@valtimo/case-migration 13.44.0 → 13.45.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,8 +8,9 @@ import { RouterModule } from '@angular/router';
8
8
  import * as i6 from '@angular/common';
9
9
  import { CommonModule } from '@angular/common';
10
10
  import { AuthGuardService } from '@valtimo/security';
11
- import { BehaviorSubject, map, shareReplay, startWith, combineLatest, take, switchMap } from 'rxjs';
11
+ import { BehaviorSubject, Subscription, shareReplay, map, startWith, combineLatest, take, switchMap, expand, EMPTY, reduce } from 'rxjs';
12
12
  import { WatsonHealthStackedMove16 } from '@carbon/icons';
13
+ import { valid, gt } from 'semver';
13
14
  import * as i1$1 from '@valtimo/document';
14
15
  import * as i3 from 'carbon-components-angular';
15
16
  import { DropdownModule, InputModule, ButtonModule, IconModule, NotificationModule } from 'carbon-components-angular';
@@ -118,6 +119,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
118
119
  * See the License for the specific language governing permissions and
119
120
  * limitations under the License.
120
121
  */
122
+ // Spring caps the `size` request param at 2000, so larger pages have to be fetched one by one.
123
+ const MAX_PAGE_SIZE = 2000;
121
124
  class CaseMigrationComponent {
122
125
  constructor(documentService, caseMigrationService, iconService, globalNotificationService, translateService) {
123
126
  this.documentService = documentService;
@@ -132,17 +135,10 @@ class CaseMigrationComponent {
132
135
  this.patchItems$ = new BehaviorSubject([]);
133
136
  this.errors$ = new BehaviorSubject(null);
134
137
  this.showConfirmationModal$ = new BehaviorSubject(false);
135
- this.caseDefinitions$ = this.documentService
136
- .getCaseDefinitionsManagement({ sort: 'name,id.versionTag', size: 100000 })
137
- .pipe(map(caseDefinitionsPage => caseDefinitionsPage.content), shareReplay(1));
138
- this.sourceCaseDefinitionKeyItems$ = this.caseDefinitions$.pipe(map(caseDefinitions => [
139
- ...new Map(caseDefinitions.map(item => [item.caseDefinitionKey, item])).values(),
140
- ]), map(caseDefinitions => caseDefinitions.map(caseDefinition => ({
141
- caseDefinitionKey: caseDefinition.caseDefinitionKey,
142
- content: caseDefinition.name,
143
- selected: false,
144
- }))), map(items => ({
145
- value: items,
138
+ this._subscriptions = new Subscription();
139
+ this.caseDefinitions$ = this.getAllCaseDefinitions().pipe(shareReplay(1));
140
+ this.sourceCaseDefinitionKeyItems$ = this.caseDefinitions$.pipe(map(caseDefinitions => ({
141
+ value: this.toCaseDefinitionKeyItems(caseDefinitions),
146
142
  isLoading: false,
147
143
  })), startWith({ isLoading: true }));
148
144
  this.sourceCaseDefinitionVersionTagItems$ = combineLatest([this.sourceCaseDefinitionKeySelected$, this.caseDefinitions$]).pipe(map(([sourceCaseDefinitionKeySelected, caseDefinitions]) => caseDefinitions.filter(caseDefinition => caseDefinition.caseDefinitionKey === sourceCaseDefinitionKeySelected)), map(caseDefinitions => caseDefinitions.map(caseDefinition => caseDefinition.caseDefinitionVersionTag)), map(versions => versions.map(version => ({
@@ -150,20 +146,21 @@ class CaseMigrationComponent {
150
146
  content: version.toString(),
151
147
  selected: false,
152
148
  }))));
153
- this.targetCaseDefinitionKeyItems$ = this.caseDefinitions$.pipe(map(caseDefinitions => [
154
- ...new Map(caseDefinitions.map(item => [item.caseDefinitionKey, item])).values(),
155
- ]), map(caseDefinitions => caseDefinitions.map(caseDefinition => ({
156
- caseDefinitionKey: caseDefinition.caseDefinitionKey,
157
- content: caseDefinition.name,
158
- selected: false,
159
- }))), map(items => ({
160
- value: items,
149
+ this.targetCaseDefinitionKeyItems$ = combineLatest([this.caseDefinitions$, this.targetCaseDefinitionKeySelected$]).pipe(map(([caseDefinitions, targetCaseDefinitionKeySelected]) => ({
150
+ value: this.toCaseDefinitionKeyItems(caseDefinitions, targetCaseDefinitionKeySelected),
161
151
  isLoading: false,
162
152
  })), startWith({ isLoading: true }));
163
- this.targetCaseDefinitionVersionTagItems$ = combineLatest([this.targetCaseDefinitionKeySelected$, this.caseDefinitions$]).pipe(map(([targetCaseDefinitionKeySelected, caseDefinitions]) => caseDefinitions.filter(caseDefinition => caseDefinition.caseDefinitionKey === targetCaseDefinitionKeySelected)), map(caseDefinitions => caseDefinitions.map(caseDefinition => caseDefinition.caseDefinitionVersionTag)), map(versions => versions.map(version => ({
164
- caseDefinitionVersionTag: version,
165
- content: version.toString(),
166
- selected: false,
153
+ this.targetCaseDefinitionVersionTagItems$ = combineLatest([
154
+ this.targetCaseDefinitionKeySelected$,
155
+ this.targetCaseDefinitionVersionTagSelected$,
156
+ this.caseDefinitions$,
157
+ ]).pipe(map(([targetCaseDefinitionKeySelected, targetCaseDefinitionVersionTagSelected, caseDefinitions,]) => caseDefinitions
158
+ .filter(caseDefinition => caseDefinition.caseDefinitionKey === targetCaseDefinitionKeySelected)
159
+ .map(caseDefinition => ({
160
+ caseDefinitionVersionTag: caseDefinition.caseDefinitionVersionTag,
161
+ content: caseDefinition.caseDefinitionVersionTag.toString(),
162
+ selected: caseDefinition.caseDefinitionVersionTag ===
163
+ targetCaseDefinitionVersionTagSelected,
167
164
  }))));
168
165
  this.patches$ = this.patchItems$.pipe(map(patchItems => patchItems.map(patchItem => ({
169
166
  source: patchItem.key,
@@ -172,6 +169,15 @@ class CaseMigrationComponent {
172
169
  this.CARBON_THEME = 'g10';
173
170
  this.iconService.registerAll([WatsonHealthStackedMove16]);
174
171
  }
172
+ ngOnInit() {
173
+ // The target is prefilled to the latest version, this screen's usual case; only the user knows the source.
174
+ this._subscriptions.add(this.sourceCaseDefinitionKeySelected$.subscribe(sourceCaseDefinitionKeySelected => this.targetCaseDefinitionKeySelected$.next(sourceCaseDefinitionKeySelected)));
175
+ // Keyed off the target so a different target case replaces the tag, which it need not otherwise have.
176
+ this._subscriptions.add(combineLatest([this.targetCaseDefinitionKeySelected$, this.caseDefinitions$]).subscribe(([targetCaseDefinitionKeySelected, caseDefinitions]) => this.targetCaseDefinitionVersionTagSelected$.next(this.latestVersionTagOf(caseDefinitions, targetCaseDefinitionKeySelected))));
177
+ }
178
+ ngOnDestroy() {
179
+ this._subscriptions.unsubscribe();
180
+ }
175
181
  mappingValueChange(patches) {
176
182
  this.patchItems$.next(patches);
177
183
  }
@@ -234,6 +240,46 @@ class CaseMigrationComponent {
234
240
  error: error => this.errors$.next([error.message]),
235
241
  });
236
242
  }
243
+ /**
244
+ * Compares tags rather than list position, so the latest version is found regardless of the order
245
+ * the backend returns the versions of a key in.
246
+ */
247
+ latestVersionTagOf(caseDefinitions, caseDefinitionKey) {
248
+ return caseDefinitions
249
+ .filter(caseDefinition => caseDefinition.caseDefinitionKey === caseDefinitionKey)
250
+ .map(caseDefinition => caseDefinition.caseDefinitionVersionTag)
251
+ .reduce((latest, current) => {
252
+ if (latest === null)
253
+ return current;
254
+ if (!valid(current))
255
+ return latest;
256
+ return !valid(latest) || gt(current, latest) ? current : latest;
257
+ }, null);
258
+ }
259
+ getAllCaseDefinitions() {
260
+ return this.getCaseDefinitionPage(0).pipe(expand(page => page.content.length === 0 || (page.number + 1) * page.size >= page.totalElements
261
+ ? EMPTY
262
+ : this.getCaseDefinitionPage(page.number + 1)), reduce((caseDefinitions, page) => [...caseDefinitions, ...page.content], []));
263
+ }
264
+ getCaseDefinitionPage(page) {
265
+ return this.documentService.getCaseDefinitionsManagement({
266
+ sort: 'id.key,id.versionTag',
267
+ allVersions: true,
268
+ page,
269
+ size: MAX_PAGE_SIZE,
270
+ });
271
+ }
272
+ // Ordered on name because that is what the dropdown shows; the fetch itself is ordered on key
273
+ // so that the versions of a case stay grouped and in version order.
274
+ toCaseDefinitionKeyItems(caseDefinitions, selectedCaseDefinitionKey = null) {
275
+ return [...new Map(caseDefinitions.map(item => [item.caseDefinitionKey, item])).values()]
276
+ .map(caseDefinition => ({
277
+ caseDefinitionKey: caseDefinition.caseDefinitionKey,
278
+ content: caseDefinition.name,
279
+ selected: caseDefinition.caseDefinitionKey === selectedCaseDefinitionKey,
280
+ }))
281
+ .sort((left, right) => left.content.localeCompare(right.content));
282
+ }
237
283
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: CaseMigrationComponent, deps: [{ token: i1$1.DocumentService }, { token: CaseMigrationService }, { token: i3.IconService }, { token: i2.GlobalNotificationService }, { token: i5.TranslateService }], target: i0.ɵɵFactoryTarget.Component }); }
238
284
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.25", type: CaseMigrationComponent, isStandalone: false, selector: "valtimo-case-migration", ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container\n class=\"case-count-configuration-form\"\n *ngIf=\"{\n sourceCaseDefinitionKeyItems: sourceCaseDefinitionKeyItems$ | async,\n sourceCaseDefinitionVersionTagItems: sourceCaseDefinitionVersionTagItems$ | async,\n targetCaseDefinitionKeyItems: targetCaseDefinitionKeyItems$ | async,\n targetCaseDefinitionVersionTagItems: targetCaseDefinitionVersionTagItems$ | async,\n sourceCaseDefinitionKeySelected: sourceCaseDefinitionKeySelected$ | async,\n sourceCaseDefinitionVersionTagSelected: sourceCaseDefinitionVersionTagSelected$ | async,\n targetCaseDefinitionKeySelected: targetCaseDefinitionKeySelected$ | async,\n targetCaseDefinitionVersionTagSelected: targetCaseDefinitionVersionTagSelected$ | async,\n patchItems: patchItems$ | async,\n errors: errors$ | async,\n showConfirmationModal: showConfirmationModal$,\n } as obs\"\n>\n <ng-container>\n <div class=\"pb-2\">\n <cds-notification\n [notificationObj]=\"{\n type: 'warning',\n title: 'caseMigration.warningBeta' | translate,\n showClose: false,\n }\"\n >\n </cds-notification>\n </div>\n </ng-container>\n\n <ng-container>\n <div class=\"input-group mt-4 mb-2 align-items-center\">\n <div>\n <h2>{{ 'caseMigration.caseDefinition' | translate }}</h2>\n </div>\n </div>\n\n <div class=\"row m-0\">\n <cds-dropdown\n class=\"pr-2 pb-2\"\n [label]=\"'caseMigration.sourceCaseDefinitionKey' | translate\"\n [style.width.px]=\"350\"\n [disabled]=\"obs.sourceCaseDefinitionKeyItems.isLoading\"\n [dropUp]=\"false\"\n [skeleton]=\"obs.sourceCaseDefinitionKeyItems.isLoading\"\n (selected)=\"sourceCaseDefinitionKeySelected$.next($event.item.caseDefinitionKey)\"\n >\n <cds-dropdown-list\n [items]=\"obs.sourceCaseDefinitionKeyItems.value || []\"\n ></cds-dropdown-list>\n </cds-dropdown>\n <cds-dropdown\n class=\"pr-2 pb-2\"\n [label]=\"'caseMigration.sourceCaseDefinitionVersionTag' | translate\"\n [style.width.px]=\"300\"\n [disabled]=\"obs.targetCaseDefinitionKeyItems.isLoading\"\n [dropUp]=\"false\"\n [skeleton]=\"obs.targetCaseDefinitionKeyItems.isLoading\"\n (selected)=\"\n sourceCaseDefinitionVersionTagSelected$.next($event.item.caseDefinitionVersionTag)\n \"\n >\n <cds-dropdown-list\n [items]=\"obs.sourceCaseDefinitionVersionTagItems || []\"\n ></cds-dropdown-list>\n </cds-dropdown>\n </div>\n </ng-container>\n\n <ng-container>\n <div class=\"row m-0\">\n <cds-dropdown\n class=\"pr-2 pb-2\"\n [label]=\"'caseMigration.targetCaseDefinitionKey' | translate\"\n [style.width.px]=\"350\"\n [disabled]=\"obs.targetCaseDefinitionKeyItems.isLoading\"\n [dropUp]=\"false\"\n [skeleton]=\"obs.targetCaseDefinitionKeyItems.isLoading\"\n (selected)=\"targetCaseDefinitionKeySelected$.next($event.item.caseDefinitionKey)\"\n >\n <cds-dropdown-list\n [items]=\"obs.targetCaseDefinitionKeyItems.value || []\"\n ></cds-dropdown-list>\n </cds-dropdown>\n <cds-dropdown\n class=\"pr-2 pb-2\"\n [label]=\"'caseMigration.targetCaseDefinitionVersionTag' | translate\"\n [style.width.px]=\"300\"\n [disabled]=\"obs.targetCaseDefinitionKeyItems.isLoading\"\n [dropUp]=\"false\"\n [skeleton]=\"obs.targetCaseDefinitionKeyItems.isLoading\"\n (selected)=\"\n targetCaseDefinitionVersionTagSelected$.next($event.item.caseDefinitionVersionTag)\n \"\n >\n <cds-dropdown-list\n [items]=\"obs.targetCaseDefinitionVersionTagItems || []\"\n ></cds-dropdown-list>\n </cds-dropdown>\n </div>\n </ng-container>\n\n <ng-container>\n <div class=\"pt-2 pb-2\">\n <div class=\"input-group mt-4 mb-2 align-items-center\">\n <div>\n <h2>{{ 'caseMigration.patches' | translate }}</h2>\n </div>\n </div>\n <valtimo-carbon-multi-input\n type=\"keyValue\"\n (valueChange)=\"mappingValueChange($event)\"\n [title]=\"' '\"\n [tooltip]=\"'caseMigration.patchTooltip' | translate\"\n [defaultValues]=\"[]\"\n [keyColumnTitle]=\"'caseMigration.patchSource' | translate\"\n [valueColumnTitle]=\"'caseMigration.patchTarget' | translate\"\n [fullWidth]=\"true\"\n ></valtimo-carbon-multi-input>\n </div>\n </ng-container>\n\n <ng-container>\n <div class=\"pt-2\">\n <div *ngIf=\"obs.errors?.length === 0\" class=\"input-group mt-4 mb-2 align-items-center\">\n <div>\n {{ 'caseMigration.noErrors' | translate }}\n </div>\n </div>\n <div *ngIf=\"obs.errors?.length >= 1\" class=\"input-group mt-4 mb-2 align-items-center\">\n <div>\n <h2>{{ 'caseMigration.errors' | translate }}</h2>\n </div>\n </div>\n\n <div class=\"pb-2\" *ngFor=\"let error of obs.errors\">\n <cds-notification\n [notificationObj]=\"{\n type: 'error',\n title: error,\n showClose: false,\n }\"\n >\n </cds-notification>\n </div>\n </div>\n </ng-container>\n\n <ng-container>\n <button\n class=\"mt-2 mb-2 mr-2\"\n cdsButton=\"secondary\"\n size=\"md\"\n (click)=\"checkPatches()\"\n [disabled]=\"\n !obs.sourceCaseDefinitionKeySelected ||\n !obs.sourceCaseDefinitionVersionTagSelected ||\n !obs.targetCaseDefinitionKeySelected ||\n !obs.targetCaseDefinitionVersionTagSelected\n \"\n >\n {{ 'caseMigration.checkPatches' | translate }}\n </button>\n <button\n class=\"mt-2 mb-2 ml-2\"\n cdsButton=\"primary\"\n size=\"md\"\n (click)=\"showConfirmationModal$.next(true)\"\n [disabled]=\"\n !obs.sourceCaseDefinitionKeySelected ||\n !obs.sourceCaseDefinitionVersionTagSelected ||\n !obs.targetCaseDefinitionKeySelected ||\n !obs.targetCaseDefinitionVersionTagSelected\n \"\n >\n {{ 'caseMigration.migrate' | translate }}\n <svg class=\"cds--btn__icon\" cdsIcon=\"watsonHealthStackedMove\" size=\"16\"></svg>\n </button>\n </ng-container>\n\n <valtimo-confirmation-modal\n [showModalSubject$]=\"obs.showConfirmationModal\"\n (confirmEvent)=\"migrate()\"\n (cancelEvent)=\"showConfirmationModal$.next(false)\"\n cancelButtonType=\"ghost\"\n confirmButtonTextTranslationKey=\"caseMigration.modalTitle\"\n titleTranslationKey=\"caseMigration.modalTitle\"\n contentTranslationKey=\"caseMigration.modalContent\"\n ></valtimo-confirmation-modal>\n</ng-container>\n", dependencies: [{ kind: "directive", type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.Dropdown, selector: "cds-dropdown, ibm-dropdown", inputs: ["id", "label", "hideLabel", "helperText", "placeholder", "displayValue", "clearText", "size", "type", "theme", "disabled", "readonly", "skeleton", "inline", "disableArrowKeys", "invalid", "invalidText", "warn", "warnText", "appendInline", "scrollableContainer", "itemValueKey", "selectionFeedback", "menuButtonLabel", "selectedLabel", "dropUp", "fluid"], outputs: ["selected", "onClose", "close"] }, { kind: "component", type: i3.DropdownList, selector: "cds-dropdown-list, ibm-dropdown-list", inputs: ["ariaLabel", "items", "listTpl", "type", "showTitles"], outputs: ["select", "scroll", "blurIntent"] }, { kind: "directive", type: i3.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "directive", type: i3.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "component", type: i7.CarbonMultiInputComponent, selector: "valtimo-carbon-multi-input", inputs: ["addRowText", "addButtonType", "addRowTranslationKey", "arbitraryAmountTitles", "arbitraryValueAmount", "defaultValues", "deleteRowText", "deleteRowTranslationKey", "disabled", "dropdownColumnTitle", "dropdownItems", "dropdownWidth", "fullWidth", "hideAddButton", "hideDeleteButton", "initialAmountOfRows", "keyColumnTitle", "margin", "maxRows", "minimumAmountOfRows", "name", "required", "title", "titleTranslationKey", "tooltip", "type", "valueColumnTitle", "valuePathSelectorCaseDefinitionKey", "valuePathSelectorPrefixes", "valuePathSelectorShowCaseDefinitionSelector", "valuePathSelectorNotation", "keyColumnFlex", "dropdownColumnFlex", "valueColumnFlex"], outputs: ["valueChange", "allValuesValidEvent"] }, { kind: "component", type: i7.ConfirmationModalComponent, selector: "valtimo-confirmation-modal", inputs: ["titleTranslationKey", "title", "content", "contentTranslationKey", "confirmButtonText", "confirmButtonTextTranslationKey", "confirmButtonType", "showOptionalButton", "optionalButtonText", "optionalButtonTextTranslationKey", "optionalButtonType", "cancelButtonText", "cancelButtonTextTranslationKey", "cancelButtonType", "showModalSubject$", "outputOnConfirm", "outputOnOptional", "spacerAfterCancelButton"], outputs: ["confirmEvent", "optionalEvent", "cancelEvent"] }, { kind: "component", type: i3.Notification, selector: "cds-notification, cds-inline-notification, ibm-notification, ibm-inline-notification", inputs: ["notificationObj"] }, { kind: "pipe", type: i6.AsyncPipe, name: "async" }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }] }); }
239
285
  }
@@ -1 +1 @@
1
- {"version":3,"file":"valtimo-case-migration.mjs","sources":["../../../../projects/valtimo/case-migration/src/lib/models/case-migration.model.ts","../../../../projects/valtimo/case-migration/src/lib/models/index.ts","../../../../projects/valtimo/case-migration/src/lib/services/case-migration.service.ts","../../../../projects/valtimo/case-migration/src/lib/services/index.ts","../../../../projects/valtimo/case-migration/src/lib/components/case-migration-component/case-migration.component.ts","../../../../projects/valtimo/case-migration/src/lib/components/case-migration-component/case-migration.component.html","../../../../projects/valtimo/case-migration/src/lib/case-migration-routing.module.ts","../../../../projects/valtimo/case-migration/src/lib/case-migration.module.ts","../../../../projects/valtimo/case-migration/src/public-api.ts","../../../../projects/valtimo/case-migration/src/valtimo-case-migration.ts"],"sourcesContent":["/*\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {CaseDefinitionId} from '@valtimo/document';\n\ninterface LoadedValue<T> {\n isLoading: boolean;\n value?: T;\n}\n\ninterface DocumentMigrationConflictRequest {\n documentDefinitionNameSource: string;\n caseDefinitionIdSource: CaseDefinitionId;\n documentDefinitionNameTarget: string;\n caseDefinitionIdTarget: CaseDefinitionId;\n patches: DocumentMigrationPatch[];\n}\n\ninterface DocumentMigrationConflictResponse {\n documentDefinitionNameSource: string;\n caseDefinitionIdSource: CaseDefinitionId;\n documentDefinitionNameTarget: string;\n caseDefinitionIdTarget: CaseDefinitionId;\n conflicts: DocumentMigrationPatch[];\n errors: Array<string>;\n documentCount: number;\n}\n\ninterface DocumentMigrationPatch {\n source: string;\n target?: string;\n error?: string;\n}\n\nexport {\n LoadedValue,\n DocumentMigrationConflictRequest,\n DocumentMigrationConflictResponse,\n DocumentMigrationPatch,\n};\n","/*\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './case-migration.model';\n","/*\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Injectable} from '@angular/core';\nimport {HttpClient} from '@angular/common/http';\nimport {ConfigService} from '@valtimo/shared';\nimport {Observable} from 'rxjs';\nimport {DocumentMigrationConflictRequest, DocumentMigrationConflictResponse} from '../models';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class CaseMigrationService {\n private readonly valtimoEndpointUri!: string;\n\n constructor(\n private http: HttpClient,\n configService: ConfigService\n ) {\n this.valtimoEndpointUri = configService.config.valtimoApi.endpointUri;\n }\n\n public getConflicts(\n request: DocumentMigrationConflictRequest\n ): Observable<DocumentMigrationConflictResponse> {\n return this.http.post<DocumentMigrationConflictResponse>(\n `${this.valtimoEndpointUri}management/v1/document-definition/migration/conflicts`,\n request\n );\n }\n\n public migrate(request: DocumentMigrationConflictRequest): Observable<void> {\n return this.http.post<void>(\n `${this.valtimoEndpointUri}management/v1/document-definition/migrate`,\n request\n );\n }\n}\n","/*\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './case-migration.service';\n","/*\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Component} from '@angular/core';\nimport {CaseDefinition, DocumentService} from '@valtimo/document';\nimport {MultiInputValues} from '@valtimo/components';\nimport {\n BehaviorSubject,\n combineLatest,\n map,\n Observable,\n shareReplay,\n startWith,\n switchMap,\n take,\n} from 'rxjs';\nimport {ListItem} from 'carbon-components-angular/dropdown';\nimport {DocumentMigrationConflictRequest, DocumentMigrationPatch, LoadedValue} from '../../models';\nimport {CaseMigrationService} from '../../services';\nimport {WatsonHealthStackedMove16} from '@carbon/icons';\nimport {IconService} from 'carbon-components-angular';\nimport {GlobalNotificationService} from '@valtimo/shared';\nimport {TranslateService} from '@ngx-translate/core';\n\n@Component({\n standalone: false,\n selector: 'valtimo-case-migration',\n templateUrl: './case-migration.component.html',\n})\nexport class CaseMigrationComponent {\n public readonly sourceCaseDefinitionKeySelected$ = new BehaviorSubject<string | null>(null);\n public readonly sourceCaseDefinitionVersionTagSelected$ = new BehaviorSubject<string | null>(\n null\n );\n public readonly targetCaseDefinitionKeySelected$ = new BehaviorSubject<string | null>(null);\n public readonly targetCaseDefinitionVersionTagSelected$ = new BehaviorSubject<string | null>(\n null\n );\n public readonly patchItems$ = new BehaviorSubject<MultiInputValues>([]);\n public readonly errors$ = new BehaviorSubject<Array<string> | null>(null);\n public readonly showConfirmationModal$ = new BehaviorSubject<boolean>(false);\n\n constructor(\n private readonly documentService: DocumentService,\n private readonly caseMigrationService: CaseMigrationService,\n private readonly iconService: IconService,\n private readonly globalNotificationService: GlobalNotificationService,\n private readonly translateService: TranslateService\n ) {\n this.iconService.registerAll([WatsonHealthStackedMove16]);\n }\n\n public readonly caseDefinitions$: Observable<Array<CaseDefinition>> = this.documentService\n .getCaseDefinitionsManagement({sort: 'name,id.versionTag', size: 100000})\n .pipe(\n map(caseDefinitionsPage => caseDefinitionsPage.content),\n shareReplay(1)\n );\n public readonly sourceCaseDefinitionKeyItems$: Observable<LoadedValue<Array<ListItem>>> =\n this.caseDefinitions$.pipe(\n map(caseDefinitions => [\n ...new Map(caseDefinitions.map(item => [item.caseDefinitionKey, item])).values(),\n ]),\n map(caseDefinitions =>\n caseDefinitions.map(\n caseDefinition =>\n ({\n caseDefinitionKey: caseDefinition.caseDefinitionKey,\n content: caseDefinition.name,\n selected: false,\n }) as ListItem\n )\n ),\n map(items => ({\n value: items,\n isLoading: false,\n })),\n startWith({isLoading: true})\n );\n public readonly sourceCaseDefinitionVersionTagItems$: Observable<Array<ListItem>> = combineLatest(\n [this.sourceCaseDefinitionKeySelected$, this.caseDefinitions$]\n ).pipe(\n map(([sourceCaseDefinitionKeySelected, caseDefinitions]) =>\n caseDefinitions.filter(\n caseDefinition => caseDefinition.caseDefinitionKey === sourceCaseDefinitionKeySelected\n )\n ),\n map(caseDefinitions =>\n caseDefinitions.map(caseDefinition => caseDefinition.caseDefinitionVersionTag)\n ),\n map(versions =>\n versions.map(\n version =>\n ({\n caseDefinitionVersionTag: version,\n content: version.toString(),\n selected: false,\n }) as ListItem\n )\n )\n );\n public readonly targetCaseDefinitionKeyItems$: Observable<LoadedValue<Array<ListItem>>> =\n this.caseDefinitions$.pipe(\n map(caseDefinitions => [\n ...new Map(caseDefinitions.map(item => [item.caseDefinitionKey, item])).values(),\n ]),\n map(caseDefinitions =>\n caseDefinitions.map(\n caseDefinition =>\n ({\n caseDefinitionKey: caseDefinition.caseDefinitionKey,\n content: caseDefinition.name,\n selected: false,\n }) as ListItem\n )\n ),\n map(items => ({\n value: items,\n isLoading: false,\n })),\n startWith({isLoading: true})\n );\n public readonly targetCaseDefinitionVersionTagItems$: Observable<Array<ListItem>> = combineLatest(\n [this.targetCaseDefinitionKeySelected$, this.caseDefinitions$]\n ).pipe(\n map(([targetCaseDefinitionKeySelected, caseDefinitions]) =>\n caseDefinitions.filter(\n caseDefinition => caseDefinition.caseDefinitionKey === targetCaseDefinitionKeySelected\n )\n ),\n map(caseDefinitions =>\n caseDefinitions.map(caseDefinition => caseDefinition.caseDefinitionVersionTag)\n ),\n map(versions =>\n versions.map(\n version =>\n ({\n caseDefinitionVersionTag: version,\n content: version.toString(),\n selected: false,\n }) as ListItem\n )\n )\n );\n public readonly patches$: Observable<Array<DocumentMigrationPatch>> = this.patchItems$.pipe(\n map(patchItems =>\n patchItems.map(\n patchItem =>\n ({\n source: patchItem.key,\n target: patchItem.value,\n }) as DocumentMigrationPatch\n )\n )\n );\n\n mappingValueChange(patches: MultiInputValues): void {\n this.patchItems$.next(patches);\n }\n\n checkPatches() {\n this.errors$.next(null);\n combineLatest([\n this.sourceCaseDefinitionKeySelected$,\n this.sourceCaseDefinitionVersionTagSelected$,\n this.targetCaseDefinitionKeySelected$,\n this.targetCaseDefinitionVersionTagSelected$,\n this.patches$,\n ])\n .pipe(\n take(1),\n map(\n ([\n caseDefinitionKeySource,\n caseDefinitionVersionTagSource,\n caseDefinitionKeyTarget,\n caseDefinitionVersionTagTarget,\n patches,\n ]) =>\n ({\n documentDefinitionNameSource: caseDefinitionKeySource,\n caseDefinitionIdSource: {\n key: caseDefinitionKeySource,\n versionTag: caseDefinitionVersionTagSource,\n },\n documentDefinitionNameTarget: caseDefinitionKeyTarget,\n caseDefinitionIdTarget: {\n key: caseDefinitionKeyTarget,\n versionTag: caseDefinitionVersionTagTarget,\n },\n patches,\n }) as DocumentMigrationConflictRequest\n ),\n switchMap(request =>\n this.caseMigrationService.getConflicts(request as DocumentMigrationConflictRequest)\n )\n )\n .subscribe(response => {\n this.errors$.next(\n response.errors.concat(\n response.conflicts.filter(c => !!c.error).map(c => c.source + ': ' + c.error)\n )\n );\n });\n }\n\n migrate() {\n this.errors$.next(null);\n combineLatest([\n this.sourceCaseDefinitionKeySelected$,\n this.sourceCaseDefinitionVersionTagSelected$,\n this.targetCaseDefinitionKeySelected$,\n this.targetCaseDefinitionVersionTagSelected$,\n this.patches$,\n ])\n .pipe(\n take(1),\n map(\n ([\n caseDefinitionKeySource,\n caseDefinitionVersionTagSource,\n caseDefinitionKeyTarget,\n caseDefinitionVersionTagTarget,\n patches,\n ]) =>\n ({\n documentDefinitionNameSource: caseDefinitionKeySource,\n caseDefinitionIdSource: {\n key: caseDefinitionKeySource,\n versionTag: caseDefinitionVersionTagSource,\n },\n documentDefinitionNameTarget: caseDefinitionKeyTarget,\n caseDefinitionIdTarget: {\n key: caseDefinitionKeyTarget,\n versionTag: caseDefinitionVersionTagTarget,\n },\n patches,\n }) as DocumentMigrationConflictRequest\n ),\n switchMap(request =>\n this.caseMigrationService.migrate(request as DocumentMigrationConflictRequest)\n )\n )\n .subscribe({\n next: () => {\n this.errors$.next([]);\n this.globalNotificationService.showToast({\n title: this.translateService.instant('caseMigration.noErrors'),\n type: 'success',\n });\n },\n error: error => this.errors$.next([error.message]),\n });\n }\n\n protected readonly CARBON_THEME = 'g10';\n}\n","<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container\n class=\"case-count-configuration-form\"\n *ngIf=\"{\n sourceCaseDefinitionKeyItems: sourceCaseDefinitionKeyItems$ | async,\n sourceCaseDefinitionVersionTagItems: sourceCaseDefinitionVersionTagItems$ | async,\n targetCaseDefinitionKeyItems: targetCaseDefinitionKeyItems$ | async,\n targetCaseDefinitionVersionTagItems: targetCaseDefinitionVersionTagItems$ | async,\n sourceCaseDefinitionKeySelected: sourceCaseDefinitionKeySelected$ | async,\n sourceCaseDefinitionVersionTagSelected: sourceCaseDefinitionVersionTagSelected$ | async,\n targetCaseDefinitionKeySelected: targetCaseDefinitionKeySelected$ | async,\n targetCaseDefinitionVersionTagSelected: targetCaseDefinitionVersionTagSelected$ | async,\n patchItems: patchItems$ | async,\n errors: errors$ | async,\n showConfirmationModal: showConfirmationModal$,\n } as obs\"\n>\n <ng-container>\n <div class=\"pb-2\">\n <cds-notification\n [notificationObj]=\"{\n type: 'warning',\n title: 'caseMigration.warningBeta' | translate,\n showClose: false,\n }\"\n >\n </cds-notification>\n </div>\n </ng-container>\n\n <ng-container>\n <div class=\"input-group mt-4 mb-2 align-items-center\">\n <div>\n <h2>{{ 'caseMigration.caseDefinition' | translate }}</h2>\n </div>\n </div>\n\n <div class=\"row m-0\">\n <cds-dropdown\n class=\"pr-2 pb-2\"\n [label]=\"'caseMigration.sourceCaseDefinitionKey' | translate\"\n [style.width.px]=\"350\"\n [disabled]=\"obs.sourceCaseDefinitionKeyItems.isLoading\"\n [dropUp]=\"false\"\n [skeleton]=\"obs.sourceCaseDefinitionKeyItems.isLoading\"\n (selected)=\"sourceCaseDefinitionKeySelected$.next($event.item.caseDefinitionKey)\"\n >\n <cds-dropdown-list\n [items]=\"obs.sourceCaseDefinitionKeyItems.value || []\"\n ></cds-dropdown-list>\n </cds-dropdown>\n <cds-dropdown\n class=\"pr-2 pb-2\"\n [label]=\"'caseMigration.sourceCaseDefinitionVersionTag' | translate\"\n [style.width.px]=\"300\"\n [disabled]=\"obs.targetCaseDefinitionKeyItems.isLoading\"\n [dropUp]=\"false\"\n [skeleton]=\"obs.targetCaseDefinitionKeyItems.isLoading\"\n (selected)=\"\n sourceCaseDefinitionVersionTagSelected$.next($event.item.caseDefinitionVersionTag)\n \"\n >\n <cds-dropdown-list\n [items]=\"obs.sourceCaseDefinitionVersionTagItems || []\"\n ></cds-dropdown-list>\n </cds-dropdown>\n </div>\n </ng-container>\n\n <ng-container>\n <div class=\"row m-0\">\n <cds-dropdown\n class=\"pr-2 pb-2\"\n [label]=\"'caseMigration.targetCaseDefinitionKey' | translate\"\n [style.width.px]=\"350\"\n [disabled]=\"obs.targetCaseDefinitionKeyItems.isLoading\"\n [dropUp]=\"false\"\n [skeleton]=\"obs.targetCaseDefinitionKeyItems.isLoading\"\n (selected)=\"targetCaseDefinitionKeySelected$.next($event.item.caseDefinitionKey)\"\n >\n <cds-dropdown-list\n [items]=\"obs.targetCaseDefinitionKeyItems.value || []\"\n ></cds-dropdown-list>\n </cds-dropdown>\n <cds-dropdown\n class=\"pr-2 pb-2\"\n [label]=\"'caseMigration.targetCaseDefinitionVersionTag' | translate\"\n [style.width.px]=\"300\"\n [disabled]=\"obs.targetCaseDefinitionKeyItems.isLoading\"\n [dropUp]=\"false\"\n [skeleton]=\"obs.targetCaseDefinitionKeyItems.isLoading\"\n (selected)=\"\n targetCaseDefinitionVersionTagSelected$.next($event.item.caseDefinitionVersionTag)\n \"\n >\n <cds-dropdown-list\n [items]=\"obs.targetCaseDefinitionVersionTagItems || []\"\n ></cds-dropdown-list>\n </cds-dropdown>\n </div>\n </ng-container>\n\n <ng-container>\n <div class=\"pt-2 pb-2\">\n <div class=\"input-group mt-4 mb-2 align-items-center\">\n <div>\n <h2>{{ 'caseMigration.patches' | translate }}</h2>\n </div>\n </div>\n <valtimo-carbon-multi-input\n type=\"keyValue\"\n (valueChange)=\"mappingValueChange($event)\"\n [title]=\"' '\"\n [tooltip]=\"'caseMigration.patchTooltip' | translate\"\n [defaultValues]=\"[]\"\n [keyColumnTitle]=\"'caseMigration.patchSource' | translate\"\n [valueColumnTitle]=\"'caseMigration.patchTarget' | translate\"\n [fullWidth]=\"true\"\n ></valtimo-carbon-multi-input>\n </div>\n </ng-container>\n\n <ng-container>\n <div class=\"pt-2\">\n <div *ngIf=\"obs.errors?.length === 0\" class=\"input-group mt-4 mb-2 align-items-center\">\n <div>\n {{ 'caseMigration.noErrors' | translate }}\n </div>\n </div>\n <div *ngIf=\"obs.errors?.length >= 1\" class=\"input-group mt-4 mb-2 align-items-center\">\n <div>\n <h2>{{ 'caseMigration.errors' | translate }}</h2>\n </div>\n </div>\n\n <div class=\"pb-2\" *ngFor=\"let error of obs.errors\">\n <cds-notification\n [notificationObj]=\"{\n type: 'error',\n title: error,\n showClose: false,\n }\"\n >\n </cds-notification>\n </div>\n </div>\n </ng-container>\n\n <ng-container>\n <button\n class=\"mt-2 mb-2 mr-2\"\n cdsButton=\"secondary\"\n size=\"md\"\n (click)=\"checkPatches()\"\n [disabled]=\"\n !obs.sourceCaseDefinitionKeySelected ||\n !obs.sourceCaseDefinitionVersionTagSelected ||\n !obs.targetCaseDefinitionKeySelected ||\n !obs.targetCaseDefinitionVersionTagSelected\n \"\n >\n {{ 'caseMigration.checkPatches' | translate }}\n </button>\n <button\n class=\"mt-2 mb-2 ml-2\"\n cdsButton=\"primary\"\n size=\"md\"\n (click)=\"showConfirmationModal$.next(true)\"\n [disabled]=\"\n !obs.sourceCaseDefinitionKeySelected ||\n !obs.sourceCaseDefinitionVersionTagSelected ||\n !obs.targetCaseDefinitionKeySelected ||\n !obs.targetCaseDefinitionVersionTagSelected\n \"\n >\n {{ 'caseMigration.migrate' | translate }}\n <svg class=\"cds--btn__icon\" cdsIcon=\"watsonHealthStackedMove\" size=\"16\"></svg>\n </button>\n </ng-container>\n\n <valtimo-confirmation-modal\n [showModalSubject$]=\"obs.showConfirmationModal\"\n (confirmEvent)=\"migrate()\"\n (cancelEvent)=\"showConfirmationModal$.next(false)\"\n cancelButtonType=\"ghost\"\n confirmButtonTextTranslationKey=\"caseMigration.modalTitle\"\n titleTranslationKey=\"caseMigration.modalTitle\"\n contentTranslationKey=\"caseMigration.modalContent\"\n ></valtimo-confirmation-modal>\n</ng-container>\n","/*\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {NgModule} from '@angular/core';\nimport {RouterModule, Routes} from '@angular/router';\nimport {CommonModule} from '@angular/common';\nimport {AuthGuardService} from '@valtimo/security';\nimport {ROLE_ADMIN} from '@valtimo/shared';\nimport {CaseMigrationComponent} from './components/case-migration-component/case-migration.component';\n\nconst routes: Routes = [\n {\n path: 'case-migration',\n component: CaseMigrationComponent,\n canActivate: [AuthGuardService],\n data: {title: 'Case migration', roles: [ROLE_ADMIN]},\n },\n];\n\n@NgModule({\n imports: [CommonModule, RouterModule.forChild(routes)],\n exports: [RouterModule],\n})\nexport class CaseMigrationRoutingModule {}\n","/*\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {NgModule} from '@angular/core';\nimport {CaseMigrationRoutingModule} from './case-migration-routing.module';\nimport {CommonModule} from '@angular/common';\nimport {FormsModule, ReactiveFormsModule} from '@angular/forms';\nimport {\n CarbonMultiInputModule,\n ConfirmationModalModule,\n RenderInPageHeaderDirective,\n TooltipIconModule,\n WidgetModule,\n} from '@valtimo/components';\nimport {TranslateModule} from '@ngx-translate/core';\nimport {CaseMigrationComponent} from './components/case-migration-component/case-migration.component';\nimport {\n ButtonModule,\n DropdownModule,\n IconModule,\n InputModule,\n NotificationModule,\n} from 'carbon-components-angular';\n\n@NgModule({\n declarations: [CaseMigrationComponent],\n imports: [\n CommonModule,\n CaseMigrationRoutingModule,\n ReactiveFormsModule,\n WidgetModule,\n FormsModule,\n TranslateModule,\n DropdownModule,\n RenderInPageHeaderDirective,\n InputModule,\n TooltipIconModule,\n ButtonModule,\n IconModule,\n CarbonMultiInputModule,\n ConfirmationModalModule,\n NotificationModule,\n ],\n})\nexport class CaseMigrationModule {}\n","/*\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*\n * Public API Surface of case-migration\n */\n\nexport * from './lib/models';\nexport * from './lib/services';\nexport * from './lib/case-migration.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1","i2.CaseMigrationService","i4"],"mappings":";;;;;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,CAAA,CAAA;AAGT,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,YAjB5B,YAAY;YACZ,0BAA0B;YAC1B,mBAAmB;YACnB,YAAY;YACZ,WAAW;YACX,eAAe;YACf,cAAc;YAEd,WAAW;YACX,iBAAiB;YACjB,YAAY;YACZ,UAAU;YACV,sBAAsB;YACtB,uBAAuB;YACvB,kBAAkB,CAAA,EAAA,CAAA,CAAA;;4FAGT,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBApB/B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,sBAAsB,CAAC;AACtC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,0BAA0B;wBAC1B,mBAAmB;wBACnB,YAAY;wBACZ,WAAW;wBACX,eAAe;wBACf,cAAc;wBACd,2BAA2B;wBAC3B,WAAW;wBACX,iBAAiB;wBACjB,YAAY;wBACZ,UAAU;wBACV,sBAAsB;wBACtB,uBAAuB;wBACvB,kBAAkB;AACnB,qBAAA;AACF,iBAAA;;;ACxDD;;;;;;;;;;;;;;AAcG;AAEH;;AAEG;;AClBH;;AAEG;;;;"}
1
+ {"version":3,"file":"valtimo-case-migration.mjs","sources":["../../../../projects/valtimo/case-migration/src/lib/models/case-migration.model.ts","../../../../projects/valtimo/case-migration/src/lib/models/index.ts","../../../../projects/valtimo/case-migration/src/lib/services/case-migration.service.ts","../../../../projects/valtimo/case-migration/src/lib/services/index.ts","../../../../projects/valtimo/case-migration/src/lib/components/case-migration-component/case-migration.component.ts","../../../../projects/valtimo/case-migration/src/lib/components/case-migration-component/case-migration.component.html","../../../../projects/valtimo/case-migration/src/lib/case-migration-routing.module.ts","../../../../projects/valtimo/case-migration/src/lib/case-migration.module.ts","../../../../projects/valtimo/case-migration/src/public-api.ts","../../../../projects/valtimo/case-migration/src/valtimo-case-migration.ts"],"sourcesContent":["/*\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {CaseDefinitionId} from '@valtimo/document';\n\ninterface LoadedValue<T> {\n isLoading: boolean;\n value?: T;\n}\n\ninterface DocumentMigrationConflictRequest {\n documentDefinitionNameSource: string;\n caseDefinitionIdSource: CaseDefinitionId;\n documentDefinitionNameTarget: string;\n caseDefinitionIdTarget: CaseDefinitionId;\n patches: DocumentMigrationPatch[];\n}\n\ninterface DocumentMigrationConflictResponse {\n documentDefinitionNameSource: string;\n caseDefinitionIdSource: CaseDefinitionId;\n documentDefinitionNameTarget: string;\n caseDefinitionIdTarget: CaseDefinitionId;\n conflicts: DocumentMigrationPatch[];\n errors: Array<string>;\n documentCount: number;\n}\n\ninterface DocumentMigrationPatch {\n source: string;\n target?: string;\n error?: string;\n}\n\nexport {\n LoadedValue,\n DocumentMigrationConflictRequest,\n DocumentMigrationConflictResponse,\n DocumentMigrationPatch,\n};\n","/*\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './case-migration.model';\n","/*\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Injectable} from '@angular/core';\nimport {HttpClient} from '@angular/common/http';\nimport {ConfigService} from '@valtimo/shared';\nimport {Observable} from 'rxjs';\nimport {DocumentMigrationConflictRequest, DocumentMigrationConflictResponse} from '../models';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class CaseMigrationService {\n private readonly valtimoEndpointUri!: string;\n\n constructor(\n private http: HttpClient,\n configService: ConfigService\n ) {\n this.valtimoEndpointUri = configService.config.valtimoApi.endpointUri;\n }\n\n public getConflicts(\n request: DocumentMigrationConflictRequest\n ): Observable<DocumentMigrationConflictResponse> {\n return this.http.post<DocumentMigrationConflictResponse>(\n `${this.valtimoEndpointUri}management/v1/document-definition/migration/conflicts`,\n request\n );\n }\n\n public migrate(request: DocumentMigrationConflictRequest): Observable<void> {\n return this.http.post<void>(\n `${this.valtimoEndpointUri}management/v1/document-definition/migrate`,\n request\n );\n }\n}\n","/*\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './case-migration.service';\n","/*\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Component, OnDestroy, OnInit} from '@angular/core';\nimport {CaseDefinition, DocumentService, Page} from '@valtimo/document';\nimport {MultiInputValues} from '@valtimo/components';\nimport {\n BehaviorSubject,\n combineLatest,\n EMPTY,\n expand,\n map,\n Observable,\n reduce,\n shareReplay,\n startWith,\n Subscription,\n switchMap,\n take,\n} from 'rxjs';\nimport {ListItem} from 'carbon-components-angular/dropdown';\nimport {DocumentMigrationConflictRequest, DocumentMigrationPatch, LoadedValue} from '../../models';\nimport {CaseMigrationService} from '../../services';\nimport {WatsonHealthStackedMove16} from '@carbon/icons';\nimport {IconService} from 'carbon-components-angular';\nimport {GlobalNotificationService} from '@valtimo/shared';\nimport {TranslateService} from '@ngx-translate/core';\nimport {gt, valid} from 'semver';\n\n// Spring caps the `size` request param at 2000, so larger pages have to be fetched one by one.\nconst MAX_PAGE_SIZE = 2000;\n\n@Component({\n standalone: false,\n selector: 'valtimo-case-migration',\n templateUrl: './case-migration.component.html',\n})\nexport class CaseMigrationComponent implements OnInit, OnDestroy {\n public readonly sourceCaseDefinitionKeySelected$ = new BehaviorSubject<string | null>(null);\n public readonly sourceCaseDefinitionVersionTagSelected$ = new BehaviorSubject<string | null>(\n null\n );\n public readonly targetCaseDefinitionKeySelected$ = new BehaviorSubject<string | null>(null);\n public readonly targetCaseDefinitionVersionTagSelected$ = new BehaviorSubject<string | null>(\n null\n );\n public readonly patchItems$ = new BehaviorSubject<MultiInputValues>([]);\n public readonly errors$ = new BehaviorSubject<Array<string> | null>(null);\n public readonly showConfirmationModal$ = new BehaviorSubject<boolean>(false);\n\n private readonly _subscriptions = new Subscription();\n\n constructor(\n private readonly documentService: DocumentService,\n private readonly caseMigrationService: CaseMigrationService,\n private readonly iconService: IconService,\n private readonly globalNotificationService: GlobalNotificationService,\n private readonly translateService: TranslateService\n ) {\n this.iconService.registerAll([WatsonHealthStackedMove16]);\n }\n\n public readonly caseDefinitions$: Observable<Array<CaseDefinition>> =\n this.getAllCaseDefinitions().pipe(shareReplay(1));\n public readonly sourceCaseDefinitionKeyItems$: Observable<LoadedValue<Array<ListItem>>> =\n this.caseDefinitions$.pipe(\n map(caseDefinitions => ({\n value: this.toCaseDefinitionKeyItems(caseDefinitions),\n isLoading: false,\n })),\n startWith({isLoading: true})\n );\n public readonly sourceCaseDefinitionVersionTagItems$: Observable<Array<ListItem>> = combineLatest(\n [this.sourceCaseDefinitionKeySelected$, this.caseDefinitions$]\n ).pipe(\n map(([sourceCaseDefinitionKeySelected, caseDefinitions]) =>\n caseDefinitions.filter(\n caseDefinition => caseDefinition.caseDefinitionKey === sourceCaseDefinitionKeySelected\n )\n ),\n map(caseDefinitions =>\n caseDefinitions.map(caseDefinition => caseDefinition.caseDefinitionVersionTag)\n ),\n map(versions =>\n versions.map(\n version =>\n ({\n caseDefinitionVersionTag: version,\n content: version.toString(),\n selected: false,\n }) as ListItem\n )\n )\n );\n public readonly targetCaseDefinitionKeyItems$: Observable<LoadedValue<Array<ListItem>>> =\n combineLatest([this.caseDefinitions$, this.targetCaseDefinitionKeySelected$]).pipe(\n map(([caseDefinitions, targetCaseDefinitionKeySelected]) => ({\n value: this.toCaseDefinitionKeyItems(caseDefinitions, targetCaseDefinitionKeySelected),\n isLoading: false,\n })),\n startWith({isLoading: true})\n );\n public readonly targetCaseDefinitionVersionTagItems$: Observable<Array<ListItem>> = combineLatest(\n [\n this.targetCaseDefinitionKeySelected$,\n this.targetCaseDefinitionVersionTagSelected$,\n this.caseDefinitions$,\n ]\n ).pipe(\n map(\n ([\n targetCaseDefinitionKeySelected,\n targetCaseDefinitionVersionTagSelected,\n caseDefinitions,\n ]) =>\n caseDefinitions\n .filter(\n caseDefinition => caseDefinition.caseDefinitionKey === targetCaseDefinitionKeySelected\n )\n .map(\n caseDefinition =>\n ({\n caseDefinitionVersionTag: caseDefinition.caseDefinitionVersionTag,\n content: caseDefinition.caseDefinitionVersionTag.toString(),\n selected:\n caseDefinition.caseDefinitionVersionTag ===\n targetCaseDefinitionVersionTagSelected,\n }) as ListItem\n )\n )\n );\n public readonly patches$: Observable<Array<DocumentMigrationPatch>> = this.patchItems$.pipe(\n map(patchItems =>\n patchItems.map(\n patchItem =>\n ({\n source: patchItem.key,\n target: patchItem.value,\n }) as DocumentMigrationPatch\n )\n )\n );\n\n public ngOnInit(): void {\n // The target is prefilled to the latest version, this screen's usual case; only the user knows the source.\n this._subscriptions.add(\n this.sourceCaseDefinitionKeySelected$.subscribe(sourceCaseDefinitionKeySelected =>\n this.targetCaseDefinitionKeySelected$.next(sourceCaseDefinitionKeySelected)\n )\n );\n\n // Keyed off the target so a different target case replaces the tag, which it need not otherwise have.\n this._subscriptions.add(\n combineLatest([this.targetCaseDefinitionKeySelected$, this.caseDefinitions$]).subscribe(\n ([targetCaseDefinitionKeySelected, caseDefinitions]) =>\n this.targetCaseDefinitionVersionTagSelected$.next(\n this.latestVersionTagOf(caseDefinitions, targetCaseDefinitionKeySelected)\n )\n )\n );\n }\n\n public ngOnDestroy(): void {\n this._subscriptions.unsubscribe();\n }\n\n mappingValueChange(patches: MultiInputValues): void {\n this.patchItems$.next(patches);\n }\n\n checkPatches() {\n this.errors$.next(null);\n combineLatest([\n this.sourceCaseDefinitionKeySelected$,\n this.sourceCaseDefinitionVersionTagSelected$,\n this.targetCaseDefinitionKeySelected$,\n this.targetCaseDefinitionVersionTagSelected$,\n this.patches$,\n ])\n .pipe(\n take(1),\n map(\n ([\n caseDefinitionKeySource,\n caseDefinitionVersionTagSource,\n caseDefinitionKeyTarget,\n caseDefinitionVersionTagTarget,\n patches,\n ]) =>\n ({\n documentDefinitionNameSource: caseDefinitionKeySource,\n caseDefinitionIdSource: {\n key: caseDefinitionKeySource,\n versionTag: caseDefinitionVersionTagSource,\n },\n documentDefinitionNameTarget: caseDefinitionKeyTarget,\n caseDefinitionIdTarget: {\n key: caseDefinitionKeyTarget,\n versionTag: caseDefinitionVersionTagTarget,\n },\n patches,\n }) as DocumentMigrationConflictRequest\n ),\n switchMap(request =>\n this.caseMigrationService.getConflicts(request as DocumentMigrationConflictRequest)\n )\n )\n .subscribe(response => {\n this.errors$.next(\n response.errors.concat(\n response.conflicts.filter(c => !!c.error).map(c => c.source + ': ' + c.error)\n )\n );\n });\n }\n\n migrate() {\n this.errors$.next(null);\n combineLatest([\n this.sourceCaseDefinitionKeySelected$,\n this.sourceCaseDefinitionVersionTagSelected$,\n this.targetCaseDefinitionKeySelected$,\n this.targetCaseDefinitionVersionTagSelected$,\n this.patches$,\n ])\n .pipe(\n take(1),\n map(\n ([\n caseDefinitionKeySource,\n caseDefinitionVersionTagSource,\n caseDefinitionKeyTarget,\n caseDefinitionVersionTagTarget,\n patches,\n ]) =>\n ({\n documentDefinitionNameSource: caseDefinitionKeySource,\n caseDefinitionIdSource: {\n key: caseDefinitionKeySource,\n versionTag: caseDefinitionVersionTagSource,\n },\n documentDefinitionNameTarget: caseDefinitionKeyTarget,\n caseDefinitionIdTarget: {\n key: caseDefinitionKeyTarget,\n versionTag: caseDefinitionVersionTagTarget,\n },\n patches,\n }) as DocumentMigrationConflictRequest\n ),\n switchMap(request =>\n this.caseMigrationService.migrate(request as DocumentMigrationConflictRequest)\n )\n )\n .subscribe({\n next: () => {\n this.errors$.next([]);\n this.globalNotificationService.showToast({\n title: this.translateService.instant('caseMigration.noErrors'),\n type: 'success',\n });\n },\n error: error => this.errors$.next([error.message]),\n });\n }\n\n /**\n * Compares tags rather than list position, so the latest version is found regardless of the order\n * the backend returns the versions of a key in.\n */\n private latestVersionTagOf(\n caseDefinitions: Array<CaseDefinition>,\n caseDefinitionKey: string | null\n ): string | null {\n return caseDefinitions\n .filter(caseDefinition => caseDefinition.caseDefinitionKey === caseDefinitionKey)\n .map(caseDefinition => caseDefinition.caseDefinitionVersionTag)\n .reduce((latest: string | null, current: string) => {\n if (latest === null) return current;\n if (!valid(current)) return latest;\n return !valid(latest) || gt(current, latest) ? current : latest;\n }, null);\n }\n\n private getAllCaseDefinitions(): Observable<Array<CaseDefinition>> {\n return this.getCaseDefinitionPage(0).pipe(\n expand(page =>\n page.content.length === 0 || (page.number + 1) * page.size >= page.totalElements\n ? EMPTY\n : this.getCaseDefinitionPage(page.number + 1)\n ),\n reduce(\n (caseDefinitions: Array<CaseDefinition>, page) => [...caseDefinitions, ...page.content],\n []\n )\n );\n }\n\n private getCaseDefinitionPage(page: number): Observable<Page<CaseDefinition>> {\n return this.documentService.getCaseDefinitionsManagement({\n sort: 'id.key,id.versionTag',\n allVersions: true,\n page,\n size: MAX_PAGE_SIZE,\n });\n }\n\n // Ordered on name because that is what the dropdown shows; the fetch itself is ordered on key\n // so that the versions of a case stay grouped and in version order.\n private toCaseDefinitionKeyItems(\n caseDefinitions: Array<CaseDefinition>,\n selectedCaseDefinitionKey: string | null = null\n ): Array<ListItem> {\n return [...new Map(caseDefinitions.map(item => [item.caseDefinitionKey, item])).values()]\n .map(\n caseDefinition =>\n ({\n caseDefinitionKey: caseDefinition.caseDefinitionKey,\n content: caseDefinition.name,\n selected: caseDefinition.caseDefinitionKey === selectedCaseDefinitionKey,\n }) as ListItem\n )\n .sort((left, right) => left.content.localeCompare(right.content));\n }\n\n protected readonly CARBON_THEME = 'g10';\n}\n","<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container\n class=\"case-count-configuration-form\"\n *ngIf=\"{\n sourceCaseDefinitionKeyItems: sourceCaseDefinitionKeyItems$ | async,\n sourceCaseDefinitionVersionTagItems: sourceCaseDefinitionVersionTagItems$ | async,\n targetCaseDefinitionKeyItems: targetCaseDefinitionKeyItems$ | async,\n targetCaseDefinitionVersionTagItems: targetCaseDefinitionVersionTagItems$ | async,\n sourceCaseDefinitionKeySelected: sourceCaseDefinitionKeySelected$ | async,\n sourceCaseDefinitionVersionTagSelected: sourceCaseDefinitionVersionTagSelected$ | async,\n targetCaseDefinitionKeySelected: targetCaseDefinitionKeySelected$ | async,\n targetCaseDefinitionVersionTagSelected: targetCaseDefinitionVersionTagSelected$ | async,\n patchItems: patchItems$ | async,\n errors: errors$ | async,\n showConfirmationModal: showConfirmationModal$,\n } as obs\"\n>\n <ng-container>\n <div class=\"pb-2\">\n <cds-notification\n [notificationObj]=\"{\n type: 'warning',\n title: 'caseMigration.warningBeta' | translate,\n showClose: false,\n }\"\n >\n </cds-notification>\n </div>\n </ng-container>\n\n <ng-container>\n <div class=\"input-group mt-4 mb-2 align-items-center\">\n <div>\n <h2>{{ 'caseMigration.caseDefinition' | translate }}</h2>\n </div>\n </div>\n\n <div class=\"row m-0\">\n <cds-dropdown\n class=\"pr-2 pb-2\"\n [label]=\"'caseMigration.sourceCaseDefinitionKey' | translate\"\n [style.width.px]=\"350\"\n [disabled]=\"obs.sourceCaseDefinitionKeyItems.isLoading\"\n [dropUp]=\"false\"\n [skeleton]=\"obs.sourceCaseDefinitionKeyItems.isLoading\"\n (selected)=\"sourceCaseDefinitionKeySelected$.next($event.item.caseDefinitionKey)\"\n >\n <cds-dropdown-list\n [items]=\"obs.sourceCaseDefinitionKeyItems.value || []\"\n ></cds-dropdown-list>\n </cds-dropdown>\n <cds-dropdown\n class=\"pr-2 pb-2\"\n [label]=\"'caseMigration.sourceCaseDefinitionVersionTag' | translate\"\n [style.width.px]=\"300\"\n [disabled]=\"obs.targetCaseDefinitionKeyItems.isLoading\"\n [dropUp]=\"false\"\n [skeleton]=\"obs.targetCaseDefinitionKeyItems.isLoading\"\n (selected)=\"\n sourceCaseDefinitionVersionTagSelected$.next($event.item.caseDefinitionVersionTag)\n \"\n >\n <cds-dropdown-list\n [items]=\"obs.sourceCaseDefinitionVersionTagItems || []\"\n ></cds-dropdown-list>\n </cds-dropdown>\n </div>\n </ng-container>\n\n <ng-container>\n <div class=\"row m-0\">\n <cds-dropdown\n class=\"pr-2 pb-2\"\n [label]=\"'caseMigration.targetCaseDefinitionKey' | translate\"\n [style.width.px]=\"350\"\n [disabled]=\"obs.targetCaseDefinitionKeyItems.isLoading\"\n [dropUp]=\"false\"\n [skeleton]=\"obs.targetCaseDefinitionKeyItems.isLoading\"\n (selected)=\"targetCaseDefinitionKeySelected$.next($event.item.caseDefinitionKey)\"\n >\n <cds-dropdown-list\n [items]=\"obs.targetCaseDefinitionKeyItems.value || []\"\n ></cds-dropdown-list>\n </cds-dropdown>\n <cds-dropdown\n class=\"pr-2 pb-2\"\n [label]=\"'caseMigration.targetCaseDefinitionVersionTag' | translate\"\n [style.width.px]=\"300\"\n [disabled]=\"obs.targetCaseDefinitionKeyItems.isLoading\"\n [dropUp]=\"false\"\n [skeleton]=\"obs.targetCaseDefinitionKeyItems.isLoading\"\n (selected)=\"\n targetCaseDefinitionVersionTagSelected$.next($event.item.caseDefinitionVersionTag)\n \"\n >\n <cds-dropdown-list\n [items]=\"obs.targetCaseDefinitionVersionTagItems || []\"\n ></cds-dropdown-list>\n </cds-dropdown>\n </div>\n </ng-container>\n\n <ng-container>\n <div class=\"pt-2 pb-2\">\n <div class=\"input-group mt-4 mb-2 align-items-center\">\n <div>\n <h2>{{ 'caseMigration.patches' | translate }}</h2>\n </div>\n </div>\n <valtimo-carbon-multi-input\n type=\"keyValue\"\n (valueChange)=\"mappingValueChange($event)\"\n [title]=\"' '\"\n [tooltip]=\"'caseMigration.patchTooltip' | translate\"\n [defaultValues]=\"[]\"\n [keyColumnTitle]=\"'caseMigration.patchSource' | translate\"\n [valueColumnTitle]=\"'caseMigration.patchTarget' | translate\"\n [fullWidth]=\"true\"\n ></valtimo-carbon-multi-input>\n </div>\n </ng-container>\n\n <ng-container>\n <div class=\"pt-2\">\n <div *ngIf=\"obs.errors?.length === 0\" class=\"input-group mt-4 mb-2 align-items-center\">\n <div>\n {{ 'caseMigration.noErrors' | translate }}\n </div>\n </div>\n <div *ngIf=\"obs.errors?.length >= 1\" class=\"input-group mt-4 mb-2 align-items-center\">\n <div>\n <h2>{{ 'caseMigration.errors' | translate }}</h2>\n </div>\n </div>\n\n <div class=\"pb-2\" *ngFor=\"let error of obs.errors\">\n <cds-notification\n [notificationObj]=\"{\n type: 'error',\n title: error,\n showClose: false,\n }\"\n >\n </cds-notification>\n </div>\n </div>\n </ng-container>\n\n <ng-container>\n <button\n class=\"mt-2 mb-2 mr-2\"\n cdsButton=\"secondary\"\n size=\"md\"\n (click)=\"checkPatches()\"\n [disabled]=\"\n !obs.sourceCaseDefinitionKeySelected ||\n !obs.sourceCaseDefinitionVersionTagSelected ||\n !obs.targetCaseDefinitionKeySelected ||\n !obs.targetCaseDefinitionVersionTagSelected\n \"\n >\n {{ 'caseMigration.checkPatches' | translate }}\n </button>\n <button\n class=\"mt-2 mb-2 ml-2\"\n cdsButton=\"primary\"\n size=\"md\"\n (click)=\"showConfirmationModal$.next(true)\"\n [disabled]=\"\n !obs.sourceCaseDefinitionKeySelected ||\n !obs.sourceCaseDefinitionVersionTagSelected ||\n !obs.targetCaseDefinitionKeySelected ||\n !obs.targetCaseDefinitionVersionTagSelected\n \"\n >\n {{ 'caseMigration.migrate' | translate }}\n <svg class=\"cds--btn__icon\" cdsIcon=\"watsonHealthStackedMove\" size=\"16\"></svg>\n </button>\n </ng-container>\n\n <valtimo-confirmation-modal\n [showModalSubject$]=\"obs.showConfirmationModal\"\n (confirmEvent)=\"migrate()\"\n (cancelEvent)=\"showConfirmationModal$.next(false)\"\n cancelButtonType=\"ghost\"\n confirmButtonTextTranslationKey=\"caseMigration.modalTitle\"\n titleTranslationKey=\"caseMigration.modalTitle\"\n contentTranslationKey=\"caseMigration.modalContent\"\n ></valtimo-confirmation-modal>\n</ng-container>\n","/*\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {NgModule} from '@angular/core';\nimport {RouterModule, Routes} from '@angular/router';\nimport {CommonModule} from '@angular/common';\nimport {AuthGuardService} from '@valtimo/security';\nimport {ROLE_ADMIN} from '@valtimo/shared';\nimport {CaseMigrationComponent} from './components/case-migration-component/case-migration.component';\n\nconst routes: Routes = [\n {\n path: 'case-migration',\n component: CaseMigrationComponent,\n canActivate: [AuthGuardService],\n data: {title: 'Case migration', roles: [ROLE_ADMIN]},\n },\n];\n\n@NgModule({\n imports: [CommonModule, RouterModule.forChild(routes)],\n exports: [RouterModule],\n})\nexport class CaseMigrationRoutingModule {}\n","/*\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {NgModule} from '@angular/core';\nimport {CaseMigrationRoutingModule} from './case-migration-routing.module';\nimport {CommonModule} from '@angular/common';\nimport {FormsModule, ReactiveFormsModule} from '@angular/forms';\nimport {\n CarbonMultiInputModule,\n ConfirmationModalModule,\n RenderInPageHeaderDirective,\n TooltipIconModule,\n WidgetModule,\n} from '@valtimo/components';\nimport {TranslateModule} from '@ngx-translate/core';\nimport {CaseMigrationComponent} from './components/case-migration-component/case-migration.component';\nimport {\n ButtonModule,\n DropdownModule,\n IconModule,\n InputModule,\n NotificationModule,\n} from 'carbon-components-angular';\n\n@NgModule({\n declarations: [CaseMigrationComponent],\n imports: [\n CommonModule,\n CaseMigrationRoutingModule,\n ReactiveFormsModule,\n WidgetModule,\n FormsModule,\n TranslateModule,\n DropdownModule,\n RenderInPageHeaderDirective,\n InputModule,\n TooltipIconModule,\n ButtonModule,\n IconModule,\n CarbonMultiInputModule,\n ConfirmationModalModule,\n NotificationModule,\n ],\n})\nexport class CaseMigrationModule {}\n","/*\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*\n * Public API Surface of case-migration\n */\n\nexport * from './lib/models';\nexport * from './lib/services';\nexport * from './lib/case-migration.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1","i2.CaseMigrationService","i4"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;AAcG;;ACdH;;;;;;;;;;;;;;AAcG;;ACdH;;;;;;;;;;;;;;AAcG;MAWU,oBAAoB,CAAA;IAG/B,WAAA,CACU,IAAgB,EACxB,aAA4B,EAAA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CAAA,EAAA,OAAA,EAAA,CAEnC,YAAY;YACZ,0BAA0B;YAC1B,mBAAmB;YACnB,YAAY;YACZ,WAAW;YACX,eAAe;YACf,cAAc;YACd,2BAA2B;YAC3B,WAAW;YACX,iBAAiB;YACjB,YAAY;YACZ,UAAU;YACV,sBAAsB;YACtB,uBAAuB;YACvB,kBAAkB,CAAA,EAAA,CAAA,CAAA;AAGT,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,YAjB5B,YAAY;YACZ,0BAA0B;YAC1B,mBAAmB;YACnB,YAAY;YACZ,WAAW;YACX,eAAe;YACf,cAAc;YAEd,WAAW;YACX,iBAAiB;YACjB,YAAY;YACZ,UAAU;YACV,sBAAsB;YACtB,uBAAuB;YACvB,kBAAkB,CAAA,EAAA,CAAA,CAAA;;4FAGT,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBApB/B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,sBAAsB,CAAC;AACtC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,0BAA0B;wBAC1B,mBAAmB;wBACnB,YAAY;wBACZ,WAAW;wBACX,eAAe;wBACf,cAAc;wBACd,2BAA2B;wBAC3B,WAAW;wBACX,iBAAiB;wBACjB,YAAY;wBACZ,UAAU;wBACV,sBAAsB;wBACtB,uBAAuB;wBACvB,kBAAkB;AACnB,qBAAA;AACF,iBAAA;;;ACxDD;;;;;;;;;;;;;;AAcG;AAEH;;AAEG;;AClBH;;AAEG;;;;"}
@@ -1,3 +1,4 @@
1
+ import { OnDestroy, OnInit } from '@angular/core';
1
2
  import { CaseDefinition, DocumentService } from '@valtimo/document';
2
3
  import { MultiInputValues } from '@valtimo/components';
3
4
  import { BehaviorSubject, Observable } from 'rxjs';
@@ -8,7 +9,7 @@ import { IconService } from 'carbon-components-angular';
8
9
  import { GlobalNotificationService } from '@valtimo/shared';
9
10
  import { TranslateService } from '@ngx-translate/core';
10
11
  import * as i0 from "@angular/core";
11
- export declare class CaseMigrationComponent {
12
+ export declare class CaseMigrationComponent implements OnInit, OnDestroy {
12
13
  private readonly documentService;
13
14
  private readonly caseMigrationService;
14
15
  private readonly iconService;
@@ -21,6 +22,7 @@ export declare class CaseMigrationComponent {
21
22
  readonly patchItems$: BehaviorSubject<MultiInputValues>;
22
23
  readonly errors$: BehaviorSubject<string[]>;
23
24
  readonly showConfirmationModal$: BehaviorSubject<boolean>;
25
+ private readonly _subscriptions;
24
26
  constructor(documentService: DocumentService, caseMigrationService: CaseMigrationService, iconService: IconService, globalNotificationService: GlobalNotificationService, translateService: TranslateService);
25
27
  readonly caseDefinitions$: Observable<Array<CaseDefinition>>;
26
28
  readonly sourceCaseDefinitionKeyItems$: Observable<LoadedValue<Array<ListItem>>>;
@@ -28,9 +30,19 @@ export declare class CaseMigrationComponent {
28
30
  readonly targetCaseDefinitionKeyItems$: Observable<LoadedValue<Array<ListItem>>>;
29
31
  readonly targetCaseDefinitionVersionTagItems$: Observable<Array<ListItem>>;
30
32
  readonly patches$: Observable<Array<DocumentMigrationPatch>>;
33
+ ngOnInit(): void;
34
+ ngOnDestroy(): void;
31
35
  mappingValueChange(patches: MultiInputValues): void;
32
36
  checkPatches(): void;
33
37
  migrate(): void;
38
+ /**
39
+ * Compares tags rather than list position, so the latest version is found regardless of the order
40
+ * the backend returns the versions of a key in.
41
+ */
42
+ private latestVersionTagOf;
43
+ private getAllCaseDefinitions;
44
+ private getCaseDefinitionPage;
45
+ private toCaseDefinitionKeyItems;
34
46
  protected readonly CARBON_THEME = "g10";
35
47
  static ɵfac: i0.ɵɵFactoryDeclaration<CaseMigrationComponent, never>;
36
48
  static ɵcmp: i0.ɵɵComponentDeclaration<CaseMigrationComponent, "valtimo-case-migration", never, {}, {}, never, never, false, never>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@valtimo/case-migration",
3
3
  "license": "EUPL-1.2",
4
- "version": "13.44.0",
4
+ "version": "13.45.1",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "19.2.25",
7
7
  "@angular/core": "19.2.25"