@valtimo/case-management 13.43.0 → 13.45.0

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.
@@ -9,7 +9,7 @@ import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
9
9
  import * as i3 from '@ngx-translate/core';
10
10
  import { TranslateModule } from '@ngx-translate/core';
11
11
  import * as i7 from '@valtimo/components';
12
- import { WidgetLayout, runAfterCarbonModalClosed, ViewType, CARBON_CONSTANTS, ValuePathSelectorPrefix, SelectModule, MuuriItemComponent, WIDGET_LAYOUT_VALUES, WIDGET_LAYOUT_TRANSLATION_KEYS, ValtimoCdsModalDirective, WidgetLayoutInfoComponent, RenderInPageHeaderDirective, TooltipModule, CarbonListModule, ConfirmationModalModule, WidgetModule, DropzoneModule, ModalModule as ModalModule$1, MultiselectDropdownModule, ParagraphModule, SpinnerModule, InputModule as InputModule$1, FormModule, TooltipIconModule, CarbonMultiInputModule, TableModule, OverflowMenuComponent, OverflowMenuOptionComponent, EditorModule, ValuePathSelectorComponent, EllipsisPipe, MuuriDirectiveModule, ReadOnlyDirective, JsonEditorComponent, AutoKeyInputComponent } from '@valtimo/components';
12
+ import { WidgetLayout, runAfterCarbonModalClosed, ViewType, CARBON_CONSTANTS, ValuePathSelectorPrefix, SelectModule, MuuriItemComponent, WIDGET_LAYOUT_VALUES, WIDGET_LAYOUT_TRANSLATION_KEYS, ValtimoCdsModalDirective, WidgetLayoutInfoComponent, RenderInPageHeaderDirective, TooltipModule, CarbonListModule, ConfirmationModalModule, pendingChangesGuard, WidgetModule, DropzoneModule, ModalModule as ModalModule$1, MultiselectDropdownModule, ParagraphModule, SpinnerModule, InputModule as InputModule$1, FormModule, TooltipIconModule, CarbonMultiInputModule, TableModule, OverflowMenuComponent, OverflowMenuOptionComponent, EditorModule, ValuePathSelectorComponent, EllipsisPipe, MuuriDirectiveModule, ReadOnlyDirective, JsonEditorComponent, AutoKeyInputComponent } from '@valtimo/components';
13
13
  import { FormManagementComponent, FormManagementEditComponent } from '@valtimo/form-management';
14
14
  import * as i2$1 from '@valtimo/shared';
15
15
  import { BaseApiService, InterceptorSkip, getCaseManagementRouteParams, InterceptorSkipHeader, CASE_MANAGEMENT_TAB_TOKEN, TagColor, getDisplayTypeParametersView, CASE_CONFIGURATION_EXTENSIONS_TOKEN, ROLE_ADMIN, ConfigModule } from '@valtimo/shared';
@@ -423,7 +423,10 @@ class CaseManagementService extends BaseApiService {
423
423
  return this.httpClient.post(this.getApiUrl(`management/v1/case-definition/${caseDefinitionKey}/version/${caseDefinitionVersionTag}/active`), {});
424
424
  }
425
425
  getAllCaseVersions(params) {
426
- return this.httpClient.get(this.getApiUrl(`management/v1/case-definition`), { params });
426
+ return this.httpClient.get(this.getApiUrl(`management/v1/case-definition`),
427
+ // Without an explicit sort the endpoint orders on name first, which scatters the versions
428
+ // of a key whenever one of them was renamed.
429
+ { params: { sort: 'id.versionTag,desc', ...params, allVersions: true } });
427
430
  }
