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

View File

@@ -6,9 +6,9 @@
(afOnInactive)="closeConfirmDialog()" (afOnInactive)="closeConfirmDialog()"
afHeading="Bekräfta" afHeading="Bekräfta"
afHeadingLevel="h2" afHeadingLevel="h2"
[afAriaLabel]="'Bekräfta att du vill skicka in en avvikelserapport'" [afAriaLabel]="'Bekräfta att skicka in en ' + reportToConfirm"
afPrimaryButtonText="Skicka" afPrimaryButtonText="Skicka"
afSecondaryButtonText="Avbryt" 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> </digi-ng-dialog>

View File

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