feature(digi-migrering): Utfasning av digi-ng-form-select referenser till ui. (TV-864)
Merge in TEA/mina-sidor-fa-web from next to develop Squashed commit of the following: commitb471feb119Author: Nikola Holst Nikolic <nikola.holst-nikolic@arbetsformedlingen.se> Date: Fri Nov 26 09:53:45 2021 +0100 feature(digi-migrering): Utfasning av digi-ng-form-select referenser till ui. (TV-864) Merge in TEA/mina-sidor-fa-web from feature/TV-864-digi-ng-form-select to next Squashed commit of the following: commit 8fa5927514505947ac9be08f880397e2658cdc39 Author: WP\holno <nikola.holst-nikolic@arbetsformedlingen.se> Date: Wed Nov 24 15:37:56 2021 +0100 Prevent digi-core´s warning message in console. Already solved in feature "TV-874-upload file" but this ticket will be releaced before that so made the change here too. commit 7100ef767c746f34f354bfb8537f570b0ae9b007 Merge: 625e77a4e36f910bAuthor: WP\holno <nikola.holst-nikolic@arbetsformedlingen.se> Date: Wed Nov 24 15:25:32 2021 +0100 Merge branch 'develop' into feature/TV-864-digi-ng-form-select commit 625e77a42f7fcf37219c4377f3f31db33228310d Author: WP\holno <nikola.holst-nikolic@arbetsformedlingen.se> Date: Wed Nov 24 14:54:58 2021 +0100 Changed import references from digi-ng´s form-select to ui´s select-option
This commit is contained in:
@@ -36,7 +36,7 @@
|
||||
<form class="avvikelse-report-form__form" [formGroup]="avvikelseFormGroup" (ngSubmit)="openConfirmDialog()">
|
||||
<div class="avvikelse-report-form__form-item">
|
||||
<ui-select
|
||||
*ngIf="reasonsAsNgDigiFormSelectItems$ | async as reason; else loadingRef"
|
||||
*ngIf="reasonsAsUiSelectOptions$ | async as reason; else loadingRef"
|
||||
[formControlName]="reasonFormName"
|
||||
uiLabel="Orsak till avvikelse"
|
||||
uiPlaceholder="Välj orsak till avvikelse"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { FormSelectItem } from '@af/digi-ng/_form/form-select';
|
||||
import { SelectOption } from '@ui/select/select-option.model';
|
||||
import { ChangeDetectionStrategy, Component, OnDestroy, OnInit } from '@angular/core';
|
||||
import { AbstractControl, FormArray, FormControl, FormGroup } from '@angular/forms';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
@@ -52,7 +52,7 @@ export class AvvikelseReportFormComponent implements OnInit, OnDestroy {
|
||||
);
|
||||
|
||||
reasons$: Observable<AvvikelseReason[]> = this.avvikelseReportFormService.fetchAvvikelseReasons$;
|
||||
reasonsAsNgDigiFormSelectItems$: Observable<FormSelectItem[]> = this.reasons$.pipe(
|
||||
reasonsAsUiSelectOptions$: Observable<SelectOption[]> = this.reasons$.pipe(
|
||||
map(reasons => reasons.map(reason => ({ name: reason.name, value: reason.id.toString() })))
|
||||
);
|
||||
|
||||
|
||||
@@ -48,7 +48,8 @@
|
||||
</div>
|
||||
<ui-select
|
||||
[formControl]="categoryFormControl"
|
||||
uiLabel=""
|
||||
class="informativ-rapport-form__category"
|
||||
uiLabel="Välj kategori"
|
||||
uiPlaceholder="Välj kategori"
|
||||
uiId="informativ-rapport-form-category"
|
||||
[uiAnnounceIfOptional]="true"
|
||||
|
||||
@@ -12,6 +12,12 @@
|
||||
gap: $digi--layout--gutter--l;
|
||||
}
|
||||
|
||||
&__category {
|
||||
::ng-deep .digi-form-label {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
&__label-wrapper {
|
||||
display: flex;
|
||||
gap: var(--digi--layout--gutter);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { FormSelectItem } from '@af/digi-ng/_form/form-select';
|
||||
import { SelectOption } from '@ui/select/select-option.model';
|
||||
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
||||
import { FormControl, FormGroup } from '@angular/forms';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
@@ -37,7 +37,7 @@ export class InformativRapportFormComponent {
|
||||
category: new FormControl(null, [RequiredValidator('Ett ärende måste väljas')]),
|
||||
comment: new FormControl('', [RequiredValidator('Kompletterande information är obligatoriskt')]),
|
||||
});
|
||||
categorySelectItems: FormSelectItem[] = Object.entries(InformativRapportCategory).map(([value, name]) => ({
|
||||
categorySelectItems: SelectOption[] = Object.entries(InformativRapportCategory).map(([value, name]) => ({
|
||||
name,
|
||||
value,
|
||||
}));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { RadiobuttonGroupDirection } from '@af/digi-ng/_form/form-radiobutton-group';
|
||||
import { FormSelectItem } from '@af/digi-ng/_form/form-select';
|
||||
import { SelectOption } from '@ui/select/select-option.model';
|
||||
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
|
||||
import { AbstractControl, FormArray, FormControl, FormGroup } from '@angular/forms';
|
||||
import { ActivatedRoute, Params } from '@angular/router';
|
||||
@@ -94,7 +94,7 @@ export class PeriodiskRedovisningFormComponent implements OnInit {
|
||||
shareReplay(1)
|
||||
);
|
||||
|
||||
periodsToFormselectItems(periods: AvropPeriod[]): FormSelectItem[] {
|
||||
periodsToFormselectItems(periods: AvropPeriod[]): SelectOption[] {
|
||||
return periods.map(period => ({
|
||||
name: this.getPeriodName(period.startDate),
|
||||
value: period.periodId,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { FormSelectItem } from '@af/digi-ng/_form/form-select';
|
||||
import { SelectOption } from '@ui/select/select-option.model';
|
||||
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
||||
import { FormControl, FormGroup } from '@angular/forms';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
@@ -49,7 +49,7 @@ export class SignalFormComponent {
|
||||
shareReplay(1)
|
||||
);
|
||||
|
||||
typeSelectItems: FormSelectItem[] = [
|
||||
typeSelectItems: SelectOption[] = [
|
||||
{ name: 'Arbete', value: SignalType.Arbete },
|
||||
{ name: 'Utbildning', value: SignalType.Utbildning },
|
||||
];
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { FormSelectItem } from '@af/digi-ng/_form/form-select';
|
||||
import { SelectOption } from '@ui/select/select-option.model';
|
||||
import {
|
||||
ChangeDetectionStrategy,
|
||||
Component,
|
||||
@@ -32,7 +32,7 @@ export class HandledarePickerFormComponent implements OnChanges {
|
||||
formGroup: FormGroup = new FormGroup({
|
||||
handledare: new FormControl(null, [RequiredValidator('Handledare är obligatorisk')]),
|
||||
});
|
||||
selectableHandledare: FormSelectItem[] = [];
|
||||
selectableHandledare: SelectOption[] = [];
|
||||
submitted = false;
|
||||
lastSavedHandledare$: Observable<Handledare> = this.handledareService.lastSavedHandledare$;
|
||||
submitHandledareLoading$: Observable<boolean> = this.handledareService.submitHandledareLoading$;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { FormSelectItem } from '@af/digi-ng/_form/form-select';
|
||||
import { SelectOption } from '@ui/select/select-option.model';
|
||||
import {
|
||||
ChangeDetectionStrategy,
|
||||
Component,
|
||||
@@ -29,7 +29,7 @@ export class OrganizationPickerFormComponent implements OnChanges {
|
||||
organizationPickerFormGroup: FormGroup = new FormGroup({
|
||||
organization: new FormControl(null, [RequiredValidator('Organisation är obligatorisk')]),
|
||||
});
|
||||
selectableOrganizations: Array<FormSelectItem> = [];
|
||||
selectableOrganizations: Array<SelectOption> = [];
|
||||
|
||||
ngOnChanges(changes: SimpleChanges): void {
|
||||
if (changes.selectedOrganization) {
|
||||
|
||||
Reference in New Issue
Block a user