fix: Fetch credentials on workflows view to include in duplicated workflows (#5532)

fix: fetch credentials on workflows view to include in duplicated workflows
This commit is contained in:
Alex Grozav 2023-03-09 14:23:38 +02:00 committed by GitHub
parent 71c349b071
commit 493f7a1c92
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -137,6 +137,7 @@ import { useUIStore } from '@/stores/ui';
import { useSettingsStore } from '@/stores/settings';
import { useUsersStore } from '@/stores/users';
import { useWorkflowsStore } from '@/stores/workflows';
import { useCredentialsStore } from '@/stores/credentials';
import { usePostHog } from '@/stores/posthog';
type IResourcesListLayoutInstance = Vue & { sendFiltersTelemetry: (source: string) => void };
@ -170,7 +171,13 @@ const WorkflowsView = mixins(showMessage, debounceHelper).extend({
};
},
computed: {
...mapStores(useSettingsStore, useUIStore, useUsersStore, useWorkflowsStore),
...mapStores(
useSettingsStore,
useUIStore,
useUsersStore,
useWorkflowsStore,
useCredentialsStore,
),
currentUser(): IUser {
return this.usersStore.currentUser || ({} as IUser);
},
@ -229,6 +236,8 @@ const WorkflowsView = mixins(showMessage, debounceHelper).extend({
this.workflowsStore.fetchActiveWorkflows(),
]);
this.credentialsStore.fetchAllCredentials();
// If the user has no workflows and is not participating in the demo experiment,
// redirect to the new workflow view
if (!this.isDemoTest && this.allWorkflows.length === 0) {