From 0fba41ee060220704dc5261ea9b2d4a0198f1d47 Mon Sep 17 00:00:00 2001
From: mbritense <79840403+mbritense@users.noreply.github.com>
Date: Thu, 16 May 2024 10:27:13 +0200
Subject: [PATCH] fix select informatieobjecttype (#996)
---
...cumenten-api-metadata-modal.component.html | 4 ++--
...documenten-api-metadata-modal.component.ts | 19 +++++++++++--------
2 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/projects/valtimo/zgw/src/lib/modules/documenten-api/components/documenten-api-metadata-modal/documenten-api-metadata-modal.component.html b/projects/valtimo/zgw/src/lib/modules/documenten-api/components/documenten-api-metadata-modal/documenten-api-metadata-modal.component.html
index 8cba5848b..95f0e7735 100644
--- a/projects/valtimo/zgw/src/lib/modules/documenten-api/components/documenten-api-metadata-modal/documenten-api-metadata-modal.component.html
+++ b/projects/valtimo/zgw/src/lib/modules/documenten-api/components/documenten-api-metadata-modal/documenten-api-metadata-modal.component.html
@@ -161,7 +161,7 @@
id="informatieobjecttype"
(selected)="informatieobjecttypeSelected($event)"
>
-
+
@@ -206,7 +206,7 @@
(selected)="tagsSelected($event)"
>
>
-
+
diff --git a/projects/valtimo/zgw/src/lib/modules/documenten-api/components/documenten-api-metadata-modal/documenten-api-metadata-modal.component.ts b/projects/valtimo/zgw/src/lib/modules/documenten-api/components/documenten-api-metadata-modal/documenten-api-metadata-modal.component.ts
index 5758e656b..48a7df826 100644
--- a/projects/valtimo/zgw/src/lib/modules/documenten-api/components/documenten-api-metadata-modal/documenten-api-metadata-modal.component.ts
+++ b/projects/valtimo/zgw/src/lib/modules/documenten-api/components/documenten-api-metadata-modal/documenten-api-metadata-modal.component.ts
@@ -295,18 +295,21 @@ export class DocumentenApiMetadataModalComponent implements OnInit, OnChanges, O
documentDefinitionName
)
),
- switchMap(([params, firstChildParams, documentDefinitionName]) =>
- this.documentService.getDocumentTypes(
- params?.documentDefinitionName ||
- firstChildParams?.documentDefinitionName ||
- documentDefinitionName
- )
+ switchMap(([params, firstChildParams, documentDefinitionName, informatieobjecttypeValue]) =>
+ combineLatest([
+ this.documentService.getDocumentTypes(
+ params?.documentDefinitionName ||
+ firstChildParams?.documentDefinitionName ||
+ documentDefinitionName
+ ),
+ of(informatieobjecttypeValue),
+ ])
),
- map(documentTypes =>
+ map(([documentTypes, informatieobjecttypeValue]) =>
documentTypes.map((type: any) => ({
id: type.url,
content: type.name,
- selected: this.informatieobjecttypeFormControl.value?.toString() === type.name,
+ selected: informatieobjecttypeValue === type.url,
}))
)
);