feat: Add onboarding flow (#7212)

Github issue / Community forum post (link here to close automatically):
This commit is contained in:
Mutasem Aldmour
2023-09-25 15:49:36 +02:00
committed by GitHub
parent 60c152dc72
commit 01e9340621
22 changed files with 1373 additions and 18 deletions

View File

@@ -1,6 +1,7 @@
import { defineStore } from 'pinia';
import { STORES } from '@/constants';
import type {
INodeUi,
ITemplatesCategory,
ITemplatesCollection,
ITemplatesCollectionFull,
@@ -19,6 +20,7 @@ import {
getWorkflows,
getWorkflowTemplate,
} from '@/api/templates';
import { getFixedNodesList } from '@/utils/nodeViewUtils';
const TEMPLATES_PAGE_SIZE = 10;
@@ -332,5 +334,19 @@ export const useTemplatesStore = defineStore(STORES.TEMPLATES, {
const versionCli: string = settingsStore.versionCli;
return getWorkflowTemplate(apiEndpoint, templateId, { 'n8n-version': versionCli });
},
async getFixedWorkflowTemplate(templateId: string): Promise<IWorkflowTemplate | undefined> {
const template = await this.getWorkflowTemplate(templateId);
if (template?.workflow?.nodes) {
template.workflow.nodes = getFixedNodesList(template.workflow.nodes) as INodeUi[];
template.workflow.nodes?.forEach((node) => {
if (node.credentials) {
delete node.credentials;
}
});
}
return template;
},
},
});