rez_core 2.0.99 → 2.0.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/filter/controller/filter.controller.d.ts +1 -1
- package/dist/module/filter/service/filter.service.d.ts +1 -1
- package/dist/module/filter/service/filter.service.js +21 -15
- package/dist/module/filter/service/filter.service.js.map +1 -1
- package/dist/module/user/service/role.service.js +3 -0
- package/dist/module/user/service/role.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 +30 -33
- package/src/module/user/service/role.service.ts +3 -0
package/package.json
CHANGED
|
@@ -155,36 +155,42 @@ export class FilterService {
|
|
|
155
155
|
const layout = layoutPreference?.[0]?.layout_json?.quick_tab || {};
|
|
156
156
|
let showList = layout?.show_list?.map((val) => val.toLowerCase()) || [];
|
|
157
157
|
|
|
158
|
-
|
|
159
|
-
if (layout?.isAllSelected) {
|
|
160
|
-
if (!showList.includes('all')) {
|
|
161
|
-
showList.push('all');
|
|
162
|
-
}
|
|
163
|
-
}
|
|
158
|
+
let filteredTabs;
|
|
164
159
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
160
|
+
if (showList?.length > 0) {
|
|
161
|
+
// If 'All' is selected, include 'all'
|
|
162
|
+
if (layout?.isAllSelected) {
|
|
163
|
+
if (!showList.includes('all')) {
|
|
164
|
+
showList.push('all');
|
|
165
|
+
}
|
|
166
|
+
}
|
|
169
167
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
(tab) => tab.tab_value.toLowerCase() === 'all',
|
|
168
|
+
// Filter `allTabs` using showList (case-insensitive)
|
|
169
|
+
filteredTabs = allTabs.filter((tab) =>
|
|
170
|
+
showList.includes(tab.tab_value.toLowerCase()),
|
|
174
171
|
);
|
|
175
|
-
const allCount = allTab?.tab_value_count ?? 0;
|
|
176
172
|
|
|
177
|
-
//
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
173
|
+
// If combine other is enabled
|
|
174
|
+
if (layout?.isCombineOther) {
|
|
175
|
+
const allTab = allTabs.find(
|
|
176
|
+
(tab) => tab.tab_value.toLowerCase() === 'all',
|
|
177
|
+
);
|
|
178
|
+
const allCount = allTab?.tab_value_count ?? 0;
|
|
179
|
+
|
|
180
|
+
// Calculate sum of filtered (excluding 'All')
|
|
181
|
+
const knownTabCountSum = filteredTabs
|
|
182
|
+
.filter((tab) => tab.tab_value.toLowerCase() !== 'all')
|
|
183
|
+
.reduce((acc, tab) => acc + tab.tab_value_count, 0);
|
|
181
184
|
|
|
182
|
-
|
|
185
|
+
const othersCount = allCount - knownTabCountSum;
|
|
183
186
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
187
|
+
filteredTabs.push({
|
|
188
|
+
tab_value: 'OTHERS',
|
|
189
|
+
tab_value_count: othersCount < 0 ? 0 : othersCount, // safe fallback
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
} else {
|
|
193
|
+
filteredTabs = allTabs;
|
|
188
194
|
}
|
|
189
195
|
|
|
190
196
|
// Add tab.value filter only if present
|
|
@@ -215,15 +221,6 @@ export class FilterService {
|
|
|
215
221
|
qb.andWhere(clause.query, clause.params);
|
|
216
222
|
});
|
|
217
223
|
|
|
218
|
-
//prefernec.sort_by.length>0 if()
|
|
219
|
-
|
|
220
|
-
// "sortby": [
|
|
221
|
-
// {
|
|
222
|
-
// "order": "asc",
|
|
223
|
-
// "column": "customer_name"
|
|
224
|
-
// }
|
|
225
|
-
// ],
|
|
226
|
-
|
|
227
224
|
if (Array.isArray(sortby)) {
|
|
228
225
|
// Optional sorting
|
|
229
226
|
sortby.forEach(({ sortColum, sortType }) => {
|
|
@@ -29,6 +29,7 @@ export class RoleService extends EntityServiceImpl {
|
|
|
29
29
|
// if level_type and level_id are not provided, use loggedInUser's values
|
|
30
30
|
role.level_type = entityData.level_type || loggedInUser.level_type;
|
|
31
31
|
role.level_id = entityData.level_id || loggedInUser.level_id;
|
|
32
|
+
role.appcode = entityData.appcode || loggedInUser.appcode;
|
|
32
33
|
|
|
33
34
|
if (
|
|
34
35
|
await this.roleRepository.isRoleNameWithLevelExists(role.name, {
|
|
@@ -62,6 +63,7 @@ export class RoleService extends EntityServiceImpl {
|
|
|
62
63
|
module_code: perm.module_code,
|
|
63
64
|
action_type: perm.action_type,
|
|
64
65
|
access_flag: perm.access_flag,
|
|
66
|
+
level_type: perm.level_type,
|
|
65
67
|
appcode: perm.appcode,
|
|
66
68
|
}),
|
|
67
69
|
);
|
|
@@ -143,6 +145,7 @@ export class RoleService extends EntityServiceImpl {
|
|
|
143
145
|
action_type: perm.action_type,
|
|
144
146
|
access_flag: perm.access_flag,
|
|
145
147
|
appcode: perm.appcode,
|
|
148
|
+
level_type: perm.level_type,
|
|
146
149
|
}),
|
|
147
150
|
);
|
|
148
151
|
|