@mj-biz-apps/tasks-ng 1.0.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/components/approval-decision-panel/approval-decision-panel.component.d.ts +70 -0
- package/dist/lib/components/approval-decision-panel/approval-decision-panel.component.d.ts.map +1 -0
- package/dist/lib/components/approval-decision-panel/approval-decision-panel.component.js +288 -0
- package/dist/lib/components/approval-decision-panel/approval-decision-panel.component.js.map +1 -0
- package/dist/lib/components/approval-inbox/approval-inbox.component.d.ts +60 -0
- package/dist/lib/components/approval-inbox/approval-inbox.component.d.ts.map +1 -0
- package/dist/lib/components/approval-inbox/approval-inbox.component.js +276 -0
- package/dist/lib/components/approval-inbox/approval-inbox.component.js.map +1 -0
- package/dist/lib/components/my-tasks/my-tasks.component.js +2 -2
- package/dist/lib/components/task-assignee-list/task-assignee-list.component.js +2 -2
- package/dist/lib/components/task-bulk-actions-bar/task-bulk-actions-bar.component.js +2 -2
- package/dist/lib/components/task-dashboard/task-dashboard.component.js +2 -2
- package/dist/lib/components/task-detail-panel/task-detail-panel.component.js +2 -2
- package/dist/lib/components/task-edit-panel/task-edit-panel.component.js +2 -2
- package/dist/lib/components/task-kanban/task-kanban.component.js +12 -12
- package/dist/lib/components/task-kanban/task-kanban.component.js.map +1 -1
- package/dist/lib/components/task-list/task-list.component.js +2 -2
- package/dist/lib/components/task-panel/task-panel.component.js +2 -2
- package/dist/lib/components/task-priority-badge/task-priority-badge.component.js +2 -2
- package/dist/lib/components/task-template-wizard/task-template-wizard.component.js +2 -2
- package/dist/lib/generated/Entities/mjBizAppsTasksTask/mjbizappstaskstask.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/mjBizAppsTasksTask/mjbizappstaskstask.form.component.js +31 -13
- package/dist/lib/generated/Entities/mjBizAppsTasksTask/mjbizappstaskstask.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/mjBizAppsTasksTaskAssignment/mjbizappstaskstaskassignment.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/mjBizAppsTasksTaskAssignment/mjbizappstaskstaskassignment.form.component.js +25 -6
- package/dist/lib/generated/Entities/mjBizAppsTasksTaskAssignment/mjbizappstaskstaskassignment.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/mjBizAppsTasksTaskDecision/mjbizappstaskstaskdecision.form.component.d.ts +10 -0
- package/dist/lib/generated/Entities/mjBizAppsTasksTaskDecision/mjbizappstaskstaskdecision.form.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/mjBizAppsTasksTaskDecision/mjbizappstaskstaskdecision.form.component.js +67 -0
- package/dist/lib/generated/Entities/mjBizAppsTasksTaskDecision/mjbizappstaskstaskdecision.form.component.js.map +1 -0
- package/dist/lib/generated/Entities/mjBizAppsTasksTaskDecisionOutcome/mjbizappstaskstaskdecisionoutcome.form.component.d.ts +10 -0
- package/dist/lib/generated/Entities/mjBizAppsTasksTaskDecisionOutcome/mjbizappstaskstaskdecisionoutcome.form.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/mjBizAppsTasksTaskDecisionOutcome/mjbizappstaskstaskdecisionoutcome.form.component.js +86 -0
- package/dist/lib/generated/Entities/mjBizAppsTasksTaskDecisionOutcome/mjbizappstaskstaskdecisionoutcome.form.component.js.map +1 -0
- package/dist/lib/generated/Entities/mjBizAppsTasksTaskType/mjbizappstaskstasktype.form.component.js +26 -22
- package/dist/lib/generated/Entities/mjBizAppsTasksTaskType/mjbizappstaskstasktype.form.component.js.map +1 -1
- package/dist/lib/generated/generated-forms.module.d.ts +21 -19
- package/dist/lib/generated/generated-forms.module.d.ts.map +1 -1
- package/dist/lib/generated/generated-forms.module.js +6 -0
- package/dist/lib/generated/generated-forms.module.js.map +1 -1
- package/dist/public-api.d.ts +2 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +2 -0
- package/dist/public-api.js.map +1 -1
- package/package.json +13 -13
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { EventEmitter, OnInit } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/** A selectable decision outcome loaded from the TaskDecisionOutcome lookup. */
|
|
4
|
+
export interface DecisionOutcomeOption {
|
|
5
|
+
ID: string;
|
|
6
|
+
Name: string;
|
|
7
|
+
Code: string;
|
|
8
|
+
IsTerminal: boolean;
|
|
9
|
+
}
|
|
10
|
+
/** Payload emitted after a decision is successfully recorded. */
|
|
11
|
+
export interface DecisionRecordedEvent {
|
|
12
|
+
TaskID: string;
|
|
13
|
+
OutcomeCode: string;
|
|
14
|
+
OutcomeName: string;
|
|
15
|
+
Notes: string | null;
|
|
16
|
+
/** The status the task was transitioned to (null if the outcome was non-terminal). */
|
|
17
|
+
NewStatus: 'Completed' | 'Cancelled' | null;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Decision panel for an approval-request task. Presents the available outcomes
|
|
21
|
+
* (Approved / Rejected / Approved With Conditions, plus any deployment-defined
|
|
22
|
+
* outcomes) and records the chosen decision.
|
|
23
|
+
*
|
|
24
|
+
* Recording a decision creates a TaskDecision row and — for terminal outcomes —
|
|
25
|
+
* transitions the task (Approved/ApprovedWithConditions → Completed,
|
|
26
|
+
* Rejected → Cancelled). The server save-event handler then fires the
|
|
27
|
+
* TaskType's OnComplete / OnReject / OnCancel action hooks.
|
|
28
|
+
*
|
|
29
|
+
* Standalone and Router-free so any Explorer or app can embed it.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```html
|
|
33
|
+
* <bizapps-approval-decision-panel
|
|
34
|
+
* [TaskID]="selectedApprovalID"
|
|
35
|
+
* [DecidedByPersonID]="currentUserPersonID"
|
|
36
|
+
* (DecisionRecorded)="onDecision($event)"
|
|
37
|
+
* (Cancelled)="closePanel()">
|
|
38
|
+
* </bizapps-approval-decision-panel>
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare class ApprovalDecisionPanelComponent implements OnInit {
|
|
42
|
+
private cdr;
|
|
43
|
+
private orchestration;
|
|
44
|
+
/** The approval-request task to decide on. Required. */
|
|
45
|
+
set TaskID(value: string | null);
|
|
46
|
+
get TaskID(): string | null;
|
|
47
|
+
private _taskID;
|
|
48
|
+
/** The Person recording the decision (stamped on the TaskDecision). */
|
|
49
|
+
DecidedByPersonID: string | null;
|
|
50
|
+
/** Emitted after a decision is successfully recorded and the task transitioned. */
|
|
51
|
+
DecisionRecorded: EventEmitter<DecisionRecordedEvent>;
|
|
52
|
+
/** Emitted when the user cancels without recording a decision. */
|
|
53
|
+
Cancelled: EventEmitter<void>;
|
|
54
|
+
Loading: boolean;
|
|
55
|
+
Saving: boolean;
|
|
56
|
+
LoadError: string | null;
|
|
57
|
+
SaveError: string | null;
|
|
58
|
+
TaskName: string;
|
|
59
|
+
Outcomes: DecisionOutcomeOption[];
|
|
60
|
+
SelectedOutcomeCode: string;
|
|
61
|
+
Notes: string;
|
|
62
|
+
ngOnInit(): Promise<void>;
|
|
63
|
+
private load;
|
|
64
|
+
private loadTaskName;
|
|
65
|
+
private loadOutcomes;
|
|
66
|
+
Submit(): Promise<void>;
|
|
67
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ApprovalDecisionPanelComponent, never>;
|
|
68
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ApprovalDecisionPanelComponent, "bizapps-approval-decision-panel", never, { "TaskID": { "alias": "TaskID"; "required": false; }; "DecidedByPersonID": { "alias": "DecidedByPersonID"; "required": false; }; }, { "DecisionRecorded": "DecisionRecorded"; "Cancelled": "Cancelled"; }, never, never, true, never>;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=approval-decision-panel.component.d.ts.map
|
package/dist/lib/components/approval-decision-panel/approval-decision-panel.component.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"approval-decision-panel.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/approval-decision-panel/approval-decision-panel.component.ts"],"names":[],"mappings":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AC,IAAI,CAAC;yCA5FpB,8BAA8B;2CAA9B,8BAA8B;CA8H1C"}
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, inject, Input, Output } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { FormsModule } from '@angular/forms';
|
|
4
|
+
import { RunView } from '@memberjunction/core';
|
|
5
|
+
import { TaskOrchestrationService } from '@mj-biz-apps/tasks-core';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
import * as i1 from "@angular/forms";
|
|
8
|
+
const _forTrack0 = ($index, $item) => $item.Code;
|
|
9
|
+
function ApprovalDecisionPanelComponent_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
10
|
+
i0.ɵɵelementStart(0, "div", 1);
|
|
11
|
+
i0.ɵɵtext(1, "Loading\u2026");
|
|
12
|
+
i0.ɵɵelementEnd();
|
|
13
|
+
} }
|
|
14
|
+
function ApprovalDecisionPanelComponent_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
15
|
+
i0.ɵɵelementStart(0, "div", 2);
|
|
16
|
+
i0.ɵɵtext(1);
|
|
17
|
+
i0.ɵɵelementEnd();
|
|
18
|
+
} if (rf & 2) {
|
|
19
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
20
|
+
i0.ɵɵadvance();
|
|
21
|
+
i0.ɵɵtextInterpolate(ctx_r0.LoadError);
|
|
22
|
+
} }
|
|
23
|
+
function ApprovalDecisionPanelComponent_Conditional_3_For_7_Template(rf, ctx) { if (rf & 1) {
|
|
24
|
+
i0.ɵɵelementStart(0, "option", 7);
|
|
25
|
+
i0.ɵɵtext(1);
|
|
26
|
+
i0.ɵɵelementEnd();
|
|
27
|
+
} if (rf & 2) {
|
|
28
|
+
const o_r3 = ctx.$implicit;
|
|
29
|
+
i0.ɵɵproperty("value", o_r3.Code);
|
|
30
|
+
i0.ɵɵadvance();
|
|
31
|
+
i0.ɵɵtextInterpolate(o_r3.Name);
|
|
32
|
+
} }
|
|
33
|
+
function ApprovalDecisionPanelComponent_Conditional_3_Conditional_12_Template(rf, ctx) { if (rf & 1) {
|
|
34
|
+
i0.ɵɵelementStart(0, "div", 2);
|
|
35
|
+
i0.ɵɵtext(1);
|
|
36
|
+
i0.ɵɵelementEnd();
|
|
37
|
+
} if (rf & 2) {
|
|
38
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
39
|
+
i0.ɵɵadvance();
|
|
40
|
+
i0.ɵɵtextInterpolate(ctx_r0.SaveError);
|
|
41
|
+
} }
|
|
42
|
+
function ApprovalDecisionPanelComponent_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
43
|
+
const _r2 = i0.ɵɵgetCurrentView();
|
|
44
|
+
i0.ɵɵelementStart(0, "h3", 3);
|
|
45
|
+
i0.ɵɵtext(1);
|
|
46
|
+
i0.ɵɵelementEnd();
|
|
47
|
+
i0.ɵɵelementStart(2, "div", 4)(3, "label", 5);
|
|
48
|
+
i0.ɵɵtext(4, "Outcome");
|
|
49
|
+
i0.ɵɵelementEnd();
|
|
50
|
+
i0.ɵɵelementStart(5, "select", 6);
|
|
51
|
+
i0.ɵɵtwoWayListener("ngModelChange", function ApprovalDecisionPanelComponent_Conditional_3_Template_select_ngModelChange_5_listener($event) { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); i0.ɵɵtwoWayBindingSet(ctx_r0.SelectedOutcomeCode, $event) || (ctx_r0.SelectedOutcomeCode = $event); return i0.ɵɵresetView($event); });
|
|
52
|
+
i0.ɵɵrepeaterCreate(6, ApprovalDecisionPanelComponent_Conditional_3_For_7_Template, 2, 2, "option", 7, _forTrack0);
|
|
53
|
+
i0.ɵɵelementEnd()();
|
|
54
|
+
i0.ɵɵelementStart(8, "div", 4)(9, "label", 8);
|
|
55
|
+
i0.ɵɵtext(10, "Notes");
|
|
56
|
+
i0.ɵɵelementEnd();
|
|
57
|
+
i0.ɵɵelementStart(11, "textarea", 9);
|
|
58
|
+
i0.ɵɵtwoWayListener("ngModelChange", function ApprovalDecisionPanelComponent_Conditional_3_Template_textarea_ngModelChange_11_listener($event) { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); i0.ɵɵtwoWayBindingSet(ctx_r0.Notes, $event) || (ctx_r0.Notes = $event); return i0.ɵɵresetView($event); });
|
|
59
|
+
i0.ɵɵelementEnd()();
|
|
60
|
+
i0.ɵɵconditionalCreate(12, ApprovalDecisionPanelComponent_Conditional_3_Conditional_12_Template, 2, 1, "div", 2);
|
|
61
|
+
i0.ɵɵelementStart(13, "div", 10)(14, "button", 11);
|
|
62
|
+
i0.ɵɵlistener("click", function ApprovalDecisionPanelComponent_Conditional_3_Template_button_click_14_listener() { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.Submit()); });
|
|
63
|
+
i0.ɵɵtext(15);
|
|
64
|
+
i0.ɵɵelementEnd();
|
|
65
|
+
i0.ɵɵelementStart(16, "button", 12);
|
|
66
|
+
i0.ɵɵlistener("click", function ApprovalDecisionPanelComponent_Conditional_3_Template_button_click_16_listener() { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.Cancelled.emit()); });
|
|
67
|
+
i0.ɵɵtext(17, "Cancel");
|
|
68
|
+
i0.ɵɵelementEnd()();
|
|
69
|
+
} if (rf & 2) {
|
|
70
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
71
|
+
i0.ɵɵadvance();
|
|
72
|
+
i0.ɵɵtextInterpolate(ctx_r0.TaskName || "Approval Decision");
|
|
73
|
+
i0.ɵɵadvance(4);
|
|
74
|
+
i0.ɵɵtwoWayProperty("ngModel", ctx_r0.SelectedOutcomeCode);
|
|
75
|
+
i0.ɵɵproperty("disabled", ctx_r0.Saving);
|
|
76
|
+
i0.ɵɵadvance();
|
|
77
|
+
i0.ɵɵrepeater(ctx_r0.Outcomes);
|
|
78
|
+
i0.ɵɵadvance(5);
|
|
79
|
+
i0.ɵɵtwoWayProperty("ngModel", ctx_r0.Notes);
|
|
80
|
+
i0.ɵɵproperty("disabled", ctx_r0.Saving);
|
|
81
|
+
i0.ɵɵadvance();
|
|
82
|
+
i0.ɵɵconditional(ctx_r0.SaveError ? 12 : -1);
|
|
83
|
+
i0.ɵɵadvance(2);
|
|
84
|
+
i0.ɵɵproperty("disabled", ctx_r0.Saving || !ctx_r0.SelectedOutcomeCode);
|
|
85
|
+
i0.ɵɵadvance();
|
|
86
|
+
i0.ɵɵtextInterpolate1(" ", ctx_r0.Saving ? "Recording\u2026" : "Record Decision", " ");
|
|
87
|
+
i0.ɵɵadvance();
|
|
88
|
+
i0.ɵɵproperty("disabled", ctx_r0.Saving);
|
|
89
|
+
} }
|
|
90
|
+
/**
|
|
91
|
+
* Decision panel for an approval-request task. Presents the available outcomes
|
|
92
|
+
* (Approved / Rejected / Approved With Conditions, plus any deployment-defined
|
|
93
|
+
* outcomes) and records the chosen decision.
|
|
94
|
+
*
|
|
95
|
+
* Recording a decision creates a TaskDecision row and — for terminal outcomes —
|
|
96
|
+
* transitions the task (Approved/ApprovedWithConditions → Completed,
|
|
97
|
+
* Rejected → Cancelled). The server save-event handler then fires the
|
|
98
|
+
* TaskType's OnComplete / OnReject / OnCancel action hooks.
|
|
99
|
+
*
|
|
100
|
+
* Standalone and Router-free so any Explorer or app can embed it.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```html
|
|
104
|
+
* <bizapps-approval-decision-panel
|
|
105
|
+
* [TaskID]="selectedApprovalID"
|
|
106
|
+
* [DecidedByPersonID]="currentUserPersonID"
|
|
107
|
+
* (DecisionRecorded)="onDecision($event)"
|
|
108
|
+
* (Cancelled)="closePanel()">
|
|
109
|
+
* </bizapps-approval-decision-panel>
|
|
110
|
+
* ```
|
|
111
|
+
*/
|
|
112
|
+
export class ApprovalDecisionPanelComponent {
|
|
113
|
+
cdr = inject(ChangeDetectorRef);
|
|
114
|
+
orchestration = new TaskOrchestrationService();
|
|
115
|
+
// ── Inputs ──────────────────────────────────────────────
|
|
116
|
+
/** The approval-request task to decide on. Required. */
|
|
117
|
+
set TaskID(value) {
|
|
118
|
+
const changed = value !== this._taskID;
|
|
119
|
+
this._taskID = value;
|
|
120
|
+
if (changed && value) {
|
|
121
|
+
void this.load();
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
get TaskID() {
|
|
125
|
+
return this._taskID;
|
|
126
|
+
}
|
|
127
|
+
_taskID = null;
|
|
128
|
+
/** The Person recording the decision (stamped on the TaskDecision). */
|
|
129
|
+
DecidedByPersonID = null;
|
|
130
|
+
// ── Outputs ─────────────────────────────────────────────
|
|
131
|
+
/** Emitted after a decision is successfully recorded and the task transitioned. */
|
|
132
|
+
DecisionRecorded = new EventEmitter();
|
|
133
|
+
/** Emitted when the user cancels without recording a decision. */
|
|
134
|
+
Cancelled = new EventEmitter();
|
|
135
|
+
// ── State ───────────────────────────────────────────────
|
|
136
|
+
Loading = false;
|
|
137
|
+
Saving = false;
|
|
138
|
+
LoadError = null;
|
|
139
|
+
SaveError = null;
|
|
140
|
+
TaskName = '';
|
|
141
|
+
Outcomes = [];
|
|
142
|
+
SelectedOutcomeCode = '';
|
|
143
|
+
Notes = '';
|
|
144
|
+
async ngOnInit() {
|
|
145
|
+
if (this._taskID) {
|
|
146
|
+
await this.load();
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
// ── Data loading ────────────────────────────────────────
|
|
150
|
+
async load() {
|
|
151
|
+
this.Loading = true;
|
|
152
|
+
this.LoadError = null;
|
|
153
|
+
this.cdr.detectChanges();
|
|
154
|
+
try {
|
|
155
|
+
await Promise.all([this.loadTaskName(), this.loadOutcomes()]);
|
|
156
|
+
}
|
|
157
|
+
catch (err) {
|
|
158
|
+
this.LoadError = err instanceof Error ? err.message : String(err);
|
|
159
|
+
}
|
|
160
|
+
finally {
|
|
161
|
+
this.Loading = false;
|
|
162
|
+
this.cdr.detectChanges();
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
async loadTaskName() {
|
|
166
|
+
if (!this._taskID)
|
|
167
|
+
return;
|
|
168
|
+
const result = await new RunView().RunView({
|
|
169
|
+
EntityName: 'MJ_BizApps_Tasks: Tasks',
|
|
170
|
+
ExtraFilter: `ID = '${this._taskID}'`,
|
|
171
|
+
Fields: ['Name'],
|
|
172
|
+
ResultType: 'simple',
|
|
173
|
+
MaxRows: 1,
|
|
174
|
+
});
|
|
175
|
+
this.TaskName = result?.Results?.[0]?.Name ?? '';
|
|
176
|
+
}
|
|
177
|
+
async loadOutcomes() {
|
|
178
|
+
const result = await new RunView().RunView({
|
|
179
|
+
EntityName: 'MJ_BizApps_Tasks: Task Decision Outcomes',
|
|
180
|
+
ExtraFilter: 'IsActive = 1',
|
|
181
|
+
OrderBy: 'Sequence ASC',
|
|
182
|
+
Fields: ['ID', 'Name', 'Code', 'IsTerminal'],
|
|
183
|
+
ResultType: 'simple',
|
|
184
|
+
});
|
|
185
|
+
this.Outcomes = result?.Results ?? [];
|
|
186
|
+
if (this.Outcomes.length > 0 && !this.SelectedOutcomeCode) {
|
|
187
|
+
this.SelectedOutcomeCode = this.Outcomes[0].Code;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
// ── Submit ──────────────────────────────────────────────
|
|
191
|
+
async Submit() {
|
|
192
|
+
if (!this._taskID || !this.SelectedOutcomeCode)
|
|
193
|
+
return;
|
|
194
|
+
const outcome = this.Outcomes.find(o => o.Code === this.SelectedOutcomeCode);
|
|
195
|
+
if (!outcome)
|
|
196
|
+
return;
|
|
197
|
+
this.Saving = true;
|
|
198
|
+
this.SaveError = null;
|
|
199
|
+
this.cdr.detectChanges();
|
|
200
|
+
try {
|
|
201
|
+
// Delegate to the shared orchestration service so the decision row,
|
|
202
|
+
// the DecisionRecorded activity log, and the status transition all
|
|
203
|
+
// happen through ONE code path (server + browser identical). The
|
|
204
|
+
// service falls back to the provider's CurrentUser when contextUser
|
|
205
|
+
// is omitted (client-side), per the MJ pattern.
|
|
206
|
+
const result = await this.orchestration.RecordDecision({
|
|
207
|
+
TaskID: this._taskID,
|
|
208
|
+
OutcomeCode: outcome.Code,
|
|
209
|
+
DecidedByPersonID: this.DecidedByPersonID ?? undefined,
|
|
210
|
+
Notes: this.Notes || undefined,
|
|
211
|
+
});
|
|
212
|
+
this.DecisionRecorded.emit({
|
|
213
|
+
TaskID: this._taskID,
|
|
214
|
+
OutcomeCode: outcome.Code,
|
|
215
|
+
OutcomeName: outcome.Name,
|
|
216
|
+
Notes: this.Notes || null,
|
|
217
|
+
NewStatus: result.NewStatus,
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
catch (err) {
|
|
221
|
+
this.SaveError = err instanceof Error ? err.message : String(err);
|
|
222
|
+
}
|
|
223
|
+
finally {
|
|
224
|
+
this.Saving = false;
|
|
225
|
+
this.cdr.detectChanges();
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
static ɵfac = function ApprovalDecisionPanelComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ApprovalDecisionPanelComponent)(); };
|
|
229
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ApprovalDecisionPanelComponent, selectors: [["bizapps-approval-decision-panel"]], inputs: { TaskID: "TaskID", DecidedByPersonID: "DecidedByPersonID" }, outputs: { DecisionRecorded: "DecisionRecorded", Cancelled: "Cancelled" }, decls: 4, vars: 1, consts: [[1, "decision-panel"], [1, "decision-loading"], [1, "decision-error"], [1, "decision-title"], [1, "field"], ["for", "outcome", 1, "field-label"], ["id", "outcome", 1, "mj-select", 3, "ngModelChange", "ngModel", "disabled"], [3, "value"], ["for", "notes", 1, "field-label"], ["id", "notes", "rows", "4", "placeholder", "Optional rationale or conditions\u2026", 1, "mj-textarea", 3, "ngModelChange", "ngModel", "disabled"], [1, "decision-actions"], ["type", "button", 1, "mj-btn", "mj-btn--primary", 3, "click", "disabled"], ["type", "button", 1, "mj-btn", "mj-btn--secondary", 3, "click", "disabled"]], template: function ApprovalDecisionPanelComponent_Template(rf, ctx) { if (rf & 1) {
|
|
230
|
+
i0.ɵɵelementStart(0, "div", 0);
|
|
231
|
+
i0.ɵɵconditionalCreate(1, ApprovalDecisionPanelComponent_Conditional_1_Template, 2, 0, "div", 1)(2, ApprovalDecisionPanelComponent_Conditional_2_Template, 2, 1, "div", 2)(3, ApprovalDecisionPanelComponent_Conditional_3_Template, 18, 9);
|
|
232
|
+
i0.ɵɵelementEnd();
|
|
233
|
+
} if (rf & 2) {
|
|
234
|
+
i0.ɵɵadvance();
|
|
235
|
+
i0.ɵɵconditional(ctx.Loading ? 1 : ctx.LoadError ? 2 : 3);
|
|
236
|
+
} }, dependencies: [CommonModule, FormsModule, i1.NgSelectOption, i1.ɵNgSelectMultipleOption, i1.DefaultValueAccessor, i1.SelectControlValueAccessor, i1.NgControlStatus, i1.NgModel], styles: ["[_nghost-%COMP%] { display: block; }\n .decision-panel[_ngcontent-%COMP%] {\n display: flex; flex-direction: column; gap: var(--mj-space-4, 16px);\n padding: var(--mj-space-5, 20px);\n background: var(--mj-bg-surface);\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-lg, 12px);\n box-shadow: var(--mj-shadow-sm, 0 1px 2px 0 rgba(0,0,0,0.05));\n }\n .decision-title[_ngcontent-%COMP%] { margin: 0; font-size: var(--mj-text-lg, 1.125rem); font-weight: var(--mj-font-semibold, 600); color: var(--mj-text-primary); }\n .decision-loading[_ngcontent-%COMP%] { color: var(--mj-text-muted); padding: var(--mj-space-3, 12px) 0; }\n .decision-error[_ngcontent-%COMP%] {\n color: var(--mj-status-error-text); background: var(--mj-status-error-bg);\n border: 1px solid var(--mj-status-error-border); border-radius: var(--mj-radius-sm, 4px);\n padding: var(--mj-space-2, 8px) var(--mj-space-3, 12px); font-size: var(--mj-text-sm, 0.875rem);\n }\n\n \n\n .field[_ngcontent-%COMP%] { display: flex; flex-direction: column; gap: var(--mj-space-2, 8px); }\n .field-label[_ngcontent-%COMP%] { font-size: var(--mj-text-sm, 0.875rem); font-weight: var(--mj-font-semibold, 600); color: var(--mj-text-primary); }\n .mj-select[_ngcontent-%COMP%], .mj-textarea[_ngcontent-%COMP%] {\n width: 100%; padding: 8px 12px; min-height: 38px;\n font-family: inherit; font-size: var(--mj-text-sm, 0.875rem); line-height: 1.5;\n color: var(--mj-text-primary); background: var(--mj-bg-surface);\n border: 1px solid var(--mj-border-default); border-radius: var(--mj-radius-sm, 4px);\n transition: border-color 150ms ease, box-shadow 150ms ease; outline: none;\n }\n .mj-textarea[_ngcontent-%COMP%] { min-height: 80px; resize: vertical; }\n .mj-select[_ngcontent-%COMP%]::placeholder, .mj-textarea[_ngcontent-%COMP%]::placeholder { color: var(--mj-text-disabled); }\n .mj-select[_ngcontent-%COMP%]:hover:not(:disabled), .mj-textarea[_ngcontent-%COMP%]:hover:not(:disabled) { border-color: var(--mj-border-strong); }\n .mj-select[_ngcontent-%COMP%]:focus, .mj-textarea[_ngcontent-%COMP%]:focus {\n border-color: var(--mj-brand-primary);\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--mj-brand-primary) 15%, transparent);\n }\n .mj-select[_ngcontent-%COMP%]:disabled, .mj-textarea[_ngcontent-%COMP%]:disabled { opacity: 0.5; cursor: not-allowed; background: var(--mj-bg-surface-sunken); }\n\n \n\n .decision-actions[_ngcontent-%COMP%] { display: flex; gap: var(--mj-space-2, 8px); margin-top: var(--mj-space-1, 4px); }\n .mj-btn[_ngcontent-%COMP%] {\n display: inline-flex; align-items: center; justify-content: center; gap: 8px;\n padding: 9px 18px; border: 1px solid transparent; border-radius: var(--mj-radius-md, 8px);\n font-family: inherit; font-size: var(--mj-text-sm, 0.875rem); font-weight: var(--mj-font-semibold, 600);\n line-height: 1.5; cursor: pointer; white-space: nowrap;\n transition: background 150ms ease, border-color 150ms ease, box-shadow 200ms ease, transform 200ms ease;\n }\n .mj-btn[_ngcontent-%COMP%]:disabled { opacity: 0.5; cursor: not-allowed; }\n .mj-btn[_ngcontent-%COMP%]:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--mj-brand-primary) 25%, transparent); }\n .mj-btn--primary[_ngcontent-%COMP%] { background: var(--mj-brand-primary); color: var(--mj-brand-on-primary, #fff); border-color: var(--mj-brand-primary); }\n .mj-btn--primary[_ngcontent-%COMP%]:hover:not(:disabled) { background: var(--mj-brand-primary-hover); border-color: var(--mj-brand-primary-hover); transform: translateY(-1px); box-shadow: var(--mj-shadow-md, 0 4px 6px -1px rgba(0,0,0,0.1)); }\n .mj-btn--secondary[_ngcontent-%COMP%] { background: var(--mj-bg-surface-sunken); color: var(--mj-text-primary); border-color: var(--mj-border-default); }\n .mj-btn--secondary[_ngcontent-%COMP%]:hover:not(:disabled) { background: var(--mj-bg-surface-hover); border-color: var(--mj-border-strong); }"], changeDetection: 0 });
|
|
237
|
+
}
|
|
238
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ApprovalDecisionPanelComponent, [{
|
|
239
|
+
type: Component,
|
|
240
|
+
args: [{ selector: 'bizapps-approval-decision-panel', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, FormsModule], template: `
|
|
241
|
+
<div class="decision-panel">
|
|
242
|
+
@if (Loading) {
|
|
243
|
+
<div class="decision-loading">Loading…</div>
|
|
244
|
+
} @else if (LoadError) {
|
|
245
|
+
<div class="decision-error">{{ LoadError }}</div>
|
|
246
|
+
} @else {
|
|
247
|
+
<h3 class="decision-title">{{ TaskName || 'Approval Decision' }}</h3>
|
|
248
|
+
|
|
249
|
+
<div class="field">
|
|
250
|
+
<label class="field-label" for="outcome">Outcome</label>
|
|
251
|
+
<select id="outcome" class="mj-select" [(ngModel)]="SelectedOutcomeCode" [disabled]="Saving">
|
|
252
|
+
@for (o of Outcomes; track o.Code) {
|
|
253
|
+
<option [value]="o.Code">{{ o.Name }}</option>
|
|
254
|
+
}
|
|
255
|
+
</select>
|
|
256
|
+
</div>
|
|
257
|
+
|
|
258
|
+
<div class="field">
|
|
259
|
+
<label class="field-label" for="notes">Notes</label>
|
|
260
|
+
<textarea id="notes" class="mj-textarea" rows="4"
|
|
261
|
+
[(ngModel)]="Notes" [disabled]="Saving"
|
|
262
|
+
placeholder="Optional rationale or conditions…"></textarea>
|
|
263
|
+
</div>
|
|
264
|
+
|
|
265
|
+
@if (SaveError) {
|
|
266
|
+
<div class="decision-error">{{ SaveError }}</div>
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
<div class="decision-actions">
|
|
270
|
+
<button type="button" class="mj-btn mj-btn--primary" (click)="Submit()" [disabled]="Saving || !SelectedOutcomeCode">
|
|
271
|
+
{{ Saving ? 'Recording…' : 'Record Decision' }}
|
|
272
|
+
</button>
|
|
273
|
+
<button type="button" class="mj-btn mj-btn--secondary" (click)="Cancelled.emit()" [disabled]="Saving">Cancel</button>
|
|
274
|
+
</div>
|
|
275
|
+
}
|
|
276
|
+
</div>
|
|
277
|
+
`, styles: ["\n :host { display: block; }\n .decision-panel {\n display: flex; flex-direction: column; gap: var(--mj-space-4, 16px);\n padding: var(--mj-space-5, 20px);\n background: var(--mj-bg-surface);\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-lg, 12px);\n box-shadow: var(--mj-shadow-sm, 0 1px 2px 0 rgba(0,0,0,0.05));\n }\n .decision-title { margin: 0; font-size: var(--mj-text-lg, 1.125rem); font-weight: var(--mj-font-semibold, 600); color: var(--mj-text-primary); }\n .decision-loading { color: var(--mj-text-muted); padding: var(--mj-space-3, 12px) 0; }\n .decision-error {\n color: var(--mj-status-error-text); background: var(--mj-status-error-bg);\n border: 1px solid var(--mj-status-error-border); border-radius: var(--mj-radius-sm, 4px);\n padding: var(--mj-space-2, 8px) var(--mj-space-3, 12px); font-size: var(--mj-text-sm, 0.875rem);\n }\n\n /* \u2500\u2500 form fields \u2500\u2500 */\n .field { display: flex; flex-direction: column; gap: var(--mj-space-2, 8px); }\n .field-label { font-size: var(--mj-text-sm, 0.875rem); font-weight: var(--mj-font-semibold, 600); color: var(--mj-text-primary); }\n .mj-select, .mj-textarea {\n width: 100%; padding: 8px 12px; min-height: 38px;\n font-family: inherit; font-size: var(--mj-text-sm, 0.875rem); line-height: 1.5;\n color: var(--mj-text-primary); background: var(--mj-bg-surface);\n border: 1px solid var(--mj-border-default); border-radius: var(--mj-radius-sm, 4px);\n transition: border-color 150ms ease, box-shadow 150ms ease; outline: none;\n }\n .mj-textarea { min-height: 80px; resize: vertical; }\n .mj-select::placeholder, .mj-textarea::placeholder { color: var(--mj-text-disabled); }\n .mj-select:hover:not(:disabled), .mj-textarea:hover:not(:disabled) { border-color: var(--mj-border-strong); }\n .mj-select:focus, .mj-textarea:focus {\n border-color: var(--mj-brand-primary);\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--mj-brand-primary) 15%, transparent);\n }\n .mj-select:disabled, .mj-textarea:disabled { opacity: 0.5; cursor: not-allowed; background: var(--mj-bg-surface-sunken); }\n\n /* \u2500\u2500 buttons (token-driven, confirm-left) \u2500\u2500 */\n .decision-actions { display: flex; gap: var(--mj-space-2, 8px); margin-top: var(--mj-space-1, 4px); }\n .mj-btn {\n display: inline-flex; align-items: center; justify-content: center; gap: 8px;\n padding: 9px 18px; border: 1px solid transparent; border-radius: var(--mj-radius-md, 8px);\n font-family: inherit; font-size: var(--mj-text-sm, 0.875rem); font-weight: var(--mj-font-semibold, 600);\n line-height: 1.5; cursor: pointer; white-space: nowrap;\n transition: background 150ms ease, border-color 150ms ease, box-shadow 200ms ease, transform 200ms ease;\n }\n .mj-btn:disabled { opacity: 0.5; cursor: not-allowed; }\n .mj-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--mj-brand-primary) 25%, transparent); }\n .mj-btn--primary { background: var(--mj-brand-primary); color: var(--mj-brand-on-primary, #fff); border-color: var(--mj-brand-primary); }\n .mj-btn--primary:hover:not(:disabled) { background: var(--mj-brand-primary-hover); border-color: var(--mj-brand-primary-hover); transform: translateY(-1px); box-shadow: var(--mj-shadow-md, 0 4px 6px -1px rgba(0,0,0,0.1)); }\n .mj-btn--secondary { background: var(--mj-bg-surface-sunken); color: var(--mj-text-primary); border-color: var(--mj-border-default); }\n .mj-btn--secondary:hover:not(:disabled) { background: var(--mj-bg-surface-hover); border-color: var(--mj-border-strong); }\n "] }]
|
|
278
|
+
}], null, { TaskID: [{
|
|
279
|
+
type: Input
|
|
280
|
+
}], DecidedByPersonID: [{
|
|
281
|
+
type: Input
|
|
282
|
+
}], DecisionRecorded: [{
|
|
283
|
+
type: Output
|
|
284
|
+
}], Cancelled: [{
|
|
285
|
+
type: Output
|
|
286
|
+
}] }); })();
|
|
287
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ApprovalDecisionPanelComponent, { className: "ApprovalDecisionPanelComponent", filePath: "src/lib/components/approval-decision-panel/approval-decision-panel.component.ts", lineNumber: 144 }); })();
|
|
288
|
+
//# sourceMappingURL=approval-decision-panel.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"approval-decision-panel.component.js","sourceRoot":"","sources":["../../../../src/lib/components/approval-decision-panel/approval-decision-panel.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAU,MAAM,EAAE,MAAM,eAAe,CAAC;AACnI,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,wBAAwB,EAA2B,MAAM,yBAAyB,CAAC;;;;;IAkD5E,8BAA8B;IAAA,6BAAQ;IAAA,iBAAM;;;IAE5C,8BAA4B;IA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IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;QAC7B,CAAC;IACL,CAAC;wHA7HQ,8BAA8B;6DAA9B,8BAA8B;YA3FnC,8BAA4B;YAKtB,AAFA,AAFF,gGAAe,0EAES,iEAEf;YA8Bb,iBAAM;;YAlCF,cAiCC;YAjCD,yDAiCC;4BApCC,YAAY,EAAE,WAAW;;iFA6F1B,8BAA8B;cAjG1C,SAAS;2BACI,iCAAiC,cAC/B,IAAI,mBACC,uBAAuB,CAAC,MAAM,WACtC,CAAC,YAAY,EAAE,WAAW,CAAC,YAC1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAqCT;;kBA8DA,KAAK;;kBAcL,KAAK;;kBAKL,MAAM;;kBAGN,MAAM;;kFA7BE,8BAA8B"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { EventEmitter, OnInit } from '@angular/core';
|
|
2
|
+
import { DecisionRecordedEvent } from '../approval-decision-panel/approval-decision-panel.component';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/** A pending approval-request task shown in the inbox. */
|
|
5
|
+
export interface ApprovalRow {
|
|
6
|
+
ID: string;
|
|
7
|
+
Name: string;
|
|
8
|
+
Description: string | null;
|
|
9
|
+
Priority: string;
|
|
10
|
+
DueAt: Date | null;
|
|
11
|
+
Status: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Approval inbox — lists the approval-request tasks awaiting a decision from a
|
|
15
|
+
* given approver and embeds the {@link ApprovalDecisionPanelComponent} for
|
|
16
|
+
* recording the outcome. Once a decision is recorded the row clears from the inbox.
|
|
17
|
+
*
|
|
18
|
+
* "Pending" = a task of the "Approval Request" type, assigned to the approver,
|
|
19
|
+
* still in an open state (not Completed/Cancelled) and without a terminal decision.
|
|
20
|
+
*
|
|
21
|
+
* Standalone and Router-free so any Explorer or app can embed it.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```html
|
|
25
|
+
* <bizapps-approval-inbox
|
|
26
|
+
* [ApproverPersonID]="currentUserPersonID"
|
|
27
|
+
* (DecisionRecorded)="refreshSourceRecord($event)">
|
|
28
|
+
* </bizapps-approval-inbox>
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export declare class ApprovalInboxComponent implements OnInit {
|
|
32
|
+
private cdr;
|
|
33
|
+
/** The approver's Person ID. Required — scopes the inbox to that person. */
|
|
34
|
+
set ApproverPersonID(value: string);
|
|
35
|
+
get ApproverPersonID(): string;
|
|
36
|
+
private _approverPersonID;
|
|
37
|
+
/** Name of the TaskType used for approval requests. @default 'Approval Request' */
|
|
38
|
+
ApprovalTypeName: string;
|
|
39
|
+
/** Re-emitted from the embedded decision panel after a decision is recorded. */
|
|
40
|
+
DecisionRecorded: EventEmitter<DecisionRecordedEvent>;
|
|
41
|
+
Loading: boolean;
|
|
42
|
+
LoadError: string | null;
|
|
43
|
+
Approvals: ApprovalRow[];
|
|
44
|
+
SelectedApprovalID: string | null;
|
|
45
|
+
ngOnInit(): Promise<void>;
|
|
46
|
+
/** Reloads the pending approvals from the server. */
|
|
47
|
+
Refresh(): Promise<void>;
|
|
48
|
+
Select(approvalID: string): void;
|
|
49
|
+
/** Maps a task priority to its badge modifier class (token-driven status colors). */
|
|
50
|
+
priorityBadgeClass(priority: string): string;
|
|
51
|
+
onDecisionRecorded(event: DecisionRecordedEvent): void;
|
|
52
|
+
/**
|
|
53
|
+
* Builds the ExtraFilter for pending approvals: tasks of the approval TaskType,
|
|
54
|
+
* assigned to this approver, still open, and without any terminal decision yet.
|
|
55
|
+
*/
|
|
56
|
+
private buildPendingFilter;
|
|
57
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ApprovalInboxComponent, never>;
|
|
58
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ApprovalInboxComponent, "bizapps-approval-inbox", never, { "ApproverPersonID": { "alias": "ApproverPersonID"; "required": false; }; "ApprovalTypeName": { "alias": "ApprovalTypeName"; "required": false; }; }, { "DecisionRecorded": "DecisionRecorded"; }, never, never, true, never>;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=approval-inbox.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"approval-inbox.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/approval-inbox/approval-inbox.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyD,YAAY,EAAiB,MAAM,EAAU,MAAM,eAAe,CAAC;AAGnI,OAAO,EAAkC,qBAAqB,EAAE,MAAM,8DAA8D,CAAC;;AAErI,0DAA0D;AAC1D,MAAM,WAAW,WAAW;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAkHa,sBAAuB,YAAW,MAAM;IACjD,OAAO,CAAC,GAAG,CAA6B;IAIxC,4EAA4E;IAC5E,IACI,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAMjC;IACD,IAAI,gBAAgB,IAAI,MAAM,CAE7B;IACD,OAAO,CAAC,iBAAiB,CAAM;IAE/B,mFAAmF;IAC1E,gBAAgB,SAAsB;IAI/C,gFAAgF;IACtE,gBAAgB,sCAA6C;IAIhE,OAAO,UAAS;IAChB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAQ;IAChC,SAAS,EAAE,WAAW,EAAE,CAAM;IAC9B,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE1C,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ/B,qDAAqD;IAC/C,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IA+B9B,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAIhC,qFAAqF;IACrF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