@things-factory/dataset 6.0.24 → 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,109 +2,101 @@ import '@operato/dataset/ox-data-ooc-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 { DataSet } from '@operato/dataset'
|
9
11
|
|
12
|
+
@customElement('data-ooc-view')
|
10
13
|
class DataOocView extends localize(i18next)(LitElement) {
|
11
|
-
static
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
:
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
}
|
14
|
+
static styles = [
|
15
|
+
ScrollbarStyles,
|
16
|
+
css`
|
17
|
+
:host {
|
18
|
+
display: flex;
|
19
|
+
flex-direction: column;
|
20
|
+
|
21
|
+
background-color: #fff;
|
22
|
+
}
|
21
23
|
|
22
|
-
|
23
|
-
|
24
|
+
div[content] {
|
25
|
+
flex: 1;
|
24
26
|
|
25
|
-
|
26
|
-
|
27
|
-
|
27
|
+
display: flex;
|
28
|
+
overflow: auto;
|
29
|
+
}
|
28
30
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
31
|
+
ox-data-ooc-view {
|
32
|
+
flex: 1;
|
33
|
+
padding: var(--padding-wide);
|
34
|
+
overflow: auto;
|
35
|
+
}
|
34
36
|
|
35
|
-
|
36
|
-
|
37
|
-
|
37
|
+
label[comment] {
|
38
|
+
display: flex;
|
39
|
+
flex-direction: column;
|
38
40
|
|
39
|
-
|
40
|
-
|
41
|
+
padding: var(--padding-wide);
|
42
|
+
}
|
41
43
|
|
42
|
-
|
43
|
-
|
44
|
-
|
44
|
+
label[comment] div {
|
45
|
+
display: flex;
|
46
|
+
}
|
45
47
|
|
46
|
-
|
47
|
-
|
48
|
-
|
48
|
+
mwc-icon {
|
49
|
+
color: var(--status-danger-color);
|
50
|
+
}
|
49
51
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
52
|
+
textarea {
|
53
|
+
border: var(--input-field-border);
|
54
|
+
border-radius: var(--input-border-radius);
|
55
|
+
padding: var(--input-field-padding);
|
56
|
+
font: var(--input-field-font);
|
57
|
+
}
|
56
58
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
}
|
59
|
+
.button-container {
|
60
|
+
display: flex;
|
61
|
+
margin-left: auto;
|
62
|
+
padding: var(--padding-default);
|
63
|
+
}
|
64
|
+
`
|
65
|
+
]
|
65
66
|
|
66
|
-
|
67
|
-
|
68
|
-
dataSet: Object,
|
69
|
-
dataOoc: Object
|
70
|
-
}
|
71
|
-
}
|
67
|
+
@property({ type: Object }) dataSet?: DataSet
|
68
|
+
@property({ type: Object }) dataOoc?: any
|
72
69
|
|
73
|
-
|
74
|
-
|
75
|
-
}
|
70
|
+
@query('textarea') commentTextArea!: HTMLTextAreaElement
|
71
|
+
@query('ox-data-ooc-view') sampleView!: HTMLTextAreaElement
|
76
72
|
|
77
73
|
render() {
|
78
|
-
const state = this.dataOoc
|
74
|
+
const state = this.dataOoc?.state
|
79
75
|
|
80
76
|
return html`
|
81
77
|
<div content>
|
82
78
|
<ox-data-ooc-view .dataSet=${this.dataSet} .dataOoc=${this.dataOoc}></ox-data-ooc-view>
|
83
79
|
</div>
|
84
80
|
|
85
|
-
${
|
86
|
-
|
87
|
-
? html`
|
81
|
+
${state === 'CREATED' || state === 'REVIEWED'
|
82
|
+
? html`
|
88
83
|
<label comment>
|
89
84
|
<div><mwc-icon>build_circle</mwc-icon> <span>correction activity</span></div>
|
90
85
|
<textarea placeholder="조치 내용을 입력해주세요."></textarea>
|
91
86
|
</label>
|
92
87
|
`
|
93
|
-
|
94
|
-
}
|
88
|
+
: html``}
|
95
89
|
|
96
90
|
<div class="button-container">
|
97
|
-
${
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
: html``
|
107
|
-
}
|
91
|
+
${state === 'CREATED'
|
92
|
+
? html`<mwc-button raised @click=${() => this._processOoc('REVIEWED')}
|
93
|
+
>${i18next.t('button.reviewed')}</mwc-button
|
94
|
+
>`
|
95
|
+
: state === 'REVIEWED'
|
96
|
+
? html`<mwc-button raised @click=${() => this._processOoc('CORRECTED')}
|
97
|
+
>${i18next.t('button.corrected')}</mwc-button
|
98
|
+
>`
|
99
|
+
: html``}
|
108
100
|
</div>
|
109
101
|
`
|
110
102
|
}
|
@@ -142,7 +134,7 @@ class DataOocView extends localize(i18next)(LitElement) {
|
|
142
134
|
}
|
143
135
|
`,
|
144
136
|
variables: {
|
145
|
-
id: this.dataOoc
|
137
|
+
id: this.dataOoc?.dataSet?.id
|
146
138
|
}
|
147
139
|
})
|
148
140
|
|
@@ -151,7 +143,7 @@ class DataOocView extends localize(i18next)(LitElement) {
|
|
151
143
|
}
|
152
144
|
|
153
145
|
async _processOoc(state) {
|
154
|
-
const commentTextArea = this.
|
146
|
+
const commentTextArea = this.commentTextArea
|
155
147
|
const comment = commentTextArea && commentTextArea.value
|
156
148
|
if (!comment || !comment.trim()) {
|
157
149
|
commentTextArea.focus()
|
@@ -172,7 +164,7 @@ class DataOocView extends localize(i18next)(LitElement) {
|
|
172
164
|
}
|
173
165
|
`,
|
174
166
|
variables: {
|
175
|
-
id: this.dataOoc
|
167
|
+
id: this.dataOoc?.id,
|
176
168
|
patch
|
177
169
|
}
|
178
170
|
})
|
@@ -184,5 +176,3 @@ class DataOocView extends localize(i18next)(LitElement) {
|
|
184
176
|
}
|
185
177
|
}
|
186
178
|
}
|
187
|
-
|
188
|
-
window.customElements.define('data-ooc-view', DataOocView)
|
@@ -6,41 +6,34 @@ import '@operato/data-grist'
|
|
6
6
|
import '@things-factory/form-ui'
|
7
7
|
|
8
8
|
import { css, html } from 'lit'
|
9
|
+
import { customElement, property, query, state } from 'lit/decorators.js'
|
9
10
|
|
11
|
+
import { PageView } from '@operato/shell'
|
10
12
|
import { i18next, localize } from '@operato/i18n'
|
11
13
|
import { CommonButtonStyles, ScrollbarStyles } from '@operato/styles'
|
12
|
-
import {
|
13
|
-
import { encodeUrlParams, getCookie } from '@things-factory/utils'
|
14
|
+
import { encodeUrlParams } from '@operato/utils'
|
14
15
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
16
|
+
@customElement('data-report-embed-page')
|
17
|
+
export class DataReportEmbedPage extends localize(i18next)(PageView) {
|
18
|
+
static styles = [
|
19
|
+
ScrollbarStyles,
|
20
|
+
css`
|
21
|
+
:host {
|
22
|
+
display: flex;
|
23
|
+
flex-direction: column;
|
24
|
+
padding: 0;
|
25
|
+
}
|
24
26
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
:
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
}
|
27
|
+
#container {
|
28
|
+
flex: 1;
|
29
|
+
padding: 0;
|
30
|
+
margin: 0;
|
31
|
+
border: 0;
|
32
|
+
}
|
33
|
+
`
|
34
|
+
]
|
34
35
|
|
35
|
-
|
36
|
-
flex: 1;
|
37
|
-
padding: 0;
|
38
|
-
margin: 0;
|
39
|
-
border: 0;
|
40
|
-
}
|
41
|
-
`
|
42
|
-
]
|
43
|
-
}
|
36
|
+
@query('iframe') iframe!: HTMLIFrameElement
|
44
37
|
|
45
38
|
get context() {
|
46
39
|
const filters = [
|
@@ -55,7 +48,7 @@ class DataReportEmbedPage extends localize(i18next)(PageView) {
|
|
55
48
|
{
|
56
49
|
title: i18next.t('button.print'),
|
57
50
|
action: () => {
|
58
|
-
this.
|
51
|
+
this.iframe.contentWindow?.print()
|
59
52
|
},
|
60
53
|
...CommonButtonStyles.print
|
61
54
|
}
|
@@ -76,7 +69,7 @@ class DataReportEmbedPage extends localize(i18next)(PageView) {
|
|
76
69
|
}}
|
77
70
|
?url-params-sensitive=${this.active}
|
78
71
|
></ox-filters-form-base>
|
79
|
-
<iframe
|
72
|
+
<iframe frameborder="0" style="border:0"></iframe>
|
80
73
|
`
|
81
74
|
}
|
82
75
|
|
@@ -110,8 +103,6 @@ class DataReportEmbedPage extends localize(i18next)(PageView) {
|
|
110
103
|
|
111
104
|
const encodedUrlParams = encodeUrlParams(urlParams)
|
112
105
|
|
113
|
-
this.
|
106
|
+
this.iframe.src = `/data-report/${reportType}/?${encodedUrlParams}`
|
114
107
|
}
|
115
108
|
}
|
116
|
-
|
117
|
-
window.customElements.define('data-report-embed-page', DataReportEmbedPage)
|
@@ -3,17 +3,20 @@ import '@operato/board/ox-board-viewer.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
|
|
8
|
-
import { getRenderer } from '@operato/data-grist'
|
9
|
+
import { getEditor, getRenderer, ColumnConfig, DataGrist, FetchOption, SortersControl } from '@operato/data-grist'
|
9
10
|
import { OxDataUseCase } from '@operato/dataset'
|
10
11
|
import { client } from '@operato/graphql'
|
11
12
|
import { i18next, localize } from '@operato/i18n'
|
12
13
|
import { openPopup } from '@operato/layout'
|
13
14
|
import { navigate, PageView, store } from '@operato/shell'
|
14
15
|
import { CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
16
|
+
import { OxPopup } from '@operato/popup'
|
17
|
+
import { encodeUrlParams } from '@operato/utils'
|
18
|
+
|
15
19
|
import { provider } from '@things-factory/board-ui'
|
16
|
-
import { encodeUrlParams } from '@things-factory/utils'
|
17
20
|
|
18
21
|
const USECASE_OPTIONS = () => {
|
19
22
|
return ['', ...OxDataUseCase.getUseCaseNames()].map(name => {
|
@@ -62,6 +65,9 @@ const showMonitorView = (columns, data, column, record, rowIndex) => {
|
|
62
65
|
// navigate(`board-viewer/${monitorView}?interactive=true&title=${title}`)
|
63
66
|
break
|
64
67
|
|
68
|
+
case 'custom-element':
|
69
|
+
break
|
70
|
+
|
65
71
|
case 'page':
|
66
72
|
navigate(monitorView)
|
67
73
|
break
|
@@ -73,8 +79,8 @@ const showMonitorView = (columns, data, column, record, rowIndex) => {
|
|
73
79
|
}
|
74
80
|
|
75
81
|
const showReportView = (columns, data, column, record, rowIndex) => {
|
76
|
-
const { id:datasetId, dataKeySet, name, reportType, reportView, reportTemplate } = record
|
77
|
-
const { id:dataKeySetId } = dataKeySet || { id: '' }
|
82
|
+
const { id: datasetId, dataKeySet, name, reportType, reportView, reportTemplate } = record
|
83
|
+
const { id: dataKeySetId } = dataKeySet || { id: '' }
|
78
84
|
const title = `${name} - ${i18next.t('title.data-report-view')}`
|
79
85
|
|
80
86
|
switch (reportType) {
|
@@ -89,55 +95,63 @@ const showReportView = (columns, data, column, record, rowIndex) => {
|
|
89
95
|
case 'embed':
|
90
96
|
break
|
91
97
|
|
98
|
+
case 'custom-element':
|
99
|
+
break
|
100
|
+
|
92
101
|
case 'page':
|
93
102
|
break
|
94
103
|
|
95
104
|
case 'external':
|
96
105
|
window.open(reportView, '_blank')
|
97
106
|
break
|
98
|
-
|
107
|
+
|
99
108
|
case 'jasper':
|
100
109
|
case 'shiny':
|
101
110
|
const encodedUrlParams = encodeUrlParams({ datasetId, dataKeySetId, reportType, reportView, reportTemplate })
|
102
111
|
navigate(`/data-report-samples/?${encodedUrlParams}`)
|
103
112
|
break
|
104
|
-
|
113
|
+
|
105
114
|
default:
|
106
115
|
break
|
107
116
|
}
|
108
117
|
}
|
109
118
|
|
119
|
+
@customElement('data-report-list-page')
|
110
120
|
export class DataReportListPage extends connect(store)(localize(i18next)(PageView)) {
|
111
|
-
static
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
mode: String
|
118
|
-
}
|
119
|
-
}
|
121
|
+
static styles = [
|
122
|
+
ScrollbarStyles,
|
123
|
+
CommonGristStyles,
|
124
|
+
css`
|
125
|
+
:host {
|
126
|
+
display: flex;
|
120
127
|
|
121
|
-
|
122
|
-
return [
|
123
|
-
ScrollbarStyles,
|
124
|
-
CommonGristStyles,
|
125
|
-
css`
|
126
|
-
:host {
|
127
|
-
display: flex;
|
128
|
+
width: 100%;
|
128
129
|
|
129
|
-
|
130
|
+
--grid-record-emphasized-background-color: red;
|
131
|
+
--grid-record-emphasized-color: yellow;
|
132
|
+
}
|
133
|
+
`
|
134
|
+
]
|
130
135
|
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
]
|
136
|
-
}
|
136
|
+
@state() gristConfig: any
|
137
|
+
@state() mode: 'CARD' | 'GRID' | 'LIST' = 'CARD'
|
138
|
+
@query('ox-grist') private grist!: DataGrist
|
139
|
+
@query('#sorter-control') private sortersControl!: OxPopup
|
137
140
|
|
138
141
|
get context() {
|
139
142
|
return {
|
140
|
-
|
143
|
+
search: {
|
144
|
+
handler: (search: string) => {
|
145
|
+
this.grist.searchText = search
|
146
|
+
},
|
147
|
+
placeholder: i18next.t('title.data-report list'),
|
148
|
+
value: this.grist.searchText
|
149
|
+
},
|
150
|
+
filter: {
|
151
|
+
handler: () => {
|
152
|
+
this.grist.toggleHeadroom()
|
153
|
+
}
|
154
|
+
},
|
141
155
|
help: 'dataset/data-report-list'
|
142
156
|
}
|
143
157
|
}
|
@@ -149,13 +163,12 @@ export class DataReportListPage extends connect(store)(localize(i18next)(PageVie
|
|
149
163
|
<ox-grist
|
150
164
|
.mode=${mode}
|
151
165
|
.config=${this.gristConfig}
|
152
|
-
.filters=${this.filters}
|
153
|
-
.orders=${this.orders}
|
154
166
|
.fetchHandler=${this.fetchHandler.bind(this)}
|
167
|
+
?url-params-sensitive=${this.active}
|
155
168
|
>
|
156
169
|
<div slot="headroom">
|
157
170
|
<div id="filters">
|
158
|
-
<ox-filters-form autofocus></ox-filters-form>
|
171
|
+
<ox-filters-form autofocus without-search></ox-filters-form>
|
159
172
|
</div>
|
160
173
|
|
161
174
|
<div id="sorters">
|
@@ -163,7 +176,7 @@ export class DataReportListPage extends connect(store)(localize(i18next)(PageVie
|
|
163
176
|
<mwc-icon
|
164
177
|
@click=${e => {
|
165
178
|
const target = e.currentTarget
|
166
|
-
this.
|
179
|
+
this.sortersControl.open({
|
167
180
|
right: 0,
|
168
181
|
top: target.offsetTop + target.offsetHeight
|
169
182
|
})
|
@@ -179,10 +192,6 @@ export class DataReportListPage extends connect(store)(localize(i18next)(PageVie
|
|
179
192
|
`
|
180
193
|
}
|
181
194
|
|
182
|
-
get grist() {
|
183
|
-
return this.renderRoot.querySelector('ox-grist')
|
184
|
-
}
|
185
|
-
|
186
195
|
async pageInitialized(lifecycle) {
|
187
196
|
this.gristConfig = {
|
188
197
|
list: {
|
@@ -275,8 +284,7 @@ export class DataReportListPage extends connect(store)(localize(i18next)(PageVie
|
|
275
284
|
record: {
|
276
285
|
editable: false
|
277
286
|
},
|
278
|
-
width: 80
|
279
|
-
label: true
|
287
|
+
width: 80
|
280
288
|
},
|
281
289
|
{
|
282
290
|
type: 'resource-object',
|
@@ -358,7 +366,7 @@ export class DataReportListPage extends connect(store)(localize(i18next)(PageVie
|
|
358
366
|
}
|
359
367
|
}
|
360
368
|
|
361
|
-
async fetchHandler({ page, limit, sortings = [], filters = [] }) {
|
369
|
+
async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {
|
362
370
|
const response = await client.query({
|
363
371
|
query: gql`
|
364
372
|
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
@@ -430,5 +438,3 @@ export class DataReportListPage extends connect(store)(localize(i18next)(PageVie
|
|
430
438
|
}
|
431
439
|
}
|
432
440
|
}
|
433
|
-
|
434
|
-
window.customElements.define('data-report-list-page', DataReportListPage)
|
package/client/pages/data-report/{data-report-samples-page.js → data-report-samples-page.ts}
RENAMED
@@ -6,46 +6,41 @@ import '@operato/data-grist'
|
|
6
6
|
|
7
7
|
import gql from 'graphql-tag'
|
8
8
|
import { css, html } from 'lit'
|
9
|
+
import { customElement, property, query, state } from 'lit/decorators.js'
|
9
10
|
import { connect } from 'pwa-helpers/connect-mixin'
|
10
11
|
|
11
12
|
import { client } from '@operato/graphql'
|
12
13
|
import { i18next, localize } from '@operato/i18n'
|
13
14
|
import { PageView, store } from '@operato/shell'
|
14
15
|
import { ScrollbarStyles } from '@operato/styles'
|
16
|
+
import { encodeUrlParams } from '@operato/utils'
|
17
|
+
import { FetchOption } from '@operato/data-grist'
|
15
18
|
|
16
|
-
|
17
|
-
|
19
|
+
@customElement('data-report-samples-page')
|
18
20
|
export class DataReportSamplesPage extends connect(store)(localize(i18next)(PageView)) {
|
19
|
-
static
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
21
|
+
static styles = [
|
22
|
+
ScrollbarStyles,
|
23
|
+
css`
|
24
|
+
:host {
|
25
|
+
display: flex;
|
26
|
+
flex-direction: column;
|
27
|
+
padding: 0;
|
28
|
+
}
|
26
29
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
:
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
}
|
30
|
+
#container {
|
31
|
+
flex: 1;
|
32
|
+
padding: 0;
|
33
|
+
margin: 0;
|
34
|
+
border: 0;
|
35
|
+
}
|
36
|
+
`
|
37
|
+
]
|
36
38
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
margin: 0;
|
41
|
-
border: 0;
|
42
|
-
}
|
43
|
-
`
|
44
|
-
]
|
45
|
-
}
|
39
|
+
@state() dataKeySetId?: string
|
40
|
+
@state() dataKeySet: any
|
41
|
+
@query('iframe') container!: HTMLIFrameElement
|
46
42
|
|
47
43
|
get context() {
|
48
|
-
|
49
44
|
const today = new Date().toISOString().split('T')[0]
|
50
45
|
|
51
46
|
const filters = [
|
@@ -82,12 +77,7 @@ export class DataReportSamplesPage extends connect(store)(localize(i18next)(Page
|
|
82
77
|
|
83
78
|
render() {
|
84
79
|
// clear if pre-loaded
|
85
|
-
|
86
|
-
if (container) {
|
87
|
-
container.src = ""
|
88
|
-
// @TODO: Clear filters
|
89
|
-
/** */
|
90
|
-
}
|
80
|
+
this.container.src = ''
|
91
81
|
|
92
82
|
return html`
|
93
83
|
<ox-filters-form-base
|
@@ -98,7 +88,8 @@ export class DataReportSamplesPage extends connect(store)(localize(i18next)(Page
|
|
98
88
|
}}
|
99
89
|
?url-params-sensitive=${this.active}
|
100
90
|
></ox-filters-form-base>
|
101
|
-
|
91
|
+
|
92
|
+
<iframe></iframe>
|
102
93
|
`
|
103
94
|
}
|
104
95
|
|
@@ -132,7 +123,7 @@ export class DataReportSamplesPage extends connect(store)(localize(i18next)(Page
|
|
132
123
|
const encodedUrlParams = encodeUrlParams(urlParams)
|
133
124
|
|
134
125
|
const reportUrl = `/data-report/${urlParams.reportType}/`
|
135
|
-
this.
|
126
|
+
this.container.src = `${reportUrl}?${encodedUrlParams}`
|
136
127
|
}
|
137
128
|
|
138
129
|
pageUpdated(changes, lifecycle) {
|
@@ -143,14 +134,12 @@ export class DataReportSamplesPage extends connect(store)(localize(i18next)(Page
|
|
143
134
|
}
|
144
135
|
}
|
145
136
|
|
146
|
-
async fetchHandler({ page, limit, sortings = [], filters = [] }) {
|
147
|
-
|
148
|
-
}
|
137
|
+
async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {}
|
149
138
|
|
150
139
|
async updated(changes) {
|
151
140
|
if (changes.has('dataKeySetId')) {
|
152
141
|
if (!this.dataKeySetId) {
|
153
|
-
this.dataKeySet
|
142
|
+
this.dataKeySet = null
|
154
143
|
return
|
155
144
|
}
|
156
145
|
|
@@ -180,7 +169,4 @@ export class DataReportSamplesPage extends connect(store)(localize(i18next)(Page
|
|
180
169
|
this.dataKeySet = response.data.dataKeySet
|
181
170
|
}
|
182
171
|
}
|
183
|
-
|
184
172
|
}
|
185
|
-
|
186
|
-
window.customElements.define('data-report-samples-page', DataReportSamplesPage)
|