Skip to content

Commit

Permalink
fix: 🐛 fix navigation for revolver typology
Browse files Browse the repository at this point in the history
  • Loading branch information
NadeigeC committed Sep 21, 2023
1 parent 9e47cd5 commit 1e984e7
Show file tree
Hide file tree
Showing 18 changed files with 139 additions and 160 deletions.
114 changes: 51 additions & 63 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
"vue-router": "^4.2.4"
},
"devDependencies": {
"@testing-library/cypress": "^9.0.0",
"@testing-library/cypress": "^10.0.1",
"@unocss/transformer-directives": "^0.55.7",
"@unocss/transformer-variant-group": "^0.55.7",
"@vitejs/plugin-vue": "^4.3.4",
"cypress": "^12.17.4",
"cypress": "^13.2.0",
"eslint": "^8.48.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-cypress": "^2.14.0",
Expand Down
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion frontend/src/components/AskingExpert.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async function sendTutorialFeedback () {
image_url: imgUrl.value,
tutorial_feedback: stepsStore.tutorialFeedback,
label: typology.value,
tutorial_option: stepsStore.selectedOptionStep2 || null,
tutorial_option: stepsStore.selectedOptionStep || null,
route_name: route.name,
confidence: confidence.value,
confidence_level: confidenceLevel.value,
Expand Down
18 changes: 0 additions & 18 deletions frontend/src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ const ContactPage = () => import('@/views/ContactPage.vue')
const GuideSecuringFirearm = () => import('@/views/GuideSecuringFirearm/GuideSecuringFirearm.vue')
const SecuringIntroduction = () => import('@/views/GuideSecuringFirearm/SecuringIntroduction.vue')
const SecuringInstructions = () => import('@/views/GuideSecuringFirearm/SecuringInstructions.vue')
const SecuringSelectOptionStep1 = () => import('@/views/GuideSecuringFirearm/SecuringSelectOptionStep1.vue')
const SecuringSelectOptionStep3 = () => import('@/views/GuideSecuringFirearm/SecuringSelectOptionStep3.vue')
const SecuringSelectOptionStep2 = () => import('@/views/GuideSecuringFirearm/SecuringSelectOptionStep2.vue')
const SecuringSelectOptionContent = () => import('@/views/GuideSecuringFirearm/SecuringSelectOptionContent.vue')
const SecuringTutorialContent = () => import('@/views/GuideSecuringFirearm/SecuringTutorialContent.vue')
const SecuringRecommendations = () => import('@/views/GuideSecuringFirearm/SecuringRecommendations.vue')
Expand Down Expand Up @@ -82,21 +79,6 @@ const routes = [
component: SecuringSelectOptionContent,
props: true,
},
{
path: '/mise-en-securite-choix-option-etape-1',
name: 'SecuringSelectOptionStep1',
component: SecuringSelectOptionStep1,
},
{
path: '/mise-en-securite-choix-option-etape-2',
name: 'SecuringSelectOptionStep2',
component: SecuringSelectOptionStep2,
},
{
path: '/mise-en-securite-choix-option-etape-3',
name: 'SecuringSelectOptionStep3',
component: SecuringSelectOptionStep3,
},
{
path: '/mise-en-securite-tutoriel',
name: 'SecuringTutorialContent',
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/stores/result.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ export const useResultStore = defineStore('result', () => {
geolocation.value = geoloc
}

const updateTypology = (selectedOptionStep1) => {
typology.value = typology.value + (selectedOptionStep1 === 'revolver_black_powder' ? '_black_powder' : '')
const updateTypology = (selectedOptionStep) => {
typology.value = typology.value + (selectedOptionStep === 'revolver_black_powder' ? '_black_powder' : '')
}

return {
Expand Down
12 changes: 6 additions & 6 deletions frontend/src/stores/steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ export const useStepsStore = defineStore('steps', () => {
const currentStep = useLocalStorage('currentStep', 1)
const currentOptionStep = useLocalStorage('currentOptionStep', {})

const selectedOptionStep2 = useLocalStorage('selectedOptionStep2', undefined, { serializer })
const selectedAmmo = useLocalStorage('selectedAmmo', undefined, { serializer })
const selectedOptionStep1 = useLocalStorage('selectedOptionStep1', undefined, { serializer })
const selectedOptionStep2 = useLocalStorage('selectedOptionStep2', undefined, { serializer })
const selectedOptionStep3 = useLocalStorage('selectedOptionStep3', undefined, { serializer })
const tutorialFeedback = useLocalStorage('tutorialFeedback', '')

Expand All @@ -29,22 +29,22 @@ export const useStepsStore = defineStore('steps', () => {
currentOptionStep.value = { ...currentOptionStep, [step]: value }
}

function setOptionStep1 (selection) {
selectedOptionStep1.value = selection
function setOptionStep1 (option) {
selectedOptionStep1.value = option
}
function setOptionStep2 (option) {
selectedOptionStep2.value = option
}
function setOptionStep3 (selection) {
selectedOptionStep3.value = selection
function setOptionStep3 (option) {
selectedOptionStep3.value = option
}

return {
currentStep,
currentOptionStep,
selectedOptionStep2,
selectedAmmo,
selectedOptionStep1,
selectedOptionStep2,
selectedOptionStep3,
tutorialFeedback,
setOptionStep,
Expand Down
Loading

0 comments on commit 1e984e7

Please sign in to comment.