Skip to content

Commit 0a243c4

Browse files
authored
Merge pull request #416 from bcgov/bugfix/intake-navigation
Fixed Navigation Guard Issue
2 parents 608f8b2 + 1639527 commit 0a243c4

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

frontend/src/components/form/FormNavigationGuard.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const { autoSaveRef = null, callback = () => {} } = defineProps<{
1515
}>();
1616
1717
// State
18+
const isAccepted: Ref<boolean> = ref(false);
1819
const isDirty = useIsFormDirty();
1920
const isOpen: Ref<boolean> = ref(false);
2021
@@ -25,6 +26,9 @@ const router = useRouter();
2526
onBeforeRouteLeave(async (to) => {
2627
autoSaveRef?.stopAutoSave();
2728
29+
// Skip navigation guard if already accepted
30+
if (isAccepted.value) return true;
31+
2832
if (isDirty.value && !isOpen.value) {
2933
isOpen.value = true;
3034
confirm.require({
@@ -35,6 +39,7 @@ onBeforeRouteLeave(async (to) => {
3539
rejectLabel: 'Cancel',
3640
rejectProps: { outlined: true },
3741
accept: async () => {
42+
isAccepted.value = true;
3843
await callback();
3944
router.replace(to);
4045
},

frontend/src/components/projectCommon/submission/ProjectTeamTab.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ function onRevokeUserClick(contact: ActivityContact) {
123123
<div class="basis-1/6">
124124
<div class="flex justify-end">
125125
<Button
126-
:label="t('e.common.projectTeamTab.addUserBtn')"
126+
:label="t('e.common.projectTeamTab.addMemberBtn')"
127127
icon="pi pi-plus"
128128
outlined
129129
@click="createUserModalVisible = true"

frontend/src/locales/en-CA.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"save": "Save"
7272
},
7373
"projectTeamTab": {
74-
"addUserBtn": "Add user",
74+
"addMemberBtn": "Add team member",
7575
"adminAdded": "{first} {last} has been added as a Project Admin.",
7676
"adminUpdated": "{first} {last} is now a Project Admin.",
7777
"failedToAdd": "Failed to add user",

0 commit comments

Comments
 (0)