@acorex-platform/module-workflow-management-client 0.0.21
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/fesm2022/acorex-platform-module-workflow-management-client-acorex-platform-module-workflow-management-client-B_Sl7G2v.mjs +4990 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-acorex-platform-module-workflow-management-client-B_Sl7G2v.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-activity-command-configurator-widget-column.component-BPa0Sh6Z.mjs +57 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-activity-command-configurator-widget-column.component-BPa0Sh6Z.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-activity-command-configurator-widget-edit.component-DuYGXzAL.mjs +482 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-activity-command-configurator-widget-edit.component-DuYGXzAL.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-contracts.mjs +163 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-contracts.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-execute-workflow-with-input.command-BFdyJ4rC.mjs +127 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-execute-workflow-with-input.command-BFdyJ4rC.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-execute-workflow.command-Cfdm1QAy.mjs +142 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-execute-workflow.command-Cfdm1QAy.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-index-C8nsbDAw.mjs +142 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-index-C8nsbDAw.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-index-CttfExOC.mjs +417 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-index-CttfExOC.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-index-DKZTLui4.mjs +1329 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-index-DKZTLui4.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-save-workflow-definition-activities.command-spFF77AO.mjs +60 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-save-workflow-definition-activities.command-spFF77AO.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-workflow-activity-instance-rows.utils-CMVZYS4y.mjs +172 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-workflow-activity-instance-rows.utils-CMVZYS4y.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-workflow-configurator-widget-column.component-D0E2zjIA.mjs +81 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-workflow-configurator-widget-column.component-D0E2zjIA.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-workflow-configurator-widget-edit.component-CVTeOv-q.mjs +538 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-workflow-configurator-widget-edit.component-CVTeOv-q.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-workflow-live-dashboard.queries--9NtYkau.mjs +218 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-workflow-live-dashboard.queries--9NtYkau.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-workflow-run-history-popup.component-BWOyivC5.mjs +588 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-workflow-run-history-popup.component-BWOyivC5.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-workflow-run-history-timeline-tab.component-AnJ-Pywf.mjs +33 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-workflow-run-history-timeline-tab.component-AnJ-Pywf.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-workflow-run-history-visual-tab.component-Bw68Jwcb.mjs +227 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-workflow-run-history-visual-tab.component-Bw68Jwcb.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-workflow-task-popover.component-Cg4gODGo.mjs +300 -0
- package/fesm2022/acorex-platform-module-workflow-management-client-workflow-task-popover.component-Cg4gODGo.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-workflow-management-client.mjs +2 -0
- package/fesm2022/acorex-platform-module-workflow-management-client.mjs.map +1 -0
- package/package.json +28 -0
- package/types/acorex-platform-module-workflow-management-client-contracts.d.ts +341 -0
- package/types/acorex-platform-module-workflow-management-client.d.ts +1026 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { AXTranslationService } from '@acorex/core/translation';
|
|
2
|
+
import { AXPColumnWidgetComponent } from '@acorex-platform/framework-client/layout/widget-core';
|
|
3
|
+
import { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';
|
|
4
|
+
import * as i0 from '@angular/core';
|
|
5
|
+
import { inject, signal, effect, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
6
|
+
import { RootConfig } from '@acorex-platform/module-workflow-management-client/contracts';
|
|
7
|
+
|
|
8
|
+
//#region ---- Imports ----
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region ---- Component ----
|
|
11
|
+
class AXMWorkflowConfiguratorWidgetColumnComponent extends AXPColumnWidgetComponent {
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region ---- Effects ----
|
|
14
|
+
constructor() {
|
|
15
|
+
super();
|
|
16
|
+
//#region ---- Services & Dependencies ----
|
|
17
|
+
this.entityService = inject(AXPEntityService);
|
|
18
|
+
this.translation = inject(AXTranslationService);
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region ---- State Signals ----
|
|
21
|
+
this.displayTitle = signal('', /* @ts-ignore */
|
|
22
|
+
...(ngDevMode ? [{ debugName: "displayTitle" }] : /* istanbul ignore next */ []));
|
|
23
|
+
this.workflowName = signal('', /* @ts-ignore */
|
|
24
|
+
...(ngDevMode ? [{ debugName: "workflowName" }] : /* istanbul ignore next */ []));
|
|
25
|
+
effect(() => {
|
|
26
|
+
const config = this.rawValue;
|
|
27
|
+
const name = config?.workflowName?.trim() ?? '';
|
|
28
|
+
this.workflowName.set(name);
|
|
29
|
+
const definitionId = config?.workflowDefinitionId?.trim() ?? '';
|
|
30
|
+
if (!definitionId) {
|
|
31
|
+
this.displayTitle.set(name);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
void this.entityService
|
|
35
|
+
.withEntity(RootConfig.module.name, RootConfig.entities.workflowDefinition.name)
|
|
36
|
+
.data()
|
|
37
|
+
.byKey(definitionId)
|
|
38
|
+
.then((row) => {
|
|
39
|
+
const entity = row;
|
|
40
|
+
const title = this.translation.resolve(entity.title).trim();
|
|
41
|
+
this.displayTitle.set(title || name);
|
|
42
|
+
})
|
|
43
|
+
.catch(() => {
|
|
44
|
+
this.displayTitle.set(name);
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMWorkflowConfiguratorWidgetColumnComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
49
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXMWorkflowConfiguratorWidgetColumnComponent, isStandalone: true, selector: "axm-workflow-configurator-widget-column", inputs: { rawValue: "rawValue", rowData: "rowData" }, usesInheritance: true, ngImport: i0, template: `
|
|
50
|
+
@if (displayTitle()) {
|
|
51
|
+
<i class="fa-light fa-diagram-project fa-fw"></i>
|
|
52
|
+
<span [title]="displayTitle()" class="text-xs font-medium">{{ displayTitle() }}</span>
|
|
53
|
+
} @else if (workflowName()) {
|
|
54
|
+
<span [title]="workflowName()" class="text-xs font-medium">{{ workflowName() }}</span>
|
|
55
|
+
} @else {
|
|
56
|
+
<span class="text-muted">---</span>
|
|
57
|
+
}
|
|
58
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
59
|
+
}
|
|
60
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMWorkflowConfiguratorWidgetColumnComponent, decorators: [{
|
|
61
|
+
type: Component,
|
|
62
|
+
args: [{
|
|
63
|
+
selector: 'axm-workflow-configurator-widget-column',
|
|
64
|
+
template: `
|
|
65
|
+
@if (displayTitle()) {
|
|
66
|
+
<i class="fa-light fa-diagram-project fa-fw"></i>
|
|
67
|
+
<span [title]="displayTitle()" class="text-xs font-medium">{{ displayTitle() }}</span>
|
|
68
|
+
} @else if (workflowName()) {
|
|
69
|
+
<span [title]="workflowName()" class="text-xs font-medium">{{ workflowName() }}</span>
|
|
70
|
+
} @else {
|
|
71
|
+
<span class="text-muted">---</span>
|
|
72
|
+
}
|
|
73
|
+
`,
|
|
74
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
75
|
+
imports: [],
|
|
76
|
+
inputs: ['rawValue', 'rowData'],
|
|
77
|
+
}]
|
|
78
|
+
}], ctorParameters: () => [] });
|
|
79
|
+
|
|
80
|
+
export { AXMWorkflowConfiguratorWidgetColumnComponent };
|
|
81
|
+
//# sourceMappingURL=acorex-platform-module-workflow-management-client-workflow-configurator-widget-column.component-D0E2zjIA.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-workflow-management-client-workflow-configurator-widget-column.component-D0E2zjIA.mjs","sources":["../../../../libs/modules/workflow-management/client/src/lib/features/workflow-configurator/workflow-configurator-widget-column.component.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPColumnWidgetComponent } from '@acorex-platform/framework-client/layout/widget-core';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { ChangeDetectionStrategy, Component, effect, inject, signal } from '@angular/core';\nimport type { AXMWorkflowManagementWorkflowDefinitionEntityModel } from '@acorex-platform/module-workflow-management-client/contracts';\nimport { RootConfig } from '@acorex-platform/module-workflow-management-client/contracts';\nimport type { WorkflowConfiguratorValue } from './workflow-configurator.types';\n\n//#endregion\n\n//#region ---- Component ----\n\n@Component({\n selector: 'axm-workflow-configurator-widget-column',\n template: `\n @if (displayTitle()) {\n <i class=\"fa-light fa-diagram-project fa-fw\"></i> \n <span [title]=\"displayTitle()\" class=\"text-xs font-medium\">{{ displayTitle() }}</span>\n } @else if (workflowName()) {\n <span [title]=\"workflowName()\" class=\"text-xs font-medium\">{{ workflowName() }}</span>\n } @else {\n <span class=\"text-muted\">---</span>\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [],\n inputs: ['rawValue', 'rowData'],\n})\nexport class AXMWorkflowConfiguratorWidgetColumnComponent extends AXPColumnWidgetComponent<WorkflowConfiguratorValue> {\n //#region ---- Services & Dependencies ----\n\n private readonly entityService = inject(AXPEntityService);\n private readonly translation = inject(AXTranslationService);\n\n //#endregion\n\n //#region ---- State Signals ----\n\n protected displayTitle = signal('');\n\n protected workflowName = signal('');\n\n //#endregion\n\n //#region ---- Effects ----\n\n constructor() {\n super();\n effect(() => {\n const config = this.rawValue as WorkflowConfiguratorValue | undefined;\n const name = config?.workflowName?.trim() ?? '';\n this.workflowName.set(name);\n\n const definitionId = config?.workflowDefinitionId?.trim() ?? '';\n if (!definitionId) {\n this.displayTitle.set(name);\n return;\n }\n\n void this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.workflowDefinition.name)\n .data()\n .byKey(definitionId)\n .then((row) => {\n const entity = row as AXMWorkflowManagementWorkflowDefinitionEntityModel;\n const title = this.translation.resolve(entity.title).trim();\n this.displayTitle.set(title || name);\n })\n .catch(() => {\n this.displayTitle.set(name);\n });\n });\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;AAAA;AAUA;AAEA;AAkBM,MAAO,4CAA6C,SAAQ,wBAAmD,CAAA;;;AAkBnH,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;;AAhBQ,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,oBAAoB,CAAC;;;QAMjD,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,EAAE;yFAAC;QAEzB,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,EAAE;yFAAC;QAQjC,MAAM,CAAC,MAAK;AACV,YAAA,MAAM,MAAM,GAAG,IAAI,CAAC,QAAiD;YACrE,MAAM,IAAI,GAAG,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE;AAC/C,YAAA,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC;YAE3B,MAAM,YAAY,GAAG,MAAM,EAAE,oBAAoB,EAAE,IAAI,EAAE,IAAI,EAAE;YAC/D,IAAI,CAAC,YAAY,EAAE;AACjB,gBAAA,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC;gBAC3B;YACF;YAEA,KAAK,IAAI,CAAC;AACP,iBAAA,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,kBAAkB,CAAC,IAAI;AAC9E,iBAAA,IAAI;iBACJ,KAAK,CAAC,YAAY;AAClB,iBAAA,IAAI,CAAC,CAAC,GAAG,KAAI;gBACZ,MAAM,MAAM,GAAG,GAAyD;AACxE,gBAAA,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE;gBAC3D,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,IAAI,IAAI,CAAC;AACtC,YAAA,CAAC;iBACA,KAAK,CAAC,MAAK;AACV,gBAAA,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC;AAC7B,YAAA,CAAC,CAAC;AACN,QAAA,CAAC,CAAC;IACJ;8GA5CW,4CAA4C,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAA5C,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,4CAA4C,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,yCAAA,EAAA,MAAA,EAAA,EAAA,QAAA,EAAA,UAAA,EAAA,OAAA,EAAA,SAAA,EAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAd7C;;;;;;;;;AAST,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAKU,4CAA4C,EAAA,UAAA,EAAA,CAAA;kBAhBxD,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,yCAAyC;AACnD,oBAAA,QAAQ,EAAE;;;;;;;;;AAST,EAAA,CAAA;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,OAAO,EAAE,EAAE;AACX,oBAAA,MAAM,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC;AAChC,iBAAA;;;;;"}
|
|
@@ -0,0 +1,538 @@
|
|
|
1
|
+
import { mapAXPPropertyToWidgetProperty, AXPValueWidgetComponent } from '@acorex-platform/framework-client/layout/widget-core';
|
|
2
|
+
import { AXPSystemStatusType, isFormValueEqual } from '@acorex-platform/framework-shared/core';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { model, input, inject, signal, computed, effect, untracked, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
5
|
+
import { isString, castArray, get, isEqual, cloneDeep } from 'lodash';
|
|
6
|
+
import { AXTranslationService } from '@acorex/core/translation';
|
|
7
|
+
import { AXPItemConfiguratorComponent } from '@acorex-platform/framework-client/layout/components';
|
|
8
|
+
import { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';
|
|
9
|
+
import { RootConfig } from '@acorex-platform/module-workflow-management-client/contracts';
|
|
10
|
+
|
|
11
|
+
//#region ---- Imports ----
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region ---- Constants ----
|
|
14
|
+
/** Workflow inputs normally supplied when a run is started from runtime context, not on the template. */
|
|
15
|
+
const WORKFLOW_CONFIGURATOR_RUNTIME_INPUT_NAMES = new Set([
|
|
16
|
+
'employeeId',
|
|
17
|
+
'employeeDisplayName',
|
|
18
|
+
'eventTypeId',
|
|
19
|
+
'eventTypeTitle',
|
|
20
|
+
'recordTypeId',
|
|
21
|
+
'recordTypeTitle',
|
|
22
|
+
'effectiveDate',
|
|
23
|
+
'assessmentCaseTitle',
|
|
24
|
+
'targetEmployeeStatusId',
|
|
25
|
+
]);
|
|
26
|
+
/**
|
|
27
|
+
* Resolves catalog scope keys from persisted row shape (keys or enriched scopes).
|
|
28
|
+
*/
|
|
29
|
+
function resolveWorkflowCatalogScopeKeys(row) {
|
|
30
|
+
const keys = new Set();
|
|
31
|
+
for (const key of row.catalogScopeKeys ?? []) {
|
|
32
|
+
if (isString(key) && key.trim()) {
|
|
33
|
+
keys.add(key.trim());
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
for (const scope of row.catalogScopes ?? []) {
|
|
37
|
+
const name = scope?.name?.trim();
|
|
38
|
+
if (name) {
|
|
39
|
+
keys.add(name);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return [...keys];
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Builds a workflow list filter from registered scope key names.
|
|
46
|
+
*/
|
|
47
|
+
function workflowConfiguratorCatalogScopeFilterFromKeys(catalogScopeKeys) {
|
|
48
|
+
const anyOf = castArray(catalogScopeKeys ?? [])
|
|
49
|
+
.filter((k) => isString(k) && k.trim().length > 0)
|
|
50
|
+
.map((k) => k.trim());
|
|
51
|
+
return anyOf.length > 0 ? { anyOf } : undefined;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Query filter for published workflow definitions, optionally restricted by catalog scope keys.
|
|
55
|
+
*/
|
|
56
|
+
function buildWorkflowConfiguratorListQueryFilter(scopeFilter) {
|
|
57
|
+
const publishedFilter = {
|
|
58
|
+
field: 'statusId',
|
|
59
|
+
operator: { type: 'equal' },
|
|
60
|
+
value: AXPSystemStatusType.Published,
|
|
61
|
+
};
|
|
62
|
+
const anyOf = scopeFilter?.anyOf?.map((k) => k.trim()).filter(Boolean) ?? [];
|
|
63
|
+
if (anyOf.length === 0) {
|
|
64
|
+
return publishedFilter;
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
logic: 'and',
|
|
68
|
+
filters: [
|
|
69
|
+
publishedFilter,
|
|
70
|
+
{
|
|
71
|
+
logic: 'or',
|
|
72
|
+
filters: anyOf.map((scopeKey) => ({
|
|
73
|
+
field: 'catalogScopeKeys',
|
|
74
|
+
operator: { type: 'contains' },
|
|
75
|
+
value: scopeKey,
|
|
76
|
+
})),
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Returns true when the row's catalog scope keys satisfy the configurator filter.
|
|
83
|
+
*/
|
|
84
|
+
function matchesWorkflowConfiguratorCatalogScopeFilter(catalogScopeKeys, filter) {
|
|
85
|
+
if (!filter) {
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
const keys = (catalogScopeKeys ?? []).filter((k) => isString(k) && k.trim().length > 0);
|
|
89
|
+
if (filter.keyPrefix?.trim()) {
|
|
90
|
+
const prefix = filter.keyPrefix.trim();
|
|
91
|
+
if (!keys.some((k) => k.startsWith(prefix))) {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
const anyOf = filter.anyOf?.map((k) => k.trim()).filter(Boolean) ?? [];
|
|
96
|
+
if (anyOf.length > 0 && !anyOf.some((scope) => keys.includes(scope))) {
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
const allOf = filter.allOf?.map((k) => k.trim()).filter(Boolean) ?? [];
|
|
100
|
+
if (allOf.length > 0 && !allOf.every((scope) => keys.includes(scope))) {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
return true;
|
|
104
|
+
}
|
|
105
|
+
function mergeTemplateInputCatalogScopeFilter(property, templateInputFilters) {
|
|
106
|
+
const name = property.name?.trim();
|
|
107
|
+
if (!name || !templateInputFilters) {
|
|
108
|
+
return property;
|
|
109
|
+
}
|
|
110
|
+
const scopeFilter = templateInputFilters[name]?.catalogScopeKeys;
|
|
111
|
+
if (!scopeFilter) {
|
|
112
|
+
return property;
|
|
113
|
+
}
|
|
114
|
+
const values = castArray(scopeFilter).filter((v) => isString(v) && v.trim().length > 0);
|
|
115
|
+
if (values.length === 0) {
|
|
116
|
+
return property;
|
|
117
|
+
}
|
|
118
|
+
const iface = property.interface;
|
|
119
|
+
if (!iface?.options) {
|
|
120
|
+
return property;
|
|
121
|
+
}
|
|
122
|
+
const existingFilter = get(iface.options, 'filter');
|
|
123
|
+
const scopeConditions = values.map((value) => ({
|
|
124
|
+
field: 'catalogScopeKeys',
|
|
125
|
+
operator: { type: 'contains' },
|
|
126
|
+
value,
|
|
127
|
+
}));
|
|
128
|
+
const mergedFilter = scopeConditions.length === 1
|
|
129
|
+
? scopeConditions[0]
|
|
130
|
+
: { logic: 'or', filters: scopeConditions };
|
|
131
|
+
return {
|
|
132
|
+
...property,
|
|
133
|
+
interface: {
|
|
134
|
+
...iface,
|
|
135
|
+
options: {
|
|
136
|
+
...iface.options,
|
|
137
|
+
filter: existingFilter
|
|
138
|
+
? { logic: 'and', filters: [existingFilter, mergedFilter] }
|
|
139
|
+
: mergedFilter,
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
//#endregion
|
|
145
|
+
//#region ---- Mapping ----
|
|
146
|
+
/**
|
|
147
|
+
* Maps workflow definition `inputs` to property viewer rows for {@link AXPItemConfiguratorComponent}.
|
|
148
|
+
*/
|
|
149
|
+
function mapWorkflowInputsToWidgetProperties(inputs, translation, templateInputNames, templateInputFilters) {
|
|
150
|
+
const list = inputs ?? [];
|
|
151
|
+
const allowSet = templateInputNames && templateInputNames.length > 0
|
|
152
|
+
? new Set(templateInputNames)
|
|
153
|
+
: null;
|
|
154
|
+
const group = {
|
|
155
|
+
name: 'workflow-template-inputs',
|
|
156
|
+
title: '@workflow-management:workflow-configurator.configure.group-title',
|
|
157
|
+
order: 0,
|
|
158
|
+
};
|
|
159
|
+
const filtered = list.filter((property) => {
|
|
160
|
+
const name = property.name?.trim();
|
|
161
|
+
if (!name) {
|
|
162
|
+
return false;
|
|
163
|
+
}
|
|
164
|
+
if (allowSet) {
|
|
165
|
+
return allowSet.has(name);
|
|
166
|
+
}
|
|
167
|
+
return !WORKFLOW_CONFIGURATOR_RUNTIME_INPUT_NAMES.has(name);
|
|
168
|
+
});
|
|
169
|
+
return filtered.map((property, index) => mapAXPPropertyToWidgetProperty(mergeTemplateInputCatalogScopeFilter(property, templateInputFilters), {
|
|
170
|
+
group,
|
|
171
|
+
order: index,
|
|
172
|
+
valuePathPrefix: 'options',
|
|
173
|
+
resolveTitle: (prop) => typeof prop.title === 'string'
|
|
174
|
+
? prop.title
|
|
175
|
+
: (translation.resolve(prop.title) ?? prop.name),
|
|
176
|
+
resolveDescription: (prop) => prop.description === undefined
|
|
177
|
+
? undefined
|
|
178
|
+
: typeof prop.description === 'string'
|
|
179
|
+
? prop.description
|
|
180
|
+
: translation.resolve(prop.description),
|
|
181
|
+
}));
|
|
182
|
+
}
|
|
183
|
+
//#endregion
|
|
184
|
+
|
|
185
|
+
//#region ---- Imports ----
|
|
186
|
+
//#endregion
|
|
187
|
+
//#region ---- Component ----
|
|
188
|
+
/**
|
|
189
|
+
* Select a workflow definition and configure template-time inputs via {@link AXPItemConfiguratorComponent}.
|
|
190
|
+
*/
|
|
191
|
+
class AXMWorkflowConfiguratorComponent {
|
|
192
|
+
//#endregion
|
|
193
|
+
//#region ---- Lifecycle ----
|
|
194
|
+
constructor() {
|
|
195
|
+
//#region ---- Inputs ----
|
|
196
|
+
this.value = model({
|
|
197
|
+
workflowDefinitionId: '',
|
|
198
|
+
workflowName: '',
|
|
199
|
+
defaultInput: {},
|
|
200
|
+
}, /* @ts-ignore */
|
|
201
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
202
|
+
this.label = input('@workflow-management:workflow-configurator.label', /* @ts-ignore */
|
|
203
|
+
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
204
|
+
this.readonly = input(false, /* @ts-ignore */
|
|
205
|
+
...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
|
|
206
|
+
/**
|
|
207
|
+
* When set, only these workflow input names are configurable; otherwise runtime inputs are excluded by default.
|
|
208
|
+
*/
|
|
209
|
+
this.templateInputNames = input(undefined, /* @ts-ignore */
|
|
210
|
+
...(ngDevMode ? [{ debugName: "templateInputNames" }] : /* istanbul ignore next */ []));
|
|
211
|
+
/**
|
|
212
|
+
* Limits workflow definitions to rows whose {@link catalogScopeKeys} match (e.g. HR lifecycle).
|
|
213
|
+
*/
|
|
214
|
+
this.catalogScopeFilter = input(undefined, /* @ts-ignore */
|
|
215
|
+
...(ngDevMode ? [{ debugName: "catalogScopeFilter" }] : /* istanbul ignore next */ []));
|
|
216
|
+
/**
|
|
217
|
+
* Per template input lookup filters (e.g. `questionnaireId` → HR catalog scopes).
|
|
218
|
+
*/
|
|
219
|
+
this.templateInputFilters = input(undefined, /* @ts-ignore */
|
|
220
|
+
...(ngDevMode ? [{ debugName: "templateInputFilters" }] : /* istanbul ignore next */ []));
|
|
221
|
+
//#endregion
|
|
222
|
+
//#region ---- Services & Dependencies ----
|
|
223
|
+
this.entityService = inject(AXPEntityService);
|
|
224
|
+
this.translation = inject(AXTranslationService);
|
|
225
|
+
//#endregion
|
|
226
|
+
//#region ---- Class Properties ----
|
|
227
|
+
this.selectedWorkflowIdModel = model('', /* @ts-ignore */
|
|
228
|
+
...(ngDevMode ? [{ debugName: "selectedWorkflowIdModel" }] : /* istanbul ignore next */ []));
|
|
229
|
+
this.defaultInputModel = model({}, /* @ts-ignore */
|
|
230
|
+
...(ngDevMode ? [{ debugName: "defaultInputModel" }] : /* istanbul ignore next */ []));
|
|
231
|
+
this.workflows = signal([], /* @ts-ignore */
|
|
232
|
+
...(ngDevMode ? [{ debugName: "workflows" }] : /* istanbul ignore next */ []));
|
|
233
|
+
this.configuratorItems = computed(() => {
|
|
234
|
+
const names = this.templateInputNames();
|
|
235
|
+
const inputFilters = this.templateInputFilters();
|
|
236
|
+
return this.workflows().map((row) => ({
|
|
237
|
+
id: row.id,
|
|
238
|
+
title: (row.title ?? row.name),
|
|
239
|
+
icon: 'fa-light fa-diagram-project',
|
|
240
|
+
description: row.description,
|
|
241
|
+
propertyDefinitions: mapWorkflowInputsToWidgetProperties(row.inputs, this.translation, names, inputFilters),
|
|
242
|
+
}));
|
|
243
|
+
}, /* @ts-ignore */
|
|
244
|
+
...(ngDevMode ? [{ debugName: "configuratorItems" }] : /* istanbul ignore next */ []));
|
|
245
|
+
effect(() => {
|
|
246
|
+
this.catalogScopeFilter();
|
|
247
|
+
untracked(() => {
|
|
248
|
+
void this.loadWorkflowDefinitions();
|
|
249
|
+
});
|
|
250
|
+
});
|
|
251
|
+
/** Sync inner models from bound `value` only (context/discard); never from model edits. */
|
|
252
|
+
effect(() => {
|
|
253
|
+
const v = this.value();
|
|
254
|
+
const id = v?.workflowDefinitionId?.trim() ?? '';
|
|
255
|
+
const defaults = v?.defaultInput ?? {};
|
|
256
|
+
untracked(() => {
|
|
257
|
+
if (this.selectedWorkflowIdModel() !== id) {
|
|
258
|
+
this.selectedWorkflowIdModel.set(id);
|
|
259
|
+
}
|
|
260
|
+
if (!isEqual(this.defaultInputModel(), defaults)) {
|
|
261
|
+
this.defaultInputModel.set({ ...defaults });
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
});
|
|
265
|
+
effect(() => {
|
|
266
|
+
const id = this.selectedWorkflowIdModel();
|
|
267
|
+
const defaults = this.defaultInputModel();
|
|
268
|
+
const row = this.workflows().find((w) => w.id === id);
|
|
269
|
+
const current = untracked(() => this.value());
|
|
270
|
+
const next = {
|
|
271
|
+
workflowDefinitionId: id,
|
|
272
|
+
workflowName: row?.name?.trim() ??
|
|
273
|
+
(current.workflowDefinitionId === id ? (current.workflowName?.trim() ?? '') : ''),
|
|
274
|
+
defaultInput: { ...defaults },
|
|
275
|
+
};
|
|
276
|
+
const normalizedCurrent = {
|
|
277
|
+
workflowDefinitionId: current.workflowDefinitionId?.trim() ?? '',
|
|
278
|
+
workflowName: current.workflowName?.trim() ?? '',
|
|
279
|
+
defaultInput: current.defaultInput ?? {},
|
|
280
|
+
};
|
|
281
|
+
if (!isEqual(next, normalizedCurrent)) {
|
|
282
|
+
untracked(() => this.value.set(next));
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
//#endregion
|
|
287
|
+
//#region ---- Data loading ----
|
|
288
|
+
/**
|
|
289
|
+
* List queries may omit heavy fields; template input definitions require full `inputs`.
|
|
290
|
+
*/
|
|
291
|
+
async hydrateWorkflowDefinitionRow(row) {
|
|
292
|
+
if ((row.inputs?.length ?? 0) > 0) {
|
|
293
|
+
return row;
|
|
294
|
+
}
|
|
295
|
+
const id = row.id?.trim();
|
|
296
|
+
if (!id) {
|
|
297
|
+
return row;
|
|
298
|
+
}
|
|
299
|
+
try {
|
|
300
|
+
const full = (await this.entityService
|
|
301
|
+
.withEntity(RootConfig.module.name, RootConfig.entities.workflowDefinition.name)
|
|
302
|
+
.data()
|
|
303
|
+
.byKey(id));
|
|
304
|
+
if (!full?.id) {
|
|
305
|
+
return row;
|
|
306
|
+
}
|
|
307
|
+
return {
|
|
308
|
+
...row,
|
|
309
|
+
...full,
|
|
310
|
+
inputs: full.inputs ?? row.inputs,
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
catch {
|
|
314
|
+
return row;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
async loadWorkflowDefinitions() {
|
|
318
|
+
try {
|
|
319
|
+
const scopeFilter = this.catalogScopeFilter();
|
|
320
|
+
const page = await this.entityService
|
|
321
|
+
.withEntity(RootConfig.module.name, RootConfig.entities.workflowDefinition.name)
|
|
322
|
+
.data()
|
|
323
|
+
.query({
|
|
324
|
+
skip: 0,
|
|
325
|
+
take: 500,
|
|
326
|
+
filter: buildWorkflowConfiguratorListQueryFilter(scopeFilter),
|
|
327
|
+
});
|
|
328
|
+
const rows = (page.items ?? []);
|
|
329
|
+
const pinnedId = this.value()?.workflowDefinitionId?.trim();
|
|
330
|
+
const filtered = rows
|
|
331
|
+
.filter((r) => !!r.id?.trim() && !!r.name?.trim())
|
|
332
|
+
.filter((r) => {
|
|
333
|
+
if (!scopeFilter) {
|
|
334
|
+
return true;
|
|
335
|
+
}
|
|
336
|
+
if (pinnedId && r.id === pinnedId) {
|
|
337
|
+
return true;
|
|
338
|
+
}
|
|
339
|
+
const keys = resolveWorkflowCatalogScopeKeys(r);
|
|
340
|
+
return matchesWorkflowConfiguratorCatalogScopeFilter(keys, scopeFilter);
|
|
341
|
+
})
|
|
342
|
+
.sort((a, b) => {
|
|
343
|
+
const ta = this.translation.resolve(a.title).trim() || a.name;
|
|
344
|
+
const tb = this.translation.resolve(b.title).trim() || b.name;
|
|
345
|
+
return ta.localeCompare(tb, this.translation.getActiveLang(), { sensitivity: 'base' });
|
|
346
|
+
});
|
|
347
|
+
const hydrated = await Promise.all(filtered.map((row) => this.hydrateWorkflowDefinitionRow(row)));
|
|
348
|
+
if (pinnedId && !hydrated.some((r) => r.id === pinnedId)) {
|
|
349
|
+
try {
|
|
350
|
+
const pinned = (await this.entityService
|
|
351
|
+
.withEntity(RootConfig.module.name, RootConfig.entities.workflowDefinition.name)
|
|
352
|
+
.data()
|
|
353
|
+
.byKey(pinnedId));
|
|
354
|
+
if (pinned?.id) {
|
|
355
|
+
hydrated.unshift(await this.hydrateWorkflowDefinitionRow(pinned));
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
catch {
|
|
359
|
+
/* keep list as filtered */
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
this.workflows.set(hydrated);
|
|
363
|
+
}
|
|
364
|
+
catch {
|
|
365
|
+
this.workflows.set([]);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMWorkflowConfiguratorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
369
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.8", type: AXMWorkflowConfiguratorComponent, isStandalone: true, selector: "axm-workflow-configurator", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, templateInputNames: { classPropertyName: "templateInputNames", publicName: "templateInputNames", isSignal: true, isRequired: false, transformFunction: null }, catalogScopeFilter: { classPropertyName: "catalogScopeFilter", publicName: "catalogScopeFilter", isSignal: true, isRequired: false, transformFunction: null }, templateInputFilters: { classPropertyName: "templateInputFilters", publicName: "templateInputFilters", isSignal: true, isRequired: false, transformFunction: null }, selectedWorkflowIdModel: { classPropertyName: "selectedWorkflowIdModel", publicName: "selectedWorkflowIdModel", isSignal: true, isRequired: false, transformFunction: null }, defaultInputModel: { classPropertyName: "defaultInputModel", publicName: "defaultInputModel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", selectedWorkflowIdModel: "selectedWorkflowIdModelChange", defaultInputModel: "defaultInputModelChange" }, host: { properties: { "attr.readonly": "readonly() ? \"\" : null" }, classAttribute: "flex flex-col" }, ngImport: i0, template: `
|
|
370
|
+
<axp-item-configurator
|
|
371
|
+
[(selectedItemId)]="selectedWorkflowIdModel"
|
|
372
|
+
[(values)]="defaultInputModel"
|
|
373
|
+
[label]="label()"
|
|
374
|
+
[readonly]="readonly()"
|
|
375
|
+
[items]="configuratorItems()"
|
|
376
|
+
/>
|
|
377
|
+
`, isInline: true, styles: [":host([readonly]){pointer-events:none;opacity:.7}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "component", type: AXPItemConfiguratorComponent, selector: "axp-item-configurator", inputs: ["selectedItemId", "values", "label", "readonly", "items", "headerActions"], outputs: ["selectedItemIdChange", "valuesChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
378
|
+
}
|
|
379
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMWorkflowConfiguratorComponent, decorators: [{
|
|
380
|
+
type: Component,
|
|
381
|
+
args: [{ selector: 'axm-workflow-configurator', template: `
|
|
382
|
+
<axp-item-configurator
|
|
383
|
+
[(selectedItemId)]="selectedWorkflowIdModel"
|
|
384
|
+
[(values)]="defaultInputModel"
|
|
385
|
+
[label]="label()"
|
|
386
|
+
[readonly]="readonly()"
|
|
387
|
+
[items]="configuratorItems()"
|
|
388
|
+
/>
|
|
389
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
390
|
+
class: 'flex flex-col',
|
|
391
|
+
'[attr.readonly]': 'readonly() ? "" : null',
|
|
392
|
+
}, imports: [AXPItemConfiguratorComponent], styles: [":host([readonly]){pointer-events:none;opacity:.7}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
|
|
393
|
+
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], templateInputNames: [{ type: i0.Input, args: [{ isSignal: true, alias: "templateInputNames", required: false }] }], catalogScopeFilter: [{ type: i0.Input, args: [{ isSignal: true, alias: "catalogScopeFilter", required: false }] }], templateInputFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "templateInputFilters", required: false }] }], selectedWorkflowIdModel: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedWorkflowIdModel", required: false }] }, { type: i0.Output, args: ["selectedWorkflowIdModelChange"] }], defaultInputModel: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultInputModel", required: false }] }, { type: i0.Output, args: ["defaultInputModelChange"] }] } });
|
|
394
|
+
|
|
395
|
+
//#region ---- Imports ----
|
|
396
|
+
//#endregion
|
|
397
|
+
//#region ---- Component ----
|
|
398
|
+
class AXMWorkflowConfiguratorWidgetEditComponent extends AXPValueWidgetComponent {
|
|
399
|
+
constructor() {
|
|
400
|
+
super(...arguments);
|
|
401
|
+
//#region ---- Computed Properties ----
|
|
402
|
+
this.readonly = computed(() => this.options()['readonly'] ?? false, /* @ts-ignore */
|
|
403
|
+
...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
|
|
404
|
+
this.label = computed(() => this.options()['label'] || '@workflow-management:workflow-configurator.label', /* @ts-ignore */
|
|
405
|
+
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
406
|
+
this.templateInputNames = computed(() => {
|
|
407
|
+
const raw = this.options()['templateInputNames'];
|
|
408
|
+
return Array.isArray(raw) ? raw : undefined;
|
|
409
|
+
}, /* @ts-ignore */
|
|
410
|
+
...(ngDevMode ? [{ debugName: "templateInputNames" }] : /* istanbul ignore next */ []));
|
|
411
|
+
this.catalogScopeFilter = computed(() => {
|
|
412
|
+
const fromKeys = workflowConfiguratorCatalogScopeFilterFromKeys(this.options()['catalogScopeKeys']);
|
|
413
|
+
if (fromKeys) {
|
|
414
|
+
return fromKeys;
|
|
415
|
+
}
|
|
416
|
+
const raw = this.options()['catalogScopeFilter'];
|
|
417
|
+
return raw && typeof raw === 'object' ? raw : undefined;
|
|
418
|
+
}, /* @ts-ignore */
|
|
419
|
+
...(ngDevMode ? [{ debugName: "catalogScopeFilter" }] : /* istanbul ignore next */ []));
|
|
420
|
+
this.templateInputFilters = computed(() => {
|
|
421
|
+
const raw = this.options()['templateInputFilters'];
|
|
422
|
+
return raw && typeof raw === 'object'
|
|
423
|
+
? raw
|
|
424
|
+
: undefined;
|
|
425
|
+
}, /* @ts-ignore */
|
|
426
|
+
...(ngDevMode ? [{ debugName: "templateInputFilters" }] : /* istanbul ignore next */ []));
|
|
427
|
+
//#endregion
|
|
428
|
+
//#region ---- State Signals ----
|
|
429
|
+
this.isInitialized = signal(false, /* @ts-ignore */
|
|
430
|
+
...(ngDevMode ? [{ debugName: "isInitialized" }] : /* istanbul ignore next */ []));
|
|
431
|
+
//#endregion
|
|
432
|
+
//#region ---- Models ----
|
|
433
|
+
this.valueModel = model({
|
|
434
|
+
workflowDefinitionId: '',
|
|
435
|
+
workflowName: '',
|
|
436
|
+
defaultInput: {},
|
|
437
|
+
}, /* @ts-ignore */
|
|
438
|
+
...(ngDevMode ? [{ debugName: "valueModel" }] : /* istanbul ignore next */ []));
|
|
439
|
+
//#endregion
|
|
440
|
+
//#region ---- Effects ----
|
|
441
|
+
this.syncValueToConfigurator = effect(() => {
|
|
442
|
+
const value = this.getValue();
|
|
443
|
+
const normalized = normalizeWorkflowConfiguratorValue(value);
|
|
444
|
+
const currentModel = untracked(() => this.valueModel());
|
|
445
|
+
if (!isEqual(normalized, currentModel)) {
|
|
446
|
+
untracked(() => {
|
|
447
|
+
this.valueModel.set(normalized);
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
untracked(() => {
|
|
451
|
+
if (!this.isInitialized()) {
|
|
452
|
+
this.isInitialized.set(true);
|
|
453
|
+
}
|
|
454
|
+
});
|
|
455
|
+
}, /* @ts-ignore */
|
|
456
|
+
...(ngDevMode ? [{ debugName: "syncValueToConfigurator" }] : /* istanbul ignore next */ []));
|
|
457
|
+
this.syncConfiguratorToValue = effect(() => {
|
|
458
|
+
const modelValue = this.valueModel();
|
|
459
|
+
if (!untracked(() => this.isInitialized())) {
|
|
460
|
+
return;
|
|
461
|
+
}
|
|
462
|
+
const normalized = normalizeWorkflowConfiguratorValue(modelValue);
|
|
463
|
+
const payload = isEmptyWorkflowConfiguratorValue(normalized)
|
|
464
|
+
? null
|
|
465
|
+
: {
|
|
466
|
+
workflowDefinitionId: normalized.workflowDefinitionId.trim(),
|
|
467
|
+
workflowName: normalized.workflowName.trim(),
|
|
468
|
+
defaultInput: cloneDeep(normalized.defaultInput ?? {}),
|
|
469
|
+
};
|
|
470
|
+
const currentValue = untracked(() => this.getValue());
|
|
471
|
+
if (!isFormValueEqual(payload, currentValue)) {
|
|
472
|
+
untracked(() => {
|
|
473
|
+
this.setValue(payload);
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
}, /* @ts-ignore */
|
|
477
|
+
...(ngDevMode ? [{ debugName: "syncConfiguratorToValue" }] : /* istanbul ignore next */ []));
|
|
478
|
+
}
|
|
479
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMWorkflowConfiguratorWidgetEditComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
480
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXMWorkflowConfiguratorWidgetEditComponent, isStandalone: true, selector: "axm-workflow-configurator-widget-edit", inputs: { valueModel: { classPropertyName: "valueModel", publicName: "valueModel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueModel: "valueModelChange" }, usesInheritance: true, ngImport: i0, template: `
|
|
481
|
+
@if (isInitialized()) {
|
|
482
|
+
<axm-workflow-configurator
|
|
483
|
+
[(value)]="valueModel"
|
|
484
|
+
[label]="label()"
|
|
485
|
+
[readonly]="readonly()"
|
|
486
|
+
[templateInputNames]="templateInputNames()"
|
|
487
|
+
[catalogScopeFilter]="catalogScopeFilter()"
|
|
488
|
+
[templateInputFilters]="templateInputFilters()"
|
|
489
|
+
/>
|
|
490
|
+
}
|
|
491
|
+
`, isInline: true, dependencies: [{ kind: "component", type: AXMWorkflowConfiguratorComponent, selector: "axm-workflow-configurator", inputs: ["value", "label", "readonly", "templateInputNames", "catalogScopeFilter", "templateInputFilters", "selectedWorkflowIdModel", "defaultInputModel"], outputs: ["valueChange", "selectedWorkflowIdModelChange", "defaultInputModelChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
492
|
+
}
|
|
493
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMWorkflowConfiguratorWidgetEditComponent, decorators: [{
|
|
494
|
+
type: Component,
|
|
495
|
+
args: [{
|
|
496
|
+
selector: 'axm-workflow-configurator-widget-edit',
|
|
497
|
+
template: `
|
|
498
|
+
@if (isInitialized()) {
|
|
499
|
+
<axm-workflow-configurator
|
|
500
|
+
[(value)]="valueModel"
|
|
501
|
+
[label]="label()"
|
|
502
|
+
[readonly]="readonly()"
|
|
503
|
+
[templateInputNames]="templateInputNames()"
|
|
504
|
+
[catalogScopeFilter]="catalogScopeFilter()"
|
|
505
|
+
[templateInputFilters]="templateInputFilters()"
|
|
506
|
+
/>
|
|
507
|
+
}
|
|
508
|
+
`,
|
|
509
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
510
|
+
imports: [AXMWorkflowConfiguratorComponent],
|
|
511
|
+
}]
|
|
512
|
+
}], propDecorators: { valueModel: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueModel", required: false }] }, { type: i0.Output, args: ["valueModelChange"] }] } });
|
|
513
|
+
//#endregion
|
|
514
|
+
//#region ---- Helpers ----
|
|
515
|
+
function normalizeWorkflowConfiguratorValue(value) {
|
|
516
|
+
if (value && typeof value === 'object' && 'workflowDefinitionId' in value) {
|
|
517
|
+
const v = value;
|
|
518
|
+
return {
|
|
519
|
+
workflowDefinitionId: v.workflowDefinitionId ?? '',
|
|
520
|
+
workflowName: v.workflowName ?? '',
|
|
521
|
+
defaultInput: v.defaultInput ?? {},
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
return { workflowDefinitionId: '', workflowName: '', defaultInput: {} };
|
|
525
|
+
}
|
|
526
|
+
function isEmptyWorkflowConfiguratorValue(value) {
|
|
527
|
+
const id = value.workflowDefinitionId?.trim() ?? '';
|
|
528
|
+
const name = value.workflowName?.trim() ?? '';
|
|
529
|
+
const defaults = value.defaultInput ?? {};
|
|
530
|
+
const hasDefaults = Object.keys(defaults).some((key) => {
|
|
531
|
+
const entry = defaults[key];
|
|
532
|
+
return entry !== null && entry !== undefined && entry !== '';
|
|
533
|
+
});
|
|
534
|
+
return !id && !name && !hasDefaults;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
export { AXMWorkflowConfiguratorWidgetEditComponent };
|
|
538
|
+
//# sourceMappingURL=acorex-platform-module-workflow-management-client-workflow-configurator-widget-edit.component-CVTeOv-q.mjs.map
|