428
431
  finalizeDraftCaseVersion(caseDefinitionKey, caseDefinitionVersionTag) {
429
432
  return this.httpClient.post(this.getApiUrl(`management/v1/case-definition/${caseDefinitionKey}/version/${caseDefinitionVersionTag}/finalize`), {});
@@ -3838,31 +3841,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
3838
3841
  * See the License for the specific language governing permissions and
3839
3842
  * limitations under the License.
3840
3843
  */
3844
+ const DEFAULT_PAGE_SIZE = 10;
3841
3845
  class CaseManagementSelectVersionModalComponent {
3842
3846
  set caseDefinitionKey(value) {
3843
- this.caseDefinitionKey$.next(value);
3847
+ this._query$.next({ ...this._query$.value, caseDefinitionKey: value, page: 0 });
3844
3848
  }
3845
3849
  set caseDefinitionTitle(value) {
3846
3850
  this.caseDefinitionTitle$.next(value);
3847
3851
  }
3848
- constructor(route, router, caseManagementService) {
3849
- this.route = route;
3850
- this.router = router;
3852
+ constructor(caseManagementService) {
3851
3853
  this.caseManagementService = caseManagementService;
3852
3854
  this.open = false;
3853
3855
  this.previousSelectedVersion = '';
3854
- this.caseDefinitionKey$ = new BehaviorSubject('');
3855
3856
  this.caseDefinitionTitle$ = new BehaviorSubject('');
3856
3857
  this.closeEvent = new EventEmitter();
3857
3858
  this.selectedVersion = new EventEmitter();
3858
3859
  this._paginationInitialized = false;
3859
- this.pagination = {
3860
- collectionSize: 0,
3861
- page: 1,
3862
- size: 10,
3863
- };
3860
+ // Key, page and size live in one subject so a change to any of them fires a single request.
3861
+ this._query$ = new BehaviorSubject({
3862
+ caseDefinitionKey: '',
3863
+ page: 0,
3864
+ size: DEFAULT_PAGE_SIZE,
3865
+ });
3864
3866
  this.pagination$ = new BehaviorSubject(null);
3865
- this.versionItems$ = this.caseDefinitionKey$.pipe(switchMap(key => this.caseManagementService.getAllCaseVersions({ caseDefinitionKey: key })), map$1((page) => {
3867
+ this.versionItems$ = this._query$.pipe(filter$1(({ caseDefinitionKey }) => !!caseDefinitionKey), switchMap(query => this.caseManagementService.getAllCaseVersions(query)), map$1((page) => {
3866
3868
  this.pagination$.next({
3867
3869
  size: page.size,
3868
3870
  page: page.number + 1,
@@ -3879,7 +3881,6 @@ class CaseManagementSelectVersionModalComponent {
3879
3881
  },
3880
3882
  ],
3881
3883
  }));
3882
- return page.content;
3883
3884
  }));
3884
3885
  this.FIELDS = [
3885
3886
  {
@@ -3900,22 +3901,14 @@ class CaseManagementSelectVersionModalComponent {
3900
3901
  ];
3901
3902
  }
3902
3903
  paginationClicked(page) {
3903
- this.router.navigate([], {
3904
- relativeTo: this.route,
3905
- queryParams: { page: page - 1 },
3906
- queryParamsHandling: 'merge',
3907
- });
3904
+ this._query$.next({ ...this._query$.value, page: page - 1 });
3908
3905
  }
3909
3906
  paginationSet(size) {
3910
3907
  if (!this._paginationInitialized) {
3911
3908
  this._paginationInitialized = true;
3912
3909
  return;
3913
3910
  }
3914
- this.router.navigate([], {
3915
- relativeTo: this.route,
3916
- queryParams: { size },
3917
- queryParamsHandling: 'merge',
3918
- });
3911
+ this._query$.next({ ...this._query$.value, page: 0, size: +size });
3919
3912
  }
3920
3913
  selectActiveVersion(event) {
3921
3914
  this.emitSelectedVersion(event?.caseDefinitionVersionTag);
@@ -3927,13 +3920,13 @@ class CaseManagementSelectVersionModalComponent {
3927
3920
  this.selectedVersion.emit(caseDefinitionVersionTag);
3928
3921
  this.closeEvent.emit();
3929
3922
  }
3930
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: CaseManagementSelectVersionModalComponent, deps: [{ token: i2$2.ActivatedRoute }, { token: i2$2.Router }, { token: CaseManagementService }], target: i0.ɵɵFactoryTarget.Component }); }
3923
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: CaseManagementSelectVersionModalComponent, deps: [{ token: CaseManagementService }], target: i0.ɵɵFactoryTarget.Component }); }
3931
3924
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.25", type: CaseManagementSelectVersionModalComponent, isStandalone: false, selector: "valtimo-case-management-select-version-modal", inputs: { open: "open", previousSelectedVersion: "previousSelectedVersion", caseDefinitionKey: "caseDefinitionKey", caseDefinitionTitle: "caseDefinitionTitle" }, outputs: { closeEvent: "closeEvent", selectedVersion: "selectedVersion" }, 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<cds-modal valtimoCdsModal showFooter=\"true\" [open]=\"open\" (close)=\"onCloseModal()\">\n <cds-modal-header [showCloseButton]=\"true\" (closeSelect)=\"onCloseModal()\">\n <h3 cdsModalHeaderHeading>\n {{\n 'caseManagement.allVersionsModal.title'\n | translate: {value: (caseDefinitionTitle$ | async) ?? ''}\n }}\n </h3>\n </cds-modal-header>\n\n <section cdsModalContent>\n <valtimo-carbon-list\n [hideToolbar]=\"true\"\n [items]=\"versionItems$ | async\"\n [fields]=\"FIELDS\"\n (rowClicked)=\"selectActiveVersion($event)\"\n [pagination]=\"pagination$ | async\"\n paginationIdentifier=\"caseManagementList\"\n (paginationClicked)=\"paginationClicked($event)\"\n (paginationSet)=\"paginationSet($event)\"\n cdsLayer=\"1\"\n >\n <valtimo-no-results\n [title]=\"'caseManagement.allVersionsModal.noResults.description' | translate\"\n [description]=\"'caseManagement.allVersionsModal.noResults.title' | translate\"\n ></valtimo-no-results>\n </valtimo-carbon-list>\n </section>\n\n <cds-modal-footer>\n <button cdsButton=\"ghost\" (click)=\"onCloseModal()\">\n {{ 'caseManagement.allVersionsModal.closeButton' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", styles: ["::ng-deep .cds--modal-footer{justify-content:flex-start!important}\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"], dependencies: [{ kind: "directive", type: i2.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "component", type: i2.Modal, selector: "cds-modal, ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i2.ModalHeader, selector: "cds-modal-header, ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "component", type: i2.ModalFooter, selector: "cds-modal-footer, ibm-modal-footer" }, { kind: "directive", type: i2.ModalContent, selector: "[cdsModalContent], [ibmModalContent]", inputs: ["hasForm"] }, { kind: "directive", type: i2.ModalHeaderHeading, selector: "[cdsModalHeaderHeading], [ibmModalHeaderHeading]" }, { kind: "directive", type: i7.ValtimoCdsModalDirective, selector: "[valtimoCdsModal]", inputs: ["minContentHeight"] }, { kind: "component", type: i7.CarbonListComponent, selector: "valtimo-carbon-list", inputs: ["items", "fields", "tableTranslations", "paginatorConfig", "pagination", "loading", "skeletonRowCount", "actions", "actionItems", "showActionItems", "header", "hideColumnHeader", "initialSortState", "sortState", "isSearchable", "initialSearchValue", "searchDebounceMs", "invalidSearchFields", "searchFields", "enableSingleSelection", "lastColumnTemplate", "paginationIdentifier", "showSelectionColumn", "striped", "hideToolbar", "lockedTooltipTranslationKey", "movingRowsEnabled", "dragAndDrop", "dragAndDropDisabled", "expandedRowTemplate", "expandedRowKey", "trackByKey"], outputs: ["rowClicked", "paginationClicked", "paginationSet", "search", "sortChanged", "moveRow", "itemsReordered"] }, { kind: "component", type: i7.CarbonNoResultsComponent, selector: "valtimo-no-results", inputs: ["action", "description", "illustration", "title", "smallPadding", "collapseVertically", "alwaysRenderVertically"] }, { kind: "directive", type: i2.LayerDirective, selector: "[cdsLayer], [ibmLayer]", inputs: ["ibmLayer", "cdsLayer"], exportAs: ["layer"] }, { kind: "pipe", type: i5.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }] }); }
3932
3925
  }
