Skip to content

Commit

Permalink
update settigs form back link label and url (#905)
Browse files Browse the repository at this point in the history
  • Loading branch information
bellangerq authored Dec 11, 2024
1 parent 6ef469f commit b0a162b
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions confiture-web-app/src/components/audit/AuditSettingsForm.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<script lang="ts" setup>
import { nextTick, ref, toRaw, watch } from "vue";
import { computed, nextTick, ref, toRaw, watch } from "vue";
import { useRoute } from "vue-router";
import { usePreviousRoute } from "../../composables/usePreviousRoute";
import { useAccountStore } from "../../store/account";
import { AuditPage, AuditType, CreateAuditRequestData } from "../../types";
import { formatEmail } from "../../utils";
Expand Down Expand Up @@ -58,6 +59,7 @@ const audits = [
];
const route = useRoute();
const previousRoute = usePreviousRoute();
const accountStore = useAccountStore();
const auditType = ref(props.audit?.auditType);
Expand Down Expand Up @@ -93,13 +95,23 @@ watch(
},
{ deep: true }
);
const backLinkLabel = computed(() => {
switch (previousRoute.route?.name) {
case "account-dashboard":
return "Retourner à mes audits";
case "audit-overview":
return "Retourner au tableau de bord de l’audit";
default:
return "Retourner à mon audit";
}
});
</script>

<template>
<BackLink
label="Retourner à mon audit"
:label="backLinkLabel"
:to="{
name: 'audit-generation',
name: previousRoute.route?.name || 'audit-overview',
params: { uniqueId: route.params.uniqueId }
}"
/>
Expand Down

0 comments on commit b0a162b

Please sign in to comment.