refactor(editor): Migrate n8nRootStore to use composition API (no-changelog) (#9770)

This commit is contained in:
Ricardo Espinoza
2024-06-18 10:15:12 -07:00
committed by GitHub
parent 653953e2bd
commit 41e06be6fd
83 changed files with 486 additions and 410 deletions

View File

@@ -27,7 +27,7 @@ import {
WORKFLOW_LM_CHAT_MODAL_KEY,
} from '@/constants';
import { useTitleChange } from '@/composables/useTitleChange';
import { useRootStore } from '@/stores/n8nRoot.store';
import { useRootStore } from '@/stores/root.store';
import { useUIStore } from '@/stores/ui.store';
import { useWorkflowsStore } from '@/stores/workflows.store';
import { openPopUpWindow } from '@/utils/executionUtils';
@@ -279,12 +279,12 @@ export function useRunWorkflow(useRunWorkflowOpts: { router: ReturnType<typeof u
if (node.type === FORM_TRIGGER_NODE_TYPE && node.typeVersion === 1) {
const webhookPath = (node.parameters.path as string) || node.webhookId;
testUrl = `${rootStore.getWebhookTestUrl}/${webhookPath}/${FORM_TRIGGER_PATH_IDENTIFIER}`;
testUrl = `${rootStore.webhookTestUrl}/${webhookPath}/${FORM_TRIGGER_PATH_IDENTIFIER}`;
}
if (node.type === FORM_TRIGGER_NODE_TYPE && node.typeVersion > 1) {
const webhookPath = (node.parameters.path as string) || node.webhookId;
testUrl = `${rootStore.getFormTestUrl}/${webhookPath}`;
testUrl = `${rootStore.formTestUrl}/${webhookPath}`;
}
if (
@@ -308,7 +308,7 @@ export function useRunWorkflow(useRunWorkflowOpts: { router: ReturnType<typeof u
const { webhookSuffix } = (node.parameters.options ?? {}) as IDataObject;
const suffix =
webhookSuffix && typeof webhookSuffix !== 'object' ? `/${webhookSuffix}` : '';
testUrl = `${rootStore.getFormWaitingUrl}/${runWorkflowApiResponse.executionId}${suffix}`;
testUrl = `${rootStore.formWaitingUrl}/${runWorkflowApiResponse.executionId}${suffix}`;
}
if (testUrl) openPopUpWindow(testUrl);