@things-factory/dataset 8.0.15 → 8.0.20
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-data-collect-edit.ts +71 -4
- package/client/activities/activity-data-review-edit.ts +28 -3
- package/client/activities/activity-data-review-view.ts +28 -3
- package/client/activities/activity-ooc-resolve-edit.ts +7 -0
- package/client/activities/activity-ooc-resolve-view.ts +7 -0
- package/client/activities/activity-ooc-review-edit.ts +33 -2
- package/client/activities/activity-ooc-review-view.ts +7 -0
- package/client/components/data-entry-form.ts +51 -4
- package/client/pages/data-entry/checklist-entry-page.ts +1 -1
- package/client/pages/data-entry/data-entry-list-page.ts +1 -0
- package/client/pages/data-ooc/data-ooc-page.ts +3 -0
- package/client/pages/data-ooc/data-ooc-view.ts +3 -0
- package/client/pages/data-sample/data-sample-view.ts +31 -1
- package/client/pages/data-set/data-set-list-page.ts +51 -11
- package/dist-client/activities/activity-data-collect-edit.d.ts +8 -1
- package/dist-client/activities/activity-data-collect-edit.js +72 -3
- package/dist-client/activities/activity-data-collect-edit.js.map +1 -1
- package/dist-client/activities/activity-data-review-edit.d.ts +2 -0
- package/dist-client/activities/activity-data-review-edit.js +28 -3
- package/dist-client/activities/activity-data-review-edit.js.map +1 -1
- package/dist-client/activities/activity-data-review-view.d.ts +2 -0
- package/dist-client/activities/activity-data-review-view.js +28 -3
- package/dist-client/activities/activity-data-review-view.js.map +1 -1
- package/dist-client/activities/activity-ooc-resolve-edit.js +7 -0
- package/dist-client/activities/activity-ooc-resolve-edit.js.map +1 -1
- package/dist-client/activities/activity-ooc-resolve-view.js +7 -0
- package/dist-client/activities/activity-ooc-resolve-view.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 +33 -1
- package/dist-client/activities/activity-ooc-review-edit.js.map +1 -1
- package/dist-client/activities/activity-ooc-review-view.js +7 -0
- package/dist-client/activities/activity-ooc-review-view.js.map +1 -1
- package/dist-client/components/data-entry-form.d.ts +9 -2
- package/dist-client/components/data-entry-form.js +52 -2
- package/dist-client/components/data-entry-form.js.map +1 -1
- package/dist-client/pages/data-entry/checklist-entry-page.js.map +1 -1
- package/dist-client/pages/data-entry/data-entry-list-page.js +1 -0
- package/dist-client/pages/data-entry/data-entry-list-page.js.map +1 -1
- package/dist-client/pages/data-ooc/data-ooc-page.js +3 -0
- package/dist-client/pages/data-ooc/data-ooc-page.js.map +1 -1
- package/dist-client/pages/data-ooc/data-ooc-view.js +3 -0
- package/dist-client/pages/data-ooc/data-ooc-view.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 +31 -1
- package/dist-client/pages/data-sample/data-sample-view.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 +43 -8
- package/dist-client/pages/data-set/data-set-list-page.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/data-ooc/index.d.ts +1 -1
- package/dist-server/service/data-set/index.d.ts +1 -1
- package/dist-server/service/index.d.ts +2 -2
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +12 -12
@@ -1,4 +1,5 @@
|
|
1
1
|
import '@operato/dataset/ox-data-entry-form.js'
|
2
|
+
import '@operato/dataset/ox-checklist-entry-form.js'
|
2
3
|
|
3
4
|
import gql from 'graphql-tag'
|
4
5
|
import { css, html, LitElement } from 'lit'
|
@@ -8,6 +9,8 @@ import { client } from '@operato/graphql'
|
|
8
9
|
import { i18next, localize } from '@operato/i18n'
|
9
10
|
import { ScrollbarStyles } from '@operato/styles'
|
10
11
|
import { OxDataEntryForm } from '@operato/dataset/ox-data-entry-form.js'
|
12
|
+
import { OxChecklistEntryForm } from '@operato/dataset/ox-checklist-entry-form.js'
|
13
|
+
|
11
14
|
import { DataSet } from '@operato/dataset'
|
12
15
|
|
13
16
|
@customElement('activity-data-collect-edit')
|
@@ -33,23 +36,84 @@ export class DataCollectActivityEdit extends localize(i18next)(LitElement) {
|
|
33
36
|
@property({ type: Object }) input?: any
|
34
37
|
@property({ type: Object }) output?: any
|
35
38
|
|
36
|
-
@state() dataSet?: DataSet & { id: string }
|
39
|
+
@state() dataSet?: DataSet & { id: string; entryType?: string; entryView?: string }
|
40
|
+
|
41
|
+
@query('ox-data-entry-form') dataEntryForm?: OxDataEntryForm
|
42
|
+
@query('ox-checklist-entry-form') checklistEntryForm?: OxChecklistEntryForm
|
43
|
+
|
44
|
+
get entryForm() {
|
45
|
+
const entryType = this.dataSet?.entryType
|
46
|
+
const entryView = this.dataSet?.entryView
|
37
47
|
|
38
|
-
|
48
|
+
switch (entryType) {
|
49
|
+
case 'generated':
|
50
|
+
if (!entryView || entryView === 'DEFAULT') {
|
51
|
+
return this.dataEntryForm
|
52
|
+
} else if (entryView === 'CHECKLIST') {
|
53
|
+
return this.checklistEntryForm
|
54
|
+
}
|
55
|
+
break
|
56
|
+
case 'board':
|
57
|
+
break
|
58
|
+
case 'page':
|
59
|
+
break
|
60
|
+
default:
|
61
|
+
return this.dataEntryForm
|
62
|
+
break
|
63
|
+
}
|
64
|
+
}
|
39
65
|
|
40
66
|
render() {
|
41
67
|
return html`
|
42
|
-
<
|
68
|
+
<div class="container">
|
69
|
+
<!-- <ox-data-entry-form
|
43
70
|
.dataSet=${this.dataSet}
|
44
71
|
.value=${this.output}
|
45
72
|
@change=${this._updateDataItems}
|
46
|
-
></ox-data-entry-form>
|
73
|
+
></ox-data-entry-form> -->
|
74
|
+
${this.showEntryView()}
|
75
|
+
</div>
|
47
76
|
`
|
48
77
|
}
|
49
78
|
|
79
|
+
private showEntryView() {
|
80
|
+
const entryType = this.dataSet?.entryType
|
81
|
+
const entryView = this.dataSet?.entryView
|
82
|
+
|
83
|
+
switch (entryType) {
|
84
|
+
case 'generated':
|
85
|
+
if (!entryView || entryView === 'DEFAULT') {
|
86
|
+
return html`<ox-data-entry-form
|
87
|
+
.dataSet=${this.dataSet}
|
88
|
+
.value=${this.output}
|
89
|
+
@change=${this._updateDataItems}
|
90
|
+
></ox-data-entry-form>`
|
91
|
+
} else if (entryView === 'CHECKLIST') {
|
92
|
+
return html`<ox-checklist-entry-form
|
93
|
+
.dataSet=${this.dataSet}
|
94
|
+
.value=${this.output}
|
95
|
+
@change=${this._updateDataItems}
|
96
|
+
></ox-checklist-entry-form>`
|
97
|
+
}
|
98
|
+
break
|
99
|
+
case 'board':
|
100
|
+
break
|
101
|
+
case 'page':
|
102
|
+
break
|
103
|
+
default:
|
104
|
+
return html`<ox-data-entry-form
|
105
|
+
.dataSet=${this.dataSet}
|
106
|
+
.value=${this.output}
|
107
|
+
@change=${this._updateDataItems}
|
108
|
+
></ox-data-entry-form>`
|
109
|
+
break
|
110
|
+
}
|
111
|
+
}
|
112
|
+
|
50
113
|
async _updateDataItems(e: CustomEvent) {
|
51
114
|
e.stopPropagation()
|
52
115
|
|
116
|
+
//@ts-ignore TODO replace with following line and confirm
|
53
117
|
this.output = this.entryForm.value
|
54
118
|
|
55
119
|
this.dispatchEvent(
|
@@ -77,6 +141,8 @@ export class DataCollectActivityEdit extends localize(i18next)(LitElement) {
|
|
77
141
|
name
|
78
142
|
description
|
79
143
|
useCase
|
144
|
+
entryType
|
145
|
+
entryView
|
80
146
|
dataItems {
|
81
147
|
name
|
82
148
|
description
|
@@ -84,6 +150,7 @@ export class DataCollectActivityEdit extends localize(i18next)(LitElement) {
|
|
84
150
|
hidden
|
85
151
|
tag
|
86
152
|
group
|
153
|
+
subgroup
|
87
154
|
type
|
88
155
|
unit
|
89
156
|
options
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import '@material/web/icon/icon.js'
|
2
2
|
import '@material/web/radio/radio.js'
|
3
3
|
import '@operato/dataset/ox-data-entry-form.js'
|
4
|
+
import '@operato/dataset/ox-checklist-sample-view.js'
|
4
5
|
|
5
6
|
import gql from 'graphql-tag'
|
6
7
|
import { css, html, LitElement } from 'lit'
|
@@ -113,9 +114,7 @@ export class DataReviewActivityEdit extends localize(i18next)(LitElement) {
|
|
113
114
|
const editable = state == 'unassigned' || state == 'assigned' || state == 'started' || state == 'submitted'
|
114
115
|
|
115
116
|
return html`
|
116
|
-
<div content>
|
117
|
-
<ox-data-sample-view .dataSample=${this.dataSample}></ox-data-sample-view>
|
118
|
-
</div>
|
117
|
+
<div content>${this.showDataSampleView()}</div>
|
119
118
|
|
120
119
|
<form @change=${this.onChangeInstruction}>
|
121
120
|
${editable
|
@@ -188,6 +187,29 @@ export class DataReviewActivityEdit extends localize(i18next)(LitElement) {
|
|
188
187
|
`
|
189
188
|
}
|
190
189
|
|
190
|
+
private showDataSampleView() {
|
191
|
+
const dataSet = this.dataSample?.dataSet
|
192
|
+
const monitorType = dataSet?.monitorType
|
193
|
+
const monitorView = dataSet?.monitorView
|
194
|
+
|
195
|
+
switch (monitorType) {
|
196
|
+
case 'generated':
|
197
|
+
if (!monitorView || monitorView === 'DEFAULT') {
|
198
|
+
return html`<ox-data-sample-view .dataSample=${this.dataSample}></ox-data-sample-view>`
|
199
|
+
} else if (monitorView === 'CHECKLIST') {
|
200
|
+
return html`<ox-checklist-sample-view .dataSample=${this.dataSample}></ox-checklist-sample-view>`
|
201
|
+
}
|
202
|
+
break
|
203
|
+
case 'board':
|
204
|
+
break
|
205
|
+
case 'page':
|
206
|
+
break
|
207
|
+
default:
|
208
|
+
return html`<ox-data-sample-view .dataSample=${this.dataSample}></ox-data-sample-view>`
|
209
|
+
break
|
210
|
+
}
|
211
|
+
}
|
212
|
+
|
191
213
|
onChangeInstruction(e: Event) {
|
192
214
|
var output = {}
|
193
215
|
|
@@ -238,6 +260,8 @@ export class DataReviewActivityEdit extends localize(i18next)(LitElement) {
|
|
238
260
|
id
|
239
261
|
name
|
240
262
|
description
|
263
|
+
monitorType
|
264
|
+
monitorView
|
241
265
|
}
|
242
266
|
dataItems {
|
243
267
|
name
|
@@ -246,6 +270,7 @@ export class DataReviewActivityEdit extends localize(i18next)(LitElement) {
|
|
246
270
|
hidden
|
247
271
|
tag
|
248
272
|
group
|
273
|
+
subgroup
|
249
274
|
type
|
250
275
|
unit
|
251
276
|
options
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import '@operato/dataset/ox-data-entry-form.js'
|
2
|
+
import '@operato/dataset/ox-checklist-sample-view.js'
|
2
3
|
|
3
4
|
import gql from 'graphql-tag'
|
4
5
|
import { css, html, LitElement } from 'lit'
|
@@ -103,9 +104,7 @@ export class DataReviewActivityView extends localize(i18next)(LitElement) {
|
|
103
104
|
const { judgment, instruction } = this.output || {}
|
104
105
|
|
105
106
|
return html`
|
106
|
-
<div content>
|
107
|
-
<ox-data-sample-view .dataSample=${this.dataSample}></ox-data-sample-view>
|
108
|
-
</div>
|
107
|
+
<div content>${this.showDataSampleView()}</div>
|
109
108
|
|
110
109
|
<form>
|
111
110
|
<label>
|
@@ -186,6 +185,8 @@ export class DataReviewActivityView extends localize(i18next)(LitElement) {
|
|
186
185
|
id
|
187
186
|
name
|
188
187
|
description
|
188
|
+
monitorType
|
189
|
+
monitorView
|
189
190
|
}
|
190
191
|
dataItems {
|
191
192
|
name
|
@@ -194,6 +195,7 @@ export class DataReviewActivityView extends localize(i18next)(LitElement) {
|
|
194
195
|
hidden
|
195
196
|
tag
|
196
197
|
group
|
198
|
+
subgroup
|
197
199
|
type
|
198
200
|
unit
|
199
201
|
options
|
@@ -223,4 +225,27 @@ export class DataReviewActivityView extends localize(i18next)(LitElement) {
|
|
223
225
|
}
|
224
226
|
}
|
225
227
|
}
|
228
|
+
|
229
|
+
private showDataSampleView() {
|
230
|
+
const dataSet = this.dataSample?.dataSet
|
231
|
+
const monitorType = dataSet?.monitorType
|
232
|
+
const monitorView = dataSet?.monitorView
|
233
|
+
|
234
|
+
switch (monitorType) {
|
235
|
+
case 'generated':
|
236
|
+
if (!monitorView || monitorView === 'DEFAULT') {
|
237
|
+
return html`<ox-data-sample-view .dataSample=${this.dataSample}></ox-data-sample-view>`
|
238
|
+
} else if (monitorView === 'CHECKLIST') {
|
239
|
+
return html`<ox-checklist-sample-view .dataSample=${this.dataSample}></ox-checklist-sample-view>`
|
240
|
+
}
|
241
|
+
break
|
242
|
+
case 'board':
|
243
|
+
break
|
244
|
+
case 'page':
|
245
|
+
break
|
246
|
+
default:
|
247
|
+
return html`<ox-data-sample-view .dataSample=${this.dataSample}></ox-data-sample-view>`
|
248
|
+
break
|
249
|
+
}
|
250
|
+
}
|
226
251
|
}
|
@@ -144,6 +144,12 @@ class OocResolveActivityEdit extends localize(i18next)(LitElement) {
|
|
144
144
|
history
|
145
145
|
correctiveAction
|
146
146
|
correctiveInstruction
|
147
|
+
dataSet {
|
148
|
+
id
|
149
|
+
name
|
150
|
+
monitorType
|
151
|
+
monitorView
|
152
|
+
}
|
147
153
|
dataItems {
|
148
154
|
name
|
149
155
|
description
|
@@ -151,6 +157,7 @@ class OocResolveActivityEdit extends localize(i18next)(LitElement) {
|
|
151
157
|
hidden
|
152
158
|
tag
|
153
159
|
group
|
160
|
+
subgroup
|
154
161
|
type
|
155
162
|
unit
|
156
163
|
options
|
@@ -89,6 +89,12 @@ export class OocResolveActivityView extends localize(i18next)(LitElement) {
|
|
89
89
|
history
|
90
90
|
correctiveAction
|
91
91
|
correctiveInstruction
|
92
|
+
dataSet {
|
93
|
+
id
|
94
|
+
name
|
95
|
+
monitorType
|
96
|
+
monitorView
|
97
|
+
}
|
92
98
|
dataItems {
|
93
99
|
name
|
94
100
|
description
|
@@ -96,6 +102,7 @@ export class OocResolveActivityView extends localize(i18next)(LitElement) {
|
|
96
102
|
hidden
|
97
103
|
tag
|
98
104
|
group
|
105
|
+
subgroup
|
99
106
|
type
|
100
107
|
unit
|
101
108
|
options
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import '@material/web/icon/icon.js'
|
2
2
|
import '@operato/dataset/ox-data-sample-view.js'
|
3
|
-
|
3
|
+
import '@operato/dataset/ox-checklist-sample-view.js'
|
4
4
|
import gql from 'graphql-tag'
|
5
5
|
import { css, html, LitElement } from 'lit'
|
6
6
|
import { customElement, property, query, state } from 'lit/decorators.js'
|
@@ -89,7 +89,8 @@ class OocReviewActivityEdit extends localize(i18next)(LitElement) {
|
|
89
89
|
|
90
90
|
return html`
|
91
91
|
<div content>
|
92
|
-
|
92
|
+
${this.showDataSampleView()}
|
93
|
+
<!-- <ox-data-sample-view .dataSample=${this.dataOoc}></ox-data-sample-view> -->
|
93
94
|
</div>
|
94
95
|
|
95
96
|
<label instruction>
|
@@ -142,6 +143,12 @@ class OocReviewActivityEdit extends localize(i18next)(LitElement) {
|
|
142
143
|
useCase
|
143
144
|
data
|
144
145
|
judgment
|
146
|
+
dataSet {
|
147
|
+
id
|
148
|
+
name
|
149
|
+
monitorType
|
150
|
+
monitorView
|
151
|
+
}
|
145
152
|
dataItems {
|
146
153
|
name
|
147
154
|
description
|
@@ -149,6 +156,7 @@ class OocReviewActivityEdit extends localize(i18next)(LitElement) {
|
|
149
156
|
hidden
|
150
157
|
tag
|
151
158
|
group
|
159
|
+
subgroup
|
152
160
|
type
|
153
161
|
unit
|
154
162
|
options
|
@@ -170,4 +178,27 @@ class OocReviewActivityEdit extends localize(i18next)(LitElement) {
|
|
170
178
|
this.dataOoc = response.data.dataOoc
|
171
179
|
}
|
172
180
|
}
|
181
|
+
|
182
|
+
private showDataSampleView() {
|
183
|
+
const dataSet = this.dataOoc?.dataSet
|
184
|
+
const monitorType = dataSet?.monitorType
|
185
|
+
const monitorView = dataSet?.monitorView
|
186
|
+
|
187
|
+
switch (monitorType) {
|
188
|
+
case 'generated':
|
189
|
+
if (!monitorView || monitorView === 'DEFAULT') {
|
190
|
+
return html`<ox-data-sample-view .dataSample=${this.dataOoc}></ox-data-sample-view>`
|
191
|
+
} else if (monitorView === 'CHECKLIST') {
|
192
|
+
return html`<ox-checklist-sample-view .dataSample=${this.dataOoc}></ox-checklist-sample-view>`
|
193
|
+
}
|
194
|
+
break
|
195
|
+
case 'board':
|
196
|
+
break
|
197
|
+
case 'page':
|
198
|
+
break
|
199
|
+
default:
|
200
|
+
return html`<ox-data-sample-view .dataSample=${this.dataOoc}></ox-data-sample-view>`
|
201
|
+
break
|
202
|
+
}
|
203
|
+
}
|
173
204
|
}
|
@@ -88,6 +88,12 @@ class OocReviewActivityView extends localize(i18next)(LitElement) {
|
|
88
88
|
history
|
89
89
|
correctiveAction
|
90
90
|
correctiveInstruction
|
91
|
+
dataSet {
|
92
|
+
id
|
93
|
+
name
|
94
|
+
monitorType
|
95
|
+
monitorView
|
96
|
+
}
|
91
97
|
dataItems {
|
92
98
|
name
|
93
99
|
description
|
@@ -95,6 +101,7 @@ class OocReviewActivityView extends localize(i18next)(LitElement) {
|
|
95
101
|
hidden
|
96
102
|
tag
|
97
103
|
group
|
104
|
+
subgroup
|
98
105
|
type
|
99
106
|
unit
|
100
107
|
options
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import '@material/web/icon/icon.js'
|
2
2
|
import '@operato/dataset/ox-data-entry-form.js'
|
3
|
+
import '@operato/dataset/ox-checklist-entry-form.js'
|
3
4
|
|
4
5
|
import gql from 'graphql-tag'
|
5
6
|
import { css, html, LitElement } from 'lit'
|
@@ -8,8 +9,9 @@ import { customElement, property, query, state } from 'lit/decorators.js'
|
|
8
9
|
import { client } from '@operato/graphql'
|
9
10
|
import { i18next, localize } from '@operato/i18n'
|
10
11
|
import { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'
|
11
|
-
import { OxDataEntryForm } from '@operato/dataset/ox-data-entry-form.js'
|
12
12
|
import { DataSet } from '@operato/dataset'
|
13
|
+
import { OxDataEntryForm } from '@operato/dataset/ox-data-entry-form.js'
|
14
|
+
import { OxChecklistEntryForm } from '@operato/dataset/ox-checklist-entry-form.js'
|
13
15
|
|
14
16
|
@customElement('data-entry-form')
|
15
17
|
export class DataEntryForm extends localize(i18next)(LitElement) {
|
@@ -39,15 +41,38 @@ export class DataEntryForm extends localize(i18next)(LitElement) {
|
|
39
41
|
`
|
40
42
|
]
|
41
43
|
|
42
|
-
@property({ type: Object }) dataSet?: DataSet & { id: string }
|
44
|
+
@property({ type: Object }) dataSet?: DataSet & { id: string; entryType?: string; entryView?: string }
|
43
45
|
|
44
46
|
@state() dataSample?: { id: string; collectedAt: Date }
|
45
47
|
|
46
|
-
@query('ox-data-entry-form')
|
48
|
+
@query('ox-data-entry-form') dataEntryForm?: OxDataEntryForm
|
49
|
+
@query('ox-checklist-entry-form') checklistEntryForm?: OxChecklistEntryForm
|
50
|
+
|
51
|
+
get entryForm() {
|
52
|
+
const entryType = this.dataSet?.entryType
|
53
|
+
const entryView = this.dataSet?.entryView
|
54
|
+
|
55
|
+
switch (entryType) {
|
56
|
+
case 'generated':
|
57
|
+
if (!entryView || entryView === 'DEFAULT') {
|
58
|
+
return this.dataEntryForm
|
59
|
+
} else if (entryView === 'CHECKLIST') {
|
60
|
+
return this.checklistEntryForm
|
61
|
+
}
|
62
|
+
break
|
63
|
+
case 'board':
|
64
|
+
break
|
65
|
+
case 'page':
|
66
|
+
break
|
67
|
+
default:
|
68
|
+
return this.dataEntryForm
|
69
|
+
break
|
70
|
+
}
|
71
|
+
}
|
47
72
|
|
48
73
|
render() {
|
49
74
|
return html`
|
50
|
-
|
75
|
+
${this.showEntryView()}
|
51
76
|
|
52
77
|
<div class="footer">
|
53
78
|
<div filler></div>
|
@@ -62,6 +87,28 @@ export class DataEntryForm extends localize(i18next)(LitElement) {
|
|
62
87
|
`
|
63
88
|
}
|
64
89
|
|
90
|
+
private showEntryView() {
|
91
|
+
const entryType = this.dataSet?.entryType
|
92
|
+
const entryView = this.dataSet?.entryView
|
93
|
+
|
94
|
+
switch (entryType) {
|
95
|
+
case 'generated':
|
96
|
+
if (!entryView || entryView === 'DEFAULT') {
|
97
|
+
return html`<ox-data-entry-form .dataSet=${this.dataSet}></ox-data-entry-form>`
|
98
|
+
} else if (entryView === 'CHECKLIST') {
|
99
|
+
return html`<ox-checklist-entry-form .dataSet=${this.dataSet}></ox-checklist-entry-form>`
|
100
|
+
}
|
101
|
+
break
|
102
|
+
case 'board':
|
103
|
+
break
|
104
|
+
case 'page':
|
105
|
+
break
|
106
|
+
default:
|
107
|
+
return html`<ox-data-entry-form .dataSet=${this.dataSet}></ox-data-entry-form>`
|
108
|
+
break
|
109
|
+
}
|
110
|
+
}
|
111
|
+
|
65
112
|
private async updateDataItems() {
|
66
113
|
//@ts-ignore TODO replace with following line and confirm
|
67
114
|
const data = this.entryForm.buildValue()
|
@@ -173,7 +173,7 @@ export class ChecklistEntryPage extends localize(i18next)(PageView) {
|
|
173
173
|
id: this.dataSetId
|
174
174
|
},
|
175
175
|
data
|
176
|
-
} as
|
176
|
+
} as any
|
177
177
|
|
178
178
|
if (this.dataSample?.collectedAt) {
|
179
179
|
dataSample.collectedAt = this.dataSample.collectedAt
|
@@ -68,6 +68,8 @@ export class DataOocViewPage extends localize(i18next)(PageView) {
|
|
68
68
|
dataSet {
|
69
69
|
id
|
70
70
|
name
|
71
|
+
monitorType
|
72
|
+
monitorView
|
71
73
|
}
|
72
74
|
key01
|
73
75
|
key02
|
@@ -82,6 +84,7 @@ export class DataOocViewPage extends localize(i18next)(PageView) {
|
|
82
84
|
hidden
|
83
85
|
tag
|
84
86
|
group
|
87
|
+
subgroup
|
85
88
|
type
|
86
89
|
unit
|
87
90
|
options
|
@@ -120,6 +120,8 @@ export class DataOocView extends localize(i18next)(LitElement) {
|
|
120
120
|
dataSet {
|
121
121
|
id
|
122
122
|
name
|
123
|
+
monitorType
|
124
|
+
monitorView
|
123
125
|
}
|
124
126
|
key01
|
125
127
|
key02
|
@@ -134,6 +136,7 @@ export class DataOocView extends localize(i18next)(LitElement) {
|
|
134
136
|
hidden
|
135
137
|
tag
|
136
138
|
group
|
139
|
+
subgroup
|
137
140
|
type
|
138
141
|
unit
|
139
142
|
options
|
@@ -2,6 +2,7 @@ import '@material/web/icon/icon.js'
|
|
2
2
|
import '@material/web/fab/fab.js'
|
3
3
|
import '@operato/dataset/ox-data-sample-view.js'
|
4
4
|
import '@operato/dataset/ox-data-ooc-brief-view.js'
|
5
|
+
import '@operato/dataset/ox-checklist-sample-view.js'
|
5
6
|
import '@things-factory/worklist/dist-client/components/activity-thread-timeline.js'
|
6
7
|
|
7
8
|
import gql from 'graphql-tag'
|
@@ -77,7 +78,7 @@ export class DataSampleView extends localize(i18next)(LitElement) {
|
|
77
78
|
|
78
79
|
return html`
|
79
80
|
${!dataSample?.dataOoc
|
80
|
-
? html
|
81
|
+
? html`${this.showDataSampleView()}`
|
81
82
|
: html` <ox-data-ooc-brief-view .dataOoc=${dataSample!.dataOoc}></ox-data-ooc-brief-view>`}
|
82
83
|
${reviewActivityThread
|
83
84
|
? html`
|
@@ -118,6 +119,29 @@ export class DataSampleView extends localize(i18next)(LitElement) {
|
|
118
119
|
}
|
119
120
|
}
|
120
121
|
|
122
|
+
private showDataSampleView() {
|
123
|
+
const dataSet = this.dataSample?.dataSet
|
124
|
+
const monitorType = dataSet?.monitorType
|
125
|
+
const monitorView = dataSet?.monitorView
|
126
|
+
|
127
|
+
switch (monitorType) {
|
128
|
+
case 'generated':
|
129
|
+
if (!monitorView || monitorView === 'DEFAULT') {
|
130
|
+
return html`<ox-data-sample-view .dataSample=${this.dataSample}></ox-data-sample-view>`
|
131
|
+
} else if (monitorView === 'CHECKLIST') {
|
132
|
+
return html`<ox-checklist-sample-view .dataSample=${this.dataSample}></ox-checklist-sample-view>`
|
133
|
+
}
|
134
|
+
break
|
135
|
+
case 'board':
|
136
|
+
break
|
137
|
+
case 'page':
|
138
|
+
break
|
139
|
+
default:
|
140
|
+
return html`<ox-data-sample-view .dataSample=${this.dataSample}></ox-data-sample-view>`
|
141
|
+
break
|
142
|
+
}
|
143
|
+
}
|
144
|
+
|
121
145
|
async fetchDataSample() {
|
122
146
|
const id = this.dataSampleId
|
123
147
|
|
@@ -147,6 +171,8 @@ export class DataSampleView extends localize(i18next)(LitElement) {
|
|
147
171
|
id
|
148
172
|
name
|
149
173
|
description
|
174
|
+
monitorType
|
175
|
+
monitorView
|
150
176
|
}
|
151
177
|
dataItems {
|
152
178
|
name
|
@@ -155,6 +181,7 @@ export class DataSampleView extends localize(i18next)(LitElement) {
|
|
155
181
|
hidden
|
156
182
|
tag
|
157
183
|
group
|
184
|
+
subgroup
|
158
185
|
type
|
159
186
|
unit
|
160
187
|
options
|
@@ -175,6 +202,8 @@ export class DataSampleView extends localize(i18next)(LitElement) {
|
|
175
202
|
dataSet {
|
176
203
|
id
|
177
204
|
name
|
205
|
+
monitorType
|
206
|
+
monitorView
|
178
207
|
}
|
179
208
|
key01
|
180
209
|
key02
|
@@ -189,6 +218,7 @@ export class DataSampleView extends localize(i18next)(LitElement) {
|
|
189
218
|
hidden
|
190
219
|
tag
|
191
220
|
group
|
221
|
+
subgroup
|
192
222
|
type
|
193
223
|
unit
|
194
224
|
options
|
@@ -17,11 +17,12 @@ import { OxDataUseCase } from '@operato/dataset'
|
|
17
17
|
import { client } from '@operato/graphql'
|
18
18
|
import { i18next, localize } from '@operato/i18n'
|
19
19
|
import { notify, openPopup } from '@operato/layout'
|
20
|
-
import { PageView, store } from '@operato/shell'
|
20
|
+
import { PageView, store, navigate } from '@operato/shell'
|
21
21
|
import { CommonGristStyles, CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'
|
22
22
|
import { isMobileDevice, sleep } from '@operato/utils'
|
23
23
|
|
24
24
|
import { p13n } from '@operato/p13n'
|
25
|
+
import { provider } from '@things-factory/board-ui/dist-client'
|
25
26
|
|
26
27
|
const MIN = 60
|
27
28
|
const HOUR = 60 * MIN
|
@@ -89,6 +90,54 @@ const USECASE_OPTIONS = () => {
|
|
89
90
|
})
|
90
91
|
}
|
91
92
|
|
93
|
+
export const showEntryView = async (columns, data, column, record, rowIndex) => {
|
94
|
+
const { name, entryType, entryView } = record
|
95
|
+
const title = `${name} - ${i18next.t('title.data-entry-form')}`
|
96
|
+
|
97
|
+
switch (entryType) {
|
98
|
+
case 'generated':
|
99
|
+
openPopup(html` <data-entry-form .dataSet=${record} style="background-color: white;"></data-entry-form> `, {
|
100
|
+
closable: true,
|
101
|
+
backdrop: true,
|
102
|
+
size: 'large',
|
103
|
+
title
|
104
|
+
})
|
105
|
+
break
|
106
|
+
|
107
|
+
case 'board':
|
108
|
+
const board = {
|
109
|
+
id: entryView
|
110
|
+
}
|
111
|
+
openPopup(
|
112
|
+
html`
|
113
|
+
<ox-board-viewer
|
114
|
+
style="background-color: white;"
|
115
|
+
.board=${board}
|
116
|
+
.provider=${provider}
|
117
|
+
hide-fullscreen
|
118
|
+
hide-navigation
|
119
|
+
></ox-board-viewer>
|
120
|
+
`,
|
121
|
+
{
|
122
|
+
closable: true,
|
123
|
+
backdrop: true,
|
124
|
+
size: 'large',
|
125
|
+
title
|
126
|
+
}
|
127
|
+
)
|
128
|
+
|
129
|
+
// navigate(`board-viewer/${entryView}?interactive=true&title=${title}`)
|
130
|
+
break
|
131
|
+
case 'page':
|
132
|
+
navigate(`${entryView}/${record.id}`)
|
133
|
+
break
|
134
|
+
|
135
|
+
case 'external':
|
136
|
+
window.open(entryView, '_blank')
|
137
|
+
break
|
138
|
+
}
|
139
|
+
}
|
140
|
+
|
92
141
|
@customElement('data-set-list-page')
|
93
142
|
export class DataSetListPage extends connect(store)(p13n(localize(i18next)(PageView))) {
|
94
143
|
static styles = [
|
@@ -255,16 +304,7 @@ export class DataSetListPage extends connect(store)(p13n(localize(i18next)(PageV
|
|
255
304
|
title: record =>
|
256
305
|
!record ? i18next.t('button.enter-data') : !record.id ? '' : i18next.t('button.enter-data'),
|
257
306
|
handlers: {
|
258
|
-
click:
|
259
|
-
openPopup(
|
260
|
-
html` <data-entry-form .dataSet=${record} style="background-color: white;"></data-entry-form> `,
|
261
|
-
{
|
262
|
-
backdrop: true,
|
263
|
-
size: 'large',
|
264
|
-
title: i18next.t('title.data-entry-form')
|
265
|
-
}
|
266
|
-
)
|
267
|
-
}
|
307
|
+
click: showEntryView
|
268
308
|
}
|
269
309
|
},
|
270
310
|
{
|