Skip to content

Commit

Permalink
refactor: ♻️ refactoring files and folders
Browse files Browse the repository at this point in the history
  • Loading branch information
nutfdt committed Dec 12, 2024
1 parent e8fc31c commit 279c12d
Show file tree
Hide file tree
Showing 19 changed files with 20 additions and 125 deletions.
2 changes: 2 additions & 0 deletions frontend/src/auto-imports.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// @ts-nocheck
// noinspection JSUnusedGlobalSymbols
// Generated by unplugin-auto-import
// biome-ignore lint: disable
export {}
declare global {
const EffectScope: (typeof import("vue"))["EffectScope"];
Expand Down Expand Up @@ -316,6 +317,7 @@ declare global {
} from "vue";
import("vue");
}

// for vue template auto import
import { UnwrapRef } from "vue";
declare module "vue" {
Expand Down
8 changes: 2 additions & 6 deletions frontend/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ export {};
declare module 'vue' {
export interface GlobalComponents {
AskingExpert: typeof import('./components/AskingExpert.vue')['default']
AuthCallback: (typeof import("./components/authentication/AuthCallback.vue"))["default"]
AuthRedirect: (typeof import("./components/authentication/AuthRedirect.vue"))["default"]
ContactExpert: typeof import('./components/ContactExpert.vue')['default']
copy: (typeof import("./components/authentification/AuthRedirect copy.vue"))["default"]
DsfrAlert: typeof import('@gouvminint/vue-dsfr')['DsfrAlert']
DsfrButton: typeof import('@gouvminint/vue-dsfr')['DsfrButton']
DsfrCheckbox: typeof import('@gouvminint/vue-dsfr')['DsfrCheckbox']
Expand All @@ -21,20 +18,19 @@ declare module 'vue' {
DsfrModal: typeof import('@gouvminint/vue-dsfr')['DsfrModal']
DsfrPicture: typeof import('@gouvminint/vue-dsfr')['DsfrPicture']
DsfrRadioButton: typeof import('@gouvminint/vue-dsfr')['DsfrRadioButton']
DsfrRadioButtonSet: typeof import('@gouvminint/vue-dsfr')['DsfrRadioButtonSet']
DsfrSelect: typeof import('@gouvminint/vue-dsfr')['DsfrSelect']
DsfrStepper: typeof import('@gouvminint/vue-dsfr')['DsfrStepper']
DsfrTable: typeof import('@gouvminint/vue-dsfr')['DsfrTable']
DsfrTag: typeof import('@gouvminint/vue-dsfr')['DsfrTag']
HeaderMain: typeof import('./components/HeaderMain.vue')['default']
MissingCardAlert: typeof import('./components/MissingCardAlert.vue')['default']
OnboardingSwiper: typeof import('./components/OnboardingSwiper.vue')['default']
PopupContact: typeof import('./components/PopupContact.vue')['default']
PopupVideo: typeof import('./components/PopupVideo.vue')['default']
ResultPage: typeof import('./components/ResultPage.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
SnackbarAlert: typeof import('./components/SnackbarAlert.vue')['default']
StepsGuide: typeof import('./components/StepsGuide.vue')['default']
User: (typeof import("./components/authentication/User.vue"))["default"]
VIcon: typeof import('@gouvminint/vue-dsfr')['VIcon']
}
}
2 changes: 1 addition & 1 deletion frontend/src/components/AskingExpert.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async function sendTutorialFeedback() {
console.log(error);
setMessage({
type: "error",
message: "Une erreur a eu lieu en enregistrant de votre message.",
message: "Une erreur a eu lieu en enregistrant votre message.",
});
})
.finally(() =>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/ContactExpert.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
icon="ri-alert-line"
label="Contacter un expert"
data-testid="expert-path"
@click="$router.push({ name: 'ExpertSituation' })"
@click="$router.push({ name: 'ExpertContact' })"
/>
</div>
</template>
Expand Down
1 change: 0 additions & 1 deletion frontend/src/components/HeaderMain.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import { computed } from "vue";
import { useRoute } from "vue-router";
import type { DsfrHeader } from "@gouvminint/vue-dsfr";
import basegunLogo from "@/assets/basegun.png";
const route = useRoute();
Expand Down
88 changes: 0 additions & 88 deletions frontend/src/components/PopupContact.vue

This file was deleted.

2 changes: 0 additions & 2 deletions frontend/src/components/StepsGuide.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script lang="ts" setup>
import { DsfrStepper } from "@gouvminint/vue-dsfr";
withDefaults(
defineProps<{
currentStep: number;
Expand Down
10 changes: 5 additions & 5 deletions frontend/src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ const IdentificationFurtherInformations = () =>
);
const IdentificationSelectAmmo = () =>
import("@/views/GuideIdentificationFirearm/IdentificationSelectAmmo.vue");
const ExpertSituation = () =>
import("@/views/GuideContactExpert/ExpertSituation.vue");
const ExpertContact = () =>
import("@/views/GuideAskingExpertise/ExpertContact.vue");

const routes: RouteRecordRaw[] = [
{
Expand Down Expand Up @@ -201,8 +201,8 @@ const routes: RouteRecordRaw[] = [
},
{
path: "/guide-contact",
name: "ExpertSituation",
component: ExpertSituation,
name: "ExpertContact",
component: ExpertContact,
beforeEnter: (to, from, next) => {
mgr.getUser().then((user) => {
if (user === null) {
Expand Down Expand Up @@ -247,7 +247,7 @@ const routes: RouteRecordRaw[] = [
await mgr.signinCallback();
const user = await mgr.getUser();
if (user !== null) {
next({ name: "ExpertSituation" });
next({ name: "ExpertContact" });
} else {
next({ name: "AuthRedirect" });
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import levierSousGardePasMagasinVideo from "@/assets/guide-mise-en-securite/vide
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,
getEpauleLevierVerrouDisclaimer,
getCommonCategory,
} from "@/utils/firearms-utils/index";
/*
Expand Down Expand Up @@ -65,5 +65,5 @@ export const epaule_a_levier_sous_garde = {
img_ammo: levierSousGardeBalls,
},
],
getDisclaimer: getEpaulLevierVerrouDisclaimer,
getDisclaimer: getEpauleLevierVerrouDisclaimer,
} as const;
4 changes: 2 additions & 2 deletions frontend/src/utils/firearms-utils/epaule-a-verrou.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import epauleAVerrouCartridges from "@/assets/guide-identification/photos/epaule
import epauleAVerrouBalls from "@/assets/guide-identification/photos/epaule_a_verrou/epaule_a_verrou_chargeur_bille.jpg";
import epauleAVerrouVideo from "@/assets/guide-mise-en-securite/videos/epaule_a_verrou/epaule_verrou_chargeur-video.mp4";
import {
getEpaulLevierVerrouDisclaimer,
getEpauleLevierVerrouDisclaimer,
getCommonCategory,
} from "@/utils/firearms-utils/index";
import PopupVideo from "@/components/PopupVideo.vue";
Expand Down Expand Up @@ -43,5 +43,5 @@ export const epaule_a_verrou = {
img_ammo: epauleAVerrouBalls,
},
],
getDisclaimer: getEpaulLevierVerrouDisclaimer,
getDisclaimer: getEpauleLevierVerrouDisclaimer,
} as const;
2 changes: 1 addition & 1 deletion frontend/src/utils/firearms-utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const MEASURED_GUNS_TYPOLOGIES = [
"epaule_semi_auto_style_chasse",
];

export function getEpaulLevierVerrouDisclaimer(
export function getEpauleLevierVerrouDisclaimer(
category: string,
isCardDetected: boolean,
) {
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/views/AccessibilityPage.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script lang="ts" setup>
import { DsfrTable } from "@gouvminint/vue-dsfr";
const headers = ref(["Date", "Action"]);
const rows = ref([
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<script lang="ts" setup>
import { ref } from "vue";
import { DsfrButton } from "@gouvminint/vue-dsfr";
import { DateTime } from "luxon";
import { mgr } from "@/utils/authentication";
import { getContactDetails } from "@/api/api-client";
Expand Down
1 change: 0 additions & 1 deletion frontend/src/views/GuideAskingExpertise/ExpertiseForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,6 @@ import { sendExpertiseForm } from "@/api/api-client";
import { mgr } from "@/utils/authentication";
import { DateTime } from "luxon";
const test = ref("");
const steps = [
"Identification du demandeur",
"Informations sur l'arme",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import { computed } from "vue";
import { useStore } from "@/stores/result";
const store = useStore();
const alarmGunException = computed(() => store.alarmGunException);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@
import { ref, computed, onMounted } from "vue";
import { useStore } from "@/stores/result";
import { TYPOLOGIES } from "@/utils/firearms-utils/index";
import TransparentMagazine from "@/assets/guide-identification/photos/semi_auto_militaire_autre/autre-epaule-transparent-magazine.jpg";
import FocusTransparentMagazine from "@/assets/guide-identification/photos/semi_auto_militaire_autre/autre-epaule-transparent-magazine-focus.jpg";
import { TYPOLOGIES } from "@/utils/firearms-utils/index";
const store = useStore();
const typology = computed(() => store.typology);
const selectedAmmo = computed({
get() {
return store.selectedAmmo;
Expand All @@ -21,7 +19,6 @@ const selectedAmmo = computed({
});
const zoom = ref("");
const zoomOn = (imgValue: string) => {
zoom.value = imgValue;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
TYPOLOGIES,
} from "@/utils/firearms-utils/index";
import { isUserUsingCrosscall } from "@/utils/isUserUsingCrosscall";
import { DsfrButton } from "@gouvminint/vue-dsfr";
const store = useStore();
Expand Down
8 changes: 2 additions & 6 deletions frontend/src/views/InstructionsPage.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script lang="ts" setup>
import GoodExamplePhoto from "@/assets/instruction-screen-gun.webp";
import { ref } from "vue";
import axios from "axios";
import { useRouter, useRoute } from "vue-router";
Expand All @@ -9,6 +7,8 @@ import { useStore } from "@/stores/result";
import { getNextRouteAfterResult } from "@/utils/firearms-utils/get-next-route-after-result";
import { isUserUsingComputer } from "@/utils/isUserUsingComputer";
import GoodExamplePhoto from "@/assets/instruction-screen-gun.webp";
const loading = ref(false);
const fileInput = ref<HTMLInputElement | null>(null);
Expand Down Expand Up @@ -68,10 +68,6 @@ async function uploadImage(base64: string, fileName: string) {
}
}
onMounted(() => {
console.log(window.navigator.userAgent);
});
const labelButton = computed(() => {
if (isUserUsingComputer()) {
return "Télécharger la photo";
Expand Down
1 change: 1 addition & 0 deletions frontend/src/views/MissingCardPage.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script lang="ts" setup>
import { useStore } from "@/stores/result";
const store = useStore();
</script>

Expand Down

0 comments on commit 279c12d

Please sign in to comment.