Merge pull request #139 in TEA/mina-sidor-fa-web from feature/TV-633-fix to develop

Squashed commit of the following:

commit 540a53d92a2680e1e950a3731b23ef864e0d28d4
Author: fueno <nicolas.fuentes-maturana@arbetsformedlingen.se>
Date:   Sun Sep 26 22:04:09 2021 +0200

    TV-633 confirm dialog input for report name
This commit is contained in:
Nicolas Fuentes Maturana
2021-09-27 22:36:46 +02:00
parent 41a3cc61bd
commit 30306a30b8
3 changed files with 56 additions and 56 deletions

View File

@@ -37,35 +37,32 @@
(change)="setOrsakerChanged()"
></msfa-deltagare-orsaks-form>
<ng-container *ngIf="showDescription">
<div class="deltagare-avvikelse__description">
<digi-ng-form-textarea
[formControlName]="descriptionFormControlName"
afLabel="Beskriv frånvaro"
[afSize]="sizeTextArea"
[afDisableValidStyle]="true"
[afMaxLength]="2000"
[afRequired]="true"
[afInvalid]="avvikelseFormGroup?.errors?.descriptionIsRequired && descriptionFormControl.touched"
></digi-ng-form-textarea>
<digi-form-validation-message
af-variation="error"
*ngIf="avvikelseFormGroup?.errors?.descriptionIsRequired && descriptionFormControl.touched"
>
Beskrivning är obligatoriskt
</digi-form-validation-message>
</div>
</ng-container>
<div *ngIf="showDescription" class="deltagare-avvikelse__description">
<digi-ng-form-textarea
[formControlName]="descriptionFormControlName"
afLabel="Beskriv frånvaro"
[afSize]="sizeTextArea"
[afDisableValidStyle]="true"
[afMaxLength]="2000"
[afRequired]="true"
[afInvalid]="avvikelseFormGroup?.errors?.descriptionIsRequired && descriptionFormControl.touched"
></digi-ng-form-textarea>
<digi-form-validation-message
af-variation="error"
*ngIf="avvikelseFormGroup?.errors?.descriptionIsRequired && descriptionFormControl.touched"
>
Beskrivning är obligatoriskt
</digi-form-validation-message>
</div>
<ng-container *ngIf="showFragor">
<msfa-deltagare-fragor-form
[fragor1]="fragor1$ | async"
[fragor2]="fragor2$ | async"
[fragorFormGroup]="avvikelseFormGroup.get('fragorFormGroup')"
[avvikelseFormGroup]="avvikelseFormGroup"
[selectedOrsaksKod]="selectedOrsaksKod"
></msfa-deltagare-fragor-form>
</ng-container>
<msfa-deltagare-fragor-form
*ngIf="showFragor"
[fragor1]="fragor1$ | async"
[fragor2]="fragor2$ | async"
[fragorFormGroup]="avvikelseFormGroup.get('fragorFormGroup')"
[avvikelseFormGroup]="avvikelseFormGroup"
[selectedOrsaksKod]="selectedOrsaksKod"
></msfa-deltagare-fragor-form>
<div *ngIf="showDatePicker" class="deltagare-avvikelse__datepicker">
<digi-ng-form-datepicker
@@ -87,12 +84,11 @@
></digi-ng-form-radiobutton-group>
</div>
<ng-container *ngIf="showTimePicker">
<msfa-deltagare-time-picker
[timepickerFormGroup]="avvikelseFormGroup.get('timepickerFormGroup')"
[avvikelseFormGroup]="avvikelseFormGroup"
></msfa-deltagare-time-picker>
</ng-container>
<msfa-deltagare-time-picker
*ngIf="showTimePicker"
[timepickerFormGroup]="avvikelseFormGroup.get('timepickerFormGroup')"
[avvikelseFormGroup]="avvikelseFormGroup"
></msfa-deltagare-time-picker>
</form>
</ng-container>
@@ -108,29 +104,32 @@
<div class="deltagare-avvikelse__step-buttons-wrapper">
<ng-container *ngIf="(showSuccessNotification$ | async) !== true">
<ng-container *ngIf="currentStep > 1">
<digi-button
class="deltagare-avvikelse__step-buttons-wrapper--space-right"
af-variation="secondary"
af-size="m"
(afOnClick)="previousStep()"
>
Tillbaka
</digi-button>
</ng-container>
<ng-container *ngIf="currentStep === totalAmountOfSteps">
<digi-button af-size="m" (afOnClick)="openConfirmDialog = true;"> Skicka in </digi-button>
</ng-container>
</ng-container>
<ng-container *ngIf="currentStep === (totalAmountOfSteps -1)">
<digi-button af-size="m" (afOnClick)="nextStep"> Förhandsgranska </digi-button>
</ng-container>
<ng-container *ngIf="showSuccessNotification$ | async">
<digi-button af-size="m" (afOnClick)="backToDeltagare()"> Tillbaka till deltagaren </digi-button>
<digi-button
*ngIf="currentStep > 1"
class="deltagare-avvikelse__step-buttons-wrapper--space-right"
af-variation="secondary"
af-size="m"
(afOnClick)="previousStep()"
>
Tillbaka
</digi-button>
<digi-button *ngIf="currentStep === totalAmountOfSteps" af-size="m" (afOnClick)="openConfirmDialog = true">
Skicka in
</digi-button>
</ng-container>
<digi-button *ngIf="currentStep === (totalAmountOfSteps -1)" af-size="m" (afOnClick)="nextStep">
Förhandsgranska
</digi-button>
<digi-button *ngIf="showSuccessNotification$ | async" af-size="m" (afOnClick)="backToDeltagare()">
Tillbaka till deltagaren
</digi-button>
</div>
</msfa-report-layout>
<msfa-confirm-dialog [openConfirmDialog]="openConfirmDialog" (confirmDialogChanged)="setConfirmDialogChanged($event)">
<msfa-confirm-dialog
[openConfirmDialog]="openConfirmDialog"
reportToConfirm="avvikelserapport"
(confirmDialogChanged)="setConfirmDialogChanged($event)"
>
</msfa-confirm-dialog>
</msfa-layout>

View File

@@ -6,9 +6,9 @@
(afOnInactive)="closeConfirmDialog()"
afHeading="Bekräfta"
afHeadingLevel="h2"
[afAriaLabel]="'Bekräfta att du vill skicka in en avvikelserapport'"
[afAriaLabel]="'Bekräfta att skicka in en ' + reportToConfirm"
afPrimaryButtonText="Skicka"
afSecondaryButtonText="Avbryt"
>
<p>Är du säker på att du vill skicka in en avvikelserapport?</p>
<p>Är du säker på att du vill skicka in en {{reportToConfirm}}?</p>
</digi-ng-dialog>

View File

@@ -9,6 +9,7 @@ import { ConfirmDialog } from '@msfa-enums/confirm-dialog.enum';
})
export class ConfirmDialogComponent {
@Input() openConfirmDialog: boolean;
@Input() reportToConfirm: string;
@Output() confirmDialogChanged = new EventEmitter<ConfirmDialog>();
sendRequest(): void {