diff --git a/packages/backend/src/database/services/app-log/user-structure-security/userStructureSecurityRepository.service.ts b/packages/backend/src/database/services/app-log/user-structure-security/userStructureSecurityRepository.service.ts index 36b7dd26a9..02653c9824 100644 --- a/packages/backend/src/database/services/app-log/user-structure-security/userStructureSecurityRepository.service.ts +++ b/packages/backend/src/database/services/app-log/user-structure-security/userStructureSecurityRepository.service.ts @@ -17,7 +17,7 @@ export const userStructureSecurityRepository = myDataSource "uuid" | "userId" | "temporaryTokens" | "eventsHistory" > > { - return this.createQueryBuilder("user_structure_security") + return await this.createQueryBuilder("user_structure_security") .where(`"temporaryTokens"->>'token' = :tokenValue`, { tokenValue, }) @@ -51,7 +51,7 @@ export const userStructureSecurityRepository = myDataSource clearAllEvents, }); - return this.update( + return await this.update( { userId }, attributes ? { diff --git a/packages/backend/src/modules/portail-admin/controllers/admin-structures/admin-structures.controller.ts b/packages/backend/src/modules/portail-admin/controllers/admin-structures/admin-structures.controller.ts index ed604f4d78..083638d09d 100644 --- a/packages/backend/src/modules/portail-admin/controllers/admin-structures/admin-structures.controller.ts +++ b/packages/backend/src/modules/portail-admin/controllers/admin-structures/admin-structures.controller.ts @@ -146,6 +146,7 @@ export class AdminStructuresController { user_structure.prenom, user_structure.email, user_structure.role, + user_structure.verified, user_structure."lastLogin", user_structure."createdAt", user_structure.uuid, diff --git a/packages/frontend/src/app/modules/manage-usagers/components/usager-filter/services/usagersSearchStringFilter.service.ts b/packages/frontend/src/app/modules/manage-usagers/components/usager-filter/services/usagersSearchStringFilter.service.ts index 6c9c886c0f..f934033e91 100644 --- a/packages/frontend/src/app/modules/manage-usagers/components/usager-filter/services/usagersSearchStringFilter.service.ts +++ b/packages/frontend/src/app/modules/manage-usagers/components/usager-filter/services/usagersSearchStringFilter.service.ts @@ -1,9 +1,15 @@ import { UsagersFilterCriteria } from "../UsagersFilterCriteria"; -import { format } from "date-fns"; +import { format, isValid, parseISO } from "date-fns"; import { UsagerLight } from "../../../../../../_common/model"; import { UsagerProcuration } from "../../../../usager-shared/interfaces/UsagerProcuration.interface"; import { UsagerAyantDroit } from "@domifa/common"; +const validateBirthDate = (date?: Date | string): string | undefined => { + if (!date) return undefined; + const parsedDate = typeof date === "string" ? parseISO(date) : date; + return !isValid(parsedDate) ? undefined : format(parsedDate, "dd/MM/yyyy"); +}; + export const getAttributes = ( usager: UsagerLight, { @@ -12,21 +18,16 @@ export const getAttributes = ( ) => { let attributes = []; if (searchStringField === "DATE_NAISSANCE") { - const dateNaissance = - typeof usager.dateNaissance === "string" - ? new Date(usager.dateNaissance) - : null; - - attributes = dateNaissance ? [format(dateNaissance, "dd/MM/yyyy")] : []; - - usager.ayantsDroits.forEach((ad: UsagerAyantDroit) => { - const dateNaissanceAd = - typeof ad.dateNaissance === "string" - ? new Date(ad.dateNaissance) - : null; - if (dateNaissanceAd) { - attributes.push(format(dateNaissanceAd, "dd/MM/yyyy")); - } + const attributes: string[] = []; + + if (usager.dateNaissance) { + const formattedDate = validateBirthDate(usager.dateNaissance); + if (formattedDate) attributes.push(formattedDate); + } + + usager.ayantsDroits.forEach((ad) => { + const formattedDate = validateBirthDate(ad.dateNaissance); + if (formattedDate) attributes.push(formattedDate); }); return attributes; diff --git a/packages/frontend/src/app/shared/store/setUsagerInformation.ts b/packages/frontend/src/app/shared/store/setUsagerInformation.ts index c5e5714228..69b114dc96 100644 --- a/packages/frontend/src/app/shared/store/setUsagerInformation.ts +++ b/packages/frontend/src/app/shared/store/setUsagerInformation.ts @@ -32,6 +32,7 @@ export const setUsagerInformation = (usager: Usager): any => { historique: [], options: new Options(usager.options), rdv: null, + dateNaissance: new Date(usager?.dateNaissance), entretien: null, }; }; diff --git a/packages/portail-admins/package.json b/packages/portail-admins/package.json index db4f684404..131341ef5f 100644 --- a/packages/portail-admins/package.json +++ b/packages/portail-admins/package.json @@ -41,6 +41,7 @@ "class-validator": "^0.14.1", "date-fns": "^2.30.0", "file-saver": "^2.0.5", + "google-libphonenumber": "^3.2.40", "ngx-matomo-client": "^5.0.4", "redux": "^4.2.1", "rimraf": "^5.0.10", diff --git a/packages/portail-admins/src/app/app.module.ts b/packages/portail-admins/src/app/app.module.ts index 4e3d447273..eef4b06ff8 100644 --- a/packages/portail-admins/src/app/app.module.ts +++ b/packages/portail-admins/src/app/app.module.ts @@ -2,6 +2,7 @@ import { HttpClientModule, HTTP_INTERCEPTORS } from "@angular/common/http"; import { CUSTOM_ELEMENTS_SCHEMA, ErrorHandler, + LOCALE_ID, NgModule, NO_ERRORS_SCHEMA, } from "@angular/core"; @@ -54,6 +55,7 @@ registerLocaleData(localeFr, "fr"); MATOMO_INJECTORS, ], providers: [ + { provide: LOCALE_ID, useValue: "fr" }, { provide: HTTP_INTERCEPTORS, useClass: JwtInterceptor, multi: true }, { multi: true, diff --git a/packages/portail-admins/src/app/modules/structure/components/structure-info/structure-info.component.html b/packages/portail-admins/src/app/modules/structure/components/structure-info/structure-info.component.html index c3a91ef029..595c7aec46 100644 --- a/packages/portail-admins/src/app/modules/structure/components/structure-info/structure-info.component.html +++ b/packages/portail-admins/src/app/modules/structure/components/structure-info/structure-info.component.html @@ -1,44 +1,55 @@
Nom : {{ structure.nom }}
-- Type de structure : {{ structure.structureType }} -
-Département : {{ structure.departement }}
++ Nom + {{ structure.nom }} +
++ Type de structure + {{ structure.structureType }} +
++ Département + {{ structure.departement }} +
-- Adresse : -
-- Coordonnées de la structure: -
-+ Adresse + {{ structure.adresse }} +
++ Ville + {{ structure.codePostal }}, {{ structure.ville }} +
-- Responsable de la structure: -
-+ Email + {{ structure.email }} +
++ Téléphone + {{ + structure.telephone | formatInternationalPhoneNumber + }} +
+ + ++ Nom du responsable + {{ structure?.responsable?.nom }} + {{ structure?.responsable?.prenom }} +
++ Fonction du responsable + {{ structure?.responsable?.fonction }} +
✅ Compte actif
-
- ❌ Inactif depuis plus de 2 mois
Dernière connexion le
- {{ user.lastLogin | date : "d MMMM y" }}
-
+
❌ Compte non vérifié
+
+ {{ user.lastLogin | date : "dd/MM/yyyy" }}
+
+
❌ Inactif depuis plus de 2 mois
+
+
❌ Compte jamais utilisé