Text fixes, frånvaro

This commit is contained in:
Daniel Appelgren
2021-10-08 16:10:29 +02:00
parent 41495a0f3b
commit ca7265f279
3 changed files with 44 additions and 28 deletions

View File

@@ -81,7 +81,7 @@
<p class="msfa__small-text" *ngIf="error.message">{{error.message}}</p>
</digi-notification-alert>
<div class="gemensam-planering__cta-wrapper">
<digi-button af-type="submit" af-size="m">Bekräfta och skicka in</digi-button>
<digi-button af-type="submit" af-size="m">Förhandsgranska</digi-button>
<msfa-back-link [showIcon]="false" [asButton]="true" [route]="['/deltagare/'+ genomforandeReferens]"
>Avbryt
</msfa-back-link>

View File

@@ -51,7 +51,9 @@
afLabel="Orsak till frånvaro"
afPlaceholder="Välj orsak till frånvaro"
[afSelectItems]="reasons"
[afAnnounceIfOptional]="true"
[afRequired]="true"
[afAnnounceIfOptional]="true"
[afDisableValidStyle]="true"
[afInvalid]="formControlIsInvalid(['reason'])"
></digi-ng-form-select>
@@ -77,6 +79,7 @@
afPlaceholder="Välj känd orsak"
[afSelectItems]="otherKnownReasons"
[afDisableValidStyle]="true"
[afAnnounceIfOptional]="true"
[afRequired]="true"
[afInvalid]="formControlIsInvalid(['otherKnownReason'])"
></digi-ng-form-select>
@@ -95,6 +98,7 @@
[afDisableValidStyle]="true"
[afInvalid]="formControlIsInvalid(['knownReasonComment'])"
[afMaxLength]="2000"
[afAnnounceIfOptional]="true"
[afRequired]="true"
afLabel="Beskriv frånvaro"
afSize="s"
@@ -117,8 +121,9 @@
[afMinDate]="avrop.startDate"
[afMaxDate]="maxDate"
[afInvalid]="formControlIsInvalid(['date'])"
[afAnnounceIfOptional]="true"
[afRequired]="true"
afLabel="Välj dag för frånvaro"
afLabel="Dag för frånvaro"
[formControl]="dateFormControl"
></digi-ng-form-datepicker>
<div aria-atomic="true" role="alert">
@@ -131,26 +136,29 @@
</div>
</div>
<digi-form-fieldset af-legend="Hel eller del av dag" af-name="wholeDay" af-form="franvaro-report-form">
<digi-ng-form-radiobutton-group
[afRadiobuttons]="wholeDayOrPartOfDayRadiobuttons"
[afRequired]="true"
[formControl]="wholeDayFormControl"
></digi-ng-form-radiobutton-group>
</digi-form-fieldset>
<div>
<h2>Tiden deltagaren var frånvarande</h2>
<digi-form-fieldset
af-legend="Heldag eller del av dag"
af-name="wholeDay"
af-form="franvaro-report-form"
>
<digi-ng-form-radiobutton-group
[afRadiobuttons]="wholeDayOrPartOfDayRadiobuttons"
[afRequired]="true"
[formControl]="wholeDayFormControl"
></digi-ng-form-radiobutton-group>
</digi-form-fieldset>
</div>
<digi-form-fieldset
*ngIf="showTimePickers"
af-legend="Välj tid för frånvaro"
af-name="time"
af-form="franvaro-report-form"
>
<ng-container *ngIf="showTimePickers">
<div class="franvaro-report__time-pickers">
<div class="franvaro-report__time-picker">
<digi-ng-form-input
afLabel="Ange starttid"
afLabel="Starttid"
[formControl]="startTimeFormControl"
[afDisableValidStyle]="true"
[afAnnounceIfOptional]="true"
[afRequired]="true"
[afInvalid]="formControlIsInvalid(['startTime', 'expectedEndTimeIsBeforeStartTime'])"
afType="time"
@@ -166,9 +174,10 @@
</div>
<div class="franvaro-report__time-picker">
<digi-ng-form-input
afLabel="Ange sluttid"
afLabel="Sluttid"
[formControl]="endTimeFormControl"
[afDisableValidStyle]="true"
[afAnnounceIfOptional]="true"
[afRequired]="true"
[afInvalid]="formControlIsInvalid(['endTime', 'expectedEndTimeIsBeforeStartTime'])"
afType="time"
@@ -191,19 +200,17 @@
[afValidationText]="formErrors.expectedEndTimeIsBeforeStartTime"
></digi-ng-form-validation-message>
</div>
</digi-form-fieldset>
</ng-container>
<digi-form-fieldset
af-legend="Välj tid förväntad närvaro"
af-name="expectedPresence"
af-form="franvaro-report-form"
>
<div>
<h2>Tiden deltagaren skulle varit närvarande</h2>
<div class="franvaro-report__time-pickers">
<div class="franvaro-report__time-picker">
<digi-ng-form-input
afLabel="Ange starttid"
afLabel="Starttid"
[formControl]="expectedPresenceStartTimeFormControl"
[afDisableValidStyle]="true"
[afAnnounceIfOptional]="true"
[afRequired]="true"
[afInvalid]="formControlIsInvalid(['expectedPresenceStartTime', 'expectedPresenceEndTimeIsBeforeStartTime'])"
afType="time"
@@ -219,9 +226,10 @@
</div>
<div class="franvaro-report__time-picker">
<digi-ng-form-input
afLabel="Ange sluttid"
afLabel="Sluttid"
[formControl]="expectedPresenceEndTimeFormControl"
[afDisableValidStyle]="true"
[afAnnounceIfOptional]="true"
[afRequired]="true"
[afInvalid]="formControlIsInvalid(['expectedPresenceEndTime', 'expectedPresenceEndTimeIsBeforeStartTime'])"
afType="time"
@@ -244,7 +252,7 @@
[afValidationText]="formErrors.expectedPresenceEndTimeIsBeforeStartTime"
></digi-ng-form-validation-message>
</div>
</digi-form-fieldset>
</div>
</ng-container>
<footer class="franvaro-report__footer">
@@ -291,7 +299,7 @@
<dd>
<digi-typography-time [afDateTime]="dateFormControl.value"></digi-typography-time>
</dd>
<dt>Hel eller del av dag</dt>
<dt>Heldag eller del av dag</dt>
<dd>{{dayOrPartOfDayFromValue}}</dd>
<ng-container *ngIf="showTimePickers">
<dt>Tid för frånvaro</dt>

