@things-factory/dataset 6.0.25 → 6.0.27
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/ooc.png +0 -0
- package/assets/images/oos.png +0 -0
- package/client/{bootstrap.js → bootstrap.ts} +2 -0
- package/client/components/{data-entry-form.js → data-entry-form.ts} +30 -33
- package/client/components/data-ooc-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} +50 -36
- package/client/pages/data-ooc/{data-ooc-view.js → data-ooc-view.ts} +66 -76
- 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} +62 -36
- package/client/{route.js → route.ts} +1 -1
- package/client/tsconfig.json +11 -0
- package/dist-client/bootstrap.d.ts +3 -0
- package/dist-client/bootstrap.js +14 -0
- package/dist-client/bootstrap.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/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 +473 -0
- package/dist-client/pages/data-ooc/data-ooc-list-page.js.map +1 -0
- package/dist-client/pages/data-ooc/data-ooc-view.d.ts +1 -0
- package/dist-client/pages/data-ooc/data-ooc-view.js +179 -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 +71 -0
- package/dist-client/pages/data-set/data-set-list-page.js +759 -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 +47 -0
- package/dist-client/route.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +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 +38 -1
- package/dist-server/controllers/create-data-sample.js.map +1 -1
- package/dist-server/controllers/index.js +5 -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 +2 -2
- package/dist-server/routes.js.map +1 -1
- package/dist-server/service/data-set/data-set-query.js +5 -4
- package/dist-server/service/data-set/data-set-query.js.map +1 -1
- package/dist-server/service/data-set/data-set.js +3 -0
- 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/package.json +15 -12
- package/server/controllers/activity-template/activity-ooc.ts +55 -0
- package/server/controllers/create-data-sample.ts +48 -3
- package/server/controllers/index.ts +9 -0
- package/server/index.ts +1 -2
- package/server/routes.ts +2 -4
- package/server/service/data-set/data-set-query.ts +5 -4
- package/server/service/data-set/data-set.ts +3 -0
- package/server/service/data-set-history/data-set-history-query.ts +4 -3
- package/server/tsconfig.json +10 -0
- package/things-factory.config.js +2 -2
- package/translations/en.json +1 -1
- package/translations/ko.json +1 -1
- package/translations/ms.json +1 -0
- package/translations/zh.json +1 -0
- package/client/pages/data-key-set/data-key-set-importer.js +0 -105
- package/client/pages/data-set/data-set-importer.js +0 -103
- package/dist-server/middlewares/index.js +0 -8
- package/dist-server/middlewares/index.js.map +0 -1
- package/dist-server/migrations/index.js +0 -12
- package/dist-server/migrations/index.js.map +0 -1
- 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
@@ -2,40 +2,33 @@ import '@operato/data-grist'
|
|
2
2
|
import '@operato/form'
|
3
3
|
|
4
4
|
import { css, html } from 'lit'
|
5
|
+
import { customElement, property, query, state } from 'lit/decorators.js'
|
5
6
|
|
7
|
+
import { PageView } from '@operato/shell'
|
6
8
|
import { i18next, localize } from '@operato/i18n'
|
7
9
|
import { CommonButtonStyles, ScrollbarStyles } from '@operato/styles'
|
8
|
-
import { PageView } from '@things-factory/shell'
|
9
10
|
|
11
|
+
@customElement('jasper-report-oocs-page')
|
10
12
|
class JasperReportOocsPage extends localize(i18next)(PageView) {
|
11
|
-
static
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
13
|
+
static styles = [
|
14
|
+
ScrollbarStyles,
|
15
|
+
css`
|
16
|
+
:host {
|
17
|
+
display: flex;
|
18
|
+
flex-direction: column;
|
19
|
+
padding: 0;
|
20
|
+
}
|
19
21
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
:
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
}
|
22
|
+
#container {
|
23
|
+
flex: 1;
|
24
|
+
padding: 0;
|
25
|
+
margin: 0;
|
26
|
+
border: 0;
|
27
|
+
}
|
28
|
+
`
|
29
|
+
]
|
29
30
|
|
30
|
-
|
31
|
-
flex: 1;
|
32
|
-
padding: 0;
|
33
|
-
margin: 0;
|
34
|
-
border: 0;
|
35
|
-
}
|
36
|
-
`
|
37
|
-
]
|
38
|
-
}
|
31
|
+
@query('iframe') container!: HTMLIFrameElement
|
39
32
|
|
40
33
|
get context() {
|
41
34
|
const filters = [
|
@@ -50,7 +43,7 @@ class JasperReportOocsPage extends localize(i18next)(PageView) {
|
|
50
43
|
{
|
51
44
|
title: i18next.t('button.print'),
|
52
45
|
action: () => {
|
53
|
-
this.
|
46
|
+
this.container.contentWindow?.print()
|
54
47
|
},
|
55
48
|
...CommonButtonStyles.print
|
56
49
|
}
|
@@ -76,9 +69,6 @@ class JasperReportOocsPage extends localize(i18next)(PageView) {
|
|
76
69
|
`
|
77
70
|
}
|
78
71
|
|
79
|
-
get searchForm() {
|
80
|
-
return this.renderRoot.querySelector('ox-filters-form-base')
|
81
|
-
}
|
82
72
|
async pageUpdated(changes, lifecycle) {
|
83
73
|
if (this.active) {
|
84
74
|
this.updateContext()
|
@@ -115,8 +105,6 @@ class JasperReportOocsPage extends localize(i18next)(PageView) {
|
|
115
105
|
.map(key => `${key}=${encodeURIComponent(urlParams[key])}`)
|
116
106
|
.join('&')
|
117
107
|
|
118
|
-
this.
|
108
|
+
this.container.src = `/data-report/jasper?${encodedUrlParams}`
|
119
109
|
}
|
120
110
|
}
|
121
|
-
|
122
|
-
window.customElements.define('jasper-report-oocs-page', JasperReportOocsPage)
|
@@ -2,40 +2,33 @@ import '@operato/data-grist'
|
|
2
2
|
import '@operato/form'
|
3
3
|
|
4
4
|
import { css, html } from 'lit'
|
5
|
+
import { customElement, property, query, state } from 'lit/decorators.js'
|
5
6
|
|
7
|
+
import { PageView } from '@operato/shell'
|
6
8
|
import { i18next, localize } from '@operato/i18n'
|
7
9
|
import { CommonButtonStyles, ScrollbarStyles } from '@operato/styles'
|
8
|
-
import { PageView } from '@things-factory/shell'
|
9
10
|
|
11
|
+
@customElement('jasper-report-samples-crosstab-page')
|
10
12
|
class JasperReportSamplesCrosstabPage extends localize(i18next)(PageView) {
|
11
|
-
static
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
13
|
+
static styles = [
|
14
|
+
ScrollbarStyles,
|
15
|
+
css`
|
16
|
+
:host {
|
17
|
+
display: flex;
|
18
|
+
flex-direction: column;
|
19
|
+
padding: 0;
|
20
|
+
}
|
19
21
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
:
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
}
|
22
|
+
#container {
|
23
|
+
flex: 1;
|
24
|
+
padding: 0;
|
25
|
+
margin: 0;
|
26
|
+
border: 0;
|
27
|
+
}
|
28
|
+
`
|
29
|
+
]
|
29
30
|
|
30
|
-
|
31
|
-
flex: 1;
|
32
|
-
padding: 0;
|
33
|
-
margin: 0;
|
34
|
-
border: 0;
|
35
|
-
}
|
36
|
-
`
|
37
|
-
]
|
38
|
-
}
|
31
|
+
@query('iframe') container!: HTMLIFrameElement
|
39
32
|
|
40
33
|
get context() {
|
41
34
|
const filters = [
|
@@ -50,7 +43,7 @@ class JasperReportSamplesCrosstabPage extends localize(i18next)(PageView) {
|
|
50
43
|
{
|
51
44
|
title: i18next.t('button.print'),
|
52
45
|
action: () => {
|
53
|
-
this.
|
46
|
+
this.container.contentWindow?.print()
|
54
47
|
},
|
55
48
|
...CommonButtonStyles.print
|
56
49
|
}
|
@@ -76,9 +69,6 @@ class JasperReportSamplesCrosstabPage extends localize(i18next)(PageView) {
|
|
76
69
|
`
|
77
70
|
}
|
78
71
|
|
79
|
-
get searchForm() {
|
80
|
-
return this.renderRoot.querySelector('ox-filters-form-base')
|
81
|
-
}
|
82
72
|
async pageUpdated(changes, lifecycle) {
|
83
73
|
if (this.active) {
|
84
74
|
this.updateContext()
|
@@ -115,8 +105,6 @@ class JasperReportSamplesCrosstabPage extends localize(i18next)(PageView) {
|
|
115
105
|
.map(key => `${key}=${encodeURIComponent(urlParams[key])}`)
|
116
106
|
.join('&')
|
117
107
|
|
118
|
-
this.
|
108
|
+
this.container.src = `/data-report/jasper?${encodedUrlParams}`
|
119
109
|
}
|
120
110
|
}
|
121
|
-
|
122
|
-
window.customElements.define('jasper-report-samples-crosstab-page', JasperReportSamplesCrosstabPage)
|
package/client/pages/data-report/{jasper-report-samples-page.js → jasper-report-samples-page.ts}
RENAMED
@@ -2,40 +2,33 @@ import '@operato/data-grist'
|
|
2
2
|
import '@operato/form'
|
3
3
|
|
4
4
|
import { css, html } from 'lit'
|
5
|
+
import { customElement, property, query, state } from 'lit/decorators.js'
|
5
6
|
|
7
|
+
import { PageView } from '@operato/shell'
|
6
8
|
import { i18next, localize } from '@operato/i18n'
|
7
9
|
import { CommonButtonStyles, ScrollbarStyles } from '@operato/styles'
|
8
|
-
import { PageView } from '@things-factory/shell'
|
9
10
|
|
11
|
+
@customElement('jasper-report-samples-page')
|
10
12
|
class JasperReportSamplesPage extends localize(i18next)(PageView) {
|
11
|
-
static
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
13
|
+
static styles = [
|
14
|
+
ScrollbarStyles,
|
15
|
+
css`
|
16
|
+
:host {
|
17
|
+
display: flex;
|
18
|
+
flex-direction: column;
|
19
|
+
padding: 0;
|
20
|
+
}
|
19
21
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
:
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
}
|
22
|
+
#container {
|
23
|
+
flex: 1;
|
24
|
+
padding: 0;
|
25
|
+
margin: 0;
|
26
|
+
border: 0;
|
27
|
+
}
|
28
|
+
`
|
29
|
+
]
|
29
30
|
|
30
|
-
|
31
|
-
flex: 1;
|
32
|
-
padding: 0;
|
33
|
-
margin: 0;
|
34
|
-
border: 0;
|
35
|
-
}
|
36
|
-
`
|
37
|
-
]
|
38
|
-
}
|
31
|
+
@query('iframe') container!: HTMLIFrameElement
|
39
32
|
|
40
33
|
get context() {
|
41
34
|
const filters = [
|
@@ -50,7 +43,7 @@ class JasperReportSamplesPage extends localize(i18next)(PageView) {
|
|
50
43
|
{
|
51
44
|
title: i18next.t('button.print'),
|
52
45
|
action: () => {
|
53
|
-
this.
|
46
|
+
this.container.contentWindow?.print()
|
54
47
|
},
|
55
48
|
...CommonButtonStyles.print
|
56
49
|
}
|
@@ -76,9 +69,6 @@ class JasperReportSamplesPage extends localize(i18next)(PageView) {
|
|
76
69
|
`
|
77
70
|
}
|
78
71
|
|
79
|
-
get searchForm() {
|
80
|
-
return this.renderRoot.querySelector('ox-filters-form-base')
|
81
|
-
}
|
82
72
|
async pageUpdated(changes, lifecycle) {
|
83
73
|
if (this.active) {
|
84
74
|
this.updateContext()
|
@@ -115,8 +105,6 @@ class JasperReportSamplesPage extends localize(i18next)(PageView) {
|
|
115
105
|
.map(key => `${key}=${encodeURIComponent(urlParams[key])}`)
|
116
106
|
.join('&')
|
117
107
|
|
118
|
-
this.
|
108
|
+
this.container.src = `/data-report/jasper?${encodedUrlParams}`
|
119
109
|
}
|
120
110
|
}
|
121
|
-
|
122
|
-
window.customElements.define('jasper-report-samples-page', JasperReportSamplesPage)
|
@@ -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)
|