mirror of
https://github.com/n8n-io/n8n.git
synced 2024-09-11 13:15:28 +03:00
fix(editor): Load credentials for workflow before determining credentials errors (#9876)
Co-authored-by: Csaba Tuncsik <csaba.tuncsik@gmail.com>
This commit is contained in:
parent
9454a851bb
commit
4008c147d7
@ -3743,6 +3743,8 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
async initView(): Promise<void> {
|
async initView(): Promise<void> {
|
||||||
|
await this.loadCredentialsForWorkflow();
|
||||||
|
|
||||||
if (this.$route.params.action === 'workflowSave') {
|
if (this.$route.params.action === 'workflowSave') {
|
||||||
// In case the workflow got saved we do not have to run init
|
// In case the workflow got saved we do not have to run init
|
||||||
// as only the route changed but all the needed data is already loaded
|
// as only the route changed but all the needed data is already loaded
|
||||||
@ -3820,7 +3822,7 @@ export default defineComponent({
|
|||||||
await this.newWorkflow();
|
await this.newWorkflow();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await this.loadCredentials();
|
|
||||||
this.historyStore.reset();
|
this.historyStore.reset();
|
||||||
this.uiStore.nodeViewInitialized = true;
|
this.uiStore.nodeViewInitialized = true;
|
||||||
document.addEventListener('keydown', this.keyDown);
|
document.addEventListener('keydown', this.keyDown);
|
||||||
@ -4468,12 +4470,13 @@ export default defineComponent({
|
|||||||
async loadCredentialTypes(): Promise<void> {
|
async loadCredentialTypes(): Promise<void> {
|
||||||
await this.credentialsStore.fetchCredentialTypes(true);
|
await this.credentialsStore.fetchCredentialTypes(true);
|
||||||
},
|
},
|
||||||
async loadCredentials(): Promise<void> {
|
async loadCredentialsForWorkflow(): Promise<void> {
|
||||||
const workflow = this.workflowsStore.getWorkflowById(this.currentWorkflow);
|
const workflow = this.workflowsStore.getWorkflowById(this.currentWorkflow);
|
||||||
|
const workflowId = workflow?.id ?? this.$route.params.name;
|
||||||
let options: { workflowId: string } | { projectId: string };
|
let options: { workflowId: string } | { projectId: string };
|
||||||
|
|
||||||
if (workflow) {
|
if (workflowId) {
|
||||||
options = { workflowId: workflow.id };
|
options = { workflowId };
|
||||||
} else {
|
} else {
|
||||||
const queryParam =
|
const queryParam =
|
||||||
typeof this.$route.query?.projectId === 'string'
|
typeof this.$route.query?.projectId === 'string'
|
||||||
@ -4801,7 +4804,7 @@ export default defineComponent({
|
|||||||
await Promise.all([
|
await Promise.all([
|
||||||
this.loadVariables(),
|
this.loadVariables(),
|
||||||
this.tagsStore.fetchAll(),
|
this.tagsStore.fetchAll(),
|
||||||
this.loadCredentials(),
|
this.loadCredentialsForWorkflow(),
|
||||||
]);
|
]);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
Loading…
Reference in New Issue
Block a user