View File

@@ -80,27 +80,35 @@ export class FranvaroReportComponent {
get reasonFormControl(): FormControl {
return this.franvaroFormGroup.get('reason') as FormControl;
}
get dateFormControl(): FormControl {
return this.franvaroFormGroup.get('date') as FormControl;
}
get wholeDayFormControl(): FormControl {
return this.franvaroFormGroup.get('wholeDay') as FormControl;
}
get startTimeFormControl(): FormControl {
return this.franvaroFormGroup.get('startTime') as FormControl;
}
get endTimeFormControl(): FormControl {
return this.franvaroFormGroup.get('endTime') as FormControl;
}
get expectedPresenceStartTimeFormControl(): FormControl {
return this.franvaroFormGroup.get('expectedPresenceStartTime') as FormControl;
}
get expectedPresenceEndTimeFormControl(): FormControl {
return this.franvaroFormGroup.get('expectedPresenceEndTime') as FormControl;
}
get otherKnownReasonFormControl(): FormControl {
return this.franvaroFormGroup.get('otherKnownReason') as FormControl;
}
get knownReasonCommentFormControl(): FormControl {
return this.franvaroFormGroup.get('knownReasonComment') as FormControl;
}
@@ -129,7 +137,7 @@ export class FranvaroReportComponent {
}
closeConfirmDialogAndProceed(confirmDialogAnswer: ConfirmDialog, genomforandeReferens: number): void {
this.confirmDialogOpen$.next(true);
this.confirmDialogOpen$.next(false);
if (confirmDialogAnswer === ConfirmDialog.ACCEPTED) {
void this.postFranvaroReport(genomforandeReferens);