mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
feat: Add save confirmation modal when leaving sharing modal (#4683)
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
:eventBus="modalBus"
|
||||
:name="WORKFLOW_SHARE_MODAL_KEY"
|
||||
:center="true"
|
||||
:beforeClose="onCloseModal"
|
||||
>
|
||||
<template #content>
|
||||
<div :class="$style.container">
|
||||
@@ -242,6 +243,25 @@ export default mixins(
|
||||
this.onRemoveSharee(user.id);
|
||||
}
|
||||
},
|
||||
async onCloseModal() {
|
||||
if (this.isDirty) {
|
||||
const shouldSave = await this.confirmMessage(
|
||||
this.$locale.baseText(
|
||||
'workflows.shareModal.saveBeforeClose.message',
|
||||
),
|
||||
this.$locale.baseText('workflows.shareModal.saveBeforeClose.title'),
|
||||
'warning',
|
||||
this.$locale.baseText('workflows.shareModal.saveBeforeClose.confirmButtonText'),
|
||||
this.$locale.baseText('workflows.shareModal.saveBeforeClose.cancelButtonText'),
|
||||
);
|
||||
|
||||
if (shouldSave) {
|
||||
return await this.onSave();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
},
|
||||
async loadUsers() {
|
||||
await this.usersStore.fetchUsers();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user