@things-factory/dataset 8.0.0-beta.9 → 8.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/client/activities/activity-data-collect-edit.ts +105 -0
- package/client/activities/activity-data-collect-view.ts +91 -0
- package/client/activities/activity-data-review-edit.ts +133 -0
- package/client/activities/activity-data-review-view.ts +145 -0
- package/client/activities/activity-ooc-resolve-edit.ts +195 -0
- package/client/activities/activity-ooc-resolve-view.ts +143 -0
- package/client/activities/activity-ooc-review-edit.ts +173 -0
- package/client/activities/activity-ooc-review-view.ts +129 -0
- package/client/bootstrap.ts +35 -0
- package/client/components/data-entry-form.ts +109 -0
- package/client/index.ts +1 -0
- package/client/pages/data-archive/data-archive-list-page.ts +277 -0
- package/client/pages/data-archive/data-archive-request-popup.ts +177 -0
- package/client/pages/data-entry/data-entry-list-page.ts +464 -0
- package/client/pages/data-key-set/data-key-item-list.ts +183 -0
- package/client/pages/data-key-set/data-key-set-importer.ts +89 -0
- package/client/pages/data-key-set/data-key-set-list-page.ts +413 -0
- package/client/pages/data-ooc/data-ooc-list-page.ts +549 -0
- package/client/pages/data-ooc/data-ooc-page.ts +164 -0
- package/client/pages/data-ooc/data-ooc-view.ts +236 -0
- package/client/pages/data-ooc/data-oocs-page.ts +200 -0
- package/client/pages/data-report/data-report-embed-page.ts +108 -0
- package/client/pages/data-report/data-report-list-page.ts +454 -0
- package/client/pages/data-report/data-report-samples-page.ts +174 -0
- package/client/pages/data-report/jasper-report-oocs-page.ts +110 -0
- package/client/pages/data-report/jasper-report-samples-crosstab-page.ts +110 -0
- package/client/pages/data-report/jasper-report-samples-page.ts +110 -0
- package/client/pages/data-sample/data-sample-list-page.ts +442 -0
- package/client/pages/data-sample/data-sample-page.ts +55 -0
- package/client/pages/data-sample/data-sample-search-page.ts +424 -0
- package/client/pages/data-sample/data-sample-view.ts +292 -0
- package/client/pages/data-sample/data-samples-page.ts +249 -0
- package/client/pages/data-sensor/data-sensor-list-page.ts +456 -0
- package/client/pages/data-set/data-item-list.ts +304 -0
- package/client/pages/data-set/data-set-importer.ts +89 -0
- package/client/pages/data-set/data-set-list-page.ts +1078 -0
- package/client/pages/data-summary/data-summary-list-page.ts +363 -0
- package/client/pages/data-summary/data-summary-period-page.ts +439 -0
- package/client/pages/data-summary/data-summary-search-page.ts +426 -0
- package/client/pages/data-summary/data-summary-view.ts +133 -0
- package/client/route.ts +91 -0
- package/client/tsconfig.json +13 -0
- package/dist-client/activities/activity-data-review-edit.d.ts +1 -5
- package/dist-client/activities/activity-data-review-edit.js +5 -143
- package/dist-client/activities/activity-data-review-edit.js.map +1 -1
- package/dist-client/pages/data-entry/data-entry-list-page.js +2 -2
- package/dist-client/pages/data-entry/data-entry-list-page.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/activities/activity-data-review.js +5 -18
- package/dist-server/activities/activity-data-review.js.map +1 -1
- package/dist-server/activities/activity-ooc-review.js +52 -13
- package/dist-server/activities/activity-ooc-review.js.map +1 -1
- package/dist-server/controllers/create-data-sample.js +94 -4
- package/dist-server/controllers/create-data-sample.js.map +1 -1
- package/dist-server/controllers/index.d.ts +0 -3
- package/dist-server/controllers/index.js +0 -3
- package/dist-server/controllers/index.js.map +1 -1
- package/dist-server/service/data-sample/data-sample-query.d.ts +1 -1
- package/dist-server/service/data-sample/data-sample-query.js +3 -3
- package/dist-server/service/data-sample/data-sample-query.js.map +1 -1
- package/dist-server/service/index.d.ts +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +26 -26
- package/server/activities/activity-data-collect.ts +100 -0
- package/server/activities/activity-data-review.ts +82 -0
- package/server/activities/activity-ooc-resolve.ts +123 -0
- package/server/activities/activity-ooc-review.ts +144 -0
- package/server/activities/index.ts +11 -0
- package/server/controllers/create-data-sample.ts +426 -0
- package/server/controllers/data-use-case.ts +98 -0
- package/server/controllers/finalize-data-collection.ts +388 -0
- package/server/controllers/index.ts +3 -0
- package/server/controllers/issue-data-collection-task.ts +70 -0
- package/server/controllers/jasper-report.ts +186 -0
- package/server/controllers/query-data-summary-by-period.ts +178 -0
- package/server/controllers/shiny-report.ts +54 -0
- package/server/engine/index.ts +1 -0
- package/server/engine/task/create-data-sample.ts +100 -0
- package/server/engine/task/index.ts +2 -0
- package/server/engine/task/issue-collect-data.ts +45 -0
- package/server/index.ts +8 -0
- package/server/routes.ts +188 -0
- package/server/service/data-archive/data-archive-mutation.ts +273 -0
- package/server/service/data-archive/data-archive-query.ts +58 -0
- package/server/service/data-archive/data-archive-type.ts +48 -0
- package/server/service/data-archive/data-archive.ts +69 -0
- package/server/service/data-archive/index.ts +6 -0
- package/server/service/data-key-set/data-key-item-type.ts +31 -0
- package/server/service/data-key-set/data-key-set-mutation.ts +201 -0
- package/server/service/data-key-set/data-key-set-query.ts +68 -0
- package/server/service/data-key-set/data-key-set-type.ts +70 -0
- package/server/service/data-key-set/data-key-set.ts +86 -0
- package/server/service/data-key-set/index.ts +6 -0
- package/server/service/data-ooc/data-ooc-mutation.ts +154 -0
- package/server/service/data-ooc/data-ooc-query.ts +106 -0
- package/server/service/data-ooc/data-ooc-subscription.ts +48 -0
- package/server/service/data-ooc/data-ooc-type.ts +71 -0
- package/server/service/data-ooc/data-ooc.ts +259 -0
- package/server/service/data-ooc/index.ts +7 -0
- package/server/service/data-sample/data-sample-mutation.ts +18 -0
- package/server/service/data-sample/data-sample-query.ts +215 -0
- package/server/service/data-sample/data-sample-type.ts +47 -0
- package/server/service/data-sample/data-sample.ts +193 -0
- package/server/service/data-sample/index.ts +6 -0
- package/server/service/data-sensor/data-sensor-mutation.ts +116 -0
- package/server/service/data-sensor/data-sensor-query.ts +76 -0
- package/server/service/data-sensor/data-sensor-type.ts +104 -0
- package/server/service/data-sensor/data-sensor.ts +126 -0
- package/server/service/data-sensor/index.ts +6 -0
- package/server/service/data-set/data-item-type.ts +155 -0
- package/server/service/data-set/data-set-mutation.ts +552 -0
- package/server/service/data-set/data-set-query.ts +461 -0
- package/server/service/data-set/data-set-type.ts +204 -0
- package/server/service/data-set/data-set.ts +326 -0
- package/server/service/data-set/index.ts +6 -0
- package/server/service/data-set-history/data-set-history-query.ts +126 -0
- package/server/service/data-set-history/data-set-history-type.ts +12 -0
- package/server/service/data-set-history/data-set-history.ts +217 -0
- package/server/service/data-set-history/event-subscriber.ts +17 -0
- package/server/service/data-set-history/index.ts +7 -0
- package/server/service/data-spec/data-spec-manager.ts +21 -0
- package/server/service/data-spec/data-spec-query.ts +21 -0
- package/server/service/data-spec/data-spec.ts +45 -0
- package/server/service/data-spec/index.ts +5 -0
- package/server/service/data-summary/data-summary-mutation.ts +45 -0
- package/server/service/data-summary/data-summary-query.ts +179 -0
- package/server/service/data-summary/data-summary-type.ts +86 -0
- package/server/service/data-summary/data-summary.ts +170 -0
- package/server/service/data-summary/index.ts +7 -0
- package/server/service/index.ts +57 -0
- package/server/tsconfig.json +10 -0
- package/server/utils/config-resolver.ts +29 -0
- package/server/utils/index.ts +1 -0
- package/translations/en.json +0 -3
- package/translations/ja.json +0 -3
- package/translations/ko.json +0 -3
- package/translations/ms.json +0 -3
- package/translations/zh.json +0 -3
- package/dist-server/controllers/create-data-ooc.d.ts +0 -4
- package/dist-server/controllers/create-data-ooc.js +0 -65
- package/dist-server/controllers/create-data-ooc.js.map +0 -1
- package/dist-server/controllers/issue-ooc-resolve.d.ts +0 -3
- package/dist-server/controllers/issue-ooc-resolve.js +0 -49
- package/dist-server/controllers/issue-ooc-resolve.js.map +0 -1
- package/dist-server/controllers/issue-ooc-review.d.ts +0 -3
- package/dist-server/controllers/issue-ooc-review.js +0 -47
- package/dist-server/controllers/issue-ooc-review.js.map +0 -1
@@ -0,0 +1,105 @@
|
|
1
|
+
import '@operato/dataset/ox-data-entry-form.js'
|
2
|
+
|
3
|
+
import gql from 'graphql-tag'
|
4
|
+
import { css, html, LitElement } from 'lit'
|
5
|
+
import { customElement, property, query, state } from 'lit/decorators.js'
|
6
|
+
|
7
|
+
import { client } from '@operato/graphql'
|
8
|
+
import { i18next, localize } from '@operato/i18n'
|
9
|
+
import { ScrollbarStyles } from '@operato/styles'
|
10
|
+
import { OxDataEntryForm } from '@operato/dataset/ox-data-entry-form.js'
|
11
|
+
import { DataSet } from '@operato/dataset'
|
12
|
+
|
13
|
+
@customElement('activity-data-collect-edit')
|
14
|
+
export class DataCollectActivityEdit extends localize(i18next)(LitElement) {
|
15
|
+
static styles = [
|
16
|
+
ScrollbarStyles,
|
17
|
+
css`
|
18
|
+
:host {
|
19
|
+
display: flex;
|
20
|
+
flex-direction: column;
|
21
|
+
|
22
|
+
background-color: var(--md-sys-color-surface);
|
23
|
+
}
|
24
|
+
|
25
|
+
ox-data-entry-form {
|
26
|
+
flex: 1;
|
27
|
+
padding: 10px;
|
28
|
+
overflow: auto;
|
29
|
+
}
|
30
|
+
`
|
31
|
+
]
|
32
|
+
|
33
|
+
@property({ type: Object }) input?: any
|
34
|
+
@property({ type: Object }) output?: any
|
35
|
+
|
36
|
+
@state() dataSet?: DataSet & { id: string }
|
37
|
+
|
38
|
+
@query('ox-data-entry-form') entryForm!: OxDataEntryForm
|
39
|
+
|
40
|
+
render() {
|
41
|
+
return html`
|
42
|
+
<ox-data-entry-form
|
43
|
+
.dataSet=${this.dataSet}
|
44
|
+
.value=${this.output}
|
45
|
+
@change=${this._updateDataItems}
|
46
|
+
></ox-data-entry-form>
|
47
|
+
`
|
48
|
+
}
|
49
|
+
|
50
|
+
async _updateDataItems(e: CustomEvent) {
|
51
|
+
e.stopPropagation()
|
52
|
+
|
53
|
+
this.output = this.entryForm.value
|
54
|
+
|
55
|
+
this.dispatchEvent(
|
56
|
+
new CustomEvent('change', {
|
57
|
+
detail: this.output
|
58
|
+
})
|
59
|
+
)
|
60
|
+
}
|
61
|
+
|
62
|
+
updated(changes) {
|
63
|
+
if (changes.has('input')) {
|
64
|
+
this.fetchDataSet()
|
65
|
+
}
|
66
|
+
}
|
67
|
+
|
68
|
+
async fetchDataSet() {
|
69
|
+
const id = this.input.dataSetId
|
70
|
+
|
71
|
+
if (id) {
|
72
|
+
const response = await client.query({
|
73
|
+
query: gql`
|
74
|
+
query ($id: String!) {
|
75
|
+
dataSet(id: $id) {
|
76
|
+
id
|
77
|
+
name
|
78
|
+
description
|
79
|
+
useCase
|
80
|
+
dataItems {
|
81
|
+
name
|
82
|
+
description
|
83
|
+
active
|
84
|
+
hidden
|
85
|
+
tag
|
86
|
+
group
|
87
|
+
type
|
88
|
+
unit
|
89
|
+
options
|
90
|
+
quota
|
91
|
+
spec
|
92
|
+
stat
|
93
|
+
}
|
94
|
+
}
|
95
|
+
}
|
96
|
+
`,
|
97
|
+
variables: {
|
98
|
+
id
|
99
|
+
}
|
100
|
+
})
|
101
|
+
|
102
|
+
this.dataSet = response.data.dataSet
|
103
|
+
}
|
104
|
+
}
|
105
|
+
}
|
@@ -0,0 +1,91 @@
|
|
1
|
+
import '@operato/dataset/ox-data-entry-view.js'
|
2
|
+
|
3
|
+
import gql from 'graphql-tag'
|
4
|
+
import { css, html, LitElement } from 'lit'
|
5
|
+
import { customElement, property, query, state } from 'lit/decorators.js'
|
6
|
+
|
7
|
+
import { client } from '@operato/graphql'
|
8
|
+
import { i18next, localize } from '@operato/i18n'
|
9
|
+
import { ScrollbarStyles } from '@operato/styles'
|
10
|
+
import { DataSet } from '@operato/dataset'
|
11
|
+
|
12
|
+
@customElement('activity-data-collect-view')
|
13
|
+
export class DataCollectActivityView extends localize(i18next)(LitElement) {
|
14
|
+
static styles = [
|
15
|
+
ScrollbarStyles,
|
16
|
+
css`
|
17
|
+
:host {
|
18
|
+
display: flex;
|
19
|
+
flex-direction: column;
|
20
|
+
|
21
|
+
background-color: var(--md-sys-color-surface);
|
22
|
+
}
|
23
|
+
|
24
|
+
ox-data-entry-view {
|
25
|
+
flex: 1;
|
26
|
+
padding: 10px;
|
27
|
+
overflow: auto;
|
28
|
+
}
|
29
|
+
|
30
|
+
@media print {
|
31
|
+
:host {
|
32
|
+
display: block;
|
33
|
+
overflow: visible;
|
34
|
+
}
|
35
|
+
}
|
36
|
+
`
|
37
|
+
]
|
38
|
+
|
39
|
+
@property({ type: Object }) input?: any
|
40
|
+
@property({ type: Object }) output?: any
|
41
|
+
|
42
|
+
@state() dataSet?: DataSet & { id: string }
|
43
|
+
|
44
|
+
render() {
|
45
|
+
return html` <ox-data-entry-view .dataSet=${this.dataSet} .value=${this.output}></ox-data-entry-view>`
|
46
|
+
}
|
47
|
+
|
48
|
+
updated(changes) {
|
49
|
+
if (changes.has('input')) {
|
50
|
+
this.fetchDataSet()
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
async fetchDataSet() {
|
55
|
+
const id = this.input.dataSetId
|
56
|
+
|
57
|
+
if (id) {
|
58
|
+
const response = await client.query({
|
59
|
+
query: gql`
|
60
|
+
query ($id: String!) {
|
61
|
+
dataSet(id: $id) {
|
62
|
+
id
|
63
|
+
name
|
64
|
+
description
|
65
|
+
useCase
|
66
|
+
dataItems {
|
67
|
+
name
|
68
|
+
description
|
69
|
+
active
|
70
|
+
hidden
|
71
|
+
tag
|
72
|
+
group
|
73
|
+
type
|
74
|
+
unit
|
75
|
+
options
|
76
|
+
quota
|
77
|
+
spec
|
78
|
+
stat
|
79
|
+
}
|
80
|
+
}
|
81
|
+
}
|
82
|
+
`,
|
83
|
+
variables: {
|
84
|
+
id
|
85
|
+
}
|
86
|
+
})
|
87
|
+
|
88
|
+
this.dataSet = response.data.dataSet
|
89
|
+
}
|
90
|
+
}
|
91
|
+
}
|
@@ -0,0 +1,133 @@
|
|
1
|
+
import '@operato/dataset/ox-data-entry-form.js'
|
2
|
+
|
3
|
+
import gql from 'graphql-tag'
|
4
|
+
import { css, html, LitElement } from 'lit'
|
5
|
+
import { customElement, property, state } from 'lit/decorators.js'
|
6
|
+
|
7
|
+
import { i18next, localize } from '@operato/i18n'
|
8
|
+
import { ScrollbarStyles } from '@operato/styles'
|
9
|
+
import { client } from '@operato/graphql'
|
10
|
+
|
11
|
+
@customElement('activity-data-review-edit')
|
12
|
+
export class DataReviewActivityEdit extends localize(i18next)(LitElement) {
|
13
|
+
static styles = [
|
14
|
+
ScrollbarStyles,
|
15
|
+
css`
|
16
|
+
:host {
|
17
|
+
display: flex;
|
18
|
+
flex-direction: column;
|
19
|
+
|
20
|
+
background-color: var(--md-sys-color-surface);
|
21
|
+
}
|
22
|
+
|
23
|
+
div[content] {
|
24
|
+
flex: 1;
|
25
|
+
flex-direction: column;
|
26
|
+
|
27
|
+
display: flex;
|
28
|
+
overflow: auto;
|
29
|
+
}
|
30
|
+
|
31
|
+
ox-data-sample-view {
|
32
|
+
flex: 1;
|
33
|
+
padding: var(--spacing-large);
|
34
|
+
overflow: auto;
|
35
|
+
}
|
36
|
+
`
|
37
|
+
]
|
38
|
+
|
39
|
+
@property({ type: Object }) input?: any
|
40
|
+
@property({ type: Object }) output?: any
|
41
|
+
|
42
|
+
@state() dataSample?: any
|
43
|
+
|
44
|
+
render() {
|
45
|
+
return html`
|
46
|
+
<div content>
|
47
|
+
<ox-data-sample-view .dataSample=${this.dataSample}></ox-data-sample-view>
|
48
|
+
</div>
|
49
|
+
`
|
50
|
+
}
|
51
|
+
|
52
|
+
onChangeInstruction(e: Event) {
|
53
|
+
this.output ||= {}
|
54
|
+
this.output.instruction = (e.target as HTMLTextAreaElement).value
|
55
|
+
|
56
|
+
this.dispatchEvent(
|
57
|
+
new CustomEvent('change', {
|
58
|
+
detail: this.output
|
59
|
+
})
|
60
|
+
)
|
61
|
+
}
|
62
|
+
|
63
|
+
updated(changes) {
|
64
|
+
if (changes.has('input')) {
|
65
|
+
this.fetchDataAssign()
|
66
|
+
}
|
67
|
+
}
|
68
|
+
|
69
|
+
async fetchDataAssign() {
|
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
|
+
}
|
132
|
+
}
|
133
|
+
}
|
@@ -0,0 +1,145 @@
|
|
1
|
+
import '@operato/dataset/ox-data-entry-form.js'
|
2
|
+
|
3
|
+
import gql from 'graphql-tag'
|
4
|
+
import { css, html, LitElement } from 'lit'
|
5
|
+
import { customElement, property, state } from 'lit/decorators.js'
|
6
|
+
|
7
|
+
import { i18next, localize } from '@operato/i18n'
|
8
|
+
import { ScrollbarStyles } from '@operato/styles'
|
9
|
+
import { client } from '@operato/graphql'
|
10
|
+
|
11
|
+
@customElement('activity-data-review-view')
|
12
|
+
export class DataReviewActivityView extends localize(i18next)(LitElement) {
|
13
|
+
static styles = [
|
14
|
+
ScrollbarStyles,
|
15
|
+
css`
|
16
|
+
:host {
|
17
|
+
display: flex;
|
18
|
+
flex-direction: column;
|
19
|
+
|
20
|
+
background-color: var(--md-sys-color-surface);
|
21
|
+
}
|
22
|
+
|
23
|
+
div[content] {
|
24
|
+
flex: 1;
|
25
|
+
flex-direction: column;
|
26
|
+
|
27
|
+
display: flex;
|
28
|
+
overflow: auto;
|
29
|
+
}
|
30
|
+
|
31
|
+
ox-data-sample-view {
|
32
|
+
flex: 1;
|
33
|
+
padding: var(--spacing-large);
|
34
|
+
overflow: auto;
|
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
|
+
}
|
48
|
+
`
|
49
|
+
]
|
50
|
+
|
51
|
+
@property({ type: Object }) input?: any
|
52
|
+
@property({ type: Object }) output?: any
|
53
|
+
|
54
|
+
@state() dataSample?: any
|
55
|
+
|
56
|
+
render() {
|
57
|
+
return html`
|
58
|
+
<div content>
|
59
|
+
<ox-data-sample-view .dataSample=${this.dataSample}></ox-data-sample-view>
|
60
|
+
</div>
|
61
|
+
`
|
62
|
+
}
|
63
|
+
|
64
|
+
onChangeInstruction(e: Event) {
|
65
|
+
this.output ||= {}
|
66
|
+
this.output.instruction = (e.target as HTMLTextAreaElement).value
|
67
|
+
|
68
|
+
this.dispatchEvent(
|
69
|
+
new CustomEvent('change', {
|
70
|
+
detail: this.output
|
71
|
+
})
|
72
|
+
)
|
73
|
+
}
|
74
|
+
|
75
|
+
updated(changes) {
|
76
|
+
if (changes.has('input')) {
|
77
|
+
this.fetchDataAssign()
|
78
|
+
}
|
79
|
+
}
|
80
|
+
|
81
|
+
async fetchDataAssign() {
|
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
|
+
}
|
144
|
+
}
|
145
|
+
}
|
@@ -0,0 +1,195 @@
|
|
1
|
+
import '@material/web/icon/icon.js'
|
2
|
+
import '@operato/dataset/ox-data-ooc-brief-view.js'
|
3
|
+
|
4
|
+
import gql from 'graphql-tag'
|
5
|
+
import { css, html, LitElement, nothing } from 'lit'
|
6
|
+
import { customElement, property, query, state } from 'lit/decorators.js'
|
7
|
+
|
8
|
+
import { client } from '@operato/graphql'
|
9
|
+
import { i18next, localize } from '@operato/i18n'
|
10
|
+
import { ScrollbarStyles } from '@operato/styles'
|
11
|
+
|
12
|
+
@customElement('activity-ooc-resolve-edit')
|
13
|
+
class OocResolveActivityEdit extends localize(i18next)(LitElement) {
|
14
|
+
static styles = [
|
15
|
+
ScrollbarStyles,
|
16
|
+
css`
|
17
|
+
:host {
|
18
|
+
display: flex;
|
19
|
+
flex-direction: column;
|
20
|
+
|
21
|
+
background-color: var(--md-sys-color-surface);
|
22
|
+
}
|
23
|
+
|
24
|
+
div[content] {
|
25
|
+
flex: 1;
|
26
|
+
flex-direction: column;
|
27
|
+
|
28
|
+
display: flex;
|
29
|
+
overflow: auto;
|
30
|
+
}
|
31
|
+
|
32
|
+
ox-data-ooc-brief-view {
|
33
|
+
flex: 1;
|
34
|
+
padding: var(--spacing-large);
|
35
|
+
overflow: auto;
|
36
|
+
}
|
37
|
+
|
38
|
+
label[action] {
|
39
|
+
display: flex;
|
40
|
+
flex-direction: column;
|
41
|
+
|
42
|
+
padding: var(--spacing-large);
|
43
|
+
}
|
44
|
+
|
45
|
+
label[action] h2 {
|
46
|
+
display: flex;
|
47
|
+
|
48
|
+
color: var(--title-text-color);
|
49
|
+
text-transform: capitalize;
|
50
|
+
margin: var(--title-margin);
|
51
|
+
align-items: center;
|
52
|
+
}
|
53
|
+
|
54
|
+
md-icon {
|
55
|
+
color: var(--status-danger-color);
|
56
|
+
}
|
57
|
+
|
58
|
+
textarea {
|
59
|
+
border: var(--input-field-border);
|
60
|
+
border-radius: var(--spacing-small);
|
61
|
+
margin: var(--spacing-medium);
|
62
|
+
padding: var(--spacing-medium);
|
63
|
+
font: var(--input-field-font);
|
64
|
+
color: var(--md-sys-color-on-surface);
|
65
|
+
background: var(--md-sys-color-surface-variant);
|
66
|
+
|
67
|
+
resize: none;
|
68
|
+
outline: none;
|
69
|
+
min-height: 200px;
|
70
|
+
}
|
71
|
+
`
|
72
|
+
]
|
73
|
+
|
74
|
+
@property({ type: Object }) input?: any
|
75
|
+
@property({ type: Object }) output?: any
|
76
|
+
@property({ type: Object }) activityThread?: any
|
77
|
+
|
78
|
+
@state() dataOoc?: any
|
79
|
+
|
80
|
+
@query('textarea') actionTextArea!: HTMLTextAreaElement
|
81
|
+
|
82
|
+
render() {
|
83
|
+
const action = this.output?.action
|
84
|
+
const state = this.activityThread?.state
|
85
|
+
const editable = state == 'unassigned' || state == 'assigned' || state == 'started'
|
86
|
+
|
87
|
+
return html`
|
88
|
+
<div content>
|
89
|
+
<ox-data-ooc-brief-view .dataOoc=${this.dataOoc}></ox-data-ooc-brief-view>
|
90
|
+
</div>
|
91
|
+
|
92
|
+
<!-- <ox-data-ooc-correction-part .dataOoc=${this.dataOoc}></ox-data-ooc-correction-part> -->
|
93
|
+
|
94
|
+
${editable
|
95
|
+
? html`
|
96
|
+
<label action>
|
97
|
+
<h2><md-icon>build_circle</md-icon> <span>${i18next.t('label.corrective action')}</span></h2>
|
98
|
+
<textarea
|
99
|
+
placeholder=${String(i18next.t('text.corrective action placeholder'))}
|
100
|
+
.value=${action || ''}
|
101
|
+
@change=${this.onChangeAction}
|
102
|
+
></textarea>
|
103
|
+
</label>
|
104
|
+
`
|
105
|
+
: nothing}
|
106
|
+
`
|
107
|
+
}
|
108
|
+
|
109
|
+
onChangeAction(e: Event) {
|
110
|
+
this.output ||= {}
|
111
|
+
this.output.action = (e.target as HTMLTextAreaElement).value
|
112
|
+
|
113
|
+
this.dispatchEvent(
|
114
|
+
new CustomEvent('change', {
|
115
|
+
detail: this.output
|
116
|
+
})
|
117
|
+
)
|
118
|
+
}
|
119
|
+
|
120
|
+
updated(changes) {
|
121
|
+
if (changes.has('input')) {
|
122
|
+
this.fetchDataOoc()
|
123
|
+
}
|
124
|
+
}
|
125
|
+
|
126
|
+
async fetchDataOoc() {
|
127
|
+
const id = this.input.dataOocId
|
128
|
+
|
129
|
+
if (id) {
|
130
|
+
const response = await client.query({
|
131
|
+
query: gql`
|
132
|
+
query ($id: String!) {
|
133
|
+
dataOoc(id: $id) {
|
134
|
+
id
|
135
|
+
name
|
136
|
+
description
|
137
|
+
ooc
|
138
|
+
oos
|
139
|
+
state
|
140
|
+
type
|
141
|
+
useCase
|
142
|
+
data
|
143
|
+
judgment
|
144
|
+
history
|
145
|
+
correctiveAction
|
146
|
+
correctiveInstruction
|
147
|
+
dataItems {
|
148
|
+
name
|
149
|
+
description
|
150
|
+
active
|
151
|
+
hidden
|
152
|
+
tag
|
153
|
+
group
|
154
|
+
type
|
155
|
+
unit
|
156
|
+
options
|
157
|
+
quota
|
158
|
+
spec
|
159
|
+
stat
|
160
|
+
}
|
161
|
+
workDate
|
162
|
+
workShift
|
163
|
+
reviewer {
|
164
|
+
id
|
165
|
+
name
|
166
|
+
}
|
167
|
+
corrector {
|
168
|
+
id
|
169
|
+
name
|
170
|
+
}
|
171
|
+
collectedAt
|
172
|
+
reviewedAt
|
173
|
+
correctedAt
|
174
|
+
}
|
175
|
+
}
|
176
|
+
`,
|
177
|
+
variables: {
|
178
|
+
id
|
179
|
+
}
|
180
|
+
})
|
181
|
+
|
182
|
+
const dataOoc = {
|
183
|
+
...response.data.dataOoc
|
184
|
+
}
|
185
|
+
|
186
|
+
if (this.activityThread?.output) {
|
187
|
+
dataOoc.correctiveAction = this.activityThread.output.action
|
188
|
+
dataOoc.correctedAt = this.activityThread.updatedAt
|
189
|
+
dataOoc.corrector = this.activityThread.assignee
|
190
|
+
}
|
191
|
+
|
192
|
+
this.dataOoc = dataOoc
|
193
|
+
}
|
194
|
+
}
|
195
|
+
}
|