@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,25 @@
1
+ import * as i0 from '@angular/core';
2
+ import { inject, Injectable } from '@angular/core';
3
+ import { g as TaskEntityUiService } from './acorex-platform-module-task-management-client-acorex-platform-module-task-management-client-dfiarGtJ.mjs';
4
+
5
+ class CreateSubjectTaskCommand {
6
+ constructor() {
7
+ this.ui = inject(TaskEntityUiService);
8
+ }
9
+ async execute(request) {
10
+ // Entity actions pass an envelope; Workboard and runtime calls pass the input directly.
11
+ const input = request && 'options' in request ? request.options : request;
12
+ if (typeof input?.taskTypeId !== 'string' || !input.taskTypeId.trim() || typeof input.subjectRef?.type !== 'string' || !input.subjectRef.type.trim() || typeof input.subjectRef.id !== 'string' || !input.subjectRef.id.trim() || [input.taskTypeId, input.subjectRef.type, input.subjectRef.id].some(value => value.includes('{{')))
13
+ return { success: false, message: { type: 'error', text: 'A task type and resolved subject are required.' } };
14
+ return this.ui.create(input);
15
+ }
16
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: CreateSubjectTaskCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
17
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: CreateSubjectTaskCommand, providedIn: 'root' }); }
18
+ }
19
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: CreateSubjectTaskCommand, decorators: [{
20
+ type: Injectable,
21
+ args: [{ providedIn: 'root' }]
22
+ }] });
23
+
24
+ export { CreateSubjectTaskCommand };
25
+ //# sourceMappingURL=acorex-platform-module-task-management-client-create-subject-task.command-o5rIB4lp.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-task-management-client-create-subject-task.command-o5rIB4lp.mjs","sources":["../../../../libs/modules/task-management/client/src/lib/features/task/commands/create-subject-task.command.ts"],"sourcesContent":["import { Injectable, inject } from '@angular/core';\nimport type { AXPCommand } from '@acorex-platform/framework-shared/runtime';\nimport type { AXPTaskSubjectRef } from '@acorex-platform/module-task-management-client/contracts';\nimport { TaskEntityUiService } from '../task-entity-ui.service';\n\nexport interface CreateSubjectTaskInput { taskTypeId: string; taskTypeTitle?: string; subjectRef: AXPTaskSubjectRef; }\n@Injectable({ providedIn: 'root' })\nexport class CreateSubjectTaskCommand implements AXPCommand<CreateSubjectTaskInput | { options: CreateSubjectTaskInput }> {\n private readonly ui = inject(TaskEntityUiService);\n async execute(request: CreateSubjectTaskInput | { options: CreateSubjectTaskInput }) {\n // Entity actions pass an envelope; Workboard and runtime calls pass the input directly.\n const input = request && 'options' in request ? request.options : request as CreateSubjectTaskInput;\n if (typeof input?.taskTypeId !== 'string' || !input.taskTypeId.trim() || typeof input.subjectRef?.type !== 'string' || !input.subjectRef.type.trim() || typeof input.subjectRef.id !== 'string' || !input.subjectRef.id.trim() || [input.taskTypeId, input.subjectRef.type, input.subjectRef.id].some(value => value.includes('{{'))) return { success: false as const, message: { type: 'error' as const, text: 'A task type and resolved subject are required.' } };\n return this.ui.create(input);\n }\n}\n"],"names":[],"mappings":";;;;MAOa,wBAAwB,CAAA;AADrC,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,EAAE,GAAG,MAAM,CAAC,mBAAmB,CAAC;AAOlD,IAAA;IANC,MAAM,OAAO,CAAC,OAAqE,EAAA;;AAEjF,QAAA,MAAM,KAAK,GAAG,OAAO,IAAI,SAAS,IAAI,OAAO,GAAG,OAAO,CAAC,OAAO,GAAG,OAAiC;AACnG,QAAA,IAAI,OAAO,KAAK,EAAE,UAAU,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI,OAAO,KAAK,CAAC,UAAU,EAAE,IAAI,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,OAAO,KAAK,CAAC,UAAU,CAAC,EAAE,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAAE,YAAA,OAAO,EAAE,OAAO,EAAE,KAAc,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,OAAgB,EAAE,IAAI,EAAE,gDAAgD,EAAE,EAAE;QACrc,OAAO,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC;IAC9B;8GAPW,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAxB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,wBAAwB,cADX,MAAM,EAAA,CAAA,CAAA;;2FACnB,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBADpC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
@@ -0,0 +1,46 @@
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 { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';
5
+ import { AXPCommandService } from '@acorex-platform/framework-client/runtime';
6
+ import { AXPProjectsWorkPermissionKeys, personalTaskTypeId } from '@acorex-platform/module-task-management-client/contracts';
7
+ import { P as PERSONAL_TASK_COMMANDS } from './acorex-platform-module-task-management-client-acorex-platform-module-task-management-client-dfiarGtJ.mjs';
8
+
9
+ /** Re-resolve live configuration when clicked; task creation stays with its owner. */
10
+ class CreateTaskTypeCommand {
11
+ constructor() {
12
+ this.entities = inject(AXPEntityService);
13
+ this.commands = inject(AXPCommandService);
14
+ this.session = inject(AXPSessionService);
15
+ }
16
+ scope() { return JSON.stringify([this.session.user?.id, this.session.tenant?.id, this.session.application?.id, this.session.authorizationRevision]); }
17
+ async execute(input) {
18
+ if (!input?.taskTypeId?.trim() || !this.session.authorize(AXPProjectsWorkPermissionKeys.Access))
19
+ return { success: false };
20
+ const tenantId = this.session.tenant?.id;
21
+ const applicationId = this.session.application?.id;
22
+ if (!tenantId || !applicationId)
23
+ return { success: false };
24
+ const scope = this.scope();
25
+ const type = await this.entities.withEntity('TaskManagement', 'TaskType').data()
26
+ .byKey(input.taskTypeId, { forUpdate: true });
27
+ if (scope !== this.scope() || type?.id !== input.taskTypeId || !type.isActive || type.showInTaskCreate !== true)
28
+ return { success: false };
29
+ if (type.id === personalTaskTypeId(tenantId, applicationId))
30
+ return await this.commands.execute(PERSONAL_TASK_COMMANDS.Create, { context: input.context ?? {} }) ?? { success: false };
31
+ const workflow = type.workflowConfig;
32
+ if (!workflow?.workflowName?.trim())
33
+ return { success: false };
34
+ return await this.commands.execute('WorkflowManagement.WorkflowDefinition:Execute', {
35
+ workflowId: workflow.workflowName.trim(), input: { ...workflow.defaultInput, taskTypeId: type.id, taskTypeTitle: type.title },
36
+ }) ?? { success: false };
37
+ }
38
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: CreateTaskTypeCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
39
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: CreateTaskTypeCommand }); }
40
+ }
41
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: CreateTaskTypeCommand, decorators: [{
42
+ type: Injectable
43
+ }] });
44
+
45
+ export { CreateTaskTypeCommand };
46
+ //# sourceMappingURL=acorex-platform-module-task-management-client-create-task-type.command-4VzqIkIc.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-task-management-client-create-task-type.command-4VzqIkIc.mjs","sources":["../../../../libs/modules/task-management/client/src/lib/features/task/commands/create-task-type.command.ts"],"sourcesContent":["import { Injectable, inject } from '@angular/core';\nimport { AXPSessionService } from '@acorex-platform/framework-client/auth';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPCommandService } from '@acorex-platform/framework-client/runtime';\nimport type { AXPWorkBoardCreateContext } from '@acorex-platform/framework-client/layout/components';\nimport type { AXPCommand } from '@acorex-platform/framework-shared/runtime';\nimport { AXPProjectsWorkPermissionKeys, personalTaskTypeId, type AXMTaskManagementTaskTypeEntityModel } from '@acorex-platform/module-task-management-client/contracts';\nimport { PERSONAL_TASK_COMMANDS } from '../personal-task.commands';\n\ninterface CreateTaskTypeInput { taskTypeId: string; context?: AXPWorkBoardCreateContext; }\n\n/** Re-resolve live configuration when clicked; task creation stays with its owner. */\n@Injectable()\nexport class CreateTaskTypeCommand implements AXPCommand<CreateTaskTypeInput> {\n private readonly entities = inject(AXPEntityService);\n private readonly commands = inject(AXPCommandService);\n private readonly session = inject(AXPSessionService);\n private scope() { return JSON.stringify([this.session.user?.id, this.session.tenant?.id, this.session.application?.id, this.session.authorizationRevision]); }\n\n async execute(input: CreateTaskTypeInput) {\n if (!input?.taskTypeId?.trim() || !this.session.authorize(AXPProjectsWorkPermissionKeys.Access)) return { success: false as const };\n const tenantId = this.session.tenant?.id;\n const applicationId = this.session.application?.id;\n if (!tenantId || !applicationId) return { success: false as const };\n const scope = this.scope();\n const type = await this.entities.withEntity('TaskManagement', 'TaskType').data<string, AXMTaskManagementTaskTypeEntityModel>()\n .byKey(input.taskTypeId, { forUpdate: true });\n if (scope !== this.scope() || type?.id !== input.taskTypeId || !type.isActive || type.showInTaskCreate !== true) return { success: false as const };\n if (type.id === personalTaskTypeId(tenantId, applicationId)) return await this.commands.execute(PERSONAL_TASK_COMMANDS.Create, { context: input.context ?? {} }) ?? { success: false as const };\n const workflow = type.workflowConfig;\n if (!workflow?.workflowName?.trim()) return { success: false as const };\n return await this.commands.execute('WorkflowManagement.WorkflowDefinition:Execute', {\n workflowId: workflow.workflowName.trim(), input: { ...workflow.defaultInput, taskTypeId: type.id, taskTypeTitle: type.title },\n }) ?? { success: false as const };\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAWA;MAEa,qBAAqB,CAAA;AADlC,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACnC,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,iBAAiB,CAAC;AACpC,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAmBrD,IAAA;AAlBS,IAAA,KAAK,KAAK,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;IAE7J,MAAM,OAAO,CAAC,KAA0B,EAAA;AACtC,QAAA,IAAI,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,6BAA6B,CAAC,MAAM,CAAC;AAAE,YAAA,OAAO,EAAE,OAAO,EAAE,KAAc,EAAE;QACnI,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE;QACxC,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE;AAClD,QAAA,IAAI,CAAC,QAAQ,IAAI,CAAC,aAAa;AAAE,YAAA,OAAO,EAAE,OAAO,EAAE,KAAc,EAAE;AACnE,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE;AAC1B,QAAA,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,gBAAgB,EAAE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ADjC;;;"}
@@ -1,12 +1,14 @@
1
1
  import { RootConfig } from '@acorex-platform/module-security-management-client/contracts';
