fix(editor): Load appropriate credentials in canvas V2 for new workflow (#12722)
Some checks are pending
Test Master / install-and-build (push) Waiting to run
Test Master / Unit tests (18.x) (push) Blocked by required conditions
Test Master / Unit tests (20.x) (push) Blocked by required conditions
Test Master / Unit tests (22.4) (push) Blocked by required conditions
Test Master / Lint (push) Blocked by required conditions
Test Master / Notify Slack on failure (push) Blocked by required conditions

This commit is contained in:
Csaba Tuncsik 2025-01-23 11:01:10 +01:00 committed by GitHub
parent 1f43181360
commit 2020dc502f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -349,6 +349,8 @@ async function initializeRoute(force = false) {
if (!isAlreadyInitialized) {
historyStore.reset();
await loadCredentials();
// If there is no workflow id, treat it as a new workflow
if (isNewWorkflowRoute.value || !workflowId.value) {
if (route.meta?.nodeView === true) {
@ -359,8 +361,6 @@ async function initializeRoute(force = false) {
await initializeWorkspaceForExistingWorkflow(workflowId.value);
await loadCredentials();
void nextTick(() => {
nodeHelpers.updateNodesInputIssues();
nodeHelpers.updateNodesCredentialsIssues();
@ -820,8 +820,8 @@ function onClickNodeAdd(source: string, sourceHandle: string) {
async function loadCredentials() {
let options: { workflowId: string } | { projectId: string };
if (editableWorkflow.value) {
options = { workflowId: editableWorkflow.value.id };
if (workflowId.value) {
options = { workflowId: workflowId.value };
} else {
const queryParam =
typeof route.query?.projectId === 'string' ? route.query?.projectId : undefined;