mirror of
https://github.com/enso-org/enso.git
synced 2024-12-23 10:42:05 +03:00
Top-level add-node button creates disconnected component. (#10416)
Closes #10389.
This commit is contained in:
parent
764259f36d
commit
2168cfdf6b
@ -39,16 +39,16 @@ test('Different ways of opening Component Browser', async ({ page }) => {
|
|||||||
// (+) button
|
// (+) button
|
||||||
await locate.addNewNodeButton(page).click()
|
await locate.addNewNodeButton(page).click()
|
||||||
await expectAndCancelBrowser(page, '')
|
await expectAndCancelBrowser(page, '')
|
||||||
|
// (+) button with selection (ignored)
|
||||||
|
await locate.graphNodeByBinding(page, 'final').click()
|
||||||
|
await locate.addNewNodeButton(page).click()
|
||||||
|
await expectAndCancelBrowser(page, '')
|
||||||
// Enter key
|
// Enter key
|
||||||
await locate.graphEditor(page).press('Enter')
|
await locate.graphEditor(page).press('Enter')
|
||||||
await expectAndCancelBrowser(page, '')
|
await expectAndCancelBrowser(page, '')
|
||||||
|
|
||||||
// With source node
|
// With source node
|
||||||
|
|
||||||
// (+) button
|
|
||||||
await locate.graphNodeByBinding(page, 'final').click()
|
|
||||||
await locate.addNewNodeButton(page).click()
|
|
||||||
await expectAndCancelBrowser(page, '', 'final')
|
|
||||||
// Enter key
|
// Enter key
|
||||||
await locate.graphNodeByBinding(page, 'final').click()
|
await locate.graphNodeByBinding(page, 'final').click()
|
||||||
await locate.graphEditor(page).press('Enter')
|
await locate.graphEditor(page).press('Enter')
|
||||||
@ -117,7 +117,7 @@ test('Graph Editor pans to Component Browser', async ({ page }) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('Accepting suggestion', async ({ page }) => {
|
test('Accepting suggestion', async ({ page }) => {
|
||||||
// Clicking enry
|
// Clicking entry
|
||||||
await actions.goToGraph(page)
|
await actions.goToGraph(page)
|
||||||
await locate.addNewNodeButton(page).click()
|
await locate.addNewNodeButton(page).click()
|
||||||
let nodeCount = await locate.graphNode(page).count()
|
let nodeCount = await locate.graphNode(page).count()
|
||||||
|
@ -496,6 +496,11 @@ function addNodeAuto() {
|
|||||||
createWithComponentBrowser(fromSelection() ?? { placement: { type: 'viewport' } })
|
createWithComponentBrowser(fromSelection() ?? { placement: { type: 'viewport' } })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function addNodeDisconnected() {
|
||||||
|
nodeSelection.deselectAll()
|
||||||
|
createWithComponentBrowser({ placement: { type: 'viewport' } })
|
||||||
|
}
|
||||||
|
|
||||||
function fromSelection(): NewNodeOptions | undefined {
|
function fromSelection(): NewNodeOptions | undefined {
|
||||||
if (graphStore.editedNodeInfo != null) return undefined
|
if (graphStore.editedNodeInfo != null) return undefined
|
||||||
const firstSelectedNode = set.first(nodeSelection.selected)
|
const firstSelectedNode = set.first(nodeSelection.selected)
|
||||||
@ -715,7 +720,7 @@ const groupColors = computed(() => {
|
|||||||
@collapseNodes="collapseNodes"
|
@collapseNodes="collapseNodes"
|
||||||
@removeNodes="deleteSelected"
|
@removeNodes="deleteSelected"
|
||||||
/>
|
/>
|
||||||
<PlusButton title="Add Component" @click.stop="addNodeAuto()" />
|
<PlusButton title="Add Component" @click.stop="addNodeDisconnected()" />
|
||||||
<Transition>
|
<Transition>
|
||||||
<Suspense ref="codeEditorArea">
|
<Suspense ref="codeEditorArea">
|
||||||
<CodeEditor v-if="showCodeEditor" @close="showCodeEditor = false" />
|
<CodeEditor v-if="showCodeEditor" @close="showCodeEditor = false" />
|
||||||
|
Loading…
Reference in New Issue
Block a user