2
- import { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';
3
2
  import { AXPSessionService } from '@acorex-platform/framework-client/auth';
3
+ import { AXPSettingsService, isQuickSearchSettingEnabled } from '@acorex-platform/framework-client/common';
4
4
  import { applyFilterArray } from '@acorex-platform/framework-client/core';
5
+ import { AXPEntityService, AXPEntityDefinitionRegistryService } from '@acorex-platform/framework-client/layout/entity';
5
6
  import { runtimeQuerySuccessCollection, runtimeQueryFailure } from '@acorex-platform/framework-shared/core';
6
7
  import { AXTranslationService } from '@acorex/core/translation';
7
8
  import * as i0 from '@angular/core';
8
9
  import { inject, Injectable } from '@angular/core';
9
- import { p as resolveTaskBoardCurrentUserAssigneeItem, e as canViewAllTaskAssignees, q as AXM_TASK_BOARD_UNASSIGNED_ASSIGNEE_ID, s as isTaskBoardUnassignedAssigneeId } from './acorex-platform-module-task-management-client-acorex-platform-module-task-management-client-INIEvacu.mjs';
10
+ import { resolveTaskBoardCurrentUserAssigneeItem, canViewAllTaskAssignees, AXM_TASK_BOARD_UNASSIGNED_ASSIGNEE_ID, isTaskBoardUnassignedAssigneeId } from '@acorex-platform/framework-client/layout/components';
11
+ import { r as readLookupSearchTerm, m as matchesLookupSearchText, t as toEntityLookupSearchRequest } from './acorex-platform-module-task-management-client-task-board-lookup-search.util-il-mNHxd.mjs';
10
12
 
11
13
  //#endregion
12
14
  //#region ---- Helpers ----
@@ -34,6 +36,8 @@ class AXMListTaskBoardAssigneesQuery {
34
36
  constructor() {
35
37
  //#region ---- Services & Dependencies ----
36
38
  this.entityService = inject(AXPEntityService);
39
+ this.entityRegistry = inject(AXPEntityDefinitionRegistryService);
40
+ this.settingsService = inject(AXPSettingsService);
37
41
  this.userService = this.entityService
38
42
  .withEntity(RootConfig.module.name, RootConfig.entities.users.name)
39
43
  .data();
@@ -64,9 +68,14 @@ class AXMListTaskBoardAssigneesQuery {
64
68
  //#region ---- Private Methods ----
65
69
  async loadPage(request) {
66
70
  const skip = request.skip ?? 0;
71
+ const searchTerm = readLookupSearchTerm(request.filter, 'displayName');
67
72
  const selfItem = resolveTaskBoardCurrentUserAssigneeItem(this.sessionService);
68
73
  if (!canViewAllTaskAssignees(this.sessionService)) {
69
- if (!selfItem || !matchesFilter(selfItem, request.filter)) {
74
+ const selfMatches = searchTerm
75
+ ? matchesLookupSearchText(selfItem?.displayName, searchTerm) ||
76
+ matchesLookupSearchText(selfItem?.username, searchTerm)
77
+ : !!selfItem && matchesFilter(selfItem, request.filter);
78
+ if (!selfItem || !selfMatches) {
70
79
  return { items: [], total: 0 };
71
80
  }
72
81
  return { items: skip === 0 ? [selfItem] : [], total: 1 };
@@ -77,8 +86,14 @@ class AXMListTaskBoardAssigneesQuery {
77
86
  displayName: unassignedLabel,
78
87
  username: '',
79
88
  };
80
- const includeUnassigned = matchesFilter(unassignedItem, request.filter);
81
- const res = await this.userService.query(request ?? { skip: 0, take: 100 });
89
+ const includeUnassigned = searchTerm
90
+ ? matchesLookupSearchText(unassignedLabel, searchTerm)
91
+ : matchesFilter(unassignedItem, request.filter);
92
+ const userRequest = await this.toUserLookupSearchRequest(request);
93
+ const res = await this.userService.query({
94
+ ...userRequest,
95
+ fields: ['displayName', 'id', 'username'],
96
+ });
82
97
  const userItems = res.items.map((item) => ({
83
98
  id: item.id,
84
99
  displayName: item.displayName,
@@ -88,6 +103,10 @@ class AXMListTaskBoardAssigneesQuery {
88
103
  const total = res.total + (includeUnassigned ? 1 : 0);
89
104
  return { items, total };
90
105
  }
106
+ async toUserLookupSearchRequest(request) {
107
+ const entity = await this.entityRegistry.resolve(RootConfig.module.name, RootConfig.entities.users.name);
108
+ return toEntityLookupSearchRequest(request, entity, 'displayName', isQuickSearchSettingEnabled(this.settingsService));
109
+ }
91
110
  async resolveOne(userId) {
92
111
  const selfItem = resolveTaskBoardCurrentUserAssigneeItem(this.sessionService);
93
112
  if (selfItem != null && String(selfItem.id) === userId) {
@@ -107,7 +126,8 @@ class AXMListTaskBoardAssigneesQuery {
107
126
  if (!canViewAllTaskAssignees(this.sessionService)) {
108
127
  return null;
109
128
  }
110
- const user = await this.userService.byKey(userId);
129
+ const page = await this.userService.query({ skip: 0, take: 1, fields: ['displayName', 'id', 'username'], filter: { logic: 'and', filters: [{ field: 'id', operator: { type: 'equal' }, value: userId }] } });
130
+ const user = page.items[0];
111
131
  if (!user) {
112
132
  return null;
113
133
  }
@@ -126,4 +146,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
126
146
  }] });
127
147
 
128
148
  export { AXMListTaskBoardAssigneesQuery };
129
- //# sourceMappingURL=acorex-platform-module-task-management-client-list-task-board-assignees.query-CENurmLO.mjs.map
149
+ //# sourceMappingURL=acorex-platform-module-task-management-client-list-task-board-assignees.query-BcNFYozj.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-task-management-client-list-task-board-assignees.query-BcNFYozj.mjs","sources":["../../../../libs/modules/task-management/client/src/lib/features/queries/list-task-board-assignees.query.ts"],"sourcesContent":["import { RootConfig as SecurityManagementRootConfig } from '@acorex-platform/module-security-management-client/contracts';\nimport { AXPSessionService } from '@acorex-platform/framework-client/auth';\nimport { AXPSettingsService, isQuickSearchSettingEnabled } from '@acorex-platform/framework-client/common';\nimport { applyFilterArray } from '@acorex-platform/framework-client/core';\nimport {\n AXPEntityDefinitionRegistryService,\n AXPEntityService,\n} from '@acorex-platform/framework-client/layout/entity';\nimport {\n runtimeQueryFailure,\n runtimeQuerySuccessCollection,\n type AXPQueryRequest,\n} from '@acorex-platform/framework-shared/core';\nimport {\n type AXPCollectionQuery,\n type AXPCollectionQueryInput,\n type AXPQueryCollectionFetchResultPromise,\n} from '@acorex-platform/framework-shared/runtime';\nimport { AXDataSourceFilterOption } from '@acorex/cdk/common';\nimport { AXTranslationService } from '@acorex/core/translation';\n\nimport { Injectable, inject } from '@angular/core';\n\nimport {\n AXM_TASK_BOARD_UNASSIGNED_ASSIGNEE_ID,\n canViewAllTaskAssignees,\n isTaskBoardUnassignedAssigneeId,\n resolveTaskBoardCurrentUserAssigneeItem,\n} from '@acorex-platform/framework-client/layout/components';\nimport { AXPWorkBoardUserOption } from '@acorex-platform/framework-client/layout/components';\nimport {\n matchesLookupSearchText,\n readLookupSearchTerm,\n toEntityLookupSearchRequest,\n} from './task-board-lookup-search.util';\n\n//#region ---- Types ----\n\nexport type AXMListTaskBoardAssigneesQueryInput = AXPCollectionQueryInput;\n\nexport type AXMListTaskBoardAssigneesQueryItem = AXPWorkBoardUserOption;\n\n//#endregion\n\n//#region ---- Helpers ----\n\nfunction matchesFilter(item: object, filter?: AXDataSourceFilterOption): boolean {\n if (!filter || (!filter.field && !filter.filters?.length)) {\n return true;\n }\n return applyFilterArray([item], [filter], filter.logic ?? 'and').length > 0;\n}\n\nfunction extractEqualIdFilter(filter?: AXDataSourceFilterOption | null): string | null {\n if (!filter) {\n return null;\n }\n if (filter.field === 'id' && filter.operator?.type === 'equal' && filter.value != null && filter.value !== '') {\n return String(filter.value);\n }\n return null;\n}\n\n//#endregion\n\n//#region ---- Query ----\n\n/**\n * Session-aware task-board assignees — replaces the `task-board-assignees` DI data source.\n */\n@Injectable({ providedIn: 'root' })\nexport class AXMListTaskBoardAssigneesQuery\n implements\n AXPCollectionQuery<AXMListTaskBoardAssigneesQueryInput, AXMListTaskBoardAssigneesQueryItem>\n{\n //#region ---- Services & Dependencies ----\n\n private readonly entityService = inject(AXPEntityService);\n private readonly entityRegistry = inject(AXPEntityDefinitionRegistryService);\n private readonly settingsService = inject(AXPSettingsService);\n private readonly userService = this.entityService\n .withEntity(SecurityManagementRootConfig.module.name, SecurityManagementRootConfig.entities.users.name)\n .data<string, { id: string; displayName: string; username: string }>();\n private readonly sessionService = inject(AXPSessionService);\n private readonly translationService = inject(AXTranslationService);\n\n //#endregion\n\n //#region ---- Query Execution ----\n\n async fetch(\n input?: AXMListTaskBoardAssigneesQueryInput | null,\n ): AXPQueryCollectionFetchResultPromise<AXMListTaskBoardAssigneesQueryItem> {\n try {\n const request = (input ?? { skip: 0, take: 100 }) as AXPQueryRequest;\n const equalId = extractEqualIdFilter(request.filter ?? undefined);\n\n if (equalId != null) {\n const item = await this.resolveOne(equalId);\n return runtimeQuerySuccessCollection({\n items: item ? [item] : [],\n total: item ? 1 : 0,\n });\n }\n\n const page = await this.loadPage(request);\n return runtimeQuerySuccessCollection(page);\n } catch (error) {\n return runtimeQueryFailure(\n error instanceof Error ? error.message : 'Unknown error occurred',\n );\n }\n }\n\n //#endregion\n\n //#region ---- Private Methods ----\n\n private async loadPage(\n request: AXPQueryRequest,\n ): Promise<{ items: AXMListTaskBoardAssigneesQueryItem[]; total: number }> {\n const skip = request.skip ?? 0;\n const searchTerm = readLookupSearchTerm(request.filter, 'displayName');\n const selfItem = resolveTaskBoardCurrentUserAssigneeItem(this.sessionService);\n\n if (!canViewAllTaskAssignees(this.sessionService)) {\n const selfMatches = searchTerm\n ? matchesLookupSearchText(selfItem?.displayName, searchTerm) ||\n matchesLookupSearchText(selfItem?.username, searchTerm)\n : !!selfItem && matchesFilter(selfItem, request.filter);\n if (!selfItem || !selfMatches) {\n return { items: [], total: 0 };\n }\n return { items: skip === 0 ? [selfItem] : [], total: 1 };\n }\n\n const unassignedLabel = await this.translationService.translateAsync(\n '@task-management:task-board.filter.unassigned',\n );\n const unassignedItem: AXPWorkBoardUserOption = {\n id: AXM_TASK_BOARD_UNASSIGNED_ASSIGNEE_ID,\n displayName: unassignedLabel,\n username: '',\n };\n const includeUnassigned = searchTerm\n ? matchesLookupSearchText(unassignedLabel, searchTerm)\n : matchesFilter(unassignedItem, request.filter);\n\n const userRequest = await this.toUserLookupSearchRequest(request);\n const res = await this.userService.query({\n ...userRequest,\n fields: ['displayName', 'id', 'username'],\n });\n const userItems: AXPWorkBoardUserOption[] = res.items.map((item) => ({\n id: item.id,\n displayName: item.displayName,\n username: item.username,\n }));\n\n const items = skip === 0 && includeUnassigned ? [unassignedItem, ...userItems] : userItems;\n const total = res.total + (includeUnassigned ? 1 : 0);\n return { items, total };\n }\n\n private async toUserLookupSearchRequest(request: AXPQueryRequest): Promise<AXPQueryRequest> {\n const entity = await this.entityRegistry.resolve(\n SecurityManagementRootConfig.module.name,\n SecurityManagementRootConfig.entities.users.name,\n );\n return toEntityLookupSearchRequest(\n request,\n entity,\n 'displayName',\n isQuickSearchSettingEnabled(this.settingsService),\n );\n }\n\n private async resolveOne(userId: string): Promise<AXPWorkBoardUserOption | null> {\n const selfItem = resolveTaskBoardCurrentUserAssigneeItem(this.sessionService);\n if (selfItem != null && String(selfItem.id) === userId) {\n return selfItem;\n }\n\n if (isTaskBoardUnassignedAssigneeId(userId)) {\n if (!canViewAllTaskAssignees(this.sessionService)) {\n return null;\n }\n const displayName = await this.translationService.translateAsync(\n '@task-management:task-board.filter.unassigned',\n );\n return {\n id: AXM_TASK_BOARD_UNASSIGNED_ASSIGNEE_ID,\n displayName,\n username: '',\n };\n }\n\n if (!canViewAllTaskAssignees(this.sessionService)) {\n return null;\n }\n\n const page = await this.userService.query({ skip: 0, take: 1, fields: ['displayName', 'id', 'username'], filter: { logic: 'and', filters: [{ field: 'id', operator: { type: 'equal' }, value: userId }] } });\n const user = page.items[0];\n if (!user) {\n return null;\n }\n\n return {\n id: user.id,\n displayName: user.displayName,\n username: user.username,\n };\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":["SecurityManagementRootConfig"],"mappings":";;;;;;;;;;;;AA0CA;AAEA;AAEA,SAAS,aAAa,CAAC,IAAY,EAAE,MAAiC,EAAA;AACpE,IAAA,IAAI,CAAC,MAAM,KAAK,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE;AACzD,QAAA,OAAO,IAAI;IACb;IACA,OAAO,gBAAgB,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,KA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C;QAC5M,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QAC1B,IAAI,CAAC,IAAI,EAAE;AACT,YAAA,OAAO,IAAI;QACb;QAEA,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB;IACH;8GA7IW,8BAA8B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA9B,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,8BAA8B,cADjB,MAAM,EAAA,CAAA,CAAA;;2FACnB,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAD1C,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
@@ -1,8 +1,10 @@
1
1
  import { RootConfig } from '@acorex-platform/module-security-management-client/contracts';
2
- import { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';
2
+ import { AXPSettingsService, isQuickSearchSettingEnabled } from '@acorex-platform/framework-client/common';
3
+ import { AXPEntityService, AXPEntityDefinitionRegistryService } from '@acorex-platform/framework-client/layout/entity';
3
4
  import { runtimeQuerySuccessCollection, runtimeQueryFailure } from '@acorex-platform/framework-shared/core';
4
5
  import * as i0 from '@angular/core';
5
6
  import { inject, Injectable } from '@angular/core';
7
+ import { t as toEntityLookupSearchRequest } from './acorex-platform-module-task-management-client-task-board-lookup-search.util-il-mNHxd.mjs';
6
8
 
7
9
  //#endregion
8
10
  //#region ---- Helpers ----
@@ -24,6 +26,8 @@ class AXMListTaskBoardReportersQuery {
24
26
  constructor() {
25
27
  //#region ---- Services & Dependencies ----
26
28
  this.entityService = inject(AXPEntityService);
29
+ this.entityRegistry = inject(AXPEntityDefinitionRegistryService);
30
+ this.settingsService = inject(AXPSettingsService);
27
31
  this.userService = this.entityService
28
32
  .withEntity(RootConfig.module.name, RootConfig.entities.users.name)
29
33
  .data();
@@ -35,7 +39,8 @@ class AXMListTaskBoardReportersQuery {
35
39
  const request = (input ?? { skip: 0, take: 100 });
36
40
  const equalId = extractEqualIdFilter(request.filter ?? undefined);
37
41
  if (equalId != null) {
38
- const user = await this.userService.byKey(equalId);
42
+ const page = await this.userService.query({ skip: 0, take: 1, fields: ['displayName', 'id', 'username'], filter: { logic: 'and', filters: [{ field: 'id', operator: { type: 'equal' }, value: equalId }] } });
43
+ const user = page.items[0];
39
44
  if (!user) {
40
45
  return runtimeQuerySuccessCollection({ items: [], total: 0 });
41
46
  }
@@ -50,7 +55,12 @@ class AXMListTaskBoardReportersQuery {
50
55
  total: 1,
51
56
  });
52
57
  }
53
- const res = await this.userService.query(request);
58
+ const entity = await this.entityRegistry.resolve(RootConfig.module.name, RootConfig.entities.users.name);
59
+ const searched = toEntityLookupSearchRequest(request, entity, 'displayName', isQuickSearchSettingEnabled(this.settingsService));
60
+ const res = await this.userService.query({
61
+ ...searched,
62
+ fields: ['displayName', 'id', 'username'],
63
+ });
54
64
  return runtimeQuerySuccessCollection({
55
65
  items: res.items.map((item) => ({
56
66
  id: item.id,
@@ -73,4 +83,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
73
83
  }] });
74
84
 
75
85
  export { AXMListTaskBoardReportersQuery };
76
- //# sourceMappingURL=acorex-platform-module-task-management-client-list-task-board-reporters.query-C3NAYa9b.mjs.map
86
+ //# sourceMappingURL=acorex-platform-module-task-management-client-list-task-board-reporters.query-A0sbGwlB.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-task-management-client-list-task-board-reporters.query-A0sbGwlB.mjs","sources":["../../../../libs/modules/task-management/client/src/lib/features/queries/list-task-board-reporters.query.ts"],"sourcesContent":["import { RootConfig as SecurityManagementRootConfig } from '@acorex-platform/module-security-management-client/contracts';\nimport { AXPSettingsService, isQuickSearchSettingEnabled } from '@acorex-platform/framework-client/common';\nimport {\n AXPEntityDefinitionRegistryService,\n AXPEntityService,\n} from '@acorex-platform/framework-client/layout/entity';\nimport {\n runtimeQueryFailure,\n runtimeQuerySuccessCollection,\n type AXPQueryRequest,\n} from '@acorex-platform/framework-shared/core';\nimport {\n type AXPCollectionQuery,\n type AXPCollectionQueryInput,\n type AXPQueryCollectionFetchResultPromise,\n} from '@acorex-platform/framework-shared/runtime';\nimport { AXDataSourceFilterOption } from '@acorex/cdk/common';\n\nimport { Injectable, inject } from '@angular/core';\n\nimport { AXPWorkBoardUserOption } from '@acorex-platform/framework-client/layout/components';\nimport { toEntityLookupSearchRequest } from './task-board-lookup-search.util';\n\n//#region ---- Types ----\n\nexport type AXMListTaskBoardReportersQueryInput = AXPCollectionQueryInput;\n\nexport type AXMListTaskBoardReportersQueryItem = AXPWorkBoardUserOption;\n\n//#endregion\n\n//#region ---- Helpers ----\n\nfunction extractEqualIdFilter(filter?: AXDataSourceFilterOption | null): string | null {\n if (!filter) {\n return null;\n }\n if (filter.field === 'id' && filter.operator?.type === 'equal' && filter.value != null && filter.value !== '') {\n return String(filter.value);\n }\n return null;\n}\n\n//#endregion\n\n//#region ---- Query ----\n\n/**\n * Task-board reporters from SecurityManagement.User — replaces the `task-board-reporters` DI data source.\n */\n@Injectable({ providedIn: 'root' })\nexport class AXMListTaskBoardReportersQuery\n implements\n AXPCollectionQuery<AXMListTaskBoardReportersQueryInput, AXMListTaskBoardReportersQueryItem>\n{\n //#region ---- Services & Dependencies ----\n\n private readonly entityService = inject(AXPEntityService);\n private readonly entityRegistry = inject(AXPEntityDefinitionRegistryService);\n private readonly settingsService = inject(AXPSettingsService);\n private readonly userService = this.entityService\n .withEntity(SecurityManagementRootConfig.module.name, SecurityManagementRootConfig.entities.users.name)\n .data<string, { id: string; displayName: string; username: string }>();\n\n //#endregion\n\n //#region ---- Query Execution ----\n\n async fetch(\n input?: AXMListTaskBoardReportersQueryInput | null,\n ): AXPQueryCollectionFetchResultPromise<AXMListTaskBoardReportersQueryItem> {\n try {\n const request = (input ?? { skip: 0, take: 100 }) as AXPQueryRequest;\n const equalId = extractEqualIdFilter(request.filter ?? undefined);\n\n if (equalId != null) {\n const page = await this.userService.query({ skip: 0, take: 1, fields: ['displayName', 'id', 'username'], filter: { logic: 'and', filters: [{ field: 'id', operator: { type: 'equal' }, value: equalId }] } });\n const user = page.items[0];\n if (!user) {\n return runtimeQuerySuccessCollection({ items: [], total: 0 });\n }\n return runtimeQuerySuccessCollection({\n items: [\n {\n id: user.id,\n displayName: user.displayName,\n username: user.username,\n },\n ],\n total: 1,\n });\n }\n\n const entity = await this.entityRegistry.resolve(\n SecurityManagementRootConfig.module.name,\n SecurityManagementRootConfig.entities.users.name,\n );\n const searched = toEntityLookupSearchRequest(\n request,\n entity,\n 'displayName',\n isQuickSearchSettingEnabled(this.settingsService),\n );\n const res = await this.userService.query({\n ...searched,\n fields: ['displayName', 'id', 'username'],\n });\n return runtimeQuerySuccessCollection({\n items: res.items.map((item) => ({\n id: item.id,\n displayName: item.displayName,\n username: item.username,\n })),\n total: res.total,\n });\n } catch (error) {\n return runtimeQueryFailure(\n error instanceof Error ? error.message : 'Unknown error occurred',\n );\n }\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":["SecurityManagementRootConfig"],"mappings":";;;;;;;;AA6BA;AAEA;AAEA,SAAS,oBAAoB,CAAC,MAAwC,EAAA;IACpE,IAAI,CAAC,MAAM,EAAE;AACX,QAAA,OAAO,IAAI;IACb;IACA,IAAI,MAAM,CAAC,KAAK,KAAK,IAAI,IAAI,MAAM,CAAC,QAAQ,EAAE,IAAI,KAAK,OAAO,IAAI,MAAM,CAAC,KAAK,IAAI,IAAI,IAAI,MAAM,CAAC,KAAK,KAAK,EAAE,EAAE;AAC7G,QAAA,OAAO,MAAM,CAAC,MAAM,CAA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AC,OAAO,GAAG,wBAAwB,CAClE;QACH;IACF;8GArEW,8BAA8B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA9B,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,8BAA8B,cADjB,MAAM,EAAA,CAAA,CAAA;;2FACnB,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAD1C,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
@@ -1,9 +1,11 @@
1
1
  import { resolveCollectionSkip, resolveCollectionTake } from '@acorex-platform/framework-shared/runtime';
2
2
  import { runtimeQuerySuccessCollection, runtimeQueryFailure } from '@acorex-platform/framework-shared/core';
3
3
  import { applyFilterArray, applySortArray } from '@acorex-platform/framework-client/core';
4
+ import { AXTranslationService } from '@acorex/core/translation';
4
5
  import * as i0 from '@angular/core';
5
6
  import { inject, Injectable } from '@angular/core';
6
- import { a as AXPTaskBoardService } from './acorex-platform-module-task-management-client-acorex-platform-module-task-management-client-INIEvacu.mjs';
7
+ import { AXPWorkBoardService } from '@acorex-platform/framework-client/layout/components';
8
+ import { r as readLookupSearchTerm, m as matchesLookupSearchText } from './acorex-platform-module-task-management-client-task-board-lookup-search.util-il-mNHxd.mjs';
7
9
 
8
10
  //#endregion
9
11
  //#region ---- Query ----
@@ -13,19 +15,27 @@ import { a as AXPTaskBoardService } from './acorex-platform-module-task-manageme
13
15
  class AXMListTaskTypesQuery {
14
16
  constructor() {
15
17
  //#region ---- Services & Dependencies ----
16
- this.taskBoardService = inject(AXPTaskBoardService);
18
+ this.taskBoardService = inject(AXPWorkBoardService);
19
+ this.translationService = inject(AXTranslationService);
17
20
  }
18
21
  //#endregion
19
22
  //#region ---- Query Execution ----
20
23
  async fetch(input) {
21
24
  try {
22
- const providers = await this.taskBoardService.getTaskTypes();
23
- let items = await Promise.all(providers.map(async (provider) => ({
24
- name: provider.name,
25
- title: await provider.getTitle(),
26
- icon: await provider.getIcon(),
27
- })));
28
- if (input?.filter) {
25
+ await this.taskBoardService.getTaskTypes();
26
+ let items = this.taskBoardService.getTaskTypeOptions();
27
+ const searchTerm = readLookupSearchTerm(input?.filter, 'title');
28
+ if (searchTerm) {
29
+ const titled = await Promise.all(items.map(async (item) => ({
30
+ item,
31
+ title: await this.translationService.translateAsync(item.title),
32
+ })));
33
+ items = titled
34
+ .filter((row) => matchesLookupSearchText(row.title, searchTerm) ||
35
+ matchesLookupSearchText(row.item.name, searchTerm))
36
+ .map((row) => row.item);
37
+ }
38
+ else if (input?.filter) {
29
39
  items = applyFilterArray(items, [input.filter]);
30
40
  }
31
41
  const rawSort = Array.isArray(input?.sort) ? input.sort : input?.sort ? [input.sort] : [];
@@ -50,4 +60,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
50
60
  }] });
51
61
 
52
62
  export { AXMListTaskTypesQuery };
53
- //# sourceMappingURL=acorex-platform-module-task-management-client-list-task-types.query-DQ2MnsAK.mjs.map
63
+ //# sourceMappingURL=acorex-platform-module-task-management-client-list-task-types.query-CZHSliWt.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-task-management-client-list-task-types.query-CZHSliWt.mjs","sources":["../../../../libs/modules/task-management/client/src/lib/features/queries/list-task-types.query.ts"],"sourcesContent":["import {\n resolveCollectionSkip,\n resolveCollectionTake,\n type AXPCollectionQuery,\n type AXPCollectionQueryInput,\n type AXPQueryCollectionFetchResultPromise,\n} from '@acorex-platform/framework-shared/runtime';\nimport {\n runtimeQueryFailure,\n runtimeQuerySuccessCollection,\n} from '@acorex-platform/framework-shared/core';\nimport { applyFilterArray, applySortArray } from '@acorex-platform/framework-client/core';\nimport { AXTranslationService } from '@acorex/core/translation';\n\nimport { Injectable, inject } from '@angular/core';\n\nimport { AXPWorkBoardService } from '@acorex-platform/framework-client/layout/components';\nimport { matchesLookupSearchText, readLookupSearchTerm } from './task-board-lookup-search.util';\n\n//#region ---- Types ----\n\nexport type AXMListTaskTypesQueryInput = AXPCollectionQueryInput;\n\nexport interface AXMListTaskTypesQueryItem {\n /** Workflow task provider key. */\n name: string;\n /** Display title from the provider. */\n title: string;\n /** Optional icon class from the provider. */\n icon: string;\n}\n\n//#endregion\n\n//#region ---- Query ----\n\n/**\n * Resolved workflow task types — replaces the `task-types` DI data source.\n */\n@Injectable({ providedIn: 'root' })\nexport class AXMListTaskTypesQuery\n implements AXPCollectionQuery<AXMListTaskTypesQueryInput, AXMListTaskTypesQueryItem>\n{\n //#region ---- Services & Dependencies ----\n\n private readonly taskBoardService = inject(AXPWorkBoardService);\n private readonly translationService = inject(AXTranslationService);\n\n //#endregion\n\n //#region ---- Query Execution ----\n\n async fetch(\n input?: AXMListTaskTypesQueryInput | null,\n ): AXPQueryCollectionFetchResultPromise<AXMListTaskTypesQueryItem> {\n try {\n await this.taskBoardService.getTaskTypes();\n let items: AXMListTaskTypesQueryItem[] = this.taskBoardService.getTaskTypeOptions();\n\n const searchTerm = readLookupSearchTerm(input?.filter, 'title');\n if (searchTerm) {\n const titled = await Promise.all(\n items.map(async (item) => ({\n item,\n title: await this.translationService.translateAsync(item.title),\n })),\n );\n items = titled\n .filter(\n (row) =>\n matchesLookupSearchText(row.title, searchTerm) ||\n matchesLookupSearchText(row.item.name, searchTerm),\n )\n .map((row) => row.item);\n } else if (input?.filter) {\n items = applyFilterArray(items, [input.filter]);\n }\n\n const rawSort = Array.isArray(input?.sort) ? input.sort : input?.sort ? [input.sort] : [];\n const sortOpt = rawSort.length > 0 ? rawSort : [{ field: 'name' as const, dir: 'asc' as const }];\n items = applySortArray(items, sortOpt);\n\n const skip = resolveCollectionSkip(input?.skip);\n const take = resolveCollectionTake(input?.take);\n const total = items.length;\n const page = items.slice(skip, skip + take);\n\n return runtimeQuerySuccessCollection({ items: page, total });\n } catch (error) {\n return runtimeQueryFailure(\n error instanceof Error ? error.message : 'Unknown error occurred',\n );\n }\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;AAgCA;AAEA;AAEA;;AAEG;MAEU,qBAAqB,CAAA;AADlC,IAAA,WAAA,GAAA;;AAMmB,QAAA,IAAA,CAAA,gBAAgB,GAAG,MAAM,CAAC,mBAAmB,CAAC;AAC9C,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AAkDnE,IAAA;;;IA5CC,MAAM,KAAK,CACT,KAAyC,EAAA;AAEzC,QAAA,IAAI;AACF,YAAA,MAAM,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE;YAC1C,IAAI,KAAK,GAAgC,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,EAAE;YAEnF,MAAM,UAAU,GAAG,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC;YAC/D,IAAI,UAAU,EAAE;AACd,gBAAA,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,GAAG,CAC9B,KAAK,CAAC,GAAG,CAAC,OAAO,IAAI,MAAM;oBACzB,IAAI;oBACJ,KAAK,EAAE,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC;iBAChE,CAAC,CAAC,CACJ;AACD,gBAAA,KAAK,GAAG;AACL,qBAAA,MAAM,CACL,CAAC,GAAG,KACF,uBAAuB,CAAC,GAAG,CAAC,KAAK,EAAE,UAAU,CAAC;oBAC9C,uBAAuB,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC;qBAErD,GAAG,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,IAAI,CAAC;YAC3B;AAAO,iBAAA,IAAI,KAAK,EAAE,MAAM,EAAE;gBACxB,KAAK,GAAG,gBAAgB,CAAC,KAAK,EAAE,C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A;kBADjC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
@@ -0,0 +1,29 @@
1
+ import * as i0 from '@angular/core';
2
+ import { inject, Injectable } from '@angular/core';
3
+ import { i as AXMTaskWorkspaceService } from './acorex-platform-module-task-management-client-acorex-platform-module-task-management-client-dfiarGtJ.mjs';
4
+
5
+ //#endregion
6
+ //#region ----- Open task workspace -----
7
+ class OpenTaskWorkspaceCommand {
8
+ constructor() {
9
+ //#region ----- Services & Dependencies -----
10
+ this.workspace = inject(AXMTaskWorkspaceService);
11
+ }
12
+ //#endregion
13
+ //#region ----- Command Implementation -----
14
+ async execute(input = {}) {
15
+ const result = await this.workspace.open(input);
16
+ if (result.errorKey)
17
+ return { success: false, message: { text: result.errorKey } };
18
+ return { success: true, kind: 'object', data: result };
19
+ }
20
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: OpenTaskWorkspaceCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
21
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: OpenTaskWorkspaceCommand, providedIn: 'root' }); }
22
+ }
23
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: OpenTaskWorkspaceCommand, decorators: [{
24
+ type: Injectable,
25
+ args: [{ providedIn: 'root' }]
26
+ }] });
27
+
28
+ export { OpenTaskWorkspaceCommand };
29
+ //# sourceMappingURL=acorex-platform-module-task-management-client-open-task-workspace.command-1BlMwoWF.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-task-management-client-open-task-workspace.command-1BlMwoWF.mjs","sources":["../../../../libs/modules/task-management/client/src/lib/features/task-workspace/open-task-workspace.command.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { Injectable, inject } from '@angular/core';\n\nimport { AXMTaskWorkspaceService } from './task-workspace.service';\nimport type { AXPTaskWorkspaceRequest } from './task-workspace.types';\n\n//#endregion\n\n//#region ----- Open task workspace -----\n\n@Injectable({ providedIn: 'root' })\nexport class OpenTaskWorkspaceCommand implements AXPCommand<AXPTaskWorkspaceRequest> {\n //#region ----- Services & Dependencies -----\n\n private readonly workspace = inject(AXMTaskWorkspaceService);\n\n //#endregion\n\n //#region ----- Command Implementation -----\n\n async execute(input: AXPTaskWorkspaceRequest = {}): AXPCommandExecuteResultPromise {\n const result = await this.workspace.open(input);\n if (result.errorKey) return { success: false, message: { text: result.errorKey } };\n return { success: true, kind: 'object', data: result };\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;AAQA;AAEA;MAGa,wBAAwB,CAAA;AADrC,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,uBAAuB,CAAC;AAa7D,IAAA;;;AAPC,IAAA,MAAM,OAAO,CAAC,KAAA,GAAiC,EAAE,EAAA;QAC/C,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC;QAC/C,IAAI,MAAM,CAAC,QAAQ;AAAE,YAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,QAAQ,EAAE,EAAE;AAClF,QAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE;IACxD;8GAbW,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAxB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,wBAAwB,cADX,MAAM,EAAA,CAAA,CAAA;;2FACnB,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBADpC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}