rez_core 2.1.57 → 2.1.59
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/controller/filter.controller.js +1 -4
- package/dist/module/filter/controller/filter.controller.js.map +1 -1
- package/dist/module/filter/dto/filter-request.dto.d.ts +7 -4
- package/dist/module/filter/service/filter.service.d.ts +2 -1
- package/dist/module/filter/service/filter.service.js +8 -9
- package/dist/module/filter/service/filter.service.js.map +1 -1
- package/dist/module/listmaster/repository/list-master-items.repository.d.ts +1 -1
- package/dist/module/listmaster/repository/list-master-items.repository.js +1 -1
- package/dist/module/listmaster/repository/list-master-items.repository.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/filter/controller/filter.controller.ts +1 -4
- package/src/module/filter/dto/filter-request.dto.ts +7 -4
- package/src/module/filter/service/filter.service.ts +21 -10
- package/src/module/listmaster/repository/list-master-items.repository.ts +1 -1
package/package.json
CHANGED
|
@@ -23,8 +23,11 @@ export interface FilterRequestDto {
|
|
|
23
23
|
tabs?: TabsConfig;
|
|
24
24
|
page?: number;
|
|
25
25
|
size?: number;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
loggedInUser?: {
|
|
27
|
+
id: string;
|
|
28
|
+
level_type: string;
|
|
29
|
+
level_id: string;
|
|
30
|
+
appcode: string;
|
|
31
|
+
organization_id?: number; // Optional, if applicable
|
|
32
|
+
};
|
|
30
33
|
}
|
|
@@ -20,7 +20,8 @@ export class FilterService {
|
|
|
20
20
|
@Inject('SavedFilterService')
|
|
21
21
|
private readonly savedFilterService: SavedFilterService,
|
|
22
22
|
) {}
|
|
23
|
-
private readonly
|
|
23
|
+
private readonly skipAppCodeFilterEntities = ['ORGP'];
|
|
24
|
+
private readonly skipOrgFilterEntities = ['ORGP'];
|
|
24
25
|
|
|
25
26
|
private async gettab_value_counts(
|
|
26
27
|
tableName: string,
|
|
@@ -78,11 +79,16 @@ export class FilterService {
|
|
|
78
79
|
attributeFilter,
|
|
79
80
|
tabs,
|
|
80
81
|
sortby,
|
|
81
|
-
|
|
82
|
+
loggedInUser,
|
|
83
|
+
} = dto;
|
|
84
|
+
|
|
85
|
+
const {
|
|
82
86
|
level_type,
|
|
83
87
|
level_id,
|
|
88
|
+
id: user_id,
|
|
84
89
|
appcode,
|
|
85
|
-
|
|
90
|
+
organization_id,
|
|
91
|
+
} = loggedInUser || {};
|
|
86
92
|
|
|
87
93
|
// Fetch meta
|
|
88
94
|
const entityMeta = await this.entityTableService.getEntityData(entity_type);
|
|
@@ -133,23 +139,28 @@ export class FilterService {
|
|
|
133
139
|
const baseWhere = this.buildWhereClauses(baseFilters, attributeMetaMap);
|
|
134
140
|
|
|
135
141
|
// check level_id and level_type
|
|
136
|
-
if (level_type && level_id) {
|
|
142
|
+
if (entity_type != 'ORGP' && level_type && level_id && organization_id) {
|
|
137
143
|
baseWhere.push({
|
|
138
|
-
query:
|
|
144
|
+
query:
|
|
145
|
+
'e.organization_id = :organization_id AND e.level_type = :level_type AND e.level_id = :level_id',
|
|
139
146
|
params: {
|
|
147
|
+
organization_id,
|
|
140
148
|
level_type,
|
|
141
149
|
level_id,
|
|
142
150
|
},
|
|
143
151
|
});
|
|
144
152
|
}
|
|
145
153
|
|
|
146
|
-
if (
|
|
147
|
-
baseWhere.push({
|
|
148
|
-
query: 'e.appcode = :appcode',
|
|
149
|
-
params: { appcode },
|
|
150
|
-
});
|
|
154
|
+
if (user_id === '1') {
|
|
151
155
|
}
|
|
152
156
|
|
|
157
|
+
// if (!this.skipAppCodeFilterEntities.includes(entity_type)) {
|
|
158
|
+
// baseWhere.push({
|
|
159
|
+
// query: 'e.appcode = :appcode',
|
|
160
|
+
// params: { appcode },
|
|
161
|
+
// });
|
|
162
|
+
// }
|
|
163
|
+
|
|
153
164
|
// layout preference query
|
|
154
165
|
const layoutPreference = await this.dataSource.query(
|
|
155
166
|
`SELECT layout_json
|
|
@@ -25,7 +25,7 @@ export class ListMasterItemsRepository {
|
|
|
25
25
|
where: { listtype: type, status: 'active' },
|
|
26
26
|
order: { sortindex: 'ASC' },
|
|
27
27
|
});
|
|
28
|
-
return items.map((i) => ({ label: i.name, value: i.
|
|
28
|
+
return items.map((i) => ({ label: i.name, value: i.id }));
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
async findAllItemsByListType(
|