Pull request #274: Remaining stuff

Merge in TEA/mina-sidor-fa-web from feature/TV-861-digi-ng-form-validation-message-v2-remaining-changes to develop

Squashed commit of the following:

commit 2dc4351060b6a9d209911c414adce42e5efaafa2
Merge: 64bc95d2 60d4ac4b
Author: WP\holno <nikola.holst-nikolic@arbetsformedlingen.se>
Date:   Wed Nov 24 13:59:46 2021 +0100

    Merge branch 'develop' into feature/TV-861-digi-ng-form-validation-message-v2-remaining-changes

commit 64bc95d234613ca41a6b4e748890df42462a4d88
Author: WP\holno <nikola.holst-nikolic@arbetsformedlingen.se>
Date:   Fri Nov 19 16:23:23 2021 +0100

    - Removed DigiNgFormSelectModule references
    - Replaced remaining digi-ng-form-select with ui-select
This commit is contained in:
Nikola Holst Nikolic
2021-11-24 14:04:56 +01:00
parent 60d4ac4b2c
commit 1ae96735c4
14 changed files with 29 additions and 65 deletions

View File

@@ -2,7 +2,6 @@ import { DigiNgFormCheckboxModule } from '@af/digi-ng/_form/form-checkbox';
import { DigiNgFormDatepickerModule } from '@af/digi-ng/_form/form-datepicker'; import { DigiNgFormDatepickerModule } from '@af/digi-ng/_form/form-datepicker';
import { DigiNgFormInputModule } from '@af/digi-ng/_form/form-input'; import { DigiNgFormInputModule } from '@af/digi-ng/_form/form-input';
import { DigiNgFormRadiobuttonGroupModule } from '@af/digi-ng/_form/form-radiobutton-group'; import { DigiNgFormRadiobuttonGroupModule } from '@af/digi-ng/_form/form-radiobutton-group';
import { DigiNgFormSelectModule } from '@af/digi-ng/_form/form-select';
import { DigiNgPopoverModule } from '@af/digi-ng/_popover/popover'; import { DigiNgPopoverModule } from '@af/digi-ng/_popover/popover';
import { HttpClientTestingModule } from '@angular/common/http/testing'; import { HttpClientTestingModule } from '@angular/common/http/testing';
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
@@ -24,7 +23,6 @@ describe('EditEmployeeFormComponent', () => {
DigiNgFormInputModule, DigiNgFormInputModule,
DigiNgFormRadiobuttonGroupModule, DigiNgFormRadiobuttonGroupModule,
DigiNgFormDatepickerModule, DigiNgFormDatepickerModule,
DigiNgFormSelectModule,
DigiNgPopoverModule, DigiNgPopoverModule,
DigiNgFormCheckboxModule, DigiNgFormCheckboxModule,
HttpClientTestingModule, HttpClientTestingModule,

View File

@@ -2,7 +2,6 @@ import { DigiNgFormCheckboxModule } from '@af/digi-ng/_form/form-checkbox';
import { DigiNgFormDatepickerModule } from '@af/digi-ng/_form/form-datepicker'; import { DigiNgFormDatepickerModule } from '@af/digi-ng/_form/form-datepicker';
import { DigiNgFormInputModule } from '@af/digi-ng/_form/form-input'; import { DigiNgFormInputModule } from '@af/digi-ng/_form/form-input';
import { DigiNgFormRadiobuttonGroupModule } from '@af/digi-ng/_form/form-radiobutton-group'; import { DigiNgFormRadiobuttonGroupModule } from '@af/digi-ng/_form/form-radiobutton-group';
import { DigiNgFormSelectModule } from '@af/digi-ng/_form/form-select';
import { DigiNgPopoverModule } from '@af/digi-ng/_popover/popover'; import { DigiNgPopoverModule } from '@af/digi-ng/_popover/popover';
import { HttpClientTestingModule } from '@angular/common/http/testing'; import { HttpClientTestingModule } from '@angular/common/http/testing';
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
@@ -27,7 +26,6 @@ describe('EmployeeFormComponent', () => {
DigiNgFormInputModule, DigiNgFormInputModule,
DigiNgFormRadiobuttonGroupModule, DigiNgFormRadiobuttonGroupModule,
DigiNgFormDatepickerModule, DigiNgFormDatepickerModule,
DigiNgFormSelectModule,
DigiNgPopoverModule, DigiNgPopoverModule,
DigiNgFormCheckboxModule, DigiNgFormCheckboxModule,
], ],

View File

@@ -1,4 +1,3 @@
import { DigiNgFormSelectModule } from '@af/digi-ng/_form/form-select';
import { HttpClientTestingModule } from '@angular/common/http/testing'; import { HttpClientTestingModule } from '@angular/common/http/testing';
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing';
@@ -20,7 +19,6 @@ describe('DeltagareTabReportsComponent', () => {
HttpClientTestingModule, HttpClientTestingModule,
ReactiveFormsModule, ReactiveFormsModule,
UiLoaderModule, UiLoaderModule,
DigiNgFormSelectModule,
], ],
providers: [DeltagareCardService], providers: [DeltagareCardService],
schemas: [CUSTOM_ELEMENTS_SCHEMA], schemas: [CUSTOM_ELEMENTS_SCHEMA],

View File

@@ -1,4 +1,3 @@
import { DigiNgFormSelectModule } from '@af/digi-ng/_form/form-select';
import { DigiNgLayoutExpansionPanelModule } from '@af/digi-ng/_layout/layout-expansion-panel'; import { DigiNgLayoutExpansionPanelModule } from '@af/digi-ng/_layout/layout-expansion-panel';
import { DigiNgPopoverModule } from '@af/digi-ng/_popover/popover'; import { DigiNgPopoverModule } from '@af/digi-ng/_popover/popover';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
@@ -42,7 +41,6 @@ import { DeltagareCardService } from './deltagare-card.service';
HandledarePickerFormModule, HandledarePickerFormModule,
DigiNgLayoutExpansionPanelModule, DigiNgLayoutExpansionPanelModule,
DigiNgPopoverModule, DigiNgPopoverModule,
DigiNgFormSelectModule,
UiSkeletonModule, UiSkeletonModule,
IconModule, IconModule,
UiLinkButtonModule, UiLinkButtonModule,

View File

@@ -2,7 +2,6 @@ import { DigiNgDialogModule } from '@af/digi-ng/_dialog/dialog';
import { DigiNgFormDatepickerModule } from '@af/digi-ng/_form/form-datepicker'; import { DigiNgFormDatepickerModule } from '@af/digi-ng/_form/form-datepicker';
import { DigiNgFormInputModule } from '@af/digi-ng/_form/form-input'; import { DigiNgFormInputModule } from '@af/digi-ng/_form/form-input';
import { DigiNgFormRadiobuttonGroupModule } from '@af/digi-ng/_form/form-radiobutton-group'; import { DigiNgFormRadiobuttonGroupModule } from '@af/digi-ng/_form/form-radiobutton-group';
import { DigiNgFormSelectModule } from '@af/digi-ng/_form/form-select';
import { DigiNgProgressProgressbarModule } from '@af/digi-ng/_progress/progressbar'; import { DigiNgProgressProgressbarModule } from '@af/digi-ng/_progress/progressbar';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
@@ -36,7 +35,6 @@ import { UiSelectModule } from '@ui/select/select.module';
ConfirmDialogModule, ConfirmDialogModule,
UiBackLinkModule, UiBackLinkModule,
UiSkeletonModule, UiSkeletonModule,
DigiNgFormSelectModule,
UiLoaderModule, UiLoaderModule,
UiSelectModule, UiSelectModule,
ReportDescriptionListModule, ReportDescriptionListModule,

View File

@@ -3,7 +3,6 @@ import { DigiNgFormDatepickerModule } from '@af/digi-ng/_form/form-datepicker';
import { DigiNgFormInputModule } from '@af/digi-ng/_form/form-input'; import { DigiNgFormInputModule } from '@af/digi-ng/_form/form-input';
import { DigiNgFormRadiobuttonGroupModule } from '@af/digi-ng/_form/form-radiobutton-group'; import { DigiNgFormRadiobuttonGroupModule } from '@af/digi-ng/_form/form-radiobutton-group';
import { DigiNgFormRangeModule } from '@af/digi-ng/_form/form-range'; import { DigiNgFormRangeModule } from '@af/digi-ng/_form/form-range';
import { DigiNgFormSelectModule } from '@af/digi-ng/_form/form-select';
import { DigiNgProgressProgressbarModule } from '@af/digi-ng/_progress/progressbar'; import { DigiNgProgressProgressbarModule } from '@af/digi-ng/_progress/progressbar';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
@@ -65,7 +64,6 @@ import { SlutredovisningFormService } from './slutredovisning-form.service';
ConfirmDialogModule, ConfirmDialogModule,
UiBackLinkModule, UiBackLinkModule,
UiSkeletonModule, UiSkeletonModule,
DigiNgFormSelectModule,
UiLoaderModule, UiLoaderModule,
UiSelectModule, UiSelectModule,
ReportDescriptionListModule, ReportDescriptionListModule,

View File

@@ -1,17 +1,14 @@
<form class="handledare-picker-form" [formGroup]="formGroup" (ngSubmit)="onFormSubmitted()"> <form class="handledare-picker-form" [formGroup]="formGroup" (ngSubmit)="onFormSubmitted()">
<digi-ng-form-select <ui-select
class="handledare-picker-form__select"
[formControl]="handledareFormControl" [formControl]="handledareFormControl"
[afLabel]="label" [uiLabel]="label"
[afPlaceholder]="label" [uiPlaceholder]="label"
[afSelectItems]="selectableHandledare" [uiOptions]="selectableHandledare"
[afDisableValidStyle]="true" [uiRequired]="true"
[afRequired]="true" [uiAnnounceIfOptional]="true"
[afAnnounceIfOptional]="true" [uiInvalid]="handledareFormControl.invalid && handledareFormControl.touched || invalid"
[afInvalid]="(handledareFormControl.invalid && handledareFormControl.touched) || invalid" (uiOnChange)="handledareChanged()"
(afOnChange)="handledareChanged()" ></ui-select>
></digi-ng-form-select>
<digi-button *ngIf="!skipSubmit" class="handledare-picker-form__submit" af-type="submit"> <digi-button *ngIf="!skipSubmit" class="handledare-picker-form__submit" af-type="submit">
{{submitText}} {{submitText}}
</digi-button> </digi-button>

View File

@@ -23,13 +23,4 @@
&__validation-wrapper { &__validation-wrapper {
grid-area: validation; grid-area: validation;
} }
&__validation-message {
display: block;
margin-bottom: $digi--layout--gutter--s;
}
::ng-deep .digi-ng-form-select__footer {
display: none !important;
}
} }

