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> <p class="msfa__small-text" *ngIf="error.message">{{error.message}}</p>
</digi-notification-alert> </digi-notification-alert>
<div class="gemensam-planering__cta-wrapper"> <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]" <msfa-back-link [showIcon]="false" [asButton]="true" [route]="['/deltagare/'+ genomforandeReferens]"
>Avbryt >Avbryt
</msfa-back-link> </msfa-back-link>

View File

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

View File

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