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

Set appointment date

parent 84516d02
No related branches found
No related tags found
2 merge requests!993Notif,!983feat(dashboard) : create dashboard !
...@@ -98,7 +98,14 @@ ...@@ -98,7 +98,14 @@
<div class="datePickerContainer"> <div class="datePickerContainer">
<span class="category-name" id="dateLabel">Date de RDV :</span> <span class="category-name" id="dateLabel">Date de RDV :</span>
<span class="datePicker"> <span class="datePicker">
<input type="date" id="date" name="date" aria-labelledby="dateLabel" /> <input
type="date"
id="date"
name="date"
aria-labelledby="dateLabel"
[value]="orientation.appointmentDate | date: 'yyyy-MM-dd'"
(change)="setAppointmentDate($event)"
/>
</span> </span>
</div> </div>
</div> </div>
......
...@@ -115,9 +115,11 @@ ...@@ -115,9 +115,11 @@
display: inline-grid; display: inline-grid;
input { input {
margin-top: 8px; margin-top: 8px;
width: 250px; width: 200px;
height: 32px; height: 16px;
padding: 8px; padding: 8px;
border-radius: 4px;
border: 1px solid $grey-1;
} }
} }
@media #{$phone} { @media #{$phone} {
......
...@@ -66,19 +66,16 @@ export class OrientationDetailsComponent implements OnInit { ...@@ -66,19 +66,16 @@ export class OrientationDetailsComponent implements OnInit {
const comment = this.commentTextarea?.value || ''; const comment = this.commentTextarea?.value || '';
const sanitizedHtml = this.sanitizer.sanitize(SecurityContext.HTML, comment); const sanitizedHtml = this.sanitizer.sanitize(SecurityContext.HTML, comment);
const sanitizedComment = this.extractPlainText(sanitizedHtml || ''); const sanitizedComment = this.extractPlainText(sanitizedHtml || '');
const patchData: any = { const patchData: any = {
status: this.selectedStatus, status: this.selectedStatus,
action: null, action: null,
processingComment: sanitizedComment, processingComment: sanitizedComment,
modifiedBy: this.userProfile._id, modifiedBy: this.userProfile._id,
}; };
// Only add closingDate if orientation is not already closed // Only add closingDate if orientation is not already closed
if (!isClosed) { if (!isClosed) {
patchData.closingDate = new Date(); patchData.closingDate = new Date();
} }
this.patchOrientation(patchData); this.patchOrientation(patchData);
} }
this.isModalOpenned = false; this.isModalOpenned = false;
...@@ -96,6 +93,14 @@ export class OrientationDetailsComponent implements OnInit { ...@@ -96,6 +93,14 @@ export class OrientationDetailsComponent implements OnInit {
} }
} }
public setAppointmentDate(event: Event): void {
const target = event.target as HTMLInputElement;
const date = new Date(target.value);
if (!isNaN(date.getTime())) {
this.patchOrientation({ appointmentDate: date, modifiedBy: this.userProfile._id });
}
}
get isValidateDisabled(): boolean { get isValidateDisabled(): boolean {
return !this.selectedStatus || !this.commentTextarea?.value?.trim(); return !this.selectedStatus || !this.commentTextarea?.value?.trim();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment