mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -08:00
fix(editor): Remove template creds setup from workflow when copied (no-changelog) (#9673)
This commit is contained in:
parent
b0b4093072
commit
1e15f73b0d
|
@ -34,7 +34,7 @@ describe('Template credentials setup', () => {
|
|||
});
|
||||
cy.intercept('GET', '**/rest/settings', (req) => {
|
||||
// Disable cache
|
||||
delete req.headers['if-none-match']
|
||||
delete req.headers['if-none-match'];
|
||||
req.reply((res) => {
|
||||
if (res.body.data) {
|
||||
// Disable custom templates host if it has been overridden by another intercept
|
||||
|
@ -117,6 +117,7 @@ describe('Template credentials setup', () => {
|
|||
const workflow = JSON.parse(workflowJSON);
|
||||
|
||||
expect(workflow.meta).to.haveOwnProperty('templateId', testTemplate.id.toString());
|
||||
expect(workflow.meta).not.to.haveOwnProperty('templateCredsSetupCompleted');
|
||||
workflow.nodes.forEach((node: any) => {
|
||||
expect(Object.keys(node.credentials ?? {})).to.have.lengthOf(1);
|
||||
});
|
||||
|
|
|
@ -260,7 +260,7 @@ export interface IWorkflowDataUpdate {
|
|||
}
|
||||
|
||||
export interface IWorkflowToShare extends IWorkflowDataUpdate {
|
||||
meta?: WorkflowMetadata;
|
||||
meta: WorkflowMetadata;
|
||||
}
|
||||
|
||||
export interface NewWorkflowResponse {
|
||||
|
|
|
@ -403,7 +403,7 @@ async function onWorkflowMenuSelect(action: WORKFLOW_MENU_ACTIONS): Promise<void
|
|||
const exportData: IWorkflowToShare = {
|
||||
...data,
|
||||
meta: {
|
||||
...(props.workflow.meta ?? {}),
|
||||
...props.workflow.meta,
|
||||
instanceId: rootStore.instanceId,
|
||||
},
|
||||
tags: (tags ?? []).map((tagId) => {
|
||||
|
|
|
@ -1997,12 +1997,14 @@ export default defineComponent({
|
|||
void this.getNodesToSave(nodes).then((data) => {
|
||||
const workflowToCopy: IWorkflowToShare = {
|
||||
meta: {
|
||||
...(this.workflowsStore.workflow.meta ?? {}),
|
||||
...this.workflowsStore.workflow.meta,
|
||||
instanceId: this.rootStore.instanceId,
|
||||
},
|
||||
...data,
|
||||
};
|
||||
|
||||
delete workflowToCopy.meta.templateCredsSetupCompleted;
|
||||
|
||||
this.workflowHelpers.removeForeignCredentialsFromWorkflow(
|
||||
workflowToCopy,
|
||||
this.credentialsStore.allCredentials,
|
||||
|
|
Loading…
Reference in a new issue