Skip to content

Commit

Permalink
Merge pull request #126 from datalab-mi/feat/add-new-stat-variable-se…
Browse files Browse the repository at this point in the history
…lect-option

Add new stat variables
  • Loading branch information
NadeigeC authored Feb 13, 2023
2 parents 5a6a914 + eb08d56 commit df0fdbc
Show file tree
Hide file tree
Showing 35 changed files with 343 additions and 188 deletions.
4 changes: 3 additions & 1 deletion backend/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,10 @@ async def log_tutorial_feedback(request: Request, user_id: Union[str, None] = Co
"bg_label": res["label"],
"bg_confidence": res["confidence"],
"bg_confidence_level": res["confidence_level"],
"bg_current_step": res["current_step"],
"bg_route_name": res["route_name"],
"bg_current_step": res["current_step"],
"bg_tutorial_option": res["tutorial_option"],
"bg_tutorial_ammo": res["tutorial_ammo"],
"bg_user_id": user_id,
"bg_device": get_device(user_agent),
"bg_device_family": user_agent.device.family,
Expand Down
65 changes: 44 additions & 21 deletions frontend/package-lock.json

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

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"pretest:unit": "npm run lint"
},
"dependencies": {
"@gouvminint/vue-dsfr": "~1.6.0",
"@gouvminint/vue-dsfr": "~2.0.0",
"@vue/compat": "^3.2.40",
"@vueuse/core": "^9.6.0",
"axios": "^0.27.2",
Expand Down
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.
Binary file removed frontend/src/assets/logo.png
Binary file not shown.
Binary file removed frontend/src/assets/pistol_test_1.mp4
Binary file not shown.
Binary file removed frontend/src/assets/pistol_test_2.mp4
Binary file not shown.
Binary file removed frontend/src/assets/thumbs-down.png
Binary file not shown.
Binary file removed frontend/src/assets/thumbs-up.png
Binary file not shown.
17 changes: 7 additions & 10 deletions frontend/src/components/HeaderMain.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,25 +119,22 @@ export default {
</script>

<style scoped>
header.fr-header {
-webkit-box-shadow: none;
-webkit-filter: none;
-moz-box-shadow: none;
box-shadow: none;
box-shadow: none;
filter: none;
}
.nav-container {
margin: .2em auto;
margin: 0.2em auto;
display: flex;
justify-content: space-between;
}
:deep(.fr-header__logo) {
padding: .75rem 0 !important;
padding: 0.75rem 0 !important;
}
.container-link {
.container-link {
display: flex;
justify-content: flex-start;
flex-direction: column;
Expand All @@ -162,7 +159,7 @@ header.fr-header {
}
:deep(.fr-modal__header) {
padding: 0 1rem;
padding: 0 1rem;
}
.btn-open-modal {
Expand All @@ -177,7 +174,7 @@ header.fr-header {
}
.btn-menu-information:hover {
color: #1660CB !important;
color: #1660cb !important;
}
</style>
5 changes: 3 additions & 2 deletions frontend/src/components/OnboardingSwiper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ export default {
</script>

<style scoped>
.swiper {
width: 100%;
height: 100%;
Expand Down Expand Up @@ -122,6 +121,7 @@ export default {
top: 45%;
color: #000091 !important;
}
:deep(.swiper-button-next) {
position: fixed;
top: 45%;
Expand All @@ -131,6 +131,7 @@ export default {
:deep(.swiper-button-prev)::after {
font-size: 28px;
}
:deep(.swiper-button-next)::after {
font-size: 28px;
}
Expand All @@ -139,7 +140,7 @@ export default {
display: none;
}
:deep(.swiper-pagination-bullet-active) {
:deep(.swiper-pagination-bullet-active) {
background: #00c7c8;
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/UploadButton.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<template>
<div
id="demarrer"
style="width: 0; height: 1px; display: none;"
style="width: 0; height: 1px; display: none;"
>
<input
ref="fileInput"
type="file"
style="width: 0; height: 1px"
style="width: 0; height: 1px"
:accept="handledImageTypes"
@change="onFileSelected($event)"
>
Expand Down
1 change: 1 addition & 0 deletions frontend/src/icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ export {
RiZoomInLine,
RiArrowGoBackFill,
RiListOrdered,
RiLogoutBoxRLine,
} from 'oh-vue-icons/icons/ri/index.js'
2 changes: 1 addition & 1 deletion frontend/src/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
}

.blank {
height: 120px;
height: 80px;
z-index: 1
}

Expand Down
3 changes: 3 additions & 0 deletions frontend/src/stores/steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ export const useStepsStore = defineStore('steps', () => {

const isFactice = computed(() => selectedAmmo === 'billes')

const isOpened = useLocalStorage('isOpened', undefined, { serializer })

function setCurrentStep (newStep) {
currentStep.value = newStep
}
Expand All @@ -30,6 +32,7 @@ export const useStepsStore = defineStore('steps', () => {
selectedAmmo,
tutorialFeedback,
isFactice,
isOpened,
setCurrentStep,
setOption,
setAmmo,
Expand Down
34 changes: 20 additions & 14 deletions frontend/src/utils/firearms-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const results = {
}

export const guideFacticeSelectOption = {
pistolet_semi_auto_moderne_text_option: "Sélectionner ce que vous voyez sur votre arme : <br> bouton à proximité <span class='bold-highlight'>du pontet du côté gauche de la poignée</span>,ou <span class='bold-highlight'>bouton sur le talon</span> de la crosse.",
pistolet_semi_auto_moderne_text_option: "Sélectionner ce que vous voyez sur votre arme : bouton à proximité <span class='bold-highlight'>du pontet du côté gauche de la poignée</span>, ou <span class='bold-highlight'>bouton sur le talon</span> de la crosse.",
pistolet_semi_auto_moderne: {
pontet: {
label: 'bouton pontet',
Expand Down Expand Up @@ -122,6 +122,13 @@ export const guideFacticeSelectOption = {
img: 'autre-epaule-p90_arrow2.jpg',
video: 'p90_sm.mp4',
},
bouton_poignee: {
label: 'bouton à la base de la poignée',
value: 'bouton_poignee',
text: '<span class="bold-highlight">Appuyer sur le bouton</span> avec le pouce de la main droite, puis <span class="bold-highlight"> extraire le chargeur </span>avec la main gauche en le tirant ou en le laissant glisser.',
img: 'autre-epaule-pistolet-mitrailleur.png',
video: 'pistolet_mitrailleur_sm.mp4',
},
},
autre_pistolet:
{
Expand All @@ -141,7 +148,6 @@ export const guideFacticeSelectOption = {
label: 'pas de chargeur présent',
value: 'sans_chargeur',
img: 'verrou_sans_chargeur_arrow2.jpg',
// text: 'Info - Ce tutoriel n’est valable que pour les armes à verrou avec chargeur externe',
},
},
revolver_text_option: 'Sélectionner ce que vous voyez sur l’arme',
Expand Down Expand Up @@ -188,18 +194,18 @@ export const guideFacticeSelectAmmo = {
img_ammo: 'autre-epaule-balls.jpg',
},
},
autre_pistolet: {
cartouches: {
label: 'cartouches',
value: 'cartouches',
img_ammo: 'autre-pistolet-cartridge.jpg',
},
billes: {
label: 'billes',
value: 'billes',
img_ammo: 'autre-pistolet-balls.jpg',
},
},
// autre_pistolet: {
// cartouches: {
// label: 'cartouches',
// value: 'cartouches',
// img_ammo: 'autre-pistolet-cartridge.jpg',
// },
// billes: {
// label: 'billes',
// value: 'billes',
// img_ammo: 'autre-pistolet-balls.jpg',
// },
// },
epaule_a_verrou: {
cartouches: {
label: 'cartouches',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/utils/storage-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const clearLocalStorage = (to, from, next) => {
const { setOption, setAmmo, setCurrentStep } = useStepsStore()
const { setResult } = useResultStore()

useStepsStore.isOpened = undefined
setOption(undefined)
setAmmo(undefined)
setCurrentStep(0)
Expand Down
15 changes: 0 additions & 15 deletions frontend/src/views/About.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,6 @@ import AboutInformationTabs from '@/views/InformationTabs/AboutInformationTabs.v
<div>
<div class="content">
<h2>À propos</h2>
<!-- <div class="d-flex align-items-center">
<router-link
:to="{name:'Start'}"
class="small-link small-text"
>
Accueil
</router-link>
<span
class="fr-fi-arrow-right-s-line"
aria-hidden="true"
/>
<p class="small-text">
À propos
</p>
</div> -->
<AboutInformationTabs />
</div>
</div>
Expand Down
15 changes: 0 additions & 15 deletions frontend/src/views/Contact.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,6 @@ import ContactInformationTabs from '@/views/InformationTabs/ContactInformationTa
<div>
<div class="content">
<h2>Contact</h2>
<!-- <div class="d-flex align-items-center">
<router-link
:to="{name:'Start'}"
class="small-link small-text"
>
Accueil
</router-link>
<span
class="fr-fi-arrow-right-s-line"
aria-hidden="true"
/>
<p class="small-text">
Contact
</p>
</div> -->
<ContactInformationTabs />
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/Error.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</p>
<router-link
v-slot="{navigate}"
:to="{name:'Home'}"
:to="{name:'Start'}"
>
<DsfrButton
label="Retour"
Expand Down
Loading

0 comments on commit df0fdbc

Please sign in to comment.