From 4c0b3b062856b1283c79295229de3e58b08345c3 Mon Sep 17 00:00:00 2001 From: Etienne Loupias <eloupias@grandlyon.com> Date: Tue, 18 Mar 2025 13:45:51 +0100 Subject: [PATCH] rename acknowledge --- .../interfaces/orientation.interface.ts | 30 +----- .../orientation-details.component.ts | 5 +- src/app/profile/dashboard/orientation.enum.ts | 93 +++---------------- .../orientations-table.component.html | 1 - .../orientations-table.component.ts | 9 +- 5 files changed, 22 insertions(+), 116 deletions(-) diff --git a/src/app/form/orientation-form-view/interfaces/orientation.interface.ts b/src/app/form/orientation-form-view/interfaces/orientation.interface.ts index ce869c02f..2a05e3d98 100644 --- a/src/app/form/orientation-form-view/interfaces/orientation.interface.ts +++ b/src/app/form/orientation-form-view/interfaces/orientation.interface.ts @@ -2,39 +2,19 @@ export interface IOrientation { type?: string; accompanimentType?: string; need: string[]; - personOriented: { - name: string; - surname: string; - email?: string; - phone?: string; - }; - address?: { - numero: string; - street: string; - postcode: string; - commune: string; - inseeCode: string; - }; + personOriented: { name: string; surname: string; email?: string; phone?: string }; + address?: { numero: string; street: string; postcode: string; commune: string; inseeCode: string }; structureChoice: string[]; socialWorker?: string; - dateSlot?: { - day: string; - hours: string; - }; + dateSlot?: { day: string; hours: string }; language?: 'Français' | 'Anglais' | 'Arabe' | null; pmr?: boolean; comments?: string; orientator: string; - structureOrientator: - | string - | { - structureName: string; - structureMail: string; - structurePhone: string; - }; + structureOrientator: string | { structureName: string; structureMail: string; structurePhone: string }; status: 'new' | 'waiting' | 'appointmentBooked' | 'appointmentDatePassed' | 'completed' | 'uncompleted' | 'expired'; - action: 'acknowledged' | 'defineAppointment' | 'waitAppointment' | 'waitVisit' | 'closeRDV'; + action: 'acknowledge' | 'defineAppointment' | 'waitAppointment' | 'waitVisit' | 'closeRDV'; modifiedBy?: string; appointmentDate?: string; processingComment?: string; diff --git a/src/app/profile/dashboard/orientation-details/orientation-details.component.ts b/src/app/profile/dashboard/orientation-details/orientation-details.component.ts index 33f32448e..dd702fbab 100644 --- a/src/app/profile/dashboard/orientation-details/orientation-details.component.ts +++ b/src/app/profile/dashboard/orientation-details/orientation-details.component.ts @@ -76,10 +76,7 @@ export class OrientationDetailsComponent implements OnInit { public acknowledgeNewOrientation(): void { if (this.orientation.status === 'new') { - this.patchOrientation({ - status: 'acknowledged', - modifiedBy: this.userProfile._id, - }); + this.patchOrientation({ status: 'waiting', modifiedBy: this.userProfile._id }); } } diff --git a/src/app/profile/dashboard/orientation.enum.ts b/src/app/profile/dashboard/orientation.enum.ts index 753ed6961..c62569d52 100644 --- a/src/app/profile/dashboard/orientation.enum.ts +++ b/src/app/profile/dashboard/orientation.enum.ts @@ -1,89 +1,26 @@ export const Status = { - new: { - label: 'Nouveau', - color: 'dark-blue', - icon: 'new', - }, - waiting: { - label: 'En attente', - color: 'blue', - icon: 'eye', - }, - appointmentBooked: { - label: 'RDV pris', - color: 'light-green', - icon: 'calendarGreen', - }, - appointmentDatePassed: { - label: 'RDV passé', - color: 'grey', - icon: 'rdvDone', - }, - completed: { - label: 'Terminé', - color: 'light-green', - icon: 'tick', - }, - uncompleted: { - label: 'Non réalisé', - color: 'red', - icon: 'redCross', - }, - expired: { - label: 'Expiré', - color: 'grey', - icon: 'greyCross', - }, + new: { label: 'Nouveau', color: 'dark-blue', icon: 'new' }, + waiting: { label: 'En attente', color: 'blue', icon: 'eye' }, + appointmentBooked: { label: 'RDV pris', color: 'light-green', icon: 'calendarGreen' }, + appointmentDatePassed: { label: 'RDV passé', color: 'grey', icon: 'rdvDone' }, + completed: { label: 'Terminé', color: 'light-green', icon: 'tick' }, + uncompleted: { label: 'Non réalisé', color: 'red', icon: 'redCross' }, + expired: { label: 'Expiré', color: 'grey', icon: 'greyCross' }, } as const; export type StatusKey = keyof typeof Status; export const Action = { - acknowledged: { - label: 'Accuser réception', - color: 'dark-blue', - icon: 'new', - }, - defineAppointment: { - label: 'Définir le RDV', - color: 'blue', - icon: 'calendar', - }, - waitAppointment: { - label: 'Attendre le RDV', - color: 'grey', - icon: 'pedestrian', - }, - waitVisit: { - label: 'Attendre la visite', - color: 'grey', - icon: 'pedestrian', - }, - closeRDV: { - label: 'Clôturer le RDV', - color: 'grey', - icon: 'rdvDone', - }, + acknowledge: { label: 'Accuser réception', color: 'dark-blue', icon: 'new' }, + defineAppointment: { label: 'Définir le RDV', color: 'blue', icon: 'calendar' }, + waitAppointment: { label: 'Attendre le RDV', color: 'grey', icon: 'pedestrian' }, + waitVisit: { label: 'Attendre la visite', color: 'grey', icon: 'pedestrian' }, + closeRDV: { label: 'Clôturer le RDV', color: 'grey', icon: 'rdvDone' }, } as const; export type ActionsKey = keyof typeof Action; export const Type = { - appointment: { - label: 'Rendez-vous', - color: 'grey', - icon: 'rdvDone', - initialAction: 'defineRdv', - }, - structuresList: { - label: 'Visite', - color: 'grey', - icon: 'pedestrian', - initialAction: 'visit', - }, - onlineMediation: { - label: 'Appel', - color: 'grey', - icon: 'call', - initialAction: 'rdvTaken', - }, + appointment: { label: 'Rendez-vous', color: 'grey', icon: 'rdvDone', initialAction: 'defineRdv' }, + structuresList: { label: 'Visite', color: 'grey', icon: 'pedestrian', initialAction: 'visit' }, + onlineMediation: { label: 'Appel', color: 'grey', icon: 'call', initialAction: 'rdvTaken' }, } as const; export type TypeKey = keyof typeof Type; diff --git a/src/app/profile/dashboard/orientations-table/orientations-table.component.html b/src/app/profile/dashboard/orientations-table/orientations-table.component.html index cf036c1aa..e944670a5 100644 --- a/src/app/profile/dashboard/orientations-table/orientations-table.component.html +++ b/src/app/profile/dashboard/orientations-table/orientations-table.component.html @@ -21,7 +21,6 @@ " (click)="navigateToDetails($event, orientation._id)" (keyup.enter)="navigateToDetails($event, orientation._id)" - (onclick)="orientationSeen()" > <div> <div class="name">{{ orientation.personOriented.name }} {{ orientation.personOriented.surname | uppercase }}</div> diff --git a/src/app/profile/dashboard/orientations-table/orientations-table.component.ts b/src/app/profile/dashboard/orientations-table/orientations-table.component.ts index 354356a76..3584a1017 100644 --- a/src/app/profile/dashboard/orientations-table/orientations-table.component.ts +++ b/src/app/profile/dashboard/orientations-table/orientations-table.component.ts @@ -16,15 +16,8 @@ export class OrientationsTableComponent { @Input() orientations: any[]; @Input() from: string; - public orientationSeen(): void { - // TODO : changer le status de l'orientation => A traiter (acknowledged) - console.log('coucou'); - } - public navigateToDetails(event: Event, orientationId: string): void { event.preventDefault(); - this.router.navigate(['/profil/details-orientation', orientationId], { - queryParams: { from: this.from }, - }); + this.router.navigate(['/profil/details-orientation', orientationId], { queryParams: { from: this.from } }); } } -- GitLab