Skip to content

Commit

Permalink
Sauvegarde typeEau ✨
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentlaine committed Apr 5, 2024
1 parent e2a301f commit 91a6b41
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 73 deletions.
13 changes: 0 additions & 13 deletions .editorconfig

This file was deleted.

59 changes: 10 additions & 49 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,52 +1,13 @@
/* eslint-env node */
require('@rushstack/eslint-patch/modern-module-resolution')
const antfu = require('@antfu/eslint-config').default;

module.exports = {
root: true,
extends: [
'plugin:vue/vue3-recommended',
'@vue/eslint-config-typescript/recommended',
'standard',
],
env: {
'vue/setup-compiler-macros': true,
module.exports = antfu(
{
typescript: true,
vue: true,
},

globals: {
definePageMeta: 'readonly',
defineMeta: 'readonly',
ref: 'readonly',
},
rules: {
'jsx-quotes': [2, 'prefer-double'],
'comma-dangle': [2, 'always-multiline'],
},
overrides: [
{
files: [
'cypress/support/*.{js,ts,jsx,tsx}',
'cypress/integration/*.{spec,e2e}.{js,ts,jsx,tsx}',
'src/**/*.ct.{js,ts,jsx,tsx}',
],
extends: [
'plugin:cypress/recommended',
],
{
parserOptions: {
sourceType: 'module',
},
{
files: [
'client/**/*.{spec,test}.{js,ts,jsx,tsx}',
],
env: {
jest: true,
},
},
{
files: [
'client/pages/**/*.vue',
],
rules: {
'vue/multi-word-component-names': 'off',
},
},
],
}
},
);
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"trailingComma": "all"
}
1 change: 0 additions & 1 deletion client/components/accueil/Faq.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import faq from '../../data/faq.json'
import { Ref } from "vue";
const expandedIndex: Ref<string | null> = ref(null);
const domainName = useRuntimeConfig().public.domainName;
const email = useRuntimeConfig().public.email;
const onAccordionClick = (index: string) => {
expandedIndex.value = index !== expandedIndex.value ? index : null;
Expand Down
9 changes: 6 additions & 3 deletions client/components/mixins/Search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ const searchZone = () => {
if (!formData.address && !formData.geo) {
return;
}
addressStore.setProfile(formData.profil);
addressStore.setTypeEau(formData.typeEau);
utils.searchZones(formData.address, formData.geo, formData.profil, formData.typeEau, router, modalTitle, modalText, modalIcon, modalActions, modalOpened, loading.value);
}
Expand Down Expand Up @@ -143,5 +141,10 @@ const closeModal = (): void => {
</DsfrModal>
</template>

<style scoped lang="scss">
<style lang="scss">
.search {
.fr-select {
width: fit-content;
}
}
</style>
1 change: 1 addition & 0 deletions client/components/situation/Restrictions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ const title = computed<string>(() => {
<div class="fr-mt-4w">
<DsfrHighlight>
<b>Besoin de précision sur les restrictions ?</b><br />
<b>La zone d’alerte concernée par votre est adresse est {{ zone.nom }}</b><br />
Merci de consulter <a class="fr-link"
:href="zone.arrete.cheminFichier"
onclick="window._paq.push(['trackEvent', 'TELECHARGEMENT ARRETE', 'PROFIL', 'particulier', 1])"
Expand Down
2 changes: 1 addition & 1 deletion client/dto/zone.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Usage } from "./usage.dto";
import { Arrete } from "./arrete.dto";

export interface Zone {
idZone: string;
id: string;
type: 'SUP' | 'SOU' | 'AEP';
profil: string;
nom: string;
Expand Down
4 changes: 2 additions & 2 deletions client/layouts/basic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ onMounted(() => {
:quickLinks="quickLinks"
:key="key"
:show-beta="runTimeConfig.domainName !== 'vigieau.gouv.fr' || runTimeConfig.domainProdNotActivated === 'true'"
serviceTitle="Vigieau.gouv.fr"
serviceDescription="Phrase d'accroche">
:serviceTitle="runTimeConfig.domainName"
serviceDescription="S'informer sur les restrictions d'eau en période de sécheresse">
</DsfrHeader>
<div class="fr-mb-8w">
<div class="fr-container" v-if="runTimeConfig.appEnv !== 'prod'">
Expand Down
2 changes: 0 additions & 2 deletions client/middleware/situationAddress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ export default defineNuxtRouteMiddleware(async (to: any, from: any) => {
if (!firstAddress) {
return navigateTo({path: '/', query: to.query});
}
addressStore.setProfile(profil);
addressStore.setTypeEau(eau);
await utils.searchZones(firstAddress, null, profil, eau, useRouter());

if (!address.value && !geo.value) {
Expand Down
8 changes: 6 additions & 2 deletions client/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { useAddressStore } from '../store/address';
import { useZoneStore } from '../store/zone';
import { FetchError } from 'ofetch';
import { Geo } from '../dto/geo.dto';
import niveauxGravite from '../dto/niveauGravite';

const index = {
debounce(fn: Function, delay: number) {
Expand Down Expand Up @@ -97,7 +98,7 @@ const index = {
async searchZones(address: Address | null,
geo: Geo | null,
profile: string,
typeEau: string | null,
typeEau: string,
router: any,
modalTitle?: Ref<string>,
modalText?: Ref<string>,
Expand Down Expand Up @@ -143,6 +144,8 @@ const index = {
}

address ? setAddress(address) : setGeo(geo);
addressStore.setProfile(profile);
addressStore.setTypeEau(typeEau);
setZones(data?.value ? data.value : []);
let query: any = {};
query.profil = profile;
Expand Down Expand Up @@ -204,10 +207,11 @@ const index = {
},

generatePopupHtml(pmtilesData: any) {
const niveauGravite = niveauxGravite.find(n => n.niveauGravite === pmtilesData.niveauGravite);
let popupHtml = `
<div class="map-popup-zone">${pmtilesData.nom}</div>
<div class="fr-my-1w">
<p class="fr-badge situation-level-bg-${this.getRestrictionRank(pmtilesData.niveauGravite)}">${pmtilesData.niveauGravite}</p>
<p class="fr-badge situation-level-bg-${this.getRestrictionRank(pmtilesData.niveauGravite)}">${niveauGravite.text}</p>
</div>
<div>
<button class="fr-btn btn-map-popup">
Expand Down

0 comments on commit 91a6b41

Please sign in to comment.