Skip to content

Commit

Permalink
modify logic to fix e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ShireenMissi committed Nov 8, 2024
1 parent 1a41dcc commit 35fc686
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)
);
});
Expand Down Expand Up @@ -828,6 +829,7 @@ async function updateCredential(
isSharedWithChanged.value = false;
}
hasUnsavedChanges.value = false;
isSaved.value = true;
if (credential) {
await externalHooks.run('credential.saved', {
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 35fc686

Please sign in to comment.