3933
3926
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: CaseManagementSelectVersionModalComponent, decorators: [{
3934
3927
  type: Component,
3935
3928
  args: [{ standalone: false, selector: 'valtimo-case-management-select-version-modal', 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<cds-modal valtimoCdsModal showFooter=\"true\" [open]=\"open\" (close)=\"onCloseModal()\">\n <cds-modal-header [showCloseButton]=\"true\" (closeSelect)=\"onCloseModal()\">\n <h3 cdsModalHeaderHeading>\n {{\n 'caseManagement.allVersionsModal.title'\n | translate: {value: (caseDefinitionTitle$ | async) ?? ''}\n }}\n </h3>\n </cds-modal-header>\n\n <section cdsModalContent>\n <valtimo-carbon-list\n [hideToolbar]=\"true\"\n [items]=\"versionItems$ | async\"\n [fields]=\"FIELDS\"\n (rowClicked)=\"selectActiveVersion($event)\"\n [pagination]=\"pagination$ | async\"\n paginationIdentifier=\"caseManagementList\"\n (paginationClicked)=\"paginationClicked($event)\"\n (paginationSet)=\"paginationSet($event)\"\n cdsLayer=\"1\"\n >\n <valtimo-no-results\n [title]=\"'caseManagement.allVersionsModal.noResults.description' | translate\"\n [description]=\"'caseManagement.allVersionsModal.noResults.title' | translate\"\n ></valtimo-no-results>\n </valtimo-carbon-list>\n </section>\n\n <cds-modal-footer>\n <button cdsButton=\"ghost\" (click)=\"onCloseModal()\">\n {{ 'caseManagement.allVersionsModal.closeButton' | translate }}\n </button>\n </cds-modal-footer>\n</cds-modal>\n", styles: ["::ng-deep .cds--modal-footer{justify-content:flex-start!important}\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"] }]
3936
- }], ctorParameters: () => [{ type: i2$2.ActivatedRoute }, { type: i2$2.Router }, { type: CaseManagementService }], propDecorators: { open: [{
3929
+ }], ctorParameters: () => [{ type: CaseManagementService }], propDecorators: { open: [{
3937
3930
  type: Input
3938
3931
  }], previousSelectedVersion: [{
3939
3932
  type: Input
@@ -6550,6 +6543,14 @@ const routes = [
6550
6543
  path: `case-management/case/:caseDefinitionKey/version/:caseDefinitionVersionTag/${TabEnum.FORM_FLOWS}/:formFlowDefinitionKey`,
6551
6544
  component: FormFlowEditorComponent,
6552
6545
  canActivate: [AuthGuardService],
6546
+ canDeactivate: [pendingChangesGuard],
6547
+ data: { title: 'Form flow details', roles: [ROLE_ADMIN], customPageTitle: true },
6548
+ },
6549
+ {
6550
+ path: `case-management/case/:caseDefinitionKey/version/:caseDefinitionVersionTag/${TabEnum.FORM_FLOWS}/:formFlowDefinitionKey/editor`,
6551
+ component: FormFlowEditorComponent,
6552
+ canActivate: [AuthGuardService],
6553
+ canDeactivate: [pendingChangesGuard],
6553
6554
  data: { title: 'Form flow details', roles: [ROLE_ADMIN], customPageTitle: true },
6554
6555
  },
6555
6556
  ];