review update

This commit is contained in:
Michael Kret 2024-09-19 17:06:20 +03:00
parent 548907e529
commit 0572977364
5 changed files with 34 additions and 20 deletions

View file

@ -153,11 +153,7 @@ const hasNodeRun = computed(() => {
}); });
const runTaskData = computed(() => { const runTaskData = computed(() => {
if ( if (!node.value || workflowExecution.value === null) {
!node.value ||
workflowExecution.value === null ||
workflowExecution.value.status === 'waiting'
) {
return null; return null;
} }
@ -214,6 +210,16 @@ const canPinData = computed(() => {
// Methods // Methods
const waitingNodeMessage = (resume: string) => {
if (resume === 'form') {
return i18n.baseText('ndv.output.waitNodeWaitingForFormSubmission');
}
if (resume === 'webhook') {
return i18n.baseText('ndv.output.waitNodeWaitingForWebhook');
}
return i18n.baseText('ndv.output.waitNodeWaiting');
};
const insertTestData = () => { const insertTestData = () => {
if (!runDataRef.value) return; if (!runDataRef.value) return;
@ -352,6 +358,13 @@ const activatePane = () => {
</n8n-text> </n8n-text>
</template> </template>
<template #node-waiting>
<n8n-text :bold="true" color="text-dark" size="large">Waiting for input</n8n-text>
<n8n-text>
{{ waitingNodeMessage(node?.parameters?.resume as string) }}
</n8n-text>
</template>
<template #no-output-data> <template #no-output-data>
<n8n-text :bold="true" color="text-dark" size="large">{{ <n8n-text :bold="true" color="text-dark" size="large">{{
$locale.baseText('ndv.output.noOutputData.title') $locale.baseText('ndv.output.noOutputData.title')

View file

@ -40,6 +40,7 @@ import {
MAX_DISPLAY_ITEMS_AUTO_ALL, MAX_DISPLAY_ITEMS_AUTO_ALL,
TEST_PIN_DATA, TEST_PIN_DATA,
HTML_NODE_TYPE, HTML_NODE_TYPE,
WAIT_NODE_TYPE,
} from '@/constants'; } from '@/constants';
import BinaryDataDisplay from '@/components/BinaryDataDisplay.vue'; import BinaryDataDisplay from '@/components/BinaryDataDisplay.vue';
@ -218,6 +219,14 @@ export default defineComponent({
isReadOnlyRoute() { isReadOnlyRoute() {
return this.$route?.meta?.readOnlyCanvas === true; return this.$route?.meta?.readOnlyCanvas === true;
}, },
isWaitNodeWaiting() {
return (
this.hasNodeRun &&
this.workflowExecution?.status === 'waiting' &&
this.node?.type === WAIT_NODE_TYPE &&
this.workflowExecution?.data?.resultData?.lastNodeExecuted === this.node?.name
);
},
activeNode(): INodeUi | null { activeNode(): INodeUi | null {
return this.ndvStore.activeNode; return this.ndvStore.activeNode;
}, },
@ -1501,6 +1510,10 @@ export default defineComponent({
</n8n-text> </n8n-text>
</div> </div>
<div v-else-if="isWaitNodeWaiting" :class="$style.center">
<slot name="node-waiting">xxx</slot>
</div>
<div v-else-if="hasNodeRun && !inputData.length && !search" :class="$style.center"> <div v-else-if="hasNodeRun && !inputData.length && !search" :class="$style.center">
<slot name="no-output-data">xxx</slot> <slot name="no-output-data">xxx</slot>
</div> </div>

View file

@ -325,13 +325,6 @@ export function usePushConnection({ router }: { router: ReturnType<typeof useRou
// Workflow did start but had been put to wait // Workflow did start but had been put to wait
titleChange.titleSet(workflow.name as string, 'IDLE'); titleChange.titleSet(workflow.name as string, 'IDLE');
toast.showToast({
title: 'Workflow started waiting',
message: `${action} <a href="https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.wait/" target="_blank">More info</a>`,
type: 'success',
duration: 0,
dangerouslyUseHTMLString: true,
});
} else if (runDataExecuted.finished !== true) { } else if (runDataExecuted.finished !== true) {
titleChange.titleSet(workflow.name as string, 'ERROR'); titleChange.titleSet(workflow.name as string, 'ERROR');

View file

@ -955,6 +955,9 @@
"ndv.output.run": "Run", "ndv.output.run": "Run",
"ndv.output.runNodeHint": "Execute this node to view data", "ndv.output.runNodeHint": "Execute this node to view data",
"ndv.output.runNodeHintSubNode": "Output will appear here once the parent node is run", "ndv.output.runNodeHintSubNode": "Output will appear here once the parent node is run",
"ndv.output.waitNodeWaitingForWebhook": "Execution will continue when webhook is received",
"ndv.output.waitNodeWaitingForFormSubmission": "Execution will continue when form is submitted",
"ndv.output.waitNodeWaiting": "Execution will continue when wait time is over",
"ndv.output.insertTestData": "set mock data", "ndv.output.insertTestData": "set mock data",
"ndv.output.staleDataWarning.regular": "Node parameters have changed.<br>Test node again to refresh output.", "ndv.output.staleDataWarning.regular": "Node parameters have changed.<br>Test node again to refresh output.",
"ndv.output.staleDataWarning.pinData": "Node parameter changes will not affect pinned output data.", "ndv.output.staleDataWarning.pinData": "Node parameter changes will not affect pinned output data.",

View file

@ -238,14 +238,6 @@ export class Wait extends Webhook {
inputs: [NodeConnectionType.Main], inputs: [NodeConnectionType.Main],
outputs: [NodeConnectionType.Main], outputs: [NodeConnectionType.Main],
credentials: credentialsProperty(this.authPropertyName), credentials: credentialsProperty(this.authPropertyName),
hints: [
{
message:
"When testing your workflow using the Editor UI, you can't see the rest of the execution following the Wait node. To inspect the execution results, enable Save Manual Executions in your Workflow settings so you can review the execution results there.",
location: 'outputPane',
whenToDisplay: 'beforeExecution',
},
],
webhooks: [ webhooks: [
{ {
...defaultWebhookDescription, ...defaultWebhookDescription,