Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update LPS phone number and email #331

Merged
merged 2 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 14 additions & 37 deletions frontend/src/components/ContactExpert.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,27 @@ function onClose () {
</div>
<Teleport to="body">
<DsfrModal
title=""
:opened="showModal"
@close="onClose()"
>
<div class="modal">
<div class="modal-content" />
<h2>
<VIcon
name="ri-arrow-right-line"
scale="1.5"
/>
Contact à un expert arme
</h2>
<p>
Sélectionnez ci-dessous votre corps de métier <br>
</p>
<div>
<div class="fr-col-11 fr-col-lg-6 mx-auto">
<div class="modal-content">
<h2>
<VIcon
name="ri-arrow-right-line"
scale="1.5"
/>
Contacter un expert arme
</h2>
<p>Sélectionnez ci-dessous votre corps de métier.</p>
<div>
<DsfrButton
class="m-1 flex justify-center w-80"
class="w-100 m-1"
label="Police Nationale"
@click="router.push({ name:'ExpertSituationPN'})"
/>
<DsfrButton
class="m-1 flex justify-center w-80"
class="w-100 m-1"
label="Gendarmerie Nationale"
@click="router.push({ name:'ExpertSituationGN'})"
/>
Expand All @@ -62,27 +58,8 @@ function onClose () {
margin: auto !important;
}

.modal {
display: flex;
flex-direction: column;
}

.modal-content {
flex: 1;
overflow-y: auto;
}

.modal-footer {
position: sticky;
bottom: 0;
text-align: center;
background-color: #f5f5fe;
box-shadow: 0 -4px 16px rgb(0 0 0 / 25%);
padding: 1rem !important;
width: 100%;
}
.modal-footer button {
width: 100%;
.w-100 {
width: 100% !important;
}

</style>
3 changes: 3 additions & 0 deletions frontend/src/components/ResultPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { ref, computed, watchEffect } from 'vue'
import axios from 'axios'
import SnackbarAlert from '@/components/SnackbarAlert.vue'
import { resultTree } from '@/utils/firearms-utils/index'
import { isUserUsingCrosscall } from '@/utils/isUserUsingCrosscall'
import { useSnackbarStore } from '@/stores/snackbar'
import { useStepsStore } from '@/stores/steps'
import { useResultStore } from '@/stores/result'
Expand Down Expand Up @@ -122,6 +123,7 @@ function sendFeedback (isCorrect: boolean) {
<p class="text-sm font-normal m-4 text-left text-current">
Nous n'avons pas suffisamment d'éléments pour fournir une réponse fiable. Nous vous conseillons de faire appel à un expert.
</p>
<ContactExpert v-if="isUserUsingCrosscall()" />
</div>
<div v-else>
<div class="fr-tile__body">
Expand All @@ -141,6 +143,7 @@ function sendFeedback (isCorrect: boolean) {
<p class="warning-text">
Nous vous conseillons de faire appel à un expert pour confirmer cette réponse.
</p>
<ContactExpert v-if="isUserUsingCrosscall()" />
</div>
<div v-if="isDummy === false && (route.name !== 'IdentificationTypologyResult'|| isDummyTypology !== true)">
<p
Expand Down
19 changes: 3 additions & 16 deletions frontend/src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ const IdentificationTypologyResult = () => import('@/views/GuideIdentificationFi
const IdentificationFinalResult = () => import('@/views/GuideIdentificationFirearm/IdentificationFinalResult.vue')
const IdentificationFurtherInformations = () => import('@/views/GuideIdentificationFirearm/IdentificationFurtherInformations.vue')
const IdentificationSelectAmmo = () => import('@/views/GuideIdentificationFirearm/IdentificationSelectAmmo.vue')
const ExpertSituationPN = () => import('@/views/GuideContactExpert/ExpertSituationPN.vue')
const ExpertSituationGN = () => import('@/views/GuideContactExpert/ExpertSituationGN.vue')
const ExpertPTS = () => import('@/views/GuideContactExpert/ExpertPTS.vue')
const ExpertPTSNU = () => import('@/views/GuideContactExpert/ExpertPTSNU.vue')
const ExpertSituation = () => import('@/views/GuideContactExpert/ExpertSituation.vue')

const routes: Parameters<typeof createRouter> [0]['routes'] = [
{
Expand Down Expand Up @@ -180,22 +177,12 @@ const routes: Parameters<typeof createRouter> [0]['routes'] = [
{
path: '/guide-contact-pn',
name: 'ExpertSituationPN',
component: ExpertSituationPN,
component: ExpertSituation,
},
{
path: '/guide-contact-gn',
name: 'ExpertSituationGN',
component: ExpertSituationGN,
},
{
path: '/guide-contact-pn/urgence',
name: 'ExpertPTS',
component: ExpertPTS,
},
{
path: '/guide-contact-pn/non-urgence',
name: 'ExpertPTSNU',
component: ExpertPTSNU,
component: ExpertSituation,
},
]

Expand Down
9 changes: 9 additions & 0 deletions frontend/src/utils/isUserUsingCrosscall.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export function isUserUsingCrosscall () {
const userAgent = window.navigator.userAgent
const keyWords = ['Mobile', 'Mozilla', 'Crosscall']

const isUsingCrosscall = keyWords.every(keyWord => {
return userAgent.includes(keyWord)
})
return isUsingCrosscall
}
Loading
Loading