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 ce869c02f75312a5b9f582cdd244c3522597992d..2a05e3d981d404281b0f1d01b01d0457246334c7 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 33f32448e81b67047052926875244bb28d72d4c3..dd702fbab243fb02880ef68bf1efae0243318be2 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 753ed69617f942388402a11630815a6bbcb3348a..c62569d5225799a440822e1318807302e86fd14c 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 cf036c1aa64780b62e16f70dab8bb9fed5fe10c0..e944670a57153315fc211fa7e9714ed987137389 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 354356a763b80695ff146e577ed4fc81b527b944..3584a101709f6fee910e5b60a791f1046180b035 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 } }); } }