rez_core 2.1.156 → 2.1.157
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module/filter/service/filter.service.js +2 -1
- package/dist/module/filter/service/filter.service.js.map +1 -1
- package/dist/module/workflow/controller/action.controller.js +1 -1
- package/dist/module/workflow/controller/task.controller.d.ts +3 -2
- package/dist/module/workflow/controller/task.controller.js.map +1 -1
- package/dist/module/workflow/repository/action.repository.js +4 -0
- package/dist/module/workflow/repository/action.repository.js.map +1 -1
- package/dist/module/workflow/repository/task.repository.d.ts +1 -1
- package/dist/module/workflow/repository/task.repository.js +2 -5
- package/dist/module/workflow/repository/task.repository.js.map +1 -1
- package/dist/module/workflow/service/action.service.js +3 -4
- package/dist/module/workflow/service/action.service.js.map +1 -1
- package/dist/module/workflow/service/task.service.js +6 -1
- package/dist/module/workflow/service/task.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/filter/service/filter.service.ts +4 -2
- package/src/module/workflow/controller/action.controller.ts +1 -1
- package/src/module/workflow/controller/task.controller.ts +3 -2
- package/src/module/workflow/repository/action.repository.ts +5 -0
- package/src/module/workflow/repository/task.repository.ts +2 -10
- package/src/module/workflow/service/action.service.ts +9 -9
- package/src/module/workflow/service/task.service.ts +6 -6
package/package.json
CHANGED
|
@@ -196,10 +196,12 @@ export class FilterService {
|
|
|
196
196
|
const layoutPreference = await this.dataSource.query(
|
|
197
197
|
`SELECT layout_json
|
|
198
198
|
FROM cr_layout_preference
|
|
199
|
-
WHERE user_id = ? AND mapped_entity_type = ?`,
|
|
200
|
-
[user_id, entity_type],
|
|
199
|
+
WHERE user_id = ? AND mapped_entity_type = ? AND mapped_level_id = ? AND mapped_level_type = ?`,
|
|
200
|
+
[user_id, entity_type, level_id, level_type],
|
|
201
201
|
);
|
|
202
202
|
|
|
203
|
+
console.log('found layoutPreference', layoutPreference);
|
|
204
|
+
|
|
203
205
|
// Extract layout preference
|
|
204
206
|
const layout = layoutPreference?.[0]?.layout_json?.quick_tab || {};
|
|
205
207
|
|
|
@@ -25,9 +25,10 @@ export class TaskController {
|
|
|
25
25
|
@Req() req: Request & { user: any },
|
|
26
26
|
@Body()
|
|
27
27
|
body: {
|
|
28
|
-
mapped_entity_type: string;
|
|
29
|
-
mapped_entity_id: number;
|
|
30
28
|
stage_id: number;
|
|
29
|
+
mapped_entity_type?: string;
|
|
30
|
+
mapped_entity_id?: number;
|
|
31
|
+
user_id?: number;
|
|
31
32
|
},
|
|
32
33
|
) {
|
|
33
34
|
const loggedInUser = req.user.userData;
|
|
@@ -11,18 +11,10 @@ export class TaskRepository {
|
|
|
11
11
|
private readonly dataSource: DataSource,
|
|
12
12
|
) {}
|
|
13
13
|
|
|
14
|
-
async getAllTaskByUserIdAndStageId(
|
|
15
|
-
userId,
|
|
16
|
-
stageId,
|
|
17
|
-
mapped_entity_type,
|
|
18
|
-
mapped_entity_id,
|
|
19
|
-
) {
|
|
14
|
+
async getAllTaskByUserIdAndStageId(condition) {
|
|
20
15
|
const result = await this.TaskRepository.find({
|
|
21
16
|
where: {
|
|
22
|
-
|
|
23
|
-
stage_id: stageId,
|
|
24
|
-
mapped_entity_type,
|
|
25
|
-
mapped_entity_id,
|
|
17
|
+
...condition,
|
|
26
18
|
},
|
|
27
19
|
});
|
|
28
20
|
|
|
@@ -64,6 +64,7 @@ export class ActionService extends EntityServiceImpl {
|
|
|
64
64
|
appcode,
|
|
65
65
|
);
|
|
66
66
|
|
|
67
|
+
// template mapping
|
|
67
68
|
if (Array.isArray(actionData.template) && actionData.template.length > 0) {
|
|
68
69
|
const templates = actionData.template;
|
|
69
70
|
|
|
@@ -102,7 +103,7 @@ export class ActionService extends EntityServiceImpl {
|
|
|
102
103
|
};
|
|
103
104
|
|
|
104
105
|
// Pass only actionData (without template) to super.updateEntity
|
|
105
|
-
let action = await super.updateEntity(actionData, loggedInUser);
|
|
106
|
+
let action = await super.updateEntity({ ...actionData }, loggedInUser);
|
|
106
107
|
|
|
107
108
|
if (!action) {
|
|
108
109
|
throw new Error('Action not found or could not be updated');
|
|
@@ -126,17 +127,17 @@ export class ActionService extends EntityServiceImpl {
|
|
|
126
127
|
loggedInUser,
|
|
127
128
|
);
|
|
128
129
|
|
|
130
|
+
// delete existing template mappings for this action
|
|
131
|
+
await this.dataSource.query(
|
|
132
|
+
`DELETE FROM cr_wf_action_template_mapping WHERE stg_act_mapping_id = ?`,
|
|
133
|
+
[stageActionMappingData.id],
|
|
134
|
+
);
|
|
135
|
+
|
|
129
136
|
// Handle template mapping (using the extracted template)
|
|
130
137
|
if (Array.isArray(template) && template.length > 0) {
|
|
131
138
|
for (let i = 0; i < template.length; i++) {
|
|
132
139
|
const templateCode = template[i];
|
|
133
140
|
|
|
134
|
-
// delete existing template mappings for this action
|
|
135
|
-
await this.dataSource.query(
|
|
136
|
-
`DELETE FROM cr_wf_action_template_mapping WHERE stg_act_mapping_id = ? AND template_code = ?`,
|
|
137
|
-
[stageActionMappingData.id, templateCode],
|
|
138
|
-
);
|
|
139
|
-
|
|
140
141
|
// Create Action-Template Mapping
|
|
141
142
|
const actionTemplateMapping = {
|
|
142
143
|
stg_act_mapping_id: stageActionMappingData.id,
|
|
@@ -291,8 +292,7 @@ export class ActionService extends EntityServiceImpl {
|
|
|
291
292
|
const actionResults = await this.dataSource
|
|
292
293
|
.createQueryBuilder()
|
|
293
294
|
.select([
|
|
294
|
-
'a
|
|
295
|
-
'a.name AS name',
|
|
295
|
+
'a.*',
|
|
296
296
|
'ac.name AS action_category',
|
|
297
297
|
'ar.name AS action_requirement',
|
|
298
298
|
])
|
|
@@ -17,12 +17,12 @@ export class TaskService extends EntityServiceImpl {
|
|
|
17
17
|
loggedInUser: UserData,
|
|
18
18
|
data,
|
|
19
19
|
): Promise<any> {
|
|
20
|
-
const taskData = await this.taskRepository.getAllTaskByUserIdAndStageId(
|
|
21
|
-
|
|
22
|
-
data.stage_id,
|
|
23
|
-
data.mapped_entity_type,
|
|
24
|
-
data.mapped_entity_id,
|
|
25
|
-
);
|
|
20
|
+
const taskData = await this.taskRepository.getAllTaskByUserIdAndStageId({
|
|
21
|
+
user_id: data.user_id,
|
|
22
|
+
stage_id: data.stage_id,
|
|
23
|
+
mapped_entity_type: data.mapped_entity_type,
|
|
24
|
+
mapped_entity_id: data.mapped_entity_id,
|
|
25
|
+
});
|
|
26
26
|
|
|
27
27
|
const grouped: { mandatory: any[]; non_mandatory: any[] } = {
|
|
28
28
|
mandatory: [],
|