mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
feat(editor): Add item selector to expression output (#9281)
This commit is contained in:
@@ -10,6 +10,7 @@ import { useStorage } from '@/composables/useStorage';
|
||||
import {
|
||||
LOCAL_STORAGE_AUTOCOMPLETE_IS_ONBOARDED,
|
||||
LOCAL_STORAGE_MAPPING_IS_ONBOARDED,
|
||||
LOCAL_STORAGE_TABLE_HOVER_IS_ONBOARDED,
|
||||
STORES,
|
||||
} from '@/constants';
|
||||
import type { INodeExecutionData, INodeIssues } from 'n8n-workflow';
|
||||
@@ -47,6 +48,7 @@ export const useNDVStore = defineStore(STORES.NDV, {
|
||||
focusedInputPath: '',
|
||||
mappingTelemetry: {},
|
||||
hoveringItem: null,
|
||||
expressionOutputItemIndex: 0,
|
||||
draggable: {
|
||||
isDragging: false,
|
||||
type: '',
|
||||
@@ -55,6 +57,7 @@ export const useNDVStore = defineStore(STORES.NDV, {
|
||||
activeTarget: null,
|
||||
},
|
||||
isMappingOnboarded: useStorage(LOCAL_STORAGE_MAPPING_IS_ONBOARDED).value === 'true',
|
||||
isTableHoverOnboarded: useStorage(LOCAL_STORAGE_TABLE_HOVER_IS_ONBOARDED).value === 'true',
|
||||
isAutocompleteOnboarded: useStorage(LOCAL_STORAGE_AUTOCOMPLETE_IS_ONBOARDED).value === 'true',
|
||||
highlightDraggables: false,
|
||||
}),
|
||||
@@ -79,14 +82,20 @@ export const useNDVStore = defineStore(STORES.NDV, {
|
||||
return [];
|
||||
}
|
||||
|
||||
return executionData.data?.resultData?.runData?.[inputNodeName]?.[inputRunIndex]?.data
|
||||
?.main?.[inputBranchIndex];
|
||||
return (
|
||||
executionData.data?.resultData?.runData?.[inputNodeName]?.[inputRunIndex]?.data?.main?.[
|
||||
inputBranchIndex
|
||||
] ?? []
|
||||
);
|
||||
},
|
||||
ndvInputDataWithPinnedData(): INodeExecutionData[] {
|
||||
const data = this.ndvInputData;
|
||||
return this.ndvInputNodeName
|
||||
? useWorkflowsStore().pinDataByNodeName(this.ndvInputNodeName) ?? data
|
||||
: data;
|
||||
},
|
||||
hasInputData(): boolean {
|
||||
const data = this.ndvInputData;
|
||||
const pinData =
|
||||
this.ndvInputNodeName && useWorkflowsStore().pinDataByNodeName(this.ndvInputNodeName);
|
||||
return !!(data && data.length > 0) || !!(pinData && pinData.length > 0);
|
||||
return this.ndvInputDataWithPinnedData.length > 0;
|
||||
},
|
||||
getPanelDisplayMode() {
|
||||
return (panel: NodePanelType) => this[panel].displayMode;
|
||||
@@ -237,6 +246,7 @@ export const useNDVStore = defineStore(STORES.NDV, {
|
||||
this.mappingTelemetry = {};
|
||||
},
|
||||
setHoveringItem(item: null | NDVState['hoveringItem']): void {
|
||||
if (item) this.setTableHoverOnboarded();
|
||||
this.hoveringItem = item;
|
||||
},
|
||||
setNDVBranchIndex(e: { pane: 'input' | 'output'; branchIndex: number }): void {
|
||||
@@ -249,6 +259,10 @@ export const useNDVStore = defineStore(STORES.NDV, {
|
||||
this.isMappingOnboarded = true;
|
||||
useStorage(LOCAL_STORAGE_MAPPING_IS_ONBOARDED).value = 'true';
|
||||
},
|
||||
setTableHoverOnboarded() {
|
||||
this.isTableHoverOnboarded = true;
|
||||
useStorage(LOCAL_STORAGE_TABLE_HOVER_IS_ONBOARDED).value = 'true';
|
||||
},
|
||||
setAutocompleteOnboarded() {
|
||||
this.isAutocompleteOnboarded = true;
|
||||
useStorage(LOCAL_STORAGE_AUTOCOMPLETE_IS_ONBOARDED).value = 'true';
|
||||
|
||||
Reference in New Issue
Block a user