Skip to content

Commit

Permalink
Merge pull request #183 from datalab-mi/enh/refactoring-selectoption-…
Browse files Browse the repository at this point in the history
…component

[WIP] enh: ♻️ refactoring selectoption component
  • Loading branch information
NadeigeC authored Sep 25, 2023
2 parents 9728f02 + 9f2d8fe commit 3a0f386
Show file tree
Hide file tree
Showing 21 changed files with 412 additions and 221 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
12 changes: 6 additions & 6 deletions frontend/src/components/UploadButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down
21 changes: 5 additions & 16 deletions frontend/src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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',
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
Loading

0 comments on commit 3a0f386

Please sign in to comment.