mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 11:01:15 +00:00
feat(editor): Expose connectionType for 'createNodeActiveChanged' hook and 'User opened nodes panel' event (no-changelog) (#15300)
This commit is contained in:
@@ -1547,6 +1547,7 @@ export type ToggleNodeCreatorOptions = {
|
|||||||
source?: NodeCreatorOpenSource;
|
source?: NodeCreatorOpenSource;
|
||||||
nodeCreatorView?: NodeFilterType;
|
nodeCreatorView?: NodeFilterType;
|
||||||
hasAddedNodes?: boolean;
|
hasAddedNodes?: boolean;
|
||||||
|
connectionType?: NodeConnectionType;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type AppliedThemeOption = 'light' | 'dark';
|
export type AppliedThemeOption = 'light' | 'dark';
|
||||||
|
|||||||
@@ -109,6 +109,7 @@ export const useNodeCreatorStore = defineStore(STORES.NODE_CREATOR, () => {
|
|||||||
setNodeCreatorState({
|
setNodeCreatorState({
|
||||||
createNodeActive: true,
|
createNodeActive: true,
|
||||||
nodeCreatorView: creatorView,
|
nodeCreatorView: creatorView,
|
||||||
|
connectionType,
|
||||||
});
|
});
|
||||||
} else if (connectionType && nodeData) {
|
} else if (connectionType && nodeData) {
|
||||||
openNodeCreatorForConnectingNode({
|
openNodeCreatorForConnectingNode({
|
||||||
@@ -130,6 +131,7 @@ export const useNodeCreatorStore = defineStore(STORES.NODE_CREATOR, () => {
|
|||||||
source,
|
source,
|
||||||
createNodeActive,
|
createNodeActive,
|
||||||
nodeCreatorView,
|
nodeCreatorView,
|
||||||
|
connectionType,
|
||||||
}: ToggleNodeCreatorOptions) {
|
}: ToggleNodeCreatorOptions) {
|
||||||
if (!nodeCreatorView) {
|
if (!nodeCreatorView) {
|
||||||
nodeCreatorView =
|
nodeCreatorView =
|
||||||
@@ -148,6 +150,7 @@ export const useNodeCreatorStore = defineStore(STORES.NODE_CREATOR, () => {
|
|||||||
void externalHooks.run('nodeView.createNodeActiveChanged', {
|
void externalHooks.run('nodeView.createNodeActiveChanged', {
|
||||||
source,
|
source,
|
||||||
mode: getMode(nodeCreatorView),
|
mode: getMode(nodeCreatorView),
|
||||||
|
connectionType,
|
||||||
createNodeActive,
|
createNodeActive,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -155,6 +158,7 @@ export const useNodeCreatorStore = defineStore(STORES.NODE_CREATOR, () => {
|
|||||||
onCreatorOpened({
|
onCreatorOpened({
|
||||||
source,
|
source,
|
||||||
mode: getMode(nodeCreatorView),
|
mode: getMode(nodeCreatorView),
|
||||||
|
connectionType,
|
||||||
workflow_id: workflowsStore.workflowId,
|
workflow_id: workflowsStore.workflowId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -195,6 +199,7 @@ export const useNodeCreatorStore = defineStore(STORES.NODE_CREATOR, () => {
|
|||||||
source: eventSource,
|
source: eventSource,
|
||||||
createNodeActive: true,
|
createNodeActive: true,
|
||||||
nodeCreatorView: isScopedConnection ? AI_UNCATEGORIZED_CATEGORY : nodeCreatorView,
|
nodeCreatorView: isScopedConnection ? AI_UNCATEGORIZED_CATEGORY : nodeCreatorView,
|
||||||
|
connectionType: type,
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO: The animation is a bit glitchy because we're updating view stack immediately
|
// TODO: The animation is a bit glitchy because we're updating view stack immediately
|
||||||
@@ -264,16 +269,19 @@ export const useNodeCreatorStore = defineStore(STORES.NODE_CREATOR, () => {
|
|||||||
function onCreatorOpened({
|
function onCreatorOpened({
|
||||||
source,
|
source,
|
||||||
mode,
|
mode,
|
||||||
|
connectionType,
|
||||||
workflow_id,
|
workflow_id,
|
||||||
}: {
|
}: {
|
||||||
source?: string;
|
source?: string;
|
||||||
mode: string;
|
mode: string;
|
||||||
|
connectionType?: NodeConnectionType;
|
||||||
workflow_id?: string;
|
workflow_id?: string;
|
||||||
}) {
|
}) {
|
||||||
resetNodesPanelSession();
|
resetNodesPanelSession();
|
||||||
trackNodeCreatorEvent('User opened nodes panel', {
|
trackNodeCreatorEvent('User opened nodes panel', {
|
||||||
source,
|
source,
|
||||||
mode,
|
mode,
|
||||||
|
connectionType,
|
||||||
workflow_id,
|
workflow_id,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import type {
|
|||||||
INodeProperties,
|
INodeProperties,
|
||||||
INodeTypeDescription,
|
INodeTypeDescription,
|
||||||
ITelemetryTrackProperties,
|
ITelemetryTrackProperties,
|
||||||
|
NodeConnectionType,
|
||||||
NodeParameterValue,
|
NodeParameterValue,
|
||||||
NodeParameterValueType,
|
NodeParameterValueType,
|
||||||
} from 'n8n-workflow';
|
} from 'n8n-workflow';
|
||||||
@@ -102,6 +103,7 @@ export interface ExternalHooks {
|
|||||||
ExternalHooksMethod<{
|
ExternalHooksMethod<{
|
||||||
source?: string;
|
source?: string;
|
||||||
mode: string;
|
mode: string;
|
||||||
|
connectionType?: NodeConnectionType;
|
||||||
createNodeActive: boolean;
|
createNodeActive: boolean;
|
||||||
}>
|
}>
|
||||||
>;
|
>;
|
||||||
|
|||||||
Reference in New Issue
Block a user