Skip to content

Commit

Permalink
feat(editor): Update Sub-Workflow Debugging Copy (n8n-io#12483)
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlieKolb authored Jan 7, 2025
1 parent cc008f9 commit 04e2928
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 17 deletions.
8 changes: 4 additions & 4 deletions cypress/e2e/47-subworkflow-debugging.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('Subworkflow debugging', () => {
openNode('Execute Workflow with param');

getOutputPanelItemsCount().should('contain.text', '2 items, 1 sub-execution');
getOutputPanelRelatedExecutionLink().should('contain.text', 'Inspect Sub-Execution');
getOutputPanelRelatedExecutionLink().should('contain.text', 'View sub-execution');
getOutputPanelRelatedExecutionLink().should('have.attr', 'href');

// ensure workflow executed and waited on output
Expand All @@ -64,7 +64,7 @@ describe('Subworkflow debugging', () => {
openNode('Execute Workflow with param2');

getOutputPanelItemsCount().should('not.exist');
getOutputPanelRelatedExecutionLink().should('contain.text', 'Inspect Sub-Execution');
getOutputPanelRelatedExecutionLink().should('contain.text', 'View sub-execution');
getOutputPanelRelatedExecutionLink().should('have.attr', 'href');

// ensure workflow executed but returned same data as input
Expand Down Expand Up @@ -109,7 +109,7 @@ describe('Subworkflow debugging', () => {
openNode('Execute Workflow with param');

getOutputPanelItemsCount().should('contain.text', '2 items, 1 sub-execution');
getOutputPanelRelatedExecutionLink().should('contain.text', 'Inspect Sub-Execution');
getOutputPanelRelatedExecutionLink().should('contain.text', 'View sub-execution');
getOutputPanelRelatedExecutionLink().should('have.attr', 'href');

// ensure workflow executed and waited on output
Expand All @@ -125,7 +125,7 @@ describe('Subworkflow debugging', () => {

getExecutionPreviewOutputPanelRelatedExecutionLink().should(
'include.text',
'Inspect Parent Execution',
'View parent execution',
);

getExecutionPreviewOutputPanelRelatedExecutionLink()
Expand Down
8 changes: 4 additions & 4 deletions packages/editor-ui/src/components/RunData.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ describe('RunData', () => {
});

expect(getByTestId('related-execution-link')).toBeInTheDocument();
expect(getByTestId('related-execution-link')).toHaveTextContent('Inspect Sub-Execution 123');
expect(getByTestId('related-execution-link')).toHaveTextContent('View sub-execution');
expect(resolveRelatedExecutionUrl).toHaveBeenCalledWith(metadata);
expect(getByTestId('related-execution-link')).toHaveAttribute('href', MOCK_EXECUTION_URL);

Expand Down Expand Up @@ -311,7 +311,7 @@ describe('RunData', () => {
});

expect(getByTestId('related-execution-link')).toBeInTheDocument();
expect(getByTestId('related-execution-link')).toHaveTextContent('Inspect Parent Execution 123');
expect(getByTestId('related-execution-link')).toHaveTextContent('View parent execution');
expect(resolveRelatedExecutionUrl).toHaveBeenCalledWith(metadata);
expect(getByTestId('related-execution-link')).toHaveAttribute('href', MOCK_EXECUTION_URL);

Expand Down Expand Up @@ -344,7 +344,7 @@ describe('RunData', () => {
});

expect(getByTestId('related-execution-link')).toBeInTheDocument();
expect(getByTestId('related-execution-link')).toHaveTextContent('Inspect Sub-Execution 123');
expect(getByTestId('related-execution-link')).toHaveTextContent('View sub-execution 123');
expect(resolveRelatedExecutionUrl).toHaveBeenCalledWith(metadata);
expect(getByTestId('related-execution-link')).toHaveAttribute('href', MOCK_EXECUTION_URL);

Expand Down Expand Up @@ -389,7 +389,7 @@ describe('RunData', () => {
});

expect(getByTestId('related-execution-link')).toBeInTheDocument();
expect(getByTestId('related-execution-link')).toHaveTextContent('Inspect Sub-Execution 123');
expect(getByTestId('related-execution-link')).toHaveTextContent('View sub-execution 123');

expect(queryByTestId('ndv-items-count')).not.toBeInTheDocument();
expect(getByTestId('run-selector')).toBeInTheDocument();
Expand Down
10 changes: 7 additions & 3 deletions packages/editor-ui/src/components/RunData.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1263,9 +1263,13 @@ function getExecutionLinkLabel(task: ITaskMetadata): string | undefined {
}
if (task.subExecution) {
return i18n.baseText('runData.openSubExecution', {
interpolate: { id: task.subExecution.executionId },
});
if (activeTaskMetadata.value?.subExecutionsCount === 1) {
return i18n.baseText('runData.openSubExecutionSingle');
} else {
return i18n.baseText('runData.openSubExecutionWithId', {
interpolate: { id: task.subExecution.executionId },
});
}
}
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ const outputError = computed(() => {
>
<N8nIcon icon="external-link-alt" size="xsmall" />
{{
i18n.baseText('runData.openSubExecution', {
i18n.baseText('runData.openSubExecutionWithId', {
interpolate: {
id: runMeta.subExecution?.executionId,
},
Expand Down
4 changes: 2 additions & 2 deletions packages/editor-ui/src/components/RunDataTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ watch(focusedMappableInput, (curr) => {
>
<N8nTooltip
:content="
i18n.baseText('runData.table.inspectSubExecution', {
i18n.baseText('runData.table.viewSubExecution', {
interpolate: {
id: `${tableData.metadata.data[index1]?.subExecution.executionId}`,
},
Expand Down Expand Up @@ -575,7 +575,7 @@ watch(focusedMappableInput, (curr) => {
>
<N8nTooltip
:content="
i18n.baseText('runData.table.inspectSubExecution', {
i18n.baseText('runData.table.viewSubExecution', {
interpolate: {
id: `${tableData.metadata.data[index1]?.subExecution.executionId}`,
},
Expand Down
7 changes: 4 additions & 3 deletions packages/editor-ui/src/plugins/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1600,8 +1600,9 @@
"resourceMapper.staleDataWarning.notice": "Refresh to see the updated fields",
"resourceMapper.attemptToConvertTypes.displayName": "Attempt to convert types",
"resourceMapper.attemptToConvertTypes.description": "Attempt to convert types when mapping fields",
"runData.openSubExecution": "Inspect Sub-Execution {id}",
"runData.openParentExecution": "Inspect Parent Execution {id}",
"runData.openSubExecutionSingle": "View sub-execution",
"runData.openSubExecutionWithId": "View sub-execution {id}",
"runData.openParentExecution": "View parent execution {id}",
"runData.emptyItemHint": "This is an item, but it's empty.",
"runData.emptyArray": "[empty array]",
"runData.emptyString": "[empty]",
Expand Down Expand Up @@ -1649,7 +1650,7 @@
"runData.showBinaryData": "View",
"runData.startTime": "Start Time",
"runData.table": "Table",
"runData.table.inspectSubExecution": "Inspect sub-execution {id}",
"runData.table.viewSubExecution": "View sub-execution {id}",
"runData.pindata.learnMore": "Learn more",
"runData.pindata.thisDataIsPinned": "This data is pinned.",
"runData.pindata.unpin": "Unpin",
Expand Down

0 comments on commit 04e2928

Please sign in to comment.