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/dist/module/filter/service/filter.service.js +31 -8
- package/dist/module/filter/service/filter.service.js.map +1 -1
- package/dist/module/layout_preference/service/layout_preference.service.js +1 -0
- package/dist/module/layout_preference/service/layout_preference.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 +48 -17
- package/src/module/layout_preference/service/layout_preference.service.ts +2 -0
package/package.json
CHANGED
|
@@ -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
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
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
|
|