diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 78554eb8..ea37063a 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -21,11 +21,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", @@ -2003,9 +2003,9 @@ } }, "node_modules/@cypress/request": { - "version": "2.88.12", - "resolved": "https://registry.npmjs.org/@cypress/request/-/request-2.88.12.tgz", - "integrity": "sha512-tOn+0mDZxASFM+cuAP9szGUGPI1HwWVSvdzm7V4cCsPdFTx6qMj29CwaQmRAMIEhORIUBFBsYROYJcveK4uOjA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@cypress/request/-/request-3.0.1.tgz", + "integrity": "sha512-TWivJlJi8ZDx2wGOw1dbLuHJKUYX7bWySw377nlnGOW3hP9/MUKIsEdXT/YngWxVdgNCHRBmFlBipE+5/2ZZlQ==", "dev": true, "dependencies": { "aws-sign2": "~0.7.0", @@ -2021,7 +2021,7 @@ "json-stringify-safe": "~5.0.1", "mime-types": "~2.1.19", "performance-now": "^2.1.0", - "qs": "~6.10.3", + "qs": "6.10.4", "safe-buffer": "^5.1.2", "tough-cookie": "^4.1.3", "tunnel-agent": "^0.6.0", @@ -2786,26 +2786,26 @@ } }, "node_modules/@testing-library/cypress": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/@testing-library/cypress/-/cypress-9.0.0.tgz", - "integrity": "sha512-c1XiCGeHGGTWn0LAU12sFUfoX3qfId5gcSE2yHode+vsyHDWraxDPALjVnHd4/Fa3j4KBcc5k++Ccy6A9qnkMA==", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/@testing-library/cypress/-/cypress-10.0.1.tgz", + "integrity": "sha512-e8uswjTZIBhaIXjzEcrQQ8nHRWHgZH7XBxKuIWxZ/T7FxfWhCR48nFhUX5nfPizjVOKSThEfOSv67jquc1ASkw==", "dev": true, "dependencies": { "@babel/runtime": "^7.14.6", - "@testing-library/dom": "^8.1.0" + "@testing-library/dom": "^9.0.0" }, "engines": { "node": ">=12", "npm": ">=6" }, "peerDependencies": { - "cypress": "^12.0.0" + "cypress": "^12.0.0 || ^13.0.0" } }, "node_modules/@testing-library/dom": { - "version": "8.20.1", - "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-8.20.1.tgz", - "integrity": "sha512-/DiOQ5xBxgdYRC8LNk7U+RWat0S3qRLeIw3ZIkMQ9kkVlRmwD/Eg8k8CqIpD6GW7u20JIUOfMKbxtiLutpjQ4g==", + "version": "9.3.3", + "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-9.3.3.tgz", + "integrity": "sha512-fB0R+fa3AUqbLHWyxXa2kGVtf1Fe1ZZFr0Zp6AIbIAzXb2mKbEXl+PCQNUOaq5lbTab5tfctfXRNsWXxa2f7Aw==", "dev": true, "dependencies": { "@babel/code-frame": "^7.10.4", @@ -2818,7 +2818,7 @@ "pretty-format": "^27.0.2" }, "engines": { - "node": ">=12" + "node": ">=14" } }, "node_modules/@types/aria-query": { @@ -2845,9 +2845,9 @@ "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==" }, "node_modules/@types/node": { - "version": "18.11.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.9.tgz", - "integrity": "sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==", + "version": "18.17.17", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.17.17.tgz", + "integrity": "sha512-cOxcXsQ2sxiwkykdJqvyFS+MLQPLvIdwh5l6gNg8qF6s+C7XSkEWOZjK+XhUZd+mYvHV/180g2cnCcIl4l06Pw==", "devOptional": true }, "node_modules/@types/normalize-package-data": { @@ -4584,15 +4584,15 @@ "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" }, "node_modules/cypress": { - "version": "12.17.4", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-12.17.4.tgz", - "integrity": "sha512-gAN8Pmns9MA5eCDFSDJXWKUpaL3IDd89N9TtIupjYnzLSmlpVr+ZR+vb4U/qaMp+lB6tBvAmt7504c3Z4RU5KQ==", + "version": "13.2.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.2.0.tgz", + "integrity": "sha512-AvDQxBydE771GTq0TR4ZUBvv9m9ffXuB/ueEtpDF/6gOcvFR96amgwSJP16Yhqw6VhmwqspT5nAGzoxxB+D89g==", "dev": true, "hasInstallScript": true, "dependencies": { - "@cypress/request": "2.88.12", + "@cypress/request": "^3.0.0", "@cypress/xvfb": "^1.2.4", - "@types/node": "^16.18.39", + "@types/node": "^18.17.5", "@types/sinonjs__fake-timers": "8.1.1", "@types/sizzle": "^2.3.2", "arch": "^2.2.0", @@ -4638,15 +4638,9 @@ "cypress": "bin/cypress" }, "engines": { - "node": "^14.0.0 || ^16.0.0 || >=18.0.0" + "node": "^16.0.0 || ^18.0.0 || >=20.0.0" } }, - "node_modules/cypress/node_modules/@types/node": { - "version": "16.18.50", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.50.tgz", - "integrity": "sha512-OiDU5xRgYTJ203v4cprTs0RwOCd5c5Zjv+K5P8KSqfiCsB1W3LcamTUMcnQarpq5kOYbhHfSOgIEJvdPyb5xyw==", - "dev": true - }, "node_modules/cypress/node_modules/commander": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", @@ -4801,15 +4795,15 @@ } }, "node_modules/deep-equal": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.1.tgz", - "integrity": "sha512-lKdkdV6EOGoVn65XaOsPdH4rMxTZOnmFyuIkMjM1i5HHCbfjC97dawgTAy0deYNfuqUqW+Q5VrVaQYtUpSd6yQ==", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.2.tgz", + "integrity": "sha512-xjVyBf0w5vH0I42jdAZzOKVldmPgSulmiyPRywoyq7HXC9qdgo17kxJE+rdnif5Tz6+pIrpJI8dCpMNLIGkUiA==", "dev": true, "dependencies": { "array-buffer-byte-length": "^1.0.0", "call-bind": "^1.0.2", "es-get-iterator": "^1.1.3", - "get-intrinsic": "^1.2.0", + "get-intrinsic": "^1.2.1", "is-arguments": "^1.1.1", "is-array-buffer": "^3.0.2", "is-date-object": "^1.0.5", @@ -11790,9 +11784,9 @@ "requires": {} }, "@cypress/request": { - "version": "2.88.12", - "resolved": "https://registry.npmjs.org/@cypress/request/-/request-2.88.12.tgz", - "integrity": "sha512-tOn+0mDZxASFM+cuAP9szGUGPI1HwWVSvdzm7V4cCsPdFTx6qMj29CwaQmRAMIEhORIUBFBsYROYJcveK4uOjA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@cypress/request/-/request-3.0.1.tgz", + "integrity": "sha512-TWivJlJi8ZDx2wGOw1dbLuHJKUYX7bWySw377nlnGOW3hP9/MUKIsEdXT/YngWxVdgNCHRBmFlBipE+5/2ZZlQ==", "dev": true, "requires": { "aws-sign2": "~0.7.0", @@ -11808,7 +11802,7 @@ "json-stringify-safe": "~5.0.1", "mime-types": "~2.1.19", "performance-now": "^2.1.0", - "qs": "~6.10.3", + "qs": "6.10.4", "safe-buffer": "^5.1.2", "tough-cookie": "^4.1.3", "tunnel-agent": "^0.6.0", @@ -12276,19 +12270,19 @@ } }, "@testing-library/cypress": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/@testing-library/cypress/-/cypress-9.0.0.tgz", - "integrity": "sha512-c1XiCGeHGGTWn0LAU12sFUfoX3qfId5gcSE2yHode+vsyHDWraxDPALjVnHd4/Fa3j4KBcc5k++Ccy6A9qnkMA==", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/@testing-library/cypress/-/cypress-10.0.1.tgz", + "integrity": "sha512-e8uswjTZIBhaIXjzEcrQQ8nHRWHgZH7XBxKuIWxZ/T7FxfWhCR48nFhUX5nfPizjVOKSThEfOSv67jquc1ASkw==", "dev": true, "requires": { "@babel/runtime": "^7.14.6", - "@testing-library/dom": "^8.1.0" + "@testing-library/dom": "^9.0.0" } }, "@testing-library/dom": { - "version": "8.20.1", - "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-8.20.1.tgz", - "integrity": "sha512-/DiOQ5xBxgdYRC8LNk7U+RWat0S3qRLeIw3ZIkMQ9kkVlRmwD/Eg8k8CqIpD6GW7u20JIUOfMKbxtiLutpjQ4g==", + "version": "9.3.3", + "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-9.3.3.tgz", + "integrity": "sha512-fB0R+fa3AUqbLHWyxXa2kGVtf1Fe1ZZFr0Zp6AIbIAzXb2mKbEXl+PCQNUOaq5lbTab5tfctfXRNsWXxa2f7Aw==", "dev": true, "requires": { "@babel/code-frame": "^7.10.4", @@ -12325,9 +12319,9 @@ "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==" }, "@types/node": { - "version": "18.11.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.9.tgz", - "integrity": "sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==", + "version": "18.17.17", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.17.17.tgz", + "integrity": "sha512-cOxcXsQ2sxiwkykdJqvyFS+MLQPLvIdwh5l6gNg8qF6s+C7XSkEWOZjK+XhUZd+mYvHV/180g2cnCcIl4l06Pw==", "devOptional": true }, "@types/normalize-package-data": { @@ -13582,14 +13576,14 @@ "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" }, "cypress": { - "version": "12.17.4", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-12.17.4.tgz", - "integrity": "sha512-gAN8Pmns9MA5eCDFSDJXWKUpaL3IDd89N9TtIupjYnzLSmlpVr+ZR+vb4U/qaMp+lB6tBvAmt7504c3Z4RU5KQ==", + "version": "13.2.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.2.0.tgz", + "integrity": "sha512-AvDQxBydE771GTq0TR4ZUBvv9m9ffXuB/ueEtpDF/6gOcvFR96amgwSJP16Yhqw6VhmwqspT5nAGzoxxB+D89g==", "dev": true, "requires": { - "@cypress/request": "2.88.12", + "@cypress/request": "^3.0.0", "@cypress/xvfb": "^1.2.4", - "@types/node": "^16.18.39", + "@types/node": "^18.17.5", "@types/sinonjs__fake-timers": "8.1.1", "@types/sizzle": "^2.3.2", "arch": "^2.2.0", @@ -13632,12 +13626,6 @@ "yauzl": "^2.10.0" }, "dependencies": { - "@types/node": { - "version": "16.18.50", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.50.tgz", - "integrity": "sha512-OiDU5xRgYTJ203v4cprTs0RwOCd5c5Zjv+K5P8KSqfiCsB1W3LcamTUMcnQarpq5kOYbhHfSOgIEJvdPyb5xyw==", - "dev": true - }, "commander": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", @@ -13743,15 +13731,15 @@ } }, "deep-equal": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.1.tgz", - "integrity": "sha512-lKdkdV6EOGoVn65XaOsPdH4rMxTZOnmFyuIkMjM1i5HHCbfjC97dawgTAy0deYNfuqUqW+Q5VrVaQYtUpSd6yQ==", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.2.tgz", + "integrity": "sha512-xjVyBf0w5vH0I42jdAZzOKVldmPgSulmiyPRywoyq7HXC9qdgo17kxJE+rdnif5Tz6+pIrpJI8dCpMNLIGkUiA==", "dev": true, "requires": { "array-buffer-byte-length": "^1.0.0", "call-bind": "^1.0.2", "es-get-iterator": "^1.1.3", - "get-intrinsic": "^1.2.0", + "get-intrinsic": "^1.2.1", "is-arguments": "^1.1.1", "is-array-buffer": "^3.0.2", "is-date-object": "^1.0.5", diff --git a/frontend/package.json b/frontend/package.json index 3ce79919..6226a644 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -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", diff --git a/frontend/src/assets/guide-mise-en-securite/photos/epaule_a_un_coup_par_canon/ep_un_coup_cle_oreilles.jpg b/frontend/src/assets/guide-mise-en-securite/photos/epaule_a_un_coup_par_canon/ep_un_coup_cle_oreilles.jpg deleted file mode 100644 index f40e5ffe..00000000 Binary files a/frontend/src/assets/guide-mise-en-securite/photos/epaule_a_un_coup_par_canon/ep_un_coup_cle_oreilles.jpg and /dev/null differ diff --git a/frontend/src/assets/guide-mise-en-securite/photos/epaule_a_un_coup_par_canon/epaule_a_un_coup_par_canon_cle_darne.jpg b/frontend/src/assets/guide-mise-en-securite/photos/epaule_a_un_coup_par_canon/epaule_a_un_coup_par_canon_cle_darne.jpg deleted file mode 100644 index f40e5ffe..00000000 Binary files a/frontend/src/assets/guide-mise-en-securite/photos/epaule_a_un_coup_par_canon/epaule_a_un_coup_par_canon_cle_darne.jpg and /dev/null differ diff --git a/frontend/src/assets/guide-mise-en-securite/photos/epaule_a_un_coup_par_canon/epaule_un_coup_cle_darne.jpg b/frontend/src/assets/guide-mise-en-securite/photos/epaule_a_un_coup_par_canon/epaule_un_coup_cle_darne.jpg new file mode 100644 index 00000000..73baf7a2 Binary files /dev/null and b/frontend/src/assets/guide-mise-en-securite/photos/epaule_a_un_coup_par_canon/epaule_un_coup_cle_darne.jpg differ diff --git a/frontend/src/assets/guide-mise-en-securite/photos/epaule_a_un_coup_par_canon/epaule_un_coup_cle_lefaucheux.jpg b/frontend/src/assets/guide-mise-en-securite/photos/epaule_a_un_coup_par_canon/epaule_un_coup_cle_lefaucheux.jpg new file mode 100644 index 00000000..34cdefd9 Binary files /dev/null and b/frontend/src/assets/guide-mise-en-securite/photos/epaule_a_un_coup_par_canon/epaule_un_coup_cle_lefaucheux.jpg differ diff --git a/frontend/src/assets/guide-mise-en-securite/photos/epaule_a_un_coup_par_canon/epaule_un_coup_cle_pouce.jpg b/frontend/src/assets/guide-mise-en-securite/photos/epaule_a_un_coup_par_canon/epaule_un_coup_cle_pouce.jpg new file mode 100644 index 00000000..a60f7f89 Binary files /dev/null and b/frontend/src/assets/guide-mise-en-securite/photos/epaule_a_un_coup_par_canon/epaule_un_coup_cle_pouce.jpg differ diff --git a/frontend/src/components/AskingExpert.vue b/frontend/src/components/AskingExpert.vue index 6a052067..81afbae8 100644 --- a/frontend/src/components/AskingExpert.vue +++ b/frontend/src/components/AskingExpert.vue @@ -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, diff --git a/frontend/src/components/UploadButton.vue b/frontend/src/components/UploadButton.vue index fd108d4c..8326ba3d 100644 --- a/frontend/src/components/UploadButton.vue +++ b/frontend/src/components/UploadButton.vue @@ -53,13 +53,13 @@ async function submitUpload (base64, fileName) { // TODO: Afficher l’erreur à l’utilisateur router.push({ name: 'ErrorPage', meta: { error } }) } finally { - router.push({ - name: getNextRouteAfterResult({ - securingTutorial: resultStore.securingTutorial, - confidenceLevel: resultStore.confidenceLevel, - typology: resultStore.typology, - }), + const nextRoute = getNextRouteAfterResult({ + securingTutorial: resultStore.securingTutorial, + confidenceLevel: resultStore.confidenceLevel, + typology: resultStore.typology, }) + console.log('nextRoute', nextRoute) + router.push(nextRoute) } } diff --git a/frontend/src/router/index.js b/frontend/src/router/index.js index ab4f173b..db29023d 100644 --- a/frontend/src/router/index.js +++ b/frontend/src/router/index.js @@ -15,9 +15,7 @@ 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') const SecuringAchievement = () => import('@/views/GuideSecuringFirearm/SecuringAchievement.vue') @@ -76,19 +74,10 @@ const routes = [ ], }, { - 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-choix-option-etape/:step', + name: 'SecuringSelectOption', + component: SecuringSelectOptionContent, + props: true, }, { path: '/mise-en-securite-tutoriel', diff --git a/frontend/src/stores/result.js b/frontend/src/stores/result.js index 7b1f714f..ebfe8ae7 100644 --- a/frontend/src/stores/result.js +++ b/frontend/src/stores/result.js @@ -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 { diff --git a/frontend/src/stores/steps.js b/frontend/src/stores/steps.js index d6cf4fa2..259f209c 100644 --- a/frontend/src/stores/steps.js +++ b/frontend/src/stores/steps.js @@ -5,11 +5,9 @@ import { serializer } from '@/utils/storage-utils.js' 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 selectedOptionStep3 = useLocalStorage('selectedOptionStep3', undefined, { serializer }) const tutorialFeedback = useLocalStorage('tutorialFeedback', '') const isDummy = useLocalStorage('isDummy', computed(() => !!(selectedAmmo.value === 'billes')), { serializer }) @@ -24,30 +22,19 @@ export const useStepsStore = defineStore('steps', () => { selectedAmmo.value = ammo } - function setOptionStep1 (selection) { - selectedOptionStep1.value = selection - } - - function setOptionStep2 (option) { - selectedOptionStep2.value = option - } - function setOptionStep3 (selection) { - selectedOptionStep3.value = selection + function setOptionStep (step, value) { + currentOptionStep.value = { ...currentOptionStep.value, [step]: value } } return { currentStep, - selectedOptionStep2, + currentOptionStep, selectedAmmo, - selectedOptionStep1, - selectedOptionStep3, tutorialFeedback, + setOptionStep, isDummy, isModalTransparentAmmoOpened, setCurrentStep, setAmmo, - setOptionStep1, - setOptionStep2, - setOptionStep3, } }) diff --git a/frontend/src/utils/firearms-utils/epaule-a-un-coup-par-canon.js b/frontend/src/utils/firearms-utils/epaule-a-un-coup-par-canon.js index 4fbe34a8..78313488 100644 --- a/frontend/src/utils/firearms-utils/epaule-a-un-coup-par-canon.js +++ b/frontend/src/utils/firearms-utils/epaule-a-un-coup-par-canon.js @@ -1,4 +1,6 @@ -import epauleAUnCoupParCanonCleDarne from '@/assets/guide-mise-en-securite/photos/epaule_a_un_coup_par_canon/ep_un_coup_cle_oreilles.jpg' +import epauleAUnCoupParCanonCleDarneImg from '@/assets/guide-mise-en-securite/photos/epaule_a_un_coup_par_canon/epaule_un_coup_cle_darne.jpg' +import epauleAUnCoupParCanonClePouceImg from '@/assets/guide-mise-en-securite/photos/epaule_a_un_coup_par_canon/epaule_un_coup_cle_pouce.jpg' +import epauleAUnCoupParCanonCleLechaufeuxImg from '@/assets/guide-mise-en-securite/photos/epaule_a_un_coup_par_canon/epaule_un_coup_cle_lefaucheux.jpg' import epauleAUnCoupParCanonCleDarneVideo from '@/assets/guide-mise-en-securite/videos/epaule_a_un_coup_par_canon/cle-darne.mp4' import epauleAUnCoupParCanonClePouceVideo from '@/assets/guide-mise-en-securite/videos/epaule_a_un_coup_par_canon/cle-pouce.mp4' import epauleAUnCoupParCanonCleLefaucheuxVideo from '@/assets/guide-mise-en-securite/videos/epaule_a_un_coup_par_canon/cle-lefaucheux.mp4' @@ -25,7 +27,7 @@ export const epaule_a_un_coup_par_canon = { 3: 'Retirer les munitions éventuelles', 4: 'Contrôler visuellement les chambres', }, - img: epauleAUnCoupParCanonCleDarne, + img: epauleAUnCoupParCanonClePouceImg, video: epauleAUnCoupParCanonClePouceVideo, }, cle_lefaucheux: { @@ -39,7 +41,7 @@ export const epaule_a_un_coup_par_canon = { 5: 'Retirer les munitions éventuelles', 6: 'Contrôler visuellement les chambres', }, - img: epauleAUnCoupParCanonCleDarne, + img: epauleAUnCoupParCanonCleLechaufeuxImg, video: epauleAUnCoupParCanonCleLefaucheuxVideo, }, cle_darne: { @@ -52,7 +54,7 @@ export const epaule_a_un_coup_par_canon = { 4: 'Retirer les munitions éventuelles', 5: 'Contrôler visuellement que la chambre est vide', }, - img: epauleAUnCoupParCanonCleDarne, + img: epauleAUnCoupParCanonCleDarneImg, video: epauleAUnCoupParCanonCleDarneVideo, }, }, diff --git a/frontend/src/utils/firearms-utils/get-next-route-after-result.js b/frontend/src/utils/firearms-utils/get-next-route-after-result.js index 44526c44..ce114478 100644 --- a/frontend/src/utils/firearms-utils/get-next-route-after-result.js +++ b/frontend/src/utils/firearms-utils/get-next-route-after-result.js @@ -3,19 +3,22 @@ import { resultTree } from '@/utils/firearms-utils/index.js' export const getNextRouteAfterResult = ({ securingTutorial, confidenceLevel, typology }) => { const isAbleToWatchTutorial = securingTutorial === true && confidenceLevel !== 'low' if (!isAbleToWatchTutorial) { - return 'IdentificationTypologyResult' + return { name: 'IdentificationTypologyResult' } } const hasNoSecuringOptions = !resultTree[typology].isSecuringOptions if (hasNoSecuringOptions) { - return 'SecuringAchievement' + return { name: 'SecuringAchievement' } } const hasMoreThanOneOptions = resultTree[typology]?.options_step_1 if (hasMoreThanOneOptions) { - return 'SecuringSelectOptionStep1' + return { name: 'SecuringSelectOption', params: { step: 1 } } } const hasSecuringOptions = resultTree[typology]?.options - return hasSecuringOptions ? 'SecuringSelectOptionStep2' : 'SecuringTutorialContent' + return { + name: hasSecuringOptions ? 'SecuringSelectOption' : 'SecuringTutorialContent', + ...(hasSecuringOptions ? { params: { step: 1 } } : {}), + } } diff --git a/frontend/src/utils/firearms-utils/revolver.js b/frontend/src/utils/firearms-utils/revolver.js index 1128a191..8df6e73d 100644 --- a/frontend/src/utils/firearms-utils/revolver.js +++ b/frontend/src/utils/firearms-utils/revolver.js @@ -70,9 +70,9 @@ export const revolver = { img: revolver2BoutoneBarilletImg, video: revolver2BoutoneBarilletVideo, }, - revolver_1873_fr: { + revolver_portiere: { label: 'Portière qui cache le côté droit du barillet', - value: 'revolver_1873_fr', + value: 'revolver_portiere', img: revolver2PortiereImg, }, revolver_1873_us: { diff --git a/frontend/src/utils/storage-utils.js b/frontend/src/utils/storage-utils.js index bb214179..895e2fcb 100644 --- a/frontend/src/utils/storage-utils.js +++ b/frontend/src/utils/storage-utils.js @@ -3,18 +3,18 @@ import { useStepsStore } from '@/stores/steps.js' export const serializer = { read: (v) => (v == null || v === 'null') ? undefined : JSON.parse(v), - write: (v) => v === undefined ? 'null' : JSON.stringify(v), + write: (v) => v == null ? 'null' : JSON.stringify(v), } export const clearLocalStorage = (to, from, next) => { - const { setAmmo, setOptionStep1, setOptionStep2, setOptionStep3, setCurrentStep } = useStepsStore() + const { setAmmo, setOptionStep, setCurrentStep } = useStepsStore() const { setResult } = useResultStore() useStepsStore.isModalTransparentAmmoOpened = undefined setAmmo(undefined) - setOptionStep1(undefined) - setOptionStep2(undefined) - setOptionStep3(undefined) + setOptionStep(1, undefined) + setOptionStep(2, undefined) + setOptionStep(3, undefined) setCurrentStep(0) setResult({ diff --git a/frontend/src/views/GuideIdentificationFirearm/GuideIdentificationFirearm.vue b/frontend/src/views/GuideIdentificationFirearm/GuideIdentificationFirearm.vue index 9c6739b2..28392e1d 100644 --- a/frontend/src/views/GuideIdentificationFirearm/GuideIdentificationFirearm.vue +++ b/frontend/src/views/GuideIdentificationFirearm/GuideIdentificationFirearm.vue @@ -59,7 +59,7 @@ async function sendLogsIdentificationDummy () { confidence: confidence.value, label: typology.value, confidence_level: confidenceLevel.value, - tutorial_option: stepsStore.selectedOptionStep2, + tutorial_option: stepsStore.selectedOptionStep, is_dummy: stepsStore.isDummy, } try { diff --git a/frontend/src/views/GuideSecuringFirearm/SecuringFooter.vue b/frontend/src/views/GuideSecuringFirearm/SecuringFooter.vue index cbd9aef7..1921c44c 100644 --- a/frontend/src/views/GuideSecuringFirearm/SecuringFooter.vue +++ b/frontend/src/views/GuideSecuringFirearm/SecuringFooter.vue @@ -34,7 +34,7 @@ const backClick = (navigate) => { class="flex justify-center w-full" :secondary="true" label="Précédent" - @click="backClick(navigate)" + @click.stop.prevent="backClick(navigate)" /> { :disabled="nextDisabled" label="Suivant" :icon-right="true" - @click="nextClick(navigate)" + @click.stop.prevent="nextClick(navigate)" /> diff --git a/frontend/src/views/GuideSecuringFirearm/SecuringSelectOptionContent.vue b/frontend/src/views/GuideSecuringFirearm/SecuringSelectOptionContent.vue new file mode 100644 index 00000000..ce79605c --- /dev/null +++ b/frontend/src/views/GuideSecuringFirearm/SecuringSelectOptionContent.vue @@ -0,0 +1,227 @@ + + + + + diff --git a/frontend/src/views/GuideSecuringFirearm/SecuringSelectOptionStep1.vue b/frontend/src/views/GuideSecuringFirearm/SecuringSelectOptionStep1.vue index d84805b6..62b4a1d8 100644 --- a/frontend/src/views/GuideSecuringFirearm/SecuringSelectOptionStep1.vue +++ b/frontend/src/views/GuideSecuringFirearm/SecuringSelectOptionStep1.vue @@ -17,8 +17,8 @@ const selectedOptionStep1 = computed({ get () { return stepsStore.selectedOptionStep1 }, - set (selection) { - stepsStore.setOptionStep1(selection) + set (option) { + stepsStore.setOptionStep1(option) }, }) @@ -117,7 +117,6 @@ function updateTypology () { } :deep(.fr-label) { - word-wrap: anywhere !important; font-size: small; } @@ -139,8 +138,8 @@ function updateTypology () { background-color: #eee9; cursor: zoom-in; position: absolute; - bottom: 0.5rem; - right: .5rem; + bottom: 0.25rem; + right: 4.5rem; } .zoom-label { diff --git a/frontend/src/views/GuideSecuringFirearm/SecuringTutorialContent.vue b/frontend/src/views/GuideSecuringFirearm/SecuringTutorialContent.vue index c3e98c71..f388ab59 100644 --- a/frontend/src/views/GuideSecuringFirearm/SecuringTutorialContent.vue +++ b/frontend/src/views/GuideSecuringFirearm/SecuringTutorialContent.vue @@ -17,20 +17,18 @@ const expandedId = ref(undefined) const typology = computed(() => resultStore.typology) -const selectedOptionStep2 = computed({ +const selectedOptionStep = computed({ get () { - return stepsStore.selectedOptionStep2 + if (typology.value === 'revolver') { + if (stepsStore.currentOptionStep['2'] === 'revolver_portiere') { + return stepsStore.currentOptionStep['3'] + } + return stepsStore.currentOptionStep['2'] + } + return stepsStore.currentOptionStep['1'] }, set (option) { - stepsStore.setOptionStep2(option) - }, -}) -const selectedOptionStep3 = computed({ - get () { - return stepsStore.selectedOptionStep3 - }, - set (option) { - stepsStore.setOptionStep3(option) + stepsStore.setOptionStep(option) }, }) @@ -49,7 +47,55 @@ const openNextAccordion = (currentIndex) => { Manipulations
-
+
+
+

+ Veuillez suivre les indications dans l'ordre afin de mettre en sécurité votre arme +

+ +
  • + + +
  • +
    +
    +
    +
    @@ -58,97 +104,47 @@ const openNextAccordion = (currentIndex) => { controls playsinline muted - :src="resultTree[typology]?.options_step_2[selectedOptionStep2]?.video" + :src="resultTree[typology]?.options_step_3['revolver_verrou_1892']?.video" /> Environ 3 min
    -
    +

    -
    +

    +
    +
    -
    -
    -

    - Veuillez suivre les indications dans l'ordre afin de mettre en sécurité votre arme -

    - -
  • - - -
  • -
    +
    +
    +
    -
    -
    -
    -
    -
    -

    -

      -
    • -
    -

    -
    - +
    +
      +
    • +
    @@ -162,7 +158,7 @@ const openNextAccordion = (currentIndex) => { controls playsinline muted - :src="resultTree[typology]?.options[selectedOptionStep2]?.video" + :src="resultTree[typology]?.options[selectedOptionStep]?.video" /> Environ 20 sec
    @@ -170,7 +166,7 @@ const openNextAccordion = (currentIndex) => {