View File

@@ -1,4 +1,3 @@
import { DigiNgFormSelectModule } from '@af/digi-ng/_form/form-select';
import { HttpClientTestingModule } from '@angular/common/http/testing'; import { HttpClientTestingModule } from '@angular/common/http/testing';
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing';
@@ -11,7 +10,7 @@ describe('HandledarePickerFormComponent', () => {
beforeEach(async () => { beforeEach(async () => {
await TestBed.configureTestingModule({ await TestBed.configureTestingModule({
imports: [ReactiveFormsModule, HttpClientTestingModule, FormsModule, DigiNgFormSelectModule], imports: [ReactiveFormsModule, HttpClientTestingModule, FormsModule],
declarations: [HandledarePickerFormComponent], declarations: [HandledarePickerFormComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA], schemas: [CUSTOM_ELEMENTS_SCHEMA],
}).compileComponents(); }).compileComponents();

View File

@@ -1,15 +1,21 @@
import { DigiNgFormSelectModule } from '@af/digi-ng/_form/form-select';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { ReactiveFormsModule } from '@angular/forms'; import { ReactiveFormsModule } from '@angular/forms';
import { UiLoaderModule } from '@ui/loader/loader.module'; import { UiLoaderModule } from '@ui/loader/loader.module';
import { HandledarePickerFormComponent } from './handledare-picker-form.component'; import { HandledarePickerFormComponent } from './handledare-picker-form.component';
import { UiSelectModule } from '@ui/select/select.module';
import { UiValidationMessageModule } from '@ui/validation-message/validation-message.module'; import { UiValidationMessageModule } from '@ui/validation-message/validation-message.module';
@NgModule({ @NgModule({
schemas: [CUSTOM_ELEMENTS_SCHEMA], schemas: [CUSTOM_ELEMENTS_SCHEMA],
declarations: [HandledarePickerFormComponent], declarations: [HandledarePickerFormComponent],
imports: [CommonModule, ReactiveFormsModule, UiLoaderModule, DigiNgFormSelectModule, UiValidationMessageModule], imports: [
CommonModule,
ReactiveFormsModule,
UiLoaderModule,
UiSelectModule,
UiValidationMessageModule,
],
exports: [HandledarePickerFormComponent], exports: [HandledarePickerFormComponent],
}) })
export class HandledarePickerFormModule {} export class HandledarePickerFormModule {}

View File

@@ -5,22 +5,14 @@
[formGroup]="organizationPickerFormGroup" [formGroup]="organizationPickerFormGroup"
(ngSubmit)="onFormSubmitted()" (ngSubmit)="onFormSubmitted()"
> >
<digi-ng-form-select <ui-select
class="organization-picker-form__select"
[formControl]="organizationFormControl" [formControl]="organizationFormControl"
[afLabel]="label" [uiLabel]="label"
[afPlaceholder]="label" [uiPlaceholder]="label"
[afSelectItems]="selectableOrganizations" [uiOptions]="selectableOrganizations"
[afDisableValidStyle]="true" [uiRequired]="true"
[afRequired]="true" [uiInvalid]="organizationFormControl.invalid && organizationFormControl.touched"
[afInvalid]="organizationFormControl.invalid && organizationFormControl.touched"
></digi-ng-form-select>
<digi-button class="organization-picker-form__submit" af-type="submit">{{submitText}}</digi-button>
<ui-validation-message
class="organization-picker-form__error"
[uiShowValidationMessage]="organizationFormControl.invalid && organizationFormControl.touched"
uiValidationMessage="Du måste välja en organisation för att kunna logga in" uiValidationMessage="Du måste välja en organisation för att kunna logga in"
></ui-validation-message> ></ui-select>
<digi-button class="organization-picker-form__submit" af-type="submit">{{submitText}}</digi-button>
</form> </form>

View File

@@ -29,12 +29,4 @@
margin-top: $digi--layout--gutter--l; margin-top: $digi--layout--gutter--l;
align-self: end; align-self: end;
} }
&__error {
grid-area: error;
}
::ng-deep .digi-ng-form-select__footer {
display: none !important;
}
} }

View File

@@ -1,4 +1,3 @@
import { DigiNgFormSelectModule } from '@af/digi-ng/_form/form-select';
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing';
import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { FormsModule, ReactiveFormsModule } from '@angular/forms';
@@ -10,7 +9,7 @@ describe('OrganizationPickerFormComponent', () => {
beforeEach(async () => { beforeEach(async () => {
await TestBed.configureTestingModule({ await TestBed.configureTestingModule({
imports: [ReactiveFormsModule, FormsModule, DigiNgFormSelectModule], imports: [ReactiveFormsModule, FormsModule],
declarations: [OrganizationPickerFormComponent], declarations: [OrganizationPickerFormComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA], schemas: [CUSTOM_ELEMENTS_SCHEMA],
}).compileComponents(); }).compileComponents();

View File

@@ -1,14 +1,14 @@
import { DigiNgFormSelectModule } from '@af/digi-ng/_form/form-select';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { ReactiveFormsModule } from '@angular/forms'; import { ReactiveFormsModule } from '@angular/forms';
import { UiValidationMessageModule } from '@ui/validation-message/validation-message.module'; import { UiValidationMessageModule } from '@ui/validation-message/validation-message.module';
import { OrganizationPickerFormComponent } from './organization-picker-form.component'; import { OrganizationPickerFormComponent } from './organization-picker-form.component';
import { UiSelectModule } from '@ui/select/select.module';
@NgModule({ @NgModule({
schemas: [CUSTOM_ELEMENTS_SCHEMA], schemas: [CUSTOM_ELEMENTS_SCHEMA],
declarations: [OrganizationPickerFormComponent], declarations: [OrganizationPickerFormComponent],
imports: [CommonModule, ReactiveFormsModule, DigiNgFormSelectModule, UiValidationMessageModule], imports: [CommonModule, ReactiveFormsModule, UiSelectModule, UiValidationMessageModule],
exports: [OrganizationPickerFormComponent], exports: [OrganizationPickerFormComponent],
}) })
export class OrganizationPickerFormModule {} export class OrganizationPickerFormModule {}