verben-workflow-ui 0.5.83 → 0.5.84
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/README.md +33 -2
- package/esm2022/src/lib/base/core/base-data-page.facade.mjs +412 -0
- package/esm2022/src/lib/base/core/base-data-page.service.mjs +140 -0
- package/esm2022/src/lib/base/core/base-data-page.state.mjs +216 -0
- package/esm2022/src/lib/base/handlers/filter-handler.service.mjs +138 -0
- package/esm2022/src/lib/base/handlers/search-handler.service.mjs +31 -0
- package/esm2022/src/lib/base/handlers/sort-handler.service.mjs +73 -0
- package/esm2022/src/lib/base/index.mjs +2 -0
- package/esm2022/src/lib/base/models/api-payload.mjs +7 -0
- package/esm2022/src/lib/base/models/page-config.interface.mjs +2 -0
- package/esm2022/src/lib/base/models/page-filter-tab-option.interface.mjs +2 -0
- package/esm2022/src/lib/base/public-api.mjs +14 -0
- package/esm2022/src/lib/base/utils/column-helpers.mjs +55 -0
- package/esm2022/src/lib/base/verben-workflow-ui-src-lib-base.mjs +5 -0
- package/esm2022/src/lib/components/actors/actors.component.mjs +156 -110
- package/esm2022/src/lib/components/actors/actors.config.mjs +49 -0
- package/esm2022/src/lib/components/actors/actors.facade.mjs +46 -242
- package/esm2022/src/lib/components/actors/actors.form.component.mjs +20 -24
- package/esm2022/src/lib/components/actors/actors.service.mjs +49 -62
- package/esm2022/src/lib/components/actors/actors.state.mjs +11 -80
- package/esm2022/src/lib/components/designer/components/node-selector.component.mjs +1 -3
- package/esm2022/src/lib/components/designer/components/wf-designer.component.mjs +1 -4
- package/esm2022/src/lib/components/designer/services/node-precondition.service.mjs +1 -2
- package/esm2022/src/lib/components/designer/services/wf-mapper.service.mjs +1 -2
- package/esm2022/src/lib/components/designer/services/wf-persistence.service.mjs +27 -25
- package/esm2022/src/lib/components/flowable-status/flowable-status.component.mjs +169 -102
- package/esm2022/src/lib/components/flowable-status/flowable-status.config.mjs +47 -0
- package/esm2022/src/lib/components/flowable-status/flowable-status.facade.mjs +56 -203
- package/esm2022/src/lib/components/flowable-status/flowable-status.service.mjs +25 -44
- package/esm2022/src/lib/components/flowable-status/flowable-status.state.mjs +10 -80
- package/esm2022/src/lib/components/form-control/form-control.component.mjs +1 -3
- package/esm2022/src/lib/components/form-group/form-fields/form-fields.component.mjs +2 -8
- package/esm2022/src/lib/components/form-group/form-group.component.mjs +2 -10
- package/esm2022/src/lib/components/form-response/form-response.component.mjs +1 -5
- package/esm2022/src/lib/components/form-timer/form-timer.component.mjs +1 -4
- package/esm2022/src/lib/components/forms/forms.component.mjs +1 -1
- package/esm2022/src/lib/components/my-queue/my-queue.component.mjs +1 -1
- package/esm2022/src/lib/components/my-queue/my-queue.facade.mjs +1 -20
- package/esm2022/src/lib/components/my-queue/tasks.form.component.mjs +1 -4
- package/esm2022/src/lib/components/operation-popup/operation-popup.component.mjs +1 -13
- package/esm2022/src/lib/components/operation-popup/operation-popup.facade.mjs +1 -15
- package/esm2022/src/lib/components/stage-details/stage-details.component.mjs +1 -3
- package/esm2022/src/lib/components/task-history/task-history.component.mjs +1 -5
- package/esm2022/src/lib/components/task-notification/task-notification.component.mjs +1 -1
- package/esm2022/src/lib/components/tasks/tasks.component.mjs +1 -1
- package/esm2022/src/lib/components/tasks/tasks.facade.mjs +1 -16
- package/esm2022/src/lib/components/tasks/tasks.form.component.mjs +1 -4
- package/esm2022/src/lib/components/wf/wf.component.mjs +1 -2
- package/esm2022/src/lib/components/workflow/workflow.component.mjs +2 -8
- package/esm2022/src/lib/components/workflow-designer/action-dialog/action-dialog.component.mjs +16 -10
- package/esm2022/src/lib/components/workflow-designer/actor-tags-dialog/actor-tags-dialog.component.mjs +10 -2
- package/esm2022/src/lib/components/workflow-designer/conditions-popup/conditions-popup.component.mjs +12 -1
- package/esm2022/src/lib/components/workflow-designer/decision-popup/decision-popup.component.mjs +20 -1
- package/esm2022/src/lib/components/workflow-designer/designer-canvas/designer-canvas.component.mjs +105 -66
- package/esm2022/src/lib/components/workflow-designer/designer-toolbar/designer-toolbar.component.mjs +14 -1
- package/esm2022/src/lib/components/workflow-designer/escalation-dialog/escalation-dialog.component.mjs +16 -12
- package/esm2022/src/lib/components/workflow-designer/services/connection.service.mjs +17 -2
- package/esm2022/src/lib/components/workflow-designer/services/node-management.service.mjs +23 -2
- package/esm2022/src/lib/components/workflow-designer/services/popup.service.mjs +10 -5
- package/esm2022/src/lib/components/workflow-designer/services/swimlane.service.mjs +16 -3
- package/esm2022/src/lib/components/workflow-designer/services/transformer.service.mjs +16 -1
- package/esm2022/src/lib/components/workflow-designer/stage-dialog/stage-dialog.component.mjs +16 -14
- package/esm2022/src/lib/components/workflow-designer/stage-node/stage-node.component.mjs +15 -6
- package/esm2022/src/lib/components/workflow-designer/swimlane-dialog/swimlane-dialog.component.mjs +15 -8
- package/esm2022/src/lib/components/workflow-designer/workflow-data.service.mjs +25 -1
- package/esm2022/src/lib/components/workflow-designer/workflow-designer.component.mjs +75 -23
- package/esm2022/src/lib/components/workflow-designer/workflow-designer.module.mjs +20 -1
- package/esm2022/src/lib/components/workflow-designer/workflow-designer.state.mjs +181 -18
- package/esm2022/src/lib/components/workflow-designer/workflow-designer.types.mjs +1 -1
- package/esm2022/src/lib/components/workflows/public-api.mjs +4 -1
- package/esm2022/src/lib/components/workflows/workflow-form/workflow-form.component.mjs +1 -5
- package/esm2022/src/lib/components/workflows/workflows.api.mjs +63 -0
- package/esm2022/src/lib/components/workflows/workflows.component.mjs +194 -148
- package/esm2022/src/lib/components/workflows/workflows.config.mjs +50 -0
- package/esm2022/src/lib/components/workflows/workflows.facade.mjs +106 -298
- package/esm2022/src/lib/components/workflows/workflows.service.mjs +58 -117
- package/esm2022/src/lib/components/workflows/workflows.state.mjs +12 -81
- package/esm2022/src/lib/services/environment.service.mjs +1 -2
- package/esm2022/src/lib/services/http-web-request.service.mjs +12 -10
- package/esm2022/src/lib/services/util.service.mjs +18 -16
- package/esm2022/src/lib/shared/components/base-data-view.component.mjs +1 -5
- package/fesm2022/verben-workflow-ui-src-lib-base.mjs +1055 -0
- package/fesm2022/verben-workflow-ui-src-lib-base.mjs.map +1 -0
- package/fesm2022/verben-workflow-ui-src-lib-components-actors.mjs +314 -508
- package/fesm2022/verben-workflow-ui-src-lib-components-actors.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-designer.mjs +26 -31
- package/fesm2022/verben-workflow-ui-src-lib-components-designer.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-flowable-status.mjs +289 -417
- package/fesm2022/verben-workflow-ui-src-lib-components-flowable-status.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-form-control.mjs +0 -2
- package/fesm2022/verben-workflow-ui-src-lib-components-form-control.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-form-group.mjs +2 -16
- package/fesm2022/verben-workflow-ui-src-lib-components-form-group.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-form-response.mjs +0 -4
- package/fesm2022/verben-workflow-ui-src-lib-components-form-response.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-form-timer.mjs +0 -3
- package/fesm2022/verben-workflow-ui-src-lib-components-form-timer.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-forms.mjs +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-forms.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-my-queue.mjs +1 -23
- package/fesm2022/verben-workflow-ui-src-lib-components-my-queue.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-operation-popup.mjs +0 -26
- package/fesm2022/verben-workflow-ui-src-lib-components-operation-popup.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-stage-details.mjs +0 -2
- package/fesm2022/verben-workflow-ui-src-lib-components-stage-details.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-task-history.mjs +0 -4
- package/fesm2022/verben-workflow-ui-src-lib-components-task-history.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-task-notification.mjs +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-task-notification.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-tasks.mjs +1 -19
- package/fesm2022/verben-workflow-ui-src-lib-components-tasks.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-wf.mjs +0 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-wf.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-workflow-designer.mjs +603 -158
- package/fesm2022/verben-workflow-ui-src-lib-components-workflow-designer.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-workflow.mjs +1 -7
- package/fesm2022/verben-workflow-ui-src-lib-components-workflow.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-workflows.mjs +427 -623
- package/fesm2022/verben-workflow-ui-src-lib-components-workflows.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-services.mjs +28 -25
- package/fesm2022/verben-workflow-ui-src-lib-services.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-shared.mjs +0 -4
- package/fesm2022/verben-workflow-ui-src-lib-shared.mjs.map +1 -1
- package/package.json +47 -41
- package/src/lib/base/README.md +146 -0
- package/src/lib/base/core/base-data-page.facade.d.ts +138 -0
- package/src/lib/base/core/base-data-page.service.d.ts +61 -0
- package/src/lib/base/core/base-data-page.state.d.ts +73 -0
- package/src/lib/base/handlers/filter-handler.service.d.ts +34 -0
- package/src/lib/base/handlers/search-handler.service.d.ts +20 -0
- package/src/lib/base/handlers/sort-handler.service.d.ts +30 -0
- package/src/lib/base/index.d.ts +1 -0
- package/src/lib/base/models/api-payload.d.ts +2 -0
- package/src/lib/base/models/page-config.interface.d.ts +24 -0
- package/src/lib/base/models/page-filter-tab-option.interface.d.ts +19 -0
- package/src/lib/base/public-api.d.ts +9 -0
- package/src/lib/base/utils/column-helpers.d.ts +24 -0
- package/src/lib/components/actors/actors.component.d.ts +66 -18
- package/src/lib/components/actors/actors.config.d.ts +10 -0
- package/src/lib/components/actors/actors.facade.d.ts +19 -27
- package/src/lib/components/actors/actors.form.component.d.ts +8 -8
- package/src/lib/components/actors/actors.service.d.ts +23 -43
- package/src/lib/components/actors/actors.state.d.ts +10 -27
- package/src/lib/components/flowable-status/flowable-status.component.d.ts +64 -18
- package/src/lib/components/flowable-status/flowable-status.config.d.ts +11 -0
- package/src/lib/components/flowable-status/flowable-status.facade.d.ts +19 -25
- package/src/lib/components/flowable-status/flowable-status.service.d.ts +17 -29
- package/src/lib/components/flowable-status/flowable-status.state.d.ts +7 -26
- package/src/lib/components/workflow-designer/action-dialog/action-dialog.component.d.ts +4 -0
- package/src/lib/components/workflow-designer/actor-tags-dialog/actor-tags-dialog.component.d.ts +1 -0
- package/src/lib/components/workflow-designer/conditions-popup/conditions-popup.component.d.ts +4 -0
- package/src/lib/components/workflow-designer/decision-popup/decision-popup.component.d.ts +3 -0
- package/src/lib/components/workflow-designer/designer-canvas/designer-canvas.component.d.ts +104 -0
- package/src/lib/components/workflow-designer/designer-toolbar/designer-toolbar.component.d.ts +6 -0
- package/src/lib/components/workflow-designer/escalation-dialog/escalation-dialog.component.d.ts +4 -0
- package/src/lib/components/workflow-designer/services/connection.service.d.ts +16 -0
- package/src/lib/components/workflow-designer/services/node-management.service.d.ts +22 -1
- package/src/lib/components/workflow-designer/services/popup.service.d.ts +9 -1
- package/src/lib/components/workflow-designer/services/swimlane.service.d.ts +15 -0
- package/src/lib/components/workflow-designer/services/transformer.service.d.ts +15 -0
- package/src/lib/components/workflow-designer/stage-dialog/stage-dialog.component.d.ts +3 -0
- package/src/lib/components/workflow-designer/stage-node/stage-node.component.d.ts +4 -0
- package/src/lib/components/workflow-designer/swimlane-dialog/swimlane-dialog.component.d.ts +4 -0
- package/src/lib/components/workflow-designer/workflow-data.service.d.ts +24 -0
- package/src/lib/components/workflow-designer/workflow-designer.component.d.ts +74 -0
- package/src/lib/components/workflow-designer/workflow-designer.module.d.ts +19 -0
- package/src/lib/components/workflow-designer/workflow-designer.state.d.ts +179 -0
- package/src/lib/components/workflow-designer/workflow-designer.types.d.ts +80 -0
- package/src/lib/components/workflows/public-api.d.ts +1 -0
- package/src/lib/components/workflows/workflows.api.d.ts +38 -0
- package/src/lib/components/workflows/workflows.component.d.ts +78 -29
- package/src/lib/components/workflows/workflows.config.d.ts +10 -0
- package/src/lib/components/workflows/workflows.facade.d.ts +31 -28
- package/src/lib/components/workflows/workflows.service.d.ts +28 -74
- package/src/lib/components/workflows/workflows.state.d.ts +8 -26
- package/src/lib/services/http-web-request.service.d.ts +1 -1
- package/src/lib/services/util.service.d.ts +8 -0
- package/esm2022/src/lib/components/workflows/workflows.helper.mjs +0 -21
- package/src/lib/components/workflows/workflows.helper.d.ts +0 -3
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { OnDestroy, WritableSignal } from '@angular/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { BaseModel } from 'verben-workflow-ui/src/lib/models';
|
|
4
|
+
import { UtilService } from 'verben-workflow-ui/src/lib/services';
|
|
5
|
+
import { CardData, ColumnDefinition, FilterCondition, SortCondition } from 'verben-ng-ui';
|
|
6
|
+
import { SearchHandlerService } from '../handlers/search-handler.service';
|
|
7
|
+
import { BasePageConfig } from '../models/page-config.interface';
|
|
8
|
+
import { BaseDataPageService } from './base-data-page.service';
|
|
9
|
+
import { BaseDataPageState } from './base-data-page.state';
|
|
10
|
+
import * as i0 from "@angular/core";
|
|
11
|
+
/**
|
|
12
|
+
* Abstract facade for base data pages.
|
|
13
|
+
* Orchestrates state, service, and search handler, and surfaces the host app's
|
|
14
|
+
* busy indicator / toasts through UtilService.
|
|
15
|
+
*/
|
|
16
|
+
export declare abstract class BaseDataPageFacade<T extends BaseModel> implements OnDestroy {
|
|
17
|
+
protected state: BaseDataPageState<T>;
|
|
18
|
+
protected service: BaseDataPageService<T>;
|
|
19
|
+
protected searchHandler: SearchHandlerService;
|
|
20
|
+
protected utilService: UtilService;
|
|
21
|
+
protected config: BasePageConfig<T>;
|
|
22
|
+
private destroy$;
|
|
23
|
+
private cardSelectionCleared;
|
|
24
|
+
/**
|
|
25
|
+
* The saved config record for this page (once loaded/created), retained so
|
|
26
|
+
* successive saves in a session update the same record instead of duplicating.
|
|
27
|
+
*/
|
|
28
|
+
private savedOption?;
|
|
29
|
+
constructor(state: BaseDataPageState<T>, service: BaseDataPageService<T>, searchHandler: SearchHandlerService, utilService: UtilService, config: BasePageConfig<T>);
|
|
30
|
+
getConfig(): BasePageConfig<T>;
|
|
31
|
+
getColumns(): ColumnDefinition<T>[];
|
|
32
|
+
get items$(): Observable<T[]>;
|
|
33
|
+
get isLoading$(): Observable<boolean>;
|
|
34
|
+
get totalCount$(): Observable<number>;
|
|
35
|
+
get filters$(): Observable<FilterCondition[]>;
|
|
36
|
+
get sorts$(): Observable<SortCondition[]>;
|
|
37
|
+
get searchTerm$(): Observable<string>;
|
|
38
|
+
get visibleColumns$(): Observable<ColumnDefinition<T>[]>;
|
|
39
|
+
/** Last table/card view (true = table). Restored on load, persisted on change. */
|
|
40
|
+
get isTableView$(): Observable<boolean>;
|
|
41
|
+
getIsTableViewValue(): boolean;
|
|
42
|
+
get cardData(): WritableSignal<CardData[]>;
|
|
43
|
+
get currentCardData(): WritableSignal<CardData | null>;
|
|
44
|
+
/**
|
|
45
|
+
* Emits when a refetch invalidates the current card selection.
|
|
46
|
+
* Card views listen to this to clear their own selection state.
|
|
47
|
+
*/
|
|
48
|
+
get cardSelectionCleared$(): Observable<void>;
|
|
49
|
+
loadData(): Promise<void>;
|
|
50
|
+
addItem(item: T): void;
|
|
51
|
+
loadMore(): Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* Fetch an arbitrary window without touching page state, honouring the active
|
|
54
|
+
* search, filters and sorts. Backs the export component's dataQueryFunction.
|
|
55
|
+
*/
|
|
56
|
+
loadRange(skip: number, limit: number): Promise<T[]>;
|
|
57
|
+
refresh(): Promise<void>;
|
|
58
|
+
onSearch(term: string): void;
|
|
59
|
+
private initializeSearchHandler;
|
|
60
|
+
applyFilters(filters: FilterCondition[]): Promise<void>;
|
|
61
|
+
clearFilters(): Promise<void>;
|
|
62
|
+
applySorts(sorts: SortCondition[]): Promise<void>;
|
|
63
|
+
clearSorts(): Promise<void>;
|
|
64
|
+
updateVisibleColumns(columns: ColumnDefinition<T>[]): void;
|
|
65
|
+
/**
|
|
66
|
+
* Update the table/card view flag WITHOUT persisting. Use for transient or
|
|
67
|
+
* internal switches (e.g. dropping to card view to open a create form).
|
|
68
|
+
*/
|
|
69
|
+
setViewState(isTableView: boolean): void;
|
|
70
|
+
/** Record the user's table/card choice and persist it (non-blocking). */
|
|
71
|
+
setView(isTableView: boolean): void;
|
|
72
|
+
/**
|
|
73
|
+
* Restore this page's saved config (via the host UTIL_SERVICE), then load data.
|
|
74
|
+
* Safe to call in place of loadData() from the page's ngOnInit. When the page
|
|
75
|
+
* has no `ui` (opt-out) or nothing is saved / the host doesn't support it, it
|
|
76
|
+
* just loads data.
|
|
77
|
+
*/
|
|
78
|
+
restoreSavedConfig(): Promise<void>;
|
|
79
|
+
/**
|
|
80
|
+
* Assemble the current page config and persist it through the host. Fire-and-
|
|
81
|
+
* forget: never awaited, so the triggering UI action is not blocked. No-op when
|
|
82
|
+
* the page opts out of persistence (`ui` unset).
|
|
83
|
+
*/
|
|
84
|
+
private persistConfig;
|
|
85
|
+
/** Map ordered saved column ids back onto the config's ColumnDefinitions. */
|
|
86
|
+
private rebuildColumns;
|
|
87
|
+
/** A fresh, unsaved PageFilterTabOption for this page. */
|
|
88
|
+
private newOption;
|
|
89
|
+
selectCard(cardData: CardData | null): void;
|
|
90
|
+
/**
|
|
91
|
+
* Close the detail form.
|
|
92
|
+
*
|
|
93
|
+
* Goes through clearCardSelection rather than `selectCard(null)`: nulling the
|
|
94
|
+
* signal alone only empties the form's fields, because CardDataViewComponent
|
|
95
|
+
* holds its own `currentItem` that keeps the right-hand panel on screen. The
|
|
96
|
+
* cardSelectionCleared$ notification is what lets the component tear that down.
|
|
97
|
+
*/
|
|
98
|
+
closeForm(): void;
|
|
99
|
+
/**
|
|
100
|
+
* Open the detail form for a record. Routed through selectCard so table-row
|
|
101
|
+
* edit and card click share one source of truth for the open record — the
|
|
102
|
+
* form template binds the current card, not a separate "selected item".
|
|
103
|
+
* Reuses the matching existing card when there is one.
|
|
104
|
+
*/
|
|
105
|
+
openForm(item?: T): void;
|
|
106
|
+
/**
|
|
107
|
+
* Prepend a blank record and open it. Replaces the old approach of inferring
|
|
108
|
+
* "this must be the new one" from a falsy Name, which re-opened the form
|
|
109
|
+
* whenever a refetch happened to contain a blank-named record.
|
|
110
|
+
*/
|
|
111
|
+
createItem(blank: T): T;
|
|
112
|
+
/**
|
|
113
|
+
* Stable identity, matching BaseDataPageState.getItemKey. Kept here so the
|
|
114
|
+
* facade can match cards without widening the state's protected seam.
|
|
115
|
+
*/
|
|
116
|
+
protected itemKey(item: T): string;
|
|
117
|
+
/**
|
|
118
|
+
* Drop the current card selection because the data it referred to is being
|
|
119
|
+
* replaced. Called by loadData(); deliberately not by loadMore(), which only
|
|
120
|
+
* appends and leaves an existing selection valid.
|
|
121
|
+
*/
|
|
122
|
+
protected clearCardSelection(): void;
|
|
123
|
+
/**
|
|
124
|
+
* Stamp the write state a record should be saved with.
|
|
125
|
+
*
|
|
126
|
+
* A record is new only when it has no Code yet (the backend always assigns
|
|
127
|
+
* Code on persisted records). Don't trust the loaded DataState here: records
|
|
128
|
+
* returned from the backend come through unchanged and report DataState
|
|
129
|
+
* 'New', which would force an insert (and thus duplicate) on every edit.
|
|
130
|
+
*/
|
|
131
|
+
protected withDataState(item: T): T;
|
|
132
|
+
saveItems(items: T[]): Promise<boolean>;
|
|
133
|
+
deleteItems(itemIds: string[]): Promise<boolean>;
|
|
134
|
+
exportData(): Promise<T[]>;
|
|
135
|
+
ngOnDestroy(): void;
|
|
136
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BaseDataPageFacade<any>, never>;
|
|
137
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<BaseDataPageFacade<any>>;
|
|
138
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { BaseModel, ErrorResponse, Paged, SortDirection } from 'verben-workflow-ui/src/lib/models';
|
|
2
|
+
import { HttpWebRequestService } from 'verben-workflow-ui/src/lib/services';
|
|
3
|
+
import { ColumnDefinition, FilterCondition, SortCondition } from 'verben-ng-ui';
|
|
4
|
+
import { FilterHandlerService } from '../handlers/filter-handler.service';
|
|
5
|
+
import { PrimarySort, SortHandlerService } from '../handlers/sort-handler.service';
|
|
6
|
+
import { SearchPropertyValue } from '../models/api-payload';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
/**
|
|
9
|
+
* Abstract base service for data pages.
|
|
10
|
+
* Handles list/search/save/delete with filter and sort support.
|
|
11
|
+
*
|
|
12
|
+
* The concrete URLs are built by the protected `*Url` seams below. Unlike the
|
|
13
|
+
* sibling libraries, every endpoint in the workflow API carries the sort as URL
|
|
14
|
+
* segments — `Get{Endpoint}/{skip}/{limit}/{sortParam}/{sortOrder}`, and the
|
|
15
|
+
* POST search does too — so the seams take sort parameters. Services whose
|
|
16
|
+
* endpoint names or shapes deviate (plural vs singular, query-string deletes)
|
|
17
|
+
* override just the URL rather than reimplementing `getData()`.
|
|
18
|
+
*
|
|
19
|
+
* When `baseUrl` is omitted, HttpWebRequestService falls back to the WorkFlowAPI
|
|
20
|
+
* base.
|
|
21
|
+
*/
|
|
22
|
+
export declare abstract class BaseDataPageService<T extends BaseModel> {
|
|
23
|
+
protected server: HttpWebRequestService;
|
|
24
|
+
protected filterHandler: FilterHandlerService;
|
|
25
|
+
protected sortHandler: SortHandlerService;
|
|
26
|
+
protected baseUrl?: string | undefined;
|
|
27
|
+
constructor(server: HttpWebRequestService, filterHandler: FilterHandlerService, sortHandler: SortHandlerService, baseUrl?: string | undefined);
|
|
28
|
+
/** API endpoint name (e.g. 'FlowableStatus'). Must be implemented by child classes. */
|
|
29
|
+
abstract getEndpoint(): string;
|
|
30
|
+
/** Sort property used when the user has not chosen one. */
|
|
31
|
+
protected defaultSortParam(): string;
|
|
32
|
+
protected defaultSortOrder(): SortDirection;
|
|
33
|
+
protected listUrl(skip: number, limit: number, sortParam: string, sortOrder: string): string;
|
|
34
|
+
protected searchTermUrl(term: string, skip: number, limit: number, sortParam: string, sortOrder: string): string;
|
|
35
|
+
protected filterSearchUrl(skip: number, limit: number, sortParam: string, sortOrder: string): string;
|
|
36
|
+
protected saveUrl(): string;
|
|
37
|
+
protected deleteUrl(itemIds: string[]): string;
|
|
38
|
+
buildPayload(filters: FilterCondition[], sorts: SortCondition[], columns: ColumnDefinition<T>[]): SearchPropertyValue[];
|
|
39
|
+
/** Filter-only payload (no sorts) for persisting saved filters. */
|
|
40
|
+
buildFilterPayloadOnly(filters: FilterCondition[], columns: ColumnDefinition<T>[]): SearchPropertyValue[];
|
|
41
|
+
/** Inverse of {@link buildFilterPayloadOnly}: rebuild FilterCondition[] on restore. */
|
|
42
|
+
parseFilterPayload(payload: SearchPropertyValue[], columns: ColumnDefinition<T>[]): FilterCondition[];
|
|
43
|
+
/**
|
|
44
|
+
* The sort the URL will carry: the user's first sortable selection, else the
|
|
45
|
+
* page default.
|
|
46
|
+
*/
|
|
47
|
+
protected resolveSort(sorts: SortCondition[] | undefined, columns: ColumnDefinition<T>[] | undefined): PrimarySort;
|
|
48
|
+
/**
|
|
49
|
+
* Fetch data, automatically choosing the endpoint based on parameters:
|
|
50
|
+
* search-only -> GET WithParam, filters -> POST Search, otherwise plain GET.
|
|
51
|
+
*
|
|
52
|
+
* Sorts alone do not force the POST path: the plain GET already carries sort
|
|
53
|
+
* in its URL, so a sort-only request stays a GET.
|
|
54
|
+
*/
|
|
55
|
+
getData(skip: number, limit: number, filters?: FilterCondition[], sorts?: SortCondition[], searchTerm?: string, columns?: ColumnDefinition<T>[]): Promise<Paged<T> | ErrorResponse>;
|
|
56
|
+
saveItems(items: T[]): Promise<T[] | ErrorResponse>;
|
|
57
|
+
deleteItems(itemIds: string[]): Promise<boolean | ErrorResponse>;
|
|
58
|
+
exportData(filters?: FilterCondition[], sorts?: SortCondition[], searchTerm?: string, columns?: ColumnDefinition<T>[]): Promise<T[] | ErrorResponse>;
|
|
59
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BaseDataPageService<any>, never>;
|
|
60
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<BaseDataPageService<any>>;
|
|
61
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { WritableSignal } from '@angular/core';
|
|
2
|
+
import { BehaviorSubject, Observable } from 'rxjs';
|
|
3
|
+
import { BaseModel, QueryParams } from 'verben-workflow-ui/src/lib/models';
|
|
4
|
+
import { CardData, ColumnDefinition, FilterCondition, SortCondition } from 'verben-ng-ui';
|
|
5
|
+
/**
|
|
6
|
+
* Abstract state management for base data pages.
|
|
7
|
+
* Tracks items, loading state, query params, filters, sorts, search, and
|
|
8
|
+
* visible columns. Card data is held in signals for cheap change detection.
|
|
9
|
+
*/
|
|
10
|
+
export declare abstract class BaseDataPageState<T extends BaseModel> {
|
|
11
|
+
protected updating$: BehaviorSubject<boolean>;
|
|
12
|
+
protected items$: BehaviorSubject<T[]>;
|
|
13
|
+
protected totalCount$: BehaviorSubject<number>;
|
|
14
|
+
protected queryParams$: BehaviorSubject<QueryParams<T>>;
|
|
15
|
+
protected searchTerm$: BehaviorSubject<string>;
|
|
16
|
+
protected filters$: BehaviorSubject<FilterCondition[]>;
|
|
17
|
+
protected sorts$: BehaviorSubject<SortCondition[]>;
|
|
18
|
+
protected visibleColumns$: BehaviorSubject<ColumnDefinition<T>[]>;
|
|
19
|
+
protected isTableView$: BehaviorSubject<boolean>;
|
|
20
|
+
protected cardData: WritableSignal<CardData[]>;
|
|
21
|
+
protected currentCardData: WritableSignal<CardData | null>;
|
|
22
|
+
protected cardDataMapper?: (item: T) => CardData;
|
|
23
|
+
/**
|
|
24
|
+
* Stable identity for a record. `Code` comes first: it is what every page in
|
|
25
|
+
* this library matches on, and what the backend assigns on persist. `Id` is
|
|
26
|
+
* frequently the empty string on records that came back from a save, and the
|
|
27
|
+
* lowercase `id` is a client-generated UUID that exists only on unsaved rows.
|
|
28
|
+
*/
|
|
29
|
+
protected getItemKey(item: T): string;
|
|
30
|
+
protected updateCardDataFromItems(items: T[]): void;
|
|
31
|
+
isUpdating$(): Observable<boolean>;
|
|
32
|
+
setUpdating(isUpdating: boolean): void;
|
|
33
|
+
getItems$(): Observable<T[]>;
|
|
34
|
+
getItemsValue(): T[];
|
|
35
|
+
setItems(items: T[]): void;
|
|
36
|
+
appendItems(newItems: T[]): void;
|
|
37
|
+
addItem(item: T): void;
|
|
38
|
+
updateItem(updatedItem: T): void;
|
|
39
|
+
/** Update the item when its key already exists, otherwise prepend it. */
|
|
40
|
+
upsertItem(item: T): void;
|
|
41
|
+
removeItem(itemKey: string): void;
|
|
42
|
+
clearItems(): void;
|
|
43
|
+
getTotalCount$(): Observable<number>;
|
|
44
|
+
setTotalCount(count: number): void;
|
|
45
|
+
getQueryParams$(): Observable<QueryParams<T>>;
|
|
46
|
+
getQueryParamsValue(): QueryParams<T>;
|
|
47
|
+
updateQueryParams(params: Partial<QueryParams<T>>): void;
|
|
48
|
+
resetPagination(): void;
|
|
49
|
+
incrementPagination(): void;
|
|
50
|
+
getSearchTerm$(): Observable<string>;
|
|
51
|
+
getSearchTermValue(): string;
|
|
52
|
+
setSearchTerm(term: string): void;
|
|
53
|
+
getFilters$(): Observable<FilterCondition[]>;
|
|
54
|
+
getFiltersValue(): FilterCondition[];
|
|
55
|
+
setFilters(filters: FilterCondition[]): void;
|
|
56
|
+
clearFilters(): void;
|
|
57
|
+
getSorts$(): Observable<SortCondition[]>;
|
|
58
|
+
getSortsValue(): SortCondition[];
|
|
59
|
+
setSorts(sorts: SortCondition[]): void;
|
|
60
|
+
clearSorts(): void;
|
|
61
|
+
getVisibleColumns$(): Observable<ColumnDefinition<T>[]>;
|
|
62
|
+
getVisibleColumnsValue(): ColumnDefinition<T>[];
|
|
63
|
+
setVisibleColumns(columns: ColumnDefinition<T>[]): void;
|
|
64
|
+
getIsTableView$(): Observable<boolean>;
|
|
65
|
+
getIsTableViewValue(): boolean;
|
|
66
|
+
setIsTableView(isTableView: boolean): void;
|
|
67
|
+
setCardDataMapper(mapper: (item: T) => CardData): void;
|
|
68
|
+
getCardData(): WritableSignal<CardData[]>;
|
|
69
|
+
setCardData(data: CardData[]): void;
|
|
70
|
+
getCurrentCardData(): WritableSignal<CardData | null>;
|
|
71
|
+
setCurrentCardData(data: CardData | null): void;
|
|
72
|
+
reset(): void;
|
|
73
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ColumnDefinition, FilterCondition, IDataFilter } from 'verben-ng-ui';
|
|
2
|
+
import { SearchPropertyValue } from '../models/api-payload';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Converts filter conditions emitted by the verben-ng-ui filter components into
|
|
6
|
+
* the SearchPropertyValue[] payload the search API expects.
|
|
7
|
+
*
|
|
8
|
+
* Two input shapes are supported. `lib-data-filter` emits `FilterCondition[]`,
|
|
9
|
+
* which carries a columnId and an operator and is the shape the base prefers.
|
|
10
|
+
* `verben-table-filter` emits `IDataFilter[]`, which names the property directly
|
|
11
|
+
* and has no operator; it is kept working so pages can migrate one at a time.
|
|
12
|
+
*/
|
|
13
|
+
export declare class FilterHandlerService {
|
|
14
|
+
buildFilterPayload<T>(filters: FilterCondition[] | IDataFilter[], columns: ColumnDefinition<T>[]): SearchPropertyValue[];
|
|
15
|
+
private isDataFilter;
|
|
16
|
+
private fromFilterCondition;
|
|
17
|
+
/** Legacy `verben-table-filter` shape: property name and type, no operator. */
|
|
18
|
+
private fromDataFilter;
|
|
19
|
+
/**
|
|
20
|
+
* Inverse of {@link buildFilterPayload}: rebuild FilterCondition[] from a
|
|
21
|
+
* persisted SearchPropertyValue[] (restoring saved filters). Sign-preserving,
|
|
22
|
+
* so re-running buildFilterPayload reproduces the same query.
|
|
23
|
+
*/
|
|
24
|
+
buildFilterConditions<T>(payload: SearchPropertyValue[], columns: ColumnDefinition<T>[]): FilterCondition[];
|
|
25
|
+
private mapSignToOperator;
|
|
26
|
+
private mapOperatorToSign;
|
|
27
|
+
/**
|
|
28
|
+
* Carried over from the original workflows.helper.ts so the legacy
|
|
29
|
+
* `verben-table-filter` path keeps producing the same payload types.
|
|
30
|
+
*/
|
|
31
|
+
private mapDataFilterType;
|
|
32
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FilterHandlerService, never>;
|
|
33
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<FilterHandlerService>;
|
|
34
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { OnDestroy } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Debounces search terms. Emits the term after the user stops typing.
|
|
5
|
+
* Provided per page so each page owns its own debounce stream.
|
|
6
|
+
*
|
|
7
|
+
* `search$` is a stable observable whose debounce interval is read live from
|
|
8
|
+
* `debounceMs`, so `setDebounceTime()` can be called after subscribers have
|
|
9
|
+
* attached (e.g. from a runtime `@Input`) and still take effect.
|
|
10
|
+
*/
|
|
11
|
+
export declare class SearchHandlerService implements OnDestroy {
|
|
12
|
+
private searchSubject;
|
|
13
|
+
private debounceMs;
|
|
14
|
+
search$: import("rxjs").Observable<string>;
|
|
15
|
+
search(term: string): void;
|
|
16
|
+
setDebounceTime(ms: number): void;
|
|
17
|
+
ngOnDestroy(): void;
|
|
18
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SearchHandlerService, never>;
|
|
19
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<SearchHandlerService>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ColumnDefinition, SortCondition } from 'verben-ng-ui';
|
|
2
|
+
import { SearchPropertyValue, SortDirection as ApiSortDirection } from '../models/api-payload';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/** The sort segment every list/search URL in this API ends with. */
|
|
5
|
+
export interface PrimarySort {
|
|
6
|
+
sortParam: string;
|
|
7
|
+
sortOrder: ApiSortDirection;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Converts SortCondition[] emitted by lib-data-sort into what the workflow API
|
|
11
|
+
* needs.
|
|
12
|
+
*
|
|
13
|
+
* This API carries sort in the URL — every endpoint ends
|
|
14
|
+
* `/{skip}/{limit}/{sortParam}/{sortOrder}`, including the POST search — so
|
|
15
|
+
* `buildPrimarySort()` is the load-bearing one and only the first condition can
|
|
16
|
+
* be honoured. `buildSortPayload()` still emits the full set on the POST body so
|
|
17
|
+
* multi-column sort starts working the moment the backend reads it.
|
|
18
|
+
*/
|
|
19
|
+
export declare class SortHandlerService {
|
|
20
|
+
/**
|
|
21
|
+
* Collapse the sort conditions to the single sort the URL can carry.
|
|
22
|
+
* Returns null when nothing sortable was selected, so callers fall back to
|
|
23
|
+
* the page's configured default.
|
|
24
|
+
*/
|
|
25
|
+
buildPrimarySort<T>(sorts: SortCondition[], columns: ColumnDefinition<T>[]): PrimarySort | null;
|
|
26
|
+
buildSortPayload<T>(sorts: SortCondition[], columns: ColumnDefinition<T>[]): SearchPropertyValue[];
|
|
27
|
+
private mapSortDirection;
|
|
28
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SortHandlerService, never>;
|
|
29
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<SortHandlerService>;
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './public-api';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { CardData, ColumnDefinition, FormGroupConfig } from 'verben-ng-ui';
|
|
2
|
+
/**
|
|
3
|
+
* Configuration for a base data page component.
|
|
4
|
+
* Collects all page-specific settings in one place.
|
|
5
|
+
*/
|
|
6
|
+
export interface BasePageConfig<T> {
|
|
7
|
+
columns: ColumnDefinition<T>[];
|
|
8
|
+
cardDataMapper: (item: T) => CardData;
|
|
9
|
+
endpoint: string;
|
|
10
|
+
ui?: string;
|
|
11
|
+
pageSize: number;
|
|
12
|
+
defaultSortParam?: string;
|
|
13
|
+
searchDebounceTime?: number;
|
|
14
|
+
formGroupConfig?: () => FormGroupConfig<any>;
|
|
15
|
+
enableCreate?: boolean;
|
|
16
|
+
enableImport?: boolean;
|
|
17
|
+
enableExport?: boolean;
|
|
18
|
+
enableFilter?: boolean;
|
|
19
|
+
enableSort?: boolean;
|
|
20
|
+
enableSearch?: boolean;
|
|
21
|
+
enableCardView?: boolean;
|
|
22
|
+
enableTableRowEdit?: boolean;
|
|
23
|
+
enableDelete?: boolean;
|
|
24
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BaseModel } from 'verben-workflow-ui/src/lib/models';
|
|
2
|
+
import { SearchPropertyValue } from './api-payload';
|
|
3
|
+
/**
|
|
4
|
+
* Per-user, per-page saved UI configuration (saved filters, column arrangement,
|
|
5
|
+
* last table/card view). Built here and persisted through the host app's
|
|
6
|
+
* UTIL_SERVICE, which stamps ownership (PageOwner) and talks to the backend.
|
|
7
|
+
*/
|
|
8
|
+
export interface PageFilterTabOption extends BaseModel {
|
|
9
|
+
/** UI identifier for the page (matches the host's UIs value). */
|
|
10
|
+
UIRoute: string;
|
|
11
|
+
/** Owner (logged-in user) — stamped by the host on save. */
|
|
12
|
+
PageOwner?: string;
|
|
13
|
+
/** Last view. `true` = card, `false` = table (i.e. `!isTableView`). */
|
|
14
|
+
IsCardView: boolean;
|
|
15
|
+
/** Ordered identifiers of the visible columns (`column.id`). */
|
|
16
|
+
VisibleColumns: string[];
|
|
17
|
+
/** Saved filters already in the API filter shape. */
|
|
18
|
+
SavedFilters: SearchPropertyValue[];
|
|
19
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './models/api-payload';
|
|
2
|
+
export * from './models/page-config.interface';
|
|
3
|
+
export * from './utils/column-helpers';
|
|
4
|
+
export * from './core/base-data-page.facade';
|
|
5
|
+
export * from './core/base-data-page.service';
|
|
6
|
+
export * from './core/base-data-page.state';
|
|
7
|
+
export * from './handlers/filter-handler.service';
|
|
8
|
+
export * from './handlers/search-handler.service';
|
|
9
|
+
export * from './handlers/sort-handler.service';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ColumnDefinition } from 'verben-ng-ui';
|
|
2
|
+
import { SearchPropertyValueType } from '../models/api-payload';
|
|
3
|
+
/**
|
|
4
|
+
* Extract property name from column definition.
|
|
5
|
+
* Only columns with accessorKey can be used for filter/sort — a column defined
|
|
6
|
+
* with accessorFn alone (e.g. the actors "tags" column) has no server-side
|
|
7
|
+
* property to filter or sort on.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getPropertyName<T>(column: ColumnDefinition<T>): string;
|
|
10
|
+
/**
|
|
11
|
+
* Infer API property type from column definition.
|
|
12
|
+
* Uses basic heuristics based on the accessor key name.
|
|
13
|
+
*/
|
|
14
|
+
export declare function inferPropertyType<T>(column: ColumnDefinition<T>): SearchPropertyValueType;
|
|
15
|
+
/**
|
|
16
|
+
* Find a column by its id.
|
|
17
|
+
*/
|
|
18
|
+
export declare function findColumn<T>(columns: ColumnDefinition<T>[], columnId: string): ColumnDefinition<T> | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Columns that can take part in filter/sort — i.e. those backed by a real
|
|
21
|
+
* property on the entity. Use this to feed the filter and sort builders so a
|
|
22
|
+
* display-only column never produces a payload the API cannot honour.
|
|
23
|
+
*/
|
|
24
|
+
export declare function filterableColumns<T>(columns: ColumnDefinition<T>[]): ColumnDefinition<T>[];
|
|
@@ -1,31 +1,79 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { CardData, FormGroupConfig } from 'verben-ng-ui';
|
|
1
|
+
import { OnInit, WritableSignal } from '@angular/core';
|
|
2
|
+
import { CardData, CardDataViewComponent, ColumnDefinition, DataViewComponent, FilterCondition, SortCondition } from 'verben-ng-ui';
|
|
4
3
|
import { Actor, Tag } from 'verben-workflow-ui/src/lib/models';
|
|
5
|
-
import { BaseDataViewComponent, DataViewConfig } from 'verben-workflow-ui/src/lib/shared';
|
|
6
|
-
import { ActorFacade } from './actors.facade';
|
|
7
4
|
import * as i0 from "@angular/core";
|
|
8
|
-
export declare class ActorsComponent
|
|
9
|
-
|
|
5
|
+
export declare class ActorsComponent implements OnInit {
|
|
6
|
+
cardDataView: CardDataViewComponent;
|
|
7
|
+
dataView: DataViewComponent;
|
|
10
8
|
private facade;
|
|
11
|
-
private
|
|
12
|
-
config:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
private destroyRef;
|
|
10
|
+
readonly config: import("verben-workflow-ui/src/lib/base").BasePageConfig<Actor>;
|
|
11
|
+
readonly styles: import("verben-ng-ui").TableStyles;
|
|
12
|
+
data: import("@angular/core").Signal<Actor[]>;
|
|
13
|
+
cardData: WritableSignal<CardData[]>;
|
|
14
|
+
readonly isTableView$: import("rxjs").Observable<boolean>;
|
|
15
|
+
readonly filters$: import("rxjs").Observable<FilterCondition[]>;
|
|
16
|
+
readonly restoredColumns$: import("rxjs").Observable<ColumnDefinition<Actor>[]>;
|
|
17
|
+
tags: import("@angular/core").Signal<Tag[]>;
|
|
18
|
+
formGroupConfig: WritableSignal<import("verben-ng-ui").FormGroupConfig<any>>;
|
|
19
|
+
visibleColumns: WritableSignal<ColumnDefinition<Actor>[]>;
|
|
20
|
+
selectedColumnCount: number;
|
|
21
|
+
selectedSortCount: number;
|
|
22
|
+
selectedFilterTableCount: number;
|
|
23
|
+
constructor();
|
|
24
|
+
ngOnInit(): void;
|
|
25
|
+
/**
|
|
26
|
+
* Tear down the card view's own selection.
|
|
27
|
+
*
|
|
28
|
+
* Nulling the facade's currentCardData only empties the form's fields — the
|
|
29
|
+
* CardDataViewComponent keeps a separate `currentItem`, and that is what holds
|
|
30
|
+
* the right-hand panel open. Without this the form goes blank after a search
|
|
31
|
+
* but the panel stays on screen.
|
|
32
|
+
*/
|
|
33
|
+
private clearCardView;
|
|
34
|
+
/**
|
|
35
|
+
* The record open in the detail form. Backed by the facade so a refetch can
|
|
36
|
+
* close it — loadData() clears the selection before replacing the list.
|
|
37
|
+
*/
|
|
38
|
+
get currentData(): CardData | null;
|
|
39
|
+
set currentData(value: CardData | null);
|
|
18
40
|
loadMore(): Promise<void>;
|
|
19
|
-
|
|
41
|
+
/** Backs lib-data-xport's dataQueryFunction; bound in the constructor. */
|
|
42
|
+
loadData(range: {
|
|
43
|
+
skip: number;
|
|
44
|
+
limit: number;
|
|
45
|
+
}): Promise<Actor[]>;
|
|
20
46
|
handleSearch(event: {
|
|
21
47
|
key: string;
|
|
22
48
|
value: string;
|
|
23
49
|
}): void;
|
|
24
|
-
|
|
25
|
-
|
|
50
|
+
onFilterApplied(filters: FilterCondition[]): void;
|
|
51
|
+
onSortUpdated(sorts: SortCondition[]): void;
|
|
52
|
+
onColumnsUpdated(updatedColumns: ColumnDefinition<Actor>[]): void;
|
|
53
|
+
onSave(data: Partial<Actor>): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Commit an inline table-row edit. The edits must be merged over the row at
|
|
56
|
+
* `index` — the old `(rowSave)="onSave($event.data)"` binding merged them over
|
|
57
|
+
* whichever record happened to be open in the card form instead.
|
|
58
|
+
*/
|
|
59
|
+
onRowSave(event: {
|
|
60
|
+
index: number;
|
|
61
|
+
key: number | string;
|
|
62
|
+
data: Partial<Actor>;
|
|
63
|
+
}): Promise<void>;
|
|
64
|
+
onSelectionChange(_selectedRows: Actor[]): void;
|
|
65
|
+
onViewChange(isTableView: boolean): void;
|
|
66
|
+
onStateChange(_event: {
|
|
67
|
+
key: string;
|
|
68
|
+
value: boolean;
|
|
69
|
+
}): void;
|
|
70
|
+
cardClicked(item: CardData, toggleView?: boolean): void;
|
|
71
|
+
handleExport(exportedData: Partial<Actor>[]): void;
|
|
72
|
+
handleFetchedExport({ skip, limit }: {
|
|
26
73
|
skip: number;
|
|
27
74
|
limit: number;
|
|
28
|
-
}):
|
|
75
|
+
}): void;
|
|
76
|
+
private downloadCSV;
|
|
29
77
|
static ɵfac: i0.ɵɵFactoryDeclaration<ActorsComponent, never>;
|
|
30
78
|
static ɵcmp: i0.ɵɵComponentDeclaration<ActorsComponent, "lib-actors", never, {}, {}, never, never, false, never>;
|
|
31
79
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BasePageConfig } from 'verben-workflow-ui/src/lib/base';
|
|
2
|
+
import { Actor } from 'verben-workflow-ui/src/lib/models';
|
|
3
|
+
/**
|
|
4
|
+
* Page configuration for actors.
|
|
5
|
+
*
|
|
6
|
+
* `enableCreate` is off — actors are provisioned elsewhere, and the page has
|
|
7
|
+
* never offered a create button. `enableFilter` is off until the API grows a
|
|
8
|
+
* `SearchActors` endpoint; sort rides the list GET's URL and needs no new one.
|
|
9
|
+
*/
|
|
10
|
+
export declare const ACTOR_CONFIG: BasePageConfig<Actor>;
|
|
@@ -1,37 +1,29 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import {
|
|
3
|
-
import { Actor,
|
|
2
|
+
import { BaseDataPageFacade, SearchHandlerService } from 'verben-workflow-ui/src/lib/base';
|
|
3
|
+
import { Actor, ActorTag, Tag } from 'verben-workflow-ui/src/lib/models';
|
|
4
4
|
import { UtilService } from 'verben-workflow-ui/src/lib/services';
|
|
5
5
|
import { ActorService } from './actors.service';
|
|
6
6
|
import { ActorState } from './actors.state';
|
|
7
7
|
import * as i0 from "@angular/core";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
private
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
getRequests$(): Observable<Actor[]>;
|
|
17
|
-
getTags$(): Observable<Tag[]>;
|
|
18
|
-
getActorTags$(): Observable<Tag[]>;
|
|
19
|
-
getQueryParams$(): Observable<QueryParams<Actor>>;
|
|
20
|
-
getSearchTerm$(): Observable<string>;
|
|
21
|
-
search(term: string): void;
|
|
22
|
-
private handleSearch;
|
|
23
|
-
filter(filterParams: IDataFilter[]): Promise<void>;
|
|
24
|
-
addNewRequest(task: Actor): void;
|
|
25
|
-
loadRequests(): Promise<void>;
|
|
26
|
-
loadRequestsWithParam(param: string): Promise<void>;
|
|
27
|
-
updateQueryParams(params: Partial<QueryParams<Actor>>): void;
|
|
28
|
-
addRequest(request: Partial<Actor>): Promise<void>;
|
|
29
|
-
resetPagination(): void;
|
|
30
|
-
updateRequest(request: Actor): Promise<void>;
|
|
31
|
-
loadMore(queue?: boolean): Promise<void>;
|
|
32
|
-
loadData(skip: number, limit: number): Promise<Actor[] | void>;
|
|
8
|
+
/**
|
|
9
|
+
* Facade for the actors page.
|
|
10
|
+
*/
|
|
11
|
+
export declare class ActorFacade extends BaseDataPageFacade<Actor> {
|
|
12
|
+
private actorService;
|
|
13
|
+
constructor(state: ActorState, service: ActorService, searchHandler: SearchHandlerService, utilService: UtilService);
|
|
14
|
+
get tags$(): Observable<Tag[]>;
|
|
15
|
+
get actorTags$(): Observable<ActorTag[]>;
|
|
33
16
|
loadTags(): Promise<void>;
|
|
34
17
|
loadActorTags(): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Save the record currently open in the form, merged over whatever the form
|
|
20
|
+
* did not edit. `saveItems()` decides insert vs update from the presence of a
|
|
21
|
+
* Code — the old component hardcoded `DataState: Changed` here, which meant a
|
|
22
|
+
* record without a Code was still sent as an update.
|
|
23
|
+
*/
|
|
24
|
+
save(edits: Partial<Actor>): Promise<boolean>;
|
|
25
|
+
/** Commit an inline table-row edit. Does not close the card form. */
|
|
26
|
+
saveRow(row: Actor, edits: Partial<Actor>): Promise<boolean>;
|
|
35
27
|
static ɵfac: i0.ɵɵFactoryDeclaration<ActorFacade, never>;
|
|
36
28
|
static ɵprov: i0.ɵɵInjectableDeclaration<ActorFacade>;
|
|
37
29
|
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { EventEmitter,
|
|
1
|
+
import { EventEmitter, OnInit } from '@angular/core';
|
|
2
2
|
import { FormBuilder, FormGroup } from '@angular/forms';
|
|
3
3
|
import { CardData } from 'verben-ng-ui';
|
|
4
|
-
import { Actor, Status, Tag } from 'verben-workflow-ui/src/lib/models';
|
|
5
|
-
import { ActorFacade } from './actors.facade';
|
|
4
|
+
import { Actor, ActorTag, Status, Tag } from 'verben-workflow-ui/src/lib/models';
|
|
6
5
|
import * as i0 from "@angular/core";
|
|
7
|
-
export declare class ActorsFormComponent {
|
|
6
|
+
export declare class ActorsFormComponent implements OnInit {
|
|
8
7
|
private fb;
|
|
9
|
-
private facade;
|
|
10
8
|
onSave: EventEmitter<Partial<Actor>>;
|
|
11
9
|
switchView: EventEmitter<undefined>;
|
|
12
10
|
get currentData(): CardData | null;
|
|
13
11
|
set currentData(value: CardData | null);
|
|
14
12
|
private _currentData;
|
|
13
|
+
private facade;
|
|
15
14
|
form: FormGroup;
|
|
16
|
-
tags:
|
|
17
|
-
actorTags:
|
|
15
|
+
tags: import("@angular/core").Signal<Tag[]>;
|
|
16
|
+
actorTags: import("@angular/core").Signal<ActorTag[]>;
|
|
18
17
|
statusOptions: Status[];
|
|
19
|
-
constructor(fb: FormBuilder
|
|
18
|
+
constructor(fb: FormBuilder);
|
|
19
|
+
ngOnInit(): void;
|
|
20
20
|
handleSubmit(): void;
|
|
21
21
|
static ɵfac: i0.ɵɵFactoryDeclaration<ActorsFormComponent, never>;
|
|
22
22
|
static ɵcmp: i0.ɵɵComponentDeclaration<ActorsFormComponent, "actors-form", never, { "currentData": { "alias": "currentData"; "required": false; }; }, { "onSave": "onSave"; "switchView": "switchView"; }, never, never, false, never>;
|