Skip to content

Commit

Permalink
feat: ✨ add dummy identification for lever rifle and semi-automatic o…
Browse files Browse the repository at this point in the history
…r automatic long gun
  • Loading branch information
nutfdt authored and thomashbrnrd committed Sep 12, 2024
1 parent 20ccc36 commit 58d8bd6
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 1 deletion.
14 changes: 14 additions & 0 deletions frontend/src/utils/firearms-utils/epaule-a-levier-sous-garde.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import levierSousGardeMagasinAvantImg from "@/assets/guide-mise-en-securite/phot
import levierSousGardePasMagasinImg from "@/assets/guide-mise-en-securite/photos/epaule_a_levier_sous_garde/epaule_levier_ss_garde_magasin_fixe.jpg";
import levierSousGardeMagasinAvantVideo from "@/assets/guide-mise-en-securite/videos/epaule_a_levier_sous_garde/epaule_levier_ss_garde_magasin_avant.mp4";
import levierSousGardePasMagasinVideo from "@/assets/guide-mise-en-securite/videos/epaule_a_levier_sous_garde/epaule_levier_ss_garde_magasin_fixe.mp4";
import levierSousGardeCartridges from "@/assets/guide-identification/photos/epaule_a_verrou/epaule_a_verrou_chargeur_cartouche.jpg";
import levierSousGardeBalls from "@/assets/guide-identification/photos/epaule_a_verrou/epaule_a_verrou_chargeur_bille.jpg";
import {
getEpaulLevierVerrouDisclaimer,
getCommonCategory,
Expand Down Expand Up @@ -51,5 +53,17 @@ export const epaule_a_levier_sous_garde = {
],
},
],
dummyOptions: [
{
label: "Balles",
value: "cartouches",
img_ammo: levierSousGardeCartridges,
},
{
label: "Billes ou trou pour billes",
value: "billes",
img_ammo: levierSousGardeBalls,
},
],
getDisclaimer: getEpaulLevierVerrouDisclaimer,
} as const;
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
import semiAutoMilitaireCartridges from "@/assets/guide-identification/photos/semi_auto_militaire_autre/semi_automatique_militaire_autre_chargeur_cartouche.jpg";
import semiAutoMilitaireBalls from "@/assets/guide-identification/photos/semi_auto_militaire_autre/semi_automatique_militaire_autre_chargeur_billes.jpg";
/*
Armes d’épaule semi-automatiques ou automatiques type militaire milieu 20e
*/
export const epaule_semi_auto_style_militaire_milieu_20e = {
displayLabel: "Arme d’épaule semi-automatique ou automatique",
getCategory: () => "A ou B",
dummyOptions: [
{
label: "Cartouches",
value: "cartouches",
img_ammo: semiAutoMilitaireCartridges,
},
{
label: "Billes",
value: "billes",
img_ammo: semiAutoMilitaireBalls,
},
],
getDisclaimer: () =>
"<strong>Catégorie A</strong> si à l'origine l’arme était à <strong>répétition automatique</strong> puis a été <strong>transformée</strong> en arme <strong>semi automatique</strong>, ou si l’arme possède <strong>une crosse rétractable / pliable</strong> et qu’en configuration la plus courte elle <strong>mesure moins de 60 cm</strong>.",
} as const;
14 changes: 14 additions & 0 deletions frontend/src/utils/firearms-utils/epaule-semi-auto-style-chasse.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { getCommonCategory } from "@/utils/firearms-utils/index";
import pistoletSemiAutoModerneCartridges from "@/assets/guide-identification/photos/pistolet_semi_auto_moderne/pistolet_sa_moderne_chargeur_cartouche.jpg";
import pistoletSemiAutoModerneBalls from "@/assets/guide-identification/photos/pistolet_semi_auto_moderne/pistolet_sa_moderne_chargeur_bille.jpg";

const DISCLAIMERS = {
short:
Expand All @@ -12,6 +14,18 @@ Armes d’épaule semi-automatiques ou automatiques type chasse
export const epaule_semi_auto_style_chasse = {
displayLabel: "Arme d’épaule semi-automatique",
getCategory: getCommonCategory,
dummyOptions: [
{
label: "Cartouches",
value: "cartouches",
img_ammo: pistoletSemiAutoModerneCartridges, // Mettre la bonne image
},
{
label: "Billes",
value: "billes",
img_ammo: pistoletSemiAutoModerneBalls, // Mettre la bonne image
},
],
getDisclaimer: (category: string, isCardDetected: boolean) => {
if (["B ou C", "C"].includes(category)) {
if (isCardDetected === false) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import type { pistolet_semi_auto_moderne } from "@/utils/firearms-utils/pistolet
import type { semi_auto_style_militaire_autre } from "@/utils/firearms-utils/semi-auto-style-militaire-autre"; // eslint-disable-line camelcase
import type { revolver } from "@/utils/firearms-utils/revolver";
import type { epaule_a_pompe } from "@/utils/firearms-utils/epaule-a-pompe";
import { epaule_a_levier_sous_garde } from "@/utils/firearms-utils/epaule-a-levier-sous-garde";
import { epaule_semi_auto_style_militaire_milieu_20e } from "@/utils/firearms-utils/epaule-semi-auto-militaire-milieu-20e";
import { epaule_semi_auto_style_chasse } from "@/utils/firearms-utils/epaule-semi-auto-style-chasse";
const store = useStore();
Expand Down Expand Up @@ -60,7 +63,10 @@ type HasDummyOptions =
| typeof pistolet_semi_auto_moderne
| typeof semi_auto_style_militaire_autre
| typeof revolver
| typeof epaule_a_pompe;
| typeof epaule_a_pompe
| typeof epaule_a_levier_sous_garde
| typeof epaule_semi_auto_style_militaire_milieu_20e
| typeof epaule_semi_auto_style_chasse;
</script>

<template>
Expand Down

0 comments on commit 58d8bd6

Please sign in to comment.