rez_core 2.0.99 → 2.1.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rez_core",
3
- "version": "2.0.99",
3
+ "version": "2.1.1",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -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
- // If 'All' is selected, include 'all'
159
- if (layout?.isAllSelected) {
160
- if (!showList.includes('all')) {
161
- showList.push('all');
162
- }
163
- }
158
+ let filteredTabs;
164
159
 
165
- // Filter `allTabs` using showList (case-insensitive)
166
- const filteredTabs = allTabs.filter((tab) =>
167
- showList.includes(tab.tab_value.toLowerCase()),
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
- // If combine other is enabled
171
- if (layout?.isCombineOther) {
172
- const allTab = allTabs.find(
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
- // Calculate sum of filtered (excluding 'All')
178
- const knownTabCountSum = filteredTabs
179
- .filter((tab) => tab.tab_value.toLowerCase() !== 'all')
180
- .reduce((acc, tab) => acc + tab.tab_value_count, 0);
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
- const othersCount = allCount - knownTabCountSum;
185
+ const othersCount = allCount - knownTabCountSum;
183
186
 
184
- filteredTabs.push({
185
- tab_value: 'OTHERS',
186
- tab_value_count: othersCount < 0 ? 0 : othersCount, // safe fallback
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 }) => {
@@ -63,6 +63,7 @@ export class LoginService {
63
63
  const roleMappings = await this.userRoleMappingRepository.find({
64
64
  where: {
65
65
  user_id: user.id,
66
+ appcode: user.last_app_access,
66
67
  },
67
68
  });
68
69
 
@@ -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