@acorex-platform/module-task-management-client 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/acorex-platform-module-task-management-client-acorex-platform-module-task-management-client-CIwafWli.mjs +4445 -0
- package/fesm2022/acorex-platform-module-task-management-client-acorex-platform-module-task-management-client-CIwafWli.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-task-management-client-contracts.mjs +183 -0
- package/fesm2022/acorex-platform-module-task-management-client-contracts.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-task-management-client-list-task-board-assignees.query-Ci8_D4Vs.mjs +129 -0
- package/fesm2022/acorex-platform-module-task-management-client-list-task-board-assignees.query-Ci8_D4Vs.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-task-management-client-list-task-board-reporters.query-C3NAYa9b.mjs +76 -0
- package/fesm2022/acorex-platform-module-task-management-client-list-task-board-reporters.query-C3NAYa9b.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-task-management-client-list-task-types.query-CKLUPrBU.mjs +53 -0
- package/fesm2022/acorex-platform-module-task-management-client-list-task-types.query-CKLUPrBU.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-task-management-client-start-task-flow.command-ChCuTFV-.mjs +114 -0
- package/fesm2022/acorex-platform-module-task-management-client-start-task-flow.command-ChCuTFV-.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-task-management-client-task-board.page-8I8H2pFq.mjs +2743 -0
- package/fesm2022/acorex-platform-module-task-management-client-task-board.page-8I8H2pFq.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-task-management-client.mjs +2 -0
- package/fesm2022/acorex-platform-module-task-management-client.mjs.map +1 -0
- package/package.json +28 -0
- package/types/acorex-platform-module-task-management-client-contracts.d.ts +318 -0
- package/types/acorex-platform-module-task-management-client.d.ts +850 -0
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/** Catalog scope for task-management–scoped workflow definitions and related catalogs. */
|
|
2
|
+
const TASK_MANAGEMENT_CATALOG_SCOPE_TASKS = 'task-management.tasks';
|
|
3
|
+
|
|
4
|
+
const AXPTaskManagementCommandKeys = {
|
|
5
|
+
Task: {
|
|
6
|
+
StartFlow: 'TaskManagement.Task:StartFlow',
|
|
7
|
+
},
|
|
8
|
+
TaskBoard: {
|
|
9
|
+
ResetFiltersAssignToCurrentUser: 'TaskManagement.TaskBoard:ResetFiltersAssignToCurrentUser',
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
//#region ---- Query keys ----
|
|
14
|
+
/** Task Management platform query registry keys. */
|
|
15
|
+
const AXMTaskManagementQueryKeys = {
|
|
16
|
+
ListTaskTypes: 'TaskManagement:ListTaskTypes',
|
|
17
|
+
TaskBoardAssignees: 'TaskManagement:TaskBoard:Assignees',
|
|
18
|
+
TaskBoardReporters: 'TaskManagement:TaskBoard:Reporters',
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
|
|
22
|
+
const AXPTaskManagementMenuKeys = {
|
|
23
|
+
Root: 'task-management:menu',
|
|
24
|
+
TaskBoard: 'task-management:board',
|
|
25
|
+
Tasks: 'task-management:menu:tasks',
|
|
26
|
+
TaskTemplates: 'task-management:menu:task-templates',
|
|
27
|
+
TaskTypes: 'task-management:menu:task-types',
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Projects & Work capabilities used by this module.
|
|
32
|
+
* Domain capability keys for this module. Root groups live in `AXPCommonPermissionGroupKeys` (common contracts).
|
|
33
|
+
*/
|
|
34
|
+
const AXPProjectsWorkPermissionKeys = {
|
|
35
|
+
Access: 'ProjectsWork:Permission:Access',
|
|
36
|
+
MaintainProjects: 'ProjectsWork:Permission:MaintainProjects',
|
|
37
|
+
MaintainTasks: 'ProjectsWork:Permission:MaintainTasks',
|
|
38
|
+
ViewAllTasks: 'ProjectsWork:Permission:ViewAllTasks',
|
|
39
|
+
MaintainTimesheets: 'ProjectsWork:Permission:MaintainTimesheets',
|
|
40
|
+
ManageTimesheetActions: 'ProjectsWork:Permission:ManageTimesheetActions',
|
|
41
|
+
ViewTimesheetReports: 'ProjectsWork:Permission:ViewTimesheetReports',
|
|
42
|
+
Setup: 'ProjectsWork:Permission:Setup',
|
|
43
|
+
};
|
|
44
|
+
/** @deprecated Prefer {@link AXPProjectsWorkPermissionKeys}. */
|
|
45
|
+
const AXMPermissionsKeys = {
|
|
46
|
+
TaskManagement: {
|
|
47
|
+
Management: AXPProjectsWorkPermissionKeys.Access,
|
|
48
|
+
Task: {
|
|
49
|
+
Management: AXPProjectsWorkPermissionKeys.MaintainTasks,
|
|
50
|
+
ViewAll: AXPProjectsWorkPermissionKeys.ViewAllTasks,
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
var AXMTaskBoardSettings;
|
|
56
|
+
(function (AXMTaskBoardSettings) {
|
|
57
|
+
/** User preference: show Calendar in the task board view switcher. */
|
|
58
|
+
AXMTaskBoardSettings["VisibleCalendar"] = "TaskManagement:Setting:TaskBoard.Visible.Calendar";
|
|
59
|
+
/** User preference: show Timeline in the task board view switcher. */
|
|
60
|
+
AXMTaskBoardSettings["VisibleTimeline"] = "TaskManagement:Setting:TaskBoard.Visible.Timeline";
|
|
61
|
+
/** User preference: show Table in the task board view switcher. */
|
|
62
|
+
AXMTaskBoardSettings["VisibleTable"] = "TaskManagement:Setting:TaskBoard.Visible.Table";
|
|
63
|
+
/** User preference: show Kanban in the task board view switcher. */
|
|
64
|
+
AXMTaskBoardSettings["VisibleKanban"] = "TaskManagement:Setting:TaskBoard.Visible.Kanban";
|
|
65
|
+
AXMTaskBoardSettings["CalendarLayout"] = "taskboard.view.calendarLayout";
|
|
66
|
+
AXMTaskBoardSettings["TimelineLayout"] = "taskboard.view.timelineLayout";
|
|
67
|
+
AXMTaskBoardSettings["TableLayout"] = "taskboard.view.tableLayout";
|
|
68
|
+
AXMTaskBoardSettings["ViewMode"] = "taskboard.viewMode";
|
|
69
|
+
AXMTaskBoardSettings["DetailPanel"] = "taskboard.DetailPanel";
|
|
70
|
+
AXMTaskBoardSettings["DaysCount"] = "taskboard.calendar.daysCount";
|
|
71
|
+
AXMTaskBoardSettings["CurrentDate"] = "taskboard.calendar.currentDate";
|
|
72
|
+
AXMTaskBoardSettings["SelectedPriorities"] = "taskboard.filter.selectedPriorities";
|
|
73
|
+
AXMTaskBoardSettings["SelectedDueStatusKeys"] = "taskboard.filter.selectedDueStatusKeys";
|
|
74
|
+
AXMTaskBoardSettings["ColorBy"] = "taskboard.colorBy";
|
|
75
|
+
AXMTaskBoardSettings["SelectedAssigneeIds"] = "taskboard.filter.selectedAssigneeIds";
|
|
76
|
+
AXMTaskBoardSettings["SelectedReporterIds"] = "taskboard.filter.selectedReporterIds";
|
|
77
|
+
AXMTaskBoardSettings["SelectedTaskTypeNames"] = "taskboard.filter.selectedTaskTypeNames";
|
|
78
|
+
})(AXMTaskBoardSettings || (AXMTaskBoardSettings = {}));
|
|
79
|
+
|
|
80
|
+
/** Canonical {@link AXPEntityReference.type} values for common task subjects. */
|
|
81
|
+
const AXPTaskManagementSubjectTypes = {
|
|
82
|
+
Project: 'ProjectManagement.Project',
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const config = {
|
|
86
|
+
i18n: 'task-management',
|
|
87
|
+
module: 'TaskManagement',
|
|
88
|
+
};
|
|
89
|
+
/** Dashboard widget type ids for task-management-hosted widgets (`{module}:Widget:Dashboard:{Segment}`). */
|
|
90
|
+
const dashboardWidgetId = (segment) => `${config.module}:Widget:Dashboard:${segment}`;
|
|
91
|
+
const RootConfig = {
|
|
92
|
+
config,
|
|
93
|
+
module: {
|
|
94
|
+
name: config.module,
|
|
95
|
+
title: `@${config.i18n}:module.title`,
|
|
96
|
+
icon: 'fa-light fa-tasks',
|
|
97
|
+
},
|
|
98
|
+
entities: {
|
|
99
|
+
taskType: {
|
|
100
|
+
name: 'TaskType',
|
|
101
|
+
title: `@${config.i18n}:task-type.individual-title`,
|
|
102
|
+
titlePlural: `@${config.i18n}:task-type.plural-title`,
|
|
103
|
+
icon: 'fa-light fa-cog',
|
|
104
|
+
},
|
|
105
|
+
taskTypeCategory: {
|
|
106
|
+
name: 'TaskTypeCategory',
|
|
107
|
+
title: `@${config.i18n}:task-type-categories.title`,
|
|
108
|
+
titlePlural: `@${config.i18n}:task-type-categories.plural`,
|
|
109
|
+
icon: 'fa-light fa-layer-group',
|
|
110
|
+
},
|
|
111
|
+
taskStatus: {
|
|
112
|
+
name: 'TaskStatus',
|
|
113
|
+
title: `@${config.i18n}:task-status.individual-title`,
|
|
114
|
+
titlePlural: `@${config.i18n}:task-status.plural-title`,
|
|
115
|
+
icon: 'fa-light fa-flag',
|
|
116
|
+
},
|
|
117
|
+
task: {
|
|
118
|
+
name: 'Task',
|
|
119
|
+
title: `@${config.i18n}:task.individual-title`,
|
|
120
|
+
titlePlural: `@${config.i18n}:task.plural-title`,
|
|
121
|
+
icon: 'fa-light fa-clipboard-check',
|
|
122
|
+
},
|
|
123
|
+
taskChecklistItem: {
|
|
124
|
+
name: 'TaskChecklistItem',
|
|
125
|
+
title: `@${config.i18n}:checklist-item.individual-title`,
|
|
126
|
+
titlePlural: `@${config.i18n}:checklist-item.plural-title`,
|
|
127
|
+
icon: 'fa-light fa-list-check',
|
|
128
|
+
},
|
|
129
|
+
taskAssignment: {
|
|
130
|
+
name: 'TaskAssignment',
|
|
131
|
+
title: `@${config.i18n}:task-assignment.individual-title`,
|
|
132
|
+
titlePlural: `@${config.i18n}:task-assignment.plural-title`,
|
|
133
|
+
icon: 'fa-light fa-user-check',
|
|
134
|
+
},
|
|
135
|
+
timeLog: {
|
|
136
|
+
name: 'TimeLog',
|
|
137
|
+
title: `@${config.i18n}:time-log.individual-title`,
|
|
138
|
+
titlePlural: `@${config.i18n}:time-log.plural-title`,
|
|
139
|
+
icon: 'fa-light fa-clock',
|
|
140
|
+
},
|
|
141
|
+
taskDependency: {
|
|
142
|
+
name: 'TaskDependency',
|
|
143
|
+
title: `@${config.i18n}:task-dependency.individual-title`,
|
|
144
|
+
titlePlural: `@${config.i18n}:task-dependency.plural-title`,
|
|
145
|
+
icon: 'fa-light fa-link',
|
|
146
|
+
},
|
|
147
|
+
taskContext: {
|
|
148
|
+
name: 'TaskContext',
|
|
149
|
+
title: `@${config.i18n}:task-context.individual-title`,
|
|
150
|
+
titlePlural: `@${config.i18n}:task-context.plural-title`,
|
|
151
|
+
icon: 'fa-light fa-sitemap',
|
|
152
|
+
},
|
|
153
|
+
taskTemplate: {
|
|
154
|
+
name: 'TaskTemplate',
|
|
155
|
+
title: `@${config.i18n}:task-template.individual-title`,
|
|
156
|
+
titlePlural: `@${config.i18n}:task-template.plural-title`,
|
|
157
|
+
icon: 'fa-light fa-copy',
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
widgets: {
|
|
161
|
+
taskBoard: dashboardWidgetId('TaskBoard'),
|
|
162
|
+
taskBoardShortcut: dashboardWidgetId('TaskBoardShortcut'),
|
|
163
|
+
},
|
|
164
|
+
queries: {
|
|
165
|
+
dashboard: {
|
|
166
|
+
openTasksKpi: `${config.module}:Dashboard:OpenTasksKpi`,
|
|
167
|
+
overdueTasksKpi: `${config.module}:Dashboard:OverdueTasksKpi`,
|
|
168
|
+
myOpenTasksKpi: `${config.module}:Dashboard:MyOpenTasksKpi`,
|
|
169
|
+
taskStatusDonut: `${config.module}:Dashboard:TaskStatusDonut`,
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
//#endregion
|
|
175
|
+
|
|
176
|
+
//#region ---- Contracts barrel ----
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Generated bundle index. Do not edit.
|
|
180
|
+
*/
|
|
181
|
+
|
|
182
|
+
export { AXMPermissionsKeys, AXMTaskBoardSettings, AXMTaskManagementQueryKeys, AXPProjectsWorkPermissionKeys, AXPTaskManagementCommandKeys, AXPTaskManagementMenuKeys, AXPTaskManagementSubjectTypes, RootConfig, TASK_MANAGEMENT_CATALOG_SCOPE_TASKS };
|
|
183
|
+
//# sourceMappingURL=acorex-platform-module-task-management-client-contracts.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-task-management-client-contracts.mjs","sources":["../../../../libs/modules/task-management/contracts/src/catalog-scope.keys.ts","../../../../libs/modules/task-management/contracts/src/commands.keys.ts","../../../../libs/modules/task-management/contracts/src/query.keys.ts","../../../../libs/modules/task-management/contracts/src/menu.keys.ts","../../../../libs/modules/task-management/contracts/src/permission.keys.ts","../../../../libs/modules/task-management/contracts/src/settings.keys.ts","../../../../libs/modules/task-management/contracts/src/subject-type.keys.ts","../../../../libs/modules/task-management/contracts/src/root-config.ts","../../../../libs/modules/task-management/contracts/src/entities/task-type/task-type.types.ts","../../../../libs/modules/task-management/contracts/src/index.ts","../../../../libs/modules/task-management/contracts/src/acorex-platform-module-task-management-client-contracts.ts"],"sourcesContent":["/** Catalog scope for task-management–scoped workflow definitions and related catalogs. */\nexport const TASK_MANAGEMENT_CATALOG_SCOPE_TASKS = 'task-management.tasks';\n","export const AXPTaskManagementCommandKeys = {\n Task: {\n StartFlow: 'TaskManagement.Task:StartFlow',\n },\n TaskBoard: {\n ResetFiltersAssignToCurrentUser: 'TaskManagement.TaskBoard:ResetFiltersAssignToCurrentUser',\n },\n} as const;\n","//#region ---- Query keys ----\n\n/** Task Management platform query registry keys. */\nexport const AXMTaskManagementQueryKeys = {\n ListTaskTypes: 'TaskManagement:ListTaskTypes',\n TaskBoardAssignees: 'TaskManagement:TaskBoard:Assignees',\n TaskBoardReporters: 'TaskManagement:TaskBoard:Reporters',\n} as const;\n\n//#endregion\n","export const AXPTaskManagementMenuKeys = {\n Root: 'task-management:menu',\n TaskBoard: 'task-management:board',\n Tasks: 'task-management:menu:tasks',\n TaskTemplates: 'task-management:menu:task-templates',\n TaskTypes: 'task-management:menu:task-types',\n} as const;\n\n","/**\n * Projects & Work capabilities used by this module.\n * Domain capability keys for this module. Root groups live in `AXPCommonPermissionGroupKeys` (common contracts).\n */\nexport const AXPProjectsWorkPermissionKeys = {\n Access: 'ProjectsWork:Permission:Access',\n MaintainProjects: 'ProjectsWork:Permission:MaintainProjects',\n MaintainTasks: 'ProjectsWork:Permission:MaintainTasks',\n ViewAllTasks: 'ProjectsWork:Permission:ViewAllTasks',\n MaintainTimesheets: 'ProjectsWork:Permission:MaintainTimesheets',\n ManageTimesheetActions: 'ProjectsWork:Permission:ManageTimesheetActions',\n ViewTimesheetReports: 'ProjectsWork:Permission:ViewTimesheetReports',\n Setup: 'ProjectsWork:Permission:Setup',\n} as const;\n\n/** @deprecated Prefer {@link AXPProjectsWorkPermissionKeys}. */\nexport const AXMPermissionsKeys = {\n TaskManagement: {\n Management: AXPProjectsWorkPermissionKeys.Access,\n Task: {\n Management: AXPProjectsWorkPermissionKeys.MaintainTasks,\n ViewAll: AXPProjectsWorkPermissionKeys.ViewAllTasks,\n },\n },\n} as const;\n","export enum AXMTaskBoardSettings {\n /** User preference: show Calendar in the task board view switcher. */\n VisibleCalendar = 'TaskManagement:Setting:TaskBoard.Visible.Calendar',\n /** User preference: show Timeline in the task board view switcher. */\n VisibleTimeline = 'TaskManagement:Setting:TaskBoard.Visible.Timeline',\n /** User preference: show Table in the task board view switcher. */\n VisibleTable = 'TaskManagement:Setting:TaskBoard.Visible.Table',\n /** User preference: show Kanban in the task board view switcher. */\n VisibleKanban = 'TaskManagement:Setting:TaskBoard.Visible.Kanban',\n CalendarLayout = 'taskboard.view.calendarLayout',\n TimelineLayout = 'taskboard.view.timelineLayout',\n TableLayout = 'taskboard.view.tableLayout',\n ViewMode = 'taskboard.viewMode',\n DetailPanel = 'taskboard.DetailPanel',\n DaysCount = 'taskboard.calendar.daysCount',\n CurrentDate = 'taskboard.calendar.currentDate',\n SelectedPriorities = 'taskboard.filter.selectedPriorities',\n SelectedDueStatusKeys = 'taskboard.filter.selectedDueStatusKeys',\n ColorBy = 'taskboard.colorBy',\n SelectedAssigneeIds = 'taskboard.filter.selectedAssigneeIds',\n SelectedReporterIds = 'taskboard.filter.selectedReporterIds',\n SelectedTaskTypeNames = 'taskboard.filter.selectedTaskTypeNames',\n}\n","/** Canonical {@link AXPEntityReference.type} values for common task subjects. */\nexport const AXPTaskManagementSubjectTypes = {\n Project: 'ProjectManagement.Project',\n} as const;\n","const config = {\n i18n: 'task-management',\n module: 'TaskManagement',\n} as const;\n\n/** Dashboard widget type ids for task-management-hosted widgets (`{module}:Widget:Dashboard:{Segment}`). */\nconst dashboardWidgetId = (segment: string): string =>\n `${config.module}:Widget:Dashboard:${segment}`;\n\nexport const RootConfig = {\n config,\n module: {\n name: config.module,\n title: `@${config.i18n}:module.title`,\n icon: 'fa-light fa-tasks',\n },\n entities: {\n taskType: {\n name: 'TaskType',\n title: `@${config.i18n}:task-type.individual-title`,\n titlePlural: `@${config.i18n}:task-type.plural-title`,\n icon: 'fa-light fa-cog',\n },\n taskTypeCategory: {\n name: 'TaskTypeCategory',\n title: `@${config.i18n}:task-type-categories.title`,\n titlePlural: `@${config.i18n}:task-type-categories.plural`,\n icon: 'fa-light fa-layer-group',\n },\n taskStatus: {\n name: 'TaskStatus',\n title: `@${config.i18n}:task-status.individual-title`,\n titlePlural: `@${config.i18n}:task-status.plural-title`,\n icon: 'fa-light fa-flag',\n },\n task: {\n name: 'Task',\n title: `@${config.i18n}:task.individual-title`,\n titlePlural: `@${config.i18n}:task.plural-title`,\n icon: 'fa-light fa-clipboard-check',\n },\n taskChecklistItem: {\n name: 'TaskChecklistItem',\n title: `@${config.i18n}:checklist-item.individual-title`,\n titlePlural: `@${config.i18n}:checklist-item.plural-title`,\n icon: 'fa-light fa-list-check',\n },\n taskAssignment: {\n name: 'TaskAssignment',\n title: `@${config.i18n}:task-assignment.individual-title`,\n titlePlural: `@${config.i18n}:task-assignment.plural-title`,\n icon: 'fa-light fa-user-check',\n },\n timeLog: {\n name: 'TimeLog',\n title: `@${config.i18n}:time-log.individual-title`,\n titlePlural: `@${config.i18n}:time-log.plural-title`,\n icon: 'fa-light fa-clock',\n },\n taskDependency: {\n name: 'TaskDependency',\n title: `@${config.i18n}:task-dependency.individual-title`,\n titlePlural: `@${config.i18n}:task-dependency.plural-title`,\n icon: 'fa-light fa-link',\n },\n taskContext: {\n name: 'TaskContext',\n title: `@${config.i18n}:task-context.individual-title`,\n titlePlural: `@${config.i18n}:task-context.plural-title`,\n icon: 'fa-light fa-sitemap',\n },\n taskTemplate: {\n name: 'TaskTemplate',\n title: `@${config.i18n}:task-template.individual-title`,\n titlePlural: `@${config.i18n}:task-template.plural-title`,\n icon: 'fa-light fa-copy',\n },\n },\n widgets: {\n taskBoard: dashboardWidgetId('TaskBoard'),\n taskBoardShortcut: dashboardWidgetId('TaskBoardShortcut'),\n },\n queries: {\n dashboard: {\n openTasksKpi: `${config.module}:Dashboard:OpenTasksKpi`,\n overdueTasksKpi: `${config.module}:Dashboard:OverdueTasksKpi`,\n myOpenTasksKpi: `${config.module}:Dashboard:MyOpenTasksKpi`,\n taskStatusDonut: `${config.module}:Dashboard:TaskStatusDonut`,\n },\n },\n} as const;\n","import type { AXMMetaDataBuilderValue } from '@acorex-platform/module-data-management-contracts';\nimport type { AXPCategoryListItem } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityModel } from '@acorex-platform/framework-shared/entity';\n\n//#region ---- Task type workflow config ----\n\n/** Workflow template binding and admin-configured default inputs for task types. */\nexport interface AXMTaskManagementTaskTypeWorkflowConfig {\n workflowDefinitionId: string;\n workflowName: string;\n defaultInput?: Record<string, unknown>;\n}\n\n//#endregion\n\n//#region ---- Task type model ----\n\nexport interface AXMTaskManagementTaskTypeEntityModel extends AXPEntityModel<string> {\n title: string;\n description?: string;\n icon?: string;\n color?: string;\n isActive: boolean;\n workflowConfig?: AXMTaskManagementTaskTypeWorkflowConfig | null;\n metaDataList?: AXMMetaDataBuilderValue;\n categoryIds?: string[];\n categories?: AXPCategoryListItem[];\n hasChecklist: boolean;\n hasTimeTracking: boolean;\n hasAttachments: boolean;\n hasDependencies: boolean;\n hasSubtasks: boolean;\n documentTypeIds?: string[];\n documentTypes?: Array<{ id: string; name?: string; title?: string }>;\n}\n\n//#endregion\n","//#region ---- Contracts barrel ----\n\nexport * from './catalog-scope.keys';\nexport * from './commands.keys';\nexport * from './query.keys';\nexport * from './menu.keys';\nexport * from './permission.keys';\nexport * from './settings.keys';\nexport * from './subject-type.keys';\n\nexport * from './root-config';\n\n//#endregion\n\nexport * from './entities';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAAA;AACO,MAAM,mCAAmC,GAAG;;ACD5C,MAAM,4BAA4B,GAAG;AAC1C,IAAA,IAAI,EAAE;AACJ,QAAA,SAAS,EAAE,+BAA+B;AAC3C,KAAA;AACD,IAAA,SAAS,EAAE;AACT,QAAA,+BAA+B,EAAE,0DAA0D;AAC5F,KAAA;;;ACNH;AAEA;AACO,MAAM,0BAA0B,GAAG;AACxC,IAAA,aAAa,EAAE,8BAA8B;AAC7C,IAAA,kBAAkB,EAAE,oCAAoC;AACxD,IAAA,kBAAkB,EAAE,oCAAoC;;AAG1D;;ACTO,MAAM,yBAAyB,GAAG;AACrC,IAAA,IAAI,EAAE,sBAAsB;AAC5B,IAAA,SAAS,EAAE,uBAAuB;AAClC,IAAA,KAAK,EAAE,4BAA4B;AACnC,IAAA,aAAa,EAAE,qCAAqC;AACpD,IAAA,SAAS,EAAE,iCAAiC;;;ACLhD;;;AAGG;AACI,MAAM,6BAA6B,GAAG;AAC3C,IAAA,MAAM,EAAE,gCAAgC;AACxC,IAAA,gBAAgB,EAAE,0CAA0C;AAC5D,IAAA,aAAa,EAAE,uCAAuC;AACtD,IAAA,YAAY,EAAE,sCAAsC;AACpD,IAAA,kBAAkB,EAAE,4CAA4C;AAChE,IAAA,sBAAsB,EAAE,gDAAgD;AACxE,IAAA,oBAAoB,EAAE,8CAA8C;AACpE,IAAA,KAAK,EAAE,+BA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|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { RootConfig } from '@acorex-platform/module-security-management-client/contracts';
|
|
2
|
+
import { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';
|
|
3
|
+
import { AXPSessionService } from '@acorex-platform/framework-client/auth';
|
|
4
|
+
import { applyFilterArray } from '@acorex-platform/framework-client/core';
|
|
5
|
+
import { runtimeQuerySuccessCollection, runtimeQueryFailure } from '@acorex-platform/framework-shared/core';
|
|
6
|
+
import { AXTranslationService } from '@acorex/core/translation';
|
|
7
|
+
import * as i0 from '@angular/core';
|
|
8
|
+
import { inject, Injectable } from '@angular/core';
|
|
9
|
+
import { o as resolveTaskBoardCurrentUserAssigneeItem, e as canViewAllTaskAssignees, p as AXM_TASK_BOARD_UNASSIGNED_ASSIGNEE_ID, q as isTaskBoardUnassignedAssigneeId } from './acorex-platform-module-task-management-client-acorex-platform-module-task-management-client-CIwafWli.mjs';
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region ---- Helpers ----
|
|
13
|
+
function matchesFilter(item, filter) {
|
|
14
|
+
if (!filter || (!filter.field && !filter.filters?.length)) {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
return applyFilterArray([item], [filter], filter.logic ?? 'and').length > 0;
|
|
18
|
+
}
|
|
19
|
+
function extractEqualIdFilter(filter) {
|
|
20
|
+
if (!filter) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
if (filter.field === 'id' && filter.operator?.type === 'equal' && filter.value != null && filter.value !== '') {
|
|
24
|
+
return String(filter.value);
|
|
25
|
+
}
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region ---- Query ----
|
|
30
|
+
/**
|
|
31
|
+
* Session-aware task-board assignees — replaces the `task-board-assignees` DI data source.
|
|
32
|
+
*/
|
|
33
|
+
class AXMListTaskBoardAssigneesQuery {
|
|
34
|
+
constructor() {
|
|
35
|
+
//#region ---- Services & Dependencies ----
|
|
36
|
+
this.entityService = inject(AXPEntityService);
|
|
37
|
+
this.userService = this.entityService
|
|
38
|
+
.withEntity(RootConfig.module.name, RootConfig.entities.users.name)
|
|
39
|
+
.data();
|
|
40
|
+
this.sessionService = inject(AXPSessionService);
|
|
41
|
+
this.translationService = inject(AXTranslationService);
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region ---- Query Execution ----
|
|
45
|
+
async fetch(input) {
|
|
46
|
+
try {
|
|
47
|
+
const request = (input ?? { skip: 0, take: 100 });
|
|
48
|
+
const equalId = extractEqualIdFilter(request.filter ?? undefined);
|
|
49
|
+
if (equalId != null) {
|
|
50
|
+
const item = await this.resolveOne(equalId);
|
|
51
|
+
return runtimeQuerySuccessCollection({
|
|
52
|
+
items: item ? [item] : [],
|
|
53
|
+
total: item ? 1 : 0,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
const page = await this.loadPage(request);
|
|
57
|
+
return runtimeQuerySuccessCollection(page);
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
return runtimeQueryFailure(error instanceof Error ? error.message : 'Unknown error occurred');
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
//#endregion
|
|
64
|
+
//#region ---- Private Methods ----
|
|
65
|
+
async loadPage(request) {
|
|
66
|
+
const skip = request.skip ?? 0;
|
|
67
|
+
const selfItem = resolveTaskBoardCurrentUserAssigneeItem(this.sessionService);
|
|
68
|
+
if (!canViewAllTaskAssignees(this.sessionService)) {
|
|
69
|
+
if (!selfItem || !matchesFilter(selfItem, request.filter)) {
|
|
70
|
+
return { items: [], total: 0 };
|
|
71
|
+
}
|
|
72
|
+
return { items: skip === 0 ? [selfItem] : [], total: 1 };
|
|
73
|
+
}
|
|
74
|
+
const unassignedLabel = await this.translationService.translateAsync('@task-management:task-board.filter.unassigned');
|
|
75
|
+
const unassignedItem = {
|
|
76
|
+
id: AXM_TASK_BOARD_UNASSIGNED_ASSIGNEE_ID,
|
|
77
|
+
displayName: unassignedLabel,
|
|
78
|
+
username: '',
|
|
79
|
+
};
|
|
80
|
+
const includeUnassigned = matchesFilter(unassignedItem, request.filter);
|
|
81
|
+
const res = await this.userService.query(request ?? { skip: 0, take: 100 });
|
|
82
|
+
const userItems = res.items.map((item) => ({
|
|
83
|
+
id: item.id,
|
|
84
|
+
displayName: item.displayName,
|
|
85
|
+
username: item.username,
|
|
86
|
+
}));
|
|
87
|
+
const items = skip === 0 && includeUnassigned ? [unassignedItem, ...userItems] : userItems;
|
|
88
|
+
const total = res.total + (includeUnassigned ? 1 : 0);
|
|
89
|
+
return { items, total };
|
|
90
|
+
}
|
|
91
|
+
async resolveOne(userId) {
|
|
92
|
+
const selfItem = resolveTaskBoardCurrentUserAssigneeItem(this.sessionService);
|
|
93
|
+
if (selfItem != null && String(selfItem.id) === userId) {
|
|
94
|
+
return selfItem;
|
|
95
|
+
}
|
|
96
|
+
if (isTaskBoardUnassignedAssigneeId(userId)) {
|
|
97
|
+
if (!canViewAllTaskAssignees(this.sessionService)) {
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
const displayName = await this.translationService.translateAsync('@task-management:task-board.filter.unassigned');
|
|
101
|
+
return {
|
|
102
|
+
id: AXM_TASK_BOARD_UNASSIGNED_ASSIGNEE_ID,
|
|
103
|
+
displayName,
|
|
104
|
+
username: '',
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
if (!canViewAllTaskAssignees(this.sessionService)) {
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
const user = await this.userService.byKey(userId);
|
|
111
|
+
if (!user) {
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
return {
|
|
115
|
+
id: user.id,
|
|
116
|
+
displayName: user.displayName,
|
|
117
|
+
username: user.username,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListTaskBoardAssigneesQuery, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
121
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListTaskBoardAssigneesQuery, providedIn: 'root' }); }
|
|
122
|
+
}
|
|
123
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListTaskBoardAssigneesQuery, decorators: [{
|
|
124
|
+
type: Injectable,
|
|
125
|
+
args: [{ providedIn: 'root' }]
|
|
126
|
+
}] });
|
|
127
|
+
|
|
128
|
+
export { AXMListTaskBoardAssigneesQuery };
|
|
129
|
+
//# sourceMappingURL=acorex-platform-module-task-management-client-list-task-board-assignees.query-Ci8_D4Vs.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-task-management-client-list-task-board-assignees.query-Ci8_D4Vs.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 { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPSessionService } from '@acorex-platform/framework-client/auth';\nimport { applyFilterArray } from '@acorex-platform/framework-client/core';\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 '../task-board/task-board-assignee-access';\nimport { AXPTaskBoardUserOption } from '../task-board/task-board.types';\n\n//#region ---- Types ----\n\nexport type AXMListTaskBoardAssigneesQueryInput = AXPCollectionQueryInput;\n\nexport type AXMListTaskBoardAssigneesQueryItem = AXPTaskBoardUserOption;\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 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 selfItem = resolveTaskBoardCurrentUserAssigneeItem(this.sessionService);\n\n if (!canViewAllTaskAssignees(this.sessionService)) {\n if (!selfItem || !matchesFilter(selfItem, request.filter)) {\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: AXPTaskBoardUserOption = {\n id: AXM_TASK_BOARD_UNASSIGNED_ASSIGNEE_ID,\n displayName: unassignedLabel,\n username: '',\n };\n const includeUnassigned = matchesFilter(unassignedItem, request.filter);\n\n const res = await this.userService.query(request ?? { skip: 0, take: 100 });\n const userItems: AXPTaskBoardUserOption[] = 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 resolveOne(userId: string): Promise<AXPTaskBoardUserOption | 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 user = await this.userService.byKey(userId);\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":";;;;;;;;;;AAiCA;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,KAAK,IAAI,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC;AAC7E;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,CAAC,KAAK,CAAC;IAC7B;AACA,IAAA,OAAO,IAAI;AACb;AAEA;AAEA;AAEA;;AAEG;MAEU,8BAA8B,CAAA;AAD3C,IAAA,WAAA,GAAA;;AAOmB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;QACxC,IAAA,CAAA,WAAW,GAAG,IAAI,CAAC;AACjC,aAAA,UAAU,CAACA,UAA4B,CAAC,MAAM,CAAC,IAAI,EAAEA,UAA4B,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI;AACrG,aAAA,IAAI,EAAiE;AACvD,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC1C,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAA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AEA,QAAA,IAAI,+BAA+B,CAAC,MAAM,CAAC,EAAE;YAC3C,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE;AACjD,gBAAA,OAAO,IAAI;YACb;YACA,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAC9D,+CAA+C,CAChD;YACD,OAAO;AACL,gBAAA,EAAE,EAAE,qCAAqC;gBACzC,WAAW;AACX,gBAAA,QAAQ,EAAE,EAAE;aACb;QACH;QAEA,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE;AACjD,YAAA,OAAO,IAAI;QACb;QAEA,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC;QACjD,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;8GAlHW,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;;;;;"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { RootConfig } from '@acorex-platform/module-security-management-client/contracts';
|
|
2
|
+
import { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';
|
|
3
|
+
import { runtimeQuerySuccessCollection, runtimeQueryFailure } from '@acorex-platform/framework-shared/core';
|
|
4
|
+
import * as i0 from '@angular/core';
|
|
5
|
+
import { inject, Injectable } from '@angular/core';
|
|
6
|
+
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region ---- Helpers ----
|
|
9
|
+
function extractEqualIdFilter(filter) {
|
|
10
|
+
if (!filter) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
if (filter.field === 'id' && filter.operator?.type === 'equal' && filter.value != null && filter.value !== '') {
|
|
14
|
+
return String(filter.value);
|
|
15
|
+
}
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region ---- Query ----
|
|
20
|
+
/**
|
|
21
|
+
* Task-board reporters from SecurityManagement.User — replaces the `task-board-reporters` DI data source.
|
|
22
|
+
*/
|
|
23
|
+
class AXMListTaskBoardReportersQuery {
|
|
24
|
+
constructor() {
|
|
25
|
+
//#region ---- Services & Dependencies ----
|
|
26
|
+
this.entityService = inject(AXPEntityService);
|
|
27
|
+
this.userService = this.entityService
|
|
28
|
+
.withEntity(RootConfig.module.name, RootConfig.entities.users.name)
|
|
29
|
+
.data();
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region ---- Query Execution ----
|
|
33
|
+
async fetch(input) {
|
|
34
|
+
try {
|
|
35
|
+
const request = (input ?? { skip: 0, take: 100 });
|
|
36
|
+
const equalId = extractEqualIdFilter(request.filter ?? undefined);
|
|
37
|
+
if (equalId != null) {
|
|
38
|
+
const user = await this.userService.byKey(equalId);
|
|
39
|
+
if (!user) {
|
|
40
|
+
return runtimeQuerySuccessCollection({ items: [], total: 0 });
|
|
41
|
+
}
|
|
42
|
+
return runtimeQuerySuccessCollection({
|
|
43
|
+
items: [
|
|
44
|
+
{
|
|
45
|
+
id: user.id,
|
|
46
|
+
displayName: user.displayName,
|
|
47
|
+
username: user.username,
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
total: 1,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
const res = await this.userService.query(request);
|
|
54
|
+
return runtimeQuerySuccessCollection({
|
|
55
|
+
items: res.items.map((item) => ({
|
|
56
|
+
id: item.id,
|
|
57
|
+
displayName: item.displayName,
|
|
58
|
+
username: item.username,
|
|
59
|
+
})),
|
|
60
|
+
total: res.total,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
return runtimeQueryFailure(error instanceof Error ? error.message : 'Unknown error occurred');
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListTaskBoardReportersQuery, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
68
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListTaskBoardReportersQuery, providedIn: 'root' }); }
|
|
69
|
+
}
|
|
70
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListTaskBoardReportersQuery, decorators: [{
|
|
71
|
+
type: Injectable,
|
|
72
|
+
args: [{ providedIn: 'root' }]
|
|
73
|
+
}] });
|
|
74
|
+
|
|
75
|
+
export { AXMListTaskBoardReportersQuery };
|
|
76
|
+
//# sourceMappingURL=acorex-platform-module-task-management-client-list-task-board-reporters.query-C3NAYa9b.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-task-management-client-list-task-board-reporters.query-C3NAYa9b.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 { AXPEntityService } 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 { AXPTaskBoardUserOption } from '../task-board/task-board.types';\n\n//#region ---- Types ----\n\nexport type AXMListTaskBoardReportersQueryInput = AXPCollectionQueryInput;\n\nexport type AXMListTaskBoardReportersQueryItem = AXPTaskBoardUserOption;\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 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 user = await this.userService.byKey(equalId);\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 res = await this.userService.query(request);\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":";;;;;;AAwBA;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,CAAC,KAAK,CAAC;IAC7B;AACA,IAAA,OAAO,IAAI;AACb;AAEA;AAEA;AAEA;;AAEG;MAEU,8BAA8B,CAAA;AAD3C,IAAA,WAAA,GAAA;;AAOmB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;QACxC,IAAA,CAAA,WAAW,GAAG,IAAI,CAAC;AACjC,aAAA,UAAU,CAACA,UAA4B,CAAC,MAAM,CAAC,IAAI,EAAEA,UAA4B,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI;AACrG,aAAA,IAAI,EAAiE;AA+CzE,IAAA;;;IAzCC,MAAM,KAAK,CACT,KAAkD,EAAA;AAElD,QAAA,IAAI;AACF,YAAA,MAAM,OAAO,IAAI,KAAK,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAoB;YACpE,MAAM,OAAO,GAAG,oBAAoB,CAAC,OAAO,CAAC,MAAM,IAAI,SAAS,CAAC;AAEjE,YAAA,IA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AAA,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;;;;;"}
|
package/fesm2022/acorex-platform-module-task-management-client-list-task-types.query-CKLUPrBU.mjs
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { resolveCollectionSkip, resolveCollectionTake } from '@acorex-platform/framework-shared/runtime';
|
|
2
|
+
import { runtimeQuerySuccessCollection, runtimeQueryFailure } from '@acorex-platform/framework-shared/core';
|
|
3
|
+
import { applyFilterArray, applySortArray } from '@acorex-platform/framework-client/core';
|
|
4
|
+
import * as i0 from '@angular/core';
|
|
5
|
+
import { inject, Injectable } from '@angular/core';
|
|
6
|
+
import { a as AXPTaskBoardService } from './acorex-platform-module-task-management-client-acorex-platform-module-task-management-client-CIwafWli.mjs';
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region ---- Query ----
|
|
10
|
+
/**
|
|
11
|
+
* Resolved workflow task types — replaces the `task-types` DI data source.
|
|
12
|
+
*/
|
|
13
|
+
class AXMListTaskTypesQuery {
|
|
14
|
+
constructor() {
|
|
15
|
+
//#region ---- Services & Dependencies ----
|
|
16
|
+
this.taskBoardService = inject(AXPTaskBoardService);
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region ---- Query Execution ----
|
|
20
|
+
async fetch(input) {
|
|
21
|
+
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) {
|
|
29
|
+
items = applyFilterArray(items, [input.filter]);
|
|
30
|
+
}
|
|
31
|
+
const rawSort = Array.isArray(input?.sort) ? input.sort : input?.sort ? [input.sort] : [];
|
|
32
|
+
const sortOpt = rawSort.length > 0 ? rawSort : [{ field: 'name', dir: 'asc' }];
|
|
33
|
+
items = applySortArray(items, sortOpt);
|
|
34
|
+
const skip = resolveCollectionSkip(input?.skip);
|
|
35
|
+
const take = resolveCollectionTake(input?.take);
|
|
36
|
+
const total = items.length;
|
|
37
|
+
const page = items.slice(skip, skip + take);
|
|
38
|
+
return runtimeQuerySuccessCollection({ items: page, total });
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
return runtimeQueryFailure(error instanceof Error ? error.message : 'Unknown error occurred');
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListTaskTypesQuery, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
45
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListTaskTypesQuery, providedIn: 'root' }); }
|
|
46
|
+
}
|
|
47
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMListTaskTypesQuery, decorators: [{
|
|
48
|
+
type: Injectable,
|
|
49
|
+
args: [{ providedIn: 'root' }]
|
|
50
|
+
}] });
|
|
51
|
+
|
|
52
|
+
export { AXMListTaskTypesQuery };
|
|
53
|
+
//# sourceMappingURL=acorex-platform-module-task-management-client-list-task-types.query-CKLUPrBU.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-task-management-client-list-task-types.query-CKLUPrBU.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';\n\nimport { Injectable, inject } from '@angular/core';\n\nimport { AXPTaskBoardService } from '../task-board/task-board.service';\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(AXPTaskBoardService);\n\n //#endregion\n\n //#region ---- Query Execution ----\n\n async fetch(\n input?: AXMListTaskTypesQueryInput | null,\n ): AXPQueryCollectionFetchResultPromise<AXMListTaskTypesQueryItem> {\n try {\n const providers = await this.taskBoardService.getTaskTypes();\n let items: AXMListTaskTypesQueryItem[] = await Promise.all(\n providers.map(async (provider) => ({\n name: provider.name,\n title: await provider.getTitle(),\n icon: await provider.getIcon(),\n })),\n );\n\n 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 );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AAE,IAAI,CAAC;AAC/C,YAAA,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM;AAC1B,YAAA,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;YAE3C,OAAO,6BAA6B,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;QAC9D;QAAE,OAAO,KAAK,EAAE;AACd,YAAA,OAAO,mBAAmB,CACxB,KAAK,YAAY,KAAK,GAAG,KAAK,CAAC,OAAO,GAAG,wBAAwB,CAClE;QACH;IACF;8GA3CW,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,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,cADR,MAAM,EAAA,CAAA,CAAA;;2FACnB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBADjC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
|
package/fesm2022/acorex-platform-module-task-management-client-start-task-flow.command-ChCuTFV-.mjs
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { AXToastService } from '@acorex/components/toast';
|
|
2
|
+
import { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';
|
|
3
|
+
import { AXPWorkflowManager } from '@acorex-platform/framework-client/workflow';
|
|
4
|
+
import { defaultTo, get, merge, isEmpty } from 'lodash';
|
|
5
|
+
import * as i0 from '@angular/core';
|
|
6
|
+
import { inject, Injectable } from '@angular/core';
|
|
7
|
+
import { AXPTaskManagementCommandKeys, RootConfig } from '@acorex-platform/module-task-management-client/contracts';
|
|
8
|
+
|
|
9
|
+
//#endregion
|
|
10
|
+
/**
|
|
11
|
+
* Starts a workflow for a {@link TaskManagement.Task} when the task type defines {@link workflowConfig}.
|
|
12
|
+
*/
|
|
13
|
+
class StartTaskFlowCommand {
|
|
14
|
+
constructor() {
|
|
15
|
+
//#region ---- Services & Dependencies ----
|
|
16
|
+
this.toastService = inject(AXToastService);
|
|
17
|
+
this.entityService = inject(AXPEntityService);
|
|
18
|
+
this.workflowManager = inject(AXPWorkflowManager);
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region ---- Command Implementation ----
|
|
22
|
+
async execute(input) {
|
|
23
|
+
const options = (input?.options ?? input);
|
|
24
|
+
const flowInput = defaultTo(options?.input, {});
|
|
25
|
+
const workflowId = (options?.workflowId ?? input?.workflowId)?.trim();
|
|
26
|
+
const taskTypeId = flowInput?.taskTypeId?.trim();
|
|
27
|
+
const subjectRef = flowInput?.subjectRef ?? input?.subjectRef;
|
|
28
|
+
const projectTypeId = flowInput?.projectTypeId?.trim() ?? input?.projectTypeId?.trim();
|
|
29
|
+
if (!workflowId || !taskTypeId || !subjectRef?.id || !subjectRef?.type) {
|
|
30
|
+
return { success: false, message: { text: 'Missing workflow, task type, or subject reference.' } };
|
|
31
|
+
}
|
|
32
|
+
try {
|
|
33
|
+
const taskType = await this.loadTaskType(taskTypeId);
|
|
34
|
+
if (!taskType) {
|
|
35
|
+
return { success: false, message: { text: 'Task type not found.' } };
|
|
36
|
+
}
|
|
37
|
+
if (projectTypeId) {
|
|
38
|
+
const allowed = await this.isTaskTypeAllowedForProjectType(projectTypeId, taskTypeId);
|
|
39
|
+
if (!allowed) {
|
|
40
|
+
return { success: false, message: { text: 'Task type is not allowed for this project type.' } };
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const defaultInput = defaultTo(get(taskType, 'workflowConfig.defaultInput'), {});
|
|
44
|
+
const startResult = await this.workflowManager.start(workflowId, merge(defaultInput, {
|
|
45
|
+
taskTypeId,
|
|
46
|
+
taskTypeTitle: flowInput.taskTypeTitle ?? taskType.title,
|
|
47
|
+
subjectRef,
|
|
48
|
+
...(projectTypeId ? { projectTypeId } : {}),
|
|
49
|
+
refId: subjectRef.id,
|
|
50
|
+
refType: subjectRef.type,
|
|
51
|
+
correlationId: this.buildCorrelationId(subjectRef.id, taskTypeId, workflowId),
|
|
52
|
+
}, flowInput));
|
|
53
|
+
if (!startResult.success) {
|
|
54
|
+
this.toastService.show({
|
|
55
|
+
color: 'danger',
|
|
56
|
+
title: 'Workflow Execution Failed',
|
|
57
|
+
content: startResult.error ?? 'Unknown error',
|
|
58
|
+
closeButton: true,
|
|
59
|
+
timeOut: 5000,
|
|
60
|
+
});
|
|
61
|
+
return { success: false, message: { text: startResult.error ?? 'Unknown error' } };
|
|
62
|
+
}
|
|
63
|
+
return { success: true, kind: 'object', data: undefined };
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
67
|
+
console.error('[StartTaskFlowCommand]', error);
|
|
68
|
+
this.toastService.show({
|
|
69
|
+
color: 'danger',
|
|
70
|
+
title: 'Workflow Execution Error',
|
|
71
|
+
content: message,
|
|
72
|
+
closeButton: true,
|
|
73
|
+
timeOut: 5000,
|
|
74
|
+
});
|
|
75
|
+
return { success: false, message: { text: message } };
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region ---- Helpers ----
|
|
80
|
+
async loadTaskType(taskTypeId) {
|
|
81
|
+
const row = await this.entityService
|
|
82
|
+
.withEntity(RootConfig.module.name, RootConfig.entities.taskType.name)
|
|
83
|
+
.data()
|
|
84
|
+
.byKey(taskTypeId);
|
|
85
|
+
return (row ?? null);
|
|
86
|
+
}
|
|
87
|
+
async isTaskTypeAllowedForProjectType(projectTypeId, taskTypeId) {
|
|
88
|
+
const projectType = (await this.entityService
|
|
89
|
+
.withEntity('ProjectManagement', 'ProjectType')
|
|
90
|
+
.data()
|
|
91
|
+
.byKey(projectTypeId));
|
|
92
|
+
if (!projectType) {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
const allowedIds = projectType.allowedTaskTypes?.map((row) => row.id).filter(Boolean) ?? [];
|
|
96
|
+
if (!isEmpty(allowedIds)) {
|
|
97
|
+
return allowedIds.includes(taskTypeId);
|
|
98
|
+
}
|
|
99
|
+
return defaultTo(projectType.allowedTaskTypeIds, []).includes(taskTypeId);
|
|
100
|
+
}
|
|
101
|
+
buildCorrelationId(subjectId, taskTypeId, workflowId) {
|
|
102
|
+
return `${subjectId}:${taskTypeId}:${workflowId}`;
|
|
103
|
+
}
|
|
104
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: StartTaskFlowCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
105
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: StartTaskFlowCommand, providedIn: 'root' }); }
|
|
106
|
+
}
|
|
107
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: StartTaskFlowCommand, decorators: [{
|
|
108
|
+
type: Injectable,
|
|
109
|
+
args: [{ providedIn: 'root' }]
|
|
110
|
+
}] });
|
|
111
|
+
const START_TASK_FLOW_COMMAND_KEY = AXPTaskManagementCommandKeys.Task.StartFlow;
|
|
112
|
+
|
|
113
|
+
export { START_TASK_FLOW_COMMAND_KEY, StartTaskFlowCommand };
|
|
114
|
+
//# sourceMappingURL=acorex-platform-module-task-management-client-start-task-flow.command-ChCuTFV-.mjs.map
|