@acorex-platform/module-task-management-client 1.0.2 → 2.0.0-beta.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.
Files changed (72) hide show
  1. package/fesm2022/acorex-platform-module-task-management-client-acorex-platform-module-task-management-client-dfiarGtJ.mjs +2846 -0
  2. package/fesm2022/acorex-platform-module-task-management-client-acorex-platform-module-task-management-client-dfiarGtJ.mjs.map +1 -0
  3. package/fesm2022/acorex-platform-module-task-management-client-contracts-entities-task-type.mjs +148 -51
  4. package/fesm2022/acorex-platform-module-task-management-client-contracts-entities-task-type.mjs.map +1 -1
  5. package/fesm2022/acorex-platform-module-task-management-client-contracts-entities-task.mjs +38 -1265
  6. package/fesm2022/acorex-platform-module-task-management-client-contracts-entities-task.mjs.map +1 -1
  7. package/fesm2022/{acorex-platform-module-task-management-client-contracts-entity-catalog-acorex-platform-module-task-management-client-contracts-entity-catalog-DoR58GWa.mjs → acorex-platform-module-task-management-client-contracts-entity-catalog-acorex-platform-module-task-management-client-contracts-entity-catalog-CtNTQX14.mjs} +51 -11
  8. package/fesm2022/acorex-platform-module-task-management-client-contracts-entity-catalog-acorex-platform-module-task-management-client-contracts-entity-catalog-CtNTQX14.mjs.map +1 -0
  9. package/fesm2022/{acorex-platform-module-task-management-client-contracts-entity-catalog-task-assignment.entity--TP_F87Y.mjs → acorex-platform-module-task-management-client-contracts-entity-catalog-task-assignment.entity-N_I7YGSn.mjs} +2 -2
  10. package/fesm2022/{acorex-platform-module-task-management-client-contracts-entity-catalog-task-assignment.entity--TP_F87Y.mjs.map → acorex-platform-module-task-management-client-contracts-entity-catalog-task-assignment.entity-N_I7YGSn.mjs.map} +1 -1
  11. package/fesm2022/{acorex-platform-module-task-management-client-contracts-entity-catalog-task-checklist-item.entity-sGrb0ZaR.mjs → acorex-platform-module-task-management-client-contracts-entity-catalog-task-checklist-item.entity-4zrBmfHs.mjs} +2 -2
  12. package/fesm2022/{acorex-platform-module-task-management-client-contracts-entity-catalog-task-checklist-item.entity-sGrb0ZaR.mjs.map → acorex-platform-module-task-management-client-contracts-entity-catalog-task-checklist-item.entity-4zrBmfHs.mjs.map} +1 -1
  13. package/fesm2022/{acorex-platform-module-task-management-client-contracts-entity-catalog-task-context.entity-CLQw9kqg.mjs → acorex-platform-module-task-management-client-contracts-entity-catalog-task-context.entity-B7nZyTo9.mjs} +2 -2
  14. package/fesm2022/{acorex-platform-module-task-management-client-contracts-entity-catalog-task-context.entity-CLQw9kqg.mjs.map → acorex-platform-module-task-management-client-contracts-entity-catalog-task-context.entity-B7nZyTo9.mjs.map} +1 -1
  15. package/fesm2022/{acorex-platform-module-task-management-client-contracts-entity-catalog-task-dependency.entity-Ce9NZlK_.mjs → acorex-platform-module-task-management-client-contracts-entity-catalog-task-dependency.entity-Kc0FDDhp.mjs} +2 -2
  16. package/fesm2022/{acorex-platform-module-task-management-client-contracts-entity-catalog-task-dependency.entity-Ce9NZlK_.mjs.map → acorex-platform-module-task-management-client-contracts-entity-catalog-task-dependency.entity-Kc0FDDhp.mjs.map} +1 -1
  17. package/fesm2022/{acorex-platform-module-task-management-client-contracts-entity-catalog-task-status.entity-DKx2UHiz.mjs → acorex-platform-module-task-management-client-contracts-entity-catalog-task-status.entity-CKmd8udh.mjs} +2 -2
  18. package/fesm2022/{acorex-platform-module-task-management-client-contracts-entity-catalog-task-status.entity-DKx2UHiz.mjs.map → acorex-platform-module-task-management-client-contracts-entity-catalog-task-status.entity-CKmd8udh.mjs.map} +1 -1
  19. package/fesm2022/{acorex-platform-module-task-management-client-contracts-entity-catalog-task-template.entity-CKY04iyS.mjs → acorex-platform-module-task-management-client-contracts-entity-catalog-task-template.entity-DhBEzoof.mjs} +2 -2
  20. package/fesm2022/{acorex-platform-module-task-management-client-contracts-entity-catalog-task-template.entity-CKY04iyS.mjs.map → acorex-platform-module-task-management-client-contracts-entity-catalog-task-template.entity-DhBEzoof.mjs.map} +1 -1
  21. package/fesm2022/{acorex-platform-module-task-management-client-contracts-entity-catalog-task-type.entity-BGKWiqU8.mjs → acorex-platform-module-task-management-client-contracts-entity-catalog-task-type.entity-Ckuv9ei1.mjs} +150 -53
  22. package/fesm2022/acorex-platform-module-task-management-client-contracts-entity-catalog-task-type.entity-Ckuv9ei1.mjs.map +1 -0
  23. package/fesm2022/acorex-platform-module-task-management-client-contracts-entity-catalog-task.entity-BN0r7MWY.mjs +46 -0
  24. package/fesm2022/acorex-platform-module-task-management-client-contracts-entity-catalog-task.entity-BN0r7MWY.mjs.map +1 -0
  25. package/fesm2022/{acorex-platform-module-task-management-client-contracts-entity-catalog-time-log.entity-Gne51DLu.mjs → acorex-platform-module-task-management-client-contracts-entity-catalog-time-log.entity-D1jG-qG1.mjs} +2 -2
  26. package/fesm2022/{acorex-platform-module-task-management-client-contracts-entity-catalog-time-log.entity-Gne51DLu.mjs.map → acorex-platform-module-task-management-client-contracts-entity-catalog-time-log.entity-D1jG-qG1.mjs.map} +1 -1
  27. package/fesm2022/acorex-platform-module-task-management-client-contracts-entity-catalog.mjs +1 -1
  28. package/fesm2022/acorex-platform-module-task-management-client-contracts.mjs +251 -30
  29. package/fesm2022/acorex-platform-module-task-management-client-contracts.mjs.map +1 -1
  30. package/fesm2022/acorex-platform-module-task-management-client-create-subject-task.command-o5rIB4lp.mjs +25 -0
  31. package/fesm2022/acorex-platform-module-task-management-client-create-subject-task.command-o5rIB4lp.mjs.map +1 -0
  32. package/fesm2022/acorex-platform-module-task-management-client-create-task-type.command-4VzqIkIc.mjs +46 -0
  33. package/fesm2022/acorex-platform-module-task-management-client-create-task-type.command-4VzqIkIc.mjs.map +1 -0
  34. package/fesm2022/{acorex-platform-module-task-management-client-list-task-board-assignees.query-CENurmLO.mjs → acorex-platform-module-task-management-client-list-task-board-assignees.query-BcNFYozj.mjs} +27 -7
  35. package/fesm2022/acorex-platform-module-task-management-client-list-task-board-assignees.query-BcNFYozj.mjs.map +1 -0
  36. package/fesm2022/{acorex-platform-module-task-management-client-list-task-board-reporters.query-C3NAYa9b.mjs → acorex-platform-module-task-management-client-list-task-board-reporters.query-A0sbGwlB.mjs} +14 -4
  37. package/fesm2022/acorex-platform-module-task-management-client-list-task-board-reporters.query-A0sbGwlB.mjs.map +1 -0
  38. package/fesm2022/{acorex-platform-module-task-management-client-list-task-types.query-DQ2MnsAK.mjs → acorex-platform-module-task-management-client-list-task-types.query-CZHSliWt.mjs} +20 -10
  39. package/fesm2022/acorex-platform-module-task-management-client-list-task-types.query-CZHSliWt.mjs.map +1 -0
  40. package/fesm2022/acorex-platform-module-task-management-client-open-task-workspace.command-1BlMwoWF.mjs +29 -0
  41. package/fesm2022/acorex-platform-module-task-management-client-open-task-workspace.command-1BlMwoWF.mjs.map +1 -0
  42. package/fesm2022/acorex-platform-module-task-management-client-personal-task.command-BubXfozR.mjs +257 -0
  43. package/fesm2022/acorex-platform-module-task-management-client-personal-task.command-BubXfozR.mjs.map +1 -0
  44. package/fesm2022/acorex-platform-module-task-management-client-task-board-lookup-search.util-il-mNHxd.mjs +42 -0
  45. package/fesm2022/acorex-platform-module-task-management-client-task-board-lookup-search.util-il-mNHxd.mjs.map +1 -0
  46. package/fesm2022/acorex-platform-module-task-management-client-task-entity-record.command-BCL_Ctpw.mjs +65 -0
  47. package/fesm2022/acorex-platform-module-task-management-client-task-entity-record.command-BCL_Ctpw.mjs.map +1 -0
  48. package/fesm2022/acorex-platform-module-task-management-client-task-lifecycle-popup.component-AxJHpj55.mjs +175 -0
  49. package/fesm2022/acorex-platform-module-task-management-client-task-lifecycle-popup.component-AxJHpj55.mjs.map +1 -0
  50. package/fesm2022/acorex-platform-module-task-management-client-task-workspace.popup-Cz8Hrp3r.mjs +220 -0
  51. package/fesm2022/acorex-platform-module-task-management-client-task-workspace.popup-Cz8Hrp3r.mjs.map +1 -0
  52. package/fesm2022/acorex-platform-module-task-management-client.mjs +1 -1
  53. package/i18n/en-AU/task-management.json +222 -5
  54. package/i18n/en-US/task-management.json +222 -5
  55. package/i18n/fa-IR/task-management.json +223 -6
  56. package/package.json +4 -3
  57. package/types/acorex-platform-module-task-management-client-contracts-entities-task.d.ts +2 -1
  58. package/types/acorex-platform-module-task-management-client-contracts.d.ts +442 -46
  59. package/types/acorex-platform-module-task-management-client.d.ts +311 -742
  60. package/fesm2022/acorex-platform-module-task-management-client-acorex-platform-module-task-management-client-INIEvacu.mjs +0 -4457
  61. package/fesm2022/acorex-platform-module-task-management-client-acorex-platform-module-task-management-client-INIEvacu.mjs.map +0 -1
  62. package/fesm2022/acorex-platform-module-task-management-client-contracts-entity-catalog-acorex-platform-module-task-management-client-contracts-entity-catalog-DoR58GWa.mjs.map +0 -1
  63. package/fesm2022/acorex-platform-module-task-management-client-contracts-entity-catalog-task-type.entity-BGKWiqU8.mjs.map +0 -1
  64. package/fesm2022/acorex-platform-module-task-management-client-contracts-entity-catalog-task.entity-CiKg52ey.mjs +0 -1273
  65. package/fesm2022/acorex-platform-module-task-management-client-contracts-entity-catalog-task.entity-CiKg52ey.mjs.map +0 -1
  66. package/fesm2022/acorex-platform-module-task-management-client-list-task-board-assignees.query-CENurmLO.mjs.map +0 -1
  67. package/fesm2022/acorex-platform-module-task-management-client-list-task-board-reporters.query-C3NAYa9b.mjs.map +0 -1
  68. package/fesm2022/acorex-platform-module-task-management-client-list-task-types.query-DQ2MnsAK.mjs.map +0 -1
  69. package/fesm2022/acorex-platform-module-task-management-client-start-task-flow.command-CR1JXr5r.mjs +0 -114
  70. package/fesm2022/acorex-platform-module-task-management-client-start-task-flow.command-CR1JXr5r.mjs.map +0 -1
  71. package/fesm2022/acorex-platform-module-task-management-client-task-board.page-xzDabJXk.mjs +0 -2744
  72. package/fesm2022/acorex-platform-module-task-management-client-task-board.page-xzDabJXk.mjs.map +0 -1
