From 5a715a2fc4c96e3089c3d5167678ccd0c6c3aaf3 Mon Sep 17 00:00:00 2001 From: Shireen Missi Date: Wed, 30 Oct 2024 11:47:39 +0000 Subject: [PATCH] harmonies node statuses Co-authored-by: Federico Meini --- packages/editor-ui/src/components/RunData.vue | 144 +++++++++++++----- .../nodes/render-types/CanvasNodeDefault.vue | 20 +++ .../parts/CanvasNodeSettingsIcons.vue | 99 ++++++++++++ .../parts/CanvasNodeStatusIcons.vue | 6 + .../src/plugins/i18n/locales/en.json | 2 +- packages/editor-ui/src/plugins/icons/index.ts | 6 + 6 files changed, 240 insertions(+), 37 deletions(-) create mode 100644 packages/editor-ui/src/components/canvas/elements/nodes/render-types/parts/CanvasNodeSettingsIcons.vue diff --git a/packages/editor-ui/src/components/RunData.vue b/packages/editor-ui/src/components/RunData.vue index 1c2d0b78a6..3ac1f204a8 100644 --- a/packages/editor-ui/src/components/RunData.vue +++ b/packages/editor-ui/src/components/RunData.vue @@ -64,6 +64,8 @@ import { useSourceControlStore } from '@/stores/sourceControl.store'; import { useRootStore } from '@/stores/root.store'; import RunDataPinButton from '@/components/RunDataPinButton.vue'; import { getGenericHints } from '@/utils/nodeViewUtils'; +import { retry } from '../__tests__/utils'; +import { continueOnFail } from '../../../core/src/NodeExecuteFunctions'; const LazyRunDataTable = defineAsyncComponent( async () => await import('@/components/RunDataTable.vue'), @@ -727,6 +729,69 @@ export default defineComponent({ return []; }, + getNodeSettingsHints(): NodeHint[] { + const hints: NodeHint[] = []; + if (this.node?.disabled) { + return [ + { + message: 'This node is disabled, and will simply pass the input through.', + type: 'info', + whenToDisplay: 'beforeExecution', + location: 'outputPane', + icon: 'ban', + }, + ]; + } + if ( + this.canPinData && + this.pinnedData.hasData.value && + !this.editMode.enabled && + !this.isProductionExecutionPreview + ) { + return []; + } + if (this.node && this.node.alwaysOutputData) { + hints.push({ + message: 'This node will output an empty item if nothing would normally be returned.', + type: 'info', + whenToDisplay: 'beforeExecution', + location: 'outputPane', + icon: 'circle', + }); + } + if (this.node && this.node.executeOnce) { + hints.push({ + message: 'This node will execute only once, no matter how many input items there are.', + type: 'info', + whenToDisplay: 'beforeExecution', + location: 'outputPane', + icon: 'dice-one', + }); + } + if (this.node && this.node.retryOnFail) { + hints.push({ + message: 'This node will automatically retry if it fails.', + type: 'info', + whenToDisplay: 'beforeExecution', + location: 'outputPane', + icon: 'retweet', + }); + } + if ( + this.node && + (this.node.onError === 'continueRegularOutput' || + this.node.onError === 'continueErrorOutput') + ) { + hints.push({ + message: 'The workflow will continue executing even if the node fails.', + type: 'info', + whenToDisplay: 'beforeExecution', + location: 'outputPane', + icon: 'arrow-right', + }); + } + return hints; + }, onItemHover(itemIndex: number | null) { if (itemIndex === null) { this.$emit('itemHover', null); @@ -1208,41 +1273,6 @@ export default defineComponent({