@things-factory/dataset 6.0.25 → 6.0.28
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/README.md +26 -11
- package/assets/images/data-collect.png +0 -0
- package/assets/images/ooc.png +0 -0
- package/assets/images/oos.png +0 -0
- package/client/{bootstrap.js → bootstrap.ts} +5 -1
- package/client/components/data-collect-activity-view.ts +100 -0
- package/client/components/{data-entry-form.js → data-entry-form.ts} +30 -33
- package/client/components/ooc-resolve-activity-view.ts +174 -0
- package/client/components/ooc-review-activity-view.ts +153 -0
- package/client/pages/data-archive/{data-archive-list-page.js → data-archive-list-page.ts} +67 -53
- package/client/pages/data-archive/{data-archive-request-popup.js → data-archive-request-popup.ts} +41 -39
- package/client/pages/data-entry/{data-entry-list-page.js → data-entry-list-page.ts} +41 -38
- package/client/pages/data-key-set/{data-key-item-list.js → data-key-item-list.ts} +31 -39
- package/client/pages/data-key-set/data-key-set-importer.ts +95 -0
- package/client/pages/data-key-set/{data-key-set-list-page.js → data-key-set-list-page.ts} +54 -35
- package/client/pages/data-ooc/{data-ooc-list-page.js → data-ooc-list-page.ts} +56 -36
- package/client/pages/data-ooc/data-ooc-view-page.ts +115 -0
- package/client/pages/data-ooc/data-ooc-view.ts +124 -0
- package/client/pages/data-report/{data-report-embed-page.js → data-report-embed-page.ts} +25 -34
- package/client/pages/data-report/{data-report-list-page.js → data-report-list-page.ts} +49 -43
- package/client/pages/data-report/{data-report-samples-page.js → data-report-samples-page.ts} +29 -43
- package/client/pages/data-report/{jasper-report-oocs-page.js → jasper-report-oocs-page.ts} +22 -34
- package/client/pages/data-report/{jasper-report-samples-crosstab-page.js → jasper-report-samples-crosstab-page.ts} +22 -34
- package/client/pages/data-report/{jasper-report-samples-page.js → jasper-report-samples-page.ts} +22 -34
- package/client/pages/data-sample/{data-sample-list-page.js → data-sample-list-page.ts} +49 -36
- package/client/pages/data-sample/{data-sample-search-page.js → data-sample-search-page.ts} +53 -39
- package/client/pages/data-sample/{data-sample-view.js → data-sample-view.ts} +29 -33
- package/client/pages/data-sensor/{data-sensor-list-page.js → data-sensor-list-page.ts} +41 -35
- package/client/pages/data-set/{data-item-list.js → data-item-list.ts} +31 -37
- package/client/pages/data-set/data-set-importer.ts +96 -0
- package/client/pages/data-set/{data-set-list-page.js → data-set-list-page.ts} +173 -40
- package/client/{route.js → route.ts} +5 -1
- package/client/tsconfig.json +11 -0
- package/config/config.development.js +30 -30
- package/config/config.production.js +31 -31
- package/dist-client/bootstrap.d.ts +5 -0
- package/dist-client/bootstrap.js +16 -0
- package/dist-client/bootstrap.js.map +1 -0
- package/dist-client/components/data-collect-activity-view.d.ts +19 -0
- package/dist-client/components/data-collect-activity-view.js +101 -0
- package/dist-client/components/data-collect-activity-view.js.map +1 -0
- package/dist-client/components/data-entry-form.d.ts +15 -0
- package/dist-client/components/data-entry-form.js +83 -0
- package/dist-client/components/data-entry-form.js.map +1 -0
- package/dist-client/components/data-ooc-activity-view.d.ts +1 -0
- package/dist-client/components/data-ooc-activity-view.js +154 -0
- package/dist-client/components/data-ooc-activity-view.js.map +1 -0
- package/dist-client/components/ooc-resolve-activity-view.d.ts +1 -0
- package/dist-client/components/ooc-resolve-activity-view.js +175 -0
- package/dist-client/components/ooc-resolve-activity-view.js.map +1 -0
- package/dist-client/components/ooc-review-activity-view.d.ts +1 -0
- package/dist-client/components/ooc-review-activity-view.js +155 -0
- package/dist-client/components/ooc-review-activity-view.js.map +1 -0
- package/dist-client/index.d.ts +1 -0
- package/dist-client/index.js +2 -0
- package/dist-client/index.js.map +1 -0
- package/dist-client/pages/data-archive/data-archive-list-page.d.ts +71 -0
- package/dist-client/pages/data-archive/data-archive-list-page.js +287 -0
- package/dist-client/pages/data-archive/data-archive-list-page.js.map +1 -0
- package/dist-client/pages/data-archive/data-archive-request-popup.d.ts +1 -0
- package/dist-client/pages/data-archive/data-archive-request-popup.js +161 -0
- package/dist-client/pages/data-archive/data-archive-request-popup.js.map +1 -0
- package/dist-client/pages/data-entry/data-entry-list-page.d.ts +36 -0
- package/dist-client/pages/data-entry/data-entry-list-page.js +383 -0
- package/dist-client/pages/data-entry/data-entry-list-page.js.map +1 -0
- package/dist-client/pages/data-key-set/data-key-item-list.d.ts +18 -0
- package/dist-client/pages/data-key-set/data-key-item-list.js +188 -0
- package/dist-client/pages/data-key-set/data-key-item-list.js.map +1 -0
- package/dist-client/pages/data-key-set/data-key-set-importer.d.ts +9 -0
- package/dist-client/pages/data-key-set/data-key-set-importer.js +100 -0
- package/dist-client/pages/data-key-set/data-key-set-importer.js.map +1 -0
- package/dist-client/pages/data-key-set/data-key-set-list-page.d.ts +60 -0
- package/dist-client/pages/data-key-set/data-key-set-list-page.js +450 -0
- package/dist-client/pages/data-key-set/data-key-set-list-page.js.map +1 -0
- package/dist-client/pages/data-ooc/data-ooc-list-page.d.ts +58 -0
- package/dist-client/pages/data-ooc/data-ooc-list-page.js +479 -0
- package/dist-client/pages/data-ooc/data-ooc-list-page.js.map +1 -0
- package/dist-client/pages/data-ooc/data-ooc-view-page.d.ts +18 -0
- package/dist-client/pages/data-ooc/data-ooc-view-page.js +114 -0
- package/dist-client/pages/data-ooc/data-ooc-view-page.js.map +1 -0
- package/dist-client/pages/data-ooc/data-ooc-view.d.ts +15 -0
- package/dist-client/pages/data-ooc/data-ooc-view.js +130 -0
- package/dist-client/pages/data-ooc/data-ooc-view.js.map +1 -0
- package/dist-client/pages/data-report/data-report-embed-page.d.ts +36 -0
- package/dist-client/pages/data-report/data-report-embed-page.js +101 -0
- package/dist-client/pages/data-report/data-report-embed-page.js.map +1 -0
- package/dist-client/pages/data-report/data-report-list-page.d.ts +36 -0
- package/dist-client/pages/data-report/data-report-list-page.js +431 -0
- package/dist-client/pages/data-report/data-report-list-page.js.map +1 -0
- package/dist-client/pages/data-report/data-report-samples-page.d.ts +32 -0
- package/dist-client/pages/data-report/data-report-samples-page.js +164 -0
- package/dist-client/pages/data-report/data-report-samples-page.js.map +1 -0
- package/dist-client/pages/data-report/jasper-report-oocs-page.d.ts +2 -0
- package/dist-client/pages/data-report/jasper-report-oocs-page.js +101 -0
- package/dist-client/pages/data-report/jasper-report-oocs-page.js.map +1 -0
- package/dist-client/pages/data-report/jasper-report-samples-crosstab-page.d.ts +2 -0
- package/dist-client/pages/data-report/jasper-report-samples-crosstab-page.js +101 -0
- package/dist-client/pages/data-report/jasper-report-samples-crosstab-page.js.map +1 -0
- package/dist-client/pages/data-report/jasper-report-samples-page.d.ts +2 -0
- package/dist-client/pages/data-report/jasper-report-samples-page.js +101 -0
- package/dist-client/pages/data-report/jasper-report-samples-page.js.map +1 -0
- package/dist-client/pages/data-sample/data-sample-list-page.d.ts +58 -0
- package/dist-client/pages/data-sample/data-sample-list-page.js +412 -0
- package/dist-client/pages/data-sample/data-sample-list-page.js.map +1 -0
- package/dist-client/pages/data-sample/data-sample-search-page.d.ts +63 -0
- package/dist-client/pages/data-sample/data-sample-search-page.js +413 -0
- package/dist-client/pages/data-sample/data-sample-search-page.js.map +1 -0
- package/dist-client/pages/data-sample/data-sample-view.d.ts +1 -0
- package/dist-client/pages/data-sample/data-sample-view.js +109 -0
- package/dist-client/pages/data-sample/data-sample-view.js.map +1 -0
- package/dist-client/pages/data-sensor/data-sensor-list-page.d.ts +49 -0
- package/dist-client/pages/data-sensor/data-sensor-list-page.js +419 -0
- package/dist-client/pages/data-sensor/data-sensor-list-page.js.map +1 -0
- package/dist-client/pages/data-set/data-item-list.d.ts +1 -0
- package/dist-client/pages/data-set/data-item-list.js +267 -0
- package/dist-client/pages/data-set/data-item-list.js.map +1 -0
- package/dist-client/pages/data-set/data-set-importer.d.ts +10 -0
- package/dist-client/pages/data-set/data-set-importer.js +103 -0
- package/dist-client/pages/data-set/data-set-importer.js.map +1 -0
- package/dist-client/pages/data-set/data-set-list-page.d.ts +73 -0
- package/dist-client/pages/data-set/data-set-list-page.js +861 -0
- package/dist-client/pages/data-set/data-set-list-page.js.map +1 -0
- package/dist-client/route.d.ts +1 -0
- package/dist-client/route.js +50 -0
- package/dist-client/route.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -0
- package/dist-server/controllers/activity-template/activity-data-collect.js +82 -0
- package/dist-server/controllers/activity-template/activity-data-collect.js.map +1 -0
- package/dist-server/controllers/activity-template/activity-ooc-resolve.js +100 -0
- package/dist-server/controllers/activity-template/activity-ooc-resolve.js.map +1 -0
- package/dist-server/controllers/activity-template/activity-ooc-review.js +107 -0
- package/dist-server/controllers/activity-template/activity-ooc-review.js.map +1 -0
- package/dist-server/controllers/activity-template/activity-ooc.js +59 -0
- package/dist-server/controllers/activity-template/activity-ooc.js.map +1 -0
- package/dist-server/controllers/create-data-sample.js +53 -14
- package/dist-server/controllers/create-data-sample.js.map +1 -1
- package/dist-server/controllers/data-use-case.js +1 -1
- package/dist-server/controllers/data-use-case.js.map +1 -1
- package/dist-server/controllers/index.js +7 -0
- package/dist-server/controllers/index.js.map +1 -1
- package/dist-server/index.js +1 -2
- package/dist-server/index.js.map +1 -1
- package/dist-server/routes.js +47 -3
- package/dist-server/routes.js.map +1 -1
- package/dist-server/service/data-ooc/data-ooc-query.js +22 -2
- package/dist-server/service/data-ooc/data-ooc-query.js.map +1 -1
- package/dist-server/service/data-ooc/data-ooc.js +26 -0
- package/dist-server/service/data-ooc/data-ooc.js.map +1 -1
- package/dist-server/service/data-set/data-set-mutation.js +88 -0
- package/dist-server/service/data-set/data-set-mutation.js.map +1 -1
- package/dist-server/service/data-set/data-set-query.js +38 -4
- package/dist-server/service/data-set/data-set-query.js.map +1 -1
- package/dist-server/service/data-set/data-set-type.js +16 -0
- package/dist-server/service/data-set/data-set-type.js.map +1 -1
- package/dist-server/service/data-set/data-set.js +55 -3
- package/dist-server/service/data-set/data-set.js.map +1 -1
- package/dist-server/service/data-set-history/data-set-history-query.js +4 -3
- package/dist-server/service/data-set-history/data-set-history-query.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/helps/dataset/data-ooc.md +5 -4
- package/package.json +17 -12
- package/server/controllers/activity-template/activity-data-collect.ts +84 -0
- package/server/controllers/activity-template/activity-ooc-resolve.ts +114 -0
- package/server/controllers/activity-template/activity-ooc-review.ts +118 -0
- package/server/controllers/create-data-sample.ts +61 -21
- package/server/controllers/data-use-case.ts +1 -1
- package/server/controllers/index.ts +11 -0
- package/server/index.ts +1 -2
- package/server/routes.ts +62 -5
- package/server/service/data-ooc/data-ooc-query.ts +12 -2
- package/server/service/data-ooc/data-ooc.ts +23 -0
- package/server/service/data-set/data-set-mutation.ts +99 -0
- package/server/service/data-set/data-set-query.ts +39 -5
- package/server/service/data-set/data-set-type.ts +14 -0
- package/server/service/data-set/data-set.ts +43 -2
- package/server/service/data-set-history/data-set-history-query.ts +4 -3
- package/server/tsconfig.json +10 -0
- package/things-factory.config.js +6 -2
- package/translations/en.json +3 -1
- package/translations/ko.json +3 -1
- package/translations/ms.json +3 -0
- package/translations/zh.json +3 -0
- package/client/pages/data-key-set/data-key-set-importer.js +0 -105
- package/client/pages/data-ooc/data-ooc-view.js +0 -188
- package/client/pages/data-set/data-set-importer.js +0 -103
- package/server/middlewares/index.ts +0 -3
- package/server/migrations/index.ts +0 -9
- package/tsconfig.json +0 -9
- /package/assets/{data-report.jpg → images/data-report.jpg} +0 -0
- /package/assets/{data-samples.jpg → images/data-samples.jpg} +0 -0
- /package/assets/{diagram.jpg → images/dataset-diagram.jpg} +0 -0
- /package/assets/{glue-table-indices.png → images/glue-table-indices-for-dataset.png} +0 -0
- /package/client/{index.js → index.ts} +0 -0
@@ -3,47 +3,66 @@ import './data-sample-view.js'
|
|
3
3
|
|
4
4
|
import gql from 'graphql-tag'
|
5
5
|
import { css, html } from 'lit'
|
6
|
+
import { customElement, property, query, state } from 'lit/decorators.js'
|
6
7
|
import { connect } from 'pwa-helpers/connect-mixin'
|
7
8
|
|
9
|
+
import {
|
10
|
+
getEditor,
|
11
|
+
getRenderer,
|
12
|
+
ColumnConfig,
|
13
|
+
DataGrist,
|
14
|
+
FetchOption,
|
15
|
+
SortersControl,
|
16
|
+
GristRecord
|
17
|
+
} from '@operato/data-grist'
|
8
18
|
import { client } from '@operato/graphql'
|
9
19
|
import { i18next, localize } from '@operato/i18n'
|
10
20
|
import { openPopup } from '@operato/layout'
|
11
21
|
import { PageView, store } from '@operato/shell'
|
12
22
|
import { CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
13
23
|
import { isMobileDevice } from '@operato/utils'
|
24
|
+
import { OxPopup } from '@operato/popup'
|
14
25
|
|
26
|
+
@customElement('data-sample-list-page')
|
15
27
|
export class DataSampleListPage extends connect(store)(localize(i18next)(PageView)) {
|
16
|
-
static
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
28
|
+
static styles = [
|
29
|
+
ScrollbarStyles,
|
30
|
+
CommonGristStyles,
|
31
|
+
css`
|
32
|
+
:host {
|
33
|
+
display: flex;
|
34
|
+
flex-direction: column;
|
23
35
|
|
24
|
-
|
25
|
-
|
26
|
-
ScrollbarStyles,
|
27
|
-
CommonGristStyles,
|
28
|
-
css`
|
29
|
-
:host {
|
30
|
-
display: flex;
|
31
|
-
flex-direction: column;
|
36
|
+
overflow: hidden;
|
37
|
+
}
|
32
38
|
|
33
|
-
|
34
|
-
|
39
|
+
ox-grist {
|
40
|
+
overflow-y: auto;
|
41
|
+
flex: 1;
|
42
|
+
}
|
43
|
+
`
|
44
|
+
]
|
35
45
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
]
|
42
|
-
}
|
46
|
+
@state() gristConfig: any
|
47
|
+
@state() mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'
|
48
|
+
|
49
|
+
@query('ox-grist') private grist!: DataGrist
|
50
|
+
@query('#sorter-control') private sortersControl!: OxPopup
|
43
51
|
|
44
52
|
get context() {
|
45
53
|
return {
|
46
|
-
|
54
|
+
search: {
|
55
|
+
handler: (search: string) => {
|
56
|
+
this.grist.searchText = search
|
57
|
+
},
|
58
|
+
placeholder: i18next.t('title.data-sample list'),
|
59
|
+
value: this.grist.searchText
|
60
|
+
},
|
61
|
+
filter: {
|
62
|
+
handler: () => {
|
63
|
+
this.grist.toggleHeadroom()
|
64
|
+
}
|
65
|
+
},
|
47
66
|
help: 'dataset/data-sample',
|
48
67
|
actions: [],
|
49
68
|
exportable: {
|
@@ -65,7 +84,7 @@ export class DataSampleListPage extends connect(store)(localize(i18next)(PageVie
|
|
65
84
|
>
|
66
85
|
<div slot="headroom">
|
67
86
|
<div id="filters">
|
68
|
-
<ox-filters-form autofocus></ox-filters-form>
|
87
|
+
<ox-filters-form autofocus without-search></ox-filters-form>
|
69
88
|
</div>
|
70
89
|
|
71
90
|
<div id="sorters">
|
@@ -73,7 +92,7 @@ export class DataSampleListPage extends connect(store)(localize(i18next)(PageVie
|
|
73
92
|
<mwc-icon
|
74
93
|
@click=${e => {
|
75
94
|
const target = e.currentTarget
|
76
|
-
this.
|
95
|
+
this.sortersControl.open({
|
77
96
|
right: 0,
|
78
97
|
top: target.offsetTop + target.offsetHeight
|
79
98
|
})
|
@@ -95,10 +114,6 @@ export class DataSampleListPage extends connect(store)(localize(i18next)(PageVie
|
|
95
114
|
`
|
96
115
|
}
|
97
116
|
|
98
|
-
get grist() {
|
99
|
-
return this.renderRoot.querySelector('ox-grist')
|
100
|
-
}
|
101
|
-
|
102
117
|
async pageInitialized(lifecycle) {
|
103
118
|
const today = new Date().toISOString().split('T')[0]
|
104
119
|
|
@@ -318,7 +333,7 @@ export class DataSampleListPage extends connect(store)(localize(i18next)(PageVie
|
|
318
333
|
}
|
319
334
|
}
|
320
335
|
|
321
|
-
async fetchHandler({ page, limit, sortings = [], filters = [] }) {
|
336
|
+
async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {
|
322
337
|
const response = await client.query({
|
323
338
|
query: gql`
|
324
339
|
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
@@ -365,7 +380,7 @@ export class DataSampleListPage extends connect(store)(localize(i18next)(PageVie
|
|
365
380
|
}
|
366
381
|
|
367
382
|
_exportableData() {
|
368
|
-
let records = []
|
383
|
+
let records = [] as GristRecord[]
|
369
384
|
if (this.grist.selected && this.grist.selected.length > 0) {
|
370
385
|
records = this.grist.selected
|
371
386
|
} else {
|
@@ -377,7 +392,7 @@ export class DataSampleListPage extends connect(store)(localize(i18next)(PageVie
|
|
377
392
|
.map(column => {
|
378
393
|
return column.imex === true
|
379
394
|
? {
|
380
|
-
header: column.header.renderer(),
|
395
|
+
header: column.header.renderer(column),
|
381
396
|
key: column.name,
|
382
397
|
width: column.width,
|
383
398
|
type: column.type
|
@@ -403,5 +418,3 @@ export class DataSampleListPage extends connect(store)(localize(i18next)(PageVie
|
|
403
418
|
return { header: headerSetting, data: data }
|
404
419
|
}
|
405
420
|
}
|
406
|
-
|
407
|
-
window.customElements.define('data-sample-list-page', DataSampleListPage)
|
@@ -3,49 +3,69 @@ import './data-sample-view.js'
|
|
3
3
|
|
4
4
|
import gql from 'graphql-tag'
|
5
5
|
import { css, html } from 'lit'
|
6
|
+
import { customElement, property, query, state } from 'lit/decorators.js'
|
6
7
|
import { connect } from 'pwa-helpers/connect-mixin'
|
7
8
|
|
9
|
+
import {
|
10
|
+
getEditor,
|
11
|
+
getRenderer,
|
12
|
+
ColumnConfig,
|
13
|
+
DataGrist,
|
14
|
+
FetchOption,
|
15
|
+
SortersControl,
|
16
|
+
GristRecord
|
17
|
+
} from '@operato/data-grist'
|
8
18
|
import { client } from '@operato/graphql'
|
9
19
|
import { i18next, localize } from '@operato/i18n'
|
10
20
|
import { openPopup } from '@operato/layout'
|
11
21
|
import { PageView, store } from '@operato/shell'
|
12
22
|
import { CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
13
23
|
import { isMobileDevice } from '@operato/utils'
|
24
|
+
import { OxPopup } from '@operato/popup'
|
14
25
|
|
26
|
+
@customElement('data-sample-search-page')
|
15
27
|
export class DataSampleSearchPage extends connect(store)(localize(i18next)(PageView)) {
|
16
|
-
static
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
}
|
24
|
-
}
|
28
|
+
static styles = [
|
29
|
+
ScrollbarStyles,
|
30
|
+
CommonGristStyles,
|
31
|
+
css`
|
32
|
+
:host {
|
33
|
+
display: flex;
|
34
|
+
flex-direction: column;
|
25
35
|
|
26
|
-
|
27
|
-
|
28
|
-
ScrollbarStyles,
|
29
|
-
CommonGristStyles,
|
30
|
-
css`
|
31
|
-
:host {
|
32
|
-
display: flex;
|
33
|
-
flex-direction: column;
|
36
|
+
overflow: hidden;
|
37
|
+
}
|
34
38
|
|
35
|
-
|
36
|
-
|
39
|
+
ox-grist {
|
40
|
+
overflow-y: auto;
|
41
|
+
flex: 1;
|
42
|
+
}
|
43
|
+
`
|
44
|
+
]
|
37
45
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
46
|
+
@state() dataKeySetId?: string
|
47
|
+
@state() dataKeySet: any
|
48
|
+
|
49
|
+
@state() gristConfig: any
|
50
|
+
@state() mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'
|
51
|
+
|
52
|
+
@query('ox-grist') private grist!: DataGrist
|
53
|
+
@query('#sorter-control') private sortersControl!: OxPopup
|
45
54
|
|
46
55
|
get context() {
|
47
56
|
return {
|
48
|
-
|
57
|
+
search: {
|
58
|
+
handler: (search: string) => {
|
59
|
+
this.grist.searchText = search
|
60
|
+
},
|
61
|
+
placeholder: i18next.t('title.data-sample search'),
|
62
|
+
value: this.grist.searchText
|
63
|
+
},
|
64
|
+
filter: {
|
65
|
+
handler: () => {
|
66
|
+
this.grist.toggleHeadroom()
|
67
|
+
}
|
68
|
+
},
|
49
69
|
help: 'dataset/data-sample-search',
|
50
70
|
actions: [],
|
51
71
|
exportable: {
|
@@ -63,11 +83,11 @@ export class DataSampleSearchPage extends connect(store)(localize(i18next)(PageV
|
|
63
83
|
.mode=${mode}
|
64
84
|
.config=${this.gristConfig}
|
65
85
|
.fetchHandler=${this.fetchHandler.bind(this)}
|
66
|
-
?url-params-sensitive=${
|
86
|
+
?url-params-sensitive=${this.active}
|
67
87
|
>
|
68
88
|
<div slot="headroom">
|
69
89
|
<div id="filters">
|
70
|
-
<ox-filters-form autofocus></ox-filters-form>
|
90
|
+
<ox-filters-form autofocus without-search></ox-filters-form>
|
71
91
|
</div>
|
72
92
|
|
73
93
|
<div id="sorters">
|
@@ -75,7 +95,7 @@ export class DataSampleSearchPage extends connect(store)(localize(i18next)(PageV
|
|
75
95
|
<mwc-icon
|
76
96
|
@click=${e => {
|
77
97
|
const target = e.currentTarget
|
78
|
-
this.
|
98
|
+
this.sortersControl.open({
|
79
99
|
right: 0,
|
80
100
|
top: target.offsetTop + target.offsetHeight
|
81
101
|
})
|
@@ -97,10 +117,6 @@ export class DataSampleSearchPage extends connect(store)(localize(i18next)(PageV
|
|
97
117
|
`
|
98
118
|
}
|
99
119
|
|
100
|
-
get grist() {
|
101
|
-
return this.renderRoot.querySelector('ox-grist')
|
102
|
-
}
|
103
|
-
|
104
120
|
pageUpdated(changes, lifecycle) {
|
105
121
|
if (this.active) {
|
106
122
|
this.dataKeySetId = lifecycle.resourceId
|
@@ -311,7 +327,7 @@ export class DataSampleSearchPage extends connect(store)(localize(i18next)(PageV
|
|
311
327
|
}
|
312
328
|
}
|
313
329
|
|
314
|
-
async fetchHandler({ page, limit, sortings = [], filters = [] }) {
|
330
|
+
async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {
|
315
331
|
if (!this.dataKeySetId) {
|
316
332
|
return { records: [], total: 0 }
|
317
333
|
}
|
@@ -367,7 +383,7 @@ export class DataSampleSearchPage extends connect(store)(localize(i18next)(PageV
|
|
367
383
|
}
|
368
384
|
|
369
385
|
_exportableData() {
|
370
|
-
let records = []
|
386
|
+
let records = [] as GristRecord[]
|
371
387
|
if (this.grist.selected && this.grist.selected.length > 0) {
|
372
388
|
records = this.grist.selected
|
373
389
|
} else {
|
@@ -379,7 +395,7 @@ export class DataSampleSearchPage extends connect(store)(localize(i18next)(PageV
|
|
379
395
|
.map(column => {
|
380
396
|
return column.imex === true
|
381
397
|
? {
|
382
|
-
header: column.header.renderer(),
|
398
|
+
header: column.header.renderer(column),
|
383
399
|
key: column.name,
|
384
400
|
width: column.width,
|
385
401
|
type: column.type
|
@@ -405,5 +421,3 @@ export class DataSampleSearchPage extends connect(store)(localize(i18next)(PageV
|
|
405
421
|
return { header: headerSetting, data: data }
|
406
422
|
}
|
407
423
|
}
|
408
|
-
|
409
|
-
window.customElements.define('data-sample-search-page', DataSampleSearchPage)
|
@@ -2,48 +2,46 @@ import '@operato/dataset/ox-data-sample-view.js'
|
|
2
2
|
|
3
3
|
import gql from 'graphql-tag'
|
4
4
|
import { css, html, LitElement } from 'lit'
|
5
|
+
import { customElement, property, query, state } from 'lit/decorators.js'
|
5
6
|
|
6
7
|
import { client } from '@operato/graphql'
|
7
8
|
import { i18next, localize } from '@operato/i18n'
|
8
9
|
import { ScrollbarStyles } from '@operato/styles'
|
10
|
+
import { DataSample } from '@operato/dataset'
|
9
11
|
|
12
|
+
@customElement('data-sample-view')
|
10
13
|
class DataSampleView extends localize(i18next)(LitElement) {
|
11
|
-
static
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
dataSample: Object
|
18
|
-
}
|
19
|
-
}
|
14
|
+
static styles = [
|
15
|
+
ScrollbarStyles,
|
16
|
+
css`
|
17
|
+
:host {
|
18
|
+
display: flex;
|
19
|
+
flex-direction: column;
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
ScrollbarStyles,
|
24
|
-
css`
|
25
|
-
:host {
|
26
|
-
display: flex;
|
27
|
-
flex-direction: column;
|
21
|
+
background-color: #fff;
|
22
|
+
}
|
28
23
|
|
29
|
-
|
30
|
-
|
24
|
+
div[content] {
|
25
|
+
flex: 1;
|
31
26
|
|
32
|
-
|
33
|
-
|
27
|
+
display: flex;
|
28
|
+
overflow: auto;
|
29
|
+
}
|
34
30
|
|
35
|
-
|
36
|
-
|
37
|
-
|
31
|
+
ox-data-sample-view {
|
32
|
+
flex: 1;
|
33
|
+
padding: var(--padding-wide);
|
34
|
+
overflow: auto;
|
35
|
+
}
|
36
|
+
`
|
37
|
+
]
|
38
38
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
]
|
46
|
-
}
|
39
|
+
@property({
|
40
|
+
type: String,
|
41
|
+
attribute: 'data-sample-id'
|
42
|
+
})
|
43
|
+
dataSampleId?: string
|
44
|
+
@state() dataSample?: DataSample
|
47
45
|
|
48
46
|
render() {
|
49
47
|
return html`
|
@@ -110,5 +108,3 @@ class DataSampleView extends localize(i18next)(LitElement) {
|
|
110
108
|
this.dataSample = response.data.dataSample
|
111
109
|
}
|
112
110
|
}
|
113
|
-
|
114
|
-
window.customElements.define('data-sample-view', DataSampleView)
|
@@ -2,6 +2,8 @@ import '@operato/data-grist'
|
|
2
2
|
|
3
3
|
import gql from 'graphql-tag'
|
4
4
|
import { css, html } from 'lit'
|
5
|
+
import { customElement, property, query, state } from 'lit/decorators.js'
|
6
|
+
|
5
7
|
import { connect } from 'pwa-helpers/connect-mixin'
|
6
8
|
|
7
9
|
import { client } from '@operato/graphql'
|
@@ -10,39 +12,49 @@ import { notify } from '@operato/layout'
|
|
10
12
|
import { PageView, store } from '@operato/shell'
|
11
13
|
import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
12
14
|
import { isMobileDevice } from '@operato/utils'
|
15
|
+
import { ColumnConfig, DataGrist, FetchOption, SortersControl } from '@operato/data-grist'
|
16
|
+
import { OxPopup } from '@operato/popup'
|
13
17
|
|
18
|
+
@customElement('data-sensor-list-page')
|
14
19
|
export class DataSensorListPage extends connect(store)(localize(i18next)(PageView)) {
|
15
|
-
static
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
20
|
+
static styles = [
|
21
|
+
ScrollbarStyles,
|
22
|
+
CommonGristStyles,
|
23
|
+
css`
|
24
|
+
:host {
|
25
|
+
display: flex;
|
26
|
+
flex-direction: column;
|
22
27
|
|
23
|
-
|
24
|
-
|
25
|
-
ScrollbarStyles,
|
26
|
-
CommonGristStyles,
|
27
|
-
css`
|
28
|
-
:host {
|
29
|
-
display: flex;
|
30
|
-
flex-direction: column;
|
28
|
+
overflow: hidden;
|
29
|
+
}
|
31
30
|
|
32
|
-
|
33
|
-
|
31
|
+
ox-grist {
|
32
|
+
overflow-y: auto;
|
33
|
+
flex: 1;
|
34
|
+
}
|
35
|
+
`
|
36
|
+
]
|
34
37
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
]
|
41
|
-
}
|
38
|
+
@state() gristConfig: any
|
39
|
+
@state() mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'
|
40
|
+
|
41
|
+
@query('ox-grist') private grist!: DataGrist
|
42
|
+
@query('#sorter-control') private sortersControl!: OxPopup
|
42
43
|
|
43
44
|
get context() {
|
44
45
|
return {
|
45
|
-
|
46
|
+
search: {
|
47
|
+
handler: (search: string) => {
|
48
|
+
this.grist.searchText = search
|
49
|
+
},
|
50
|
+
placeholder: i18next.t('title.data-sensor list'),
|
51
|
+
value: this.grist.searchText
|
52
|
+
},
|
53
|
+
filter: {
|
54
|
+
handler: () => {
|
55
|
+
this.grist.toggleHeadroom()
|
56
|
+
}
|
57
|
+
},
|
46
58
|
help: 'dataset/data-sensor',
|
47
59
|
actions: [
|
48
60
|
{
|
@@ -76,7 +88,7 @@ export class DataSensorListPage extends connect(store)(localize(i18next)(PageVie
|
|
76
88
|
>
|
77
89
|
<div slot="headroom">
|
78
90
|
<div id="filters">
|
79
|
-
<ox-filters-form autofocus></ox-filters-form>
|
91
|
+
<ox-filters-form autofocus without-search></ox-filters-form>
|
80
92
|
</div>
|
81
93
|
|
82
94
|
<div id="sorters">
|
@@ -84,7 +96,7 @@ export class DataSensorListPage extends connect(store)(localize(i18next)(PageVie
|
|
84
96
|
<mwc-icon
|
85
97
|
@click=${e => {
|
86
98
|
const target = e.currentTarget
|
87
|
-
this.
|
99
|
+
this.sortersControl.open({
|
88
100
|
right: 0,
|
89
101
|
top: target.offsetTop + target.offsetHeight
|
90
102
|
})
|
@@ -106,10 +118,6 @@ export class DataSensorListPage extends connect(store)(localize(i18next)(PageVie
|
|
106
118
|
`
|
107
119
|
}
|
108
120
|
|
109
|
-
get grist() {
|
110
|
-
return this.renderRoot.querySelector('ox-grist')
|
111
|
-
}
|
112
|
-
|
113
121
|
async pageInitialized(lifecycle) {
|
114
122
|
this.gristConfig = {
|
115
123
|
list: { fields: ['name', 'description', 'active'] },
|
@@ -290,7 +298,7 @@ export class DataSensorListPage extends connect(store)(localize(i18next)(PageVie
|
|
290
298
|
}
|
291
299
|
}
|
292
300
|
|
293
|
-
async fetchHandler({ page, limit, sortings = [], filters = [] }) {
|
301
|
+
async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {
|
294
302
|
const response = await client.query({
|
295
303
|
query: gql`
|
296
304
|
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
@@ -390,7 +398,7 @@ export class DataSensorListPage extends connect(store)(localize(i18next)(PageVie
|
|
390
398
|
let patches = this.grist.dirtyRecords
|
391
399
|
if (patches && patches.length) {
|
392
400
|
patches = patches.map(patch => {
|
393
|
-
let patchField = patch.id ? { id: patch.id } : {}
|
401
|
+
let patchField: any = patch.id ? { id: patch.id } : {}
|
394
402
|
const dirtyFields = patch.__dirtyfields__
|
395
403
|
for (let key in dirtyFields) {
|
396
404
|
patchField[key] = dirtyFields[key].after
|
@@ -417,5 +425,3 @@ export class DataSensorListPage extends connect(store)(localize(i18next)(PageVie
|
|
417
425
|
}
|
418
426
|
}
|
419
427
|
}
|
420
|
-
|
421
|
-
window.customElements.define('data-sensor-list-page', DataSensorListPage)
|
@@ -1,51 +1,47 @@
|
|
1
1
|
import gql from 'graphql-tag'
|
2
2
|
import { css, html, LitElement } from 'lit'
|
3
|
+
import { customElement, property, query, state } from 'lit/decorators.js'
|
3
4
|
|
4
5
|
import { client } from '@operato/graphql'
|
5
6
|
import { i18next, localize } from '@operato/i18n'
|
6
7
|
import { isMobileDevice } from '@operato/utils'
|
8
|
+
import { ColumnConfig, DataGrist, FetchOption, SortersControl } from '@operato/data-grist'
|
7
9
|
|
10
|
+
@customElement('data-item-list')
|
8
11
|
class DataItemList extends localize(i18next)(LitElement) {
|
9
|
-
|
10
|
-
return {
|
11
|
-
dataSet: Object,
|
12
|
-
gristConfig: Object
|
13
|
-
}
|
14
|
-
}
|
12
|
+
@property({ type: Object }) dataSet: any
|
15
13
|
|
16
|
-
|
17
|
-
return [
|
18
|
-
css`
|
19
|
-
:host {
|
20
|
-
display: flex;
|
21
|
-
flex-direction: column;
|
14
|
+
@state() gristConfig: any
|
22
15
|
|
23
|
-
|
24
|
-
|
16
|
+
static styles = [
|
17
|
+
css`
|
18
|
+
:host {
|
19
|
+
display: flex;
|
20
|
+
flex-direction: column;
|
25
21
|
|
26
|
-
|
27
|
-
|
28
|
-
}
|
22
|
+
background-color: #fff;
|
23
|
+
}
|
29
24
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
padding: var(--padding-default);
|
34
|
-
}
|
25
|
+
ox-grist {
|
26
|
+
flex: 1;
|
27
|
+
}
|
35
28
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
}
|
42
|
-
`
|
43
|
-
]
|
44
|
-
}
|
29
|
+
.button-container {
|
30
|
+
display: flex;
|
31
|
+
margin-left: auto;
|
32
|
+
padding: var(--padding-default);
|
33
|
+
}
|
45
34
|
|
46
|
-
|
47
|
-
|
48
|
-
|
35
|
+
[danger] {
|
36
|
+
--mdc-theme-primary: var(--mdc-danger-button-primary-color);
|
37
|
+
}
|
38
|
+
mwc-button {
|
39
|
+
margin-left: var(--margin-default);
|
40
|
+
}
|
41
|
+
`
|
42
|
+
]
|
43
|
+
|
44
|
+
@query('ox-grist') private grist!: DataGrist
|
49
45
|
|
50
46
|
render() {
|
51
47
|
return html`
|
@@ -223,7 +219,7 @@ class DataItemList extends localize(i18next)(LitElement) {
|
|
223
219
|
}
|
224
220
|
}
|
225
221
|
|
226
|
-
async fetchHandler({ filters, page, limit, sortings = [] }) {
|
222
|
+
async fetchHandler({ filters, page, limit, sortings = [] }: FetchOption) {
|
227
223
|
const dataItems = this.dataSet.dataItems || []
|
228
224
|
|
229
225
|
return {
|
@@ -273,5 +269,3 @@ class DataItemList extends localize(i18next)(LitElement) {
|
|
273
269
|
this.grist.deleteSelectedRecords(false)
|
274
270
|
}
|
275
271
|
}
|
276
|
-
|
277
|
-
window.customElements.define('data-item-list', DataItemList)
|