@@ -0,0 +1,257 @@
1
+ import * as i0 from '@angular/core';
2
+ import { inject, Injectable } from '@angular/core';
3
+ import { AXPSessionService } from '@acorex-platform/framework-client/auth';
4
+ import { AXPBroadcastEventService } from '@acorex-platform/framework-client/core';
5
+ import { AXPLayoutBuilderService } from '@acorex-platform/framework-client/layout/builder';
6
+ import { AXPCommandService, AXPQueryService } from '@acorex-platform/framework-client/runtime';
7
+ import { runtimeQueryPayloadData, createRandomUuid } from '@acorex-platform/framework-shared/core';
8
+ import { b as taskInputInstant, T as TaskAttachmentsUiService, c as taskPersonalCapability, d as taskActionErrorKey, e as taskRecordActionPlan, f as TASK_ATTACHMENT_WIDGET_OPTIONS } from './acorex-platform-module-task-management-client-acorex-platform-module-task-management-client-dfiarGtJ.mjs';
9
+ import { AXTranslationService } from '@acorex/core/translation';
10
+ import { AXDialogService } from '@acorex/components/dialog';
11
+
12
+ /** Form values become explicit instants; an all-day date keeps its local calendar day. */
13
+ function taskCreateScheduleInput(value, timeZone) {
14
+ const invalid = (message) => { throw Object.assign(new Error(message), { code: 'validation_failed' }); };
15
+ const result = { dueAt: taskInputInstant(value.due), estimatedMinutes: value.estimatedMinutes };
16
+ if (value.estimatedMinutes != null && (!Number.isSafeInteger(value.estimatedMinutes) || value.estimatedMinutes < 0))
17
+ invalid('Invalid estimate.');
18
+ if (value.mode === 'timed') {
19
+ const start = taskInputInstant(value.start), end = taskInputInstant(value.end);
20
+ if (start && end && end <= start)
21
+ invalid('Planned end must follow start.');
22
+ return { ...result, plannedStartAt: start, plannedEndAt: end, allDayDate: null, calendarTimeZone: null };
23
+ }
24
+ if (value.mode === 'all-day') {
25
+ const dayInstant = taskInputInstant(value.day);
26
+ if (!dayInstant)
27
+ return invalid('An all-day date is required.');
28
+ const day = new Date(dayInstant);
29
+ try {
30
+ new Intl.DateTimeFormat('en', { timeZone }).format(0);
31
+ }
32
+ catch {
33
+ invalid('Invalid timezone.');
34
+ }
35
+ return { ...result, plannedStartAt: null, plannedEndAt: null, allDayDate: `${day.getFullYear()}-${String(day.getMonth() + 1).padStart(2, '0')}-${String(day.getDate()).padStart(2, '0')}`, calendarTimeZone: timeZone };
36
+ }
37
+ if (value.mode !== 'none')
38
+ invalid('Invalid schedule mode.');
39
+ return { ...result, plannedStartAt: null, plannedEndAt: null, allDayDate: null, calendarTimeZone: null };
40
+ }
41
+
42
+ class PersonalTaskCommand {
43
+ constructor() {
44
+ this.attachments = inject(TaskAttachmentsUiService);
45
+ this.layouts = inject(AXPLayoutBuilderService);
46
+ this.commands = inject(AXPCommandService);
47
+ this.queries = inject(AXPQueryService);
48
+ this.session = inject(AXPSessionService);
49
+ this.translations = inject(AXTranslationService);
50
+ this.dialogs = inject(AXDialogService);
51
+ this.events = inject(AXPBroadcastEventService);
52
+ this.pending = new Map();
53
+ }
54
+ scope() { return JSON.stringify([this.session.user?.id, this.session.tenant?.id, this.session.application?.id, this.session.authorizationRevision]); }
55
+ execute(options = {}) {
56
+ const action = this.action;
57
+ const key = JSON.stringify([this.scope(), action, options.taskId]);
58
+ const existing = this.pending.get(key);
59
+ if (existing)
60
+ return existing;
61
+ const work = this.open(action, options).finally(() => this.pending.delete(key));
62
+ this.pending.set(key, work);
63
+ return work;
64
+ }
65
+ async read(key, taskId) {
66
+ const response = await this.queries.fetch(key, { taskId }, { snapshot: false, dataExecution: { force: true, refreshOnInvalidate: false } });
67
+ const result = runtimeQueryPayloadData(response);
68
+ if (!result)
69
+ throw response;
70
+ return result;
71
+ }
72
+ async open(action, options) {
73
+ const { AXP_TASK_RUNTIME_KEYS } = await import('@acorex-platform/module-task-management-client/contracts');
74
+ const scope = this.scope();
75
+ let record;
76
+ if (action !== 'create') {
77
+ if (!options.taskId)
78
+ throw { code: 'validation_failed' };
79
+ const row = await this.read(AXP_TASK_RUNTIME_KEYS.Get, options.taskId);
80
+ if (row.id !== options.taskId || !Number.isSafeInteger(row.version) || row.version < 1 || !await taskPersonalCapability(row, action))
81
+ throw { code: 'forbidden' };
82
+ record = row;
83
+ }
84
+ if (scope !== this.scope())
85
+ throw { code: 'forbidden' };
86
+ if (action === 'delete') {
87
+ if (!record)
88
+ throw { code: 'forbidden' };
89
+ const confirmed = await this.dialogs.confirm(await this.translations.translateAsync('@general:workflow.warning'), await this.translations.translateAsync('@general:workflow.confirm-delete'), 'danger', 'horizontal', false, 'cancel');
90
+ if (!confirmed.result)
91
+ return { success: false, metadata: { outcome: 'cancelled' } };
92
+ try {
93
+ if (scope !== this.scope())
94
+ throw { code: 'forbidden' };
95
+ const response = await this.commands.executeRemote(AXP_TASK_RUNTIME_KEYS.DeletePersonal, {
96
+ taskId: record.id, expectedVersion: record.version, commandId: createRandomUuid(),
97
+ });
98
+ if (!response?.success)
99
+ throw response;
100
+ const result = runtimeQueryPayloadData(response);
101
+ if (!result?.taskId || scope !== this.scope())
102
+ throw { code: 'forbidden' };
103
+ this.events.publish('task-board.close', { provider: 'task-management.tasks' });
104
+ this.events.publish('task-board.refresh', { provider: 'task-management.tasks', preserveRows: true, itemIds: [result.taskId] });
105
+ return { success: true, kind: 'object', data: result, metadata: { refresh: true } };
106
+ }
107
+ catch (error) {
108
+ throw new Error(await this.translations.translateAsync(taskActionErrorKey(error)));
109
+ }
110
+ }
111
+ const createPlan = action === 'create' ? runtimeQueryPayloadData(await this.queries.fetch(AXP_TASK_RUNTIME_KEYS.PersonalCreatePlan, {}, { snapshot: false, dataExecution: { force: true, refreshOnInvalidate: false } })) : undefined;
112
+ if (action === 'create' && !createPlan || scope !== this.scope())
113
+ throw { code: 'forbidden' };
114
+ const timePolicy = record?.timePolicy ?? createPlan.timePolicy;
115
+ const attachmentsEnabled = action === 'create' ? createPlan?.hasAttachments === true : taskRecordActionPlan(record)?.attachments?.enabled === true;
116
+ const range = options.context?.range;
117
+ const seed = {
118
+ checklist: [],
119
+ attachments: this.attachments.files(record?.attachments),
120
+ title: record?.title ?? '', description: record?.description ?? '', priority: record?.priority ?? 'normal',
121
+ mode: record?.allDayDate ? 'all-day' : record?.plannedStartAt || record?.plannedEndAt || range ? options.context?.allDay ? 'all-day' : 'timed' : 'none',
122
+ start: record?.plannedStartAt ? new Date(record.plannedStartAt) : range?.from ?? null,
123
+ end: record?.plannedEndAt ? new Date(record.plannedEndAt) : range?.end ?? null,
124
+ day: record?.allDayDate ? new Date(record.allDayDate + 'T12:00:00') : range?.from ?? null,
125
+ due: record?.dueAt ?? null,
126
+ estimatedMinutes: record?.estimatedMinutes ?? null,
127
+ };
128
+ let lastPayload = '', commandId = '';
129
+ let submitting = false;
130
+ const result = await this.layouts.create().dialog(dialog => {
131
+ dialog.setTitle(`@task-management:personal-task.${action}-title`).setSize('md').setCloseButton(true).setContext(seed)
132
+ .confirmCloseWhenDirty(true)
133
+ .content(flex => {
134
+ flex.setDirection('column');
135
+ flex.formField('@task-management:personal-task.title', field => field.path('title').textBox({ validations: [{ rule: 'required' }], maxLength: 300 }));
136
+ flex.formField('@task-management:personal-task.description', field => field.path('description').largeTextBox({ maxLength: 10000 }));
137
+ flex.grid(grid => {
138
+ grid.setColumns(12).setGap('1rem');
139
+ grid.formField('@task-management:personal-task.priority', field => field.layout(6).path('priority').selectBox({
140
+ valueField: 'id', textField: 'title', dataSource: ['low', 'normal', 'high', 'urgent'].map(id => ({ id, title: `@task-management:task-board.priority.${id}` })),
141
+ }));
142
+ grid.formField('@task-management:personal-task.schedule', field => field.layout(6).path('mode').selectBox({
143
+ valueField: 'id', textField: 'title', dataSource: ['none', 'timed', 'all-day'].map(id => ({ id, title: `@task-management:personal-task.schedule-${id}` })),
144
+ }));
145
+ });
146
+ flex.grid(grid => {
147
+ grid.setColumns(12).setGap('1rem');
148
+ grid.formField('@task-management:personal-task.start', field => field.layout(4).path('start').dateTimeBox({ format: 'datetime' }).visible("{{ context.eval('mode') === 'timed' }}"));
149
+ grid.formField('@task-management:personal-task.end', field => field.layout(4).path('end').dateTimeBox({ format: 'datetime' }).visible("{{ context.eval('mode') === 'timed' }}"));
150
+ grid.formField('@task-management:personal-task.day', field => field.layout(4).path('day').dateTimeBox({ format: 'date' }).visible("{{ context.eval('mode') === 'all-day' }}"));
151
+ if (timePolicy.dueMode !== 'disabled')
152
+ grid.formField('@task-management:personal-task.due', field => field.layout(4).path('due').dateTimeBox({ format: 'datetime', validations: timePolicy.dueMode === 'required' ? [{ rule: 'required' }] : [] }));
153
+ });
154
+ if (action === 'create') {
155
+ flex.formField('@task-management:personal-task.checklist', field => field.path('checklist').customWidget('repeater-layout', {
156
+ hasControls: true, allowReorder: true, defaultItem: { title: '' }, mode: 'edit',
157
+ children: [{ type: 'text-editor', path: 'title', mode: 'edit', options: {
158
+ placeholder: '@task-management:personal-task.checklist-item', maxLength: 240, validations: [{ rule: 'required' }],
159
+ } }],
160
+ }));
161
+ }
162
+ if (attachmentsEnabled)
163
+ flex.formField('@general:widgets.file-uploader.attachments.title', field => field.path('attachments').customWidget('attachments', TASK_ATTACHMENT_WIDGET_OPTIONS));
164
+ })
165
+ .setActions(actions => { actions.cancel(); actions.submit('@general:actions.save.title'); })
166
+ .onAction(async (ref) => {
167
+ if (ref.action() !== 'submit')
168
+ return { success: false, metadata: { outcome: 'cancelled' } };
169
+ if (submitting)
170
+ throw { code: 'conflict' };
171
+ submitting = true;
172
+ ref.setLoading(true);
173
+ try {
174
+ if (scope !== this.scope())
175
+ throw { code: 'forbidden' };
176
+ const values = ref.context();
177
+ const input = { ...(attachmentsEnabled ? { attachments: await this.attachments.input(values.attachments) } : {}), ...(action === 'create' ? { checklist: values.checklist.map((item) => ({ title: item.title })) } : {}), title: values.title, description: values.description || null, priority: values.priority,
178
+ ...taskCreateScheduleInput({ ...values, due: timePolicy.dueMode === 'disabled' ? null : values.due }, record?.calendarTimeZone ?? Intl.DateTimeFormat().resolvedOptions().timeZone) };
179
+ const payload = { ...(record ? { taskId: record.id, expectedVersion: record.version } : {}), ...(input ? { input } : {}) };
180
+ const fingerprint = JSON.stringify(payload);
181
+ if (fingerprint !== lastPayload) {
182
+ lastPayload = fingerprint;
183
+ commandId = createRandomUuid();
184
+ }
185
+ const key = action === 'create' ? AXP_TASK_RUNTIME_KEYS.CreatePersonal : AXP_TASK_RUNTIME_KEYS.UpdatePersonal;
186
+ if (scope !== this.scope())
187
+ throw { code: 'forbidden' };
188
+ const response = await this.commands.executeRemote(key, { ...payload, commandId });
189
+ if (!response?.success)
190
+ throw response;
191
+ const result = runtimeQueryPayloadData(response);
192
+ if (!result?.taskId || scope !== this.scope())
193
+ throw { code: 'forbidden' };
194
+ this.events.publish('task-board.close', { provider: 'task-management.tasks' });
195
+ this.events.publish('task-board.refresh', { provider: 'task-management.tasks', preserveRows: true, itemIds: [result.taskId] });
196
+ const data = action === 'create' ? {
197
+ ...result,
198
+ scheduleKind: input.allDayDate ? 'all-day' : input.plannedStartAt || input.plannedEndAt ? 'timed' : input.dueAt ? 'deadline' : 'unscheduled',
199
+ } : result;
200
+ return { success: true, kind: 'object', data, metadata: { refresh: true } };
201
+ }
202
+ catch (error) {
203
+ throw new Error(await this.translations.translateAsync(taskActionErrorKey(error)));
204
+ }
205
+ finally {
206
+ submitting = false;
207
+ ref.setLoading(false);
208
+ }
209
+ });
210
+ }).show();
211
+ return result ?? { success: false, metadata: { outcome: 'cancelled' } };
212
+ }
213
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: PersonalTaskCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
214
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: PersonalTaskCommand }); }
215
+ }
216
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: PersonalTaskCommand, decorators: [{
217
+ type: Injectable
218
+ }] });
219
+ class CreatePersonalTaskCommand extends PersonalTaskCommand {
220
+ constructor() {
221
+ super(...arguments);
222
+ this.action = 'create';
223
+ }
224
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: CreatePersonalTaskCommand, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
225
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: CreatePersonalTaskCommand, providedIn: 'root' }); }
226
+ }
227
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: CreatePersonalTaskCommand, decorators: [{
228
+ type: Injectable,
229
+ args: [{ providedIn: 'root' }]
230
+ }] });
231
+ class EditPersonalTaskCommand extends PersonalTaskCommand {
232
+ constructor() {
233
+ super(...arguments);
234
+ this.action = 'edit';
235
+ }
236
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: EditPersonalTaskCommand, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
237
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: EditPersonalTaskCommand, providedIn: 'root' }); }
238
+ }
239
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: EditPersonalTaskCommand, decorators: [{
240
+ type: Injectable,
241
+ args: [{ providedIn: 'root' }]
242
+ }] });
243
+ class DeletePersonalTaskCommand extends PersonalTaskCommand {
244
+ constructor() {
245
+ super(...arguments);
246
+ this.action = 'delete';
247
+ }
248
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: DeletePersonalTaskCommand, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
249
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: DeletePersonalTaskCommand, providedIn: 'root' }); }
250
+ }
251
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: DeletePersonalTaskCommand, decorators: [{
252
+ type: Injectable,
253
+ args: [{ providedIn: 'root' }]
254
+ }] });
255
+
256
+ export { CreatePersonalTaskCommand, DeletePersonalTaskCommand, EditPersonalTaskCommand };
257
+ //# sourceMappingURL=acorex-platform-module-task-management-client-personal-task.command-BubXfozR.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-task-management-client-personal-task.command-BubXfozR.mjs","sources":["../../../../libs/modules/task-management/client/src/lib/features/task/commands/task-create-schedule.util.ts","../../../../libs/modules/task-management/client/src/lib/features/task/commands/personal-task.command.ts"],"sourcesContent":["import type { AXPTaskScheduleInput } from '@acorex-platform/module-task-management-client/contracts';\nimport { taskInputInstant } from '../task-entity-input.util';\n\nexport interface TaskCreateSchedule {\n mode: 'none' | 'timed' | 'all-day';\n start: Date | string | null;\n end: Date | string | null;\n day: Date | string | null;\n due: Date | string | null;\n estimatedMinutes: number | null;\n}\n\n/** Form values become explicit instants; an all-day date keeps its local calendar day. */\nexport function taskCreateScheduleInput(value: TaskCreateSchedule, timeZone: string): AXPTaskScheduleInput {\n const invalid = (message: string): never => { throw Object.assign(new Error(message), { code: 'validation_failed' }); };\n const result: AXPTaskScheduleInput = { dueAt: taskInputInstant(value.due), estimatedMinutes: value.estimatedMinutes };\n if (value.estimatedMinutes != null && (!Number.isSafeInteger(value.estimatedMinutes) || value.estimatedMinutes < 0)) invalid('Invalid estimate.');\n if (value.mode === 'timed') {\n const start = taskInputInstant(value.start), end = taskInputInstant(value.end);\n if (start && end && end <= start) invalid('Planned end must follow start.');\n return { ...result, plannedStartAt: start, plannedEndAt: end, allDayDate: null, calendarTimeZone: null };\n }\n if (value.mode === 'all-day') {\n const dayInstant = taskInputInstant(value.day);\n if (!dayInstant) return invalid('An all-day date is required.');\n const day = new Date(dayInstant);\n try { new Intl.DateTimeFormat('en', { timeZone }).format(0); } catch { invalid('Invalid timezone.'); }\n return { ...result, plannedStartAt: null, plannedEndAt: null, allDayDate: `${day.getFullYear()}-${String(day.getMonth() + 1).padStart(2, '0')}-${String(day.getDate()).padStart(2, '0')}`, calendarTimeZone: timeZone };\n }\n if (value.mode !== 'none') invalid('Invalid schedule mode.');\n return { ...result, plannedStartAt: null, plannedEndAt: null, allDayDate: null, calendarTimeZone: null };\n}\n","import { Injectable, inject } from '@angular/core';\nimport { AXPSessionService } from '@acorex-platform/framework-client/auth';\nimport { AXPBroadcastEventService } from '@acorex-platform/framework-client/core';\nimport { AXPLayoutBuilderService } from '@acorex-platform/framework-client/layout/builder';\nimport { AXPCommandService, AXPQueryService } from '@acorex-platform/framework-client/runtime';\nimport { createRandomUuid, runtimeQueryPayloadData, type AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\nimport type { AXPCommand } from '@acorex-platform/framework-shared/runtime';\nimport type { AXPTaskOutputRecord, AXPTaskCommandResult } from '@acorex-platform/module-task-management-client/contracts';\nimport { taskPersonalCapability, taskRecordActionPlan } from '../task-personal-capabilities.util';\nimport type { AXPWorkBoardCreateContext, AXPWorkBoardCreateResult } from '@acorex-platform/framework-client/layout/components';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXDialogService } from '@acorex/components/dialog';\nimport { taskActionErrorKey } from '../../task-board/task-lifecycle-ui.util';\nimport { TaskAttachmentsUiService, TASK_ATTACHMENT_WIDGET_OPTIONS } from '../task-attachments-ui.service';\nimport type { AXPTaskCreatePlan } from '@acorex-platform/module-task-management-client/contracts';\nimport { taskCreateScheduleInput } from './task-create-schedule.util';\n\ninterface PersonalTaskCommandInput { taskId?: string; context?: AXPWorkBoardCreateContext; }\ntype PersonalTaskAction = 'create' | 'edit' | 'delete';\n\n@Injectable()\nabstract class PersonalTaskCommand implements AXPCommand<PersonalTaskCommandInput> {\n protected abstract readonly action: PersonalTaskAction;\n private readonly attachments = inject(TaskAttachmentsUiService);\n private readonly layouts = inject(AXPLayoutBuilderService);\n private readonly commands = inject(AXPCommandService);\n private readonly queries = inject(AXPQueryService);\n private readonly session = inject(AXPSessionService);\n private readonly translations = inject(AXTranslationService);\n private readonly dialogs = inject(AXDialogService);\n private readonly events = inject(AXPBroadcastEventService);\n private readonly pending = new Map<string, Promise<AXPRuntimeCommandResult>>();\n private scope(): string { return JSON.stringify([this.session.user?.id, this.session.tenant?.id, this.session.application?.id, this.session.authorizationRevision]); }\n\n execute(options: PersonalTaskCommandInput = {}): Promise<AXPRuntimeCommandResult> {\n const action = this.action;\n const key = JSON.stringify([this.scope(), action, options.taskId]);\n const existing = this.pending.get(key);\n if (existing) return existing;\n const work = this.open(action, options).finally(() => this.pending.delete(key));\n this.pending.set(key, work);\n return work;\n }\n\n private async read<T>(key: string, taskId: string): Promise<T> {\n const response = await this.queries.fetch<{ taskId: string }, T>(key, { taskId }, { snapshot: false, dataExecution: { force: true, refreshOnInvalidate: false } });\n const result = runtimeQueryPayloadData<T>(response);\n if (!result) throw response;\n return result;\n }\n\n private async open(action: PersonalTaskAction, options: PersonalTaskCommandInput): Promise<AXPRuntimeCommandResult> {\n const { AXP_TASK_RUNTIME_KEYS } = await import('@acorex-platform/module-task-management-client/contracts');\n const scope = this.scope();\n let record: AXPTaskOutputRecord | undefined;\n if (action !== 'create') {\n if (!options.taskId) throw { code: 'validation_failed' };\n const row = await this.read<AXPTaskOutputRecord>(AXP_TASK_RUNTIME_KEYS.Get, options.taskId);\n if (row.id !== options.taskId || !Number.isSafeInteger(row.version) || row.version < 1 || !await taskPersonalCapability(row, action)) throw { code: 'forbidden' };\n record = row;\n }\n if (scope !== this.scope()) throw { code: 'forbidden' };\n if (action === 'delete') {\n if (!record) throw { code: 'forbidden' };\n const confirmed = await this.dialogs.confirm(\n await this.translations.translateAsync('@general:workflow.warning'),\n await this.translations.translateAsync('@general:workflow.confirm-delete'),\n 'danger', 'horizontal', false, 'cancel',\n );\n if (!confirmed.result) return { success: false, metadata: { outcome: 'cancelled' } };\n try {\n if (scope !== this.scope()) throw { code: 'forbidden' };\n const response = await this.commands.executeRemote<unknown, AXPTaskCommandResult>(AXP_TASK_RUNTIME_KEYS.DeletePersonal, {\n taskId: record.id, expectedVersion: record.version, commandId: createRandomUuid(),\n });\n if (!response?.success) throw response;\n const result = runtimeQueryPayloadData<AXPTaskCommandResult>(response);\n if (!result?.taskId || scope !== this.scope()) throw { code: 'forbidden' };\n this.events.publish('task-board.close', { provider: 'task-management.tasks' });\n this.events.publish('task-board.refresh', { provider: 'task-management.tasks', preserveRows: true, itemIds: [result.taskId] });\n return { success: true, kind: 'object', data: result, metadata: { refresh: true } };\n } catch (error) {\n throw new Error(await this.translations.translateAsync(taskActionErrorKey(error)));\n }\n }\n const createPlan = action === 'create' ? runtimeQueryPayloadData<AXPTaskCreatePlan>(await this.queries.fetch(AXP_TASK_RUNTIME_KEYS.PersonalCreatePlan, {}, { snapshot: false, dataExecution: { force: true, refreshOnInvalidate: false } })) : undefined;\n if (action === 'create' && !createPlan || scope !== this.scope()) throw { code: 'forbidden' };\n const timePolicy = record?.timePolicy ?? createPlan!.timePolicy;\n const attachmentsEnabled = action === 'create' ? createPlan?.hasAttachments === true : taskRecordActionPlan(record!)?.attachments?.enabled === true;\n const range = options.context?.range;\n const seed = {\n checklist: [] as Array<{ title: string }>,\n attachments: this.attachments.files(record?.attachments),\n title: record?.title ?? '', description: record?.description ?? '', priority: record?.priority ?? 'normal',\n mode: record?.allDayDate ? 'all-day' : record?.plannedStartAt || record?.plannedEndAt || range ? options.context?.allDay ? 'all-day' : 'timed' : 'none',\n start: record?.plannedStartAt ? new Date(record.plannedStartAt) : range?.from ?? null,\n end: record?.plannedEndAt ? new Date(record.plannedEndAt) : range?.end ?? null,\n day: record?.allDayDate ? new Date(record.allDayDate + 'T12:00:00') : range?.from ?? null,\n due: record?.dueAt ?? null,\n estimatedMinutes: record?.estimatedMinutes ?? null,\n };\n let lastPayload = '', commandId = '';\n let submitting = false;\n const result = await this.layouts.create().dialog<AXPRuntimeCommandResult>(dialog => {\n dialog.setTitle(`@task-management:personal-task.${action}-title`).setSize('md').setCloseButton(true).setContext(seed)\n .confirmCloseWhenDirty(true)\n .content(flex => {\n flex.setDirection('column');\n flex.formField('@task-management:personal-task.title', field => field.path('title').textBox({ validations: [{ rule: 'required' }], maxLength: 300 }));\n flex.formField('@task-management:personal-task.description', field => field.path('description').largeTextBox({ maxLength: 10000 }));\n flex.grid(grid => {\n grid.setColumns(12).setGap('1rem');\n grid.formField('@task-management:personal-task.priority', field => field.layout(6).path('priority').selectBox({\n valueField: 'id', textField: 'title', dataSource: ['low', 'normal', 'high', 'urgent'].map(id => ({ id, title: `@task-management:task-board.priority.${id}` })),\n }));\n grid.formField('@task-management:personal-task.schedule', field => field.layout(6).path('mode').selectBox({\n valueField: 'id', textField: 'title', dataSource: ['none', 'timed', 'all-day'].map(id => ({ id, title: `@task-management:personal-task.schedule-${id}` })),\n }));\n });\n flex.grid(grid => {\n grid.setColumns(12).setGap('1rem');\n grid.formField('@task-management:personal-task.start', field => field.layout(4).path('start').dateTimeBox({ format: 'datetime' }).visible(\"{{ context.eval('mode') === 'timed' }}\"));\n grid.formField('@task-management:personal-task.end', field => field.layout(4).path('end').dateTimeBox({ format: 'datetime' }).visible(\"{{ context.eval('mode') === 'timed' }}\"));\n grid.formField('@task-management:personal-task.day', field => field.layout(4).path('day').dateTimeBox({ format: 'date' }).visible(\"{{ context.eval('mode') === 'all-day' }}\"));\n if (timePolicy.dueMode !== 'disabled') grid.formField('@task-management:personal-task.due', field => field.layout(4).path('due').dateTimeBox({ format: 'datetime', validations: timePolicy.dueMode === 'required' ? [{ rule: 'required' }] : [] }));\n });\n if (action === 'create') {\n flex.formField('@task-management:personal-task.checklist', field => field.path('checklist').customWidget('repeater-layout', {\n hasControls: true, allowReorder: true, defaultItem: { title: '' }, mode: 'edit',\n children: [{ type: 'text-editor', path: 'title', mode: 'edit', options: {\n placeholder: '@task-management:personal-task.checklist-item', maxLength: 240, validations: [{ rule: 'required' }],\n } }],\n }));\n }\n if (attachmentsEnabled) flex.formField('@general:widgets.file-uploader.attachments.title', field => field.path('attachments').customWidget('attachments', TASK_ATTACHMENT_WIDGET_OPTIONS));\n })\n .setActions(actions => { actions.cancel(); actions.submit('@general:actions.save.title'); })\n .onAction(async ref => {\n if (ref.action() !== 'submit') return { success: false, metadata: { outcome: 'cancelled' } };\n if (submitting) throw { code: 'conflict' };\n submitting = true;\n ref.setLoading(true);\n try {\n if (scope !== this.scope()) throw { code: 'forbidden' };\n const values = ref.context();\n const input = { ...(attachmentsEnabled ? { attachments: await this.attachments.input(values.attachments) } : {}), ...(action === 'create' ? { checklist: values.checklist.map((item: { title: string }) => ({ title: item.title })) } : {}), title: values.title, description: values.description || null, priority: values.priority,\n ...taskCreateScheduleInput({ ...values, due: timePolicy.dueMode === 'disabled' ? null : values.due }, record?.calendarTimeZone ?? Intl.DateTimeFormat().resolvedOptions().timeZone) };\n const payload = { ...(record ? { taskId: record.id, expectedVersion: record.version } : {}), ...(input ? { input } : {}) };\n const fingerprint = JSON.stringify(payload);\n if (fingerprint !== lastPayload) { lastPayload = fingerprint; commandId = createRandomUuid(); }\n const key = action === 'create' ? AXP_TASK_RUNTIME_KEYS.CreatePersonal : AXP_TASK_RUNTIME_KEYS.UpdatePersonal;\n if (scope !== this.scope()) throw { code: 'forbidden' };\n const response = await this.commands.executeRemote<unknown, AXPTaskCommandResult>(key, { ...payload, commandId });\n if (!response?.success) throw response;\n const result = runtimeQueryPayloadData<AXPTaskCommandResult>(response);\n if (!result?.taskId || scope !== this.scope()) throw { code: 'forbidden' };\n this.events.publish('task-board.close', { provider: 'task-management.tasks' });\n this.events.publish('task-board.refresh', { provider: 'task-management.tasks', preserveRows: true, itemIds: [result.taskId] });\n const data = action === 'create' ? {\n ...result,\n scheduleKind: input.allDayDate ? 'all-day' : input.plannedStartAt || input.plannedEndAt ? 'timed' : input.dueAt ? 'deadline' : 'unscheduled',\n } satisfies AXPWorkBoardCreateResult : result;\n return { success: true, kind: 'object', data, metadata: { refresh: true } };\n } catch (error) {\n throw new Error(await this.translations.translateAsync(taskActionErrorKey(error)));\n } finally { submitting = false; ref.setLoading(false); }\n });\n }).show();\n return result ?? { success: false, metadata: { outcome: 'cancelled' } };\n }\n}\n\n@Injectable({ providedIn: 'root' })\nexport class CreatePersonalTaskCommand extends PersonalTaskCommand {\n protected readonly action = 'create' as const;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class EditPersonalTaskCommand extends PersonalTaskCommand {\n protected readonly action = 'edit' as const;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class DeletePersonalTaskCommand extends PersonalTaskCommand {\n protected readonly action = 'delete' as const;\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAYA;AACM,SAAU,uBAAuB,CAAC,KAAyB,EAAE,QAAgB,EAAA;IACjF,MAAM,OAAO,GAAG,CAAC,OAAe,KAAW,EAAG,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE,CAAC,CAAC,CAAC,CAAC;AACvH,IAAA,MAAM,MAAM,GAAyB,EAAE,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,gBAAgB,EAAE,KAAK,CAAC,gBAAgB,EAAE;IACrH,IAAI,KAAK,CAAC,gBAAgB,IAAI,IAAI,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,gBAAgB,CAAC,IAAI,KAAK,CAAC,gBAAgB,GAAG,CAAC,CAAC;QAAE,OAAO,CAAC,mBAAmB,CAAC;AACjJ,IAAA,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE;AAC1B,QAAA,MAAM,KAAK,GAAG,gBAAgB,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,GAAG,GAAG,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC;AAC9E,QAAA,IAAI,KAAK,IAAI,GAAG,IAAI,GAAG,IAAI,KAAK;YAAE,OAAO,CAAC,gCAAgC,CAAC;QAC3E,OAAO,EAAE,GAAG,MAAM,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE;IAC1G;AACA,IAAA,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,EAAE;QAC5B,MAAM,UAAU,GAAG,gB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BAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
@@ -0,0 +1,42 @@
1
+ import { extractFieldContainsValue, AXP_QUERY_QUICK_SEARCH_FIELD, buildTextSearchFilter } from '@acorex-platform/framework-shared/core';
2
+
3
+ /** Typed lookup/list search term, whether it arrived as the display field or `__quickSearch__`. */
4
+ function readLookupSearchTerm(filter, textField) {
5
+ if (!filter) {
6
+ return undefined;
7
+ }
8
+ const value = extractFieldContainsValue(filter, AXP_QUERY_QUICK_SEARCH_FIELD) ??
9
+ extractFieldContainsValue(filter, textField);
10
+ if (value == null) {
11
+ return undefined;
12
+ }
13
+ const term = String(value).trim();
14
+ return term || undefined;
15
+ }
16
+ /**
17
+ * Same predicate entity lookups use: `__quickSearch__` when that setting is on,
18
+ * otherwise an OR of the entity's inline-searchable properties.
19
+ */
20
+ function toEntityLookupSearchRequest(request, entity, textField, useQuickSearch) {
21
+ const term = readLookupSearchTerm(request.filter, textField);
22
+ if (!term) {
23
+ return request;
24
+ }
25
+ const inlineFields = (entity.properties ?? [])
26
+ .filter((property) => property.options?.filter?.inline?.enabled)
27
+ .map((property) => property.name);
28
+ const filter = buildTextSearchFilter(term, inlineFields, useQuickSearch);
29
+ if (!filter) {
30
+ return request;
31
+ }
32
+ return { ...request, filter };
33
+ }
34
+ function matchesLookupSearchText(text, term) {
35
+ if (!term) {
36
+ return true;
37
+ }
38
+ return String(text ?? '').toLowerCase().includes(term.toLowerCase());
39
+ }
40
+
41
+ export { matchesLookupSearchText as m, readLookupSearchTerm as r, toEntityLookupSearchRequest as t };
42
+ //# sourceMappingURL=acorex-platform-module-task-management-client-task-board-lookup-search.util-il-mNHxd.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-task-management-client-task-board-lookup-search.util-il-mNHxd.mjs","sources":["../../../../libs/modules/task-management/client/src/lib/features/queries/task-board-lookup-search.util.ts"],"sourcesContent":["import {\n AXP_QUERY_QUICK_SEARCH_FIELD,\n buildTextSearchFilter,\n extractFieldContainsValue,\n type AXPQueryRequest,\n} from '@acorex-platform/framework-shared/core';\nimport type { AXPEntity } from '@acorex-platform/framework-shared/entity';\nimport type { AXDataSourceFilterOption } from '@acorex/cdk/common';\n\n/** Typed lookup/list search term, whether it arrived as the display field or `__quickSearch__`. */\nexport function readLookupSearchTerm(\n filter: AXDataSourceFilterOption | null | undefined,\n textField: string,\n): string | undefined {\n if (!filter) {\n return undefined;\n }\n\n const value =\n extractFieldContainsValue(filter, AXP_QUERY_QUICK_SEARCH_FIELD) ??\n extractFieldContainsValue(filter, textField);\n if (value == null) {\n return undefined;\n }\n\n const term = String(value).trim();\n return term || undefined;\n}\n\n/**\n * Same predicate entity lookups use: `__quickSearch__` when that setting is on,\n * otherwise an OR of the entity's inline-searchable properties.\n */\nexport function toEntityLookupSearchRequest(\n request: AXPQueryRequest,\n entity: AXPEntity,\n textField: string,\n useQuickSearch: boolean,\n): AXPQueryRequest {\n const term = readLookupSearchTerm(request.filter, textField);\n if (!term) {\n return request;\n }\n\n const inlineFields = (entity.properties ?? [])\n .filter((property) => property.options?.filter?.inline?.enabled)\n .map((property) => property.name);\n const filter = buildTextSearchFilter(term, inlineFields, useQuickSearch);\n if (!filter) {\n return request;\n }\n\n return { ...request, filter };\n}\n\nexport function matchesLookupSearchText(text: string | null | undefined, term: string | undefined): boolean {\n if (!term) {\n return true;\n }\n return String(text ?? '').toLowerCase().includes(term.toLowerCase());\n}\n"],"names":[],"mappings":";;AASA;AACM,SAAU,oBAAoB,CAClC,MAAmD,EACnD,SAAiB,EAAA;IAEjB,IAAI,CAAC,MAAM,EAAE;AACX,QAAA,OAAO,SAAS;IAClB;AAEA,IAAA,MAAM,KAAK,GACT,yBAAyB,CAAC,MAAM,EAAE,4BAA4B,CAAC;AAC/D,QAAA,yBAAyB,CAAC,MAAM,EAAE,SAAS,CAAC;AAC9C,IAAA,IAAI,KAAK,IAAI,IAAI,EAAE;AACjB,QAAA,OAAO,SAAS;IAClB;IAEA,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE;IACjC,OAAO,IAAI,IAAI,SAAS;AAC1B;AAEA;;;AAGG;AACG,SAAU,2BAA2B,CACzC,OAAwB,EACxB,MAAiB,EACjB,SAAiB,EACjB,cAAuB,EAAA;IAEvB,MAAM,IAAI,GAAG,oBAAoB,CAAC,OAAO,CAAC,MAAM,EAAE,SAAS,CAAC;IAC5D,IAAI,CAAC,IAAI,EAAE;AACT,QAAA,OAAO,OAAO;IAChB;IAEA,MAAM,YAAY,GAAG,CAAC,MAAM,CAAC,UAAU,IAAI,EAAE;AAC1C,SAAA,MAAM,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO;SAC9D,GAAG,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,IAAI,CAAC;IACnC,MAAM,MAAM,GAAG,qBAAqB,CAAC,IAAI,EAAE,YAAY,EAAE,cAAc,CAAC;IACxE,IAAI,CAAC,MAAM,EAAE;AACX,QAAA,OAAO,OAAO;IAChB;AAEA,IAAA,OAAO,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE;AAC/B;AAEM,SAAU,uBAAuB,CAAC,IAA+B,EAAE,IAAwB,EAAA;IAC/F,IAAI,CAAC,IAAI,EAAE;AACT,QAAA,OAAO,IAAI;IACb;AACA,IAAA,OAAO,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;AACtE;;"}
@@ -0,0 +1,65 @@
1
+ import * as i0 from '@angular/core';
2
+ import { inject, Injectable } from '@angular/core';
3
+ import { resolveEntityActionCommandInput } from '@acorex-platform/framework-shared/runtime';
4
+ import { g as TaskEntityUiService, h as AXPTaskLifecycleUiService } from './acorex-platform-module-task-management-client-acorex-platform-module-task-management-client-dfiarGtJ.mjs';
5
+
6
+ class EditTaskEntityCommand {
7
+ constructor() {
8
+ this.ui = inject(TaskEntityUiService);
9
+ }
10
+ async execute(input) {
11
+ const data = resolveEntityActionCommandInput(input).data;
12
+ if (!data?.id)
13
+ return { success: false };
14
+ return this.ui.open(data.id, true);
15
+ }
16
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: EditTaskEntityCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
17
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: EditTaskEntityCommand, providedIn: 'root' }); }
18
+ }
19
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: EditTaskEntityCommand, decorators: [{
20
+ type: Injectable,
21
+ args: [{ providedIn: 'root' }]
22
+ }] });
23
+ class ViewTaskEntityCommand {
24
+ constructor() {
25
+ this.ui = inject(TaskEntityUiService);
26
+ }
27
+ async execute(input) {
28
+ const data = resolveEntityActionCommandInput(input).data;
29
+ if (!data?.id)
30
+ return { success: false };
31
+ return this.ui.open(data.id, false);
32
+ }
33
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ViewTaskEntityCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
34
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ViewTaskEntityCommand, providedIn: 'root' }); }
35
+ }
36
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ViewTaskEntityCommand, decorators: [{
37
+ type: Injectable,
38
+ args: [{ providedIn: 'root' }]
39
+ }] });
40
+ class TaskEntityLifecycleCommand {
41
+ constructor() {
42
+ this.ui = inject(AXPTaskLifecycleUiService);
43
+ }
44
+ async execute(input) {
45
+ if (input.options?.taskId)
46
+ return this.ui.open(input.options);
47
+ const data = resolveEntityActionCommandInput(input).data;
48
+ if (!data?.id || !input.options?.action)
49
+ return { success: false };
50
+ const plan = await this.ui.actions(data.id);
51
+ const action = plan.actions.find(a => a.action === input.options?.action);
52
+ if (!action)
53
+ return { success: false };
54
+ return this.ui.open({ taskId: plan.taskId, expectedVersion: plan.version, action: action.action, targetStatusId: action.targetStatusId, plan });
55
+ }
56
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: TaskEntityLifecycleCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
57
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: TaskEntityLifecycleCommand, providedIn: 'root' }); }
58
+ }
59
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: TaskEntityLifecycleCommand, decorators: [{
60
+ type: Injectable,
61
+ args: [{ providedIn: 'root' }]
62
+ }] });
63
+
64
+ export { EditTaskEntityCommand, TaskEntityLifecycleCommand, ViewTaskEntityCommand };
65
+ //# sourceMappingURL=acorex-platform-module-task-management-client-task-entity-record.command-BCL_Ctpw.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-task-management-client-task-entity-record.command-BCL_Ctpw.mjs","sources":["../../../../libs/modules/task-management/client/src/lib/features/task/commands/task-entity-record.command.ts"],"sourcesContent":["import { Injectable, inject } from '@angular/core';\nimport { resolveEntityActionCommandInput } from '@acorex-platform/framework-shared/runtime';\nimport { TaskEntityUiService } from '../task-entity-ui.service';\nimport { AXPTaskLifecycleUiService, type TaskLifecycleSelection } from '../../task-board/task-lifecycle-ui.service';\n\n@Injectable({ providedIn: 'root' })\nexport class EditTaskEntityCommand {\n private readonly ui = inject(TaskEntityUiService);\n async execute(input: Parameters<typeof resolveEntityActionCommandInput>[0]) {\n const data = resolveEntityActionCommandInput(input).data as { id?: string } | undefined;\n if (!data?.id) return { success: false as const };\n return this.ui.open(data.id, true);\n }\n}\n@Injectable({ providedIn: 'root' })\nexport class ViewTaskEntityCommand {\n private readonly ui = inject(TaskEntityUiService);\n async execute(input: Parameters<typeof resolveEntityActionCommandInput>[0]) {\n const data = resolveEntityActionCommandInput(input).data as { id?: string } | undefined;\n if (!data?.id) return { success: false as const };\n return this.ui.open(data.id, false);\n }\n}\n\n@Injectable({ providedIn: 'root' })\nexport class TaskEntityLifecycleCommand {\n private readonly ui = inject(AXPTaskLifecycleUiService);\n async execute(input: Parameters<typeof resolveEntityActionCommandInput>[0] & { options?: Partial<TaskLifecycleSelection> }) {\n if (input.options?.taskId) return this.ui.open(input.options as TaskLifecycleSelection);\n const data = resolveEntityActionCommandInput(input).data as { id?: string } | undefined;\n if (!data?.id || !input.options?.action) return { success: false as const };\n const plan = await this.ui.actions(data.id);\n const action = plan.actions.find(a => a.action === input.options?.action);\n if (!action) return { success: false as const };\n return this.ui.open({ taskId: plan.taskId, expectedVersion: plan.version, action: action.action, targetStatusId: action.targetStatusId, plan });\n }\n}\n"],"names":[],"mappings":";;;;;MAMa,qBAAqB,CAAA;AADlC,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,EAAE,GAAG,MAAM,CAAC,mBAAmB,CAAC;AAMlD,IAAA;IALC,MAAM,OAAO,CAAC,KAA4D,EAAA;QACxE,MAAM,IAAI,GAAG,+BAA+B,CAAC,KAAK,CAAC,CAAC,IAAmC;QACvF,IAAI,CAAC,IAAI,EAAE,EAAE;AAAE,YAAA,OAAO,EAAE,OAAO,EAAE,KAAc,EAAE;AACjD,QAAA,OAAO,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC;IACpC;8GANW,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAArB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,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