Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(editor): Fix NDV close after using input select #7544

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion cypress/e2e/5-ndv.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,17 @@ describe('NDV', () => {
ndv.getters.outputDisplayMode().should('have.length.at.least', 1).and('be.visible');
});

it('should change input', () => {
it('should change input and go back to canvas', () => {
cy.createFixtureWorkflow('NDV-test-select-input.json', `NDV test select input ${uuid()}`);
workflowPage.actions.zoomToFit();
workflowPage.getters.canvasNodes().last().dblclick();
ndv.getters.inputSelect().click();
ndv.getters.inputOption().last().click();
ndv.getters.inputDataContainer().find('[class*=schema_]').should('exist');
ndv.getters.inputDataContainer().should('contain', 'start');
ndv.getters.backToCanvas().click();
ndv.getters.container().should('not.be.visible');
cy.shouldNotHaveConsoleErrors();
});

it('should show correct validation state for resource locator params', () => {
Expand Down
7 changes: 7 additions & 0 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,10 @@ Cypress.Commands.add('draganddrop', (draggableSelector, droppableSelector) => {
}
});
});

Cypress.Commands.add('shouldNotHaveConsoleErrors', () => {
cy.window().then((win) => {
const spy = cy.spy(win.console, 'error');
cy.wrap(spy).should('not.have.been.called');
});
});
1 change: 1 addition & 0 deletions cypress/support/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ declare global {
options?: { abs?: boolean; index?: number; realMouse?: boolean },
): void;
draganddrop(draggableSelector: string, droppableSelector: string): void;
shouldNotHaveConsoleErrors(): void;
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/editor-ui/src/components/NodeDetailsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ export default defineComponent({
return Math.min(this.runOutputIndex, this.maxOutputRun);
},
maxInputRun(): number {
cstuncsik marked this conversation as resolved.
Show resolved Hide resolved
if (this.inputNode === null && this.activeNode === null) {
if (this.inputNode === null || this.activeNode === null) {
return 0;
}

Expand All @@ -355,7 +355,7 @@ export default defineComponent({

const runData: IRunData | null = this.workflowRunData;

if (outputs.filter((output) => output !== NodeConnectionType.Main).length) {
if (outputs.some((output) => output !== NodeConnectionType.Main)) {
node = this.activeNode;
}

Expand Down