From 7a5793316d94c34fa46607c5fc2ecabc6086a656 Mon Sep 17 00:00:00 2001 From: mbritense <79840403+mbritense@users.noreply.github.com> Date: Tue, 7 May 2024 10:57:15 +0200 Subject: [PATCH 01/13] feat: task list feedback (#974) * feedback * comment --- .../carbon-list/carbon-list.component.html | 2 +- .../carbon-list/carbon-list.component.scss | 12 ++++++++---- .../src/lib/services/task-list-pagination.service.ts | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/projects/valtimo/components/src/lib/components/carbon-list/carbon-list.component.html b/projects/valtimo/components/src/lib/components/carbon-list/carbon-list.component.html index b620dcc60..6e49bf1ab 100644 --- a/projects/valtimo/components/src/lib/components/carbon-list/carbon-list.component.html +++ b/projects/valtimo/components/src/lib/components/carbon-list/carbon-list.component.html @@ -118,7 +118,7 @@ -
+
td .locked) { + cursor: not-allowed; + + td { + color: var(--cds-text-on-color-disabled); + } +} + .valtimo-carbon-list { ::ng-deep &__header--hidden thead { display: none; @@ -94,7 +102,3 @@ td:first-child { } } } - -.disabled { - cursor: not-allowed; -} diff --git a/projects/valtimo/task/src/lib/services/task-list-pagination.service.ts b/projects/valtimo/task/src/lib/services/task-list-pagination.service.ts index 2ed1a101b..12eda6ff9 100644 --- a/projects/valtimo/task/src/lib/services/task-list-pagination.service.ts +++ b/projects/valtimo/task/src/lib/services/task-list-pagination.service.ts @@ -40,7 +40,7 @@ export class TaskListPaginationService { public get paginationForCurrentTaskTypeForList$(): Observable { return this._paginationForCurrentTaskType$.pipe( - map(pagination => ({...pagination, page: pagination.page + 1})) + map(pagination => ({...pagination, page: pagination?.page + 1 || 1})) ); } From 1d8db4795fef02ca694cc6d06b2e4a39b7044dea Mon Sep 17 00:00:00 2001 From: mbritense <79840403+mbritense@users.noreply.github.com> Date: Tue, 7 May 2024 16:24:53 +0200 Subject: [PATCH 02/13] fixes (#977) --- .../dossier-management-status-modal.component.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/projects/valtimo/dossier-management/src/lib/components/dossier-management-statuses/dossier-management-status-modal/dossier-management-status-modal.component.ts b/projects/valtimo/dossier-management/src/lib/components/dossier-management-statuses/dossier-management-status-modal/dossier-management-status-modal.component.ts index c275edfff..80c6e90bd 100644 --- a/projects/valtimo/dossier-management/src/lib/components/dossier-management-statuses/dossier-management-status-modal/dossier-management-status-modal.component.ts +++ b/projects/valtimo/dossier-management/src/lib/components/dossier-management-statuses/dossier-management-status-modal/dossier-management-status-modal.component.ts @@ -61,7 +61,7 @@ import {TranslateService} from '@ngx-translate/core'; }) export class DossierManagementStatusModalComponent implements OnInit, OnDestroy { @Input() public set type(value: StatusModalType) { - this._type.next(value); + this._type$.next(value); if (value === 'closed') { setTimeout(() => { @@ -81,12 +81,10 @@ export class DossierManagementStatusModalComponent implements OnInit, OnDestroy @Output() public closeModalEvent = new EventEmitter(); - private readonly _type = new BehaviorSubject(undefined); + private readonly _type$ = new BehaviorSubject(undefined); private readonly _typeAnimationDelay$ = new BehaviorSubject(undefined); private readonly _prefillStatus = new BehaviorSubject(undefined); - public readonly isClosed$ = this._type.pipe(map(type => type === 'closed')); - public readonly statusFormGroup = this.fb.group({ title: this.fb.control('', Validators.required), key: this.fb.control('', [ @@ -98,11 +96,14 @@ export class DossierManagementStatusModalComponent implements OnInit, OnDestroy color: this.fb.control('', Validators.required), }); + private _isEdit!: boolean; + public readonly isEdit$ = combineLatest([this._typeAnimationDelay$, this._prefillStatus]).pipe( tap(([type, prefillStatus]) => { if (type === 'edit' && prefillStatus) this.prefillForm(prefillStatus); }), - map(([type]) => type === 'edit') + map(([type]) => type === 'edit'), + tap(isEdit => (this._isEdit = isEdit)) ); public readonly isAdd$ = this._typeAnimationDelay$.pipe( @@ -112,6 +113,8 @@ export class DossierManagementStatusModalComponent implements OnInit, OnDestroy }) ); + public readonly isClosed$ = this._type$.pipe(map(type => type === 'closed')); + public readonly disabled$ = new BehaviorSubject(false); private readonly COLORS: InternalCaseStatusColor[] = [ @@ -347,7 +350,7 @@ export class DossierManagementStatusModalComponent implements OnInit, OnDestroy private uniqueKeyValidator(): ValidatorFn { return (control: AbstractControl): ValidationErrors | null => - this.usedKeys?.every((key: string) => key !== control.value) + this.usedKeys?.every((key: string) => key !== control.value) || this._isEdit ? null : {uniqueKey: {value: control.value}}; } From 0cccdcedcee9cb529a497e3f71cc05c0421d018b Mon Sep 17 00:00:00 2001 From: mbritense <79840403+mbritense@users.noreply.github.com> Date: Tue, 7 May 2024 17:02:29 +0200 Subject: [PATCH 03/13] fix tags for specified columns (#978) --- .../src/lib/components/carbon-list/carbon-list.component.html | 2 ++ .../src/lib/components/dossier-list/dossier-list.component.ts | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/projects/valtimo/components/src/lib/components/carbon-list/carbon-list.component.html b/projects/valtimo/components/src/lib/components/carbon-list/carbon-list.component.html index 6e49bf1ab..0913a2a8f 100644 --- a/projects/valtimo/components/src/lib/components/carbon-list/carbon-list.component.html +++ b/projects/valtimo/components/src/lib/components/carbon-list/carbon-list.component.html @@ -153,6 +153,8 @@ + - +
{{ data.tags[0].content }} diff --git a/projects/valtimo/dossier/src/lib/components/dossier-list/dossier-list.component.ts b/projects/valtimo/dossier/src/lib/components/dossier-list/dossier-list.component.ts index e1be4764c..e4c703d0c 100644 --- a/projects/valtimo/dossier/src/lib/components/dossier-list/dossier-list.component.ts +++ b/projects/valtimo/dossier/src/lib/components/dossier-list/dossier-list.component.ts @@ -45,7 +45,6 @@ import { Documents, DocumentService, InternalCaseStatus, - InternalCaseStatusColor, InternalCaseStatusUtils, SpecifiedDocuments, } from '@valtimo/document'; @@ -432,7 +431,8 @@ export class DossierListComponent implements OnInit, OnDestroy { return res.data.map(item => { const status = res.statuses.find( - (status: InternalCaseStatus) => status.key === item.internalStatus + (status: InternalCaseStatus) => + status.key === item.internalStatus || status.key === item.status ); if (!status) return item; From f9feb494757ce087dfd2e7cd1424d155230c59ba Mon Sep 17 00:00:00 2001 From: mbritense <79840403+mbritense@users.noreply.github.com> Date: Wed, 8 May 2024 11:41:18 +0200 Subject: [PATCH 04/13] remove tab (#981) --- projects/valtimo/zgw/src/lib/zgw.module.ts | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/projects/valtimo/zgw/src/lib/zgw.module.ts b/projects/valtimo/zgw/src/lib/zgw.module.ts index a7aaaa8c9..1e40e00c9 100644 --- a/projects/valtimo/zgw/src/lib/zgw.module.ts +++ b/projects/valtimo/zgw/src/lib/zgw.module.ts @@ -26,7 +26,6 @@ import { ZakenApiZaaktypeLinkComponent, } from './modules'; import { - CASE_MANAGEMENT_TAB_TOKEN, ZGW_CASE_CONFIGURATION_EXTENSIONS_TOKEN, ZGW_DOCUMENTEN_API_DOCUMENTS_COMPONENT_TOKEN, ZGW_OBJECT_TYPE_COMPONENT_TOKEN, @@ -38,7 +37,6 @@ import {RouterModule} from '@angular/router'; import {DropzoneModule, FileSizeModule} from '@valtimo/components'; import {DocumentModule} from '@valtimo/document'; import {ResourceModule} from '@valtimo/resource'; -import {DossierManagementZgwComponent} from './components'; @NgModule({ imports: [ @@ -56,14 +54,6 @@ import {DossierManagementZgwComponent} from './components'; declarations: [DocumentenApiUploaderComponent], exports: [DocumentenApiUploaderComponent], providers: [ - { - provide: CASE_MANAGEMENT_TAB_TOKEN, - useValue: { - translationKey: 'zgw.zgwTab', - component: DossierManagementZgwComponent, - }, - multi: true, - }, { provide: ZGW_OBJECT_TYPE_COMPONENT_TOKEN, useValue: DossierDetailTabObjectTypeComponent, From 6980b0cd0ef85b57711d2b5d441df0f49d6baec4 Mon Sep 17 00:00:00 2001 From: Klaas Schuijtemaker <94360980+Klaas-Ritense@users.noreply.github.com> Date: Wed, 8 May 2024 11:51:16 +0200 Subject: [PATCH 05/13] Add ids for playwright (#945) * Add ids for Playwright * Add ids for Playwright --- .../lib/components/right-sidebar/right-sidebar.component.html | 2 ++ .../dossier-management-detail-container-actions.component.html | 2 ++ .../dossier-management-status-modal.component.html | 1 + 3 files changed, 5 insertions(+) diff --git a/projects/valtimo/components/src/lib/components/right-sidebar/right-sidebar.component.html b/projects/valtimo/components/src/lib/components/right-sidebar/right-sidebar.component.html index 48dc72b65..fa97d44f8 100644 --- a/projects/valtimo/components/src/lib/components/right-sidebar/right-sidebar.component.html +++ b/projects/valtimo/components/src/lib/components/right-sidebar/right-sidebar.component.html @@ -149,7 +149,9 @@ diff --git a/projects/valtimo/dossier-management/src/lib/components/dossier-management-detail-container-actions/dossier-management-detail-container-actions.component.html b/projects/valtimo/dossier-management/src/lib/components/dossier-management-detail-container-actions/dossier-management-detail-container-actions.component.html index c31383583..62634fb3e 100644 --- a/projects/valtimo/dossier-management/src/lib/components/dossier-management-detail-container-actions/dossier-management-detail-container-actions.component.html +++ b/projects/valtimo/dossier-management/src/lib/components/dossier-management-detail-container-actions/dossier-management-detail-container-actions.component.html @@ -56,6 +56,7 @@ class="overflow-button" > {{ @@ -65,6 +66,7 @@ {{ 'Remove document definition' | translate }} {{ 'dossierManagement.statuses.columns.color' | translate }} Date: Wed, 8 May 2024 14:27:10 +0200 Subject: [PATCH 06/13] cherrypick (#983) --- .../components/form-io/form-io.component.ts | 22 +++--- .../services/form-io-local-storage.service.ts | 68 +++++++++++++++++++ 2 files changed, 77 insertions(+), 13 deletions(-) create mode 100644 projects/valtimo/components/src/lib/components/form-io/services/form-io-local-storage.service.ts diff --git a/projects/valtimo/components/src/lib/components/form-io/form-io.component.ts b/projects/valtimo/components/src/lib/components/form-io/form-io.component.ts index 358a4b8eb..3a70a121a 100644 --- a/projects/valtimo/components/src/lib/components/form-io/form-io.component.ts +++ b/projects/valtimo/components/src/lib/components/form-io/form-io.component.ts @@ -32,10 +32,9 @@ import { Formio, FormioComponent as FormIoSourceComponent, FormioOptions, + FormioRefreshValue, FormioSubmission, - FormioUtils, } from '@formio/angular'; -import {FormioRefreshValue} from '@formio/angular/formio.common'; import {jwtDecode} from 'jwt-decode'; import {NGXLogger} from 'ngx-logger'; import {BehaviorSubject, combineLatest, Observable, Subject, Subscription, timer} from 'rxjs'; @@ -43,6 +42,7 @@ import {distinctUntilChanged, map, switchMap, take, tap} from 'rxjs/operators'; import {FormIoStateService} from './services/form-io-state.service'; import {ActivatedRoute} from '@angular/router'; import {TranslateService} from '@ngx-translate/core'; +import {FormIoLocalStorageService} from './services/form-io-local-storage.service'; import {deepmerge} from 'deepmerge-ts'; import {ConfigService, ValtimoConfig} from '@valtimo/config'; @@ -50,6 +50,7 @@ import {ConfigService, ValtimoConfig} from '@valtimo/config'; selector: 'valtimo-form-io', templateUrl: './form-io.component.html', styleUrls: ['./form-io.component.css'], + providers: [FormIoLocalStorageService], }) export class FormioComponent implements OnInit, OnChanges, OnDestroy { @Input() set options(optionsValue: ValtimoFormioOptions) { @@ -73,7 +74,7 @@ export class FormioComponent implements OnInit, OnChanges, OnDestroy { @HostListener('window:beforeunload', ['$event']) private handleBeforeUnload() { - this.clearTokenFromLocalStorage(); + this.localStorageService.clearTokenFromLocalStorage(); } public refreshForm = new EventEmitter(); @@ -83,7 +84,6 @@ export class FormioComponent implements OnInit, OnChanges, OnDestroy { public readonly options$ = new BehaviorSubject(undefined); public readonly readOnly$ = new BehaviorSubject(false); public readonly errors$ = new BehaviorSubject>([]); - public readonly tokenSetInLocalStorage$ = new BehaviorSubject(false); public readonly currentLanguage$ = this.translateService.stream('key').pipe( map(() => this.translateService.currentLang), @@ -115,19 +115,20 @@ export class FormioComponent implements OnInit, OnChanges, OnDestroy { tap(options => this.logger.debug('Form.IO options used', options)) ); + public readonly tokenSetInLocalStorage$ = this.localStorageService.tokenSetInLocalStorage$; + private _tokenRefreshTimerSubscription!: Subscription; private _formRefreshSubscription!: Subscription; private readonly _subscriptions = new Subscription(); private readonly _tokenTimerSubscription = new Subscription(); - private readonly _FORMIO_TOKEN_LOCAL_STORAGE_KEY = 'formioToken'; - constructor( private readonly userProviderService: UserProviderService, private readonly logger: NGXLogger, private readonly stateService: FormIoStateService, private readonly route: ActivatedRoute, private readonly translateService: TranslateService, + private readonly localStorageService: FormIoLocalStorageService, private readonly modalService: ValtimoModalService, private readonly configService: ConfigService ) { @@ -157,7 +158,7 @@ export class FormioComponent implements OnInit, OnChanges, OnDestroy { this.unsubscribeFormRefresh(); this._tokenRefreshTimerSubscription?.unsubscribe(); this._subscriptions.unsubscribe(); - this.clearTokenFromLocalStorage(); + this.localStorageService.clearTokenFromLocalStorage(); } public showErrors(errors: string[]): void { @@ -218,9 +219,8 @@ export class FormioComponent implements OnInit, OnChanges, OnDestroy { private setToken(token: string): void { Formio.setUser(jwtDecode(token)); Formio.setToken(token); - localStorage.setItem(this._FORMIO_TOKEN_LOCAL_STORAGE_KEY, token); this.setTimerForTokenRefresh(token); - this.tokenSetInLocalStorage$.next(true); + this.localStorageService.setTokenInLocalStorage(token); this.logger.debug('New token set for form.io.'); } @@ -277,10 +277,6 @@ export class FormioComponent implements OnInit, OnChanges, OnDestroy { ); } - private clearTokenFromLocalStorage(): void { - localStorage.removeItem(this._FORMIO_TOKEN_LOCAL_STORAGE_KEY); - } - private setOverrideOptions(config: ValtimoConfig): void { if (!config.formioOptions) return; diff --git a/projects/valtimo/components/src/lib/components/form-io/services/form-io-local-storage.service.ts b/projects/valtimo/components/src/lib/components/form-io/services/form-io-local-storage.service.ts new file mode 100644 index 000000000..43a1afd85 --- /dev/null +++ b/projects/valtimo/components/src/lib/components/form-io/services/form-io-local-storage.service.ts @@ -0,0 +1,68 @@ +/* + * Copyright 2015-2024 Ritense BV, the Netherlands. + * + * Licensed under EUPL, Version 1.2 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {Injectable} from '@angular/core'; +import {BehaviorSubject, Observable} from 'rxjs'; + +@Injectable() +export class FormIoLocalStorageService { + private readonly _FORMIO_TOKEN_LOCAL_STORAGE_KEY = 'formioToken'; + private readonly _tokenSetInLocalStorage$ = new BehaviorSubject(false); + + public get tokenSetInLocalStorage$(): Observable { + return this._tokenSetInLocalStorage$.asObservable(); + } + + public setTokenInLocalStorage(token: string): void { + setTimeout(() => { + localStorage.setItem(this._FORMIO_TOKEN_LOCAL_STORAGE_KEY, token); + this.checkIfTokenExistsInLocalStorage(); + }); + } + + public clearTokenFromLocalStorage(): void { + localStorage.removeItem(this._FORMIO_TOKEN_LOCAL_STORAGE_KEY); + this.checkIfTokenIsRemovedFromLocalStorage(); + } + + private getTokenFromLocalStorage(): string | null { + return localStorage.getItem(this._FORMIO_TOKEN_LOCAL_STORAGE_KEY); + } + + private checkIfTokenExistsInLocalStorage(): void { + const maxChecks = 100; + let checks = 0; + + if (this.getTokenFromLocalStorage()) { + this._tokenSetInLocalStorage$.next(true); + } else if (checks <= maxChecks) { + checks++; + this.checkIfTokenExistsInLocalStorage(); + } + } + + private checkIfTokenIsRemovedFromLocalStorage(): void { + const maxChecks = 100; + let checks = 0; + + if (this.getTokenFromLocalStorage() && checks <= maxChecks) { + checks++; + this.checkIfTokenIsRemovedFromLocalStorage(); + } else { + this._tokenSetInLocalStorage$.next(false); + } + } +} From c33f5eaafc7ffd9ddbd6647a916ded6fe1480b03 Mon Sep 17 00:00:00 2001 From: mbritense <79840403+mbritense@users.noreply.github.com> Date: Tue, 14 May 2024 10:34:19 +0200 Subject: [PATCH 07/13] fix form management edit and case detail header (#989) --- .../dossier-detail.component.html | 35 +++++---- .../dossier-detail.component.scss | 18 +++-- .../form-management-edit.component.html | 75 +++++++++++-------- .../form-management-edit.component.scss | 19 +++++ .../form-management-edit.component.ts | 6 +- .../src/lib/form-management.module.ts | 23 +++--- 6 files changed, 110 insertions(+), 66 deletions(-) diff --git a/projects/valtimo/dossier/src/lib/components/dossier-detail/dossier-detail.component.html b/projects/valtimo/dossier/src/lib/components/dossier-detail/dossier-detail.component.html index 5b3b46c13..af6e663e7 100644 --- a/projects/valtimo/dossier/src/lib/components/dossier-detail/dossier-detail.component.html +++ b/projects/valtimo/dossier/src/lib/components/dossier-detail/dossier-detail.component.html @@ -146,21 +146,29 @@ canAssign: canAssign$ | async, canClaim: canClaim$ | async, canHaveAssignee: canHaveAssignee$ | async, - document: document$ | async + document: document$ | async, + caseStatus: caseStatus$ | async } as obs" > -
- +
+ @if (obs.caseStatus) { + {{ obs.caseStatus.title }} + } + +
+ +
+
-
- {{ caseStatus.title }} -
diff --git a/projects/valtimo/dossier/src/lib/components/dossier-detail/dossier-detail.component.scss b/projects/valtimo/dossier/src/lib/components/dossier-detail/dossier-detail.component.scss index ea86e913a..22d9cfd76 100644 --- a/projects/valtimo/dossier/src/lib/components/dossier-detail/dossier-detail.component.scss +++ b/projects/valtimo/dossier/src/lib/components/dossier-detail/dossier-detail.component.scss @@ -65,9 +65,11 @@ width: 100%; justify-content: space-between; align-items: flex-end; + padding-bottom: 4px; &.--compact { - align-items: center; + padding-bottom: 0; + align-items: flex-start; } ::ng-deep .version-selection { @@ -79,11 +81,17 @@ } } -.dossier-assign-user { - padding-bottom: 4px; - margin-left: -16px; +.dossier-status-assign { + display: flex; + gap: 16px; + align-items: flex-end; + + .cds--tag { + margin: 0; + height: var(--cds-layout-size-height-md); + } &.--compact { - margin-left: 0; + align-items: center; } } diff --git a/projects/valtimo/form-management/src/lib/form-management-edit/form-management-edit.component.html b/projects/valtimo/form-management/src/lib/form-management-edit/form-management-edit.component.html index 9a19ac8c4..771e358b8 100644 --- a/projects/valtimo/form-management/src/lib/form-management-edit/form-management-edit.component.html +++ b/projects/valtimo/form-management/src/lib/form-management-edit/form-management-edit.component.html @@ -24,44 +24,53 @@ @if (obs.formDefinition) { -
- - - {{ 'Download' | translate }} - +
+ @if (obs.formDefinition.readOnly) { + {{ 'formManagement.readOnly' | translate }} + } - - {{ 'Upload' | translate }} - +
+ + + {{ 'Download' | translate }} + - - {{ 'interface.delete' | translate }} - + + {{ 'Upload' | translate }} + - - {{ 'formManagement.duplicate' | translate }} - - + + {{ 'interface.delete' | translate }} + - + + +
diff --git a/projects/valtimo/form-management/src/lib/form-management-edit/form-management-edit.component.scss b/projects/valtimo/form-management/src/lib/form-management-edit/form-management-edit.component.scss index 787d46752..80faa63e6 100644 --- a/projects/valtimo/form-management/src/lib/form-management-edit/form-management-edit.component.scss +++ b/projects/valtimo/form-management/src/lib/form-management-edit/form-management-edit.component.scss @@ -20,6 +20,25 @@ align-items: center; justify-content: flex-end; gap: 16px; + margin-left: auto; + } + + &__header-container { + width: 100%; + display: flex; + justify-content: space-between; + align-items: flex-end; + padding-bottom: 4px; + + .cds--tag { + margin: 0; + height: var(--cds-layout-size-height-md); + } + + &.--compact { + align-items: flex-start; + padding-bottom: 0; + } } &__output .cds--tab-content { diff --git a/projects/valtimo/form-management/src/lib/form-management-edit/form-management-edit.component.ts b/projects/valtimo/form-management/src/lib/form-management-edit/form-management-edit.component.ts index c0225ebf8..fc7650ce2 100644 --- a/projects/valtimo/form-management/src/lib/form-management-edit/form-management-edit.component.ts +++ b/projects/valtimo/form-management/src/lib/form-management-edit/form-management-edit.component.ts @@ -29,7 +29,6 @@ import { BehaviorSubject, distinctUntilChanged, filter, - first, Subscription, switchMap, take, @@ -60,6 +59,9 @@ export class FormManagementEditComponent public activeTab = EDIT_TABS.BUILDER; private readonly _formDefinition$ = new BehaviorSubject(null); + private get _formDefinition(): FormDefinition { + return this._formDefinition$.getValue(); + } public readonly formDefinition$ = this._formDefinition$.pipe( filter((definition: FormDefinition | null) => !!definition), distinctUntilChanged( @@ -117,7 +119,7 @@ export class FormManagementEditComponent } this._changeActive = true; this.modifiedFormDefinition = event.form; - this._formDefinition$.next(event.form); + this._formDefinition$.next({...this._formDefinition, formDefinition: event.form}); this.jsonFormDefinition$.next({...definition, value: JSON.stringify(event.form)}); this._changeActive = false; } diff --git a/projects/valtimo/form-management/src/lib/form-management.module.ts b/projects/valtimo/form-management/src/lib/form-management.module.ts index 42a9ba365..be566d224 100644 --- a/projects/valtimo/form-management/src/lib/form-management.module.ts +++ b/projects/valtimo/form-management/src/lib/form-management.module.ts @@ -18,23 +18,22 @@ import {NgModule} from '@angular/core'; import {FormManagementComponent} from './form-management.component'; import {FormManagementRoutingModule} from './form-management-routing.module'; import { + ButtonModule, + CarbonListModule, + ConfirmationModalModule, DropzoneModule, + EditorModule, FormIoModule, - ListModule, - ModalModule as vcModalModule, - ValtimoCdsModalDirectiveModule, - WidgetModule, - ButtonModule, FormModule, InputModule as vInputModule, - VModalModule, - TitleModule, - CarbonListModule, - PageTitleModule, + ListModule, + ModalModule as vcModalModule, RenderInPageHeaderDirectiveModule, - EditorModule, SpinnerModule, - ConfirmationModalModule, + TitleModule, + ValtimoCdsModalDirectiveModule, + VModalModule, + WidgetModule, } from '@valtimo/components'; import {CommonModule} from '@angular/common'; import {FormsModule, ReactiveFormsModule} from '@angular/forms'; @@ -52,6 +51,7 @@ import { ModalModule, PlaceholderModule, TabsModule, + TagModule, } from 'carbon-components-angular'; @NgModule({ @@ -94,6 +94,7 @@ import { SpinnerModule, IconModule, ConfirmationModalModule, + TagModule, ], exports: [FormManagementComponent], }) From 106904fd3a6f03d6e835728098fce7b659f561b3 Mon Sep 17 00:00:00 2001 From: mbritense <79840403+mbritense@users.noreply.github.com> Date: Tue, 14 May 2024 14:35:19 +0200 Subject: [PATCH 08/13] fix after saving in monaco editor (#990) --- .../form-management-edit/form-management-edit.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/projects/valtimo/form-management/src/lib/form-management-edit/form-management-edit.component.ts b/projects/valtimo/form-management/src/lib/form-management-edit/form-management-edit.component.ts index fc7650ce2..771f42014 100644 --- a/projects/valtimo/form-management/src/lib/form-management-edit/form-management-edit.component.ts +++ b/projects/valtimo/form-management/src/lib/form-management-edit/form-management-edit.component.ts @@ -203,9 +203,13 @@ export class FormManagementEditComponent return; } + const parsedDefinition = JSON.parse(value); + + this.modifiedFormDefinition = parsedDefinition; + this._formDefinition$.next({ ...definition, - formDefinition: JSON.parse(value), + formDefinition: parsedDefinition, }); } From c929216ce172dad562e883c8f26d38237b864ee5 Mon Sep 17 00:00:00 2001 From: mbritense <79840403+mbritense@users.noreply.github.com> Date: Wed, 15 May 2024 13:51:11 +0200 Subject: [PATCH 09/13] fix support tags (#993) Co-authored-by: teodor-ritense --- .../carbon-list/carbon-list.component.html | 28 +++++++++++-------- .../carbon-list/carbon-list.component.ts | 2 +- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/projects/valtimo/components/src/lib/components/carbon-list/carbon-list.component.html b/projects/valtimo/components/src/lib/components/carbon-list/carbon-list.component.html index 0913a2a8f..bd616d952 100644 --- a/projects/valtimo/components/src/lib/components/carbon-list/carbon-list.component.html +++ b/projects/valtimo/components/src/lib/components/carbon-list/carbon-list.component.html @@ -156,18 +156,22 @@ -
- - {{ data.tags[0].content }} - - - - {{ data.tags.length - 1 }} - + @if (data.tags.length === 0) { + - + } @else { + + {{ data.tags[0].content }} + + + + {{ data.tags.length - 1 }} + + }
diff --git a/projects/valtimo/components/src/lib/components/carbon-list/carbon-list.component.ts b/projects/valtimo/components/src/lib/components/carbon-list/carbon-list.component.ts index 299cdc735..a4b59f8b2 100644 --- a/projects/valtimo/components/src/lib/components/carbon-list/carbon-list.component.ts +++ b/projects/valtimo/components/src/lib/components/carbon-list/carbon-list.component.ts @@ -395,7 +395,7 @@ export class CarbonListComponent implements OnInit, AfterViewInit, OnDestroy { }); case ViewType.TAGS: return new TableItem({ - data: {tags: item.tags}, + data: {tags: item?.tags ?? []}, template: this.tagTemplate, }); default: From c5f5a027db58e6dca29ede2177fa92034ebd202b Mon Sep 17 00:00:00 2001 From: Thomas Minke Date: Wed, 15 May 2024 14:52:20 +0200 Subject: [PATCH 10/13] Updated equalize-deps.cjs link/branch name. --- scripts/equalize-deps.cjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/equalize-deps.cjs b/scripts/equalize-deps.cjs index 161b39e0f..302be5643 100644 --- a/scripts/equalize-deps.cjs +++ b/scripts/equalize-deps.cjs @@ -89,7 +89,7 @@ const cleanUp = () => { const fetchDeps = () => http.get( // update link to raw Github content of latest major package.json - 'https://raw.githubusercontent.com/valtimo-platform/valtimo-frontend-libraries/development/12.0.0/package.json', + 'https://raw.githubusercontent.com/valtimo-platform/valtimo-frontend-libraries/rc/12.0.0/package.json', function (response) { response.pipe(file); From 270caa0fcecd41cc7e056548b7f1f145b320fb66 Mon Sep 17 00:00:00 2001 From: mbritense <79840403+mbritense@users.noreply.github.com> Date: Thu, 16 May 2024 09:25:13 +0200 Subject: [PATCH 11/13] fix: status edit bug (#985) * real fix * refactor --- ...ssier-management-status-modal.component.ts | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/projects/valtimo/dossier-management/src/lib/components/dossier-management-statuses/dossier-management-status-modal/dossier-management-status-modal.component.ts b/projects/valtimo/dossier-management/src/lib/components/dossier-management-statuses/dossier-management-status-modal/dossier-management-status-modal.component.ts index 80c6e90bd..9166a3f2f 100644 --- a/projects/valtimo/dossier-management/src/lib/components/dossier-management-statuses/dossier-management-status-modal/dossier-management-status-modal.component.ts +++ b/projects/valtimo/dossier-management/src/lib/components/dossier-management-statuses/dossier-management-status-modal/dossier-management-status-modal.component.ts @@ -37,9 +37,9 @@ import { import {CARBON_CONSTANTS} from '@valtimo/components'; import { AbstractControl, + AsyncValidatorFn, FormBuilder, ValidationErrors, - ValidatorFn, Validators, } from '@angular/forms'; import { @@ -90,20 +90,17 @@ export class DossierManagementStatusModalComponent implements OnInit, OnDestroy key: this.fb.control('', [ Validators.required, Validators.minLength(3), - this.uniqueKeyValidator(), + this.uniqueKeyValidator, ]), visibleInCaseListByDefault: this.fb.control(true, Validators.required), color: this.fb.control('', Validators.required), }); - private _isEdit!: boolean; - public readonly isEdit$ = combineLatest([this._typeAnimationDelay$, this._prefillStatus]).pipe( tap(([type, prefillStatus]) => { if (type === 'edit' && prefillStatus) this.prefillForm(prefillStatus); }), - map(([type]) => type === 'edit'), - tap(isEdit => (this._isEdit = isEdit)) + map(([type]) => type === 'edit') ); public readonly isAdd$ = this._typeAnimationDelay$.pipe( @@ -348,11 +345,15 @@ export class DossierManagementStatusModalComponent implements OnInit, OnDestroy this.statusFormGroup.patchValue({key: ''}); } - private uniqueKeyValidator(): ValidatorFn { - return (control: AbstractControl): ValidationErrors | null => - this.usedKeys?.every((key: string) => key !== control.value) || this._isEdit - ? null - : {uniqueKey: {value: control.value}}; + private uniqueKeyValidator(): AsyncValidatorFn { + return (control: AbstractControl): Observable => + combineLatest([this.isEdit$, control.valueChanges]).pipe( + map(([isEdit, keyValue]) => + this.usedKeys?.every((key: string) => key !== keyValue) || isEdit + ? null + : {uniqueKey: {value: control.value}} + ) + ); } private disable(): void { From 3bfe594576226cf1a53f01669665154f5a832f26 Mon Sep 17 00:00:00 2001 From: mbritense <79840403+mbritense@users.noreply.github.com> Date: Thu, 16 May 2024 11:08:31 +0200 Subject: [PATCH 12/13] Fixed object type title didn't load on page switch (#950) (#997) Co-authored-by: Sofia <131170700+sofiaIvarsRitense@users.noreply.github.com> --- .../src/lib/components/object-list/object-list.component.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/projects/valtimo/object/src/lib/components/object-list/object-list.component.ts b/projects/valtimo/object/src/lib/components/object-list/object-list.component.ts index 3135db804..79b1aa161 100644 --- a/projects/valtimo/object/src/lib/components/object-list/object-list.component.ts +++ b/projects/valtimo/object/src/lib/components/object-list/object-list.component.ts @@ -54,8 +54,7 @@ export class ObjectListComponent { readonly objectManagementId$: Observable = this.route.params.pipe( map(params => params.objectManagementId), tap(objectManagementId => { - if (!this._settingPageTitle && objectManagementId) { - this._settingPageTitle = true; + if (objectManagementId) { this.objectManagementService.getObjectById(objectManagementId).subscribe(objectType => { if (objectType.title) { this.pageTitleService.setCustomPageTitle(objectType.title); @@ -234,8 +233,6 @@ export class ObjectListComponent { }) ); - private _settingPageTitle = false; - constructor( private readonly objectService: ObjectService, private readonly objectColumnService: ObjectColumnService, From ca25cc347f799a5e066426e6fabdac926698abc5 Mon Sep 17 00:00:00 2001 From: mbritense <79840403+mbritense@users.noreply.github.com> Date: Thu, 16 May 2024 14:23:05 +0200 Subject: [PATCH 13/13] fix custom title case detail header (#998) --- .../dossier-detail/dossier-detail.component.html | 15 ++++++++------- .../dossier-detail/dossier-detail.component.scss | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/projects/valtimo/dossier/src/lib/components/dossier-detail/dossier-detail.component.html b/projects/valtimo/dossier/src/lib/components/dossier-detail/dossier-detail.component.html index af6e663e7..1dc4e6f0b 100644 --- a/projects/valtimo/dossier/src/lib/components/dossier-detail/dossier-detail.component.html +++ b/projects/valtimo/dossier/src/lib/components/dossier-detail/dossier-detail.component.html @@ -61,7 +61,7 @@ let-document="document" let-canAssign="canAssign" > -
+
@@ -91,10 +91,6 @@ > - -
{{ documentDefinitionNameTitle?.trim() }}
-
- -
+
@if (obs.caseStatus) { {{ obs.caseStatus.title }} } @@ -167,6 +166,8 @@ " >
+ +
diff --git a/projects/valtimo/dossier/src/lib/components/dossier-detail/dossier-detail.component.scss b/projects/valtimo/dossier/src/lib/components/dossier-detail/dossier-detail.component.scss index 22d9cfd76..2a90375f0 100644 --- a/projects/valtimo/dossier/src/lib/components/dossier-detail/dossier-detail.component.scss +++ b/projects/valtimo/dossier/src/lib/components/dossier-detail/dossier-detail.component.scss @@ -81,7 +81,7 @@ } } -.dossier-status-assign { +.dossier-status-assign-custom-title { display: flex; gap: 16px; align-items: flex-end;