@things-factory/dataset 7.0.0-alpha.6 → 7.0.0-alpha.7
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-view.ts +7 -0
- package/client/activities/activity-data-review-edit.ts +66 -4
- package/client/activities/activity-data-review-view.ts +78 -4
- package/client/activities/activity-ooc-resolve-view.ts +12 -0
- package/client/activities/activity-ooc-review-view.ts +12 -0
- package/client/pages/data-ooc/data-ooc-list-page.ts +38 -9
- package/client/pages/data-ooc/data-ooc-page.ts +42 -0
- package/client/pages/data-ooc/data-ooc-view.ts +158 -19
- package/client/pages/data-ooc/data-oocs-page.ts +69 -3
- package/client/pages/data-sample/data-sample-list-page.ts +23 -6
- package/client/pages/data-sample/data-sample-page.ts +7 -0
- package/client/pages/data-sample/data-sample-search-page.ts +2 -2
- package/client/pages/data-sample/data-sample-view.ts +144 -22
- package/client/pages/data-sample/data-samples-page.ts +131 -5
- package/client/pages/data-sensor/data-sensor-list-page.ts +28 -6
- package/client/pages/data-set/data-item-list.ts +2 -2
- package/dist-client/activities/activity-data-collect-view.js +7 -0
- package/dist-client/activities/activity-data-collect-view.js.map +1 -1
- package/dist-client/activities/activity-data-review-edit.d.ts +1 -1
- package/dist-client/activities/activity-data-review-edit.js +63 -5
- package/dist-client/activities/activity-data-review-edit.js.map +1 -1
- package/dist-client/activities/activity-data-review-view.d.ts +1 -1
- package/dist-client/activities/activity-data-review-view.js +75 -5
- package/dist-client/activities/activity-data-review-view.js.map +1 -1
- package/dist-client/activities/activity-ooc-resolve-view.js +12 -0
- package/dist-client/activities/activity-ooc-resolve-view.js.map +1 -1
- package/dist-client/activities/activity-ooc-review-view.js +12 -0
- package/dist-client/activities/activity-ooc-review-view.js.map +1 -1
- package/dist-client/pages/data-ooc/data-ooc-list-page.js +38 -9
- package/dist-client/pages/data-ooc/data-ooc-list-page.js.map +1 -1
- package/dist-client/pages/data-ooc/data-ooc-page.js +42 -0
- package/dist-client/pages/data-ooc/data-ooc-page.js.map +1 -1
- package/dist-client/pages/data-ooc/data-ooc-view.d.ts +6 -3
- package/dist-client/pages/data-ooc/data-ooc-view.js +155 -22
- package/dist-client/pages/data-ooc/data-ooc-view.js.map +1 -1
- package/dist-client/pages/data-ooc/data-oocs-page.d.ts +1 -0
- package/dist-client/pages/data-ooc/data-oocs-page.js +69 -3
- package/dist-client/pages/data-ooc/data-oocs-page.js.map +1 -1
- package/dist-client/pages/data-sample/data-sample-list-page.js +23 -6
- package/dist-client/pages/data-sample/data-sample-list-page.js.map +1 -1
- package/dist-client/pages/data-sample/data-sample-page.js +7 -0
- package/dist-client/pages/data-sample/data-sample-page.js.map +1 -1
- package/dist-client/pages/data-sample/data-sample-search-page.js +2 -2
- 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 +18 -0
- package/dist-client/pages/data-sample/data-sample-view.js +143 -21
- package/dist-client/pages/data-sample/data-sample-view.js.map +1 -1
- package/dist-client/pages/data-sample/data-samples-page.d.ts +2 -0
- package/dist-client/pages/data-sample/data-samples-page.js +132 -5
- package/dist-client/pages/data-sample/data-samples-page.js.map +1 -1
- package/dist-client/pages/data-sensor/data-sensor-list-page.js +28 -6
- package/dist-client/pages/data-sensor/data-sensor-list-page.js.map +1 -1
- package/dist-client/pages/data-set/data-item-list.js +2 -2
- package/dist-client/pages/data-set/data-item-list.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/activities/activity-data-review.js.map +1 -1
- package/dist-server/activities/activity-ooc-review.js +2 -1
- package/dist-server/activities/activity-ooc-review.js.map +1 -1
- package/dist-server/controllers/create-data-sample.js +27 -29
- package/dist-server/controllers/create-data-sample.js.map +1 -1
- package/dist-server/engine/index.js +4 -0
- package/dist-server/engine/index.js.map +1 -0
- package/dist-server/engine/task/create-data-sample.js +80 -0
- package/dist-server/engine/task/create-data-sample.js.map +1 -0
- package/dist-server/engine/task/index.js +4 -0
- package/dist-server/engine/task/index.js.map +1 -0
- package/dist-server/index.js +1 -0
- package/dist-server/index.js.map +1 -1
- package/dist-server/routes.js +35 -27
- package/dist-server/routes.js.map +1 -1
- package/dist-server/service/data-ooc/data-ooc-query.js +32 -0
- package/dist-server/service/data-ooc/data-ooc-query.js.map +1 -1
- package/dist-server/service/data-ooc/data-ooc.js +15 -26
- package/dist-server/service/data-ooc/data-ooc.js.map +1 -1
- package/dist-server/service/data-sample/data-sample-query.js +24 -0
- package/dist-server/service/data-sample/data-sample-query.js.map +1 -1
- package/dist-server/service/data-sample/data-sample.js +17 -21
- package/dist-server/service/data-sample/data-sample.js.map +1 -1
- package/dist-server/service/data-sensor/data-sensor-query.js +16 -1
- package/dist-server/service/data-sensor/data-sensor-query.js.map +1 -1
- package/dist-server/service/data-sensor/data-sensor-type.js +8 -0
- package/dist-server/service/data-sensor/data-sensor-type.js.map +1 -1
- package/dist-server/service/data-sensor/data-sensor.js +15 -1
- package/dist-server/service/data-sensor/data-sensor.js.map +1 -1
- package/dist-server/service/data-set/data-item-type.js +1 -0
- package/dist-server/service/data-set/data-item-type.js.map +1 -1
- package/dist-server/service/data-set/data-set-query.js +2 -2
- package/dist-server/service/data-set/data-set-query.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/helps/dataset/task/create-data-sample.ja.md +28 -0
- package/helps/dataset/task/create-data-sample.ko.md +28 -0
- package/helps/dataset/task/create-data-sample.md +28 -0
- package/helps/dataset/task/create-data-sample.ms.md +30 -0
- package/helps/dataset/task/create-data-sample.zh.md +28 -0
- package/package.json +11 -11
- package/server/activities/activity-data-review.ts +1 -5
- package/server/activities/activity-ooc-review.ts +5 -15
- package/server/controllers/create-data-sample.ts +31 -38
- package/server/engine/index.ts +1 -0
- package/server/engine/task/create-data-sample.ts +92 -0
- package/server/engine/task/index.ts +1 -0
- package/server/index.ts +1 -0
- package/server/routes.ts +47 -31
- package/server/service/data-ooc/data-ooc-query.ts +17 -0
- package/server/service/data-ooc/data-ooc.ts +17 -28
- package/server/service/data-sample/data-sample-query.ts +17 -17
- package/server/service/data-sample/data-sample.ts +18 -23
- package/server/service/data-sensor/data-sensor-query.ts +13 -1
- package/server/service/data-sensor/data-sensor-type.ts +6 -0
- package/server/service/data-sensor/data-sensor.ts +13 -11
- package/server/service/data-set/data-item-type.ts +1 -0
- package/server/service/data-set/data-set-query.ts +7 -7
- package/translations/en.json +14 -2
- package/translations/ja.json +11 -1
- package/translations/ko.json +13 -1
- package/translations/ms.json +10 -0
- package/translations/zh.json +11 -1
@@ -1,10 +1,12 @@
|
|
1
1
|
import '@operato/dataset/ox-data-entry-form.js'
|
2
2
|
|
3
|
+
import gql from 'graphql-tag'
|
3
4
|
import { css, html, LitElement } from 'lit'
|
4
5
|
import { customElement, property, state } from 'lit/decorators.js'
|
5
6
|
|
6
7
|
import { i18next, localize } from '@operato/i18n'
|
7
8
|
import { ScrollbarStyles } from '@operato/styles'
|
9
|
+
import { client } from '@operato/graphql'
|
8
10
|
|
9
11
|
@customElement('activity-data-review-edit')
|
10
12
|
export class DataReviewActivityEdit extends localize(i18next)(LitElement) {
|
@@ -37,12 +39,12 @@ export class DataReviewActivityEdit extends localize(i18next)(LitElement) {
|
|
37
39
|
@property({ type: Object }) input?: any
|
38
40
|
@property({ type: Object }) output?: any
|
39
41
|
|
40
|
-
@state()
|
42
|
+
@state() dataSample?: any
|
41
43
|
|
42
44
|
render() {
|
43
45
|
return html`
|
44
46
|
<div content>
|
45
|
-
<ox-data-sample-view .dataSample=${this.
|
47
|
+
<ox-data-sample-view .dataSample=${this.dataSample}></ox-data-sample-view>
|
46
48
|
</div>
|
47
49
|
`
|
48
50
|
}
|
@@ -65,7 +67,67 @@ export class DataReviewActivityEdit extends localize(i18next)(LitElement) {
|
|
65
67
|
}
|
66
68
|
|
67
69
|
async fetchDataAssign() {
|
68
|
-
const dataSample = this.input
|
69
|
-
|
70
|
+
const { dataSampleId, dataSample } = this.input || {}
|
71
|
+
|
72
|
+
if (dataSample) {
|
73
|
+
/* only for backwards compatibility - should be deleted later */
|
74
|
+
this.dataSample = dataSample
|
75
|
+
} else if (dataSampleId) {
|
76
|
+
const response = await client.query({
|
77
|
+
query: gql`
|
78
|
+
query ($id: String!) {
|
79
|
+
dataSample(id: $id) {
|
80
|
+
id
|
81
|
+
name
|
82
|
+
description
|
83
|
+
useCase
|
84
|
+
key01
|
85
|
+
key02
|
86
|
+
key03
|
87
|
+
key04
|
88
|
+
key05
|
89
|
+
data
|
90
|
+
ooc
|
91
|
+
oos
|
92
|
+
dataSet {
|
93
|
+
id
|
94
|
+
name
|
95
|
+
description
|
96
|
+
}
|
97
|
+
dataItems {
|
98
|
+
name
|
99
|
+
description
|
100
|
+
active
|
101
|
+
hidden
|
102
|
+
tag
|
103
|
+
group
|
104
|
+
type
|
105
|
+
unit
|
106
|
+
options
|
107
|
+
quota
|
108
|
+
spec
|
109
|
+
stat
|
110
|
+
}
|
111
|
+
judgment
|
112
|
+
workDate
|
113
|
+
workShift
|
114
|
+
updater {
|
115
|
+
id
|
116
|
+
name
|
117
|
+
}
|
118
|
+
updatedAt
|
119
|
+
collectedAt
|
120
|
+
}
|
121
|
+
}
|
122
|
+
`,
|
123
|
+
variables: {
|
124
|
+
id: dataSampleId
|
125
|
+
}
|
126
|
+
})
|
127
|
+
|
128
|
+
this.dataSample = {
|
129
|
+
...response.data.dataSample
|
130
|
+
}
|
131
|
+
}
|
70
132
|
}
|
71
133
|
}
|
@@ -1,10 +1,12 @@
|
|
1
1
|
import '@operato/dataset/ox-data-entry-form.js'
|
2
2
|
|
3
|
+
import gql from 'graphql-tag'
|
3
4
|
import { css, html, LitElement } from 'lit'
|
4
5
|
import { customElement, property, state } from 'lit/decorators.js'
|
5
6
|
|
6
7
|
import { i18next, localize } from '@operato/i18n'
|
7
8
|
import { ScrollbarStyles } from '@operato/styles'
|
9
|
+
import { client } from '@operato/graphql'
|
8
10
|
|
9
11
|
@customElement('activity-data-review-view')
|
10
12
|
export class DataReviewActivityView extends localize(i18next)(LitElement) {
|
@@ -31,18 +33,30 @@ export class DataReviewActivityView extends localize(i18next)(LitElement) {
|
|
31
33
|
padding: var(--padding-wide);
|
32
34
|
overflow: auto;
|
33
35
|
}
|
36
|
+
|
37
|
+
@media print {
|
38
|
+
:host {
|
39
|
+
display: block;
|
40
|
+
overflow: visible;
|
41
|
+
}
|
42
|
+
|
43
|
+
div[content] {
|
44
|
+
display: block;
|
45
|
+
overflow: visible;
|
46
|
+
}
|
47
|
+
}
|
34
48
|
`
|
35
49
|
]
|
36
50
|
|
37
51
|
@property({ type: Object }) input?: any
|
38
52
|
@property({ type: Object }) output?: any
|
39
53
|
|
40
|
-
@state()
|
54
|
+
@state() dataSample?: any
|
41
55
|
|
42
56
|
render() {
|
43
57
|
return html`
|
44
58
|
<div content>
|
45
|
-
<ox-data-sample-view .dataSample=${this.
|
59
|
+
<ox-data-sample-view .dataSample=${this.dataSample}></ox-data-sample-view>
|
46
60
|
</div>
|
47
61
|
`
|
48
62
|
}
|
@@ -65,7 +79,67 @@ export class DataReviewActivityView extends localize(i18next)(LitElement) {
|
|
65
79
|
}
|
66
80
|
|
67
81
|
async fetchDataAssign() {
|
68
|
-
const dataSample = this.input
|
69
|
-
|
82
|
+
const { dataSampleId, dataSample } = this.input || {}
|
83
|
+
|
84
|
+
if (dataSample) {
|
85
|
+
/* only for backwards compatibility - should be deleted later */
|
86
|
+
this.dataSample = dataSample
|
87
|
+
} else if (dataSampleId) {
|
88
|
+
const response = await client.query({
|
89
|
+
query: gql`
|
90
|
+
query ($id: String!) {
|
91
|
+
dataSample(id: $id) {
|
92
|
+
id
|
93
|
+
name
|
94
|
+
description
|
95
|
+
useCase
|
96
|
+
key01
|
97
|
+
key02
|
98
|
+
key03
|
99
|
+
key04
|
100
|
+
key05
|
101
|
+
data
|
102
|
+
ooc
|
103
|
+
oos
|
104
|
+
dataSet {
|
105
|
+
id
|
106
|
+
name
|
107
|
+
description
|
108
|
+
}
|
109
|
+
dataItems {
|
110
|
+
name
|
111
|
+
description
|
112
|
+
active
|
113
|
+
hidden
|
114
|
+
tag
|
115
|
+
group
|
116
|
+
type
|
117
|
+
unit
|
118
|
+
options
|
119
|
+
quota
|
120
|
+
spec
|
121
|
+
stat
|
122
|
+
}
|
123
|
+
judgment
|
124
|
+
workDate
|
125
|
+
workShift
|
126
|
+
updater {
|
127
|
+
id
|
128
|
+
name
|
129
|
+
}
|
130
|
+
updatedAt
|
131
|
+
collectedAt
|
132
|
+
}
|
133
|
+
}
|
134
|
+
`,
|
135
|
+
variables: {
|
136
|
+
id: dataSampleId
|
137
|
+
}
|
138
|
+
})
|
139
|
+
|
140
|
+
this.dataSample = {
|
141
|
+
...response.data.dataSample
|
142
|
+
}
|
143
|
+
}
|
70
144
|
}
|
71
145
|
}
|
@@ -33,6 +33,18 @@ export class OocResolveActivityView extends localize(i18next)(LitElement) {
|
|
33
33
|
padding: var(--padding-wide);
|
34
34
|
overflow: auto;
|
35
35
|
}
|
36
|
+
|
37
|
+
@media print {
|
38
|
+
:host {
|
39
|
+
display: block;
|
40
|
+
overflow: visible;
|
41
|
+
}
|
42
|
+
|
43
|
+
div[content] {
|
44
|
+
display: block;
|
45
|
+
overflow: visible;
|
46
|
+
}
|
47
|
+
}
|
36
48
|
`
|
37
49
|
]
|
38
50
|
|
@@ -33,6 +33,18 @@ class OocReviewActivityView extends localize(i18next)(LitElement) {
|
|
33
33
|
padding: var(--padding-wide);
|
34
34
|
overflow: auto;
|
35
35
|
}
|
36
|
+
|
37
|
+
@media print {
|
38
|
+
:host {
|
39
|
+
display: block;
|
40
|
+
overflow: visible;
|
41
|
+
}
|
42
|
+
|
43
|
+
div[content] {
|
44
|
+
display: block;
|
45
|
+
overflow: visible;
|
46
|
+
}
|
47
|
+
}
|
36
48
|
`
|
37
49
|
]
|
38
50
|
|
@@ -47,6 +47,8 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
|
|
47
47
|
flex-direction: column;
|
48
48
|
|
49
49
|
overflow: hidden;
|
50
|
+
|
51
|
+
--grid-header-padding: 2px 0 2px 9px;
|
50
52
|
}
|
51
53
|
|
52
54
|
ox-grist {
|
@@ -136,7 +138,7 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
|
|
136
138
|
title: i18next.t('title.view detail ooc data'),
|
137
139
|
handlers: {
|
138
140
|
click: (columns, data, column, record, rowIndex) => {
|
139
|
-
const popup = openPopup(html` <data-ooc-view
|
141
|
+
const popup = openPopup(html` <data-ooc-view data-ooc-id=${record.id} style="background-color: white;"></data-ooc-view> `, {
|
140
142
|
backdrop: true,
|
141
143
|
size: 'large',
|
142
144
|
title: i18next.t('title.data-ooc view')
|
@@ -154,7 +156,7 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
|
|
154
156
|
label: true,
|
155
157
|
header: i18next.t('field.name'),
|
156
158
|
record: {
|
157
|
-
editable:
|
159
|
+
editable: false
|
158
160
|
},
|
159
161
|
filter: 'search',
|
160
162
|
sortable: true,
|
@@ -167,7 +169,7 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
|
|
167
169
|
label: true,
|
168
170
|
header: i18next.t('field.description'),
|
169
171
|
record: {
|
170
|
-
editable:
|
172
|
+
editable: false
|
171
173
|
},
|
172
174
|
filter: 'search',
|
173
175
|
width: 150,
|
@@ -210,13 +212,25 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
|
|
210
212
|
filter: true,
|
211
213
|
imex: true
|
212
214
|
},
|
215
|
+
{
|
216
|
+
type: 'textarea',
|
217
|
+
name: 'correctiveInstruction',
|
218
|
+
label: true,
|
219
|
+
header: i18next.t('field.corrective-instruction'),
|
220
|
+
record: {
|
221
|
+
editable: false,
|
222
|
+
language: 'text'
|
223
|
+
},
|
224
|
+
width: 150,
|
225
|
+
imex: true
|
226
|
+
},
|
213
227
|
{
|
214
228
|
type: 'textarea',
|
215
229
|
name: 'correctiveAction',
|
216
230
|
label: true,
|
217
231
|
header: i18next.t('field.corrective-action'),
|
218
232
|
record: {
|
219
|
-
editable:
|
233
|
+
editable: false,
|
220
234
|
language: 'text'
|
221
235
|
},
|
222
236
|
width: 150,
|
@@ -233,7 +247,10 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
|
|
233
247
|
{
|
234
248
|
type: 'string',
|
235
249
|
name: 'key01',
|
236
|
-
header:
|
250
|
+
header: {
|
251
|
+
renderer: i18next.t('field.key-01'),
|
252
|
+
group: i18next.t('field.key')
|
253
|
+
},
|
237
254
|
record: {
|
238
255
|
editable: false
|
239
256
|
},
|
@@ -244,7 +261,10 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
|
|
244
261
|
{
|
245
262
|
type: 'string',
|
246
263
|
name: 'key02',
|
247
|
-
header:
|
264
|
+
header: {
|
265
|
+
renderer: i18next.t('field.key-02'),
|
266
|
+
group: i18next.t('field.key')
|
267
|
+
},
|
248
268
|
record: {
|
249
269
|
editable: false
|
250
270
|
},
|
@@ -255,7 +275,10 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
|
|
255
275
|
{
|
256
276
|
type: 'string',
|
257
277
|
name: 'key03',
|
258
|
-
header:
|
278
|
+
header: {
|
279
|
+
renderer: i18next.t('field.key-03'),
|
280
|
+
group: i18next.t('field.key')
|
281
|
+
},
|
259
282
|
record: {
|
260
283
|
editable: false
|
261
284
|
},
|
@@ -266,7 +289,10 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
|
|
266
289
|
{
|
267
290
|
type: 'string',
|
268
291
|
name: 'key04',
|
269
|
-
header:
|
292
|
+
header: {
|
293
|
+
renderer: i18next.t('field.key-04'),
|
294
|
+
group: i18next.t('field.key')
|
295
|
+
},
|
270
296
|
record: {
|
271
297
|
editable: false
|
272
298
|
},
|
@@ -277,7 +303,10 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
|
|
277
303
|
{
|
278
304
|
type: 'string',
|
279
305
|
name: 'key05',
|
280
|
-
header:
|
306
|
+
header: {
|
307
|
+
renderer: i18next.t('field.key-05'),
|
308
|
+
group: i18next.t('field.key')
|
309
|
+
},
|
281
310
|
record: {
|
282
311
|
editable: false
|
283
312
|
},
|
@@ -19,6 +19,13 @@ export class DataOocViewPage extends localize(i18next)(PageView) {
|
|
19
19
|
data-ooc-view {
|
20
20
|
flex: 1;
|
21
21
|
}
|
22
|
+
|
23
|
+
@media print {
|
24
|
+
:host {
|
25
|
+
display: block;
|
26
|
+
overflow: visible;
|
27
|
+
}
|
28
|
+
}
|
22
29
|
`
|
23
30
|
]
|
24
31
|
|
@@ -107,6 +114,41 @@ export class DataOocViewPage extends localize(i18next)(PageView) {
|
|
107
114
|
}
|
108
115
|
updatedAt
|
109
116
|
collectedAt
|
117
|
+
reviewActivityInstance {
|
118
|
+
...ActivityInstanceFragment
|
119
|
+
}
|
120
|
+
resolveActivityInstance {
|
121
|
+
...ActivityInstanceFragment
|
122
|
+
}
|
123
|
+
}
|
124
|
+
}
|
125
|
+
|
126
|
+
fragment ActivityInstanceFragment on ActivityInstance {
|
127
|
+
activityThreads {
|
128
|
+
assignee {
|
129
|
+
name
|
130
|
+
}
|
131
|
+
output
|
132
|
+
activityApprovals {
|
133
|
+
judgment
|
134
|
+
approver {
|
135
|
+
name
|
136
|
+
}
|
137
|
+
comment
|
138
|
+
createdAt
|
139
|
+
updatedAt
|
140
|
+
terminatedAt
|
141
|
+
}
|
142
|
+
activityThreadHistories {
|
143
|
+
transaction
|
144
|
+
reason
|
145
|
+
updater {
|
146
|
+
name
|
147
|
+
}
|
148
|
+
updatedAt
|
149
|
+
state
|
150
|
+
output
|
151
|
+
}
|
110
152
|
}
|
111
153
|
}
|
112
154
|
`,
|
@@ -1,9 +1,12 @@
|
|
1
1
|
import '@operato/dataset/ox-data-ooc-brief-view.js'
|
2
2
|
import '@material/mwc-fab'
|
3
|
+
import '@things-factory/worklist/dist-client/components/activity-thread-timeline.js'
|
3
4
|
|
4
|
-
import
|
5
|
-
import {
|
5
|
+
import gql from 'graphql-tag'
|
6
|
+
import { css, html, LitElement, nothing } from 'lit'
|
7
|
+
import { customElement, property, query, state } from 'lit/decorators.js'
|
6
8
|
|
9
|
+
import { client } from '@operato/graphql'
|
7
10
|
import { i18next, localize } from '@operato/i18n'
|
8
11
|
import { ScrollbarStyles } from '@operato/styles'
|
9
12
|
import { GhostPrint } from '@operato/ghost-print'
|
@@ -14,21 +17,23 @@ export class DataOocView extends localize(i18next)(LitElement) {
|
|
14
17
|
ScrollbarStyles,
|
15
18
|
css`
|
16
19
|
:host {
|
17
|
-
display:
|
18
|
-
flex-direction: column;
|
20
|
+
display: block;
|
19
21
|
position: relative;
|
20
|
-
|
21
22
|
background-color: #fff;
|
23
|
+
|
24
|
+
overflow: auto;
|
22
25
|
}
|
23
26
|
|
24
27
|
ox-data-ooc-brief-view {
|
25
|
-
flex: 1;
|
26
28
|
padding: var(--padding-wide);
|
27
|
-
|
29
|
+
}
|
30
|
+
|
31
|
+
activity-thread-timeline {
|
32
|
+
margin: var(--margin-default);
|
28
33
|
}
|
29
34
|
|
30
35
|
mwc-fab {
|
31
|
-
position:
|
36
|
+
position: fixed;
|
32
37
|
bottom: 15px;
|
33
38
|
right: 16px;
|
34
39
|
text-decoration: auto;
|
@@ -36,15 +41,6 @@ export class DataOocView extends localize(i18next)(LitElement) {
|
|
36
41
|
}
|
37
42
|
|
38
43
|
@media print {
|
39
|
-
:host {
|
40
|
-
display: block;
|
41
|
-
}
|
42
|
-
|
43
|
-
ox-data-ooc-brief-view {
|
44
|
-
flex: unset;
|
45
|
-
overflow: visible;
|
46
|
-
}
|
47
|
-
|
48
44
|
mwc-fab {
|
49
45
|
display: none;
|
50
46
|
}
|
@@ -52,15 +48,44 @@ export class DataOocView extends localize(i18next)(LitElement) {
|
|
52
48
|
`
|
53
49
|
]
|
54
50
|
|
55
|
-
@property({
|
51
|
+
@property({
|
52
|
+
type: String,
|
53
|
+
attribute: 'data-ooc-id'
|
54
|
+
})
|
55
|
+
dataOocId?: string
|
56
56
|
|
57
|
-
@
|
57
|
+
@state() dataOoc?: any
|
58
58
|
|
59
59
|
private printHandler = this.handlePrint.bind(this)
|
60
60
|
|
61
61
|
render() {
|
62
|
+
if (!this.dataOoc) {
|
63
|
+
return nothing
|
64
|
+
}
|
65
|
+
|
66
|
+
const reviewActivityThread = this.dataOoc?.reviewActivityInstance?.activityThreads?.[0]
|
67
|
+
const resolveActivityThread = this.dataOoc?.resolveActivityInstance?.activityThreads?.[0]
|
68
|
+
|
62
69
|
return html`
|
63
70
|
<ox-data-ooc-brief-view .dataOoc=${this.dataOoc}></ox-data-ooc-brief-view>
|
71
|
+
${reviewActivityThread
|
72
|
+
? html`
|
73
|
+
<activity-thread-timeline
|
74
|
+
subtitle=${String(i18next.t('label.ooc review timeline'))}
|
75
|
+
.activityThread=${reviewActivityThread}
|
76
|
+
short-form
|
77
|
+
></activity-thread-timeline>
|
78
|
+
`
|
79
|
+
: nothing}
|
80
|
+
${resolveActivityThread
|
81
|
+
? html`
|
82
|
+
<activity-thread-timeline
|
83
|
+
subtitle=${String(i18next.t('label.ooc resolve timeline'))}
|
84
|
+
.activityThread=${resolveActivityThread}
|
85
|
+
short-form
|
86
|
+
></activity-thread-timeline>
|
87
|
+
`
|
88
|
+
: nothing}
|
64
89
|
|
65
90
|
<mwc-fab
|
66
91
|
icon="print"
|
@@ -74,6 +99,120 @@ export class DataOocView extends localize(i18next)(LitElement) {
|
|
74
99
|
`
|
75
100
|
}
|
76
101
|
|
102
|
+
updated(changes) {
|
103
|
+
if (changes.has('dataOocId')) {
|
104
|
+
this.fetchDataOoc()
|
105
|
+
}
|
106
|
+
}
|
107
|
+
|
108
|
+
async fetchDataOoc() {
|
109
|
+
const id = this.dataOocId
|
110
|
+
|
111
|
+
const response = await client.query({
|
112
|
+
query: gql`
|
113
|
+
query ($id: String!) {
|
114
|
+
dataOoc(id: $id) {
|
115
|
+
id
|
116
|
+
name
|
117
|
+
description
|
118
|
+
useCase
|
119
|
+
dataSet {
|
120
|
+
id
|
121
|
+
name
|
122
|
+
}
|
123
|
+
key01
|
124
|
+
key02
|
125
|
+
key03
|
126
|
+
key04
|
127
|
+
key05
|
128
|
+
partitionKeys
|
129
|
+
dataItems {
|
130
|
+
name
|
131
|
+
description
|
132
|
+
active
|
133
|
+
hidden
|
134
|
+
tag
|
135
|
+
group
|
136
|
+
type
|
137
|
+
unit
|
138
|
+
options
|
139
|
+
quota
|
140
|
+
spec
|
141
|
+
stat
|
142
|
+
}
|
143
|
+
data
|
144
|
+
rawData
|
145
|
+
judgment
|
146
|
+
ooc
|
147
|
+
oos
|
148
|
+
state
|
149
|
+
history
|
150
|
+
workDate
|
151
|
+
workShift
|
152
|
+
correctiveInstruction
|
153
|
+
correctiveAction
|
154
|
+
reviewedAt
|
155
|
+
reviewer {
|
156
|
+
id
|
157
|
+
name
|
158
|
+
}
|
159
|
+
correctedAt
|
160
|
+
corrector {
|
161
|
+
id
|
162
|
+
name
|
163
|
+
}
|
164
|
+
updater {
|
165
|
+
id
|
166
|
+
name
|
167
|
+
}
|
168
|
+
updatedAt
|
169
|
+
collectedAt
|
170
|
+
reviewActivityInstance {
|
171
|
+
...ActivityInstanceFragment
|
172
|
+
}
|
173
|
+
resolveActivityInstance {
|
174
|
+
...ActivityInstanceFragment
|
175
|
+
}
|
176
|
+
}
|
177
|
+
}
|
178
|
+
|
179
|
+
fragment ActivityInstanceFragment on ActivityInstance {
|
180
|
+
activityThreads {
|
181
|
+
assignee {
|
182
|
+
name
|
183
|
+
}
|
184
|
+
output
|
185
|
+
activityApprovals {
|
186
|
+
judgment
|
187
|
+
approver {
|
188
|
+
name
|
189
|
+
}
|
190
|
+
comment
|
191
|
+
createdAt
|
192
|
+
updatedAt
|
193
|
+
terminatedAt
|
194
|
+
}
|
195
|
+
activityThreadHistories {
|
196
|
+
transaction
|
197
|
+
reason
|
198
|
+
updater {
|
199
|
+
name
|
200
|
+
}
|
201
|
+
updatedAt
|
202
|
+
state
|
203
|
+
output
|
204
|
+
}
|
205
|
+
}
|
206
|
+
}
|
207
|
+
`,
|
208
|
+
variables: {
|
209
|
+
id
|
210
|
+
}
|
211
|
+
})
|
212
|
+
|
213
|
+
this.dataOoc = response.data.dataOoc
|
214
|
+
}
|
215
|
+
|
77
216
|
handlePrint(event) {
|
78
217
|
if ((event.ctrlKey || event.metaKey) && event.key === 'p') {
|
79
218
|
event.preventDefault()
|