Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions frontend/src/components/form/FormNavigationGuard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const { autoSaveRef = null, callback = () => {} } = defineProps<{
}>();

// State
const isAccepted: Ref<boolean> = ref(false);
const isDirty = useIsFormDirty();
const isOpen: Ref<boolean> = ref(false);

Expand All @@ -25,6 +26,9 @@ const router = useRouter();
onBeforeRouteLeave(async (to) => {
autoSaveRef?.stopAutoSave();

// Skip navigation guard if already accepted
if (isAccepted.value) return true;

if (isDirty.value && !isOpen.value) {
isOpen.value = true;
confirm.require({
Expand All @@ -35,6 +39,7 @@ onBeforeRouteLeave(async (to) => {
rejectLabel: 'Cancel',
rejectProps: { outlined: true },
accept: async () => {
isAccepted.value = true;
await callback();
router.replace(to);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ function onRevokeUserClick(contact: ActivityContact) {
<div class="basis-1/6">
<div class="flex justify-end">
<Button
:label="t('e.common.projectTeamTab.addUserBtn')"
:label="t('e.common.projectTeamTab.addMemberBtn')"
icon="pi pi-plus"
outlined
@click="createUserModalVisible = true"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/locales/en-CA.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"save": "Save"
},
"projectTeamTab": {
"addUserBtn": "Add user",
"addMemberBtn": "Add team member",
"adminAdded": "{first} {last} has been added as a Project Admin.",
"adminUpdated": "{first} {last} is now a Project Admin.",
"failedToAdd": "Failed to add user",
Expand Down