Skip to content
Snippets Groups Projects
Commit d9238e97 authored by Marlène SIMONDANT's avatar Marlène SIMONDANT
Browse files

Fusionner closingComment et processingComment

parent dd6847a0
No related branches found
No related tags found
2 merge requests!993Notif,!983feat(dashboard) : create dashboard !
...@@ -269,7 +269,7 @@ ...@@ -269,7 +269,7 @@
[opened]="isModalOpenned" [opened]="isModalOpenned"
[title]="'Clôturer un accompagnement'" [title]="'Clôturer un accompagnement'"
[validateDisabled]="isValidateDisabled" [validateDisabled]="isValidateDisabled"
(closed)="closeOrientation($event)" (closed)="closeOrientation($event, isClosed)"
> >
<div class="modalContent emphasized"> <div class="modalContent emphasized">
{{ orientation.personOriented.name }} {{ orientation.personOriented.surname | uppercase }} {{ orientation.personOriented.name }} {{ orientation.personOriented.surname | uppercase }}
...@@ -287,7 +287,7 @@ ...@@ -287,7 +287,7 @@
<div> <div>
<label for="comment">Commentaires <span class="optional">(facultatifs)</span></label> <label for="comment">Commentaires <span class="optional">(facultatifs)</span></label>
<app-textarea #comment id="comment" [value]="orientation.closingComment" /> <app-textarea #comment id="comment" [value]="orientation.processingComment" />
</div> </div>
</div> </div>
</app-modal> </app-modal>
...@@ -27,7 +27,7 @@ export class OrientationDetailsComponent implements OnInit { ...@@ -27,7 +27,7 @@ export class OrientationDetailsComponent implements OnInit {
public isModalOpenned = false; public isModalOpenned = false;
public userProfile: User; public userProfile: User;
public from: string; public from: string;
public closingComment = ''; public processingComment = '';
public selectedStatus = ''; public selectedStatus = '';
public isClosed: boolean; public isClosed: boolean;
...@@ -61,15 +61,15 @@ export class OrientationDetailsComponent implements OnInit { ...@@ -61,15 +61,15 @@ export class OrientationDetailsComponent implements OnInit {
this.isModalOpenned = true; this.isModalOpenned = true;
} }
public closeOrientation(event): void { public closeOrientation(event, isClosed): void {
if (event) { if (event) {
const comment = this.commentTextarea?.value || ''; const comment = this.commentTextarea?.value || '';
const sanitizedComment = this.sanitizer.sanitize(SecurityContext.HTML, comment); const sanitizedComment = this.sanitizer.sanitize(SecurityContext.HTML, comment);
this.patchOrientation({ this.patchOrientation({
status: this.selectedStatus, status: this.selectedStatus,
action: null, action: null,
closingComment: sanitizedComment, processing: sanitizedComment,
closingDate: new Date(), closingDate: isClosed ? null : new Date(),
modifiedBy: this.userProfile._id, modifiedBy: this.userProfile._id,
}); });
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment