rez_core 2.1.25 → 2.1.26

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.1.25",
3
+ "version": "2.1.26",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -153,16 +153,25 @@ export class FilterService {
153
153
  [user_id, entity_type],
154
154
  );
155
155
 
156
- const allTabs = await this.gettab_value_counts(
157
- getTableMeta.data_source,
158
- tabs?.columnName,
159
- baseWhere,
160
- );
161
-
162
156
  // Extract layout preference
163
157
  const layout = layoutPreference?.[0]?.layout_json?.quick_tab || {};
164
158
  let showList = layout?.show_list?.map((val) => val.toLowerCase()) || [];
165
159
 
160
+ let allTabs;
161
+ if (layout.attribute) {
162
+ allTabs = await this.gettab_value_counts(
163
+ getTableMeta.data_source,
164
+ layout.attribute,
165
+ baseWhere,
166
+ );
167
+ } else {
168
+ allTabs = await this.gettab_value_counts(
169
+ getTableMeta.data_source,
170
+ tabs?.columnName,
171
+ baseWhere,
172
+ );
173
+ }
174
+
166
175
  let filteredTabs;
167
176
 
168
177
  if (showList?.length > 0) {
@@ -201,20 +210,42 @@ export class FilterService {
201
210
  filteredTabs = allTabs;
202
211
  }
203
212
 
204
- // Add tab.value filter only if present
205
213
  const dataWhere = [...baseWhere];
214
+
206
215
  if (tabs?.columnName && tabs?.value) {
207
216
  const tabAttrMeta = attributeMetaMap[tabs.columnName];
208
- const tabCondition = this.buildCondition(
209
- {
210
- filter_attribute: tabs.columnName,
211
- filter_operator: 'equal',
212
- filter_value: tabs.value,
213
- },
214
- tabAttrMeta,
215
- );
216
- if (tabCondition) {
217
- if (tabs.value.toLowerCase() !== 'all') dataWhere.push(tabCondition);
217
+ const tabValue = tabs.value.toLowerCase();
218
+
219
+ if (tabValue === 'others') {
220
+ const valuesToExclude = showList.filter((v) => v !== 'all');
221
+ if (valuesToExclude.length > 0) {
222
+ valuesToExclude.forEach((value) => {
223
+ const tabCondition = this.buildCondition(
224
+ {
225
+ filter_attribute: tabs.columnName,
226
+ filter_operator: 'not_equal',
227
+ filter_value: value,
228
+ },
229
+ tabAttrMeta,
230
+ );
231
+ if (tabCondition) {
232
+ dataWhere.push(tabCondition);
233
+ }
234
+ });
235
+ }
236
+ } else if (tabValue !== 'all') {
237
+ // Normal case: filter by equality
238
+ const tabCondition = this.buildCondition(
239
+ {
240
+ filter_attribute: tabs.columnName,
241
+ filter_operator: 'equal',
242
+ filter_value: tabs.value,
243
+ },
244
+ tabAttrMeta,
245
+ );
246
+ if (tabCondition) {
247
+ dataWhere.push(tabCondition);
248
+ }
218
249
  }
219
250
  }
220
251
 
@@ -15,6 +15,8 @@ export class LayoutPreferenceService extends EntityServiceImpl {
15
15
  }
16
16
 
17
17
  async createEntity(entityData: BaseEntity, loggedInUser: UserData | null) {
18
+ console.log('lap api called', entityData);
19
+
18
20
  const { mapped_entity_type } = entityData as any;
19
21
  const userId = loggedInUser?.id;
20
22