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

Fix accents converted by sanitize

parent 444138e9
No related branches found
No related tags found
2 merge requests!993Draft: Notif,!983feat(dashboard) : create dashboard !
......@@ -64,7 +64,8 @@ export class OrientationDetailsComponent implements OnInit {
public closeOrientation(event, isClosed): void {
if (event) {
const comment = this.commentTextarea?.value || '';
const sanitizedComment = this.sanitizer.sanitize(SecurityContext.HTML, comment);
const sanitizedHtml = this.sanitizer.sanitize(SecurityContext.HTML, comment);
const sanitizedComment = this.extractPlainText(sanitizedHtml || '');
this.patchOrientation({
status: this.selectedStatus,
action: null,
......@@ -76,6 +77,12 @@ export class OrientationDetailsComponent implements OnInit {
this.isModalOpenned = false;
}
private extractPlainText(html: string): string {
const tempElement = document.createElement('div');
tempElement.innerHTML = html;
return tempElement.textContent || '';
}
public acknowledgeNewOrientation(): void {
if (this.orientation.status === 'new') {
this.patchOrientation({ status: 'waiting', action: 'defineAppointment', modifiedBy: this.userProfile._id });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment