rez_core 2.2.99 → 2.2.100
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/workflow/service/task.service.d.ts +3 -1
- package/dist/module/workflow/service/task.service.js +19 -4
- 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/workflow/service/task.service.ts +24 -2
package/package.json
CHANGED
|
@@ -7,6 +7,7 @@ import { DataSource, EntityManager } from 'typeorm';
|
|
|
7
7
|
import { BaseEntity } from 'src/module/meta/entity/base-entity.entity';
|
|
8
8
|
import { ActivityLogService } from './activity-log.service';
|
|
9
9
|
import { ACTIVITY_CATEGORIES } from '../repository/activity-log.repository';
|
|
10
|
+
import { MediaDataService } from 'src/module/meta/service/media-data.service';
|
|
10
11
|
|
|
11
12
|
@Injectable()
|
|
12
13
|
export class TaskService extends EntityServiceImpl {
|
|
@@ -16,6 +17,7 @@ export class TaskService extends EntityServiceImpl {
|
|
|
16
17
|
private readonly dataSource: DataSource,
|
|
17
18
|
@Inject('ActivityLogService')
|
|
18
19
|
private readonly activityLogService: ActivityLogService,
|
|
20
|
+
private readonly mediaDataService: MediaDataService,
|
|
19
21
|
) {
|
|
20
22
|
super();
|
|
21
23
|
}
|
|
@@ -214,13 +216,14 @@ export class TaskService extends EntityServiceImpl {
|
|
|
214
216
|
s.name AS stage_name,
|
|
215
217
|
a.name AS action_name,
|
|
216
218
|
u.name AS created_by_name,
|
|
217
|
-
u2.name AS task_owner_name
|
|
219
|
+
u2.name AS task_owner_name,
|
|
220
|
+
u2.profile_image AS task_owner_profile
|
|
218
221
|
FROM cr_wf_task_data t
|
|
219
222
|
LEFT JOIN cr_wf_stage s ON t.stage_id = s.id
|
|
220
223
|
LEFT JOIN cr_wf_stage_group sg ON s.stage_group_id = sg.id
|
|
221
224
|
LEFT JOIN cr_wf_action a ON t.action_id = a.id
|
|
222
225
|
LEFT JOIN cr_user u ON t.created_by = u.id
|
|
223
|
-
LEFT JOIN
|
|
226
|
+
LEFT JOIN eth_user_profile u2 ON t.task_owner = u2.parent_id
|
|
224
227
|
WHERE ${whereClauses.join(' AND ')}
|
|
225
228
|
ORDER BY t.created_date DESC
|
|
226
229
|
`;
|
|
@@ -248,15 +251,34 @@ export class TaskService extends EntityServiceImpl {
|
|
|
248
251
|
);
|
|
249
252
|
|
|
250
253
|
// Assign task_status using the map
|
|
254
|
+
|
|
255
|
+
const mediaCache = new Map<number, any>();
|
|
256
|
+
|
|
251
257
|
for (const task of taskData) {
|
|
258
|
+
// Map status name
|
|
252
259
|
task.task_status = task.status
|
|
253
260
|
? statusMap.get(String(task.status)) || null
|
|
254
261
|
: null;
|
|
255
262
|
|
|
263
|
+
// Fix action_name for generic tasks
|
|
256
264
|
task.action_name =
|
|
257
265
|
task.action_id === '0' || task.action_id === 0
|
|
258
266
|
? 'Generic'
|
|
259
267
|
: task.action_name;
|
|
268
|
+
|
|
269
|
+
// Profile media (with caching like notes)
|
|
270
|
+
if (task.task_owner_profile) {
|
|
271
|
+
if (!mediaCache.has(task.task_owner_profile)) {
|
|
272
|
+
const url = await this.mediaDataService.getMediaDownloadUrl(
|
|
273
|
+
task.task_owner_profile,
|
|
274
|
+
loggedInUser,
|
|
275
|
+
);
|
|
276
|
+
mediaCache.set(task.task_owner_profile, url);
|
|
277
|
+
}
|
|
278
|
+
task.task_owner_profile = mediaCache.get(task.task_owner_profile);
|
|
279
|
+
} else {
|
|
280
|
+
task.task_owner_profile = null;
|
|
281
|
+
}
|
|
260
282
|
}
|
|
261
283
|
|
|
262
284
|
// Normalize is_mandatory to '0'/'1' as string
|