diff --git a/frontend/src/components/AskingExpert.vue b/frontend/src/components/AskingExpert.vue index de8a8fd1..72ab76c1 100644 --- a/frontend/src/components/AskingExpert.vue +++ b/frontend/src/components/AskingExpert.vue @@ -46,7 +46,6 @@ async function sendTutorialFeedback () { setMessage({ type: 'error', message: 'Une erreur a eu lieu en enregistrant de votre message.' }) }) .finally(() => setTimeout(() => { - stepsStore.setCurrentStep(1) stepsStore.tutorialFeedback = '' router.push({ name: 'ResultPage' }) }, 3000)) diff --git a/frontend/src/components/HeaderMain.vue b/frontend/src/components/HeaderMain.vue index d0be8b9c..69301470 100644 --- a/frontend/src/components/HeaderMain.vue +++ b/frontend/src/components/HeaderMain.vue @@ -62,8 +62,13 @@ const quickLinks: InstanceType['$props']['quickLinks'] = [ } } +:deep(.fr-header__navbar) { + margin-top: 0 !important; +} + :deep(.fr-header__navbar .fr-btn--menu) { color : var(--text-action-high-blue-france); + box-shadow: none; } .marianne-only :deep(.fr-header__logo .fr-logo::before) { diff --git a/frontend/src/stores/steps.ts b/frontend/src/stores/steps.ts index fc2fb12c..677688f0 100644 --- a/frontend/src/stores/steps.ts +++ b/frontend/src/stores/steps.ts @@ -6,7 +6,6 @@ import { serializer } from '@/utils/storage-utils' type Step = Record<'1' | '2' | '3', string> export const useStepsStore = defineStore('steps', () => { - const currentStep = useLocalStorage<1 | 2 | 3>('currentStep', 1) const currentOptionStep = useLocalStorage>('currentOptionStep', {}) const selectedAmmo = useLocalStorage('selectedAmmo', undefined, { serializer }) @@ -17,10 +16,6 @@ export const useStepsStore = defineStore('steps', () => { const isModalTransparentAmmoOpened = useLocalStorage('isModalTransparentAmmoOpened', undefined, { serializer }) - function setCurrentStep (newStep: 1 | 2 | 3) { - currentStep.value = newStep - } - function setAmmo (ammo?: string) { selectedAmmo.value = ammo } @@ -34,7 +29,6 @@ export const useStepsStore = defineStore('steps', () => { } return { - currentStep, currentOptionStep, selectedAmmo, selectedAlarmGun, @@ -45,7 +39,6 @@ export const useStepsStore = defineStore('steps', () => { isModalTransparentAmmoOpened.value = val }, isModalTransparentAmmoOpened, - setCurrentStep, setAmmo, $reset, } diff --git a/frontend/src/utils/storage-utils.ts b/frontend/src/utils/storage-utils.ts index 760faf1d..4db130d8 100644 --- a/frontend/src/utils/storage-utils.ts +++ b/frontend/src/utils/storage-utils.ts @@ -9,7 +9,7 @@ export const serializer = { } export const clearLocalStorage: NavigationGuardWithThis = (to, from, next) => { - const { setAmmo, setOptionStep, setCurrentStep, setModalTransparentAmmoOpened } = useStepsStore() + const { setAmmo, setOptionStep, setModalTransparentAmmoOpened } = useStepsStore() const resultStore = useResultStore() setModalTransparentAmmoOpened(undefined) @@ -17,7 +17,6 @@ export const clearLocalStorage: NavigationGuardWithThis = (to, from, setOptionStep(1, undefined) setOptionStep(2, undefined) setOptionStep(3, undefined) - setCurrentStep(0) resultStore.$patch({ typology: undefined, diff --git a/frontend/src/views/GuideIdentificationFirearm/GuideIdentificationFirearm.vue b/frontend/src/views/GuideIdentificationFirearm/GuideIdentificationFirearm.vue index 3e6d3496..16bf7610 100644 --- a/frontend/src/views/GuideIdentificationFirearm/GuideIdentificationFirearm.vue +++ b/frontend/src/views/GuideIdentificationFirearm/GuideIdentificationFirearm.vue @@ -3,8 +3,6 @@ import { computed } from 'vue' import { useRoute, useRouter } from 'vue-router' import { - identificationRoutePaths, - identificationRoutePathsWithArmeAlarme, identificationGuideSteps, identificationGuideStepsWithArmeAlarme, resultTree, @@ -21,14 +19,7 @@ const route = useRoute() const confidenceLevel = computed(() => resultStore.confidenceLevel) const typology = computed(() => resultStore.typology) -const currentStep = computed({ - get () { - return stepsStore.currentStep + 1 - }, - set (value) { - stepsStore.setCurrentStep(value as 1 | 2 | 3) - }, -}) +const currentStep = ref(1) const isDummyTypology = resultTree[resultStore.typology].isDummyTypology const isLowConfidence = confidenceLevel.value === 'low' @@ -47,29 +38,16 @@ const steps = computed(() => { const disabledValidation = computed(() => currentStep.value === 3 && stepsStore.selectedAmmo === undefined) -const goToNewRoute = () => ( - router.push({ name: `${identificationGuideSteps[currentStep.value - 1]}` }).catch(() => { }) -) +const goToNewRoute = () => { + router.push({ name: identificationGuideSteps[currentStep.value - 1] }) +} const goToNewRouteWithArmeAlarme = () => ( - router.push({ name: `${identificationGuideStepsWithArmeAlarme[currentStep.value - 1]}` }) + router.push({ name: identificationGuideStepsWithArmeAlarme[currentStep.value - 1] }) ) const isArmeAlarme = computed(() => route.path === '/guide-identification/armes-alarme') -const goToPreviousStep = () => ( - currentStep.value = currentStep.value - 2 -) - -const stepsNumber = computed(() => ALARM_GUNS_TYPOLOGIES.includes(resultStore.typology) - ? identificationRoutePaths.length - : identificationRoutePathsWithArmeAlarme.length, -) - -const goToNextStep = () => ( - currentStep.value = currentStep.value < stepsNumber.value ? currentStep.value : stepsNumber.value -) - const goOnAndFollow = computed(() => ( currentStep.value === 1 ? 'Continuer' @@ -89,7 +67,7 @@ const calculateRoute = (stepsStore) => { // showDiv is used to create a mini steper for alarm guns. Need to be reworked. const backStepButtonAction = () => { if (showDiv.value === false) { - goToPreviousStep() + currentStep.value-- goToNewRouteWithArmeAlarme() } else { showDiv.value = false @@ -100,15 +78,15 @@ const nextStepButtonAction = () => { if (showDiv.value === false) { showDiv.value = true } else { - goToNextStep(); goToNewRouteWithArmeAlarme() + currentStep.value++; goToNewRouteWithArmeAlarme() } } function handlePreviousButtonClick () { - goToPreviousStep() + currentStep.value-- if (ALARM_GUNS_TYPOLOGIES.includes(typology.value)) { goToNewRouteWithArmeAlarme() - } else if (resultTree[typology]?.isDummyTypology) { + } else { goToNewRoute() } } @@ -122,7 +100,7 @@ const showDiv = ref(false)
@@ -160,12 +138,12 @@ const showDiv = ref(false) class="fr-col-11 fr-col-lg-6 footer-actions mx-auto" >
@@ -185,15 +163,15 @@ const showDiv = ref(false) > diff --git a/frontend/src/views/GuideSecuringFirearm/GuideSecuringFirearm.vue b/frontend/src/views/GuideSecuringFirearm/GuideSecuringFirearm.vue index 8a3bf66c..785f1711 100644 --- a/frontend/src/views/GuideSecuringFirearm/GuideSecuringFirearm.vue +++ b/frontend/src/views/GuideSecuringFirearm/GuideSecuringFirearm.vue @@ -1,35 +1,24 @@ +