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

feat: ♻️ refactor start page #161

Merged
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
4 changes: 2 additions & 2 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ ARG NODE_EXTRA_CA_CERTS
COPY ./cert/. /etc/ssl/certs/

# downgrade npm version to avoid chokidar error
RUN npm install -g npm@8
# RUN npm install -g npm@8

COPY ./package.json ./package-lock.json ./
RUN npm ci
RUN npm ci --legacy-peer-deps

COPY src ./src
COPY public ./public
Expand Down
1,272 changes: 504 additions & 768 deletions frontend/package-lock.json

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,32 @@
"pretest:unit": "npm run lint"
},
"dependencies": {
"@gouvfr/dsfr": "^1.9.2",
"@gouvfr/dsfr": "^1.9.3",
"@gouvminint/vue-dsfr": "3.6.0",
"@vue/compat": "^3.3.2",
"@vue/compat": "^3.3.4",
"@vueuse/core": "^10.1.2",
"axios": "^1.4.0",
"pinia": "^2.1.0",
"pinia": "^2.1.3",
"stylelint-config-recommended-vue": "^1.4.0",
"vite": "^4.3.7",
"vue": "^3.3.2",
"vue-router": "^4.2.0"
"vite": "^4.3.8",
"vue": "^3.3.4",
"vue-router": "^4.2.1"
},
"devDependencies": {
"@unocss/transformer-directives": "^0.51.13",
"@unocss/transformer-variant-group": "^0.51.13",
"@unocss/transformer-directives": "^0.52.3",
"@unocss/transformer-variant-group": "^0.52.3",
"@vitejs/plugin-vue": "^4.2.3",
"eslint": "^8.40.0",
"eslint": "^8.41.0",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-cypress": "^2.13.3",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-n": "^15.7.0",
"eslint-plugin-n": "^16.0.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-vue": "^9.13.0",
"eslint-plugin-vue": "^9.14.0",
"stylelint": "^15.6.2",
"stylelint-config-standard": "^33.0.0",
"unocss": "^0.51.13",
"vite-plugin-pwa": "^0.14.7",
"unocss": "^0.52.3",
"vite-plugin-pwa": "^0.15.1",
"workbox-window": "^6.5.4"
},
"browserslist": [
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/HeaderMain.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const quickLinks = [
]

function onClickOnLogo () {
router.push({ name: 'Start' })
router.push({ name: 'StartPage' })
}

function onClickOnInfo (event) {
Expand Down
10 changes: 5 additions & 5 deletions frontend/src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useResultStore } from '@/stores/result.js'
import { useStepsStore } from '@/stores/steps.js'

const HomePage = () => import('@/views/HomePage.vue')
const Start = () => import('@/views/Start.vue')
const StartPage = () => import('@/views/StartPage.vue')
const Instructions = () => import('@/views/Instructions.vue')
const Result = () => import('@/views/Result.vue')
const Error = () => import('@/views/Error.vue')
Expand Down Expand Up @@ -34,8 +34,8 @@ const routes = [
},
{
path: '/accueil',
name: 'Start',
component: Start,
name: 'StartPage',
component: StartPage,
meta: {
displayHeader: true,
},
Expand Down Expand Up @@ -69,7 +69,7 @@ const routes = [
if (stepsStore.currentStep !== 0 && resultStore.img) {
return true
}
return { name: 'Start' }
return { name: 'StartPage' }
},
children: [
{
Expand Down Expand Up @@ -106,7 +106,7 @@ const routes = [
if (resultStore.img) {
return true
}
return { name: 'Start' }
return { name: 'StartPage' }
},
},
{
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:'Start'}"
:to="{name:'StartPage'}"
>
<DsfrButton
label="Retour"
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/views/GuideFactice/GuideFactice.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const goToNextStep = () => (

watchEffect(() => {
if (!resultStore.img) {
router.push({ name: 'Start' })
router.push({ name: 'StartPage' })
}
})

Expand Down Expand Up @@ -112,7 +112,7 @@ onBeforeUnmount(() => { metaViewport.setAttribute('content', 'width=device-width
</div>
<div class="m-2">
<router-link
:to="{ name: 'Start' }"
:to="{ name: 'StartPage' }"
>
<img
class="go-home"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/HomePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</div>
<router-link
v-slot="{navigate}"
:to="{name:'Start'}"
:to="{name:'StartPage'}"
>
<DsfrButton
id="agree-button"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/PageNotFound.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<p>Vous avez saisi ou suivi un lien vers une page qui n'existe pas.</p>
<router-link
v-slot="{navigate}"
:to="{name: 'Start'}"
:to="{name: 'StartPage'}"
>
<DsfrButton
label="Retour"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/Result.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const resultStore = useResultStore()
const router = useRouter()

watchEffect(() => {
if (!resultStore.img) router.push({ name: 'Start' })
if (!resultStore.img) router.push({ name: 'StartPage' })
})

const confidence = computed(() => resultStore.confidence)
Expand Down
18 changes: 16 additions & 2 deletions frontend/src/views/Start.vue → frontend/src/views/StartPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,31 @@
<p class="accueil-subtitle">
Identification automatique des armes à feu
</p>
<router-link
v-slot="{navigate}"
:to="{name:'StartPage'}"
>
<DsfrButton
class=" w-14rem mb-4 p-2 whitespace-pre-line"
label="Je veux mettre en sécurité mon arme"
size="small"
@click="navigate()"
/>
</router-link>
<router-link
v-slot="{navigate}"
:to="{name:'Instructions'}"
>
<DsfrButton
label="Démarrer"
class=" w-14rem mb-4 p-2 whitespace-pre-line"
label="J’ai déjà mis mon arme en sécurité, je veux l’identifier"
size="small"
@click="navigate()"
/>
</router-link>
<div class="footer footer-up footer-text">
Basegun est un outil d'aide à la décision. Il ne remplace en aucun cas l'avis d'un expert.
Basegun est un <span class="font-bold">outil d'aide à la décision</span>.
Il <span class="font-bold">ne remplace en aucun cas l'avis d'un expert</span>.
</div>
</div>
</template>
Expand Down