@things-factory/dataset 6.2.70 → 6.2.72

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.
Files changed (28) hide show
  1. package/client/pages/data-key-set/data-key-set-list-page.ts +6 -2
  2. package/client/pages/data-sample/data-sample-list-page.ts +4 -2
  3. package/client/pages/data-sample/data-sample-search-page.ts +4 -2
  4. package/client/pages/data-set/data-item-list.ts +7 -3
  5. package/client/pages/data-set/data-set-list-page.ts +58 -17
  6. package/client/pages/data-summary/data-summary-list-page.ts +33 -105
  7. package/client/pages/data-summary/data-summary-period-page.ts +5 -3
  8. package/dist-client/pages/data-key-set/data-key-set-list-page.js +6 -2
  9. package/dist-client/pages/data-key-set/data-key-set-list-page.js.map +1 -1
  10. package/dist-client/pages/data-sample/data-sample-list-page.js +4 -2
  11. package/dist-client/pages/data-sample/data-sample-list-page.js.map +1 -1
  12. package/dist-client/pages/data-sample/data-sample-search-page.js +4 -2
  13. package/dist-client/pages/data-sample/data-sample-search-page.js.map +1 -1
  14. package/dist-client/pages/data-set/data-item-list.js +6 -2
  15. package/dist-client/pages/data-set/data-item-list.js.map +1 -1
  16. package/dist-client/pages/data-set/data-set-list-page.js +58 -17
  17. package/dist-client/pages/data-set/data-set-list-page.js.map +1 -1
  18. package/dist-client/pages/data-summary/data-summary-list-page.js +33 -105
  19. package/dist-client/pages/data-summary/data-summary-list-page.js.map +1 -1
  20. package/dist-client/pages/data-summary/data-summary-period-page.js +4 -1
  21. package/dist-client/pages/data-summary/data-summary-period-page.js.map +1 -1
  22. package/dist-client/tsconfig.tsbuildinfo +1 -1
  23. package/package.json +4 -4
  24. package/translations/en.json +3 -0
  25. package/translations/ja.json +3 -0
  26. package/translations/ko.json +3 -0
  27. package/translations/ms.json +3 -0
  28. package/translations/zh.json +3 -0
