@valtimo/task 13.30.0 → 13.32.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.
|
@@ -1218,7 +1218,7 @@ class TaskDetailContentComponent {
|
|
|
1218
1218
|
this._processLinkId$.next(processLinkResult.processLinkId);
|
|
1219
1219
|
this.formDefinition$.next(processLinkResult.properties.formDefinition);
|
|
1220
1220
|
this.formName$.next(processLinkResult.properties.formName ?? '');
|
|
1221
|
-
this.setFormViewModelComponent();
|
|
1221
|
+
this.setFormViewModelComponent(processLinkResult.properties.formDefinition, processLinkResult.properties.formName ?? '', this.taskInstanceId$.getValue());
|
|
1222
1222
|
this.loading$.next(false);
|
|
1223
1223
|
break;
|
|
1224
1224
|
case 'url':
|
|
@@ -1242,7 +1242,7 @@ class TaskDetailContentComponent {
|
|
|
1242
1242
|
this._processLinkId$.next(processLinkResult.processLinkId);
|
|
1243
1243
|
this.formDefinition$.next(null);
|
|
1244
1244
|
this.formName$.next('');
|
|
1245
|
-
this.setFormCustomComponent(processLinkResult.properties.componentKey);
|
|
1245
|
+
this.setFormCustomComponent(processLinkResult.properties.componentKey, this.taskInstanceId$.getValue());
|
|
1246
1246
|
this.loading$.next(false);
|
|
1247
1247
|
break;
|
|
1248
1248
|
}
|
|
@@ -1300,60 +1300,57 @@ class TaskDetailContentComponent {
|
|
|
1300
1300
|
this.loading$.next(false);
|
|
1301
1301
|
}
|
|
1302
1302
|
}
|
|
1303
|
-
setFormViewModelComponent() {
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
this.
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
}
|
|
1328
|
-
}));
|
|
1329
|
-
this.getCurrentProgress(formViewModelComponent);
|
|
1330
|
-
}
|
|
1331
|
-
this._subscriptions.add(this.closeModalEvent.subscribe(() => {
|
|
1332
|
-
formViewModelComponent.destroy();
|
|
1303
|
+
setFormViewModelComponent(formDefinition, formName, taskInstanceId) {
|
|
1304
|
+
this.viewInitialized$.pipe(take$1(1)).subscribe(() => {
|
|
1305
|
+
this.formViewModelDynamicContainer.clear();
|
|
1306
|
+
if (!this.formViewModel) {
|
|
1307
|
+
return;
|
|
1308
|
+
}
|
|
1309
|
+
const formViewModelComponent = this.formViewModelDynamicContainer.createComponent(this.formViewModel.component);
|
|
1310
|
+
formViewModelComponent.instance.form = formDefinition;
|
|
1311
|
+
formViewModelComponent.instance.formName = formName;
|
|
1312
|
+
formViewModelComponent.instance.taskInstanceId = taskInstanceId;
|
|
1313
|
+
formViewModelComponent.instance.isStartForm = false;
|
|
1314
|
+
formViewModelComponent.instance.formSubmit
|
|
1315
|
+
.pipe(switchMap(() => this.task$), take$1(1))
|
|
1316
|
+
.subscribe((task) => {
|
|
1317
|
+
this.completeTask(task);
|
|
1318
|
+
});
|
|
1319
|
+
if (this.intermediateSaveEnabled) {
|
|
1320
|
+
this._subscriptions.add(formViewModelComponent.instance.submission$.subscribe(submission => {
|
|
1321
|
+
this.taskIntermediateSaveService.setSubmission(submission);
|
|
1322
|
+
}));
|
|
1323
|
+
this._subscriptions.add(this.submission$.pipe(distinctUntilChanged()).subscribe(submission => {
|
|
1324
|
+
if (submission?.data && Object.keys(submission.data).length === 0) {
|
|
1325
|
+
formViewModelComponent.instance.submission = { data: {} };
|
|
1326
|
+
}
|
|
1333
1327
|
}));
|
|
1328
|
+
this.getCurrentProgress(formViewModelComponent);
|
|
1334
1329
|
}
|
|
1330
|
+
this._subscriptions.add(this.closeModalEvent.subscribe(() => {
|
|
1331
|
+
formViewModelComponent.destroy();
|
|
1332
|
+
}));
|
|
1335
1333
|
});
|
|
1336
1334
|
}
|
|
1337
|
-
setFormCustomComponent(formCustomComponentKey) {
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
return;
|
|
1343
|
-
}
|
|
1344
|
-
let renderedComponent;
|
|
1345
|
-
this._subscriptions.add(this._formCustomComponentConfig$.subscribe((formCustomComponentConfig) => {
|
|
1346
|
-
const customComponent = formCustomComponentConfig[formCustomComponentKey];
|
|
1347
|
-
renderedComponent = this.formCustomComponentDynamicContainer.createComponent(customComponent);
|
|
1348
|
-
renderedComponent.instance.taskInstanceId = this.taskInstanceId$.value;
|
|
1349
|
-
renderedComponent.instance.submittedEvent.subscribe(() => {
|
|
1350
|
-
this.closeModalEvent.emit();
|
|
1351
|
-
});
|
|
1352
|
-
}));
|
|
1353
|
-
this._subscriptions.add(this.closeModalEvent.subscribe(() => {
|
|
1354
|
-
renderedComponent.destroy();
|
|
1355
|
-
}));
|
|
1335
|
+
setFormCustomComponent(formCustomComponentKey, taskInstanceId) {
|
|
1336
|
+
this.viewInitialized$.pipe(take$1(1)).subscribe(() => {
|
|
1337
|
+
this.formCustomComponentDynamicContainer.clear();
|
|
1338
|
+
if (!this.formCustomComponentConfig) {
|
|
1339
|
+
return;
|
|
1356
1340
|
}
|
|
1341
|
+
let renderedComponent;
|
|
1342
|
+
this._subscriptions.add(this._formCustomComponentConfig$.subscribe((formCustomComponentConfig) => {
|
|
1343
|
+
const customComponent = formCustomComponentConfig[formCustomComponentKey];
|
|
1344
|
+
renderedComponent = this.formCustomComponentDynamicContainer.createComponent(customComponent);
|
|
1345
|
+
renderedComponent.instance.taskInstanceId = taskInstanceId;
|
|
1346
|
+
renderedComponent.instance.documentId = this.task$.getValue()?.businessKey ?? null;
|
|
1347
|
+
renderedComponent.instance.submittedEvent.subscribe(() => {
|
|
1348
|
+
this.completeTask(this.task$.getValue());
|
|
1349
|
+
});
|
|
1350
|
+
}));
|
|
1351
|
+
this._subscriptions.add(this.closeModalEvent.subscribe(() => {
|
|
1352
|
+
renderedComponent.destroy();
|
|
1353
|
+
}));
|
|
1357
1354
|
});
|
|
1358
1355
|
}
|
|
1359
1356
|
resetFormDefinition() {
|
|
@@ -1375,7 +1372,7 @@ class TaskDetailContentComponent {
|
|
|
1375
1372
|
});
|
|
1376
1373
|
}
|
|
1377
1374
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TaskDetailContentComponent, deps: [{ token: i1$1.ConfigService }, { token: i2.DocumentService }, { token: i1$1.GlobalNotificationService }, { token: i2$1.IconService }, { token: i4.NGXLogger }, { token: i9.ValtimoModalService }, { token: i3.PermissionService }, { token: i7.ProcessLinkService }, { token: i1$2.Router }, { token: i9.FormIoStateService }, { token: TaskIntermediateSaveService }, { token: TaskService }, { token: i4$1.TranslateService }, { token: FORM_VIEW_MODEL_TOKEN, optional: true }, { token: FORM_CUSTOM_COMPONENT_TOKEN, optional: true }, { token: i7.UrlResolverService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1378
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: TaskDetailContentComponent, isStandalone: true, selector: "valtimo-task-detail-content", inputs: { task: "task", taskAndProcessLink: "taskAndProcessLink", modalClosed: "modalClosed" }, outputs: { closeModalEvent: "closeModalEvent", formSubmit: "formSubmit", activeChange: "activeChange", taskUpdated: "taskUpdated" }, 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-
|
|
1375
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: TaskDetailContentComponent, isStandalone: true, selector: "valtimo-task-detail-content", inputs: { task: "task", taskAndProcessLink: "taskAndProcessLink", modalClosed: "modalClosed" }, outputs: { closeModalEvent: "closeModalEvent", formSubmit: "formSubmit", activeChange: "activeChange", taskUpdated: "taskUpdated" }, 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-2026 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 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 noFormNotification: noFormNotification$ | async,\n } as obs\"\n>\n @if (obs.loading) {\n <div style=\"width: 100%; display: flex; justify-content: center; padding: 1rem\">\n <cds-loading size=\"sm\"></cds-loading>\n </div>\n } @else {\n <valtimo-form-io\n #form\n *ngIf=\"\n obs.formDefinition &&\n obs.submission &&\n obs.processLinkIsForm &&\n !obs.processLinkIsUiComponent &&\n !obs.processLinkIsFormViewModel\n \"\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 @if (obs.noFormNotification) {\n <cds-inline-notification [notificationObj]=\"obs.noFormNotification\"></cds-inline-notification>\n }\n\n @if (obs.errorMessage) {\n <cds-inline-notification\n [notificationObj]=\"{\n type: 'error',\n title: ('interface.error' | translate),\n message: obs.errorMessage,\n showClose: false,\n lowContrast: true,\n }\"\n ></cds-inline-notification>\n }\n }\n\n <div>\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: i4$1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ProcessLinkModule }, { kind: "component", type: i7.FormFlowComponent, selector: "valtimo-form-flow", inputs: ["formIoFormData", "formFlowInstanceId"], outputs: ["formFlowComplete", "formFlowChange"] }, { kind: "ngmodule", type: LoadingModule }, { kind: "component", type: i2$1.Loading, selector: "cds-loading, ibm-loading", inputs: ["title", "isActive", "size", "overlay"] }, { kind: "ngmodule", type: NotificationModule }, { kind: "component", type: i2$1.Notification, selector: "cds-notification, cds-inline-notification, ibm-notification, ibm-inline-notification", inputs: ["notificationObj"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1379
1376
|
}
|
|
1380
1377
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TaskDetailContentComponent, decorators: [{
|
|
1381
1378
|
type: Component,
|
|
@@ -1386,7 +1383,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
1386
1383
|
ProcessLinkModule,
|
|
1387
1384
|
LoadingModule,
|
|
1388
1385
|
NotificationModule,
|
|
1389
|
-
], template: "<!--\n ~ Copyright 2015-
|
|
1386
|
+
], template: "<!--\n ~ Copyright 2015-2026 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 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 noFormNotification: noFormNotification$ | async,\n } as obs\"\n>\n @if (obs.loading) {\n <div style=\"width: 100%; display: flex; justify-content: center; padding: 1rem\">\n <cds-loading size=\"sm\"></cds-loading>\n </div>\n } @else {\n <valtimo-form-io\n #form\n *ngIf=\"\n obs.formDefinition &&\n obs.submission &&\n obs.processLinkIsForm &&\n !obs.processLinkIsUiComponent &&\n !obs.processLinkIsFormViewModel\n \"\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 @if (obs.noFormNotification) {\n <cds-inline-notification [notificationObj]=\"obs.noFormNotification\"></cds-inline-notification>\n }\n\n @if (obs.errorMessage) {\n <cds-inline-notification\n [notificationObj]=\"{\n type: 'error',\n title: ('interface.error' | translate),\n message: obs.errorMessage,\n showClose: false,\n lowContrast: true,\n }\"\n ></cds-inline-notification>\n }\n }\n\n <div>\n <ng-template #formViewModelComponent></ng-template>\n <ng-template #formCustomComponent></ng-template>\n </div>\n</ng-container>\n" }]
|
|
1390
1387
|
}], ctorParameters: () => [{ type: i1$1.ConfigService }, { type: i2.DocumentService }, { type: i1$1.GlobalNotificationService }, { type: i2$1.IconService }, { type: i4.NGXLogger }, { type: i9.ValtimoModalService }, { type: i3.PermissionService }, { type: i7.ProcessLinkService }, { type: i1$2.Router }, { type: i9.FormIoStateService }, { type: TaskIntermediateSaveService }, { type: TaskService }, { type: i4$1.TranslateService }, { type: undefined, decorators: [{
|
|
1391
1388
|
type: Optional
|
|
1392
1389
|
}, {
|