codevdesign 1.0.33 → 1.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +12 -6
- package/assets/csqc.css +0 -259
- package/composants/csqcAide.vue +0 -55
- package/composants/csqcAlerteErreur.vue +0 -87
- package/composants/csqcChaise/chaiseConteneur.vue +0 -367
- package/composants/csqcChaise/chaiseItem.vue +0 -54
- package/composants/csqcCodeBudgetaireGenerique.vue +0 -336
- package/composants/csqcConfirmation.vue +0 -75
- package/composants/csqcDate.vue +0 -57
- package/composants/csqcDialogue.vue +0 -118
- package/composants/csqcEditeurTexteRiche.vue +0 -380
- package/composants/csqcEntete.vue +0 -163
- package/composants/csqcImportCSV.vue +0 -125
- package/composants/csqcModaleSaisie.vue +0 -95
- package/composants/csqcOptionSwitch.vue +0 -120
- package/composants/csqcRecherche.vue +0 -213
- package/composants/csqcRechercheUtilisateur.vue +0 -197
- package/composants/csqcSnackbar.vue +0 -88
- package/composants/csqcTable/csqcTable.vue +0 -383
- package/composants/csqcTable/csqcTableExportExcel.vue +0 -58
- package/composants/csqcTable/csqcTableModaleChoixColonnes.vue +0 -586
- package/composants/csqcTexteBilingue.vue +0 -175
- package/composants/csqcTiroir.vue +0 -156
- package/composants/gabarit/csqcMenu.vue +0 -281
- package/composants/gabarit/pivEntete.vue +0 -205
- package/composants/gabarit/pivPiedPage.vue +0 -70
- package/composants/gabarit/vueDefault.vue +0 -5
- package/composants/validateurs.ts +0 -183
- package/enums/choixLangue.ts +0 -10
- package/index.ts +0 -74
- package/locales/en.json +0 -100
- package/locales/fr.json +0 -101
- package/modeles/apiReponse.ts +0 -12
- package/modeles/assurancesAssuranceGeneraleGrics.ts +0 -10
- package/modeles/assurancesAssurancePersonnelleGrics.ts +0 -13
- package/modeles/assurancesContratGrics.ts +0 -14
- package/modeles/assurancesDetailsPrimeReguliereGrics.ts +0 -12
- package/modeles/assurancesDonneesAssureurGrics.ts +0 -13
- package/modeles/assurancesEmployeGrics.ts +0 -11
- package/modeles/assurancesGrics.ts +0 -14
- package/modeles/assurancesRegimeAssuranceGrics.ts +0 -9
- package/modeles/assurancesRegimeBaseEmployeurGrics.ts +0 -9
- package/modeles/assurancesRegimeBaseGrics.ts +0 -9
- package/modeles/composants/csqcMenuModele.ts +0 -18
- package/modeles/composants/datatableColonne.ts +0 -31
- package/modeles/composants/snackbar.ts +0 -18
- package/modeles/data.ts +0 -24
- package/modeles/droitIntervention.ts +0 -14
- package/modeles/employeAdresseGrics.ts +0 -13
- package/modeles/employeAdressesPersonnellesGrics.ts +0 -12
- package/modeles/employeAffectationCorpsEmploiGrics.ts +0 -9
- package/modeles/employeBanquesCongeBanqueGrics.ts +0 -9
- package/modeles/employeBanquesCongeGrics.ts +0 -14
- package/modeles/employeBanquesCongeRegimeAbsenceGrics.ts +0 -9
- package/modeles/employeCourrielsPersonnels.ts +0 -9
- package/modeles/employeCourrielsProfessionnels.ts +0 -9
- package/modeles/employeEmploisCategorieGrics.ts +0 -9
- package/modeles/employeEmploisClasseGrics.ts +0 -9
- package/modeles/employeEmploisCorpsEmploiGrics.ts +0 -9
- package/modeles/employeEmploisEtatEmploiGrics.ts +0 -9
- package/modeles/employeEmploisGrics.ts +0 -37
- package/modeles/employeEmploisGroupePaieGrics.ts +0 -9
- package/modeles/employeEmploisLieuTravailPrincipalGrics.ts +0 -10
- package/modeles/employeEmploisLieuxTravailSecondairesGrics.ts +0 -10
- package/modeles/employeEmploisRegimeAbsenceGrics.ts +0 -9
- package/modeles/employeEmploisSecteurGrics.ts +0 -9
- package/modeles/employeEmploisStatutEngagementGrics.ts +0 -9
- package/modeles/employeExperienceEmploiGrics.ts +0 -9
- package/modeles/employeExperienceEmployeGrics.ts +0 -12
- package/modeles/employeExperienceExperiencesGrics.ts +0 -11
- package/modeles/employeExperienceExperiencesTotalesGrics.ts +0 -15
- package/modeles/employeExperienceGrics.ts +0 -17
- package/modeles/employeGrics.ts +0 -31
- package/modeles/employeMinsLsCodev.ts +0 -10
- package/modeles/employeTelephoneGrics.ts +0 -12
- package/modeles/employeTelephonesPersonnelsGrics.ts +0 -11
- package/modeles/employeTelephonesProfessionnelsGrics.ts +0 -11
- package/modeles/groupeCE.ts +0 -14
- package/modeles/groupeCEIntervalle.ts +0 -13
- package/modeles/historiquesAbsenceBanqueGrics.ts +0 -9
- package/modeles/historiquesAbsenceGrics.ts +0 -21
- package/modeles/historiquesAbsenceLieuTravailGrics.ts +0 -9
- package/modeles/historiquesAbsenceSousBanqueGrics.ts +0 -9
- package/modeles/intervention.ts +0 -35
- package/modeles/motifsAbsenceBanque.ts +0 -9
- package/modeles/motifsAbsenceGrics.ts +0 -17
- package/modeles/motifsAbsenceRegimeAbsence.ts +0 -9
- package/modeles/motifsAbsenceSousMotifs.ts +0 -9
- package/modeles/motifsAbsenceTraitementBanques.ts +0 -11
- package/modeles/notificationGabaritDefaut.ts +0 -10
- package/modeles/response.ts +0 -12
- package/modeles/role.ts +0 -31
- package/modeles/roleMin.ts +0 -12
- package/modeles/syndicat.ts +0 -26
- package/modeles/syndicatGroupeCe.ts +0 -10
- package/modeles/syndicatResponsable.ts +0 -15
- package/modeles/syndicatUnite.ts +0 -10
- package/modeles/typeEnseignement.ts +0 -14
- package/modeles/typeTelephone.ts +0 -12
- package/modeles/unite.ts +0 -23
- package/modeles/uniteTypeEnseignement.ts +0 -12
- package/modeles/utilisateur.ts +0 -15
- package/outils/appAxios.ts +0 -116
- package/outils/csqcOutils.ts +0 -366
- package/outils/rafraichisseurToken.ts +0 -187
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<v-toolbar
|
|
3
|
-
color="primary"
|
|
4
|
-
height="72px"
|
|
5
|
-
elevation="1"
|
|
6
|
-
>
|
|
7
|
-
<v-row
|
|
8
|
-
class="pl-6 pr-6"
|
|
9
|
-
align="center"
|
|
10
|
-
no-gutters
|
|
11
|
-
>
|
|
12
|
-
<!-- Première colonne : Logo -->
|
|
13
|
-
<v-col cols="auto">
|
|
14
|
-
<a
|
|
15
|
-
:href="href"
|
|
16
|
-
:target="cssUrlValide ? '_blank' : undefined"
|
|
17
|
-
:rel="cssUrlValide ? 'noopener noreferrer' : undefined"
|
|
18
|
-
>
|
|
19
|
-
<!-- Placeholder (même taille) pendant la décision -->
|
|
20
|
-
<div
|
|
21
|
-
v-if="!ready"
|
|
22
|
-
class="logo-placeholder"
|
|
23
|
-
></div>
|
|
24
|
-
<!-- On ne rend l'image qu'une fois la source choisie -->
|
|
25
|
-
<img
|
|
26
|
-
v-else
|
|
27
|
-
class="logo-img"
|
|
28
|
-
id="pivImage"
|
|
29
|
-
:src="currentSrc!"
|
|
30
|
-
:alt="$t('csqc.pivFooter.logoAlt')"
|
|
31
|
-
decoding="async"
|
|
32
|
-
loading="eager"
|
|
33
|
-
@error="ErreurLogo"
|
|
34
|
-
/>
|
|
35
|
-
</a>
|
|
36
|
-
</v-col>
|
|
37
|
-
|
|
38
|
-
<!-- Colonne pour le nom de l'application (Pour le mode desktop) -->
|
|
39
|
-
<v-col
|
|
40
|
-
v-if="!estMobile"
|
|
41
|
-
class="d-flex justify-center"
|
|
42
|
-
>
|
|
43
|
-
<v-app-bar-title
|
|
44
|
-
class="pl-12 ml-12"
|
|
45
|
-
style="font-size: 16px !important"
|
|
46
|
-
>
|
|
47
|
-
{{ formulaireNom }}
|
|
48
|
-
</v-app-bar-title>
|
|
49
|
-
</v-col>
|
|
50
|
-
|
|
51
|
-
<!-- Colonne pour le bouton de langue et icône d'aide -->
|
|
52
|
-
<v-col class="d-none d-flex justify-end">
|
|
53
|
-
<!-- langue -->
|
|
54
|
-
<v-btn
|
|
55
|
-
variant="text"
|
|
56
|
-
@click="enregistrerLangue()"
|
|
57
|
-
>{{ $t('csqc.pivEntete.langue') }}
|
|
58
|
-
</v-btn>
|
|
59
|
-
|
|
60
|
-
<!-- icône d'aide si dispo -->
|
|
61
|
-
<v-btn
|
|
62
|
-
v-if="aideUrl"
|
|
63
|
-
icon="mdi-help-circle-outline"
|
|
64
|
-
:href="aideUrl"
|
|
65
|
-
target="_blank"
|
|
66
|
-
rel="noopener noreferrer"
|
|
67
|
-
style="margin-top: -6px"
|
|
68
|
-
>
|
|
69
|
-
</v-btn>
|
|
70
|
-
|
|
71
|
-
<slot name="droite"></slot>
|
|
72
|
-
</v-col>
|
|
73
|
-
|
|
74
|
-
<!-- Colonne pour le nom de l'application (Pour le mode mobile) -->
|
|
75
|
-
<v-col
|
|
76
|
-
v-if="props.estMobile"
|
|
77
|
-
cols="12"
|
|
78
|
-
>
|
|
79
|
-
<v-app-bar-title style="font-size: 16px !important">
|
|
80
|
-
{{ formulaireNom }}
|
|
81
|
-
</v-app-bar-title>
|
|
82
|
-
</v-col>
|
|
83
|
-
</v-row>
|
|
84
|
-
</v-toolbar>
|
|
85
|
-
</template>
|
|
86
|
-
|
|
87
|
-
<script setup lang="ts">
|
|
88
|
-
import { ref, watch, computed } from 'vue'
|
|
89
|
-
import { useLocale } from 'vuetify'
|
|
90
|
-
import { useI18n } from 'vue-i18n'
|
|
91
|
-
|
|
92
|
-
const { current } = useLocale()
|
|
93
|
-
const props = defineProps({
|
|
94
|
-
estMobile: { type: Boolean, default: false },
|
|
95
|
-
urlBase: { type: String, required: true },
|
|
96
|
-
aideUrl: { type: String, default: '' },
|
|
97
|
-
cssUrl: { type: String, default: '' },
|
|
98
|
-
logoUrl: { type: String, default: '' },
|
|
99
|
-
lienLogo: { type: String, default: '' },
|
|
100
|
-
formulaireId: { type: Number, default: 0 },
|
|
101
|
-
formulaireNom: { type: String, default: '' },
|
|
102
|
-
})
|
|
103
|
-
const emit = defineEmits(['changementLangue'])
|
|
104
|
-
const { t } = useI18n()
|
|
105
|
-
|
|
106
|
-
const FALLBACK = '/images/QUEBEC_blanc.svg'
|
|
107
|
-
const currentSrc = ref<string | null>(null) // pas d'image tant que null
|
|
108
|
-
const ready = ref(false)
|
|
109
|
-
|
|
110
|
-
const formulaireNom = computed(() => {
|
|
111
|
-
return props.formulaireNom || t('nom_application')
|
|
112
|
-
})
|
|
113
|
-
|
|
114
|
-
const href = computed(() => (props.cssUrl?.trim() ? props.cssUrl.trim() : '/'))
|
|
115
|
-
const cssUrlValide = computed(() => /^https?:\/\//i.test(href.value))
|
|
116
|
-
|
|
117
|
-
let loadToken = 0 // ← identifiant de “requête” pour annuler logiquement
|
|
118
|
-
|
|
119
|
-
// Sur changement de l’URL du logo, on tente de le charger, sinon fallback apres 3.5 secs
|
|
120
|
-
watch(
|
|
121
|
-
() => props.logoUrl,
|
|
122
|
-
async (nouvelle, ancienne) => {
|
|
123
|
-
const url = (nouvelle ?? '').trim()
|
|
124
|
-
|
|
125
|
-
// même URL → ne rien faire
|
|
126
|
-
if (url === (ancienne ?? '').trim() && currentSrc.value !== null) return
|
|
127
|
-
|
|
128
|
-
// pas d’URL → fallback immédiat
|
|
129
|
-
if (!url) {
|
|
130
|
-
currentSrc.value = FALLBACK
|
|
131
|
-
ready.value = true
|
|
132
|
-
return
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
// nouvelle tentative (avec “annulation logique”)
|
|
136
|
-
const token = ++loadToken
|
|
137
|
-
ready.value = false
|
|
138
|
-
const ok = await loadWithTimeout(url, 3500)
|
|
139
|
-
if (token !== loadToken) return // une nouvelle tentative a démarré entre-temps
|
|
140
|
-
|
|
141
|
-
currentSrc.value = ok ? url : FALLBACK
|
|
142
|
-
ready.value = true
|
|
143
|
-
},
|
|
144
|
-
{ immediate: true },
|
|
145
|
-
)
|
|
146
|
-
|
|
147
|
-
// Charge une image avec un timeout
|
|
148
|
-
function loadWithTimeout(url: string, timeoutMs: number): Promise<boolean> {
|
|
149
|
-
return new Promise<boolean>(resolve => {
|
|
150
|
-
const img = new Image()
|
|
151
|
-
const timer = setTimeout(() => {
|
|
152
|
-
// trop long → on abandonne
|
|
153
|
-
img.src = '' // stoppe le chargement
|
|
154
|
-
resolve(false)
|
|
155
|
-
}, timeoutMs)
|
|
156
|
-
|
|
157
|
-
img.onload = () => {
|
|
158
|
-
clearTimeout(timer)
|
|
159
|
-
resolve(true)
|
|
160
|
-
}
|
|
161
|
-
img.onerror = () => {
|
|
162
|
-
clearTimeout(timer)
|
|
163
|
-
resolve(false)
|
|
164
|
-
}
|
|
165
|
-
img.src = url
|
|
166
|
-
})
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
// Si l'image choisie a un problème, switch sur le fallback
|
|
170
|
-
function ErreurLogo() {
|
|
171
|
-
if (currentSrc.value !== FALLBACK) currentSrc.value = FALLBACK
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
const enregistrerLangue = (): void => {
|
|
175
|
-
const langueDispo: string = current.value === 'fr' ? 'en' : 'fr'
|
|
176
|
-
let returnUrl = window.location.pathname + window.location.search
|
|
177
|
-
if (import.meta.env.MODE === 'development') {
|
|
178
|
-
returnUrl = '/'
|
|
179
|
-
}
|
|
180
|
-
window.location.href =
|
|
181
|
-
props.urlBase + `/Traducteur/SetLanguage?culture=${langueDispo}&returnUrl=${encodeURIComponent(returnUrl)}`
|
|
182
|
-
emit('changementLangue')
|
|
183
|
-
}
|
|
184
|
-
</script>
|
|
185
|
-
|
|
186
|
-
<style scoped>
|
|
187
|
-
.container {
|
|
188
|
-
max-width: none !important;
|
|
189
|
-
}
|
|
190
|
-
.theme--light.v-app-bar.v-toolbar.v-sheet {
|
|
191
|
-
background: #095797;
|
|
192
|
-
|
|
193
|
-
color: #fff;
|
|
194
|
-
}
|
|
195
|
-
.logo-placeholder {
|
|
196
|
-
height: 72px;
|
|
197
|
-
width: 180px;
|
|
198
|
-
}
|
|
199
|
-
.logo-img {
|
|
200
|
-
height: 72px;
|
|
201
|
-
transition: opacity 0.15s;
|
|
202
|
-
opacity: 1;
|
|
203
|
-
display: block;
|
|
204
|
-
}
|
|
205
|
-
</style>
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<footer>
|
|
3
|
-
<div class="footer-content">
|
|
4
|
-
<a href="https://quebec.ca">
|
|
5
|
-
<img
|
|
6
|
-
id="logoFooter"
|
|
7
|
-
alt="Gouvernement du Québec."
|
|
8
|
-
src="/images/QUEBEC_couleur.svg"
|
|
9
|
-
width="117"
|
|
10
|
-
height="35"
|
|
11
|
-
/>
|
|
12
|
-
</a>
|
|
13
|
-
<div>
|
|
14
|
-
<small>
|
|
15
|
-
<a
|
|
16
|
-
href="http://www.droitauteur.gouv.qc.ca/copyright.php"
|
|
17
|
-
target="_blank"
|
|
18
|
-
>© Gouvernement du Québec {{ anneeEnCours }}
|
|
19
|
-
</a>
|
|
20
|
-
|
|
21
|
-
<a
|
|
22
|
-
v-if="props.version"
|
|
23
|
-
:href="props.lien"
|
|
24
|
-
target="_blank"
|
|
25
|
-
><br />
|
|
26
|
-
version <span v-html="props.version"
|
|
27
|
-
/></a>
|
|
28
|
-
</small>
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
31
|
-
</footer>
|
|
32
|
-
</template>
|
|
33
|
-
|
|
34
|
-
<script setup lang="ts">
|
|
35
|
-
import { computed } from 'vue'
|
|
36
|
-
|
|
37
|
-
const props = defineProps<{
|
|
38
|
-
version?: string
|
|
39
|
-
lien?: string
|
|
40
|
-
}>()
|
|
41
|
-
|
|
42
|
-
const anneeEnCours = computed<number>(() => {
|
|
43
|
-
return new Date().getFullYear()
|
|
44
|
-
})
|
|
45
|
-
</script>
|
|
46
|
-
|
|
47
|
-
<style scoped>
|
|
48
|
-
footer {
|
|
49
|
-
display: flex;
|
|
50
|
-
justify-content: center; /* Centrer horizontalement */
|
|
51
|
-
align-items: center; /* Centrer verticalement */
|
|
52
|
-
text-align: center; /* Centrer le texte à l'intérieur des éléments */
|
|
53
|
-
height: 100px; /* Ajuster la hauteur du footer */
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.footer-content {
|
|
57
|
-
display: flex;
|
|
58
|
-
flex-direction: column; /* Disposer les éléments les uns sous les autres */
|
|
59
|
-
justify-content: center; /* Centrer verticalement à l'intérieur de .footer-content */
|
|
60
|
-
align-items: center; /* Centrer horizontalement à l'intérieur de .footer-content */
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
footer a {
|
|
64
|
-
text-decoration: none; /* Supprimer le soulignement des liens */
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
footer small {
|
|
68
|
-
margin-top: 10px; /* Ajouter de l'espace entre l'image et le texte */
|
|
69
|
-
}
|
|
70
|
-
</style>
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import { ChoixLangue } from '@/enums/choixLangue'
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Valide que le champ contient une valeur définie et non vide.
|
|
6
|
-
* Accepte les chaînes de caractères non vides, les nombres différents de 0,
|
|
7
|
-
* et toute autre valeur définie (ex. objets sélectionnés dans un v-select).
|
|
8
|
-
*
|
|
9
|
-
* @param valeur La valeur saisie ou sélectionnée dans le champ.
|
|
10
|
-
* @returns true si la valeur est considérée comme valide, sinon retourne un message d'erreur.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
export function estRequis(valeur: unknown, t: (key: string, params?: any) => string): true | string {
|
|
14
|
-
if (valeur == null) return t('csqc.validateurs.estRequis')
|
|
15
|
-
|
|
16
|
-
if (typeof valeur === 'number' && isNaN(valeur)) return t('csqc.validateurs.estRequis')
|
|
17
|
-
|
|
18
|
-
if (typeof valeur === 'string') {
|
|
19
|
-
return valeur.trim().length > 0 || t('csqc.validateurs.estRequis')
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
return true // On considère tout le reste comme valide (ex: number, object, etc.)
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Valide que le champ contient une valeur qui est d'une longeur minimale.
|
|
27
|
-
* @param valeur La valeur saisie du champ texte.
|
|
28
|
-
* @param min La longeur minimale de la valeur.
|
|
29
|
-
* @returns true si la longeur de la valeur est égale ou supérieure au minimum, sinon retourne un message d'erreur.
|
|
30
|
-
*/
|
|
31
|
-
export function estMinimumLongueur(valeur: string, min: number, t: (key: string, params?: any) => string) {
|
|
32
|
-
if (min <= 0) {
|
|
33
|
-
min = 1
|
|
34
|
-
console.warn(
|
|
35
|
-
'CsqcValidateurs (estMinimumLongeur) - Une valeur négative ou égale à 0 a été reçue. Assurez-vous de passer une valeur supérieur à 0 dans la fonction estMinimumLongeur. La valeur a été mise à 1.',
|
|
36
|
-
)
|
|
37
|
-
}
|
|
38
|
-
return (valeur && valeur.trim().length >= min) || t('csqc.validateurs.estMinimumLongueur', { count: min, nbCaracteres: min })
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Valide que le champ contient une valeur qui ne dépasse pas une longeur maximale.
|
|
43
|
-
* @param valeur La valeur saisie du champ texte.
|
|
44
|
-
* @param max La longeur maximale (inclusive) de la valeur.
|
|
45
|
-
* @returns true si la longeur de la valeur est inférieure ou égale au maximum, sinon retourne un message d'erreur.
|
|
46
|
-
*/
|
|
47
|
-
export function estMaximumLongueur(valeur: string, max: number, t: (key: string, params?: any) => string) {
|
|
48
|
-
if (max < 1) {
|
|
49
|
-
max = 1
|
|
50
|
-
console.warn(
|
|
51
|
-
'CsqcValidateurs (estMaximumLongueur) - Une valeur négative ou égale à 0 a été reçue. Assurez-vous de passer une valeur supérieur à 0 dans la fonction estMaximumLongueur. La valeur a été mise à 1.',
|
|
52
|
-
)
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return (valeur && valeur.trim().length <= max) || t('csqc.validateurs.estMaximumLongueur', { count: max, nbCaracteres: max })
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Vérifie qu'une valeur passée en paramètre est unique parmis une liste de valeurs. La validation du bilinguisme sera appliquée
|
|
60
|
-
* selon la langue CSS configurée et passée en option.
|
|
61
|
-
* @param valeur La valeur a vérifier
|
|
62
|
-
* @param modele L'instance d'un modèle avec un primary key id
|
|
63
|
-
* @param options Les configurations de la fonction
|
|
64
|
-
* @returns Vrai si la valeur est unique, ou une string d'erreur si un doublon est trouvé.
|
|
65
|
-
*/
|
|
66
|
-
export function estUniqueBilingue<T extends ModeleAvecId>(
|
|
67
|
-
valeur: string,
|
|
68
|
-
modele: T,
|
|
69
|
-
options: EstUniqueOptionsBilingue<T>,
|
|
70
|
-
t: (key: string, params?: any) => string,
|
|
71
|
-
) {
|
|
72
|
-
// Affectations valeurs par défaut
|
|
73
|
-
const { champs, langueCss, valeurs } = options
|
|
74
|
-
if (!langueCss) options.langueCss = ChoixLangue.Francais
|
|
75
|
-
valeur = valeur.toLowerCase().trim()
|
|
76
|
-
|
|
77
|
-
switch (langueCss) {
|
|
78
|
-
case ChoixLangue.Anglais:
|
|
79
|
-
if (!champs.Anglais) {
|
|
80
|
-
console.error(
|
|
81
|
-
'CsqcValidateurs (estUnique) - Le champ anglais doit être speçifié lorsque la langueCss est en anglais.',
|
|
82
|
-
)
|
|
83
|
-
throw Error(
|
|
84
|
-
'CsqcValidateurs (estUnique) - Le champ anglais doit être speçifié lorsque la langueCss est en anglais.',
|
|
85
|
-
)
|
|
86
|
-
}
|
|
87
|
-
return (
|
|
88
|
-
!valeurs.find(
|
|
89
|
-
e =>
|
|
90
|
-
(e[champs.Anglais!] as string) != null &&
|
|
91
|
-
(e[champs.Anglais!] as string).toLowerCase().trim() === valeur &&
|
|
92
|
-
e.id !== modele.id,
|
|
93
|
-
) || t('csqc.validateurs.estUnique', { valeurExistante: valeur })
|
|
94
|
-
)
|
|
95
|
-
case ChoixLangue.Francais:
|
|
96
|
-
if (!champs.Francais) {
|
|
97
|
-
console.error(
|
|
98
|
-
'CsqcValidateurs (estUnique) - Le champ français doit être speçifié lorsque la langueCss est en français.',
|
|
99
|
-
)
|
|
100
|
-
throw Error(
|
|
101
|
-
'CsqcValidateurs (estUnique) - Le champ français doit être speçifié lorsque la langueCss est en français.',
|
|
102
|
-
)
|
|
103
|
-
}
|
|
104
|
-
return (
|
|
105
|
-
valeurs.find(
|
|
106
|
-
e =>
|
|
107
|
-
(e[champs.Francais!] as string) != null &&
|
|
108
|
-
(e[champs.Francais!] as string).toLowerCase().trim() === valeur &&
|
|
109
|
-
e.id !== modele.id,
|
|
110
|
-
) == null || t('csqc.validateurs.estUnique', { valeurExistante: valeur })
|
|
111
|
-
)
|
|
112
|
-
case ChoixLangue.Bilingue:
|
|
113
|
-
if (!champs.Anglais || !champs.Francais) {
|
|
114
|
-
console.error(
|
|
115
|
-
"CsqcValidateurs (estUnique) - Les deux champs (français et anglais) doivent être speçifiés lorsque qu'on est en mode de validation bilingue.",
|
|
116
|
-
)
|
|
117
|
-
throw Error(
|
|
118
|
-
"CsqcValidateurs (estUnique) - Les deux champs (français et anglais) doivent être speçifiés lorsque qu'on est en mode de validation bilingue.",
|
|
119
|
-
)
|
|
120
|
-
}
|
|
121
|
-
const estUnique =
|
|
122
|
-
valeurs.find(
|
|
123
|
-
e =>
|
|
124
|
-
((e[champs.Francais!] != null && (e[champs.Francais!] as string).toLowerCase().trim() === valeur) ||
|
|
125
|
-
(e[champs.Anglais!] != null && (e[champs.Anglais!] as string).toLowerCase().trim() === valeur)) &&
|
|
126
|
-
e.id !== modele.id,
|
|
127
|
-
) == null
|
|
128
|
-
return estUnique || t('csqc.validateurs.estUnique', { valeurExistante: valeur })
|
|
129
|
-
default:
|
|
130
|
-
break
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
throw Error('pas supposé être ici')
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* Vérifie qu'une valeur passée en paramètre est unique parmis une liste de valeurs.
|
|
138
|
-
* @param valeur La valeur a vérifier
|
|
139
|
-
* @param modele L'instance d'un modèle avec un primary key id
|
|
140
|
-
* @param options Les configurations de la fonction
|
|
141
|
-
* @returns Vrai si la valeur est unique, ou une string d'erreur si un doublon est trouvé.
|
|
142
|
-
*/
|
|
143
|
-
export function estUnique<T extends ModeleAvecId>(
|
|
144
|
-
valeur: string,
|
|
145
|
-
modele: T,
|
|
146
|
-
options: EstUniqueOptions<T>,
|
|
147
|
-
t: (key: string, params?: any) => string,
|
|
148
|
-
) {
|
|
149
|
-
const { champ, valeurs } = options
|
|
150
|
-
return (
|
|
151
|
-
!valeurs.some(
|
|
152
|
-
e =>
|
|
153
|
-
e[champ] != null &&
|
|
154
|
-
(e[champ] as string).toLowerCase().trim() === valeur.toLowerCase().trim() &&
|
|
155
|
-
e.id !== modele.id,
|
|
156
|
-
) || t('csqc.validateurs.estUnique', { valeurExistante: valeur })
|
|
157
|
-
)
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
type ModeleAvecId = { id: number }
|
|
161
|
-
|
|
162
|
-
type ValeursChampEstUniqueOptions<ModeleAvecId> = {
|
|
163
|
-
['Francais']?: keyof ModeleAvecId
|
|
164
|
-
['Anglais']?: keyof ModeleAvecId
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
interface EstUniqueOptionsBilingue<T extends ModeleAvecId> {
|
|
168
|
-
champs: ValeursChampEstUniqueOptions<T>
|
|
169
|
-
valeurs: T[]
|
|
170
|
-
langueCss?: ChoixLangue
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
interface EstUniqueOptions<T extends ModeleAvecId> {
|
|
174
|
-
champ: keyof T
|
|
175
|
-
valeurs: T[]
|
|
176
|
-
}
|
|
177
|
-
export default {
|
|
178
|
-
estRequis,
|
|
179
|
-
estMinimumLongueur,
|
|
180
|
-
estMaximumLongueur,
|
|
181
|
-
estUnique,
|
|
182
|
-
estUniqueBilingue,
|
|
183
|
-
}
|
package/enums/choixLangue.ts
DELETED
package/index.ts
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import csqcAlerteErreur from './composants/csqcAlerteErreur.vue'
|
|
2
|
-
import csqcDialogue from './composants/csqcDialogue.vue'
|
|
3
|
-
import csqcOptionSwitch from './composants/csqcOptionSwitch.vue'
|
|
4
|
-
import csqcRecherche from './composants/csqcRecherche.vue'
|
|
5
|
-
import csqcSnackbar from './composants/csqcSnackbar.vue'
|
|
6
|
-
import csqcTiroir from './composants/csqcTiroir.vue'
|
|
7
|
-
import pivEntete from './composants/gabarit/pivEntete.vue'
|
|
8
|
-
import pivFooter from './composants/gabarit/pivPiedPage.vue'
|
|
9
|
-
import csqcMenu from './composants/gabarit/csqcMenu.vue'
|
|
10
|
-
import csqcConfirmation from './composants/csqcConfirmation.vue'
|
|
11
|
-
import csqcSaisie from './composants/csqcModaleSaisie.vue'
|
|
12
|
-
import csqcDate from './composants/csqcDate.vue'
|
|
13
|
-
import csqcTable from './composants/csqcTable/csqcTable.vue'
|
|
14
|
-
import csqcCodeBudgetaire from './composants/csqcCodeBudgetaireGenerique.vue'
|
|
15
|
-
import csqcChaise from './composants/csqcChaise/chaiseConteneur.vue'
|
|
16
|
-
import csqcAide from './composants/csqcAide.vue'
|
|
17
|
-
import csqcEntete from './composants/csqcEntete.vue'
|
|
18
|
-
import csqcTexteBilingue from './composants/csqcTexteBilingue.vue'
|
|
19
|
-
import csqcEditeurTexteRiche from './composants/csqcEditeurTexteRiche.vue'
|
|
20
|
-
import csqcImportCSV from './composants/csqcImportCSV.vue'
|
|
21
|
-
import csqcRechercheUtilisateur from './composants/csqcRechercheUtilisateur.vue'
|
|
22
|
-
import validateurs from './composants/validateurs'
|
|
23
|
-
|
|
24
|
-
// modèles
|
|
25
|
-
import NotificationGabaritDefaut from './modeles/notificationGabaritDefaut'
|
|
26
|
-
import modeleSnackbar from './modeles/composants/snackbar'
|
|
27
|
-
import modeleDatatableColonne from './modeles/composants/datatableColonne'
|
|
28
|
-
import apiReponse from './modeles/apiReponse'
|
|
29
|
-
import data from './modeles/data'
|
|
30
|
-
import response from './modeles/response'
|
|
31
|
-
|
|
32
|
-
// outils
|
|
33
|
-
import csqcRafraichisseurToken from './outils/rafraichisseurToken'
|
|
34
|
-
import csqcOutils from './outils/csqcOutils'
|
|
35
|
-
|
|
36
|
-
// i18n
|
|
37
|
-
import csqcEn from './locales/en.json'
|
|
38
|
-
import csqcFr from './locales/fr.json'
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
export {
|
|
42
|
-
csqcFr,
|
|
43
|
-
csqcEn,
|
|
44
|
-
csqcAlerteErreur,
|
|
45
|
-
csqcDialogue,
|
|
46
|
-
csqcConfirmation,
|
|
47
|
-
csqcSaisie,
|
|
48
|
-
csqcDate,
|
|
49
|
-
csqcOptionSwitch,
|
|
50
|
-
csqcRecherche,
|
|
51
|
-
csqcSnackbar,
|
|
52
|
-
csqcTable,
|
|
53
|
-
csqcTiroir,
|
|
54
|
-
csqcMenu,
|
|
55
|
-
csqcCodeBudgetaire,
|
|
56
|
-
csqcChaise,
|
|
57
|
-
pivFooter,
|
|
58
|
-
pivEntete,
|
|
59
|
-
csqcAide,
|
|
60
|
-
csqcEntete,
|
|
61
|
-
csqcTexteBilingue,
|
|
62
|
-
csqcEditeurTexteRiche,
|
|
63
|
-
validateurs,
|
|
64
|
-
csqcImportCSV,
|
|
65
|
-
csqcRechercheUtilisateur,
|
|
66
|
-
csqcRafraichisseurToken,
|
|
67
|
-
csqcOutils,
|
|
68
|
-
modeleSnackbar,
|
|
69
|
-
modeleDatatableColonne as colonne,
|
|
70
|
-
apiReponse,
|
|
71
|
-
data,
|
|
72
|
-
response,
|
|
73
|
-
NotificationGabaritDefaut,
|
|
74
|
-
}
|
package/locales/en.json
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"csqc": {
|
|
3
|
-
"bouton": {
|
|
4
|
-
"activer": "Activate",
|
|
5
|
-
"ajouter": "Add",
|
|
6
|
-
"annuler": "Cancel",
|
|
7
|
-
"anonymiser": "Anonymize",
|
|
8
|
-
"completer": "Complete",
|
|
9
|
-
"continuer": "Continue",
|
|
10
|
-
"desactiver": "Deactivate",
|
|
11
|
-
"envoyer": "Send",
|
|
12
|
-
"exporter": "Export",
|
|
13
|
-
"fermer": "Close",
|
|
14
|
-
"generer": "Generate",
|
|
15
|
-
"importer": "Import",
|
|
16
|
-
"modifier": "Edit",
|
|
17
|
-
"non": "No",
|
|
18
|
-
"ok": "Ok",
|
|
19
|
-
"oui": "Yes",
|
|
20
|
-
"ouvrir": "Open",
|
|
21
|
-
"recharger": "Reload",
|
|
22
|
-
"reinitialiser": "Reset",
|
|
23
|
-
"restaurer": "Restore",
|
|
24
|
-
"sauvegarder": "Save",
|
|
25
|
-
"supprimer": "Delete",
|
|
26
|
-
"televerser": "Upload"
|
|
27
|
-
},
|
|
28
|
-
"csqcChaise": {
|
|
29
|
-
"erreur": "Please make a selection for all units.",
|
|
30
|
-
"info": "This claim will have to be verified by the following unit(s). For those with more than one possibility, please select the choice that suits you.",
|
|
31
|
-
"titre": "Tracking Preference"
|
|
32
|
-
},
|
|
33
|
-
"csqcEmploisEmploye": {
|
|
34
|
-
"dateDebut": "Start Date",
|
|
35
|
-
"dateFin": "End Date",
|
|
36
|
-
"etat": "Status",
|
|
37
|
-
"etatActif": "Active",
|
|
38
|
-
"lieuPrincipal": "Primary Location",
|
|
39
|
-
"lieuSecondaire": "Secondary Location|Secondary Locations",
|
|
40
|
-
"principal": {
|
|
41
|
-
"libelle": "Principal",
|
|
42
|
-
"non": "No",
|
|
43
|
-
"oui": "Yes"
|
|
44
|
-
},
|
|
45
|
-
"statut": "Status",
|
|
46
|
-
"titre": "Employee Jobs"
|
|
47
|
-
},
|
|
48
|
-
"csqcImportCSV": {
|
|
49
|
-
"erreur": {
|
|
50
|
-
"erreur": "Import Error.",
|
|
51
|
-
"lectureFichier": "Error reading CSV file."
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
"csqcMenu": {
|
|
55
|
-
"deconnexion": "Logout"
|
|
56
|
-
},
|
|
57
|
-
"csqcRechercheUtilisateur": {
|
|
58
|
-
"ajouterUtilisateurInfo": "You can enter here the Office 365 identifier or the employee’s payroll number. Then click on the magnifying glass. If this information is found in the payroll system, the user will be added. Note that the user must have a valid portal email address in the payroll system.",
|
|
59
|
-
"aucunEmploi": "No job found",
|
|
60
|
-
"aucunResultat": "No result found",
|
|
61
|
-
"corpsEmploi": "Job category",
|
|
62
|
-
"erreur": " An error occurred while searching for the user.",
|
|
63
|
-
"identifiantOuMatricule": "Office 365 identifier or payroll number",
|
|
64
|
-
"placeholderRechercheUtilisateur": "Search for a user",
|
|
65
|
-
"revenirRecherche": "Back to search",
|
|
66
|
-
"utilisateurIntrouvable": "The employee you searched for could not be found",
|
|
67
|
-
"utilisateurs": "Employee"
|
|
68
|
-
},
|
|
69
|
-
"label": {
|
|
70
|
-
"actif": "Active",
|
|
71
|
-
"fermer": "Close",
|
|
72
|
-
"nom": "Name",
|
|
73
|
-
"recherche": "Search",
|
|
74
|
-
"rechercheAvanceeDefaut": "Advanced search",
|
|
75
|
-
"rechercher": "Search"
|
|
76
|
-
},
|
|
77
|
-
"message": {
|
|
78
|
-
"chaiseSelection": "No selection for this unit",
|
|
79
|
-
"chaiseSelectionToutes": "Please make a selection for all units.",
|
|
80
|
-
"supprimerMessage": "Are you sure you want to delete {nom}?",
|
|
81
|
-
"supprimerTitre": "Delete confirmation!"
|
|
82
|
-
},
|
|
83
|
-
"pivEntete": {
|
|
84
|
-
"langue": "Français"
|
|
85
|
-
},
|
|
86
|
-
"pivFooter": {
|
|
87
|
-
"logoAlt": ""
|
|
88
|
-
},
|
|
89
|
-
"placeholder": {
|
|
90
|
-
"date": "Choose a date",
|
|
91
|
-
"selectionner": "Select"
|
|
92
|
-
},
|
|
93
|
-
"validateurs": {
|
|
94
|
-
"estMaximumLongueur": "None | This field must not exceed {nbCaracteres} character | This field must not exceed {nbCaracteres} characters.",
|
|
95
|
-
"estMinimumLongueur": "None | This field is too short, it must contain at least {nbCaracteres} character | This field is too short, it must contain at least {nbCaracteres} characters.",
|
|
96
|
-
"estRequis": "This field is required",
|
|
97
|
-
"estUnique": "The value '{valeurExistante}' already exists"
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|