@@ -144,11 +144,12 @@ export class DataKeySetListPage extends connect(store)(localize(i18next)(PageVie
144
144
  details: ['active', 'updatedAt']
145
145
  },
146
146
  columns: [
147
- { type: 'gutter', gutterName: 'sequence' },
148
- { type: 'gutter', gutterName: 'row-selector', multiple: true },
147
+ { type: 'gutter', gutterName: 'sequence', fixed: true },
148
+ { type: 'gutter', gutterName: 'row-selector', fixed: true, multiple: true },
149
149
  {
150
150
  type: 'gutter',
151
151
  gutterName: 'button',
152
+ fixed: true,
152
153
  icon: 'reorder',
153
154
  title: i18next.t('title.edit data-key items'),
154
155
  handlers: {
@@ -169,6 +170,7 @@ export class DataKeySetListPage extends connect(store)(localize(i18next)(PageVie
169
170
  {
170
171
  type: 'gutter',
171
172
  gutterName: 'button',
173
+ fixed: true,
172
174
  icon: 'checklist',
173
175
  title: i18next.t('title.open data sample search page'),
174
176
  handlers: {
@@ -180,6 +182,7 @@ export class DataKeySetListPage extends connect(store)(localize(i18next)(PageVie
180
182
  {
181
183
  type: 'gutter',
182
184
  gutterName: 'button',
185
+ fixed: true,
183
186
  icon: 'newspaper',
184
187
  title: i18next.t('title.open data sample report page'),
185
188
  handlers: {
@@ -215,6 +218,7 @@ export class DataKeySetListPage extends connect(store)(localize(i18next)(PageVie
215
218
  {
216
219
  type: 'string',
217
220
  name: 'name',
221
+ fixed: true,
218
222
  header: i18next.t('field.name'),
219
223
  record: {
220
224
  editable: true
@@ -98,11 +98,12 @@ export class DataSampleListPage extends connect(store)(localize(i18next)(PageVie
98
98
  this.gristConfig = {
99
99
  list: { fields: ['dataSet', 'data', 'updater', 'updatedAt'] },
100
100
  columns: [
101
- { type: 'gutter', gutterName: 'sequence' },
102
- { type: 'gutter', gutterName: 'row-selector', multiple: true },
101
+ { type: 'gutter', gutterName: 'sequence', fixed: true },
102
+ { type: 'gutter', gutterName: 'row-selector', fixed: true, multiple: true },
103
103
  {
104
104
  type: 'gutter',
105
105
  gutterName: 'button',
106
+ fixed: true,
106
107
  icon: 'assignment',
107
108
  title: i18next.t('title.open data sample view'),
108
109
  handlers: {
@@ -123,6 +124,7 @@ export class DataSampleListPage extends connect(store)(localize(i18next)(PageVie
123
124
  {
124
125
  type: 'string',
125
126
  name: 'name',
127
+ fixed: true,
126
128
  label: true,
127
129
  header: i18next.t('field.name'),
128
130
  record: {
@@ -160,11 +160,12 @@ export class DataSampleSearchPage extends connect(store)(localize(i18next)(PageV
160
160
  this.gristConfig = {
161
161
  list: { fields: ['dataSet', 'data', 'updater', 'updatedAt'] },
162
162
  columns: [
163
- { type: 'gutter', gutterName: 'sequence' },
164
- { type: 'gutter', gutterName: 'row-selector', multiple: true },
163
+ { type: 'gutter', gutterName: 'sequence', fixed: true },
164
+ { type: 'gutter', gutterName: 'row-selector', fixed: true, multiple: true },
165
165
  {
166
166
  type: 'gutter',
167
167
  gutterName: 'button',
168
+ fixed: true,
168
169
  icon: 'assignment',
169
170
  title: i18next.t('title.open data sample view'),
170
171
  handlers: {
@@ -185,6 +186,7 @@ export class DataSampleSearchPage extends connect(store)(localize(i18next)(PageV
185
186
  {
186
187
  type: 'string',
187
188
  name: 'name',
189
+ fixed: true,
188
190
  label: true,
189
191
  header: i18next.t('field.name'),
190
192
  record: {
@@ -6,7 +6,7 @@ import { customElement, property, query, state } from 'lit/decorators.js'
6
6
  import { client } from '@operato/graphql'
7
7
  import { i18next, localize } from '@operato/i18n'
8
8
  import { isMobileDevice } from '@operato/utils'
9
- import { ColumnConfig, DataGrist, FetchOption, SortersControl } from '@operato/data-grist'
9
+ import { DataGrist, FetchOption } from '@operato/data-grist'
10
10
 
11
11
  const DataItemStats = ['sum', 'mean', 'stddev', 'variance', 'min', 'max', 'range', 'median', 'mode']
12
12
 
@@ -64,19 +64,21 @@ class DataItemList extends localize(i18next)(LitElement) {
64
64
  this.gristConfig = {
65
65
  list: { fields: ['name', 'description', 'active'] },
66
66
  columns: [
67
- { type: 'gutter', gutterName: 'row-selector', multiple: true },
67
+ { type: 'gutter', gutterName: 'row-selector', fixed: true, multiple: true },
68
68
  {
69
69
  type: 'gutter',
70
70
  gutterName: 'button',
71
+ fixed: true,
71
72
  icon: 'add',
72
73
  handlers: {
73
74
  click: 'record-copy'
74
75
  }
75
76
  },
76
- { type: 'gutter', gutterName: 'sequence' },
77
+ { type: 'gutter', gutterName: 'sequence', fixed: true },
77
78
  {
78
79
  type: 'gutter',
79
80
  gutterName: 'button',
81
+ fixed: true,
80
82
  icon: 'arrow_upward',
81
83
  handlers: {
82
84
  click: 'move-up'
@@ -85,6 +87,7 @@ class DataItemList extends localize(i18next)(LitElement) {
85
87
  {
86
88
  type: 'gutter',
87
89
  gutterName: 'button',
90
+ fixed: true,
88
91
  icon: 'arrow_downward',
89
92
  handlers: {
90
93
  click: 'move-down'
@@ -93,6 +96,7 @@ class DataItemList extends localize(i18next)(LitElement) {
93
96
  {
94
97
  type: 'string',
95
98
  name: 'name',
99
+ fixed: true,
96
100
  header: i18next.t('field.name'),
97
101
  record: {
98
102
  editable: true
@@ -86,6 +86,8 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
86
86
 
87
87
  --grid-record-emphasized-background-color: red;
88
88
  --grid-record-emphasized-color: yellow;
89
+
90
+ --grid-header-padding: 2px 0 2px 9px;
89
91
  }
90
92
 
91
93
  ox-grist {
@@ -355,7 +357,7 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
355
357
  objectified: true /* transfered as a object type */
356
358
  }
357
359
  },
358
- width: 50
360
+ width: 80
359
361
  },
360
362
  {
361
363
  type: 'select',
@@ -419,7 +421,10 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
419
421
  {
420
422
  type: 'resource-object',
421
423
  name: 'supervisoryRole',
422
- header: i18next.t('field.supervisory-role'),
424
+ header: {
425
+ renderer: i18next.t('field.supervisory-role'),
426
+ group: i18next.t('field.role')
427
+ },
423
428
  record: {
424
429
  editable: true,
425
430
  options: {
@@ -433,7 +438,10 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
433
438
  {
434
439
  type: 'resource-object',
435
440
  name: 'entryRole',
436
- header: i18next.t('field.entry-role'),
441
+ header: {
442
+ renderer: i18next.t('field.entry-role'),
443
+ group: i18next.t('field.role')
444
+ },
437
445
  record: {
438
446
  editable: true,
439
447
  options: {
@@ -446,35 +454,47 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
446
454
  {
447
455
  type: 'assignees',
448
456
  name: 'assignees',
449
- header: i18next.t('field.assignees'),
457
+ header: {
458
+ renderer: i18next.t('field.assignees'),
459
+ group: i18next.t('field.role')
460
+ },
450
461
  record: {
451
462
  editable: true
452
463
  },
453
- width: 50
464
+ width: 80
454
465
  },
455
466
  {
456
467
  type: 'approval-line',
457
468
  name: 'reviewApprovalLine',
458
- header: i18next.t('field.review-approval-line'),
469
+ header: {
470
+ renderer: i18next.t('field.review-approval-line'),
471
+ group: i18next.t('field.role')
472
+ },
459
473
  record: {
460
474
  editable: true
461
475
  },
462
- width: 50
476
+ width: 80
463
477
  },
464
478
  {
465
479
  type: 'approval-line',
466
480
  name: 'outlierApprovalLine',
467
- header: i18next.t('field.outlier-approval-line'),
481
+ header: {
482
+ renderer: i18next.t('field.outlier-approval-line'),
483
+ group: i18next.t('field.role')
484
+ },
468
485
  record: {
469
486
  editable: true
470
487
  },
471
- width: 50
488
+ width: 80
472
489
  },
473
490
  {
474
491
  type: 'checkbox',
475
492
  name: 'requiresReview',
476
493
  label: true,
477
- header: i18next.t('field.requires-review'),
494
+ header: {
495
+ renderer: i18next.t('field.requires-review'),
496
+ group: i18next.t('field.role')
497
+ },
478
498
  record: {
479
499
  editable: true
480
500
  },
@@ -492,7 +512,10 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
492
512
  type: 'select',
493
513
  name: 'entryType',
494
514
  label: true,
495
- header: i18next.t('field.entry-type'),
515
+ header: {
516
+ renderer: i18next.t('field.entry-type'),
517
+ group: i18next.t('field.view')
518
+ },
496
519
  record: {
497
520
  editable: true,
498
521
  options: ENTRY_TYPES
@@ -502,7 +525,10 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
502
525
  {
503
526
  type: 'string',
504
527
  name: 'entryView',
505
- header: i18next.t('field.entry-view'),
528
+ header: {
529
+ renderer: i18next.t('field.entry-view'),
530
+ group: i18next.t('field.view')
531
+ },
506
532
  record: {
507
533
  editable: true,
508
534
  editor: function (value, column, record, rowIndex, field) {
@@ -520,7 +546,10 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
520
546
  type: 'select',
521
547
  name: 'monitorType',
522
548
  label: true,
523
- header: i18next.t('field.monitor-type'),
549
+ header: {
550
+ renderer: i18next.t('field.monitor-type'),
551
+ group: i18next.t('field.view')
552
+ },
524
553
  record: {
525
554
  editable: true,
526
555
  options: MONITOR_TYPES
@@ -530,7 +559,10 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
530
559
  {
531
560
  type: 'string',
532
561
  name: 'monitorView',
533
- header: i18next.t('field.monitor-view'),
562
+ header: {
563
+ renderer: i18next.t('field.monitor-view'),
564
+ group: i18next.t('field.view')
565
+ },
534
566
  record: {
535
567
  editable: true,
536
568
  editor: function (value, column, record, rowIndex, field) {
@@ -548,7 +580,10 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
548
580
  type: 'select',
549
581
  name: 'reportType',
550
582
  label: true,
551
- header: i18next.t('field.report-type'),
583
+ header: {
584
+ renderer: i18next.t('field.report-type'),
585
+ group: i18next.t('field.view')
586
+ },
552
587
  record: {
553
588
  editable: true,
554
589
  options: REPORT_TYPES
@@ -558,7 +593,10 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
558
593
  {
559
594
  type: 'string',
560
595
  name: 'reportView',
561
- header: i18next.t('field.report-view'),
596
+ header: {
597
+ renderer: i18next.t('field.report-view'),
598
+ group: i18next.t('field.view')
599
+ },
562
600
  record: {
563
601
  editable: true,
564
602
  editor: function (value, column, record, rowIndex, field) {
@@ -575,7 +613,10 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
575
613
  {
576
614
  type: 'file',
577
615
  name: 'reportTemplate',
578
- header: i18next.t('field.report-template'),
616
+ header: {
617
+ renderer: i18next.t('field.report-template'),
618
+ group: i18next.t('field.view')
619
+ },
579
620
  record: {
580
621
  editable: true
581
622
  },
@@ -29,6 +29,8 @@ export class DataSummaryListPage extends connect(store)(localize(i18next)(PageVi
29
29
 
30
30
  --grid-record-emphasized-background-color: red;
31
31
  --grid-record-emphasized-color: yellow;
32
+
33
+ --grid-header-padding: 2px 0 2px 9px;
32
34
  }
33
35
  `
34
36
  ]
@@ -164,111 +166,37 @@ export class DataSummaryListPage extends connect(store)(localize(i18next)(PageVi
164
166
  width: 60,
165
167
  imex: true
166
168
  },
167
- {
168
- type: 'string',
169
- name: 'key01',
170
- header: i18next.t('field.key-01'),
171
- record: {
172
- editable: false
173
- },
174
- sortable: true,
175
- width: 120,
176
- imex: true
177
- },
178
- {
179
- type: 'string',
180
- name: 'key02',
181
- header: i18next.t('field.key-02'),
182
- record: {
183
- editable: false
184
- },
185
- sortable: true,
186
- width: 120,
187
- imex: true
188
- },
189
- {
190
- type: 'string',
191
- name: 'key03',
192
- header: i18next.t('field.key-03'),
193
- record: {
194
- editable: false
195
- },
196
- sortable: true,
197
- width: 120,
198
- imex: true
199
- },
200
- {
201
- type: 'string',
202
- name: 'key04',
203
- header: i18next.t('field.key-04'),
204
- record: {
205
- editable: false
206
- },
207
- sortable: true,
208
- width: 120,
209
- imex: true
210
- },
211
- {
212
- type: 'string',
213
- name: 'key05',
214
- header: i18next.t('field.key-05'),
215
- record: {
216
- editable: false
217
- },
218
- sortable: true,
219
- width: 120,
220
- imex: true
221
- },
222
- {
223
- type: 'number',
224
- name: 'data01',
225
- header: i18next.t('field.data-01'),
226
- record: {
227
- editable: false
228
- },
229
- width: 120,
230
- imex: true
231
- },
232
- {
233
- type: 'number',
234
- name: 'data02',
235
- header: i18next.t('field.data-02'),
236
- record: {
237
- editable: false
238
- },
239
- width: 120,
240
- imex: true
241
- },
242
- {
243
- type: 'number',
244
- name: 'data03',
245
- header: i18next.t('field.data-03'),
246
- record: {
247
- editable: false
248
- },
249
- width: 120,
250
- imex: true
251
- },
252
- {
253
- type: 'number',
254
- name: 'data04',
255
- header: i18next.t('field.data-04'),
256
- record: {
257
- editable: false
258
- },
259
- width: 120,
260
- imex: true
261
- },
262
- {
263
- type: 'number',
264
- name: 'data05',
265
- header: i18next.t('field.data-05'),
266
- record: {
267
- editable: false
268
- },
269
- width: 120,
270
- imex: true
271
- },
169
+ ...Array.from({ length: 5 }, (_, idx) => {
170
+ return {
171
+ type: 'string',
172
+ name: `key0${idx + 1}`,
173
+ header: {
174
+ renderer: i18next.t(`field.key-0${idx + 1}`),
175
+ group: i18next.t('field.key')
176
+ },
177
+ record: {
178
+ editable: false
179
+ },
180
+ width: 120,
181
+ imex: true
182
+ }
183
+ }),
184
+ ...Array.from({ length: 5 }, (_, idx) => {
185
+ return {
186
+ type: 'number',
187
+ name: `data0${idx + 1}`,
188
+ header: {
189
+ renderer: i18next.t(`field.data-0${idx + 1}`),
190
+ group: i18next.t('field.data')
191
+ },
192
+ record: {
193
+ editable: false,
194
+ align: 'right'
195
+ },
196
+ width: 120,
197
+ imex: true
198
+ }
199
+ }),
272
200
  {
273
201
  type: 'number',
274
202
  name: 'count',
@@ -11,10 +11,9 @@ import { DataGrist, FetchOption, GristRecord } from '@operato/data-grist'
11
11
  import { client } from '@operato/graphql'
12
12
  import { i18next, localize } from '@operato/i18n'
13
13
  import { PageView, store } from '@operato/shell'
14
- import { CommonButtonStyles, CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'
14
+ import { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'
15
15
  import { isMobileDevice } from '@operato/utils'
16
16
  import { DataItem } from '@operato/dataset'
17
- import { openOverlay, TOOL_POSITION } from '@operato/layout'
18
17
 
19
18
  enum DataSetSummaryGroupType {
20
19
  Today = 'today',
@@ -265,10 +264,11 @@ export class DataSummaryGroupPage extends connect(store)(localize(i18next)(PageV
265
264
  this.gristConfig = {
266
265
  list: { fields: listFields },
267
266
  columns: [
268
- { type: 'gutter', gutterName: 'sequence' },
267
+ { type: 'gutter', gutterName: 'sequence', fixed: true },
269
268
  (this.period == DataSetSummaryGroupType.ThisYear || this.period == DataSetSummaryGroupType.TwelveMonths) && {
270
269
  type: 'string',
271
270
  name: 'month',
271
+ fixed: true,
272
272
  header: i18next.t('field.month'),
273
273
  label: true,
274
274
  width: 80,
@@ -279,6 +279,7 @@ export class DataSummaryGroupPage extends connect(store)(localize(i18next)(PageV
279
279
  this.period != DataSetSummaryGroupType.TwelveMonths && {
280
280
  type: 'string',
281
281
  name: 'date',
282
+ fixed: true,
282
283
  header: i18next.t('field.date'),
283
284
  label: true,
284
285
  sortable: true,
@@ -288,6 +289,7 @@ export class DataSummaryGroupPage extends connect(store)(localize(i18next)(PageV
288
289
  this.period == DataSetSummaryGroupType.Today && {
289
290
  type: 'string',
290
291
  name: 'period',
292
+ fixed: true,
291
293
  header: i18next.t('field.time-period'),
292
294
  label: true,
293
295
  sortable: true,
@@ -117,11 +117,12 @@ let DataKeySetListPage = class DataKeySetListPage extends connect(store)(localiz
117
117
  details: ['active', 'updatedAt']
118
118
  },
119
119
  columns: [
120
- { type: 'gutter', gutterName: 'sequence' },
121
- { type: 'gutter', gutterName: 'row-selector', multiple: true },
120
+ { type: 'gutter', gutterName: 'sequence', fixed: true },
121
+ { type: 'gutter', gutterName: 'row-selector', fixed: true, multiple: true },
122
122
  {
123
123
  type: 'gutter',
124
124
  gutterName: 'button',
125
+ fixed: true,
125
126
  icon: 'reorder',
126
127
  title: i18next.t('title.edit data-key items'),
127
128
  handlers: {
@@ -143,6 +144,7 @@ let DataKeySetListPage = class DataKeySetListPage extends connect(store)(localiz
143
144
  {
144
145
  type: 'gutter',
145
146
  gutterName: 'button',
147
+ fixed: true,
146
148
  icon: 'checklist',
147
149
  title: i18next.t('title.open data sample search page'),
148
150
  handlers: {
@@ -154,6 +156,7 @@ let DataKeySetListPage = class DataKeySetListPage extends connect(store)(localiz
154
156
  {
155
157
  type: 'gutter',
156
158
  gutterName: 'button',
159
+ fixed: true,
157
160
  icon: 'newspaper',
158
161
  title: i18next.t('title.open data sample report page'),
159
162
  handlers: {
@@ -190,6 +193,7 @@ let DataKeySetListPage = class DataKeySetListPage extends connect(store)(localiz
190
193
  {
191
194
  type: 'string',
192
195
  name: 'name',
196
+ fixed: true,
193
197
  header: i18next.t('field.name'),
194
198
  record: {
195
199
  editable: true
@@ -1 +1 @@
1
- {"version":3,"file":"data-key-set-list-page.js","sourceRoot":"","sources":["../../../client/pages/data-key-set/data-key-set-list-page.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAC5B,OAAO,6CAA6C,CAAA;AACpD,OAAO,4BAA4B,CAAA;AACnC,OAAO,sBAAsB,CAAA;AAE7B,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAY,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AAEnD,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAe,MAAM,qBAAqB,CAAA;AACpF,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAC1D,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACrE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAEhE,MAAM,YAAY,GAAG;IACnB;QACE,OAAO,EAAE,EAAE;QACX,KAAK,EAAE,EAAE;KACV;IACD;QACE,OAAO,EAAE,WAAW;QACpB,KAAK,EAAE,W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AC,KAAK,EAAE,CAAA;QACpB,CAAC;;OAEJ,EACD;YACE,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,2BAA2B,CAAC;SAC9C,CACF,CAAA;QAED,KAAK,CAAC,QAAQ,GAAG,GAAG,EAAE;YACpB,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAA;QACpB,CAAC,CAAA;IACH,CAAC;;AA1YM,yBAAM,GAAG;IACd,eAAe;IACf,kBAAkB;IAClB,GAAG,CAAA;;;;;;;;;;;;;;KAcF;CACF,CAAA;AAED;IAAC,KAAK,EAAE;;uDAAiB;AACzB;IAAC,KAAK,EAAE;;gDAAoE;AAE5E;IAAC,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;iDAAA;AAxBjC,kBAAkB;IAD9B,aAAa,CAAC,wBAAwB,CAAC;GAC3B,kBAAkB,CA4Y9B;SA5YY,kBAAkB","sourcesContent":["import '@operato/data-grist'\nimport '@operato/context/ox-context-page-toolbar.js'\nimport './data-key-set-importer.js'\nimport './data-key-item-list'\n\nimport gql from 'graphql-tag'\nimport { css, html } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { connect } from 'pwa-helpers/connect-mixin'\n\nimport { getEditor, getRenderer, DataGrist, FetchOption } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { notify, openPopup } from '@operato/layout'\nimport { navigate, PageView, store } from '@operato/shell'\nimport { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'\nimport { isMobileDevice, encodeUrlParams } from '@operato/utils'\n\nconst REPORT_TYPES = [\n {\n display: '',\n value: ''\n },\n {\n display: 'Generated',\n value: 'generated'\n },\n {\n display: 'Embed',\n value: 'embed'\n },\n {\n display: 'CustomElement',\n value: 'custom-element'\n },\n {\n display: 'Page',\n value: 'page'\n },\n {\n display: 'External URL',\n value: 'external'\n },\n {\n display: 'Jasper',\n value: 'jasper'\n },\n {\n display: 'Shiny',\n value: 'shiny'\n }\n]\n\n@customElement('data-key-set-list-page')\nexport class DataKeySetListPage extends connect(store)(localize(i18next)(PageView)) {\n static styles = [\n ScrollbarStyles,\n CommonHeaderStyles,\n css`\n :host {\n display: flex;\n\n width: 100%;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n ox-grist {\n overflow-y: auto;\n flex: 1;\n }\n `\n ]\n\n @state() gristConfig: any\n @state() mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'\n\n @query('ox-grist') private grist!: DataGrist\n\n get context() {\n return {\n title: i18next.t('title.data-key-set list'),\n search: {\n handler: (search: string) => {\n this.grist.searchText = search\n },\n value: this.grist?.searchText || ''\n },\n filter: {\n handler: () => {\n this.grist.toggleHeadroom()\n }\n },\n help: 'dataset/data-key-set',\n actions: [\n {\n title: i18next.t('button.save'),\n action: this._updateDataKeySet.bind(this),\n icon: 'save'\n },\n {\n title: i18next.t('button.delete'),\n action: this._deleteDataKeySet.bind(this),\n icon: 'delete'\n }\n ],\n exportable: {\n name: i18next.t('title.data-key-set list'),\n data: this.exportHandler.bind(this)\n },\n importable: {\n handler: this.importHandler.bind(this)\n },\n toolbar: false\n }\n }\n\n render() {\n const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID')\n\n return html`\n <ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>\n <div slot=\"headroom\" class=\"header\">\n <div class=\"title\">\n <mwc-icon>summarize</mwc-icon>\n ${i18next.t('title.data-key-set list')}\n </div>\n\n <div class=\"filters\">\n <ox-filters-form autofocus without-search></ox-filters-form>\n </div>\n\n <ox-context-page-toolbar class=\"actions\" .context=${this.context}> </ox-context-page-toolbar>\n </div>\n </ox-grist>\n `\n }\n\n async pageInitialized(lifecycle) {\n this.gristConfig = {\n list: {\n fields: ['name', 'description'],\n details: ['active', 'updatedAt']\n },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'reorder',\n title: i18next.t('title.edit data-key items'),\n handlers: {\n click: (columns, data, column, record, rowIndex) => {\n if (!record.id) return\n const popup = openPopup(html` <data-key-item-list .dataKeySet=${record}></data-key-item-list> `, {\n backdrop: true,\n help: 'dataset/ui/data-key-item-list',\n size: 'large',\n title: i18next.t('title.data-key-item list')\n })\n popup.onclosed = () => {\n this.grist.fetch()\n }\n }\n }\n },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'checklist',\n title: i18next.t('title.open data sample search page'),\n handlers: {\n click: (columns, data, column, record, rowIndex) => {\n navigate(`data-sample-search/${record.id}`)\n }\n }\n },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'newspaper',\n title: i18next.t('title.open data sample report page'),\n handlers: {\n click: (columns, data, column, record, rowIndex) => {\n try {\n const { id: dataKeySetId, reportType, reportView } = record\n switch (reportType) {\n case 'generated':\n break\n case 'custom-element':\n break\n case 'page':\n break\n case 'embed':\n break\n case 'external':\n reportView && window.open(reportView, '_blank')\n break\n case 'jasper':\n case 'shiny':\n const urlParams = encodeUrlParams({ dataKeySetId, reportType, reportView })\n navigate(`data-report-samples/?${urlParams}`)\n break\n default:\n break\n }\n } catch (ex) {\n console.log(ex)\n }\n }\n }\n },\n {\n type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n record: {\n editable: true\n },\n filter: 'search',\n sortable: true,\n width: 150\n },\n {\n type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n record: {\n editable: true\n },\n filter: 'search',\n width: 200\n },\n {\n type: 'checkbox',\n name: 'active',\n label: true,\n header: i18next.t('field.active'),\n record: {\n editable: true\n },\n filter: true,\n sortable: true,\n width: 60\n },\n {\n type: 'select',\n name: 'reportType',\n label: true,\n header: i18next.t('field.report-type'),\n record: {\n editable: true,\n options: REPORT_TYPES\n },\n width: 80\n },\n {\n type: 'string',\n name: 'reportView',\n header: i18next.t('field.report-view'),\n record: {\n editable: true,\n editor: function (value, column, record, rowIndex, field) {\n var type = record.reportType !== 'custom' ? 'string' : 'script'\n return getEditor(type)(value, column, record, rowIndex, field)\n },\n renderer: function (value, column, record, rowIndex, field) {\n var type = record.reportType !== 'custom' ? 'string' : 'string'\n return getRenderer(type)(value, column, record, rowIndex, field)\n }\n },\n width: 140\n },\n {\n type: 'resource-object',\n name: 'updater',\n header: i18next.t('field.updater'),\n record: {\n editable: false\n },\n sortable: true,\n width: 120\n },\n {\n type: 'datetime',\n name: 'updatedAt',\n header: i18next.t('field.updated_at'),\n record: {\n editable: false\n },\n sortable: true,\n width: 180\n }\n ],\n rows: {\n selectable: {\n multiple: true\n }\n },\n sorters: [\n {\n name: 'name'\n }\n ]\n }\n }\n\n async pageUpdated(changes, lifecycle) {\n if (this.active) {\n // do something here when this page just became as active\n }\n }\n\n async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n responses: dataKeySets(filters: $filters, pagination: $pagination, sortings: $sortings) {\n items {\n id\n name\n description\n active\n reportType\n reportView\n dataKeyItems {\n name\n description\n dataKey\n tKey\n }\n updater {\n id\n name\n }\n updatedAt\n }\n total\n }\n }\n `,\n variables: {\n filters,\n pagination: { page, limit },\n sortings\n }\n })\n\n return {\n total: response.data.responses.total || 0,\n records: response.data.responses.items || []\n }\n }\n\n async _deleteDataKeySet() {\n if (confirm(i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }))) {\n const ids = this.grist.selected.map(record => record.id)\n if (ids && ids.length > 0) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($ids: [String!]!) {\n deleteDataKeySets(ids: $ids)\n }\n `,\n variables: {\n ids\n }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n notify({\n message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })\n })\n }\n }\n }\n }\n\n async _updateDataKeySet() {\n let patches = this.grist.dirtyRecords\n if (patches && patches.length) {\n patches = patches.map(patch => {\n let patchField: any = patch.id ? { id: patch.id } : {}\n const dirtyFields = patch.__dirtyfields__\n for (let key in dirtyFields) {\n patchField[key] = dirtyFields[key].after\n }\n patchField.cuFlag = patch.__dirty__\n\n return patchField\n })\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($patches: [DataKeySetPatch!]!) {\n updateMultipleDataKeySet(patches: $patches) {\n name\n }\n }\n `,\n variables: {\n patches\n }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n }\n }\n }\n\n async exportHandler() {\n const exportTargets = this.grist.selected.length ? this.grist.selected : this.grist.dirtyData.records\n const targetFieldSet = new Set(['id', 'name', 'description', 'active', 'reportType', 'reportView'])\n\n return exportTargets.map(dataKeySet => {\n let tempObj = {}\n for (const field of targetFieldSet) {\n tempObj[field] = dataKeySet[field]\n }\n\n return tempObj\n })\n }\n\n async importHandler(records) {\n const popup = openPopup(\n html`\n <data-key-set-importer\n .dataKeySets=${records}\n @imported=${() => {\n history.back()\n this.grist.fetch()\n }}\n ></data-key-set-importer>\n `,\n {\n backdrop: true,\n size: 'large',\n title: i18next.t('title.import data-key-set')\n }\n )\n\n popup.onclosed = () => {\n this.grist.fetch()\n }\n }\n}\n"]}
1
+ {"version":3,"file":"data-key-set-list-page.js","sourceRoot":"","sources":["../../../client/pages/data-key-set/data-key-set-list-page.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAC5B,OAAO,6CAA6C,CAAA;AACpD,OAAO,4BAA4B,CAAA;AACnC,OAAO,sBAAsB,CAAA;AAE7B,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAY,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2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AAS;iDAAA;AAxBjC,kBAAkB;IAD9B,aAAa,CAAC,wBAAwB,CAAC;GAC3B,kBAAkB,CAgZ9B;SAhZY,kBAAkB","sourcesContent":["import '@operato/data-grist'\nimport '@operato/context/ox-context-page-toolbar.js'\nimport './data-key-set-importer.js'\nimport './data-key-item-list'\n\nimport gql from 'graphql-tag'\nimport { css, html } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { connect } from 'pwa-helpers/connect-mixin'\n\nimport { getEditor, getRenderer, DataGrist, FetchOption } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { notify, openPopup } from '@operato/layout'\nimport { navigate, PageView, store } from '@operato/shell'\nimport { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'\nimport { isMobileDevice, encodeUrlParams } from '@operato/utils'\n\nconst REPORT_TYPES = [\n {\n display: '',\n value: ''\n },\n {\n display: 'Generated',\n value: 'generated'\n },\n {\n display: 'Embed',\n value: 'embed'\n },\n {\n display: 'CustomElement',\n value: 'custom-element'\n },\n {\n display: 'Page',\n value: 'page'\n },\n {\n display: 'External URL',\n value: 'external'\n },\n {\n display: 'Jasper',\n value: 'jasper'\n },\n {\n display: 'Shiny',\n value: 'shiny'\n }\n]\n\n@customElement('data-key-set-list-page')\nexport class DataKeySetListPage extends connect(store)(localize(i18next)(PageView)) {\n static styles = [\n ScrollbarStyles,\n CommonHeaderStyles,\n css`\n :host {\n display: flex;\n\n width: 100%;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n ox-grist {\n overflow-y: auto;\n flex: 1;\n }\n `\n ]\n\n @state() gristConfig: any\n @state() mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'\n\n @query('ox-grist') private grist!: DataGrist\n\n get context() {\n return {\n title: i18next.t('title.data-key-set list'),\n search: {\n handler: (search: string) => {\n this.grist.searchText = search\n },\n value: this.grist?.searchText || ''\n },\n filter: {\n handler: () => {\n this.grist.toggleHeadroom()\n }\n },\n help: 'dataset/data-key-set',\n actions: [\n {\n title: i18next.t('button.save'),\n action: this._updateDataKeySet.bind(this),\n icon: 'save'\n },\n {\n title: i18next.t('button.delete'),\n action: this._deleteDataKeySet.bind(this),\n icon: 'delete'\n }\n ],\n exportable: {\n name: i18next.t('title.data-key-set list'),\n data: this.exportHandler.bind(this)\n },\n importable: {\n handler: this.importHandler.bind(this)\n },\n toolbar: false\n }\n }\n\n render() {\n const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID')\n\n return html`\n <ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>\n <div slot=\"headroom\" class=\"header\">\n <div class=\"title\">\n <mwc-icon>summarize</mwc-icon>\n ${i18next.t('title.data-key-set list')}\n </div>\n\n <div class=\"filters\">\n <ox-filters-form autofocus without-search></ox-filters-form>\n </div>\n\n <ox-context-page-toolbar class=\"actions\" .context=${this.context}> </ox-context-page-toolbar>\n </div>\n </ox-grist>\n `\n }\n\n async pageInitialized(lifecycle) {\n this.gristConfig = {\n list: {\n fields: ['name', 'description'],\n details: ['active', 'updatedAt']\n },\n columns: [\n { type: 'gutter', gutterName: 'sequence', fixed: true },\n { type: 'gutter', gutterName: 'row-selector', fixed: true, multiple: true },\n {\n type: 'gutter',\n gutterName: 'button',\n fixed: true,\n icon: 'reorder',\n title: i18next.t('title.edit data-key items'),\n handlers: {\n click: (columns, data, column, record, rowIndex) => {\n if (!record.id) return\n const popup = openPopup(html` <data-key-item-list .dataKeySet=${record}></data-key-item-list> `, {\n backdrop: true,\n help: 'dataset/ui/data-key-item-list',\n size: 'large',\n title: i18next.t('title.data-key-item list')\n })\n popup.onclosed = () => {\n this.grist.fetch()\n }\n }\n }\n },\n {\n type: 'gutter',\n gutterName: 'button',\n fixed: true,\n icon: 'checklist',\n title: i18next.t('title.open data sample search page'),\n handlers: {\n click: (columns, data, column, record, rowIndex) => {\n navigate(`data-sample-search/${record.id}`)\n }\n }\n },\n {\n type: 'gutter',\n gutterName: 'button',\n fixed: true,\n icon: 'newspaper',\n title: i18next.t('title.open data sample report page'),\n handlers: {\n click: (columns, data, column, record, rowIndex) => {\n try {\n const { id: dataKeySetId, reportType, reportView } = record\n switch (reportType) {\n case 'generated':\n break\n case 'custom-element':\n break\n case 'page':\n break\n case 'embed':\n break\n case 'external':\n reportView && window.open(reportView, '_blank')\n break\n case 'jasper':\n case 'shiny':\n const urlParams = encodeUrlParams({ dataKeySetId, reportType, reportView })\n navigate(`data-report-samples/?${urlParams}`)\n break\n default:\n break\n }\n } catch (ex) {\n console.log(ex)\n }\n }\n }\n },\n {\n type: 'string',\n name: 'name',\n fixed: true,\n header: i18next.t('field.name'),\n record: {\n editable: true\n },\n filter: 'search',\n sortable: true,\n width: 150\n },\n {\n type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n record: {\n editable: true\n },\n filter: 'search',\n width: 200\n },\n {\n type: 'checkbox',\n name: 'active',\n label: true,\n header: i18next.t('field.active'),\n record: {\n editable: true\n },\n filter: true,\n sortable: true,\n width: 60\n },\n {\n type: 'select',\n name: 'reportType',\n label: true,\n header: i18next.t('field.report-type'),\n record: {\n editable: true,\n options: REPORT_TYPES\n },\n width: 80\n },\n {\n type: 'string',\n name: 'reportView',\n header: i18next.t('field.report-view'),\n record: {\n editable: true,\n editor: function (value, column, record, rowIndex, field) {\n var type = record.reportType !== 'custom' ? 'string' : 'script'\n return getEditor(type)(value, column, record, rowIndex, field)\n },\n renderer: function (value, column, record, rowIndex, field) {\n var type = record.reportType !== 'custom' ? 'string' : 'string'\n return getRenderer(type)(value, column, record, rowIndex, field)\n }\n },\n width: 140\n },\n {\n type: 'resource-object',\n name: 'updater',\n header: i18next.t('field.updater'),\n record: {\n editable: false\n },\n sortable: true,\n width: 120\n },\n {\n type: 'datetime',\n name: 'updatedAt',\n header: i18next.t('field.updated_at'),\n record: {\n editable: false\n },\n sortable: true,\n width: 180\n }\n ],\n rows: {\n selectable: {\n multiple: true\n }\n },\n sorters: [\n {\n name: 'name'\n }\n ]\n }\n }\n\n async pageUpdated(changes, lifecycle) {\n if (this.active) {\n // do something here when this page just became as active\n }\n }\n\n async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n responses: dataKeySets(filters: $filters, pagination: $pagination, sortings: $sortings) {\n items {\n id\n name\n description\n active\n reportType\n reportView\n dataKeyItems {\n name\n description\n dataKey\n tKey\n }\n updater {\n id\n name\n }\n updatedAt\n }\n total\n }\n }\n `,\n variables: {\n filters,\n pagination: { page, limit },\n sortings\n }\n })\n\n return {\n total: response.data.responses.total || 0,\n records: response.data.responses.items || []\n }\n }\n\n async _deleteDataKeySet() {\n if (confirm(i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }))) {\n const ids = this.grist.selected.map(record => record.id)\n if (ids && ids.length > 0) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($ids: [String!]!) {\n deleteDataKeySets(ids: $ids)\n }\n `,\n variables: {\n ids\n }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n notify({\n message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })\n })\n }\n }\n }\n }\n\n async _updateDataKeySet() {\n let patches = this.grist.dirtyRecords\n if (patches && patches.length) {\n patches = patches.map(patch => {\n let patchField: any = patch.id ? { id: patch.id } : {}\n const dirtyFields = patch.__dirtyfields__\n for (let key in dirtyFields) {\n patchField[key] = dirtyFields[key].after\n }\n patchField.cuFlag = patch.__dirty__\n\n return patchField\n })\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($patches: [DataKeySetPatch!]!) {\n updateMultipleDataKeySet(patches: $patches) {\n name\n }\n }\n `,\n variables: {\n patches\n }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n }\n }\n }\n\n async exportHandler() {\n const exportTargets = this.grist.selected.length ? this.grist.selected : this.grist.dirtyData.records\n const targetFieldSet = new Set(['id', 'name', 'description', 'active', 'reportType', 'reportView'])\n\n return exportTargets.map(dataKeySet => {\n let tempObj = {}\n for (const field of targetFieldSet) {\n tempObj[field] = dataKeySet[field]\n }\n\n return tempObj\n })\n }\n\n async importHandler(records) {\n const popup = openPopup(\n html`\n <data-key-set-importer\n .dataKeySets=${records}\n @imported=${() => {\n history.back()\n this.grist.fetch()\n }}\n ></data-key-set-importer>\n `,\n {\n backdrop: true,\n size: 'large',\n title: i18next.t('title.import data-key-set')\n }\n )\n\n popup.onclosed = () => {\n this.grist.fetch()\n }\n }\n}\n"]}