@valtimo/dashboard 13.46.0 → 13.47.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/valtimo-dashboard.mjs +502 -74
- package/fesm2022/valtimo-dashboard.mjs.map +1 -1
- package/lib/data-sources/task-count/components/index.d.ts +1 -0
- package/lib/data-sources/task-count/components/index.d.ts.map +1 -1
- package/lib/data-sources/task-count/components/task-count-condition-group/index.d.ts +2 -0
- package/lib/data-sources/task-count/components/task-count-condition-group/index.d.ts.map +1 -0
- package/lib/data-sources/task-count/components/task-count-condition-group/task-count-condition-group.component.d.ts +68 -0
- package/lib/data-sources/task-count/components/task-count-condition-group/task-count-condition-group.component.d.ts.map +1 -0
- package/lib/data-sources/task-count/components/task-count-configuration/task-count-configuration.component.d.ts +43 -18
- package/lib/data-sources/task-count/components/task-count-configuration/task-count-configuration.component.d.ts.map +1 -1
- package/lib/data-sources/task-count/constants/index.d.ts +2 -0
- package/lib/data-sources/task-count/constants/index.d.ts.map +1 -0
- package/lib/data-sources/task-count/constants/task-count.test-ids.d.ts +11 -0
- package/lib/data-sources/task-count/constants/task-count.test-ids.d.ts.map +1 -0
- package/lib/data-sources/task-count/models/task-count.model.d.ts +50 -3
- package/lib/data-sources/task-count/models/task-count.model.d.ts.map +1 -1
- package/lib/data-sources/task-count/task-count.module.d.ts +2 -1
- package/lib/data-sources/task-count/task-count.module.d.ts.map +1 -1
- package/lib/data-sources/task-count/task-count.specification.d.ts.map +1 -1
- package/lib/data-sources/task-count/utils/index.d.ts +2 -0
- package/lib/data-sources/task-count/utils/index.d.ts.map +1 -0
- package/lib/data-sources/task-count/utils/task-count-conditions.utils.d.ts +27 -0
- package/lib/data-sources/task-count/utils/task-count-conditions.utils.d.ts.map +1 -0
- package/lib/models/data-source.model.d.ts +40 -1
- package/lib/models/data-source.model.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../projects/valtimo/dashboard/src/lib/data-sources/task-count/components/index.ts"],"names":[],"mappings":"AAgBA,cAAc,4BAA4B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../projects/valtimo/dashboard/src/lib/data-sources/task-count/components/index.ts"],"names":[],"mappings":"AAgBA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../projects/valtimo/dashboard/src/lib/data-sources/task-count/components/task-count-condition-group/index.ts"],"names":[],"mappings":"AAgBA,cAAc,wCAAwC,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import { FormArray, FormControl } from '@angular/forms';
|
|
3
|
+
import { ListItemWithId, MultiInputValues } from '@valtimo/components';
|
|
4
|
+
import { IconService } from 'carbon-components-angular';
|
|
5
|
+
import { ConditionGroupForm, ConditionGroupOperator } from '../../models';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* A single condition group in the task count configuration: an AND/OR selector, the group's own
|
|
9
|
+
* condition rows, and its nested groups. The component renders itself recursively, so groups can
|
|
10
|
+
* be nested to any depth - matching the backend `AndConditionGroup`/`OrConditionGroup` tree.
|
|
11
|
+
*
|
|
12
|
+
* All state lives in the [group] form: the rows are bound to the multi input as a control, and a
|
|
13
|
+
* nested group is a form in the `groups` array. Changes therefore reach the configuration component
|
|
14
|
+
* through the form itself, without this component reporting them.
|
|
15
|
+
*/
|
|
16
|
+
export declare class TaskCountConditionGroupComponent {
|
|
17
|
+
private readonly iconService;
|
|
18
|
+
group: ConditionGroupForm;
|
|
19
|
+
dataSourceKey: string;
|
|
20
|
+
disabled: boolean;
|
|
21
|
+
operatorItems: Array<ListItemWithId>;
|
|
22
|
+
/** The outermost group cannot be deleted and starts out without condition rows. */
|
|
23
|
+
root: boolean;
|
|
24
|
+
deleteGroupEvent: EventEmitter<void>;
|
|
25
|
+
protected readonly testIds: {
|
|
26
|
+
readonly caseDefinitionDropdown: "taskCountCaseDefinitionDropdown";
|
|
27
|
+
readonly conditionGroup: "taskCountConditionGroup";
|
|
28
|
+
readonly operatorSwitcher: "taskCountGroupOperatorSwitcher";
|
|
29
|
+
readonly operatorAndButton: "taskCountGroupOperatorAndButton";
|
|
30
|
+
readonly operatorOrButton: "taskCountGroupOperatorOrButton";
|
|
31
|
+
readonly operatorMirror: "taskCountGroupOperatorMirror";
|
|
32
|
+
readonly addGroupButton: "taskCountAddGroupButton";
|
|
33
|
+
readonly deleteGroupButton: "taskCountDeleteGroupButton";
|
|
34
|
+
};
|
|
35
|
+
get operator(): ConditionGroupOperator;
|
|
36
|
+
get rowsControl(): FormControl<MultiInputValues>;
|
|
37
|
+
get groups(): FormArray<ConditionGroupForm>;
|
|
38
|
+
/**
|
|
39
|
+
* Index of the connector that carries the interactive operator selector.
|
|
40
|
+
*
|
|
41
|
+
* The root renders a connector between every pair of sections, but a group has a single operator,
|
|
42
|
+
* so all of them would set the same value. Only this one is a selector; the rest mirror it as
|
|
43
|
+
* static text, to avoid suggesting that the sections can be joined by different operators.
|
|
44
|
+
*/
|
|
45
|
+
get interactiveConnectorIndex(): number;
|
|
46
|
+
constructor(iconService: IconService);
|
|
47
|
+
setOperator(operator: ConditionGroupOperator): void;
|
|
48
|
+
/**
|
|
49
|
+
* The multi input drops rows that are not filled in completely, so its value alone cannot tell a
|
|
50
|
+
* half-filled group apart from a complete one. This event does, and marks the group invalid until
|
|
51
|
+
* every row is either complete or removed.
|
|
52
|
+
*/
|
|
53
|
+
onAllRowsValid(allRowsValid: boolean): void;
|
|
54
|
+
/**
|
|
55
|
+
* Appends a section to this group, leaving the operator of the group untouched.
|
|
56
|
+
*
|
|
57
|
+
* How the sections relate is a single property of this group, shown on the connectors between
|
|
58
|
+
* them and changed there with [setOperator]. An addition deliberately does not ask for it: the
|
|
59
|
+
* operator of the group and the operator inside a section are two different levels, and the first
|
|
60
|
+
* addition has nothing to relate the new section to yet. The new section starts out combining its
|
|
61
|
+
* own conditions with 'and'; that operator is changed in the header of the section itself.
|
|
62
|
+
*/
|
|
63
|
+
addGroup(): void;
|
|
64
|
+
removeGroup(index: number): void;
|
|
65
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TaskCountConditionGroupComponent, never>;
|
|
66
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TaskCountConditionGroupComponent, "valtimo-task-count-condition-group", never, { "group": { "alias": "group"; "required": false; }; "dataSourceKey": { "alias": "dataSourceKey"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "operatorItems": { "alias": "operatorItems"; "required": false; }; "root": { "alias": "root"; "required": false; }; }, { "deleteGroupEvent": "deleteGroupEvent"; }, never, never, true, never>;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=task-count-condition-group.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-count-condition-group.component.d.ts","sourceRoot":"","sources":["../../../../../../../../projects/valtimo/dashboard/src/lib/data-sources/task-count/components/task-count-condition-group/task-count-condition-group.component.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAqC,YAAY,EAAgB,MAAM,eAAe,CAAC;AAC9F,OAAO,EAAC,SAAS,EAAE,WAAW,EAAsB,MAAM,gBAAgB,CAAC;AAC3E,OAAO,EAAyB,cAAc,EAAE,gBAAgB,EAAC,MAAM,qBAAqB,CAAC;AAE7F,OAAO,EAIL,WAAW,EAGZ,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAC,kBAAkB,EAAE,sBAAsB,EAAC,MAAM,cAAc,CAAC;;AAKxE;;;;;;;;GAQG;AACH,qBAkBa,gCAAgC;IAmC/B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAlCxB,KAAK,EAAE,kBAAkB,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,UAAS;IACjB,aAAa,EAAE,KAAK,CAAC,cAAc,CAAC,CAAM;IAC1D,mFAAmF;IACnE,IAAI,UAAS;IAEZ,gBAAgB,qBAA4B;IAE7D,SAAS,CAAC,QAAQ,CAAC,OAAO;;;;;;;;;MAAuB;IAEjD,IAAW,QAAQ,IAAI,sBAAsB,CAE5C;IAED,IAAW,WAAW,IAAI,WAAW,CAAC,gBAAgB,CAAC,CAEtD;IAED,IAAW,MAAM,IAAI,SAAS,CAAC,kBAAkB,CAAC,CAEjD;IAED;;;;;;OAMG;IACH,IAAW,yBAAyB,IAAI,MAAM,CAE7C;gBAE4B,WAAW,EAAE,WAAW;IAI9C,WAAW,CAAC,QAAQ,EAAE,sBAAsB,GAAG,IAAI;IAQ1D;;;;OAIG;IACI,cAAc,CAAC,YAAY,EAAE,OAAO,GAAG,IAAI;IAIlD;;;;;;;;OAQG;IACI,QAAQ,IAAI,IAAI;IAIhB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;yCArE5B,gCAAgC;2CAAhC,gCAAgC;CAwE5C"}
|
|
@@ -1,33 +1,58 @@
|
|
|
1
1
|
import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { ListItemWithId, MultiInputKeyValue, MultiInputValues } from '@valtimo/components';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { ListItem, NotificationContent } from 'carbon-components-angular';
|
|
4
|
+
import { ListItemWithId } from '@valtimo/components';
|
|
5
|
+
import { DocumentService } from '@valtimo/document';
|
|
7
6
|
import { TranslateService } from '@ngx-translate/core';
|
|
7
|
+
import { ConfigurationOutput, DataSourceConfigurationComponent } from '../../../../models';
|
|
8
|
+
import { WidgetTranslationService } from '../../../../services';
|
|
9
|
+
import { TaskCountConfiguration } from '../../models';
|
|
8
10
|
import * as i0 from "@angular/core";
|
|
9
11
|
export declare class TaskCountConfigurationComponent implements OnInit, OnDestroy, DataSourceConfigurationComponent {
|
|
10
|
-
private readonly
|
|
12
|
+
private readonly documentService;
|
|
11
13
|
private readonly translateService;
|
|
14
|
+
private readonly widgetTranslationService;
|
|
12
15
|
dataSourceKey: string;
|
|
13
|
-
readonly form: import("@angular/forms").FormGroup<{
|
|
14
|
-
queryConditions: import("@angular/forms").FormControl<any>;
|
|
15
|
-
}>;
|
|
16
16
|
set disabled(disabledValue: boolean);
|
|
17
|
-
private readonly _OPERATORS;
|
|
18
|
-
readonly operatorItems$: Observable<Array<ListItemWithId>>;
|
|
19
|
-
readonly defaultConditionValues$: BehaviorSubject<MultiInputValues>;
|
|
20
|
-
readonly allConditionsValid$: BehaviorSubject<boolean>;
|
|
21
|
-
get queryConditions(): AbstractControl<QueryCondition[]>;
|
|
22
17
|
set prefillConfiguration(configurationValue: TaskCountConfiguration);
|
|
23
18
|
configurationEvent: EventEmitter<ConfigurationOutput<TaskCountConfiguration>>;
|
|
19
|
+
readonly $disabled: import("@angular/core").WritableSignal<boolean>;
|
|
20
|
+
/**
|
|
21
|
+
* The whole condition tree. Kept for the lifetime of the component - a prefill resets its
|
|
22
|
+
* contents - so that the subscription below survives it.
|
|
23
|
+
*/
|
|
24
|
+
readonly conditionsForm: import("@valtimo/dashboard").ConditionGroupForm;
|
|
25
|
+
protected readonly testIds: {
|
|
26
|
+
readonly caseDefinitionDropdown: "taskCountCaseDefinitionDropdown";
|
|
27
|
+
readonly conditionGroup: "taskCountConditionGroup";
|
|
28
|
+
readonly operatorSwitcher: "taskCountGroupOperatorSwitcher";
|
|
29
|
+
readonly operatorAndButton: "taskCountGroupOperatorAndButton";
|
|
30
|
+
readonly operatorOrButton: "taskCountGroupOperatorOrButton";
|
|
31
|
+
readonly operatorMirror: "taskCountGroupOperatorMirror";
|
|
32
|
+
readonly addGroupButton: "taskCountAddGroupButton";
|
|
33
|
+
readonly deleteGroupButton: "taskCountDeleteGroupButton";
|
|
34
|
+
};
|
|
35
|
+
private readonly _$selectedCaseDefinitionName;
|
|
36
|
+
private readonly _serializedConditions$;
|
|
37
|
+
readonly hasUnsupportedConditions$: Observable<boolean>;
|
|
38
|
+
/**
|
|
39
|
+
* Emits once and then on every language change. Subscribing to a translation is the only way to
|
|
40
|
+
* be notified, so the lists below are rebuilt whenever this fires.
|
|
41
|
+
*/
|
|
42
|
+
private readonly _languageChange$;
|
|
43
|
+
readonly caseDefinitionItems$: Observable<Array<ListItem>>;
|
|
44
|
+
readonly operatorItems$: Observable<Array<ListItemWithId>>;
|
|
45
|
+
readonly unsupportedConditionsNotification$: Observable<NotificationContent>;
|
|
24
46
|
private readonly _subscriptions;
|
|
25
|
-
constructor(
|
|
47
|
+
constructor(documentService: DocumentService, translateService: TranslateService, widgetTranslationService: WidgetTranslationService);
|
|
26
48
|
ngOnInit(): void;
|
|
27
49
|
ngOnDestroy(): void;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
50
|
+
caseDefinitionSelected(event: {
|
|
51
|
+
item?: ListItem;
|
|
52
|
+
}): void;
|
|
53
|
+
/** Rows are a form control, so the multi input follows the form, not a [disabled] binding. */
|
|
54
|
+
private applyDisabledState;
|
|
55
|
+
private emit;
|
|
31
56
|
static ɵfac: i0.ɵɵFactoryDeclaration<TaskCountConfigurationComponent, never>;
|
|
32
57
|
static ɵcmp: i0.ɵɵComponentDeclaration<TaskCountConfigurationComponent, "ng-component", never, { "dataSourceKey": { "alias": "dataSourceKey"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "prefillConfiguration": { "alias": "prefillConfiguration"; "required": false; }; }, { "configurationEvent": "configurationEvent"; }, never, never, false, never>;
|
|
33
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-count-configuration.component.d.ts","sourceRoot":"","sources":["../../../../../../../../projects/valtimo/dashboard/src/lib/data-sources/task-count/components/task-count-configuration/task-count-configuration.component.ts"],"names":[],"mappings":"AAgBA,OAAO,EAGL,YAAY,EAEZ,SAAS,EACT,MAAM,
|
|
1
|
+
{"version":3,"file":"task-count-configuration.component.d.ts","sourceRoot":"","sources":["../../../../../../../../projects/valtimo/dashboard/src/lib/data-sources/task-count/components/task-count-configuration/task-count-configuration.component.ts"],"names":[],"mappings":"AAgBA,OAAO,EAGL,YAAY,EAEZ,SAAS,EACT,MAAM,EAGP,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAqB,UAAU,EAAuC,MAAM,MAAM,CAAC;AAC1F,OAAO,EAAC,QAAQ,EAAE,mBAAmB,EAAC,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,gBAAgB,EAAC,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAC,mBAAmB,EAAE,gCAAgC,EAAC,MAAM,oBAAoB,CAAC;AACzF,OAAO,EAAC,wBAAwB,EAAC,MAAM,sBAAsB,CAAC;AAE9D,OAAO,EAAsB,sBAAsB,EAAC,MAAM,cAAc,CAAC;;AAQzE,qBAMa,+BACX,YAAW,MAAM,EAAE,SAAS,EAAE,gCAAgC;IAuG5D,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,wBAAwB;IAvG3B,aAAa,EAAE,MAAM,CAAC;IAEtC,IAAoB,QAAQ,CAAC,aAAa,EAAE,OAAO,EAGlD;IAED,IAAoB,oBAAoB,CAAC,kBAAkB,EAAE,sBAAsB,EAYlF;IAEgB,kBAAkB,4DAE/B;IAEJ,SAAgB,SAAS,kDAA0B;IAEnD;;;OAGG;IACH,SAAgB,cAAc,kDAA+B;IAE7D,SAAS,CAAC,QAAQ,CAAC,OAAO;;;;;;;;;MAAuB;IAGjD,OAAO,CAAC,QAAQ,CAAC,4BAA4B,CAAyC;IAEtF,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAIrC;IAEF,SAAgB,yBAAyB,EAAE,UAAU,CAAC,OAAO,CAAC,CAE5D;IAEF;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAEqB;IAEtD,SAAgB,oBAAoB,EAAE,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAiB/D;IAEF,SAAgB,cAAc,EAAE,UAAU,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAQ/D;IAEF,SAAgB,kCAAkC,EAAE,UAAU,CAAC,mBAAmB,CAAC,CAW/E;IAEJ,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAsB;gBAGlC,eAAe,EAAE,eAAe,EAChC,gBAAgB,EAAE,gBAAgB,EAClC,wBAAwB,EAAE,wBAAwB;IAG9D,QAAQ,IAAI,IAAI;IAKhB,WAAW,IAAI,IAAI;IAInB,sBAAsB,CAAC,KAAK,EAAE;QAAC,IAAI,CAAC,EAAE,QAAQ,CAAA;KAAC,GAAG,IAAI;IAS7D,8FAA8F;IAC9F,OAAO,CAAC,kBAAkB;IAM1B,OAAO,CAAC,IAAI;yCAtID,+BAA+B;2CAA/B,+BAA+B;CAwJ3C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../projects/valtimo/dashboard/src/lib/data-sources/task-count/constants/index.ts"],"names":[],"mappings":"AAgBA,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const TASK_COUNT_TEST_IDS: {
|
|
2
|
+
readonly caseDefinitionDropdown: "taskCountCaseDefinitionDropdown";
|
|
3
|
+
readonly conditionGroup: "taskCountConditionGroup";
|
|
4
|
+
readonly operatorSwitcher: "taskCountGroupOperatorSwitcher";
|
|
5
|
+
readonly operatorAndButton: "taskCountGroupOperatorAndButton";
|
|
6
|
+
readonly operatorOrButton: "taskCountGroupOperatorOrButton";
|
|
7
|
+
readonly operatorMirror: "taskCountGroupOperatorMirror";
|
|
8
|
+
readonly addGroupButton: "taskCountAddGroupButton";
|
|
9
|
+
readonly deleteGroupButton: "taskCountDeleteGroupButton";
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=task-count.test-ids.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-count.test-ids.d.ts","sourceRoot":"","sources":["../../../../../../../projects/valtimo/dashboard/src/lib/data-sources/task-count/constants/task-count.test-ids.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,mBAAmB;;;;;;;;;CAStB,CAAC"}
|
|
@@ -1,6 +1,53 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FormArray, FormControl, FormGroup } from '@angular/forms';
|
|
2
|
+
import { MultiInputValues } from '@valtimo/components';
|
|
3
|
+
import { WireConditionNode } from '../../../models';
|
|
2
4
|
interface TaskCountConfiguration {
|
|
3
|
-
|
|
5
|
+
caseDefinitionName?: string;
|
|
6
|
+
conditions?: WireConditionNode[];
|
|
7
|
+
/** Legacy alias for [conditions], used by configuration saved before groups existed. */
|
|
8
|
+
queryConditions?: WireConditionNode[];
|
|
4
9
|
}
|
|
5
|
-
|
|
10
|
+
type ConditionGroupOperator = 'and' | 'or';
|
|
11
|
+
interface ConditionGroupControls {
|
|
12
|
+
/** Combines the rows and the nested groups of this group, mirroring `and`/`or` on the backend. */
|
|
13
|
+
operator: FormControl<ConditionGroupOperator>;
|
|
14
|
+
/**
|
|
15
|
+
* The conditions of this group. Held as a single control because the multi input writes the whole
|
|
16
|
+
* set of rows at once; it only ever contains complete rows, incomplete ones are reported through
|
|
17
|
+
* [rowsComplete].
|
|
18
|
+
*/
|
|
19
|
+
rows: FormControl<MultiInputValues>;
|
|
20
|
+
/** False while the multi input holds a row that is not filled in completely. */
|
|
21
|
+
rowsComplete: FormControl<boolean>;
|
|
22
|
+
groups: FormArray<ConditionGroupForm>;
|
|
23
|
+
/**
|
|
24
|
+
* Children the editor cannot render (array values for the `in` operator, operators outside the
|
|
25
|
+
* dropdown). Kept so that configuration authored in a file survives an edit in the admin UI.
|
|
26
|
+
*/
|
|
27
|
+
unsupportedNodes: FormControl<WireConditionNode[]>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A single condition group as a form. Groups nest to arbitrary depth through [groups], so the
|
|
31
|
+
* validity of the whole tree is the validity of this form.
|
|
32
|
+
*
|
|
33
|
+
* Declared as an interface rather than a type alias, so that the group can reference itself.
|
|
34
|
+
*/
|
|
35
|
+
interface ConditionGroupForm extends FormGroup<ConditionGroupControls> {
|
|
36
|
+
}
|
|
37
|
+
/** The raw value of a [ConditionGroupForm], which is what the serializer walks. */
|
|
38
|
+
interface ConditionGroupValue {
|
|
39
|
+
operator: ConditionGroupOperator;
|
|
40
|
+
rows: MultiInputValues;
|
|
41
|
+
rowsComplete: boolean;
|
|
42
|
+
groups: ConditionGroupValue[];
|
|
43
|
+
unsupportedNodes: WireConditionNode[];
|
|
44
|
+
}
|
|
45
|
+
/** The result of walking a [ConditionGroupValue] tree once. */
|
|
46
|
+
interface SerializedConditionGroup {
|
|
47
|
+
/** The group as a wire node, or null when it holds no condition at all. */
|
|
48
|
+
node: WireConditionNode | null;
|
|
49
|
+
/** True when the tree holds nodes the editor cannot render. */
|
|
50
|
+
hasUnsupportedNodes: boolean;
|
|
51
|
+
}
|
|
52
|
+
export { TaskCountConfiguration, ConditionGroupOperator, ConditionGroupControls, ConditionGroupForm, ConditionGroupValue, SerializedConditionGroup, };
|
|
6
53
|
//# sourceMappingURL=task-count.model.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-count.model.d.ts","sourceRoot":"","sources":["../../../../../../../projects/valtimo/dashboard/src/lib/data-sources/task-count/models/task-count.model.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"task-count.model.d.ts","sourceRoot":"","sources":["../../../../../../../projects/valtimo/dashboard/src/lib/data-sources/task-count/models/task-count.model.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAC,SAAS,EAAE,WAAW,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAC,gBAAgB,EAAC,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAC,iBAAiB,EAAC,MAAM,iBAAiB,CAAC;AAElD,UAAU,sBAAsB;IAC9B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACjC,wFAAwF;IACxF,eAAe,CAAC,EAAE,iBAAiB,EAAE,CAAC;CACvC;AAED,KAAK,sBAAsB,GAAG,KAAK,GAAG,IAAI,CAAC;AAE3C,UAAU,sBAAsB;IAC9B,kGAAkG;IAClG,QAAQ,EAAE,WAAW,CAAC,sBAAsB,CAAC,CAAC;IAC9C;;;;OAIG;IACH,IAAI,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAC;IACpC,gFAAgF;IAChF,YAAY,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IACnC,MAAM,EAAE,SAAS,CAAC,kBAAkB,CAAC,CAAC;IACtC;;;OAGG;IACH,gBAAgB,EAAE,WAAW,CAAC,iBAAiB,EAAE,CAAC,CAAC;CACpD;AAED;;;;;GAKG;AACH,UAAU,kBAAmB,SAAQ,SAAS,CAAC,sBAAsB,CAAC;CAAG;AAEzE,mFAAmF;AACnF,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,sBAAsB,CAAC;IACjC,IAAI,EAAE,gBAAgB,CAAC;IACvB,YAAY,EAAE,OAAO,CAAC;IACtB,MAAM,EAAE,mBAAmB,EAAE,CAAC;IAC9B,gBAAgB,EAAE,iBAAiB,EAAE,CAAC;CACvC;AAED,+DAA+D;AAC/D,UAAU,wBAAwB;IAChC,2EAA2E;IAC3E,IAAI,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC/B,+DAA+D;IAC/D,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAED,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,GACzB,CAAC"}
|
|
@@ -5,9 +5,10 @@ import * as i3 from "@angular/forms";
|
|
|
5
5
|
import * as i4 from "../../pipes/widget-translate/widget-translate-pipe.module";
|
|
6
6
|
import * as i5 from "carbon-components-angular";
|
|
7
7
|
import * as i6 from "@valtimo/components";
|
|
8
|
+
import * as i7 from "./components/task-count-condition-group/task-count-condition-group.component";
|
|
8
9
|
export declare class TaskCountDataSourceModule {
|
|
9
10
|
static ɵfac: i0.ɵɵFactoryDeclaration<TaskCountDataSourceModule, never>;
|
|
10
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<TaskCountDataSourceModule, [typeof i1.TaskCountConfigurationComponent], [typeof i2.CommonModule, typeof i3.ReactiveFormsModule, typeof i4.WidgetTranslatePipeModule, typeof i5.InputModule, typeof i5.DropdownModule, typeof i6.CarbonMultiInputModule], [typeof i1.TaskCountConfigurationComponent]>;
|
|
11
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<TaskCountDataSourceModule, [typeof i1.TaskCountConfigurationComponent], [typeof i2.CommonModule, typeof i3.ReactiveFormsModule, typeof i4.WidgetTranslatePipeModule, typeof i5.InputModule, typeof i5.DropdownModule, typeof i6.CarbonMultiInputModule, typeof i5.ButtonModule, typeof i5.ContentSwitcherModule, typeof i5.IconModule, typeof i5.LayerModule, typeof i5.NotificationModule, typeof i5.TilesModule, typeof i7.TaskCountConditionGroupComponent], [typeof i7.TaskCountConditionGroupComponent, typeof i1.TaskCountConfigurationComponent]>;
|
|
11
12
|
static ɵinj: i0.ɵɵInjectorDeclaration<TaskCountDataSourceModule>;
|
|
12
13
|
}
|
|
13
14
|
//# sourceMappingURL=task-count.module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-count.module.d.ts","sourceRoot":"","sources":["../../../../../../projects/valtimo/dashboard/src/lib/data-sources/task-count/task-count.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"task-count.module.d.ts","sourceRoot":"","sources":["../../../../../../projects/valtimo/dashboard/src/lib/data-sources/task-count/task-count.module.ts"],"names":[],"mappings":";;;;;;;;AAmCA,qBAoBa,yBAAyB;yCAAzB,yBAAyB;0CAAzB,yBAAyB;0CAAzB,yBAAyB;CAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-count.specification.d.ts","sourceRoot":"","sources":["../../../../../../projects/valtimo/dashboard/src/lib/data-sources/task-count/task-count.specification.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAC,uBAAuB,EAAC,MAAM,cAAc,CAAC;AAIrD,eAAO,MAAM,sBAAsB,EAAE,
|
|
1
|
+
{"version":3,"file":"task-count.specification.d.ts","sourceRoot":"","sources":["../../../../../../projects/valtimo/dashboard/src/lib/data-sources/task-count/task-count.specification.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAC,uBAAuB,EAAC,MAAM,cAAc,CAAC;AAIrD,eAAO,MAAM,sBAAsB,EAAE,uBA2DpC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../projects/valtimo/dashboard/src/lib/data-sources/task-count/utils/index.ts"],"names":[],"mappings":"AAgBA,cAAc,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { MultiInputKeyValue, MultiInputValues } from '@valtimo/components';
|
|
2
|
+
import { ExpressionOperator } from '@valtimo/shared';
|
|
3
|
+
import { WireConditionNode } from '../../../models';
|
|
4
|
+
import { ConditionGroupForm, ConditionGroupOperator, ConditionGroupValue, SerializedConditionGroup } from '../models';
|
|
5
|
+
/** The operators the condition rows offer. Anything else is preserved but not editable. */
|
|
6
|
+
export declare const EDITABLE_CONDITION_OPERATORS: Array<ExpressionOperator>;
|
|
7
|
+
export declare function createConditionGroup(operator: ConditionGroupOperator, rows?: MultiInputValues, unsupportedNodes?: WireConditionNode[]): ConditionGroupForm;
|
|
8
|
+
export declare function createEmptyConditionRow(): MultiInputKeyValue;
|
|
9
|
+
/**
|
|
10
|
+
* Applies the conditions of a stored configuration to [root], leaving the form instance itself
|
|
11
|
+
* intact so that subscriptions on it survive a prefill.
|
|
12
|
+
*
|
|
13
|
+
* A single group at the top level is adopted as the root group itself, so that its operator
|
|
14
|
+
* survives a save/reload round-trip. Anything else - including a legacy flat list of conditions -
|
|
15
|
+
* becomes a set of children combined with AND, matching the backend's list semantics.
|
|
16
|
+
*/
|
|
17
|
+
export declare function resetRootGroup(root: ConditionGroupForm, nodes: WireConditionNode[]): void;
|
|
18
|
+
/**
|
|
19
|
+
* Walks [group] once and collects the wire node to emit and whether the tree holds nodes the editor
|
|
20
|
+
* cannot render.
|
|
21
|
+
*
|
|
22
|
+
* Groups without a single condition serialize to `null`: the backend rejects empty `and`/`or`
|
|
23
|
+
* groups, because `cb.or()` without predicates evaluates to false and would silently zero out the
|
|
24
|
+
* count.
|
|
25
|
+
*/
|
|
26
|
+
export declare function serializeConditionGroup(group: ConditionGroupValue): SerializedConditionGroup;
|
|
27
|
+
//# sourceMappingURL=task-count-conditions.utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-count-conditions.utils.d.ts","sourceRoot":"","sources":["../../../../../../../projects/valtimo/dashboard/src/lib/data-sources/task-count/utils/task-count-conditions.utils.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAC,kBAAkB,EAAE,gBAAgB,EAAC,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAKL,iBAAiB,EAElB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,mBAAmB,EACnB,wBAAwB,EACzB,MAAM,WAAW,CAAC;AAEnB,2FAA2F;AAC3F,eAAO,MAAM,4BAA4B,EAAE,KAAK,CAAC,kBAAkB,CAOlE,CAAC;AAEF,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,sBAAsB,EAChC,IAAI,GAAE,gBAAqB,EAC3B,gBAAgB,GAAE,iBAAiB,EAAO,GACzC,kBAAkB,CAepB;AAED,wBAAgB,uBAAuB,IAAI,kBAAkB,CAE5D;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,kBAAkB,EAAE,KAAK,EAAE,iBAAiB,EAAE,GAAG,IAAI,CAWzF;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,mBAAmB,GAAG,wBAAwB,CAqB5F"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Type } from '@angular/core';
|
|
2
|
+
import { ExpressionOperator } from '@valtimo/shared';
|
|
2
3
|
import { DataSourceConfigurationComponent } from './configuration.model';
|
|
3
4
|
interface DataSourceSpecification {
|
|
4
5
|
dataSourceKey: string;
|
|
@@ -15,5 +16,43 @@ interface QueryCondition {
|
|
|
15
16
|
queryOperator: string;
|
|
16
17
|
queryValue: string;
|
|
17
18
|
}
|
|
18
|
-
|
|
19
|
+
/**
|
|
20
|
+
* A single condition as the configuration UI writes it: canonical keys and a scalar value.
|
|
21
|
+
*/
|
|
22
|
+
interface ConditionLeaf {
|
|
23
|
+
path: string;
|
|
24
|
+
operator: ExpressionOperator;
|
|
25
|
+
value: string | number | boolean;
|
|
26
|
+
}
|
|
27
|
+
interface AndConditionGroup {
|
|
28
|
+
and: ConditionNode[];
|
|
29
|
+
}
|
|
30
|
+
interface OrConditionGroup {
|
|
31
|
+
or: ConditionNode[];
|
|
32
|
+
}
|
|
33
|
+
type ConditionGroup = AndConditionGroup | OrConditionGroup;
|
|
34
|
+
type ConditionNode = ConditionLeaf | ConditionGroup;
|
|
35
|
+
/**
|
|
36
|
+
* A condition tree in the shape it can actually arrive in from the backend: leaves may use the
|
|
37
|
+
* legacy [[QueryCondition]] aliases, values may be arrays (for the `in` operator) and operators
|
|
38
|
+
* may be ones the configuration UI has no input for. Narrow to [[ConditionNode]] before relying
|
|
39
|
+
* on a leaf's contents; nodes that cannot be narrowed are passed through unchanged.
|
|
40
|
+
*/
|
|
41
|
+
interface WireConditionLeaf {
|
|
42
|
+
path?: string;
|
|
43
|
+
operator?: string;
|
|
44
|
+
value?: unknown;
|
|
45
|
+
queryPath?: string;
|
|
46
|
+
queryOperator?: string;
|
|
47
|
+
queryValue?: unknown;
|
|
48
|
+
}
|
|
49
|
+
interface WireAndConditionGroup {
|
|
50
|
+
and: WireConditionNode[];
|
|
51
|
+
}
|
|
52
|
+
interface WireOrConditionGroup {
|
|
53
|
+
or: WireConditionNode[];
|
|
54
|
+
}
|
|
55
|
+
type WireConditionGroup = WireAndConditionGroup | WireOrConditionGroup;
|
|
56
|
+
type WireConditionNode = WireConditionLeaf | WireConditionGroup;
|
|
57
|
+
export { DataSourceSpecification, QueryCondition, ConditionLeaf, AndConditionGroup, OrConditionGroup, ConditionGroup, ConditionNode, WireConditionLeaf, WireAndConditionGroup, WireOrConditionGroup, WireConditionGroup, WireConditionNode, };
|
|
19
58
|
//# sourceMappingURL=data-source.model.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-source.model.d.ts","sourceRoot":"","sources":["../../../../../projects/valtimo/dashboard/src/lib/models/data-source.model.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAC,IAAI,EAAC,MAAM,eAAe,CAAC;AACnC,OAAO,EAAC,gCAAgC,EAAC,MAAM,uBAAuB,CAAC;AAEvE,UAAU,uBAAuB;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,sBAAsB,CAAC,EAAE,IAAI,CAAC,gCAAgC,CAAC,CAAC;IAChE,YAAY,EAAE;QACZ,CAAC,OAAO,EAAE,MAAM,GAAG;YACjB,KAAK,EAAE,MAAM,CAAC;YACd,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAAC;SAClC,CAAC;KACH,CAAC;CACH;AAED,UAAU,cAAc;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,OAAO,
|
|
1
|
+
{"version":3,"file":"data-source.model.d.ts","sourceRoot":"","sources":["../../../../../projects/valtimo/dashboard/src/lib/models/data-source.model.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAC,IAAI,EAAC,MAAM,eAAe,CAAC;AACnC,OAAO,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAC,gCAAgC,EAAC,MAAM,uBAAuB,CAAC;AAEvE,UAAU,uBAAuB;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,sBAAsB,CAAC,EAAE,IAAI,CAAC,gCAAgC,CAAC,CAAC;IAChE,YAAY,EAAE;QACZ,CAAC,OAAO,EAAE,MAAM,GAAG;YACjB,KAAK,EAAE,MAAM,CAAC;YACd,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAAC;SAClC,CAAC;KACH,CAAC;CACH;AAED,UAAU,cAAc;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,UAAU,aAAa;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;CAClC;AAED,UAAU,iBAAiB;IACzB,GAAG,EAAE,aAAa,EAAE,CAAC;CACtB;AAED,UAAU,gBAAgB;IACxB,EAAE,EAAE,aAAa,EAAE,CAAC;CACrB;AAED,KAAK,cAAc,GAAG,iBAAiB,GAAG,gBAAgB,CAAC;AAE3D,KAAK,aAAa,GAAG,aAAa,GAAG,cAAc,CAAC;AAEpD;;;;;GAKG;AACH,UAAU,iBAAiB;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,UAAU,qBAAqB;IAC7B,GAAG,EAAE,iBAAiB,EAAE,CAAC;CAC1B;AAED,UAAU,oBAAoB;IAC5B,EAAE,EAAE,iBAAiB,EAAE,CAAC;CACzB;AAED,KAAK,kBAAkB,GAAG,qBAAqB,GAAG,oBAAoB,CAAC;AAEvE,KAAK,iBAAiB,GAAG,iBAAiB,GAAG,kBAAkB,CAAC;AAEhE,OAAO,EACL,uBAAuB,EACvB,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,GAClB,CAAC"}
|