2022-05-23 08:56:15 -07:00
|
|
|
<template>
|
|
|
|
<RunData
|
|
|
|
:nodeUi="node"
|
|
|
|
:runIndex="runIndex"
|
|
|
|
:linkedRuns="linkedRuns"
|
|
|
|
:canLinkRuns="canLinkRuns"
|
|
|
|
:tooMuchDataTitle="$locale.baseText('ndv.output.tooMuchData.title')"
|
|
|
|
:noDataInBranchMessage="$locale.baseText('ndv.output.noOutputDataInBranch')"
|
|
|
|
:isExecuting="isNodeRunning"
|
|
|
|
:executingMessage="$locale.baseText('ndv.output.executing')"
|
|
|
|
:sessionId="sessionId"
|
2022-07-20 08:50:39 -07:00
|
|
|
:isReadOnly="isReadOnly"
|
2022-10-31 10:59:53 -07:00
|
|
|
:blockUI="blockUI"
|
2022-11-14 04:28:26 -08:00
|
|
|
:isProductionExecutionPreview="isProductionExecutionPreview"
|
2022-05-23 08:56:15 -07:00
|
|
|
paneType="output"
|
|
|
|
@runChange="onRunIndexChange"
|
|
|
|
@linkRun="onLinkRun"
|
|
|
|
@unlinkRun="onUnlinkRun"
|
2022-08-24 05:47:42 -07:00
|
|
|
@tableMounted="$emit('tableMounted', $event)"
|
2022-10-12 05:06:28 -07:00
|
|
|
@itemHover="$emit('itemHover', $event)"
|
2022-07-20 08:50:39 -07:00
|
|
|
ref="runData"
|
2022-05-23 08:56:15 -07:00
|
|
|
>
|
2022-11-18 05:59:31 -08:00
|
|
|
<template #header>
|
2022-05-23 08:56:15 -07:00
|
|
|
<div :class="$style.titleSection">
|
2022-07-20 08:50:39 -07:00
|
|
|
<span :class="$style.title">
|
|
|
|
{{ $locale.baseText(outputPanelEditMode.enabled ? 'ndv.output.edit' : 'ndv.output') }}
|
|
|
|
</span>
|
|
|
|
<RunInfo
|
|
|
|
v-if="!hasPinData && runsCount === 1"
|
|
|
|
v-show="!outputPanelEditMode.enabled"
|
|
|
|
:taskData="runTaskData"
|
|
|
|
/>
|
2022-05-23 08:56:15 -07:00
|
|
|
|
|
|
|
<n8n-info-tip
|
|
|
|
theme="warning"
|
|
|
|
type="tooltip"
|
|
|
|
tooltipPlacement="right"
|
|
|
|
v-if="hasNodeRun && staleData"
|
|
|
|
>
|
|
|
|
<template>
|
2022-07-20 08:50:39 -07:00
|
|
|
<span v-html="$locale.baseText(
|
|
|
|
hasPinData ? 'ndv.output.staleDataWarning.pinData' : 'ndv.output.staleDataWarning.regular'
|
|
|
|
)"></span>
|
2022-05-23 08:56:15 -07:00
|
|
|
</template>
|
|
|
|
</n8n-info-tip>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2022-11-18 05:59:31 -08:00
|
|
|
<template #node-not-run>
|
2022-06-20 12:39:24 -07:00
|
|
|
<n8n-text v-if="workflowRunning && !isTriggerNode">{{ $locale.baseText('ndv.output.waitingToRun') }}</n8n-text>
|
2022-07-20 08:50:39 -07:00
|
|
|
<n8n-text v-if="!workflowRunning">
|
|
|
|
{{ $locale.baseText('ndv.output.runNodeHint') }}
|
|
|
|
<span @click="insertTestData" v-if="canPinData">
|
|
|
|
<br>
|
|
|
|
{{ $locale.baseText('generic.or') }}
|
|
|
|
<n8n-text
|
|
|
|
tag="a"
|
|
|
|
size="medium"
|
|
|
|
color="primary"
|
|
|
|
>
|
|
|
|
{{ $locale.baseText('ndv.output.insertTestData') }}
|
|
|
|
</n8n-text>
|
|
|
|
</span>
|
|
|
|
</n8n-text>
|
2022-05-23 08:56:15 -07:00
|
|
|
</template>
|
|
|
|
|
2022-11-18 05:59:31 -08:00
|
|
|
<template #no-output-data>
|
2022-05-23 08:56:15 -07:00
|
|
|
<n8n-text :bold="true" color="text-dark" size="large">{{ $locale.baseText('ndv.output.noOutputData.title') }}</n8n-text>
|
|
|
|
<n8n-text>
|
|
|
|
{{ $locale.baseText('ndv.output.noOutputData.message') }}
|
|
|
|
<a @click="openSettings">{{ $locale.baseText('ndv.output.noOutputData.message.settings') }}</a>
|
|
|
|
{{ $locale.baseText('ndv.output.noOutputData.message.settingsOption') }}
|
|
|
|
</n8n-text>
|
|
|
|
</template>
|
|
|
|
|
2022-07-20 08:50:39 -07:00
|
|
|
<template #run-info v-if="!hasPinData && runsCount > 1">
|
2022-05-23 08:56:15 -07:00
|
|
|
<RunInfo :taskData="runTaskData" />
|
|
|
|
</template>
|
|
|
|
</RunData>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import { IExecutionResponse, INodeUi } from '@/Interface';
|
|
|
|
import { INodeTypeDescription, IRunData, IRunExecutionData, ITaskData } from 'n8n-workflow';
|
|
|
|
import Vue from 'vue';
|
2022-07-20 08:50:39 -07:00
|
|
|
import RunData, { EnterEditModeArgs } from './RunData.vue';
|
2022-05-23 08:56:15 -07:00
|
|
|
import RunInfo from './RunInfo.vue';
|
2022-07-20 08:50:39 -07:00
|
|
|
import { pinData } from "@/components/mixins/pinData";
|
|
|
|
import mixins from 'vue-typed-mixins';
|
2022-11-04 06:04:31 -07:00
|
|
|
import { mapStores } from 'pinia';
|
|
|
|
import { useUIStore } from '@/stores/ui';
|
|
|
|
import { useWorkflowsStore } from '@/stores/workflows';
|
|
|
|
import { useNDVStore } from '@/stores/ndv';
|
|
|
|
import { useNodeTypesStore } from '@/stores/nodeTypes';
|
2022-07-20 08:50:39 -07:00
|
|
|
|
2022-09-23 07:14:28 -07:00
|
|
|
type RunDataRef = Vue & { enterEditMode: (args: EnterEditModeArgs) => void };
|
2022-05-23 08:56:15 -07:00
|
|
|
|
2022-07-20 08:50:39 -07:00
|
|
|
export default mixins(
|
|
|
|
pinData,
|
|
|
|
).extend({
|
2022-05-23 08:56:15 -07:00
|
|
|
name: 'OutputPanel',
|
|
|
|
components: { RunData, RunInfo },
|
|
|
|
props: {
|
|
|
|
runIndex: {
|
|
|
|
type: Number,
|
|
|
|
},
|
2022-07-20 08:50:39 -07:00
|
|
|
isReadOnly: {
|
|
|
|
type: Boolean,
|
|
|
|
},
|
2022-05-23 08:56:15 -07:00
|
|
|
linkedRuns: {
|
|
|
|
type: Boolean,
|
|
|
|
},
|
|
|
|
canLinkRuns: {
|
|
|
|
type: Boolean,
|
|
|
|
},
|
|
|
|
sessionId: {
|
|
|
|
type: String,
|
|
|
|
},
|
2022-10-31 10:59:53 -07:00
|
|
|
blockUI: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
2022-11-14 04:28:26 -08:00
|
|
|
isProductionExecutionPreview: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
2022-05-23 08:56:15 -07:00
|
|
|
},
|
|
|
|
computed: {
|
2022-11-04 06:04:31 -07:00
|
|
|
...mapStores(
|
|
|
|
useNodeTypesStore,
|
|
|
|
useNDVStore,
|
|
|
|
useUIStore,
|
|
|
|
useWorkflowsStore,
|
|
|
|
),
|
|
|
|
node(): INodeUi | null {
|
|
|
|
return this.ndvStore.activeNode;
|
2022-05-23 08:56:15 -07:00
|
|
|
},
|
|
|
|
nodeType (): INodeTypeDescription | null {
|
|
|
|
if (this.node) {
|
2022-11-04 06:04:31 -07:00
|
|
|
return this.nodeTypesStore.getNodeType(this.node.type, this.node.typeVersion);
|
2022-05-23 08:56:15 -07:00
|
|
|
}
|
|
|
|
return null;
|
|
|
|
},
|
|
|
|
isTriggerNode (): boolean {
|
2022-11-04 06:04:31 -07:00
|
|
|
return this.nodeTypesStore.isTriggerNode(this.node.type);
|
2022-05-23 08:56:15 -07:00
|
|
|
},
|
|
|
|
isPollingTypeNode (): boolean {
|
|
|
|
return !!(this.nodeType && this.nodeType.polling);
|
|
|
|
},
|
|
|
|
isScheduleTrigger (): boolean {
|
|
|
|
return !!(this.nodeType && this.nodeType.group.includes('schedule'));
|
|
|
|
},
|
|
|
|
isNodeRunning(): boolean {
|
2022-11-04 06:04:31 -07:00
|
|
|
const executingNode = this.workflowsStore.executingNode;
|
2022-06-20 12:39:24 -07:00
|
|
|
return this.node && executingNode === this.node.name;
|
2022-05-23 08:56:15 -07:00
|
|
|
},
|
|
|
|
workflowRunning (): boolean {
|
2022-11-04 06:04:31 -07:00
|
|
|
return this.uiStore.isActionActive('workflowRunning');
|
2022-05-23 08:56:15 -07:00
|
|
|
},
|
|
|
|
workflowExecution(): IExecutionResponse | null {
|
2022-11-04 06:04:31 -07:00
|
|
|
return this.workflowsStore.getWorkflowExecution;
|
2022-05-23 08:56:15 -07:00
|
|
|
},
|
|
|
|
workflowRunData(): IRunData | null {
|
|
|
|
if (this.workflowExecution === null) {
|
|
|
|
return null;
|
|
|
|
}
|
2022-09-21 02:51:20 -07:00
|
|
|
const executionData: IRunExecutionData | undefined = this.workflowExecution.data;
|
|
|
|
if (!executionData || !executionData.resultData || !executionData.resultData.runData) {
|
|
|
|
return null;
|
|
|
|
}
|
2022-05-23 08:56:15 -07:00
|
|
|
return executionData.resultData.runData;
|
|
|
|
},
|
|
|
|
hasNodeRun(): boolean {
|
2022-11-04 06:04:31 -07:00
|
|
|
if (this.workflowsStore.subWorkflowExecutionError) return true;
|
feat(editor, core, cli): implement new workflow experience (#4358)
* feat(ExecuteWorkflowTrigger node): Implement ExecuteWorkflowTrigger node (#4108)
* feat(ExecuteWorkflowTrigger node): Implement ExecuteWorkflowTrigger node
* feat(editor): Do not show duplicate button if canvas contains `maxNodes` amount of nodes
* feat(ManualTrigger node): Implement ManualTrigger node (#4110)
* feat(ManualTrigger node): Implement ManualTrigger node
* :memo: Remove generics doc items from ManualTrigger node
* feat(editor-ui): Trigger tab redesign (#4150)
* :construction: Begin with TriggerPanel implementation, add Other Trigger Nodes subcategory
* :construction: Extracted categorized categories/subcategory/nodes rendering into its own component — CategorizedItems, removed SubcategoryPanel, added translations
* :sparkles: Implement MainPanel background scrim
* :recycle: Move `categoriesWithNodes`, 'visibleNodeTypes` and 'categorizedItems` to store, implemented dynamic categories count based on `selectedType`
* :bug: Fix SlideTransition for all the NodeCreato panels
* :lipstick: Fix cursos for CategoryItem and NodeItem
* :bug: Make sure ALL_NODE_FILTER is always set when MainPanel is mounted
* :art: Address PR comments
* label: Use Array type for CategorizedItems props
* :label: Add proper types for Vue props
* 🎨 Use standard component registration for CategorizedItems inside TriggerHelperPanel
* 🎨 Use kebab case for main-panel and icon component
* :label: Improve types
* feat(editor-ui): Redesign search input inside node creator panel (#4204)
* :construction: Begin with TriggerPanel implementation, add Other Trigger Nodes subcategory
* :construction: Extracted categorized categories/subcategory/nodes rendering into its own component — CategorizedItems, removed SubcategoryPanel, added translations
* :sparkles: Implement MainPanel background scrim
* :recycle: Move `categoriesWithNodes`, 'visibleNodeTypes` and 'categorizedItems` to store, implemented dynamic categories count based on `selectedType`
* :bug: Fix SlideTransition for all the NodeCreato panels
* :lipstick: Fix cursos for CategoryItem and NodeItem
* :bug: Make sure ALL_NODE_FILTER is always set when MainPanel is mounted
* :art: Address PR comments
* label: Use Array type for CategorizedItems props
* :label: Add proper types for Vue props
* 🎨 Use standard component registration for CategorizedItems inside TriggerHelperPanel
* :sparkles: Redesign search input and unify usage of categorized items
* :label: Use lowercase "Boolean" as `isSearchVisible` computed return type
* :fire: Remove useless emit
* :sparkles: Implement no result view based on subcategory, minor fixes
* :art: Remove unused properties
* feat(node-email): Change EmailReadImap display name and name (#4239)
* feat(editor-ui): Implement "Choose a Triger" action and related behaviour (#4226)
* :sparkles: Implement "Choose a Triger" action and related behaviour
* :mute: Lint fix
* :recycle: Remove PlaceholderTrigger node, add a button instead
* :art: Merge onMouseEnter and onMouseLeave to a single function
* :bulb: Add comment
* :fire: Remove PlaceholderNode registration
* :art: Rename TriggerPlaceholderButton to CanvasAddButton
* :sparkles: Add method to unregister custom action and rework CanvasAddButton centering logic
* :art: Run `setRecenteredCanvasAddButtonPosition` on `CanvasAddButton` mount
* fix(editor): Fix selecting of node from node-creator panel by clicking
* :twisted_rightwards_arrows: Merge fixes
* fix(editor): Show execute workflow trigger instead of workflow trigger in the trigger helper panel
* feat(editor): Fix node creator panel slide transition (#4261)
* fix(editor): Fix node creator panel slide-in/slide-out transitions
* :art: Fix naming
* :art: Use kebab-case for transition component name
* feat(editor): Disable execution and show notice when user tries to run workflow without enabled triggers
* fix(editor): Address first batch of new WF experience review (#4279)
* fix(editor): Fix first batch of review items
* bug(editor): Fix nodeview canvas add button centering
* :mute: Fix linter errors
* bug(ManualTrigger Node): Fix manual trigger node execution
* fix(editor): Do not show canvas add button in execution or demo mode and prevent clicking if creator is open
* fix(editor): do not show pin data tooltip for manual trigger node
* fix(editor): do not use nodeViewOffset on zoomToFit
* :lipstick: Add margin for last node creator item and set font-weight to 700 for category title
* :sparkles: Position welcome note next to the added trigger node
* :bug: Remve always true welcome note
* feat(editor): Minor UI and UX tweaks (#4328)
* :lipstick: Make top viewport buttons less prominent
* :sparkles: Allow user to switch to all tabs if it contains filter results, move nodecreator state props to its own module
* :mute: Fix linting errors
* :mute: Fix linting errors
* :mute: Fix linting errors
* chore(build): Ping Turbo version to 1.5.5
* :lipstick: Minor traigger panel and node view style changes
* :speech_balloon: Update display name of execute workflow trigger
* feat(core, editor): Update subworkflow execution logic (#4269)
* :sparkles: Implement `findWorkflowStart`
* :zap: Extend `WorkflowOperationError`
* :zap: Add `WorkflowOperationError` to toast
* :blue_book: Extend interface
* :sparkles: Add `subworkflowExecutionError` to store
* :sparkles: Create `SubworkflowOperationError`
* :zap: Render subworkflow error as node error
* :truck: Move subworkflow start validation to `cli`
* :zap: Reset subworkflow execution error state
* :fire: Remove unused import
* :zap: Adjust CLI commands
* :fire: Remove unneeded check
* :fire: Remove stray log
* :zap: Simplify syntax
* :zap: Sort in case both Start and EWT present
* :recycle: Address Omar's feedback
* :fire: Remove unneeded lint exception
* :pencil2: Fix copy
* :shirt: Fix lint
* fix: moved find start node function to catchable place
Co-authored-by: Omar Ajoue <krynble@gmail.com>
* :lipstick: Change ExecuteWorkflow node to primary
* :sparkles: Allow user to navigate to all tab if it contains search results
* :bug: Fixed canvas control button while in demo, disable workflow activation for non-activavle nodes and revert zoomToFit bottom offset
* :fix: Do not chow request text if there's results
* :speech_balloon: Update noResults text
Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
Co-authored-by: Omar Ajoue <krynble@gmail.com>
2022-10-18 05:23:22 -07:00
|
|
|
|
2022-05-23 08:56:15 -07:00
|
|
|
return Boolean(
|
|
|
|
this.node && this.workflowRunData && this.workflowRunData.hasOwnProperty(this.node.name),
|
|
|
|
);
|
|
|
|
},
|
|
|
|
runTaskData(): ITaskData | null {
|
|
|
|
if (!this.node || this.workflowExecution === null) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
const runData = this.workflowRunData;
|
|
|
|
|
|
|
|
if (runData === null || !runData.hasOwnProperty(this.node.name)) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (runData[this.node.name].length <= this.runIndex) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
return runData[this.node.name][this.runIndex];
|
|
|
|
},
|
|
|
|
runsCount(): number {
|
|
|
|
if (this.node === null) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
const runData: IRunData | null = this.workflowRunData;
|
|
|
|
|
|
|
|
if (runData === null || !runData.hasOwnProperty(this.node.name)) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (runData[this.node.name].length) {
|
|
|
|
return runData[this.node.name].length;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
},
|
|
|
|
staleData(): boolean {
|
|
|
|
if (!this.node) {
|
|
|
|
return false;
|
|
|
|
}
|
2022-11-04 06:04:31 -07:00
|
|
|
const updatedAt = this.workflowsStore.getParametersLastUpdate(this.node.name);
|
2022-05-23 08:56:15 -07:00
|
|
|
if (!updatedAt || !this.runTaskData) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
const runAt = this.runTaskData.startTime;
|
|
|
|
return updatedAt > runAt;
|
|
|
|
},
|
2022-07-20 08:50:39 -07:00
|
|
|
outputPanelEditMode(): { enabled: boolean; value: string; } {
|
2022-11-04 06:04:31 -07:00
|
|
|
return this.ndvStore.outputPanelEditMode;
|
2022-07-20 08:50:39 -07:00
|
|
|
},
|
|
|
|
canPinData(): boolean {
|
|
|
|
return this.isPinDataNodeType && !this.isReadOnly;
|
|
|
|
},
|
2022-05-23 08:56:15 -07:00
|
|
|
},
|
|
|
|
methods: {
|
2022-07-20 08:50:39 -07:00
|
|
|
insertTestData() {
|
|
|
|
if (this.$refs.runData) {
|
2022-09-23 07:14:28 -07:00
|
|
|
(this.$refs.runData as RunDataRef).enterEditMode({
|
2022-07-20 08:50:39 -07:00
|
|
|
origin: 'insertTestDataLink',
|
|
|
|
});
|
|
|
|
|
|
|
|
this.$telemetry.track('User clicked ndv link', {
|
2022-11-04 06:04:31 -07:00
|
|
|
workflow_id: this.workflowsStore.workflowId,
|
2022-07-20 08:50:39 -07:00
|
|
|
session_id: this.sessionId,
|
|
|
|
node_type: this.node.type,
|
|
|
|
pane: 'output',
|
|
|
|
type: 'insert-test-data',
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
2022-05-23 08:56:15 -07:00
|
|
|
onLinkRun() {
|
|
|
|
this.$emit('linkRun');
|
|
|
|
},
|
|
|
|
onUnlinkRun() {
|
|
|
|
this.$emit('unlinkRun');
|
|
|
|
},
|
|
|
|
openSettings() {
|
|
|
|
this.$emit('openSettings');
|
|
|
|
this.$telemetry.track('User clicked ndv link', {
|
|
|
|
node_type: this.node.type,
|
2022-11-04 06:04:31 -07:00
|
|
|
workflow_id: this.workflowsStore.workflowId,
|
2022-05-23 08:56:15 -07:00
|
|
|
session_id: this.sessionId,
|
|
|
|
pane: 'output',
|
|
|
|
type: 'settings',
|
|
|
|
});
|
|
|
|
},
|
|
|
|
onRunIndexChange(run: number) {
|
|
|
|
this.$emit('runChange', run);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" module>
|
|
|
|
.titleSection {
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
> * {
|
|
|
|
margin-right: var(--spacing-2xs);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.title {
|
|
|
|
text-transform: uppercase;
|
|
|
|
color: var(--color-text-light);
|
|
|
|
letter-spacing: 3px;
|
|
|
|
font-weight: var(--font-weight-bold);
|
|
|
|
font-size: var(--font-size-s);
|
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|