Skip to content

Commit

Permalink
remove help alert on report page (#602)
Browse files Browse the repository at this point in the history
  • Loading branch information
bellangerq authored Jan 10, 2024
1 parent 953cabf commit 02580ac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 34 deletions.
6 changes: 2 additions & 4 deletions confiture-web-app/src/components/report/OnboardingModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const props = defineProps<{
}>();
const emit = defineEmits<{
(e: "close", confirmed: boolean): void;
(e: "close"): void;
}>();
const modal = ref<InstanceType<typeof DsfrModal>>();
Expand Down Expand Up @@ -59,15 +59,13 @@ const steps = computed(() => [
const currentStep = ref(0);
const contentEl = ref<HTMLDivElement>();
const confirmed = ref(false);
const previousStep = () => {
currentStep.value = Math.max(0, currentStep.value - 1);
};
const nextStep = () => {
if (currentStep.value === 4) {
confirmed.value = true;
modal.value?.hide();
}
Expand All @@ -85,7 +83,7 @@ watch(currentStep, () => {
id="onboarding-modal"
ref="modal"
aria-label="Bienvenue sur votre rapport d’audit"
@closed="emit('close', confirmed)"
@closed="emit('close')"
>
<div class="fr-container fr-container--fluid fr-container-md">
<div class="fr-grid-row fr-grid-row--center">
Expand Down
31 changes: 1 addition & 30 deletions confiture-web-app/src/pages/report/ReportPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ function hideReportAlert() {
}
const onboardingModalRef = ref<InstanceType<typeof OnboardingModal>>();
const showOnboardingAlert = ref(false);
watch(
() => report.data,
Expand All @@ -72,25 +71,12 @@ watch(
) {
onboardingModalRef.value?.show();
}
showOnboardingAlert.value =
getAuditStatus(report) !== AuditStatus.IN_PROGRESS &&
localStorage.getItem("confiture:hide-onboarding-alert") !== "true";
}
}
);
function onOnboardingClose(confirmed: boolean) {
function onOnboardingClose() {
localStorage.setItem("confiture:seen-onboarding", "true");
showOnboardingAlert.value = !confirmed;
if (confirmed) {
localStorage.setItem("confiture:hide-onboarding-alert", "true");
}
}
function onOnboardingAlertClose() {
showOnboardingAlert.value = false;
localStorage.setItem("confiture:hide-onboarding-alert", "true");
}
const targetTab = ref(route.params.tab as string | undefined);
Expand Down Expand Up @@ -145,21 +131,6 @@ const siteUrl = computed(() => {
</script>

<template>
<div v-if="showOnboardingAlert" class="fr-alert fr-alert--info fr-mb-6w">
<p class="fr-alert__title">Vous ne savez pas par quel bout commencer ?</p>
<p>
Retrouvez tous nos conseils dans la page
<RouterLink to="/aide">Aide</RouterLink>
</p>
<button
class="fr-btn--close fr-btn"
title="Masquer le message"
@click="onOnboardingAlertClose"
>
Masquer le message
</button>
</div>

<div
v-if="
report.data && getAuditStatus(report.data) === AuditStatus.IN_PROGRESS
Expand Down

0 comments on commit 02580ac

Please sign in to comment.