From 35fc686da66e90a7f119e3d79f3f08cc0ff67fc7 Mon Sep 17 00:00:00 2001 From: Shireen Missi Date: Fri, 8 Nov 2024 15:01:08 +0000 Subject: [PATCH] modify logic to fix e2e tests --- .../src/components/CredentialEdit/CredentialEdit.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/editor-ui/src/components/CredentialEdit/CredentialEdit.vue b/packages/editor-ui/src/components/CredentialEdit/CredentialEdit.vue index 98f66ee1af..f6689f31cc 100644 --- a/packages/editor-ui/src/components/CredentialEdit/CredentialEdit.vue +++ b/packages/editor-ui/src/components/CredentialEdit/CredentialEdit.vue @@ -89,6 +89,7 @@ const isDeleting = ref(false); const isSaving = ref(false); const isTesting = ref(false); const hasUnsavedChanges = ref(false); +const isSaved = ref(false); const loading = ref(false); const showValidationWarning = ref(false); const testedSuccessfully = ref(false); @@ -318,8 +319,8 @@ const defaultCredentialTypeName = computed(() => { const showSaveButton = computed(() => { return ( - (hasUnsavedChanges.value || !credentialId.value) && - (credentialPermissions.value.create || credentialPermissions.value.update) + (props.mode === 'new' || hasUnsavedChanges.value || isSaved.value) && + (credentialPermissions.value.create ?? credentialPermissions.value.update) ); }); @@ -828,6 +829,7 @@ async function updateCredential( isSharedWithChanged.value = false; } hasUnsavedChanges.value = false; + isSaved.value = true; if (credential) { await externalHooks.run('credential.saved', { @@ -879,6 +881,7 @@ async function deleteCredential() { isDeleting.value = true; await credentialsStore.deleteCredential({ id: credentialId.value }); hasUnsavedChanges.value = false; + isSaved.value = true; } catch (error) { toast.showError( error,