@opengis/gis 0.1.34 → 0.1.36

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.
@@ -0,0 +1,22 @@
1
+ [
2
+ {
3
+ "id": "1",
4
+ "text": "Шаблон 1"
5
+ },
6
+ {
7
+ "id": "2",
8
+ "text": "Шаблон 2"
9
+ },
10
+ {
11
+ "id": "3",
12
+ "text": "Шаблон 3"
13
+ },
14
+ {
15
+ "id": "4",
16
+ "text": "Шаблон 4"
17
+ },
18
+ {
19
+ "id": "5",
20
+ "text": "Шаблон 5"
21
+ }
22
+ ]
@@ -46,23 +46,27 @@
46
46
  "col": 6,
47
47
  "type": "Tags"
48
48
  },
49
- "is_public": {
50
- "ua": "Чи публічний реєстр?",
49
+ "view": {
50
+ "ua": "Вигляд реєстру",
51
51
  "col": 6,
52
- "type": "Switcher",
53
- "data": "yes_no",
52
+ "defaultValue": "1",
53
+ "data": "view",
54
+ "type": "Autocomplete",
54
55
  "validators": [
55
56
  "required"
56
57
  ]
57
58
  },
59
+ "is_public": {
60
+ "ua": "Чи публічний реєстр?",
61
+ "col": 6,
62
+ "type": "Switcher",
63
+ "data": "yes_no"
64
+ },
58
65
  "is_active": {
59
66
  "ua": "Чи активний?",
60
67
  "col": 6,
61
68
  "type": "Switcher",
62
- "data": "yes_no",
63
- "validators": [
64
- "required"
65
- ]
69
+ "data": "yes_no"
66
70
  },
67
71
  "image": {
68
72
  "ua": "Фото",
@@ -131,13 +135,21 @@
131
135
  "type": "HTML",
132
136
  "title": "Структура реєстру",
133
137
  "text": "<h2 class='text-xl font-bold text-left'>Структура реєстру</h2>",
134
- "conditions": ["table_name","!=","null"],
138
+ "conditions": [
139
+ "table_name",
140
+ "!=",
141
+ "null"
142
+ ],
135
143
  "col": 12
136
144
  },
137
145
  "columns": {
138
146
  "type": "DataTable",
139
147
  "ua": "Колонки",
140
- "conditions": ["table_name","!=","null"],
148
+ "conditions": [
149
+ "table_name",
150
+ "!=",
151
+ "null"
152
+ ],
141
153
  "colModel": [
142
154
  {
143
155
  "key": "name",
@@ -147,7 +159,7 @@
147
159
  "ua": "Назва колонки в БД",
148
160
  "i": "Для працездатності випадаючого списку оберіть табличку в БД вище",
149
161
  "behavior": {
150
- "set" : {
162
+ "set": {
151
163
  "ua": "comment"
152
164
  }
153
165
  },
@@ -184,7 +196,15 @@
184
196
  {
185
197
  "key": "data",
186
198
  "ua": "Класифікатор",
187
- "conditions": ["format","in",["select","badge","tags"]],
199
+ "conditions": [
200
+ "format",
201
+ "in",
202
+ [
203
+ "select",
204
+ "badge",
205
+ "tags"
206
+ ]
207
+ ],
188
208
  "type": "Text"
189
209
  },
190
210
  {
@@ -213,7 +233,11 @@
213
233
  "filters": {
214
234
  "type": "DataTable",
215
235
  "ua": "Фільтри",
216
- "conditions": ["table_name","!=","null"],
236
+ "conditions": [
237
+ "table_name",
238
+ "!=",
239
+ "null"
240
+ ],
217
241
  "colModel": [
218
242
  {
219
243
  "key": "id",
@@ -223,7 +247,7 @@
223
247
  "ua": "Назва колонки в БД",
224
248
  "i": "Для працездатності випадаючого списку оберіть табличку в БД вище",
225
249
  "behavior": {
226
- "set" : {
250
+ "set": {
227
251
  "label": "comment"
228
252
  }
229
253
  },
@@ -252,7 +276,14 @@
252
276
  "key": "data",
253
277
  "type": "Text",
254
278
  "ua": "Класифікатор",
255
- "conditions": ["type","in",["Autocomplete","Check"]]
279
+ "conditions": [
280
+ "type",
281
+ "in",
282
+ [
283
+ "Autocomplete",
284
+ "Check"
285
+ ]
286
+ ]
256
287
  },
257
288
  {
258
289
  "key": "disabled",
@@ -268,4 +299,4 @@
268
299
  ]
269
300
  }
270
301
  }
271
- }
302
+ }
@@ -20,6 +20,12 @@
20
20
  },
21
21
  "title": "Реєстри",
22
22
  "form": "gis.registers.form",
23
+ "sql": [
24
+ {
25
+ "name": "is_export_sql",
26
+ "sql": "select jsonb_path_exists(columns, '$[*] ? (@.is_export == true)') as is_export"
27
+ }
28
+ ],
23
29
  "columns": [
24
30
  {
25
31
  "ua": "Назва",
@@ -58,6 +64,12 @@
58
64
  "ua": "Аліас реєстру",
59
65
  "name": "register_key",
60
66
  "format": "text"
67
+ },
68
+ {
69
+ "ua": "Наявність колонок для експорту",
70
+ "name": "is_export",
71
+ "data": "yes_no",
72
+ "format": "badge"
61
73
  }
62
74
  ],
63
75
  "filterList": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/gis",
3
- "version": "0.1.34",
3
+ "version": "0.1.36",
4
4
  "type": "module",
5
5
  "author": "Softpro",
6
6
  "main": "dist/import-file.js",
@@ -57,4 +57,4 @@
57
57
  "sass-embedded": "1.86.3",
58
58
  "vite": "^6.3.5"
59
59
  }
60
- }
60
+ }
@@ -3,7 +3,7 @@ import { extractVisibleColumns } from './columns.js';
3
3
  import { getMeta, getFilterSQL } from "@opengis/fastify-table/utils.js";
4
4
 
5
5
  export async function handleRegistryRequest({ settings, query, object_id, offset = 0, limit = 16, page = 1, pg }) {
6
- const { name, table_name, columns, filters, query: whereQuery, order, pk, register_id, is_files } = settings;
6
+ const { name, table_name, columns, filters, query: whereQuery, order, pk, register_id, is_files, view } = settings;
7
7
  const parsedColumns = Array.isArray(columns) ? columns : JSON.parse(columns);
8
8
  const filtersParsed = Array.isArray(filters) ? filters : JSON.parse(filters);
9
9
  const activeFilters = filtersParsed.filter((f) => f.disabled !== true);
@@ -93,6 +93,7 @@ export async function handleRegistryRequest({ settings, query, object_id, offset
93
93
  filters: activeFilters,
94
94
  limit,
95
95
  page,
96
+ view,
96
97
  config: {
97
98
  listConfig
98
99
  }
@@ -19,7 +19,7 @@ export default async function gisRegistry({
19
19
  const {
20
20
  rows: [registry],
21
21
  } = await pg.query(
22
- `SELECT register_id, name, table_name, columns, filters, query, "order", pk, register_key, is_files
22
+ `SELECT register_id, name, table_name, columns, filters, query, "order", pk, register_key, is_files, view
23
23
  FROM gis.registers
24
24
  WHERE register_key = $1`,
25
25
  [slug]
@@ -38,19 +38,19 @@ export default async function mapFormat(req, reply) {
38
38
  }
39
39
  }
40
40
 
41
- let source_path, attributes, tpl;
41
+ let source_path, attributes, tpl, cardInterface;
42
42
  if (service) {
43
- ({ source_path, attributes } = service);
43
+ ({ source_path, attributes, interface: cardInterface } = service);
44
44
  } else {
45
45
  // git
46
46
  tpl = await getTemplate('map', map);
47
47
  const matchedLayer = tpl?.layers?.find(l => l.id === layer || l.service === layer);
48
48
  if (!matchedLayer || !matchedLayer.source_path || !matchedLayer.card) {
49
49
  return reply.status(404).send('template not found');
50
- }
51
-
50
+ };
52
51
  source_path = matchedLayer.source_path;
53
52
  attributes = matchedLayer.card;
53
+
54
54
  }
55
55
 
56
56
  const columns = attributes;
@@ -101,11 +101,16 @@ export default async function mapFormat(req, reply) {
101
101
 
102
102
  const html = `<dl class="divide-y divide-gray-100 py-[5px]">${result.join('')}</dl>`;
103
103
 
104
- return {
104
+ const res = {
105
105
  time: Date.now() - time,
106
106
  id,
107
107
  rows: fullRow,
108
108
  columns,
109
109
  html
110
110
  };
111
+ if (service) {
112
+ res.cardInterface = cardInterface;
113
+ }
114
+
115
+ return res;
111
116
  }