@opengis/admin 0.2.106 → 0.2.108
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/{add-page-CdFX9g1D.js → add-page-DJypc83n.js} +1 -1
- package/dist/{admin-interface-CWlGQqkn.js → admin-interface-DvB3JMzi.js} +1 -1
- package/dist/{admin-view-CC2yQOiJ.js → admin-view-BLTvgWNq.js} +1 -1
- package/dist/admin.js +1 -1
- package/dist/admin.umd.cjs +6 -6
- package/dist/{card-view-Dv2DYL7T.js → card-view-6bg6w45v.js} +1 -1
- package/dist/{edit-page-WcZ56HXI.js → edit-page-Cn0OP8Go.js} +1 -1
- package/dist/{import-file-CtZ4FD_r.js → import-file-COxFpeUP.js} +1283 -1279
- package/package.json +1 -1
- package/server/routes/data/controllers/tableFilter.js +7 -2
package/package.json
CHANGED
@@ -7,7 +7,7 @@ export default async function tableFilter(req) {
|
|
7
7
|
const { uid } = user || {};
|
8
8
|
|
9
9
|
if (!params.name) {
|
10
|
-
return { message: 'not
|
10
|
+
return { message: 'not enough params: name', status: 400 };
|
11
11
|
}
|
12
12
|
|
13
13
|
const loadTable = await getTemplate('table', params.name);
|
@@ -65,6 +65,11 @@ export default async function tableFilter(req) {
|
|
65
65
|
Object.assign(el, { options });
|
66
66
|
}));
|
67
67
|
|
68
|
+
const sqlList = loadTable?.sql
|
69
|
+
?.filter((el) => !el.disabled && el?.sql?.replace)
|
70
|
+
?.map((el, i) => ` left join lateral (${el.filter ? el.sql.replace(/limit 1/ig, '') : el.sql}) as ${el.name || `t${i + 1}`} on 1=1 `)
|
71
|
+
?.join(' ') || '';
|
72
|
+
|
68
73
|
// percentile_cont - alternative
|
69
74
|
await Promise.all(filters.filter((el) => el.name && el.type === 'Range').map(async (el) => {
|
70
75
|
const data = await pg.queryCache(`select array[
|
@@ -73,7 +78,7 @@ export default async function tableFilter(req) {
|
|
73
78
|
percentile_disc(0.5) within group (order by ${el.name}),
|
74
79
|
percentile_disc(0.75) within group (order by ${el.name}),
|
75
80
|
max(${el.name})
|
76
|
-
] as range from ${loadTable.table} where ${loadTable.query || '1=1'}`, { table: loadTable.table }).then(el => el.rows?.[0]?.range);
|
81
|
+
] as range from ${loadTable.table} ${sqlList ? ` t ${sqlList}` : ''} where ${loadTable.query || '1=1'}`, { table: loadTable.table }).then(el => el.rows?.[0]?.range);
|
77
82
|
Object.assign(el, { data });
|
78
83
|
}));
|
79
84
|
|