mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-26 05:04:05 -08:00
feat: Add save confirmation modal when leaving sharing modal (#4683)
This commit is contained in:
parent
249b7eba15
commit
173badc4e0
|
@ -5,6 +5,7 @@
|
||||||
:eventBus="modalBus"
|
:eventBus="modalBus"
|
||||||
:name="WORKFLOW_SHARE_MODAL_KEY"
|
:name="WORKFLOW_SHARE_MODAL_KEY"
|
||||||
:center="true"
|
:center="true"
|
||||||
|
:beforeClose="onCloseModal"
|
||||||
>
|
>
|
||||||
<template #content>
|
<template #content>
|
||||||
<div :class="$style.container">
|
<div :class="$style.container">
|
||||||
|
@ -242,6 +243,25 @@ export default mixins(
|
||||||
this.onRemoveSharee(user.id);
|
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() {
|
async loadUsers() {
|
||||||
await this.usersStore.fetchUsers();
|
await this.usersStore.fetchUsers();
|
||||||
},
|
},
|
||||||
|
|
|
@ -1378,6 +1378,10 @@
|
||||||
"workflows.shareModal.list.delete.confirm.message": "<strong>This might cause the workflow to stop working:</strong> if {name} is the only user with access to credentials used in this workflow, those credentials will also be removed from {workflow}.",
|
"workflows.shareModal.list.delete.confirm.message": "<strong>This might cause the workflow to stop working:</strong> if {name} is the only user with access to credentials used in this workflow, those credentials will also be removed from {workflow}.",
|
||||||
"workflows.shareModal.list.delete.confirm.confirmButtonText": "Remove access",
|
"workflows.shareModal.list.delete.confirm.confirmButtonText": "Remove access",
|
||||||
"workflows.shareModal.list.delete.confirm.cancelButtonText": "Cancel",
|
"workflows.shareModal.list.delete.confirm.cancelButtonText": "Cancel",
|
||||||
|
"workflows.shareModal.saveBeforeClose.title": "Save sharing changes?",
|
||||||
|
"workflows.shareModal.saveBeforeClose.message": "You have unsaved changes. Do you want to save them before closing?",
|
||||||
|
"workflows.shareModal.saveBeforeClose.confirmButtonText": "Save",
|
||||||
|
"workflows.shareModal.saveBeforeClose.cancelButtonText": "Close without saving",
|
||||||
"workflows.shareModal.save": "Save",
|
"workflows.shareModal.save": "Save",
|
||||||
"workflows.shareModal.changesHint": "You made changes",
|
"workflows.shareModal.changesHint": "You made changes",
|
||||||
"workflows.shareModal.notAvailable": "Sharing workflows with others is currently available only on n8n cloud, our hosted offering.",
|
"workflows.shareModal.notAvailable": "Sharing workflows with others is currently available only on n8n cloud, our hosted offering.",
|
||||||
|
|
Loading…
Reference in a new issue