From b471feb1191f817316cfdcce17d1412fdda61a3e Mon Sep 17 00:00:00 2001 From: Nikola Holst Nikolic Date: Fri, 26 Nov 2021 09:53:45 +0100 Subject: [PATCH 1/2] feature(digi-migrering): Utfasning av digi-ng-form-select referenser till ui. (TV-864) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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: 625e77a4 e36f910b Author: WP\holno 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 Date: Wed Nov 24 14:54:58 2021 +0100 Changed import references from digi-ng´s form-select to ui´s select-option --- .../avvikelse-report-form.component.html | 2 +- .../avvikelse-report-form.component.ts | 4 ++-- .../informativ-rapport-form.component.html | 3 ++- .../informativ-rapport-form.component.scss | 6 ++++++ .../informativ-rapport-form.component.ts | 4 ++-- .../periodisk-redovisning-form.component.ts | 4 ++-- .../pages/report-forms/signal-form/signal-form.component.ts | 4 ++-- .../handledare-picker-form.component.ts | 4 ++-- .../organization-picker-form.component.ts | 4 ++-- 9 files changed, 21 insertions(+), 14 deletions(-) diff --git a/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/report-forms/avvikelse-report-form/avvikelse-report-form.component.html b/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/report-forms/avvikelse-report-form/avvikelse-report-form.component.html index 0fbd824..74cc2b2 100644 --- a/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/report-forms/avvikelse-report-form/avvikelse-report-form.component.html +++ b/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/report-forms/avvikelse-report-form/avvikelse-report-form.component.html @@ -36,7 +36,7 @@
= this.avvikelseReportFormService.fetchAvvikelseReasons$; - reasonsAsNgDigiFormSelectItems$: Observable = this.reasons$.pipe( + reasonsAsUiSelectOptions$: Observable = this.reasons$.pipe( map(reasons => reasons.map(reason => ({ name: reason.name, value: reason.id.toString() }))) ); diff --git a/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/report-forms/informativ-rapport-form/informativ-rapport-form.component.html b/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/report-forms/informativ-rapport-form/informativ-rapport-form.component.html index 9fcd9ae..73ce3d1 100644 --- a/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/report-forms/informativ-rapport-form/informativ-rapport-form.component.html +++ b/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/report-forms/informativ-rapport-form/informativ-rapport-form.component.html @@ -48,7 +48,8 @@
({ + categorySelectItems: SelectOption[] = Object.entries(InformativRapportCategory).map(([value, name]) => ({ name, value, })); diff --git a/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/report-forms/periodisk-redovisning-form/periodisk-redovisning-form.component.ts b/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/report-forms/periodisk-redovisning-form/periodisk-redovisning-form.component.ts index abd39d4..fe0b732 100644 --- a/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/report-forms/periodisk-redovisning-form/periodisk-redovisning-form.component.ts +++ b/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/report-forms/periodisk-redovisning-form/periodisk-redovisning-form.component.ts @@ -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, diff --git a/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/report-forms/signal-form/signal-form.component.ts b/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/report-forms/signal-form/signal-form.component.ts index b2dbb34..5bca2a3 100644 --- a/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/report-forms/signal-form/signal-form.component.ts +++ b/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/report-forms/signal-form/signal-form.component.ts @@ -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 }, ]; diff --git a/apps/mina-sidor-fa/src/app/shared/components/handledare-picker-form/handledare-picker-form.component.ts b/apps/mina-sidor-fa/src/app/shared/components/handledare-picker-form/handledare-picker-form.component.ts index e98b1d9..e4109b5 100644 --- a/apps/mina-sidor-fa/src/app/shared/components/handledare-picker-form/handledare-picker-form.component.ts +++ b/apps/mina-sidor-fa/src/app/shared/components/handledare-picker-form/handledare-picker-form.component.ts @@ -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 = this.handledareService.lastSavedHandledare$; submitHandledareLoading$: Observable = this.handledareService.submitHandledareLoading$; diff --git a/apps/mina-sidor-fa/src/app/shared/components/organization-picker-form/organization-picker-form.component.ts b/apps/mina-sidor-fa/src/app/shared/components/organization-picker-form/organization-picker-form.component.ts index 2d0156b..e0418d2 100644 --- a/apps/mina-sidor-fa/src/app/shared/components/organization-picker-form/organization-picker-form.component.ts +++ b/apps/mina-sidor-fa/src/app/shared/components/organization-picker-form/organization-picker-form.component.ts @@ -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 = []; + selectableOrganizations: Array = []; ngOnChanges(changes: SimpleChanges): void { if (changes.selectedOrganization) { From 863604986688f24a69dc96155f840ac373103448 Mon Sep 17 00:00:00 2001 From: Daniel Appelgren Date: Fri, 26 Nov 2021 10:24:48 +0100 Subject: [PATCH 2/2] Pull request #281: TV-811 Because it's workdays and not calendar days we temporarily set this to much more. Merge in TEA/mina-sidor-fa-web from feature/TV-811-increase-dates-since-its-workdays-and-not-calendar-days to next Squashed commit of the following: commit cdafaee42c71d8d4e0bf0d87ffc6e542a02e9e82 Author: Daniel Appelgren Date: Fri Nov 26 10:11:14 2021 +0100 Because it's workdays and not calendar days we temporarily set this to much more. This date should be fetched from API in the future --- .../avvikelse-report-form/avvikelse-report-form.component.ts | 4 +++- .../gemensam-planering-form.component.ts | 4 +++- .../slutredovisning-form/slutredovisning-form.component.ts | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/report-forms/avvikelse-report-form/avvikelse-report-form.component.ts b/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/report-forms/avvikelse-report-form/avvikelse-report-form.component.ts index 7455ec8..1d38f62 100644 --- a/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/report-forms/avvikelse-report-form/avvikelse-report-form.component.ts +++ b/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/report-forms/avvikelse-report-form/avvikelse-report-form.component.ts @@ -139,7 +139,9 @@ export class AvvikelseReportFormComponent implements OnInit, OnDestroy { return new Date() > startDate; } private _isBeforeLastPossibleReportDay(endDate: Date): boolean { - const lastPossibleReportDay = addDays(endDate, 5); // Reporting is allowed at latest 5 days past avrop end date. + // Reporting is allowed at latest 5 days past avrop end date. + // Because it's workdays and not calendar days we temporarily set this to much more. This date should be fetched from API in the future + const lastPossibleReportDay = addDays(endDate, 15); return lastPossibleReportDay > new Date(); } diff --git a/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/report-forms/gemensam-planering-form/gemensam-planering-form.component.ts b/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/report-forms/gemensam-planering-form/gemensam-planering-form.component.ts index 022beeb..a426c63 100644 --- a/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/report-forms/gemensam-planering-form/gemensam-planering-form.component.ts +++ b/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/report-forms/gemensam-planering-form/gemensam-planering-form.component.ts @@ -154,7 +154,9 @@ export class GemensamPlaneringFormComponent { return new Date() > startDate; } private _isBeforeLastPossibleReportDay(endDate: Date): boolean { - const lastPossibleReportDay = addDays(endDate, 5); // Reporting is allowed at latest 5 days past avrop end date. + // Reporting is allowed at latest 5 days past avrop end date. + // Because it's workdays and not calendar days we temporarily set this to much more. This date should be fetched from API in the future + const lastPossibleReportDay = addDays(endDate, 15); return lastPossibleReportDay > new Date(); } diff --git a/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/report-forms/slutredovisning-form/slutredovisning-form.component.ts b/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/report-forms/slutredovisning-form/slutredovisning-form.component.ts index 8cd3e8d..2489eb3 100644 --- a/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/report-forms/slutredovisning-form/slutredovisning-form.component.ts +++ b/apps/mina-sidor-fa/src/app/pages/deltagare/pages/deltagare-details/pages/report-forms/slutredovisning-form/slutredovisning-form.component.ts @@ -64,7 +64,9 @@ export class SlutredovisningFormComponent { } private _isBeforeLastPossibleReportDay(date: Date): boolean { - const lastPossibleReportDay = addDays(date, 60); // Reporting is allowed at latest 60 days past avrop end date. + // Reporting is allowed at latest 60 days past avrop end date. + // Because it's workdays and not calendar days we temporarily set this to much more. This date should be fetched from API in the future + const lastPossibleReportDay = addDays(date, 100); return lastPossibleReportDay > new Date(); }