rez_core 5.0.210 → 5.0.211
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
|
@@ -26,8 +26,7 @@ export class FilterService {
|
|
|
26
26
|
@Inject() protected readonly loggingService: LoggingService,
|
|
27
27
|
private readonly configService: ConfigService,
|
|
28
28
|
private readonly reflectionHelper: ReflectionHelper,
|
|
29
|
-
) {
|
|
30
|
-
}
|
|
29
|
+
) {}
|
|
31
30
|
|
|
32
31
|
schema = this.configService.get('DB_SCHEMA');
|
|
33
32
|
|
|
@@ -82,7 +81,6 @@ export class FilterService {
|
|
|
82
81
|
GROUP BY ${column}
|
|
83
82
|
`;
|
|
84
83
|
|
|
85
|
-
|
|
86
84
|
const rows = await this.entityManager.query(rawSQL, values);
|
|
87
85
|
|
|
88
86
|
const total = rows.reduce(
|
|
@@ -284,7 +282,6 @@ export class FilterService {
|
|
|
284
282
|
|
|
285
283
|
// Handle TEMPLATE entity special condition
|
|
286
284
|
if (entity_type === 'TEMP' || entity_type === 'TEM') {
|
|
287
|
-
|
|
288
285
|
if (level_type === 'ORG') {
|
|
289
286
|
baseWhere.push({
|
|
290
287
|
query: ` ((e.level_type = 'ORG' AND e.level_id = '${loggedInUser.enterprise_id}'))`,
|
|
@@ -325,8 +322,7 @@ export class FilterService {
|
|
|
325
322
|
!customLevelId
|
|
326
323
|
) {
|
|
327
324
|
baseWhere.push({
|
|
328
|
-
query:
|
|
329
|
-
'e.level_type = :level_type AND e.level_id = :level_id',
|
|
325
|
+
query: 'e.level_type = :level_type AND e.level_id = :level_id',
|
|
330
326
|
params: {
|
|
331
327
|
level_type,
|
|
332
328
|
level_id,
|
|
@@ -694,30 +690,28 @@ export class FilterService {
|
|
|
694
690
|
layoutPreference: any,
|
|
695
691
|
tabs: any,
|
|
696
692
|
) {
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
693
|
+
const sorting = layoutPreference?.mapped_json?.sorting;
|
|
694
|
+
|
|
695
|
+
if (sorting) {
|
|
696
|
+
if (Array.isArray(sorting?.tabs)) {
|
|
697
|
+
const preferenceTabArray = sorting?.tabs;
|
|
701
698
|
const tabFilter = preferenceTabArray.find(
|
|
702
|
-
(tabData) => tabData.tab_name === tabs?.value,
|
|
699
|
+
(tabData) => tabData.tab_name?.value === tabs?.value,
|
|
703
700
|
);
|
|
704
|
-
|
|
701
|
+
|
|
702
|
+
tabFilter?.sortby?.forEach(({ column, order }) => {
|
|
703
|
+
qb.addOrderBy(
|
|
704
|
+
`e.${column}`,
|
|
705
|
+
order?.toUpperCase() === 'DSC' ? 'DESC' : 'ASC',
|
|
706
|
+
);
|
|
707
|
+
});
|
|
708
|
+
} else if (Array.isArray(sorting.sortby)) {
|
|
709
|
+
sorting?.sortby?.forEach(({ column, order }) => {
|
|
705
710
|
qb.addOrderBy(
|
|
706
711
|
`e.${column}`,
|
|
707
712
|
order?.toUpperCase() === 'DSC' ? 'DESC' : 'ASC',
|
|
708
713
|
);
|
|
709
714
|
});
|
|
710
|
-
} else if (
|
|
711
|
-
Array.isArray(layoutPreference[0]?.mapped_json?.sorting?.sortby)
|
|
712
|
-
) {
|
|
713
|
-
layoutPreference[0]?.mapped_json?.sorting?.sortby?.forEach(
|
|
714
|
-
({ column, order }) => {
|
|
715
|
-
qb.addOrderBy(
|
|
716
|
-
`e.${column}`,
|
|
717
|
-
order?.toUpperCase() === 'DSC' ? 'DESC' : 'ASC',
|
|
718
|
-
);
|
|
719
|
-
},
|
|
720
|
-
);
|
|
721
715
|
}
|
|
722
716
|
}
|
|
723
717
|
|