mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-14 00:24:07 -08:00
modify logic to fix e2e tests
This commit is contained in:
parent
1a41dccc1a
commit
35fc686da6
|
@ -89,6 +89,7 @@ const isDeleting = ref(false);
|
||||||
const isSaving = ref(false);
|
const isSaving = ref(false);
|
||||||
const isTesting = ref(false);
|
const isTesting = ref(false);
|
||||||
const hasUnsavedChanges = ref(false);
|
const hasUnsavedChanges = ref(false);
|
||||||
|
const isSaved = ref(false);
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const showValidationWarning = ref(false);
|
const showValidationWarning = ref(false);
|
||||||
const testedSuccessfully = ref(false);
|
const testedSuccessfully = ref(false);
|
||||||
|
@ -318,8 +319,8 @@ const defaultCredentialTypeName = computed(() => {
|
||||||
|
|
||||||
const showSaveButton = computed(() => {
|
const showSaveButton = computed(() => {
|
||||||
return (
|
return (
|
||||||
(hasUnsavedChanges.value || !credentialId.value) &&
|
(props.mode === 'new' || hasUnsavedChanges.value || isSaved.value) &&
|
||||||
(credentialPermissions.value.create || credentialPermissions.value.update)
|
(credentialPermissions.value.create ?? credentialPermissions.value.update)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -828,6 +829,7 @@ async function updateCredential(
|
||||||
isSharedWithChanged.value = false;
|
isSharedWithChanged.value = false;
|
||||||
}
|
}
|
||||||
hasUnsavedChanges.value = false;
|
hasUnsavedChanges.value = false;
|
||||||
|
isSaved.value = true;
|
||||||
|
|
||||||
if (credential) {
|
if (credential) {
|
||||||
await externalHooks.run('credential.saved', {
|
await externalHooks.run('credential.saved', {
|
||||||
|
@ -879,6 +881,7 @@ async function deleteCredential() {
|
||||||
isDeleting.value = true;
|
isDeleting.value = true;
|
||||||
await credentialsStore.deleteCredential({ id: credentialId.value });
|
await credentialsStore.deleteCredential({ id: credentialId.value });
|
||||||
hasUnsavedChanges.value = false;
|
hasUnsavedChanges.value = false;
|
||||||
|
isSaved.value = true;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
toast.showError(
|
toast.showError(
|
||||||
error,
|
error,
|
||||||
|
|
Loading…
Reference in a new issue