@things-factory/dataset 7.0.1-alpha.13 → 7.0.1-alpha.19
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/client/activities/activity-ooc-resolve-edit.ts +3 -3
- package/client/activities/activity-ooc-review-edit.ts +3 -2
- package/client/pages/data-archive/data-archive-list-page.ts +5 -14
- package/client/pages/data-entry/data-entry-list-page.ts +2 -1
- package/client/pages/data-key-set/data-key-set-list-page.ts +2 -1
- package/client/pages/data-ooc/data-ooc-list-page.ts +2 -1
- package/client/pages/data-ooc/data-ooc-view.ts +7 -6
- package/client/pages/data-report/data-report-list-page.ts +9 -24
- package/client/pages/data-sample/data-sample-list-page.ts +2 -1
- package/client/pages/data-sample/data-sample-search-page.ts +2 -1
- package/client/pages/data-sample/data-sample-view.ts +7 -5
- package/client/pages/data-sensor/data-sensor-list-page.ts +2 -1
- package/client/pages/data-set/data-set-list-page.ts +2 -1
- package/client/pages/data-summary/data-summary-list-page.ts +2 -1
- package/client/pages/data-summary/data-summary-period-page.ts +5 -20
- package/client/pages/data-summary/data-summary-search-page.ts +11 -31
- package/dist-client/activities/activity-ooc-resolve-edit.d.ts +1 -0
- package/dist-client/activities/activity-ooc-resolve-edit.js +3 -3
- package/dist-client/activities/activity-ooc-resolve-edit.js.map +1 -1
- package/dist-client/activities/activity-ooc-review-edit.d.ts +1 -0
- package/dist-client/activities/activity-ooc-review-edit.js +3 -2
- package/dist-client/activities/activity-ooc-review-edit.js.map +1 -1
- package/dist-client/pages/data-archive/data-archive-list-page.d.ts +1 -0
- package/dist-client/pages/data-archive/data-archive-list-page.js +5 -14
- package/dist-client/pages/data-archive/data-archive-list-page.js.map +1 -1
- package/dist-client/pages/data-entry/data-entry-list-page.d.ts +1 -0
- package/dist-client/pages/data-entry/data-entry-list-page.js +2 -1
- package/dist-client/pages/data-entry/data-entry-list-page.js.map +1 -1
- package/dist-client/pages/data-key-set/data-key-set-list-page.d.ts +1 -0
- package/dist-client/pages/data-key-set/data-key-set-list-page.js +2 -1
- package/dist-client/pages/data-key-set/data-key-set-list-page.js.map +1 -1
- package/dist-client/pages/data-ooc/data-ooc-list-page.d.ts +1 -0
- package/dist-client/pages/data-ooc/data-ooc-list-page.js +2 -1
- package/dist-client/pages/data-ooc/data-ooc-list-page.js.map +1 -1
- package/dist-client/pages/data-ooc/data-ooc-view.d.ts +2 -1
- package/dist-client/pages/data-ooc/data-ooc-view.js +7 -6
- package/dist-client/pages/data-ooc/data-ooc-view.js.map +1 -1
- package/dist-client/pages/data-report/data-report-list-page.d.ts +1 -0
- package/dist-client/pages/data-report/data-report-list-page.js +4 -16
- package/dist-client/pages/data-report/data-report-list-page.js.map +1 -1
- package/dist-client/pages/data-sample/data-sample-list-page.d.ts +1 -0
- package/dist-client/pages/data-sample/data-sample-list-page.js +2 -1
- package/dist-client/pages/data-sample/data-sample-list-page.js.map +1 -1
- package/dist-client/pages/data-sample/data-sample-search-page.d.ts +1 -0
- package/dist-client/pages/data-sample/data-sample-search-page.js +2 -1
- package/dist-client/pages/data-sample/data-sample-search-page.js.map +1 -1
- package/dist-client/pages/data-sample/data-sample-view.d.ts +2 -0
- package/dist-client/pages/data-sample/data-sample-view.js +7 -5
- package/dist-client/pages/data-sample/data-sample-view.js.map +1 -1
- package/dist-client/pages/data-sensor/data-sensor-list-page.d.ts +1 -0
- package/dist-client/pages/data-sensor/data-sensor-list-page.js +2 -1
- package/dist-client/pages/data-sensor/data-sensor-list-page.js.map +1 -1
- package/dist-client/pages/data-set/data-set-list-page.d.ts +1 -0
- package/dist-client/pages/data-set/data-set-list-page.js +2 -1
- package/dist-client/pages/data-set/data-set-list-page.js.map +1 -1
- package/dist-client/pages/data-summary/data-summary-list-page.d.ts +1 -0
- package/dist-client/pages/data-summary/data-summary-list-page.js +2 -1
- package/dist-client/pages/data-summary/data-summary-list-page.js.map +1 -1
- package/dist-client/pages/data-summary/data-summary-period-page.d.ts +1 -0
- package/dist-client/pages/data-summary/data-summary-period-page.js +5 -20
- package/dist-client/pages/data-summary/data-summary-period-page.js.map +1 -1
- package/dist-client/pages/data-summary/data-summary-search-page.d.ts +1 -0
- package/dist-client/pages/data-summary/data-summary-search-page.js +6 -15
- package/dist-client/pages/data-summary/data-summary-search-page.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/package.json +12 -14
@@ -1,5 +1,5 @@
|
|
1
|
+
import '@material/web/icon/icon.js'
|
1
2
|
import '@operato/dataset/ox-data-ooc-brief-view.js'
|
2
|
-
// import '@operato/dataset/ox-data-ooc-correction-part.js'
|
3
3
|
|
4
4
|
import gql from 'graphql-tag'
|
5
5
|
import { css, html, LitElement, nothing } from 'lit'
|
@@ -51,7 +51,7 @@ class OocResolveActivityEdit extends localize(i18next)(LitElement) {
|
|
51
51
|
align-items: center;
|
52
52
|
}
|
53
53
|
|
54
|
-
|
54
|
+
md-icon {
|
55
55
|
color: var(--status-danger-color);
|
56
56
|
}
|
57
57
|
|
@@ -92,7 +92,7 @@ class OocResolveActivityEdit extends localize(i18next)(LitElement) {
|
|
92
92
|
${editable
|
93
93
|
? html`
|
94
94
|
<label action>
|
95
|
-
<h2><
|
95
|
+
<h2><md-icon>build_circle</md-icon> <span>${i18next.t('label.corrective action')}</span></h2>
|
96
96
|
<textarea placeholder=${String(i18next.t('text.corrective action placeholder'))} .value=${action || ''} @change=${this.onChangeAction}></textarea>
|
97
97
|
</label>
|
98
98
|
`
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import '@material/web/icon/icon.js'
|
1
2
|
import '@operato/dataset/ox-data-sample-view.js'
|
2
3
|
|
3
4
|
import gql from 'graphql-tag'
|
@@ -54,7 +55,7 @@ class OocReviewActivityEdit extends localize(i18next)(LitElement) {
|
|
54
55
|
font: var(--input-field-font);
|
55
56
|
}
|
56
57
|
|
57
|
-
|
58
|
+
md-icon {
|
58
59
|
color: var(--status-danger-color);
|
59
60
|
}
|
60
61
|
|
@@ -90,7 +91,7 @@ class OocReviewActivityEdit extends localize(i18next)(LitElement) {
|
|
90
91
|
</div>
|
91
92
|
|
92
93
|
<label instruction>
|
93
|
-
<h2><
|
94
|
+
<h2><md-icon>build_circle</md-icon> <span>${i18next.t('label.corrective instruction')}</span></h2>
|
94
95
|
${editable
|
95
96
|
? html`
|
96
97
|
<textarea
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import '@material/web/icon/icon.js'
|
1
2
|
import '@operato/data-grist'
|
2
3
|
import '@operato/context/ox-context-page-toolbar.js'
|
3
4
|
|
@@ -77,15 +78,10 @@ export class DataArchiveListPage extends connect(store)(localize(i18next)(PageVi
|
|
77
78
|
const mode = this.mode || (isMobileDevice() ? 'LIST' : 'GRID')
|
78
79
|
|
79
80
|
return html`
|
80
|
-
<ox-grist
|
81
|
-
.mode=${mode}
|
82
|
-
.config=${this.gristConfig}
|
83
|
-
.fetchHandler=${this.fetchHandler.bind(this)}
|
84
|
-
?url-params-sensitive=${false /* this.active */}
|
85
|
-
>
|
81
|
+
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)} ?url-params-sensitive=${false /* this.active */}>
|
86
82
|
<div slot="headroom" class="header">
|
87
83
|
<div class="title">
|
88
|
-
<
|
84
|
+
<md-icon>apps</md-icon>
|
89
85
|
${i18next.t('title.data-archive list')}
|
90
86
|
</div>
|
91
87
|
|
@@ -185,10 +181,7 @@ export class DataArchiveListPage extends connect(store)(localize(i18next)(PageVi
|
|
185
181
|
|
186
182
|
async openArchivePopup() {
|
187
183
|
this.popup = openPopup(
|
188
|
-
html` <data-archive-request-popup
|
189
|
-
@requested=${this.closePopupAndRefesh.bind(this)}
|
190
|
-
@created=${this.closePopupAndRefesh.bind(this)}
|
191
|
-
></data-archive-request-popup>`,
|
184
|
+
html` <data-archive-request-popup @requested=${this.closePopupAndRefesh.bind(this)} @created=${this.closePopupAndRefesh.bind(this)}></data-archive-request-popup>`,
|
192
185
|
{
|
193
186
|
backdrop: true,
|
194
187
|
size: 'small',
|
@@ -264,9 +257,7 @@ export class DataArchiveListPage extends connect(store)(localize(i18next)(PageVi
|
|
264
257
|
.filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)
|
265
258
|
.reduce((record, column) => {
|
266
259
|
const key = column.imex === true ? column.name : column.imex.key
|
267
|
-
record[key] = key
|
268
|
-
.split('.')
|
269
|
-
.reduce((obj, key) => (obj && obj[key] !== 'undefined' ? obj[key] : undefined), item)
|
260
|
+
record[key] = key.split('.').reduce((obj, key) => (obj && obj[key] !== 'undefined' ? obj[key] : undefined), item)
|
270
261
|
return record
|
271
262
|
}, {})
|
272
263
|
}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import '@material/web/icon/icon.js'
|
1
2
|
import '@operato/data-grist'
|
2
3
|
import '@operato/context/ox-context-page-toolbar.js'
|
3
4
|
import '@operato/board/ox-board-viewer.js'
|
@@ -121,7 +122,7 @@ export class DataEntryListPage extends connect(store)(localize(i18next)(PageView
|
|
121
122
|
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)} ?url-params-sensitive=${this.active}>
|
122
123
|
<div slot="headroom" class="header">
|
123
124
|
<div class="title">
|
124
|
-
<
|
125
|
+
<md-icon>apps</md-icon>
|
125
126
|
${i18next.t('title.data-entry list')}
|
126
127
|
</div>
|
127
128
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import '@material/web/icon/icon.js'
|
1
2
|
import '@operato/data-grist'
|
2
3
|
import '@operato/context/ox-context-page-toolbar.js'
|
3
4
|
import './data-key-set-importer.js'
|
@@ -123,7 +124,7 @@ export class DataKeySetListPage extends connect(store)(localize(i18next)(PageVie
|
|
123
124
|
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
|
124
125
|
<div slot="headroom" class="header">
|
125
126
|
<div class="title">
|
126
|
-
<
|
127
|
+
<md-icon>apps</md-icon>
|
127
128
|
${i18next.t('title.data-key-set list')}
|
128
129
|
</div>
|
129
130
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import '@material/web/icon/icon.js'
|
1
2
|
import '@operato/data-grist'
|
2
3
|
import '@operato/context/ox-context-page-toolbar.js'
|
3
4
|
import '@operato/input/ox-input-select-buttons.js'
|
@@ -101,7 +102,7 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
|
|
101
102
|
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
|
102
103
|
<div slot="headroom" class="header">
|
103
104
|
<div class="title">
|
104
|
-
<
|
105
|
+
<md-icon>apps</md-icon>
|
105
106
|
${i18next.t('title.data-ooc list')}
|
106
107
|
</div>
|
107
108
|
|
@@ -1,5 +1,6 @@
|
|
1
|
+
import '@material/web/icon/icon.js'
|
2
|
+
import '@material/web/fab/fab.js'
|
1
3
|
import '@operato/dataset/ox-data-ooc-brief-view.js'
|
2
|
-
import '@material/mwc-fab'
|
3
4
|
import '@things-factory/worklist/dist-client/components/activity-thread-timeline.js'
|
4
5
|
|
5
6
|
import gql from 'graphql-tag'
|
@@ -32,7 +33,7 @@ export class DataOocView extends localize(i18next)(LitElement) {
|
|
32
33
|
margin: var(--margin-default);
|
33
34
|
}
|
34
35
|
|
35
|
-
|
36
|
+
md-fab {
|
36
37
|
position: fixed;
|
37
38
|
bottom: 15px;
|
38
39
|
right: 16px;
|
@@ -41,7 +42,7 @@ export class DataOocView extends localize(i18next)(LitElement) {
|
|
41
42
|
}
|
42
43
|
|
43
44
|
@media print {
|
44
|
-
|
45
|
+
md-fab {
|
45
46
|
display: none;
|
46
47
|
}
|
47
48
|
}
|
@@ -87,15 +88,15 @@ export class DataOocView extends localize(i18next)(LitElement) {
|
|
87
88
|
`
|
88
89
|
: nothing}
|
89
90
|
|
90
|
-
<
|
91
|
-
icon="print"
|
91
|
+
<md-fab
|
92
92
|
title="print"
|
93
93
|
@click=${() =>
|
94
94
|
GhostPrint.print({
|
95
95
|
src: `./data-ooc/${this.dataOoc.id}`
|
96
96
|
})}
|
97
|
-
>print</mwc-fab
|
98
97
|
>
|
98
|
+
<md-icon slot="icon">print</md-icon>
|
99
|
+
</md-fab>
|
99
100
|
`
|
100
101
|
}
|
101
102
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import '@material/web/icon/icon.js'
|
1
2
|
import '@operato/data-grist'
|
2
3
|
import '@operato/context/ox-context-page-toolbar.js'
|
3
4
|
import '@operato/board/ox-board-viewer.js'
|
@@ -44,23 +45,12 @@ const showMonitorView = (columns, data, column, record, rowIndex) => {
|
|
44
45
|
const board = {
|
45
46
|
id: monitorView
|
46
47
|
}
|
47
|
-
openPopup(
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
hide-fullscreen
|
54
|
-
hide-navigation
|
55
|
-
></ox-board-viewer>
|
56
|
-
`,
|
57
|
-
{
|
58
|
-
closable: true,
|
59
|
-
backdrop: true,
|
60
|
-
size: 'large',
|
61
|
-
title
|
62
|
-
}
|
63
|
-
)
|
48
|
+
openPopup(html` <ox-board-viewer style="background-color: white;" .board=${board} .provider=${provider} hide-fullscreen hide-navigation></ox-board-viewer> `, {
|
49
|
+
closable: true,
|
50
|
+
backdrop: true,
|
51
|
+
size: 'large',
|
52
|
+
title
|
53
|
+
})
|
64
54
|
|
65
55
|
// navigate(`board-viewer/${monitorView}?interactive=true&title=${title}`)
|
66
56
|
break
|
@@ -166,15 +156,10 @@ export class DataReportListPage extends connect(store)(localize(i18next)(PageVie
|
|
166
156
|
const mode = 'CARD'
|
167
157
|
|
168
158
|
return html`
|
169
|
-
<ox-grist
|
170
|
-
.mode=${mode}
|
171
|
-
.config=${this.gristConfig}
|
172
|
-
.fetchHandler=${this.fetchHandler.bind(this)}
|
173
|
-
?url-params-sensitive=${this.active}
|
174
|
-
>
|
159
|
+
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)} ?url-params-sensitive=${this.active}>
|
175
160
|
<div slot="headroom" class="header">
|
176
161
|
<div class="title">
|
177
|
-
<
|
162
|
+
<md-icon>apps</md-icon>
|
178
163
|
${i18next.t('title.data-report list')}
|
179
164
|
</div>
|
180
165
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import '@material/web/icon/icon.js'
|
1
2
|
import '@operato/data-grist'
|
2
3
|
import '@operato/context/ox-context-page-toolbar.js'
|
3
4
|
import './data-sample-view.js'
|
@@ -81,7 +82,7 @@ export class DataSampleListPage extends connect(store)(localize(i18next)(PageVie
|
|
81
82
|
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)} ?url-params-sensitive=${false /* this.active */}>
|
82
83
|
<div slot="headroom" class="header">
|
83
84
|
<div class="title">
|
84
|
-
<
|
85
|
+
<md-icon>apps</md-icon>
|
85
86
|
${i18next.t('title.data-sample list')}
|
86
87
|
</div>
|
87
88
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import '@material/web/icon/icon.js'
|
1
2
|
import '@operato/data-grist'
|
2
3
|
import '@operato/context/ox-context-page-toolbar.js'
|
3
4
|
import './data-sample-view.js'
|
@@ -83,7 +84,7 @@ export class DataSampleSearchPage extends connect(store)(localize(i18next)(PageV
|
|
83
84
|
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
|
84
85
|
<div slot="headroom" class="header">
|
85
86
|
<div class="title">
|
86
|
-
<
|
87
|
+
<md-icon>apps</md-icon>
|
87
88
|
${i18next.t('title.data-sample search')}
|
88
89
|
</div>
|
89
90
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
import '@material/web/icon/icon.js'
|
2
|
+
import '@material/web/fab/fab.js'
|
1
3
|
import '@operato/dataset/ox-data-sample-view.js'
|
2
4
|
import '@operato/dataset/ox-data-ooc-brief-view.js'
|
3
5
|
import '@things-factory/worklist/dist-client/components/activity-thread-timeline.js'
|
@@ -33,7 +35,7 @@ export class DataSampleView extends localize(i18next)(LitElement) {
|
|
33
35
|
margin: var(--margin-default);
|
34
36
|
}
|
35
37
|
|
36
|
-
|
38
|
+
md-fab {
|
37
39
|
position: fixed;
|
38
40
|
bottom: 15px;
|
39
41
|
right: 16px;
|
@@ -42,7 +44,7 @@ export class DataSampleView extends localize(i18next)(LitElement) {
|
|
42
44
|
}
|
43
45
|
|
44
46
|
@media print {
|
45
|
-
|
47
|
+
md-fab {
|
46
48
|
display: none;
|
47
49
|
}
|
48
50
|
}
|
@@ -96,15 +98,15 @@ export class DataSampleView extends localize(i18next)(LitElement) {
|
|
96
98
|
`
|
97
99
|
: nothing}
|
98
100
|
|
99
|
-
<
|
100
|
-
icon="print"
|
101
|
+
<md-fab
|
101
102
|
title="print"
|
102
103
|
@click=${() =>
|
103
104
|
GhostPrint.print({
|
104
105
|
src: `./data-sample/${this.dataSampleId}`
|
105
106
|
})}
|
106
|
-
>print</mwc-fab
|
107
107
|
>
|
108
|
+
<md-icon slot="icon">print</md-icon>
|
109
|
+
</md-fab>
|
108
110
|
`
|
109
111
|
}
|
110
112
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import '@material/web/icon/icon.js'
|
1
2
|
import '@operato/data-grist'
|
2
3
|
import '@operato/context/ox-context-page-toolbar.js'
|
3
4
|
|
@@ -93,7 +94,7 @@ export class DataSensorListPage extends connect(store)(localize(i18next)(PageVie
|
|
93
94
|
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)} ?url-params-sensitive=${this.active}>
|
94
95
|
<div slot="headroom" class="header">
|
95
96
|
<div class="title">
|
96
|
-
<
|
97
|
+
<md-icon>apps</md-icon>
|
97
98
|
${i18next.t('title.data-sensor list')}
|
98
99
|
</div>
|
99
100
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import '@material/web/icon/icon.js'
|
1
2
|
import '@operato/data-grist'
|
2
3
|
import '@operato/context/ox-context-page-toolbar.js'
|
3
4
|
import './data-item-list.js'
|
@@ -152,7 +153,7 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
|
|
152
153
|
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)} ?url-params-sensitive=${this.active}>
|
153
154
|
<div slot="headroom" class="header">
|
154
155
|
<div class="title">
|
155
|
-
<
|
156
|
+
<md-icon>apps</md-icon>
|
156
157
|
${i18next.t('title.data-set list')}
|
157
158
|
</div>
|
158
159
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import '@material/web/icon/icon.js'
|
1
2
|
import '@operato/data-grist'
|
2
3
|
import '@operato/context/ox-context-page-toolbar.js'
|
3
4
|
import './data-summary-view.js'
|
@@ -70,7 +71,7 @@ export class DataSummaryListPage extends connect(store)(localize(i18next)(PageVi
|
|
70
71
|
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)} ?url-params-sensitive=${false /* this.active */}>
|
71
72
|
<div slot="headroom" class="header">
|
72
73
|
<div class="title">
|
73
|
-
<
|
74
|
+
<md-icon>apps</md-icon>
|
74
75
|
${i18next.t('title.data-summary list')}
|
75
76
|
</div>
|
76
77
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import '@material/web/icon/icon.js'
|
1
2
|
import '@operato/input/ox-input-select-buttons.js'
|
2
3
|
import '@operato/data-grist'
|
3
4
|
import '@operato/context/ox-context-page-toolbar.js'
|
@@ -84,7 +85,7 @@ export class DataSummaryGroupPage extends connect(store)(localize(i18next)(PageV
|
|
84
85
|
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
|
85
86
|
<div slot="headroom" class="header">
|
86
87
|
<div class="title">
|
87
|
-
<
|
88
|
+
<md-icon>apps</md-icon>
|
88
89
|
${i18next.t('title.data-summary period')}
|
89
90
|
</div>
|
90
91
|
|
@@ -348,22 +349,8 @@ export class DataSummaryGroupPage extends connect(store)(localize(i18next)(PageV
|
|
348
349
|
|
349
350
|
const response = await client.query({
|
350
351
|
query: gql`
|
351
|
-
query (
|
352
|
-
$dataSetName:
|
353
|
-
$period: String!
|
354
|
-
$dataKeys: [String!]
|
355
|
-
$filters: [Filter!]
|
356
|
-
$pagination: Pagination
|
357
|
-
$sortings: [Sorting!]
|
358
|
-
) {
|
359
|
-
dataSummaryByPeriod(
|
360
|
-
dataSetName: $dataSetName
|
361
|
-
period: $period
|
362
|
-
dataKeys: $dataKeys
|
363
|
-
filters: $filters
|
364
|
-
pagination: $pagination
|
365
|
-
sortings: $sortings
|
366
|
-
) {
|
352
|
+
query ($dataSetName: String!, $period: String!, $dataKeys: [String!], $filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
353
|
+
dataSummaryByPeriod(dataSetName: $dataSetName, period: $period, dataKeys: $dataKeys, filters: $filters, pagination: $pagination, sortings: $sortings) {
|
367
354
|
month
|
368
355
|
date
|
369
356
|
period
|
@@ -426,9 +413,7 @@ export class DataSummaryGroupPage extends connect(store)(localize(i18next)(PageV
|
|
426
413
|
.filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)
|
427
414
|
.reduce((record, column) => {
|
428
415
|
const key = column.imex === true ? column.name : column.imex.key
|
429
|
-
record[key] = key
|
430
|
-
.split('.')
|
431
|
-
.reduce((obj, key) => (obj && obj[key] !== 'undefined' ? obj[key] : undefined), item)
|
416
|
+
record[key] = key.split('.').reduce((obj, key) => (obj && obj[key] !== 'undefined' ? obj[key] : undefined), item)
|
432
417
|
return record
|
433
418
|
}, {})
|
434
419
|
}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import '@material/web/icon/icon.js'
|
1
2
|
import '@operato/data-grist'
|
2
3
|
import '@operato/context/ox-context-page-toolbar.js'
|
3
4
|
import './data-summary-view.js'
|
@@ -8,15 +9,7 @@ import { css, html } from 'lit'
|
|
8
9
|
import { customElement, property, query, state } from 'lit/decorators.js'
|
9
10
|
import { connect } from 'pwa-helpers/connect-mixin'
|
10
11
|
|
11
|
-
import {
|
12
|
-
getEditor,
|
13
|
-
getRenderer,
|
14
|
-
ColumnConfig,
|
15
|
-
DataGrist,
|
16
|
-
FetchOption,
|
17
|
-
SortersControl,
|
18
|
-
GristRecord
|
19
|
-
} from '@operato/data-grist'
|
12
|
+
import { getEditor, getRenderer, ColumnConfig, DataGrist, FetchOption, SortersControl, GristRecord } from '@operato/data-grist'
|
20
13
|
import { client } from '@operato/graphql'
|
21
14
|
import { i18next, localize } from '@operato/i18n'
|
22
15
|
import { openPopup } from '@operato/layout'
|
@@ -95,7 +88,7 @@ export class DataSummarySearchPage extends connect(store)(localize(i18next)(Page
|
|
95
88
|
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
|
96
89
|
<div slot="headroom" class="header">
|
97
90
|
<div class="title">
|
98
|
-
<
|
91
|
+
<md-icon>apps</md-icon>
|
99
92
|
${i18next.t('title.data-summary search')}
|
100
93
|
</div>
|
101
94
|
|
@@ -221,16 +214,11 @@ export class DataSummarySearchPage extends connect(store)(localize(i18next)(Page
|
|
221
214
|
title: i18next.t('title.open data summary view'),
|
222
215
|
handlers: {
|
223
216
|
click: (columns, data, column, record, rowIndex) => {
|
224
|
-
openPopup(
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
backdrop: true,
|
230
|
-
size: 'large',
|
231
|
-
title: i18next.t('title.data-summary view')
|
232
|
-
}
|
233
|
-
)
|
217
|
+
openPopup(html` <data-summary-view data-summary-id=${record.id} style="background-color: white;"></data-summary-view> `, {
|
218
|
+
backdrop: true,
|
219
|
+
size: 'large',
|
220
|
+
title: i18next.t('title.data-summary view')
|
221
|
+
})
|
234
222
|
}
|
235
223
|
}
|
236
224
|
},
|
@@ -247,8 +235,7 @@ export class DataSummarySearchPage extends connect(store)(localize(i18next)(Page
|
|
247
235
|
width: 80,
|
248
236
|
imex: true
|
249
237
|
},
|
250
|
-
(this.dataSet.summaryPeriod == DataSetSummaryPeriodType.Hour ||
|
251
|
-
this.dataSet.summaryPeriod == DataSetSummaryPeriodType.WorkShift) && {
|
238
|
+
(this.dataSet.summaryPeriod == DataSetSummaryPeriodType.Hour || this.dataSet.summaryPeriod == DataSetSummaryPeriodType.WorkShift) && {
|
252
239
|
type: 'string',
|
253
240
|
name: 'period',
|
254
241
|
header: i18next.t('field.time-period'),
|
@@ -335,12 +322,7 @@ export class DataSummarySearchPage extends connect(store)(localize(i18next)(Page
|
|
335
322
|
const response = await client.query({
|
336
323
|
query: gql`
|
337
324
|
query ($dataSetId: String!, $filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
338
|
-
dataSummariesByDataSet(
|
339
|
-
dataSetId: $dataSetId
|
340
|
-
filters: $filters
|
341
|
-
pagination: $pagination
|
342
|
-
sortings: $sortings
|
343
|
-
) {
|
325
|
+
dataSummariesByDataSet(dataSetId: $dataSetId, filters: $filters, pagination: $pagination, sortings: $sortings) {
|
344
326
|
items {
|
345
327
|
id
|
346
328
|
name
|
@@ -413,9 +395,7 @@ export class DataSummarySearchPage extends connect(store)(localize(i18next)(Page
|
|
413
395
|
.filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)
|
414
396
|
.reduce((record, column) => {
|
415
397
|
const key = column.imex === true ? column.name : column.imex.key
|
416
|
-
record[key] = key
|
417
|
-
.split('.')
|
418
|
-
.reduce((obj, key) => (obj && obj[key] !== 'undefined' ? obj[key] : undefined), item)
|
398
|
+
record[key] = key.split('.').reduce((obj, key) => (obj && obj[key] !== 'undefined' ? obj[key] : undefined), item)
|
419
399
|
return record
|
420
400
|
}, {})
|
421
401
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
2
|
+
import '@material/web/icon/icon.js';
|
2
3
|
import '@operato/dataset/ox-data-ooc-brief-view.js';
|
3
|
-
// import '@operato/dataset/ox-data-ooc-correction-part.js'
|
4
4
|
import gql from 'graphql-tag';
|
5
5
|
import { css, html, LitElement, nothing } from 'lit';
|
6
6
|
import { customElement, property, query, state } from 'lit/decorators.js';
|
@@ -23,7 +23,7 @@ let OocResolveActivityEdit = class OocResolveActivityEdit extends localize(i18ne
|
|
23
23
|
${editable
|
24
24
|
? html `
|
25
25
|
<label action>
|
26
|
-
<h2><
|
26
|
+
<h2><md-icon>build_circle</md-icon> <span>${i18next.t('label.corrective action')}</span></h2>
|
27
27
|
<textarea placeholder=${String(i18next.t('text.corrective action placeholder'))} .value=${action || ''} @change=${this.onChangeAction}></textarea>
|
28
28
|
</label>
|
29
29
|
`
|
@@ -147,7 +147,7 @@ OocResolveActivityEdit.styles = [
|
|
147
147
|
align-items: center;
|
148
148
|
}
|
149
149
|
|
150
|
-
|
150
|
+
md-icon {
|
151
151
|
color: var(--status-danger-color);
|
152
152
|
}
|
153
153
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"activity-ooc-resolve-edit.js","sourceRoot":"","sources":["../../client/activities/activity-ooc-resolve-edit.ts"],"names":[],"mappings":";AAAA,OAAO,
|
1
|
+
{"version":3,"file":"activity-ooc-resolve-edit.js","sourceRoot":"","sources":["../../client/activities/activity-ooc-resolve-edit.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,4CAA4C,CAAA;AAEnD,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAEzE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAGjD,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;IAmEhE,MAAM;;QACJ,MAAM,MAAM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AE;oBACT,EAAE;iBACH;aACF,CAAC,CAAA;YAEF,MAAM,OAAO,qBACR,QAAQ,CAAC,IAAI,CAAC,OAAO,CACzB,CAAA;YAED,IAAI,MAAA,IAAI,CAAC,cAAc,0CAAE,MAAM,EAAE;gBAC/B,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,CAAA;gBAC5D,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,SAAS,CAAA;gBACnD,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAA;aACjD;YAED,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;SACvB;IACH,CAAC;;AA9KM,6BAAM,GAAG;IACd,eAAe;IACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAqDF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qDAAY;AACvC;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;sDAAa;AACxC;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;8DAAqB;AAEhD;IAAC,KAAK,EAAE;;uDAAc;AAEtB;IAAC,KAAK,CAAC,UAAU,CAAC;8BAAkB,mBAAmB;8DAAA;AAjEnD,sBAAsB;IAD3B,aAAa,CAAC,2BAA2B,CAAC;GACrC,sBAAsB,CAgL3B","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/dataset/ox-data-ooc-brief-view.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement, nothing } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { ScrollbarStyles } from '@operato/styles'\n\n@customElement('activity-ooc-resolve-edit')\nclass OocResolveActivityEdit extends localize(i18next)(LitElement) {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: #fff;\n }\n\n div[content] {\n flex: 1;\n flex-direction: column;\n\n display: flex;\n overflow: auto;\n }\n\n ox-data-ooc-brief-view {\n flex: 1;\n padding: var(--padding-wide);\n overflow: auto;\n }\n\n label[action] {\n display: flex;\n flex-direction: column;\n\n padding: var(--padding-wide);\n }\n\n label[action] h2 {\n display: flex;\n\n color: var(--title-text-color);\n text-transform: capitalize;\n margin: var(--title-margin);\n align-items: center;\n }\n\n md-icon {\n color: var(--status-danger-color);\n }\n\n textarea {\n border: var(--input-field-border);\n border-radius: 10px;\n margin: var(--margin-default);\n padding: var(--input-padding);\n font: var(--input-field-font);\n\n resize: none;\n outline: none;\n min-height: 200px;\n }\n `\n ]\n\n @property({ type: Object }) input?: any\n @property({ type: Object }) output?: any\n @property({ type: Object }) activityThread?: any\n\n @state() dataOoc?: any\n\n @query('textarea') actionTextArea!: HTMLTextAreaElement\n\n render() {\n const action = this.output?.action\n const state = this.activityThread?.state\n const editable = state == 'assigned' || state == 'started'\n\n return html`\n <div content>\n <ox-data-ooc-brief-view .dataOoc=${this.dataOoc}></ox-data-ooc-brief-view>\n </div>\n\n <!-- <ox-data-ooc-correction-part .dataOoc=${this.dataOoc}></ox-data-ooc-correction-part> -->\n\n ${editable\n ? html`\n <label action>\n <h2><md-icon>build_circle</md-icon> <span>${i18next.t('label.corrective action')}</span></h2>\n <textarea placeholder=${String(i18next.t('text.corrective action placeholder'))} .value=${action || ''} @change=${this.onChangeAction}></textarea>\n </label>\n `\n : nothing}\n `\n }\n\n onChangeAction(e: Event) {\n this.output ||= {}\n this.output.action = (e.target as HTMLTextAreaElement).value\n\n this.dispatchEvent(\n new CustomEvent('change', {\n detail: this.output\n })\n )\n }\n\n updated(changes) {\n if (changes.has('input')) {\n this.fetchDataOoc()\n }\n }\n\n async fetchDataOoc() {\n const id = this.input.dataOocId\n\n if (id) {\n const response = await client.query({\n query: gql`\n query ($id: String!) {\n dataOoc(id: $id) {\n id\n name\n description\n ooc\n oos\n state\n type\n useCase\n data\n judgment\n history\n correctiveAction\n correctiveInstruction\n dataItems {\n name\n description\n active\n hidden\n tag\n group\n type\n unit\n options\n quota\n spec\n stat\n }\n workDate\n workShift\n reviewer {\n id\n name\n }\n corrector {\n id\n name\n }\n collectedAt\n reviewedAt\n correctedAt\n }\n }\n `,\n variables: {\n id\n }\n })\n\n const dataOoc = {\n ...response.data.dataOoc\n }\n\n if (this.activityThread?.output) {\n dataOoc.correctiveAction = this.activityThread.output.action\n dataOoc.correctedAt = this.activityThread.updatedAt\n dataOoc.corrector = this.activityThread.assignee\n }\n\n this.dataOoc = dataOoc\n }\n }\n}\n"]}
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
2
|
+
import '@material/web/icon/icon.js';
|
2
3
|
import '@operato/dataset/ox-data-sample-view.js';
|
3
4
|
import gql from 'graphql-tag';
|
4
5
|
import { css, html, LitElement } from 'lit';
|
@@ -18,7 +19,7 @@ let OocReviewActivityEdit = class OocReviewActivityEdit extends localize(i18next
|
|
18
19
|
</div>
|
19
20
|
|
20
21
|
<label instruction>
|
21
|
-
<h2><
|
22
|
+
<h2><md-icon>build_circle</md-icon> <span>${i18next.t('label.corrective instruction')}</span></h2>
|
22
23
|
${editable
|
23
24
|
? html `
|
24
25
|
<textarea
|
@@ -133,7 +134,7 @@ OocReviewActivityEdit.styles = [
|
|
133
134
|
font: var(--input-field-font);
|
134
135
|
}
|
135
136
|
|
136
|
-
|
137
|
+
md-icon {
|
137
138
|
color: var(--status-danger-color);
|
138
139
|
}
|
139
140
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"activity-ooc-review-edit.js","sourceRoot":"","sources":["../../client/activities/activity-ooc-review-edit.ts"],"names":[],"mappings":";AAAA,OAAO,yCAAyC,CAAA;AAEhD,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,G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,MAAM,MAAM,CAAC,KAAK,CAAC;gBAClC,KAAK,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAgCT;gBACD,SAAS,EAAE;oBACT,EAAE;iBACH;aACF,CAAC,CAAA;YAEF,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAA;SACrC;IACH,CAAC;;AA5JM,4BAAM,GAAG;IACd,eAAe;IACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA0DF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;oDAAY;AACvC;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qDAAa;AACxC;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;6DAAqB;AAEhD;IAAC,KAAK,EAAE;;sDAAc;AApElB,qBAAqB;IAD1B,aAAa,CAAC,0BAA0B,CAAC;GACpC,qBAAqB,CA8J1B","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/dataset/ox-data-sample-view.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { ScrollbarStyles } from '@operato/styles'\n\n@customElement('activity-ooc-review-edit')\nclass OocReviewActivityEdit extends localize(i18next)(LitElement) {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: #fff;\n }\n\n div[content] {\n flex: 1;\n flex-direction: column;\n\n display: flex;\n overflow: auto;\n }\n\n ox-data-sample-view {\n flex: 1;\n padding: var(--padding-wide);\n overflow: auto;\n }\n\n label[instruction] {\n display: flex;\n flex-direction: column;\n\n padding: var(--padding-wide);\n\n h2 {\n display: flex;\n\n color: var(--title-text-color);\n text-transform: capitalize;\n margin: var(--title-margin);\n align-items: center;\n }\n\n div {\n padding: var(--padding-wide);\n font: var(--input-field-font);\n }\n\n md-icon {\n color: var(--status-danger-color);\n }\n\n textarea {\n border: var(--input-field-border);\n border-radius: 10px;\n margin: var(--margin-default);\n padding: var(--input-padding);\n font: var(--input-field-font);\n\n resize: none;\n outline: none;\n min-height: 200px;\n }\n }\n `\n ]\n\n @property({ type: Object }) input?: any\n @property({ type: Object }) output?: any\n @property({ type: Object }) activityThread?: any\n\n @state() dataOoc?: any\n\n render() {\n const instruction = this.output?.instruction\n const { state } = this.activityThread || {}\n const editable = state == 'assigned' || state == 'started' || state == 'submitted'\n\n return html`\n <div content>\n <ox-data-sample-view .dataSample=${this.dataOoc}></ox-data-sample-view>\n </div>\n\n <label instruction>\n <h2><md-icon>build_circle</md-icon> <span>${i18next.t('label.corrective instruction')}</span></h2>\n ${editable\n ? html`\n <textarea\n placeholder=${String(i18next.t('text.corrective instruction placeholder'))}\n .value=${instruction || ''}\n @change=${this.onChangeInstruction}\n ></textarea>\n `\n : html`<div>${instruction}</div>`}\n </label>\n `\n }\n\n onChangeInstruction(e: Event) {\n this.output ||= {}\n this.output.instruction = (e.target as HTMLTextAreaElement).value\n\n this.dispatchEvent(\n new CustomEvent('change', {\n detail: this.output\n })\n )\n }\n\n updated(changes) {\n if (changes.has('input')) {\n this.fetchDataOoc()\n }\n }\n\n async fetchDataOoc() {\n const id = this.input?.dataOocId\n\n if (id) {\n const response = await client.query({\n query: gql`\n query ($id: String!) {\n dataOoc(id: $id) {\n id\n name\n description\n ooc\n oos\n state\n type\n useCase\n data\n judgment\n dataItems {\n name\n description\n active\n hidden\n tag\n group\n type\n unit\n options\n quota\n spec\n stat\n }\n workDate\n workShift\n collectedAt\n }\n }\n `,\n variables: {\n id\n }\n })\n\n this.dataOoc = response.data.dataOoc\n }\n }\n}\n"]}
|