@valtimo/task 12.5.1 → 12.7.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.
- package/esm2022/lib/components/assign-user-to-task/assign-user-to-task.component.mjs +3 -3
- package/esm2022/lib/components/task-detail-content/task-detail-content.component.mjs +145 -73
- package/esm2022/lib/components/task-detail-intermediate-save/task-detail-intermediate-save.component.mjs +29 -5
- package/esm2022/lib/components/task-detail-modal/task-detail-modal.component.mjs +18 -3
- package/esm2022/lib/models/task.model.mjs +1 -1
- package/esm2022/lib/services/task-intermediate-save.service.mjs +6 -4
- package/esm2022/lib/services/task.service.mjs +1 -1
- package/esm2022/lib/task.module.mjs +2 -2
- package/fesm2022/valtimo-task.mjs +196 -83
- package/fesm2022/valtimo-task.mjs.map +1 -1
- package/lib/components/task-detail-content/task-detail-content.component.d.ts +22 -11
- package/lib/components/task-detail-content/task-detail-content.component.d.ts.map +1 -1
- package/lib/components/task-detail-intermediate-save/task-detail-intermediate-save.component.d.ts +4 -1
- package/lib/components/task-detail-intermediate-save/task-detail-intermediate-save.component.d.ts.map +1 -1
- package/lib/components/task-detail-modal/task-detail-modal.component.d.ts +6 -1
- package/lib/components/task-detail-modal/task-detail-modal.component.d.ts.map +1 -1
- package/lib/models/task.model.d.ts +1 -17
- package/lib/models/task.model.d.ts.map +1 -1
- package/lib/services/task-intermediate-save.service.d.ts +1 -1
- package/lib/services/task-intermediate-save.service.d.ts.map +1 -1
- package/lib/services/task.service.d.ts +2 -1
- package/lib/services/task.service.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { Injectable, EventEmitter, Component, Input, Output, ViewContainerRef, ChangeDetectionStrategy, Optional, Inject, ViewChild, signal, ViewEncapsulation, HostListener, NgModule } from '@angular/core';
|
|
3
3
|
import * as i9 from '@valtimo/components';
|
|
4
4
|
import { ViewType, SearchableDropdownSelectModule, FormioOptionsImpl, FormIoModule, ConfirmationModalModule, TooltipModule, CarbonListModule, PageHeaderModule, WidgetModule, SpinnerModule, CamundaFormModule, RenderInPageHeaderDirectiveModule, SearchFieldsModule } from '@valtimo/components';
|
|
5
|
-
import { BehaviorSubject, combineLatest, tap, filter, switchMap, of, map as map$1, Subscription, take as take$1, distinctUntilChanged, Subject } from 'rxjs';
|
|
5
|
+
import { BehaviorSubject, combineLatest, tap, filter, switchMap, of, map as map$1, catchError, Subscription, take as take$1, distinctUntilChanged, Subject } from 'rxjs';
|
|
6
6
|
import * as i6 from '@angular/common';
|
|
7
7
|
import { CommonModule } from '@angular/common';
|
|
8
8
|
import * as i3 from '@ngx-translate/core';
|
|
@@ -18,7 +18,7 @@ import * as i1$2 from '@angular/router';
|
|
|
18
18
|
import { RouterModule } from '@angular/router';
|
|
19
19
|
import { RecentlyViewed16 } from '@carbon/icons';
|
|
20
20
|
import * as i7 from '@valtimo/process-link';
|
|
21
|
-
import { ProcessLinkModule, formSizeToCarbonModalSizeMap } from '@valtimo/process-link';
|
|
21
|
+
import { FORM_CUSTOM_COMPONENT_TOKEN, ProcessLinkModule, formSizeToCarbonModalSizeMap } from '@valtimo/process-link';
|
|
22
22
|
import * as i2 from '@valtimo/document';
|
|
23
23
|
import * as i12 from 'carbon-components-angular';
|
|
24
24
|
import { ButtonModule, IconModule, ModalModule, LinkModule, TabsModule, ContentSwitcherModule, DropdownModule, TooltipModule as TooltipModule$1 } from 'carbon-components-angular';
|
|
@@ -713,12 +713,14 @@ class TaskIntermediateSaveService extends BaseApiService {
|
|
|
713
713
|
this._formIoFormData$ = new BehaviorSubject({});
|
|
714
714
|
}
|
|
715
715
|
getIntermediateSubmission(taskInstanceId) {
|
|
716
|
-
return this.httpClient
|
|
716
|
+
return this.httpClient
|
|
717
|
+
.get(this.getApiUrl('/v1/form/intermediate/submission'), {
|
|
717
718
|
params: {
|
|
718
719
|
taskInstanceId,
|
|
719
720
|
},
|
|
720
721
|
headers: new HttpHeaders().set(InterceptorSkip, '404'),
|
|
721
|
-
})
|
|
722
|
+
})
|
|
723
|
+
.pipe(catchError(() => of(null)));
|
|
722
724
|
}
|
|
723
725
|
storeIntermediateSubmission(request) {
|
|
724
726
|
return this.httpClient.post(this.getApiUrl('/v1/form/intermediate/submission'), request, {
|
|
@@ -864,11 +866,11 @@ class AssignUserToTaskComponent {
|
|
|
864
866
|
this.disabled$.next(true);
|
|
865
867
|
}
|
|
866
868
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AssignUserToTaskComponent, deps: [{ token: TaskService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
867
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: AssignUserToTaskComponent, isStandalone: true, selector: "valtimo-assign-user-to-task", inputs: { taskId: "taskId", assigneeId: "assigneeId" }, outputs: { assignmentOfTaskChanged: "assignmentOfTaskChanged" }, usesOnChanges: true, ngImport: i0, template: "<!--\n ~ Copyright 2015-2024 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 *ngIf=\"{\n candidateUsers: candidateUsersForTask$ | async,\n disabled: disabled$ | async,\n idOnServer: assignedIdOnServer$ | async,\n } as obs\"\n>\n <div class=\"container-fluid\">\n <div class=\"mt-2 mb-2\">\n <div class=\"col-12 pl-0 d-flex flex-row align-items-center\">\n <valtimo-searchable-dropdown-select\n *ngIf=\"obs.candidateUsers; else loading\"\n [style]=\"'underlinedText'\"\n [items]=\"mapUsersForDropdown(obs.candidateUsers)\"\n [buttonText]=\"'assignTask.header' | translate\"\n [searchText]=\"'interface.typeToSearch' | translate\"\n [noResultsText]=\"'interface.noSearchResults' | translate\"\n [disabled]=\"obs.disabled\"\n [selectedText]=\"'assignTask.assignedTo' | translate\"\n [selectedTextValue]=\"assignedUserFullName$ | async\"\n [clearSelectionButtonTitle]=\"'assignTask.remove' | translate\"\n [hasSelection]=\"userIdToAssign === obs.idOnServer && obs.idOnServer !== null\"\n [width]=\"250\"\n (itemSelected)=\"assignTask($event)\"\n (clearSelection)=\"unassignTask()\"\n >\n </valtimo-searchable-dropdown-select>\n </div>\n </div>\n </div>\n</ng-container>\n\n<ng-template #loading>\n <h5>\n <b>{{ 'assignTask.fetchingUsers' | translate }}</b>\n </h5>\n</ng-template>\n", styles: [".container-fluid{color:#959595}i{font-size:13px}\n/*!\n * Copyright 2015-2024 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: "ngmodule", type: CommonModule }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i6.AsyncPipe, name: "async" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: SearchableDropdownSelectModule }, { kind: "component", type: i9.SearchableDropdownSelectComponent, selector: "valtimo-searchable-dropdown-select", inputs: ["style", "items", "buttonText", "searchText", "noResultsText", "disabled", "selectedText", "selectedTextValue", "clearSelectionButtonTitle", "hasSelection", "width", "hasPermission", "showClearSelection"], outputs: ["itemSelected", "clearSelection"] }] }); }
|
|
869
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: AssignUserToTaskComponent, isStandalone: true, selector: "valtimo-assign-user-to-task", inputs: { taskId: "taskId", assigneeId: "assigneeId" }, outputs: { assignmentOfTaskChanged: "assignmentOfTaskChanged" }, usesOnChanges: true, ngImport: i0, template: "<!--\n ~ Copyright 2015-2024 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 *ngIf=\"{\n candidateUsers: candidateUsersForTask$ | async,\n disabled: disabled$ | async,\n idOnServer: assignedIdOnServer$ | async,\n } as obs\"\n>\n <div class=\"container-fluid\">\n <div class=\"mt-2 mb-2\">\n <div class=\"col-12 pl-0 d-flex flex-row align-items-center\">\n <valtimo-searchable-dropdown-select\n *ngIf=\"obs.candidateUsers; else loading\"\n [style]=\"'underlinedText'\"\n [items]=\"mapUsersForDropdown(obs.candidateUsers)\"\n [buttonText]=\"'assignTask.header' | translate\"\n [searchText]=\"'interface.typeToSearch' | translate\"\n [noResultsText]=\"'interface.noSearchResults' | translate\"\n [disabled]=\"obs.disabled\"\n [selectedText]=\"'assignTask.assignedTo' | translate\"\n [selectedTextValue]=\"assignedUserFullName$ | async\"\n [clearSelectionButtonTitle]=\"'assignTask.remove' | translate\"\n [hasSelection]=\"userIdToAssign === obs.idOnServer && obs.idOnServer !== null\"\n [width]=\"250\"\n (itemSelected)=\"assignTask($event)\"\n (clearSelection)=\"unassignTask()\"\n >\n </valtimo-searchable-dropdown-select>\n </div>\n </div>\n </div>\n</ng-container>\n\n<ng-template #loading>\n <h5>\n <b>{{ 'assignTask.fetchingUsers' | translate }}</b>\n </h5>\n</ng-template>\n", styles: [".container-fluid{color:#959595;padding:0;margin:0}i{font-size:13px}\n/*!\n * Copyright 2015-2024 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: "ngmodule", type: CommonModule }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i6.AsyncPipe, name: "async" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: SearchableDropdownSelectModule }, { kind: "component", type: i9.SearchableDropdownSelectComponent, selector: "valtimo-searchable-dropdown-select", inputs: ["style", "items", "buttonText", "searchText", "noResultsText", "disabled", "selectedText", "selectedTextValue", "clearSelectionButtonTitle", "hasSelection", "width", "hasPermission", "showClearSelection"], outputs: ["itemSelected", "clearSelection"] }] }); }
|
|
868
870
|
}
|
|
869
871
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AssignUserToTaskComponent, decorators: [{
|
|
870
872
|
type: Component,
|
|
871
|
-
args: [{ selector: 'valtimo-assign-user-to-task', standalone: true, imports: [CommonModule, TranslateModule, SearchableDropdownSelectModule], template: "<!--\n ~ Copyright 2015-2024 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 *ngIf=\"{\n candidateUsers: candidateUsersForTask$ | async,\n disabled: disabled$ | async,\n idOnServer: assignedIdOnServer$ | async,\n } as obs\"\n>\n <div class=\"container-fluid\">\n <div class=\"mt-2 mb-2\">\n <div class=\"col-12 pl-0 d-flex flex-row align-items-center\">\n <valtimo-searchable-dropdown-select\n *ngIf=\"obs.candidateUsers; else loading\"\n [style]=\"'underlinedText'\"\n [items]=\"mapUsersForDropdown(obs.candidateUsers)\"\n [buttonText]=\"'assignTask.header' | translate\"\n [searchText]=\"'interface.typeToSearch' | translate\"\n [noResultsText]=\"'interface.noSearchResults' | translate\"\n [disabled]=\"obs.disabled\"\n [selectedText]=\"'assignTask.assignedTo' | translate\"\n [selectedTextValue]=\"assignedUserFullName$ | async\"\n [clearSelectionButtonTitle]=\"'assignTask.remove' | translate\"\n [hasSelection]=\"userIdToAssign === obs.idOnServer && obs.idOnServer !== null\"\n [width]=\"250\"\n (itemSelected)=\"assignTask($event)\"\n (clearSelection)=\"unassignTask()\"\n >\n </valtimo-searchable-dropdown-select>\n </div>\n </div>\n </div>\n</ng-container>\n\n<ng-template #loading>\n <h5>\n <b>{{ 'assignTask.fetchingUsers' | translate }}</b>\n </h5>\n</ng-template>\n", styles: [".container-fluid{color:#959595}i{font-size:13px}\n/*!\n * Copyright 2015-2024 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"] }]
|
|
873
|
+
args: [{ selector: 'valtimo-assign-user-to-task', standalone: true, imports: [CommonModule, TranslateModule, SearchableDropdownSelectModule], template: "<!--\n ~ Copyright 2015-2024 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 *ngIf=\"{\n candidateUsers: candidateUsersForTask$ | async,\n disabled: disabled$ | async,\n idOnServer: assignedIdOnServer$ | async,\n } as obs\"\n>\n <div class=\"container-fluid\">\n <div class=\"mt-2 mb-2\">\n <div class=\"col-12 pl-0 d-flex flex-row align-items-center\">\n <valtimo-searchable-dropdown-select\n *ngIf=\"obs.candidateUsers; else loading\"\n [style]=\"'underlinedText'\"\n [items]=\"mapUsersForDropdown(obs.candidateUsers)\"\n [buttonText]=\"'assignTask.header' | translate\"\n [searchText]=\"'interface.typeToSearch' | translate\"\n [noResultsText]=\"'interface.noSearchResults' | translate\"\n [disabled]=\"obs.disabled\"\n [selectedText]=\"'assignTask.assignedTo' | translate\"\n [selectedTextValue]=\"assignedUserFullName$ | async\"\n [clearSelectionButtonTitle]=\"'assignTask.remove' | translate\"\n [hasSelection]=\"userIdToAssign === obs.idOnServer && obs.idOnServer !== null\"\n [width]=\"250\"\n (itemSelected)=\"assignTask($event)\"\n (clearSelection)=\"unassignTask()\"\n >\n </valtimo-searchable-dropdown-select>\n </div>\n </div>\n </div>\n</ng-container>\n\n<ng-template #loading>\n <h5>\n <b>{{ 'assignTask.fetchingUsers' | translate }}</b>\n </h5>\n</ng-template>\n", styles: [".container-fluid{color:#959595;padding:0;margin:0}i{font-size:13px}\n/*!\n * Copyright 2015-2024 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"] }]
|
|
872
874
|
}], ctorParameters: () => [{ type: TaskService }], propDecorators: { taskId: [{
|
|
873
875
|
type: Input
|
|
874
876
|
}], assigneeId: [{
|
|
@@ -936,7 +938,20 @@ class TaskDetailContentComponent {
|
|
|
936
938
|
return;
|
|
937
939
|
this.loadTaskDetails(value);
|
|
938
940
|
}
|
|
939
|
-
|
|
941
|
+
set taskAndProcessLink(value) {
|
|
942
|
+
if (!value)
|
|
943
|
+
return;
|
|
944
|
+
this.loadTaskDetails(value.task, value.processLinkActivityResult);
|
|
945
|
+
}
|
|
946
|
+
set modalClosed(_) {
|
|
947
|
+
// save form flow data on modal closed
|
|
948
|
+
if (this.formFlow)
|
|
949
|
+
this.formFlow.saveData();
|
|
950
|
+
}
|
|
951
|
+
get viewInitialized$() {
|
|
952
|
+
return this._viewInitialized$.pipe(filter(initialized => initialized));
|
|
953
|
+
}
|
|
954
|
+
constructor(configService, documentService, iconService, logger, modalService, permissionService, processLinkService, router, stateService, taskIntermediateSaveService, taskService, toastr, translateService, formViewModel, formCustomComponentConfig, urlResolverService) {
|
|
940
955
|
this.configService = configService;
|
|
941
956
|
this.documentService = documentService;
|
|
942
957
|
this.iconService = iconService;
|
|
@@ -951,6 +966,7 @@ class TaskDetailContentComponent {
|
|
|
951
966
|
this.toastr = toastr;
|
|
952
967
|
this.translateService = translateService;
|
|
953
968
|
this.formViewModel = formViewModel;
|
|
969
|
+
this.formCustomComponentConfig = formCustomComponentConfig;
|
|
954
970
|
this.urlResolverService = urlResolverService;
|
|
955
971
|
this.closeModalEvent = new EventEmitter();
|
|
956
972
|
this.formSubmit = new EventEmitter();
|
|
@@ -973,13 +989,17 @@ class TaskDetailContentComponent {
|
|
|
973
989
|
this.processLinkIsForm$ = this._taskProcessLinkType$.pipe(map$1((type) => type === 'form'));
|
|
974
990
|
this.processLinkIsFormViewModel$ = this._taskProcessLinkType$.pipe(map$1((type) => type === 'form-view-model'));
|
|
975
991
|
this.processLinkIsFormFlow$ = this._taskProcessLinkType$.pipe(map$1((type) => type === 'form-flow'));
|
|
992
|
+
this.processLinkIsUiComponent$ = this._taskProcessLinkType$.pipe(map$1((type) => type === 'ui-component'));
|
|
976
993
|
this._processLinkId$ = new BehaviorSubject(null);
|
|
977
994
|
this._subscriptions = new Subscription();
|
|
995
|
+
this._formCustomComponentConfig$ = new BehaviorSubject({});
|
|
996
|
+
this._viewInitialized$ = new BehaviorSubject(false);
|
|
978
997
|
this.intermediateSaveEnabled = !!this.configService.featureToggles?.enableIntermediateSave;
|
|
979
998
|
this.iconService.registerAll([RecentlyViewed16]);
|
|
980
999
|
const options = new FormioOptionsImpl();
|
|
981
1000
|
options.disableAlerts = true;
|
|
982
1001
|
this.formioOptions$.next(options);
|
|
1002
|
+
this._formCustomComponentConfig$.next(formCustomComponentConfig);
|
|
983
1003
|
}
|
|
984
1004
|
ngOnInit() {
|
|
985
1005
|
this.openPermissionSubscription();
|
|
@@ -987,6 +1007,10 @@ class TaskDetailContentComponent {
|
|
|
987
1007
|
ngOnDestroy() {
|
|
988
1008
|
this._subscriptions.unsubscribe();
|
|
989
1009
|
this.taskIntermediateSaveService.setSubmission({});
|
|
1010
|
+
this._viewInitialized$.next(false);
|
|
1011
|
+
}
|
|
1012
|
+
ngAfterViewInit() {
|
|
1013
|
+
this._viewInitialized$.next(true);
|
|
990
1014
|
}
|
|
991
1015
|
onSubmit(submission) {
|
|
992
1016
|
if (submission.data) {
|
|
@@ -1036,15 +1060,20 @@ class TaskDetailContentComponent {
|
|
|
1036
1060
|
onFormFlowChangeEvent() {
|
|
1037
1061
|
this.activeChange.emit(true);
|
|
1038
1062
|
}
|
|
1039
|
-
loadTaskDetails(task) {
|
|
1063
|
+
loadTaskDetails(task, processLink) {
|
|
1040
1064
|
this.resetTaskProcessLinkType();
|
|
1041
1065
|
this.resetFormDefinition();
|
|
1042
|
-
this.
|
|
1066
|
+
this.taskInstanceId$.next(task.id);
|
|
1067
|
+
if (!processLink) {
|
|
1068
|
+
this.getTaskProcessLink(task.id);
|
|
1069
|
+
}
|
|
1070
|
+
else {
|
|
1071
|
+
this.setTaskProcessLink(processLink);
|
|
1072
|
+
}
|
|
1043
1073
|
this.setDocumentDefinitionNameInService(task);
|
|
1044
1074
|
const documentId = task.businessKey;
|
|
1045
1075
|
this.stateService.setDocumentId(documentId);
|
|
1046
1076
|
this.task$.next(task);
|
|
1047
|
-
this.taskInstanceId$.next(task.id);
|
|
1048
1077
|
this.page$.next({
|
|
1049
1078
|
title: task.name,
|
|
1050
1079
|
subtitle: `${this.translateService.instant('taskDetail.taskCreated')} ${task.created}`,
|
|
@@ -1052,10 +1081,12 @@ class TaskDetailContentComponent {
|
|
|
1052
1081
|
}
|
|
1053
1082
|
getCurrentProgress(formViewModelComponentRef) {
|
|
1054
1083
|
this.taskInstanceId$
|
|
1055
|
-
.pipe(take$1(1), switchMap((taskInstanceId) => this.taskIntermediateSaveService.getIntermediateSubmission(taskInstanceId ?? '')))
|
|
1084
|
+
.pipe(filter(value => !!value), take$1(1), switchMap((taskInstanceId) => this.taskIntermediateSaveService.getIntermediateSubmission(taskInstanceId ?? '')))
|
|
1056
1085
|
.subscribe({
|
|
1057
1086
|
next: (intermediateSubmission) => {
|
|
1058
|
-
this.taskIntermediateSaveService.setSubmission({
|
|
1087
|
+
this.taskIntermediateSaveService.setSubmission({
|
|
1088
|
+
data: intermediateSubmission?.submission || {},
|
|
1089
|
+
});
|
|
1059
1090
|
if (formViewModelComponentRef) {
|
|
1060
1091
|
formViewModelComponentRef.instance.submission = {
|
|
1061
1092
|
data: intermediateSubmission.submission,
|
|
@@ -1067,50 +1098,60 @@ class TaskDetailContentComponent {
|
|
|
1067
1098
|
getTaskProcessLink(taskId) {
|
|
1068
1099
|
this.taskService.getTaskProcessLink(taskId).subscribe({
|
|
1069
1100
|
next: res => {
|
|
1070
|
-
|
|
1071
|
-
switch (res?.type) {
|
|
1072
|
-
case 'form':
|
|
1073
|
-
this._taskProcessLinkType$.next('form');
|
|
1074
|
-
this._processLinkId$.next(res.processLinkId);
|
|
1075
|
-
if (this.intermediateSaveEnabled)
|
|
1076
|
-
this.getCurrentProgress();
|
|
1077
|
-
this.setFormDefinition(res.properties.prefilledForm);
|
|
1078
|
-
break;
|
|
1079
|
-
case 'form-flow':
|
|
1080
|
-
this._taskProcessLinkType$.next('form-flow');
|
|
1081
|
-
this.formFlowInstanceId$.next(res.properties.formFlowInstanceId ?? '');
|
|
1082
|
-
break;
|
|
1083
|
-
case 'form-view-model':
|
|
1084
|
-
this._taskProcessLinkType$.next('form-view-model');
|
|
1085
|
-
this._processLinkId$.next(res.processLinkId);
|
|
1086
|
-
this.formDefinition$.next(res.properties.formDefinition);
|
|
1087
|
-
this.formName$.next(res.properties.formName ?? '');
|
|
1088
|
-
this.setFormViewModelComponent();
|
|
1089
|
-
break;
|
|
1090
|
-
case 'url':
|
|
1091
|
-
this._taskProcessLinkType$.next('url');
|
|
1092
|
-
this._processLinkId$.next(res.processLinkId);
|
|
1093
|
-
combineLatest([this.processLinkService.getVariables(), this.task$])
|
|
1094
|
-
.pipe(take$1(1))
|
|
1095
|
-
.subscribe(([variables, task]) => {
|
|
1096
|
-
let url = this.urlResolverService.resolveUrlVariables(res.properties.url, variables.variables);
|
|
1097
|
-
window.open(url, '_blank').focus();
|
|
1098
|
-
this.processLinkService
|
|
1099
|
-
.submitURLProcessLink(res.processLinkId, task.businessKey, task.id)
|
|
1100
|
-
.subscribe(() => {
|
|
1101
|
-
this.completeTask(task);
|
|
1102
|
-
});
|
|
1103
|
-
});
|
|
1104
|
-
break;
|
|
1105
|
-
}
|
|
1106
|
-
this.loading$.next(false);
|
|
1107
|
-
}
|
|
1101
|
+
this.setTaskProcessLink(res);
|
|
1108
1102
|
},
|
|
1109
1103
|
error: _ => {
|
|
1110
1104
|
this.loading$.next(false);
|
|
1111
1105
|
},
|
|
1112
1106
|
});
|
|
1113
1107
|
}
|
|
1108
|
+
setTaskProcessLink(processLinkResult) {
|
|
1109
|
+
if (processLinkResult !== null) {
|
|
1110
|
+
switch (processLinkResult?.type) {
|
|
1111
|
+
case 'form':
|
|
1112
|
+
this._taskProcessLinkType$.next('form');
|
|
1113
|
+
this._processLinkId$.next(processLinkResult.processLinkId);
|
|
1114
|
+
if (this.intermediateSaveEnabled)
|
|
1115
|
+
this.getCurrentProgress();
|
|
1116
|
+
this.setFormDefinition(processLinkResult.properties.prefilledForm);
|
|
1117
|
+
break;
|
|
1118
|
+
case 'form-flow':
|
|
1119
|
+
this._taskProcessLinkType$.next('form-flow');
|
|
1120
|
+
this.formFlowInstanceId$.next(processLinkResult.properties.formFlowInstanceId ?? '');
|
|
1121
|
+
break;
|
|
1122
|
+
case 'form-view-model':
|
|
1123
|
+
this._taskProcessLinkType$.next('form-view-model');
|
|
1124
|
+
this._processLinkId$.next(processLinkResult.processLinkId);
|
|
1125
|
+
this.formDefinition$.next(processLinkResult.properties.formDefinition);
|
|
1126
|
+
this.formName$.next(processLinkResult.properties.formName ?? '');
|
|
1127
|
+
this.setFormViewModelComponent();
|
|
1128
|
+
break;
|
|
1129
|
+
case 'url':
|
|
1130
|
+
this._taskProcessLinkType$.next('url');
|
|
1131
|
+
this._processLinkId$.next(processLinkResult.processLinkId);
|
|
1132
|
+
combineLatest([this.processLinkService.getVariables(), this.task$])
|
|
1133
|
+
.pipe(take$1(1))
|
|
1134
|
+
.subscribe(([variables, task]) => {
|
|
1135
|
+
let url = this.urlResolverService.resolveUrlVariables(processLinkResult.properties.url, variables.variables);
|
|
1136
|
+
window.open(url, '_blank').focus();
|
|
1137
|
+
this.processLinkService
|
|
1138
|
+
.submitURLProcessLink(processLinkResult.processLinkId, task.businessKey, task.id)
|
|
1139
|
+
.subscribe(() => {
|
|
1140
|
+
this.completeTask(task);
|
|
1141
|
+
});
|
|
1142
|
+
});
|
|
1143
|
+
break;
|
|
1144
|
+
case 'ui-component':
|
|
1145
|
+
this._taskProcessLinkType$.next('ui-component');
|
|
1146
|
+
this._processLinkId$.next(processLinkResult.processLinkId);
|
|
1147
|
+
this.formDefinition$.next(null);
|
|
1148
|
+
this.formName$.next('');
|
|
1149
|
+
this.setFormCustomComponent(processLinkResult.properties.componentKey);
|
|
1150
|
+
break;
|
|
1151
|
+
}
|
|
1152
|
+
this.loading$.next(false);
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1114
1155
|
openPermissionSubscription() {
|
|
1115
1156
|
this._subscriptions.add(this.task$.subscribe(task => {
|
|
1116
1157
|
if (task) {
|
|
@@ -1135,30 +1176,51 @@ class TaskDetailContentComponent {
|
|
|
1135
1176
|
this.formDefinition$.next(formDefinition);
|
|
1136
1177
|
}
|
|
1137
1178
|
setFormViewModelComponent() {
|
|
1138
|
-
this.
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
this.
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1179
|
+
this._viewInitialized$.subscribe((viewInitialized) => {
|
|
1180
|
+
if (viewInitialized) {
|
|
1181
|
+
this.formViewModelDynamicContainer.clear();
|
|
1182
|
+
if (!this.formViewModel)
|
|
1183
|
+
return;
|
|
1184
|
+
const formViewModelComponent = this.formViewModelDynamicContainer.createComponent(this.formViewModel.component);
|
|
1185
|
+
formViewModelComponent.instance.form = this.formDefinition$.getValue();
|
|
1186
|
+
formViewModelComponent.instance.formName = this.formName$.getValue();
|
|
1187
|
+
formViewModelComponent.instance.taskInstanceId = this.taskInstanceId$.getValue();
|
|
1188
|
+
formViewModelComponent.instance.isStartForm = false;
|
|
1189
|
+
formViewModelComponent.instance.formSubmit
|
|
1190
|
+
.pipe(take$1(1), switchMap(() => this.task$))
|
|
1191
|
+
.subscribe((task) => {
|
|
1192
|
+
this.completeTask(task);
|
|
1193
|
+
});
|
|
1194
|
+
if (this.intermediateSaveEnabled) {
|
|
1195
|
+
this._subscriptions.add(formViewModelComponent.instance.submission$.subscribe(submission => {
|
|
1196
|
+
this.taskIntermediateSaveService.setSubmission(submission);
|
|
1197
|
+
}));
|
|
1198
|
+
this._subscriptions.add(this.submission$.pipe(distinctUntilChanged()).subscribe((submission) => {
|
|
1199
|
+
if (submission?.data && Object.keys(submission.data).length === 0) {
|
|
1200
|
+
formViewModelComponent.instance.submission = { data: {} };
|
|
1201
|
+
}
|
|
1202
|
+
}));
|
|
1203
|
+
this.getCurrentProgress(formViewModelComponent);
|
|
1158
1204
|
}
|
|
1159
|
-
}
|
|
1160
|
-
|
|
1161
|
-
|
|
1205
|
+
}
|
|
1206
|
+
});
|
|
1207
|
+
}
|
|
1208
|
+
setFormCustomComponent(formCustomComponentKey) {
|
|
1209
|
+
this._viewInitialized$.subscribe((viewInitialized) => {
|
|
1210
|
+
if (viewInitialized) {
|
|
1211
|
+
this.formCustomComponentDynamicContainer.clear();
|
|
1212
|
+
if (!this.formCustomComponentConfig)
|
|
1213
|
+
return;
|
|
1214
|
+
this._subscriptions.add(this._formCustomComponentConfig$.subscribe((formCustomComponentConfig) => {
|
|
1215
|
+
const customComponent = formCustomComponentConfig[formCustomComponentKey];
|
|
1216
|
+
const renderedComponent = this.formCustomComponentDynamicContainer.createComponent(customComponent);
|
|
1217
|
+
renderedComponent.instance.taskInstanceId = this.taskInstanceId$.value;
|
|
1218
|
+
renderedComponent.instance.submitEvent.subscribe(() => {
|
|
1219
|
+
this.closeModalEvent.emit();
|
|
1220
|
+
});
|
|
1221
|
+
}));
|
|
1222
|
+
}
|
|
1223
|
+
});
|
|
1162
1224
|
}
|
|
1163
1225
|
resetFormDefinition() {
|
|
1164
1226
|
this.formDefinition$.next(null);
|
|
@@ -1177,17 +1239,22 @@ class TaskDetailContentComponent {
|
|
|
1177
1239
|
this.stateService.setDocumentDefinitionName(documentDefinitionName);
|
|
1178
1240
|
});
|
|
1179
1241
|
}
|
|
1180
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: TaskDetailContentComponent, deps: [{ token: i1$1.ConfigService }, { token: i2.DocumentService }, { token: i12.IconService }, { token: i4.NGXLogger }, { token: i9.ValtimoModalService }, { token: i3$1.PermissionService }, { token: i7.ProcessLinkService }, { token: i1$2.Router }, { token: i9.FormIoStateService }, { token: TaskIntermediateSaveService }, { token: TaskService }, { token: i10.ToastrService }, { token: i3.TranslateService }, { token: FORM_VIEW_MODEL_TOKEN, optional: true }, { token: i7.UrlResolverService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1181
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: TaskDetailContentComponent, isStandalone: true, selector: "valtimo-task-detail-content", inputs: { task: "task" }, outputs: { closeModalEvent: "closeModalEvent", formSubmit: "formSubmit", activeChange: "activeChange" }, viewQueries: [{ propertyName: "form", first: true, predicate: ["form"], descendants: true }, { propertyName: "formViewModelDynamicContainer", first: true, predicate: ["formViewModelComponent"], descendants: true, read: ViewContainerRef }, { propertyName: "formFlow", first: true, predicate: ["formFlow"], descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2024 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 *ngIf=\"{\n loading: loading$ | async,\n page: page$ | async,\n task: task$ | async,\n taskId: taskInstanceId$ | async,\n formDefinition: formDefinition$ | async,\n formDefinitionId: formDefinitionId$ | async,\n formName: formName$ | async,\n formIoFormData: formIoFormData$ | async,\n submission: submission$ | async,\n processLinkIsForm: processLinkIsForm$ | async,\n processLinkIsFormViewModel: processLinkIsFormViewModel$ | async,\n formioOptions: formioOptions$ | async,\n processLinkIsFormFlow: processLinkIsFormFlow$ | async,\n formFlowInstanceId: formFlowInstanceId$ | async,\n errorMessage: errorMessage$ | async,\n canAssignUserToTask: canAssignUserToTask$ | async,\n } as obs\"\n>\n <valtimo-form-io\n #form\n *ngIf=\"obs.formDefinition && obs.processLinkIsForm\"\n [form]=\"obs.formDefinition\"\n [submission]=\"obs.submission\"\n (submit)=\"onSubmit($event)\"\n (change)=\"onChange($event)\"\n [options]=\"obs.formioOptions\"\n ></valtimo-form-io>\n\n <valtimo-form-flow\n #formFlow\n *ngIf=\"obs.processLinkIsFormFlow\"\n [formIoFormData]=\"formIoFormData$\"\n [formFlowInstanceId]=\"obs.formFlowInstanceId\"\n (formFlowComplete)=\"completeTask(obs.task)\"\n (formFlowChange)=\"onFormFlowChangeEvent()\"\n ></valtimo-form-flow>\n\n <div *ngIf=\"obs.loading\" class=\"text-black mb-0 p-3 text-center\">\n {{ 'formManagement.loading' | translate }}\n </div>\n\n <div\n *ngIf=\"\n obs.loading === false && !obs.formDefinition && !obs.formFlowInstanceId && !obs.errorMessage\n \"\n class=\"bg-warning text-black mb-0 p-3 text-center\"\n >\n {{\n (isAdmin$ | async)\n ? ('formManagement.noFormDefinitionFoundAdmin' | translate)\n : ('formManagement.noFormDefinitionFoundUser' | translate)\n }}\n </div>\n\n <div *ngIf=\"obs.errorMessage\" class=\"bg-danger text-black mb-0 p-3 text-center\">\n {{ obs.errorMessage }}\n </div>\n\n <div class=\"m-2\">\n <ng-template #formViewModelComponent></ng-template>\n </div>\n</ng-container>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i6.AsyncPipe, name: "async" }, { kind: "ngmodule", type: FormIoModule }, { kind: "component", type: i9.FormioComponent, selector: "valtimo-form-io", inputs: ["options", "submission", "form", "readOnly", "formRefresh$"], outputs: ["submit", "change", "event"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ProcessLinkModule }, { kind: "component", type: i7.FormFlowComponent, selector: "valtimo-form-flow", inputs: ["formIoFormData", "formFlowInstanceId"], outputs: ["formFlowComplete", "formFlowChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1242
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: TaskDetailContentComponent, deps: [{ token: i1$1.ConfigService }, { token: i2.DocumentService }, { token: i12.IconService }, { token: i4.NGXLogger }, { token: i9.ValtimoModalService }, { token: i3$1.PermissionService }, { token: i7.ProcessLinkService }, { token: i1$2.Router }, { token: i9.FormIoStateService }, { token: TaskIntermediateSaveService }, { token: TaskService }, { token: i10.ToastrService }, { token: i3.TranslateService }, { token: FORM_VIEW_MODEL_TOKEN, optional: true }, { token: FORM_CUSTOM_COMPONENT_TOKEN, optional: true }, { token: i7.UrlResolverService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1243
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: TaskDetailContentComponent, isStandalone: true, selector: "valtimo-task-detail-content", inputs: { task: "task", taskAndProcessLink: "taskAndProcessLink", modalClosed: "modalClosed" }, outputs: { closeModalEvent: "closeModalEvent", formSubmit: "formSubmit", activeChange: "activeChange" }, viewQueries: [{ propertyName: "form", first: true, predicate: ["form"], descendants: true }, { propertyName: "formViewModelDynamicContainer", first: true, predicate: ["formViewModelComponent"], descendants: true, read: ViewContainerRef }, { propertyName: "formFlow", first: true, predicate: ["formFlow"], descendants: true }, { propertyName: "formCustomComponentDynamicContainer", first: true, predicate: ["formCustomComponent"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2024 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 *ngIf=\"{\n loading: loading$ | async,\n page: page$ | async,\n task: task$ | async,\n taskId: taskInstanceId$ | async,\n formDefinition: formDefinition$ | async,\n formDefinitionId: formDefinitionId$ | async,\n formName: formName$ | async,\n formIoFormData: formIoFormData$ | async,\n submission: submission$ | async,\n processLinkIsForm: processLinkIsForm$ | async,\n processLinkIsFormViewModel: processLinkIsFormViewModel$ | async,\n processLinkIsUiComponent: processLinkIsUiComponent$ | async,\n formioOptions: formioOptions$ | async,\n processLinkIsFormFlow: processLinkIsFormFlow$ | async,\n formFlowInstanceId: formFlowInstanceId$ | async,\n errorMessage: errorMessage$ | async,\n canAssignUserToTask: canAssignUserToTask$ | async,\n } as obs\"\n>\n <valtimo-form-io\n #form\n *ngIf=\"obs.formDefinition && obs.processLinkIsForm\"\n [form]=\"obs.formDefinition\"\n [submission]=\"obs.submission\"\n (submit)=\"onSubmit($event)\"\n (change)=\"onChange($event)\"\n [options]=\"obs.formioOptions\"\n ></valtimo-form-io>\n\n <valtimo-form-flow\n #formFlow\n *ngIf=\"obs.processLinkIsFormFlow\"\n [formIoFormData]=\"formIoFormData$\"\n [formFlowInstanceId]=\"obs.formFlowInstanceId\"\n (formFlowComplete)=\"completeTask(obs.task)\"\n (formFlowChange)=\"onFormFlowChangeEvent()\"\n ></valtimo-form-flow>\n\n <div *ngIf=\"obs.loading\" class=\"text-black mb-0 p-3 text-center\">\n {{ 'formManagement.loading' | translate }}\n </div>\n\n <div\n *ngIf=\"\n obs.loading === false && !obs.formDefinition && !obs.formFlowInstanceId && !obs.errorMessage && !obs.processLinkIsUiComponent\n \"\n class=\"bg-warning text-black mb-0 p-3 text-center\"\n >\n {{\n (isAdmin$ | async)\n ? ('formManagement.noFormDefinitionFoundAdmin' | translate)\n : ('formManagement.noFormDefinitionFoundUser' | translate)\n }}\n </div>\n\n <div *ngIf=\"obs.errorMessage\" class=\"bg-danger text-black mb-0 p-3 text-center\">\n {{ obs.errorMessage }}\n </div>\n\n <div class=\"m-2\">\n <ng-template #formViewModelComponent></ng-template>\n <ng-template #formCustomComponent></ng-template>\n </div>\n</ng-container>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i6.AsyncPipe, name: "async" }, { kind: "ngmodule", type: FormIoModule }, { kind: "component", type: i9.FormioComponent, selector: "valtimo-form-io", inputs: ["options", "submission", "form", "readOnly", "formRefresh$"], outputs: ["submit", "change", "event"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ProcessLinkModule }, { kind: "component", type: i7.FormFlowComponent, selector: "valtimo-form-flow", inputs: ["formIoFormData", "formFlowInstanceId"], outputs: ["formFlowComplete", "formFlowChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1182
1244
|
}
|
|
1183
1245
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: TaskDetailContentComponent, decorators: [{
|
|
1184
1246
|
type: Component,
|
|
1185
|
-
args: [{ selector: 'valtimo-task-detail-content', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, FormIoModule, TranslateModule, ProcessLinkModule], template: "<!--\n ~ Copyright 2015-2024 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 *ngIf=\"{\n loading: loading$ | async,\n page: page$ | async,\n task: task$ | async,\n taskId: taskInstanceId$ | async,\n formDefinition: formDefinition$ | async,\n formDefinitionId: formDefinitionId$ | async,\n formName: formName$ | async,\n formIoFormData: formIoFormData$ | async,\n submission: submission$ | async,\n processLinkIsForm: processLinkIsForm$ | async,\n processLinkIsFormViewModel: processLinkIsFormViewModel$ | async,\n formioOptions: formioOptions$ | async,\n processLinkIsFormFlow: processLinkIsFormFlow$ | async,\n formFlowInstanceId: formFlowInstanceId$ | async,\n errorMessage: errorMessage$ | async,\n canAssignUserToTask: canAssignUserToTask$ | async,\n } as obs\"\n>\n <valtimo-form-io\n #form\n *ngIf=\"obs.formDefinition && obs.processLinkIsForm\"\n [form]=\"obs.formDefinition\"\n [submission]=\"obs.submission\"\n (submit)=\"onSubmit($event)\"\n (change)=\"onChange($event)\"\n [options]=\"obs.formioOptions\"\n ></valtimo-form-io>\n\n <valtimo-form-flow\n #formFlow\n *ngIf=\"obs.processLinkIsFormFlow\"\n [formIoFormData]=\"formIoFormData$\"\n [formFlowInstanceId]=\"obs.formFlowInstanceId\"\n (formFlowComplete)=\"completeTask(obs.task)\"\n (formFlowChange)=\"onFormFlowChangeEvent()\"\n ></valtimo-form-flow>\n\n <div *ngIf=\"obs.loading\" class=\"text-black mb-0 p-3 text-center\">\n {{ 'formManagement.loading' | translate }}\n </div>\n\n <div\n *ngIf=\"\n obs.loading === false && !obs.formDefinition && !obs.formFlowInstanceId && !obs.errorMessage\n \"\n class=\"bg-warning text-black mb-0 p-3 text-center\"\n >\n {{\n (isAdmin$ | async)\n ? ('formManagement.noFormDefinitionFoundAdmin' | translate)\n : ('formManagement.noFormDefinitionFoundUser' | translate)\n }}\n </div>\n\n <div *ngIf=\"obs.errorMessage\" class=\"bg-danger text-black mb-0 p-3 text-center\">\n {{ obs.errorMessage }}\n </div>\n\n <div class=\"m-2\">\n <ng-template #formViewModelComponent></ng-template>\n </div>\n</ng-container>\n" }]
|
|
1247
|
+
args: [{ selector: 'valtimo-task-detail-content', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, FormIoModule, TranslateModule, ProcessLinkModule], template: "<!--\n ~ Copyright 2015-2024 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 *ngIf=\"{\n loading: loading$ | async,\n page: page$ | async,\n task: task$ | async,\n taskId: taskInstanceId$ | async,\n formDefinition: formDefinition$ | async,\n formDefinitionId: formDefinitionId$ | async,\n formName: formName$ | async,\n formIoFormData: formIoFormData$ | async,\n submission: submission$ | async,\n processLinkIsForm: processLinkIsForm$ | async,\n processLinkIsFormViewModel: processLinkIsFormViewModel$ | async,\n processLinkIsUiComponent: processLinkIsUiComponent$ | async,\n formioOptions: formioOptions$ | async,\n processLinkIsFormFlow: processLinkIsFormFlow$ | async,\n formFlowInstanceId: formFlowInstanceId$ | async,\n errorMessage: errorMessage$ | async,\n canAssignUserToTask: canAssignUserToTask$ | async,\n } as obs\"\n>\n <valtimo-form-io\n #form\n *ngIf=\"obs.formDefinition && obs.processLinkIsForm\"\n [form]=\"obs.formDefinition\"\n [submission]=\"obs.submission\"\n (submit)=\"onSubmit($event)\"\n (change)=\"onChange($event)\"\n [options]=\"obs.formioOptions\"\n ></valtimo-form-io>\n\n <valtimo-form-flow\n #formFlow\n *ngIf=\"obs.processLinkIsFormFlow\"\n [formIoFormData]=\"formIoFormData$\"\n [formFlowInstanceId]=\"obs.formFlowInstanceId\"\n (formFlowComplete)=\"completeTask(obs.task)\"\n (formFlowChange)=\"onFormFlowChangeEvent()\"\n ></valtimo-form-flow>\n\n <div *ngIf=\"obs.loading\" class=\"text-black mb-0 p-3 text-center\">\n {{ 'formManagement.loading' | translate }}\n </div>\n\n <div\n *ngIf=\"\n obs.loading === false && !obs.formDefinition && !obs.formFlowInstanceId && !obs.errorMessage && !obs.processLinkIsUiComponent\n \"\n class=\"bg-warning text-black mb-0 p-3 text-center\"\n >\n {{\n (isAdmin$ | async)\n ? ('formManagement.noFormDefinitionFoundAdmin' | translate)\n : ('formManagement.noFormDefinitionFoundUser' | translate)\n }}\n </div>\n\n <div *ngIf=\"obs.errorMessage\" class=\"bg-danger text-black mb-0 p-3 text-center\">\n {{ obs.errorMessage }}\n </div>\n\n <div class=\"m-2\">\n <ng-template #formViewModelComponent></ng-template>\n <ng-template #formCustomComponent></ng-template>\n </div>\n</ng-container>\n" }]
|
|
1186
1248
|
}], ctorParameters: () => [{ type: i1$1.ConfigService }, { type: i2.DocumentService }, { type: i12.IconService }, { type: i4.NGXLogger }, { type: i9.ValtimoModalService }, { type: i3$1.PermissionService }, { type: i7.ProcessLinkService }, { type: i1$2.Router }, { type: i9.FormIoStateService }, { type: TaskIntermediateSaveService }, { type: TaskService }, { type: i10.ToastrService }, { type: i3.TranslateService }, { type: undefined, decorators: [{
|
|
1187
1249
|
type: Optional
|
|
1188
1250
|
}, {
|
|
1189
1251
|
type: Inject,
|
|
1190
1252
|
args: [FORM_VIEW_MODEL_TOKEN]
|
|
1253
|
+
}] }, { type: undefined, decorators: [{
|
|
1254
|
+
type: Optional
|
|
1255
|
+
}, {
|
|
1256
|
+
type: Inject,
|
|
1257
|
+
args: [FORM_CUSTOM_COMPONENT_TOKEN]
|
|
1191
1258
|
}] }, { type: i7.UrlResolverService }], propDecorators: { form: [{
|
|
1192
1259
|
type: ViewChild,
|
|
1193
1260
|
args: ['form']
|
|
@@ -1197,8 +1264,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
1197
1264
|
}], formFlow: [{
|
|
1198
1265
|
type: ViewChild,
|
|
1199
1266
|
args: ['formFlow']
|
|
1267
|
+
}], formCustomComponentDynamicContainer: [{
|
|
1268
|
+
type: ViewChild,
|
|
1269
|
+
args: ['formCustomComponent', { static: false, read: ViewContainerRef }]
|
|
1200
1270
|
}], task: [{
|
|
1201
1271
|
type: Input
|
|
1272
|
+
}], taskAndProcessLink: [{
|
|
1273
|
+
type: Input
|
|
1274
|
+
}], modalClosed: [{
|
|
1275
|
+
type: Input
|
|
1202
1276
|
}], closeModalEvent: [{
|
|
1203
1277
|
type: Output
|
|
1204
1278
|
}], formSubmit: [{
|
|
@@ -1230,8 +1304,7 @@ class TaskDetailIntermediateSaveComponent {
|
|
|
1230
1304
|
.getTaskProcessLink(value.id)
|
|
1231
1305
|
.pipe(take$1(1))
|
|
1232
1306
|
.subscribe(res => {
|
|
1233
|
-
|
|
1234
|
-
this.formFlowInstanceId$.next(res.properties.formFlowInstanceId);
|
|
1307
|
+
this.setFormFlow(res);
|
|
1235
1308
|
});
|
|
1236
1309
|
this.taskValue.set(value);
|
|
1237
1310
|
this.page.set({
|
|
@@ -1240,6 +1313,17 @@ class TaskDetailIntermediateSaveComponent {
|
|
|
1240
1313
|
});
|
|
1241
1314
|
this.getCurrentProgress(value);
|
|
1242
1315
|
}
|
|
1316
|
+
set taskAndProcessLink(value) {
|
|
1317
|
+
if (!value)
|
|
1318
|
+
return;
|
|
1319
|
+
this.setFormFlow(value.processLinkActivityResult);
|
|
1320
|
+
this.taskValue.set(value.task);
|
|
1321
|
+
this.page.set({
|
|
1322
|
+
title: value?.task.name,
|
|
1323
|
+
subtitle: `${this.translateService.instant('taskDetail.taskCreated')} ${value?.task.created}`,
|
|
1324
|
+
});
|
|
1325
|
+
this.getCurrentProgress(value.task);
|
|
1326
|
+
}
|
|
1243
1327
|
constructor(configService, iconService, translateService, taskIntermediateSaveService, taskService, toastr) {
|
|
1244
1328
|
this.configService = configService;
|
|
1245
1329
|
this.iconService = iconService;
|
|
@@ -1298,6 +1382,11 @@ class TaskDetailIntermediateSaveComponent {
|
|
|
1298
1382
|
this.currentIntermediateSaveEvent.emit(this.currentIntermediateSave);
|
|
1299
1383
|
});
|
|
1300
1384
|
}
|
|
1385
|
+
setFormFlow(processLink) {
|
|
1386
|
+
if (processLink !== null && processLink.type === 'form-flow') {
|
|
1387
|
+
this.formFlowInstanceId$.next(processLink.properties.formFlowInstanceId);
|
|
1388
|
+
}
|
|
1389
|
+
}
|
|
1301
1390
|
formatIntermediateSubmission(intermediateSubmission) {
|
|
1302
1391
|
intermediateSubmission.createdOn = moment(intermediateSubmission.createdOn).format('DD MMM YYYY HH:mm');
|
|
1303
1392
|
if (intermediateSubmission.editedOn) {
|
|
@@ -1310,11 +1399,18 @@ class TaskDetailIntermediateSaveComponent {
|
|
|
1310
1399
|
.getIntermediateSubmission(task.id ?? '')
|
|
1311
1400
|
.pipe(take$1(1))
|
|
1312
1401
|
.subscribe(intermediateSave => {
|
|
1313
|
-
|
|
1402
|
+
if (intermediateSave !== null) {
|
|
1403
|
+
this.currentIntermediateSave = this.formatIntermediateSubmission(intermediateSave);
|
|
1404
|
+
}
|
|
1405
|
+
else {
|
|
1406
|
+
this.currentIntermediateSave = null;
|
|
1407
|
+
this.taskIntermediateSaveService.setSubmission({});
|
|
1408
|
+
}
|
|
1409
|
+
this.currentIntermediateSaveEvent.emit(this.currentIntermediateSave);
|
|
1314
1410
|
});
|
|
1315
1411
|
}
|
|
1316
1412
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: TaskDetailIntermediateSaveComponent, deps: [{ token: i1$1.ConfigService }, { token: i12.IconService }, { token: i3.TranslateService }, { token: TaskIntermediateSaveService }, { token: TaskService }, { token: i10.ToastrService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1317
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: TaskDetailIntermediateSaveComponent, isStandalone: true, selector: "valtimo-task-detail-intermediate-save", inputs: { task: "task" }, outputs: { currentIntermediateSaveEvent: "currentIntermediateSaveEvent", showModalEvent: "showModalEvent" }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2024 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@if (intermediateSaveEnabled && (formFlowInstanceId$ | async) === undefined) {\n <button\n cdsButton=\"ghost\"\n iconOnly=\"true\"\n cdsIcon=\"save\"\n [vTooltip]=\"'formManagement.intermediateSave.save' | translate\"\n (click)=\"saveCurrentProgress()\"\n ></button>\n\n <button\n cdsButton=\"ghost\"\n iconOnly=\"true\"\n cdsIcon=\"recently-viewed\"\n [disabled]=\"!currentIntermediateSave\"\n [vTooltip]=\"'formManagement.intermediateSave.clear' | translate\"\n (click)=\"revertSaveClick()\"\n ></button>\n}\n\n<valtimo-confirmation-modal\n [showModalSubject$]=\"showConfirmationModal$\"\n (confirmEvent)=\"clearCurrentProgress()\"\n (cancelEvent)=\"showConfirmationModal$.next(false)\"\n cancelButtonType=\"ghost\"\n confirmButtonTextTranslationKey=\"interface.confirm\"\n titleTranslationKey=\"formManagement.intermediateSave.clear\"\n contentTranslationKey=\"formManagement.intermediateSave.clearConfirm\"\n></valtimo-confirmation-modal>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i6.AsyncPipe, name: "async" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i12.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: ConfirmationModalModule }, { kind: "component", type: i9.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: "ngmodule", type: IconModule }, { kind: "directive", type: i12.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "ngmodule", type: ModalModule }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i9.TooltipDirective, selector: "[vTooltip]", inputs: ["vTooltip", "onBottom", "tooltipDisabled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1413
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: TaskDetailIntermediateSaveComponent, isStandalone: true, selector: "valtimo-task-detail-intermediate-save", inputs: { task: "task", taskAndProcessLink: "taskAndProcessLink" }, outputs: { currentIntermediateSaveEvent: "currentIntermediateSaveEvent", showModalEvent: "showModalEvent" }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2024 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@if (intermediateSaveEnabled && (formFlowInstanceId$ | async) === undefined) {\n <button\n cdsButton=\"ghost\"\n iconOnly=\"true\"\n cdsIcon=\"save\"\n [vTooltip]=\"'formManagement.intermediateSave.save' | translate\"\n (click)=\"saveCurrentProgress()\"\n ></button>\n\n <button\n cdsButton=\"ghost\"\n iconOnly=\"true\"\n cdsIcon=\"recently-viewed\"\n [disabled]=\"!currentIntermediateSave\"\n [vTooltip]=\"'formManagement.intermediateSave.clear' | translate\"\n (click)=\"revertSaveClick()\"\n ></button>\n}\n\n<valtimo-confirmation-modal\n [showModalSubject$]=\"showConfirmationModal$\"\n (confirmEvent)=\"clearCurrentProgress()\"\n (cancelEvent)=\"showConfirmationModal$.next(false)\"\n cancelButtonType=\"ghost\"\n confirmButtonTextTranslationKey=\"interface.confirm\"\n titleTranslationKey=\"formManagement.intermediateSave.clear\"\n contentTranslationKey=\"formManagement.intermediateSave.clearConfirm\"\n></valtimo-confirmation-modal>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i6.AsyncPipe, name: "async" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i12.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "ngmodule", type: ConfirmationModalModule }, { kind: "component", type: i9.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: "ngmodule", type: IconModule }, { kind: "directive", type: i12.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "ngmodule", type: ModalModule }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i9.TooltipDirective, selector: "[vTooltip]", inputs: ["vTooltip", "onBottom", "tooltipDisabled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1318
1414
|
}
|
|
1319
1415
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: TaskDetailIntermediateSaveComponent, decorators: [{
|
|
1320
1416
|
type: Component,
|
|
@@ -1329,6 +1425,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
1329
1425
|
], template: "<!--\n ~ Copyright 2015-2024 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@if (intermediateSaveEnabled && (formFlowInstanceId$ | async) === undefined) {\n <button\n cdsButton=\"ghost\"\n iconOnly=\"true\"\n cdsIcon=\"save\"\n [vTooltip]=\"'formManagement.intermediateSave.save' | translate\"\n (click)=\"saveCurrentProgress()\"\n ></button>\n\n <button\n cdsButton=\"ghost\"\n iconOnly=\"true\"\n cdsIcon=\"recently-viewed\"\n [disabled]=\"!currentIntermediateSave\"\n [vTooltip]=\"'formManagement.intermediateSave.clear' | translate\"\n (click)=\"revertSaveClick()\"\n ></button>\n}\n\n<valtimo-confirmation-modal\n [showModalSubject$]=\"showConfirmationModal$\"\n (confirmEvent)=\"clearCurrentProgress()\"\n (cancelEvent)=\"showConfirmationModal$.next(false)\"\n cancelButtonType=\"ghost\"\n confirmButtonTextTranslationKey=\"interface.confirm\"\n titleTranslationKey=\"formManagement.intermediateSave.clear\"\n contentTranslationKey=\"formManagement.intermediateSave.clearConfirm\"\n></valtimo-confirmation-modal>\n" }]
|
|
1330
1426
|
}], ctorParameters: () => [{ type: i1$1.ConfigService }, { type: i12.IconService }, { type: i3.TranslateService }, { type: TaskIntermediateSaveService }, { type: TaskService }, { type: i10.ToastrService }], propDecorators: { task: [{
|
|
1331
1427
|
type: Input
|
|
1428
|
+
}], taskAndProcessLink: [{
|
|
1429
|
+
type: Input
|
|
1332
1430
|
}], currentIntermediateSaveEvent: [{
|
|
1333
1431
|
type: Output
|
|
1334
1432
|
}], showModalEvent: [{
|
|
@@ -1365,12 +1463,16 @@ class TaskDetailModalComponent {
|
|
|
1365
1463
|
this.formSubmit = new EventEmitter();
|
|
1366
1464
|
this.assignmentOfTaskChanged = new EventEmitter();
|
|
1367
1465
|
this.currentIntermediateSave$ = new BehaviorSubject(null);
|
|
1466
|
+
this.processLinkPreloaded$ = new BehaviorSubject(false);
|
|
1368
1467
|
this.task$ = new BehaviorSubject(null);
|
|
1468
|
+
this.taskAndProcessLink$ = new BehaviorSubject(null);
|
|
1469
|
+
this.task = new BehaviorSubject(null);
|
|
1369
1470
|
this.submission$ = new BehaviorSubject({});
|
|
1370
1471
|
this.page$ = new BehaviorSubject(null);
|
|
1371
1472
|
this.showConfirmationModal$ = new BehaviorSubject(false);
|
|
1372
1473
|
this.size$ = new BehaviorSubject('md');
|
|
1373
1474
|
this.canAssignUserToTask$ = new BehaviorSubject(false);
|
|
1475
|
+
this.modalCloseEvent$ = new BehaviorSubject(false);
|
|
1374
1476
|
this._subscriptions = new Subscription();
|
|
1375
1477
|
}
|
|
1376
1478
|
ngOnInit() {
|
|
@@ -1403,6 +1505,16 @@ class TaskDetailModalComponent {
|
|
|
1403
1505
|
});
|
|
1404
1506
|
this.openModal();
|
|
1405
1507
|
}
|
|
1508
|
+
openTaskAndProcessLinkDetails(taskWithProcessLink) {
|
|
1509
|
+
this.processLinkPreloaded$.next(true);
|
|
1510
|
+
this.taskAndProcessLink$.next(taskWithProcessLink);
|
|
1511
|
+
this.task$.next({ ...taskWithProcessLink.task });
|
|
1512
|
+
this.page$.next({
|
|
1513
|
+
title: taskWithProcessLink.task?.name,
|
|
1514
|
+
subtitle: `${this.translateService.instant('taskDetail.taskCreated')} ${taskWithProcessLink.task?.created}`,
|
|
1515
|
+
});
|
|
1516
|
+
this.openModal();
|
|
1517
|
+
}
|
|
1406
1518
|
gotoProcessLinkScreen() {
|
|
1407
1519
|
this.closeModal();
|
|
1408
1520
|
this.router.navigate(['process-links']);
|
|
@@ -1419,16 +1531,17 @@ class TaskDetailModalComponent {
|
|
|
1419
1531
|
closeModal() {
|
|
1420
1532
|
this._modal.open = false;
|
|
1421
1533
|
this.taskIntermediateSaveService.setSubmission({});
|
|
1534
|
+
this.modalCloseEvent$.next(!this.modalCloseEvent$.getValue());
|
|
1422
1535
|
}
|
|
1423
1536
|
openModal() {
|
|
1424
1537
|
this._modal.open = true;
|
|
1425
1538
|
}
|
|
1426
1539
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: TaskDetailModalComponent, deps: [{ token: i1$2.Router }, { token: i3.TranslateService }, { token: i3$1.PermissionService }, { token: i4.NGXLogger }, { token: TaskIntermediateSaveService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1427
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
1540
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: TaskDetailModalComponent, selector: "valtimo-task-detail-modal", inputs: { modalSize: "modalSize" }, outputs: { formSubmit: "formSubmit", assignmentOfTaskChanged: "assignmentOfTaskChanged" }, viewQueries: [{ propertyName: "_modal", first: true, predicate: ["taskDetailModal"], descendants: true }, { propertyName: "_intermediateSaveComponent", first: true, predicate: TaskDetailIntermediateSaveComponent, descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright 2015-2024 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 #taskDetailModal id=\"taskDetailModal\" [size]=\"size$ | async\">\n <cds-modal-header (closeSelect)=\"closeModal()\">\n <div class=\"title-container\">\n <p class=\"cds--modal-header__heading cds--type-beta\">{{ (page$ | async)?.title }}</p>\n\n <p class=\"cds--modal-header__label cds--type-delta\">{{ (page$ | async)?.subtitle }}</p>\n\n <p\n class=\"cds--modal-header__label cds--type-delta\"\n *ngIf=\"currentIntermediateSave$ | async as currentIntermediateSave\"\n >\n {{ 'formManagement.intermediateSave.lastSavedBy' | translate }}:\n\n {{\n currentIntermediateSave?.editedBy\n ? currentIntermediateSave?.editedBy\n : currentIntermediateSave.createdBy\n }}\n\n {{ 'formManagement.intermediateSave.on' | translate }}:\n\n {{\n currentIntermediateSave?.editedOn\n ? currentIntermediateSave?.editedOn\n : currentIntermediateSave.createdOn\n }}\n </p>\n\n <ng-container *ngTemplateOutlet=\"assignUserToTask\"></ng-container>\n </div>\n\n @if (processLinkPreloaded$ | async) {\n <valtimo-task-detail-intermediate-save\n class=\"save-buttons-margin\"\n [taskAndProcessLink]=\"taskAndProcessLink$ | async\"\n (currentIntermediateSaveEvent)=\"onCurrentIntermediateSaveEvent($event)\"\n (showModalEvent)=\"onShowModalEvent()\"\n ></valtimo-task-detail-intermediate-save>\n } @else {\n <valtimo-task-detail-intermediate-save\n class=\"save-buttons-margin\"\n [task]=\"task$ | async\"\n (currentIntermediateSaveEvent)=\"onCurrentIntermediateSaveEvent($event)\"\n (showModalEvent)=\"onShowModalEvent()\"\n ></valtimo-task-detail-intermediate-save>\n }\n </cds-modal-header>\n\n <div body class=\"cds--modal-content pb-1\">\n @if (processLinkPreloaded$ | async) {\n <valtimo-task-detail-content\n [taskAndProcessLink]=\"taskAndProcessLink$ | async\"\n [modalClosed]=\"modalCloseEvent$ | async\"\n (formSubmit)=\"onFormSubmit()\"\n (closeModalEvent)=\"closeModal()\"\n ></valtimo-task-detail-content>\n } @else {\n <valtimo-task-detail-content\n [task]=\"task$ | async\"\n [modalClosed]=\"modalCloseEvent$ | async\"\n (formSubmit)=\"onFormSubmit()\"\n (closeModalEvent)=\"closeModal()\"\n ></valtimo-task-detail-content>\n }\n </div>\n</cds-modal>\n\n<valtimo-confirmation-modal\n [showModalSubject$]=\"showConfirmationModal$\"\n (confirmEvent)=\"clearCurrentProgress()\"\n (cancelEvent)=\"showConfirmationModal$.next(false)\"\n cancelButtonType=\"ghost\"\n confirmButtonTextTranslationKey=\"interface.confirm\"\n titleTranslationKey=\"formManagement.intermediateSave.clear\"\n contentTranslationKey=\"formManagement.intermediateSave.clearConfirm\"\n></valtimo-confirmation-modal>\n\n<ng-template #assignUserToTask>\n <ng-container\n *ngIf=\"{\n task: task$ | async,\n canAssignUserToTask: canAssignUserToTask$ | async,\n } as obs\"\n >\n <valtimo-assign-user-to-task\n *ngIf=\"obs.task && obs.canAssignUserToTask && assignmentOfTaskChanged\"\n [taskId]=\"obs.task.id\"\n [assigneeId]=\"obs.task.assignee\"\n (assignmentOfTaskChanged)=\"assignmentOfTaskChanged.emit()\"\n ></valtimo-assign-user-to-task>\n </ng-container>\n</ng-template>\n", styles: ["#taskDetailModal .formio-component-submit{text-align:right}cds-modal-header .cds--modal-header{display:flex;justify-content:space-between}.save-buttons-margin{margin-top:-15px}\n/*!\n * Copyright 2015-2024 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: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i12.Modal, selector: "cds-modal, ibm-modal", inputs: ["size", "theme", "ariaLabel", "open", "trigger", "hasScrollingContent"], outputs: ["overlaySelected", "close"] }, { kind: "component", type: i12.ModalHeader, selector: "cds-modal-header, ibm-modal-header", inputs: ["theme", "closeLabel", "showCloseButton"], outputs: ["closeSelect"] }, { kind: "component", type: i9.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: AssignUserToTaskComponent, selector: "valtimo-assign-user-to-task", inputs: ["taskId", "assigneeId"], outputs: ["assignmentOfTaskChanged"] }, { kind: "component", type: TaskDetailContentComponent, selector: "valtimo-task-detail-content", inputs: ["task", "taskAndProcessLink", "modalClosed"], outputs: ["closeModalEvent", "formSubmit", "activeChange"] }, { kind: "component", type: TaskDetailIntermediateSaveComponent, selector: "valtimo-task-detail-intermediate-save", inputs: ["task", "taskAndProcessLink"], outputs: ["currentIntermediateSaveEvent", "showModalEvent"] }, { kind: "pipe", type: i6.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
1428
1541
|
}
|
|
1429
1542
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: TaskDetailModalComponent, decorators: [{
|
|
1430
1543
|
type: Component,
|
|
1431
|
-
args: [{ selector: 'valtimo-task-detail-modal', encapsulation: ViewEncapsulation.None, template: "<!--\n ~ Copyright 2015-2024 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 #taskDetailModal id=\"taskDetailModal\" [size]=\"size$ | async\">\n <cds-modal-header (closeSelect)=\"closeModal()\">\n <div class=\"title-container\">\n <p class=\"cds--modal-header__heading cds--type-beta\">{{ (page$ | async)?.title }}</p>\n\n <p class=\"cds--modal-header__label cds--type-delta\">{{ (page$ | async)?.subtitle }}</p>\n\n <p\n class=\"cds--modal-header__label cds--type-delta\"\n *ngIf=\"currentIntermediateSave$ | async as currentIntermediateSave\"\n >\n {{ 'formManagement.intermediateSave.lastSavedBy' | translate }}:\n\n {{\n currentIntermediateSave?.editedBy\n ? currentIntermediateSave?.editedBy\n : currentIntermediateSave.createdBy\n }}\n\n {{ 'formManagement.intermediateSave.on' | translate }}:\n\n {{\n currentIntermediateSave?.editedOn\n ? currentIntermediateSave?.editedOn\n : currentIntermediateSave.createdOn\n }}\n </p>\n\n <ng-container *ngTemplateOutlet=\"assignUserToTask\"></ng-container>\n </div>\n\n <valtimo-task-detail-intermediate-save\n class=\"save-buttons-margin\"\n
|
|
1544
|
+
args: [{ selector: 'valtimo-task-detail-modal', encapsulation: ViewEncapsulation.None, template: "<!--\n ~ Copyright 2015-2024 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 #taskDetailModal id=\"taskDetailModal\" [size]=\"size$ | async\">\n <cds-modal-header (closeSelect)=\"closeModal()\">\n <div class=\"title-container\">\n <p class=\"cds--modal-header__heading cds--type-beta\">{{ (page$ | async)?.title }}</p>\n\n <p class=\"cds--modal-header__label cds--type-delta\">{{ (page$ | async)?.subtitle }}</p>\n\n <p\n class=\"cds--modal-header__label cds--type-delta\"\n *ngIf=\"currentIntermediateSave$ | async as currentIntermediateSave\"\n >\n {{ 'formManagement.intermediateSave.lastSavedBy' | translate }}:\n\n {{\n currentIntermediateSave?.editedBy\n ? currentIntermediateSave?.editedBy\n : currentIntermediateSave.createdBy\n }}\n\n {{ 'formManagement.intermediateSave.on' | translate }}:\n\n {{\n currentIntermediateSave?.editedOn\n ? currentIntermediateSave?.editedOn\n : currentIntermediateSave.createdOn\n }}\n </p>\n\n <ng-container *ngTemplateOutlet=\"assignUserToTask\"></ng-container>\n </div>\n\n @if (processLinkPreloaded$ | async) {\n <valtimo-task-detail-intermediate-save\n class=\"save-buttons-margin\"\n [taskAndProcessLink]=\"taskAndProcessLink$ | async\"\n (currentIntermediateSaveEvent)=\"onCurrentIntermediateSaveEvent($event)\"\n (showModalEvent)=\"onShowModalEvent()\"\n ></valtimo-task-detail-intermediate-save>\n } @else {\n <valtimo-task-detail-intermediate-save\n class=\"save-buttons-margin\"\n [task]=\"task$ | async\"\n (currentIntermediateSaveEvent)=\"onCurrentIntermediateSaveEvent($event)\"\n (showModalEvent)=\"onShowModalEvent()\"\n ></valtimo-task-detail-intermediate-save>\n }\n </cds-modal-header>\n\n <div body class=\"cds--modal-content pb-1\">\n @if (processLinkPreloaded$ | async) {\n <valtimo-task-detail-content\n [taskAndProcessLink]=\"taskAndProcessLink$ | async\"\n [modalClosed]=\"modalCloseEvent$ | async\"\n (formSubmit)=\"onFormSubmit()\"\n (closeModalEvent)=\"closeModal()\"\n ></valtimo-task-detail-content>\n } @else {\n <valtimo-task-detail-content\n [task]=\"task$ | async\"\n [modalClosed]=\"modalCloseEvent$ | async\"\n (formSubmit)=\"onFormSubmit()\"\n (closeModalEvent)=\"closeModal()\"\n ></valtimo-task-detail-content>\n }\n </div>\n</cds-modal>\n\n<valtimo-confirmation-modal\n [showModalSubject$]=\"showConfirmationModal$\"\n (confirmEvent)=\"clearCurrentProgress()\"\n (cancelEvent)=\"showConfirmationModal$.next(false)\"\n cancelButtonType=\"ghost\"\n confirmButtonTextTranslationKey=\"interface.confirm\"\n titleTranslationKey=\"formManagement.intermediateSave.clear\"\n contentTranslationKey=\"formManagement.intermediateSave.clearConfirm\"\n></valtimo-confirmation-modal>\n\n<ng-template #assignUserToTask>\n <ng-container\n *ngIf=\"{\n task: task$ | async,\n canAssignUserToTask: canAssignUserToTask$ | async,\n } as obs\"\n >\n <valtimo-assign-user-to-task\n *ngIf=\"obs.task && obs.canAssignUserToTask && assignmentOfTaskChanged\"\n [taskId]=\"obs.task.id\"\n [assigneeId]=\"obs.task.assignee\"\n (assignmentOfTaskChanged)=\"assignmentOfTaskChanged.emit()\"\n ></valtimo-assign-user-to-task>\n </ng-container>\n</ng-template>\n", styles: ["#taskDetailModal .formio-component-submit{text-align:right}cds-modal-header .cds--modal-header{display:flex;justify-content:space-between}.save-buttons-margin{margin-top:-15px}\n/*!\n * Copyright 2015-2024 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"] }]
|
|
1432
1545
|
}], ctorParameters: () => [{ type: i1$2.Router }, { type: i3.TranslateService }, { type: i3$1.PermissionService }, { type: i4.NGXLogger }, { type: TaskIntermediateSaveService }], propDecorators: { _modal: [{
|
|
1433
1546
|
type: ViewChild,
|
|
1434
1547
|
args: ['taskDetailModal']
|
|
@@ -2106,7 +2219,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
2106
2219
|
TaskDetailContentComponent,
|
|
2107
2220
|
TaskDetailIntermediateSaveComponent,
|
|
2108
2221
|
],
|
|
2109
|
-
exports: [TaskListComponent, TaskDetailModalComponent]
|
|
2222
|
+
exports: [TaskListComponent, TaskDetailModalComponent],
|
|
2110
2223
|
}]
|
|
2111
2224
|
}] });
|
|
2112
2225
|
|