@things-factory/dataset 6.0.27 → 6.0.28
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/assets/images/data-collect.png +0 -0
- package/client/bootstrap.ts +4 -2
- package/client/components/data-collect-activity-view.ts +100 -0
- package/client/components/ooc-resolve-activity-view.ts +174 -0
- package/client/components/{data-ooc-activity-view.ts → ooc-review-activity-view.ts} +16 -16
- package/client/pages/data-ooc/data-ooc-list-page.ts +6 -0
- package/client/pages/data-ooc/data-ooc-view-page.ts +115 -0
- package/client/pages/data-ooc/data-ooc-view.ts +7 -61
- package/client/pages/data-set/data-set-list-page.ts +111 -4
- package/client/route.ts +4 -0
- package/config/config.development.js +30 -30
- package/config/config.production.js +31 -31
- package/dist-client/bootstrap.d.ts +3 -1
- package/dist-client/bootstrap.js +4 -2
- package/dist-client/bootstrap.js.map +1 -1
- package/dist-client/components/data-collect-activity-view.d.ts +19 -0
- package/dist-client/components/data-collect-activity-view.js +101 -0
- package/dist-client/components/data-collect-activity-view.js.map +1 -0
- package/dist-client/components/ooc-resolve-activity-view.d.ts +1 -0
- package/dist-client/components/ooc-resolve-activity-view.js +175 -0
- package/dist-client/components/ooc-resolve-activity-view.js.map +1 -0
- package/dist-client/components/ooc-review-activity-view.d.ts +1 -0
- package/dist-client/components/ooc-review-activity-view.js +155 -0
- package/dist-client/components/ooc-review-activity-view.js.map +1 -0
- package/dist-client/pages/data-ooc/data-ooc-list-page.js +6 -0
- package/dist-client/pages/data-ooc/data-ooc-list-page.js.map +1 -1
- package/dist-client/pages/data-ooc/data-ooc-view-page.d.ts +18 -0
- package/dist-client/pages/data-ooc/data-ooc-view-page.js +114 -0
- package/dist-client/pages/data-ooc/data-ooc-view-page.js.map +1 -0
- package/dist-client/pages/data-ooc/data-ooc-view.d.ts +15 -1
- package/dist-client/pages/data-ooc/data-ooc-view.js +9 -58
- package/dist-client/pages/data-ooc/data-ooc-view.js.map +1 -1
- package/dist-client/pages/data-set/data-set-list-page.d.ts +2 -0
- package/dist-client/pages/data-set/data-set-list-page.js +106 -4
- package/dist-client/pages/data-set/data-set-list-page.js.map +1 -1
- package/dist-client/route.js +3 -0
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/controllers/activity-template/activity-data-collect.js +82 -0
- package/dist-server/controllers/activity-template/activity-data-collect.js.map +1 -0
- package/dist-server/controllers/activity-template/activity-ooc-resolve.js +100 -0
- package/dist-server/controllers/activity-template/activity-ooc-resolve.js.map +1 -0
- package/dist-server/controllers/activity-template/activity-ooc-review.js +107 -0
- package/dist-server/controllers/activity-template/activity-ooc-review.js.map +1 -0
- package/dist-server/controllers/create-data-sample.js +44 -42
- package/dist-server/controllers/create-data-sample.js.map +1 -1
- package/dist-server/controllers/data-use-case.js +1 -1
- package/dist-server/controllers/data-use-case.js.map +1 -1
- package/dist-server/controllers/index.js +4 -2
- package/dist-server/controllers/index.js.map +1 -1
- package/dist-server/middlewares/index.js +8 -0
- package/dist-server/middlewares/index.js.map +1 -0
- package/dist-server/migrations/index.js +12 -0
- package/dist-server/migrations/index.js.map +1 -0
- package/dist-server/routes.js +45 -1
- package/dist-server/routes.js.map +1 -1
- package/dist-server/service/data-ooc/data-ooc-query.js +22 -2
- package/dist-server/service/data-ooc/data-ooc-query.js.map +1 -1
- package/dist-server/service/data-ooc/data-ooc.js +26 -0
- package/dist-server/service/data-ooc/data-ooc.js.map +1 -1
- package/dist-server/service/data-set/data-set-mutation.js +88 -0
- package/dist-server/service/data-set/data-set-mutation.js.map +1 -1
- package/dist-server/service/data-set/data-set-query.js +33 -0
- package/dist-server/service/data-set/data-set-query.js.map +1 -1
- package/dist-server/service/data-set/data-set-type.js +16 -0
- package/dist-server/service/data-set/data-set-type.js.map +1 -1
- package/dist-server/service/data-set/data-set.js +52 -3
- package/dist-server/service/data-set/data-set.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/helps/dataset/data-ooc.md +5 -4
- package/package.json +10 -8
- package/server/controllers/activity-template/activity-data-collect.ts +84 -0
- package/server/controllers/activity-template/activity-ooc-resolve.ts +114 -0
- package/server/controllers/activity-template/activity-ooc-review.ts +118 -0
- package/server/controllers/create-data-sample.ts +48 -53
- package/server/controllers/data-use-case.ts +1 -1
- package/server/controllers/index.ts +4 -2
- package/server/routes.ts +61 -2
- package/server/service/data-ooc/data-ooc-query.ts +12 -2
- package/server/service/data-ooc/data-ooc.ts +23 -0
- package/server/service/data-set/data-set-mutation.ts +99 -0
- package/server/service/data-set/data-set-query.ts +34 -1
- package/server/service/data-set/data-set-type.ts +14 -0
- package/server/service/data-set/data-set.ts +40 -2
- package/things-factory.config.js +4 -0
- package/translations/en.json +2 -0
- package/translations/ko.json +2 -0
- package/translations/ms.json +2 -0
- package/translations/zh.json +2 -0
- package/server/controllers/activity-template/activity-ooc.ts +0 -55
Binary file
|
package/client/bootstrap.ts
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
import './components/data-
|
1
|
+
import './components/data-collect-activity-view' /* refered by the activity template (activity-data-collect) on server */
|
2
|
+
import './components/ooc-review-activity-view' /* refered by the activity template (activity-ooc-review) on server */
|
3
|
+
import './components/ooc-resolve-activity-view' /* refered by the activity template (activity-ooc-resolve) on server */
|
2
4
|
|
3
5
|
import '@operato/app/filter-renderer.js' /* register resource-object filter renderer */
|
4
6
|
|
@@ -8,7 +10,7 @@ import {
|
|
8
10
|
registerEditor as registerGristEditor,
|
9
11
|
registerRenderer as registerGristRenderer
|
10
12
|
} from '@operato/data-grist'
|
11
|
-
import { OxGristEditorDataItemSpec } from '@operato/dataset/grist-editor'
|
13
|
+
import { OxGristEditorDataItemSpec } from '@operato/dataset/grist-editor/ox-grist-editor-data-item-spec.js'
|
12
14
|
import { OxGristEditorPartitionKeys } from '@operato/grist-editor/ox-grist-editor-partition-keys.js'
|
13
15
|
|
14
16
|
export default function bootstrap() {
|
@@ -0,0 +1,100 @@
|
|
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('data-collect-activity-view')
|
14
|
+
export class DataCollectActivityView extends localize(i18next)(LitElement) {
|
15
|
+
static styles = [
|
16
|
+
ScrollbarStyles,
|
17
|
+
css`
|
18
|
+
:host {
|
19
|
+
display: flex;
|
20
|
+
flex-direction: column;
|
21
|
+
|
22
|
+
background-color: #fff;
|
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() {
|
51
|
+
this.output = this.entryForm.value
|
52
|
+
|
53
|
+
this.dispatchEvent(
|
54
|
+
new CustomEvent('change', {
|
55
|
+
detail: this.output
|
56
|
+
})
|
57
|
+
)
|
58
|
+
}
|
59
|
+
|
60
|
+
updated(changes) {
|
61
|
+
if (changes.has('input')) {
|
62
|
+
this.fetchDataSet()
|
63
|
+
}
|
64
|
+
}
|
65
|
+
|
66
|
+
async fetchDataSet() {
|
67
|
+
const id = this.input.dataSetId
|
68
|
+
|
69
|
+
if (id) {
|
70
|
+
const response = await client.query({
|
71
|
+
query: gql`
|
72
|
+
query ($id: String!) {
|
73
|
+
dataSet(id: $id) {
|
74
|
+
id
|
75
|
+
name
|
76
|
+
description
|
77
|
+
useCase
|
78
|
+
dataItems {
|
79
|
+
name
|
80
|
+
description
|
81
|
+
active
|
82
|
+
tag
|
83
|
+
type
|
84
|
+
unit
|
85
|
+
options
|
86
|
+
quota
|
87
|
+
spec
|
88
|
+
}
|
89
|
+
}
|
90
|
+
}
|
91
|
+
`,
|
92
|
+
variables: {
|
93
|
+
id
|
94
|
+
}
|
95
|
+
})
|
96
|
+
|
97
|
+
this.dataSet = response.data.dataSet
|
98
|
+
}
|
99
|
+
}
|
100
|
+
}
|
@@ -0,0 +1,174 @@
|
|
1
|
+
import '@operato/dataset/ox-data-sample-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
|
+
|
11
|
+
@customElement('ooc-resolve-activity-view')
|
12
|
+
class OocResolveActivityView extends localize(i18next)(LitElement) {
|
13
|
+
static styles = [
|
14
|
+
ScrollbarStyles,
|
15
|
+
css`
|
16
|
+
:host {
|
17
|
+
display: flex;
|
18
|
+
flex-direction: column;
|
19
|
+
|
20
|
+
background-color: #fff;
|
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(--padding-wide);
|
34
|
+
overflow: auto;
|
35
|
+
}
|
36
|
+
|
37
|
+
div[instruction] {
|
38
|
+
display: flex;
|
39
|
+
flex-direction: column;
|
40
|
+
|
41
|
+
padding: var(--padding-wide);
|
42
|
+
}
|
43
|
+
|
44
|
+
div[instruction] div {
|
45
|
+
display: flex;
|
46
|
+
}
|
47
|
+
|
48
|
+
div[instruction] div[content] {
|
49
|
+
display: flex;
|
50
|
+
min-height: 50px;
|
51
|
+
}
|
52
|
+
|
53
|
+
label[action] {
|
54
|
+
display: flex;
|
55
|
+
flex-direction: column;
|
56
|
+
|
57
|
+
padding: var(--padding-wide);
|
58
|
+
}
|
59
|
+
|
60
|
+
label[action] div {
|
61
|
+
display: flex;
|
62
|
+
}
|
63
|
+
|
64
|
+
mwc-icon {
|
65
|
+
color: var(--status-danger-color);
|
66
|
+
}
|
67
|
+
|
68
|
+
textarea {
|
69
|
+
border: var(--input-field-border);
|
70
|
+
border-radius: var(--input-border-radius);
|
71
|
+
padding: var(--input-field-padding);
|
72
|
+
font: var(--input-field-font);
|
73
|
+
}
|
74
|
+
|
75
|
+
.button-container {
|
76
|
+
display: flex;
|
77
|
+
margin-left: auto;
|
78
|
+
padding: var(--padding-default);
|
79
|
+
}
|
80
|
+
`
|
81
|
+
]
|
82
|
+
|
83
|
+
@property({ type: Object }) input?: any
|
84
|
+
@property({ type: Object }) output?: any
|
85
|
+
|
86
|
+
@state() dataOoc?: any
|
87
|
+
|
88
|
+
@query('textarea') actionTextArea!: HTMLTextAreaElement
|
89
|
+
|
90
|
+
render() {
|
91
|
+
const action = this.output?.action
|
92
|
+
|
93
|
+
return html`
|
94
|
+
<div content>
|
95
|
+
<ox-data-sample-view .dataSample=${this.dataOoc}></ox-data-sample-view>
|
96
|
+
</div>
|
97
|
+
|
98
|
+
<div instruction>
|
99
|
+
<div><mwc-icon>build_circle</mwc-icon> <span>corrective instruction</span></div>
|
100
|
+
<div content>${this.input?.instruction}</div>
|
101
|
+
</div>
|
102
|
+
|
103
|
+
<label action>
|
104
|
+
<div><mwc-icon>build_circle</mwc-icon> <span>corrective action</span></div>
|
105
|
+
<textarea
|
106
|
+
placeholder="시정 및 예방을 위한 조치 이행 사항을 입력해주세요."
|
107
|
+
.value=${action || ''}
|
108
|
+
@change=${this.onChangeAction}
|
109
|
+
></textarea>
|
110
|
+
</label>
|
111
|
+
`
|
112
|
+
}
|
113
|
+
|
114
|
+
onChangeAction(e: Event) {
|
115
|
+
this.output ||= {}
|
116
|
+
this.output.action = (e.target as HTMLTextAreaElement).value
|
117
|
+
|
118
|
+
this.dispatchEvent(
|
119
|
+
new CustomEvent('change', {
|
120
|
+
detail: this.output
|
121
|
+
})
|
122
|
+
)
|
123
|
+
}
|
124
|
+
|
125
|
+
updated(changes) {
|
126
|
+
if (changes.has('input')) {
|
127
|
+
this.fetchDataOoc()
|
128
|
+
}
|
129
|
+
}
|
130
|
+
|
131
|
+
async fetchDataOoc() {
|
132
|
+
const id = this.input.dataOocId
|
133
|
+
|
134
|
+
if (id) {
|
135
|
+
const response = await client.query({
|
136
|
+
query: gql`
|
137
|
+
query ($id: String!) {
|
138
|
+
dataOoc(id: $id) {
|
139
|
+
id
|
140
|
+
name
|
141
|
+
description
|
142
|
+
ooc
|
143
|
+
oos
|
144
|
+
state
|
145
|
+
type
|
146
|
+
useCase
|
147
|
+
data
|
148
|
+
judgment
|
149
|
+
dataItems {
|
150
|
+
name
|
151
|
+
description
|
152
|
+
active
|
153
|
+
tag
|
154
|
+
type
|
155
|
+
unit
|
156
|
+
options
|
157
|
+
quota
|
158
|
+
spec
|
159
|
+
}
|
160
|
+
workDate
|
161
|
+
workShift
|
162
|
+
collectedAt
|
163
|
+
}
|
164
|
+
}
|
165
|
+
`,
|
166
|
+
variables: {
|
167
|
+
id
|
168
|
+
}
|
169
|
+
})
|
170
|
+
|
171
|
+
this.dataOoc = response.data.dataOoc
|
172
|
+
}
|
173
|
+
}
|
174
|
+
}
|
@@ -8,8 +8,8 @@ import { client } from '@operato/graphql'
|
|
8
8
|
import { i18next, localize } from '@operato/i18n'
|
9
9
|
import { ScrollbarStyles } from '@operato/styles'
|
10
10
|
|
11
|
-
@customElement('
|
12
|
-
class
|
11
|
+
@customElement('ooc-review-activity-view')
|
12
|
+
class OocReviewActivityView extends localize(i18next)(LitElement) {
|
13
13
|
static styles = [
|
14
14
|
ScrollbarStyles,
|
15
15
|
css`
|
@@ -28,20 +28,20 @@ class DataOocActivityView extends localize(i18next)(LitElement) {
|
|
28
28
|
overflow: auto;
|
29
29
|
}
|
30
30
|
|
31
|
-
ox-data-
|
31
|
+
ox-data-sample-view {
|
32
32
|
flex: 1;
|
33
33
|
padding: var(--padding-wide);
|
34
34
|
overflow: auto;
|
35
35
|
}
|
36
36
|
|
37
|
-
label[
|
37
|
+
label[instruction] {
|
38
38
|
display: flex;
|
39
39
|
flex-direction: column;
|
40
40
|
|
41
41
|
padding: var(--padding-wide);
|
42
42
|
}
|
43
43
|
|
44
|
-
label[
|
44
|
+
label[instruction] div {
|
45
45
|
display: flex;
|
46
46
|
}
|
47
47
|
|
@@ -69,30 +69,30 @@ class DataOocActivityView extends localize(i18next)(LitElement) {
|
|
69
69
|
|
70
70
|
@state() dataOoc?: any
|
71
71
|
|
72
|
-
@query('textarea')
|
72
|
+
@query('textarea') instructionTextArea!: HTMLTextAreaElement
|
73
73
|
|
74
74
|
render() {
|
75
|
-
const
|
75
|
+
const instruction = this.output?.instruction
|
76
76
|
|
77
77
|
return html`
|
78
78
|
<div content>
|
79
79
|
<ox-data-sample-view .dataSample=${this.dataOoc}></ox-data-sample-view>
|
80
80
|
</div>
|
81
81
|
|
82
|
-
<label
|
83
|
-
<div><mwc-icon>build_circle</mwc-icon> <span>
|
82
|
+
<label instruction>
|
83
|
+
<div><mwc-icon>build_circle</mwc-icon> <span>corrective instruction</span></div>
|
84
84
|
<textarea
|
85
|
-
placeholder="조치
|
86
|
-
.value=${
|
87
|
-
@change=${this.
|
85
|
+
placeholder="시정 및 예방을 위한 조치 지시 사항을 입력해주세요."
|
86
|
+
.value=${instruction || ''}
|
87
|
+
@change=${this.onChangeInstruction}
|
88
88
|
></textarea>
|
89
89
|
</label>
|
90
90
|
`
|
91
91
|
}
|
92
92
|
|
93
|
-
|
94
|
-
this.output
|
95
|
-
this.output.
|
93
|
+
onChangeInstruction(e: Event) {
|
94
|
+
this.output ||= {}
|
95
|
+
this.output.instruction = (e.target as HTMLTextAreaElement).value
|
96
96
|
|
97
97
|
this.dispatchEvent(
|
98
98
|
new CustomEvent('change', {
|
@@ -108,7 +108,7 @@ class DataOocActivityView extends localize(i18next)(LitElement) {
|
|
108
108
|
}
|
109
109
|
|
110
110
|
async fetchDataOoc() {
|
111
|
-
const id = this.input
|
111
|
+
const id = this.input?.dataOocId
|
112
112
|
|
113
113
|
if (id) {
|
114
114
|
const response = await client.query({
|
@@ -412,7 +412,13 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
|
|
412
412
|
history
|
413
413
|
workDate
|
414
414
|
workShift
|
415
|
+
correctiveInstruction
|
415
416
|
correctiveAction
|
417
|
+
reviewedAt
|
418
|
+
reviewer {
|
419
|
+
id
|
420
|
+
name
|
421
|
+
}
|
416
422
|
correctedAt
|
417
423
|
corrector {
|
418
424
|
id
|
@@ -0,0 +1,115 @@
|
|
1
|
+
import gql from 'graphql-tag'
|
2
|
+
|
3
|
+
import { PropertyValues, html, css } from 'lit'
|
4
|
+
import { customElement, property } from 'lit/decorators.js'
|
5
|
+
import { PageView } from '@operato/shell'
|
6
|
+
import { i18next, localize } from '@operato/i18n'
|
7
|
+
import { client } from '@operato/graphql'
|
8
|
+
|
9
|
+
import './data-ooc-view.js'
|
10
|
+
|
11
|
+
@customElement('data-ooc-view-page')
|
12
|
+
export class DataOocViewPage extends localize(i18next)(PageView) {
|
13
|
+
static styles = [
|
14
|
+
css`
|
15
|
+
:host {
|
16
|
+
display: flex;
|
17
|
+
}
|
18
|
+
|
19
|
+
data-ooc-view {
|
20
|
+
flex: 1;
|
21
|
+
}
|
22
|
+
`
|
23
|
+
]
|
24
|
+
|
25
|
+
@property({ type: Object }) dataOoc?: any
|
26
|
+
|
27
|
+
get context() {
|
28
|
+
return {
|
29
|
+
title: i18next.t('title.data-ooc list'),
|
30
|
+
help: 'dataset/data-ooc',
|
31
|
+
actions: []
|
32
|
+
}
|
33
|
+
}
|
34
|
+
|
35
|
+
render() {
|
36
|
+
return html` <data-ooc-view .dataOoc=${this.dataOoc}></data-ooc-view> `
|
37
|
+
}
|
38
|
+
|
39
|
+
updated(changes: PropertyValues<this>) {}
|
40
|
+
|
41
|
+
pageUpdated(changes: any, lifecycle: any, before: any) {
|
42
|
+
if (this.active) {
|
43
|
+
/*
|
44
|
+
* this page is activated
|
45
|
+
*/
|
46
|
+
this.fetchOoc(lifecycle.resourceId)
|
47
|
+
} else {
|
48
|
+
/* this page is deactivated */
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
async fetchOoc(id: string) {
|
53
|
+
const response = await client.query({
|
54
|
+
query: gql`
|
55
|
+
query ($id: String!) {
|
56
|
+
dataOoc(id: $id) {
|
57
|
+
id
|
58
|
+
name
|
59
|
+
description
|
60
|
+
useCase
|
61
|
+
dataSet {
|
62
|
+
id
|
63
|
+
name
|
64
|
+
}
|
65
|
+
key01
|
66
|
+
key02
|
67
|
+
key03
|
68
|
+
key04
|
69
|
+
key05
|
70
|
+
partitionKeys
|
71
|
+
dataItems {
|
72
|
+
name
|
73
|
+
description
|
74
|
+
tag
|
75
|
+
unit
|
76
|
+
spec
|
77
|
+
}
|
78
|
+
data
|
79
|
+
rawData
|
80
|
+
judgment
|
81
|
+
ooc
|
82
|
+
oos
|
83
|
+
state
|
84
|
+
history
|
85
|
+
workDate
|
86
|
+
workShift
|
87
|
+
correctiveInstruction
|
88
|
+
correctiveAction
|
89
|
+
reviewedAt
|
90
|
+
reviewer {
|
91
|
+
id
|
92
|
+
name
|
93
|
+
}
|
94
|
+
correctedAt
|
95
|
+
corrector {
|
96
|
+
id
|
97
|
+
name
|
98
|
+
}
|
99
|
+
updater {
|
100
|
+
id
|
101
|
+
name
|
102
|
+
}
|
103
|
+
updatedAt
|
104
|
+
collectedAt
|
105
|
+
}
|
106
|
+
}
|
107
|
+
`,
|
108
|
+
variables: {
|
109
|
+
id
|
110
|
+
}
|
111
|
+
})
|
112
|
+
|
113
|
+
this.dataOoc = response.data.dataOoc
|
114
|
+
}
|
115
|
+
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import '@operato/dataset/ox-data-ooc-view.js'
|
1
|
+
import '@operato/dataset/ox-data-ooc-brief-view.js'
|
2
2
|
|
3
3
|
import gql from 'graphql-tag'
|
4
4
|
import { css, html, LitElement } from 'lit'
|
@@ -10,7 +10,7 @@ import { ScrollbarStyles } from '@operato/styles'
|
|
10
10
|
import { DataSet } from '@operato/dataset'
|
11
11
|
|
12
12
|
@customElement('data-ooc-view')
|
13
|
-
class DataOocView extends localize(i18next)(LitElement) {
|
13
|
+
export class DataOocView extends localize(i18next)(LitElement) {
|
14
14
|
static styles = [
|
15
15
|
ScrollbarStyles,
|
16
16
|
css`
|
@@ -28,7 +28,7 @@ class DataOocView extends localize(i18next)(LitElement) {
|
|
28
28
|
overflow: auto;
|
29
29
|
}
|
30
30
|
|
31
|
-
ox-data-ooc-view {
|
31
|
+
ox-data-ooc-brief-view {
|
32
32
|
flex: 1;
|
33
33
|
padding: var(--padding-wide);
|
34
34
|
overflow: auto;
|
@@ -64,39 +64,19 @@ class DataOocView extends localize(i18next)(LitElement) {
|
|
64
64
|
`
|
65
65
|
]
|
66
66
|
|
67
|
-
@property({ type: Object }) dataSet?: DataSet
|
68
67
|
@property({ type: Object }) dataOoc?: any
|
69
68
|
|
69
|
+
@state() dataSet?: DataSet
|
70
|
+
|
70
71
|
@query('textarea') commentTextArea!: HTMLTextAreaElement
|
71
|
-
@query('ox-data-ooc-view') sampleView!: HTMLTextAreaElement
|
72
|
+
@query('ox-data-ooc-brief-view') sampleView!: HTMLTextAreaElement
|
72
73
|
|
73
74
|
render() {
|
74
75
|
const state = this.dataOoc?.state
|
75
76
|
|
76
77
|
return html`
|
77
78
|
<div content>
|
78
|
-
<ox-data-ooc-view .dataSet=${this.dataSet} .dataOoc=${this.dataOoc}></ox-data-ooc-view>
|
79
|
-
</div>
|
80
|
-
|
81
|
-
${state === 'CREATED' || state === 'REVIEWED'
|
82
|
-
? html`
|
83
|
-
<label comment>
|
84
|
-
<div><mwc-icon>build_circle</mwc-icon> <span>correction activity</span></div>
|
85
|
-
<textarea placeholder="조치 내용을 입력해주세요."></textarea>
|
86
|
-
</label>
|
87
|
-
`
|
88
|
-
: html``}
|
89
|
-
|
90
|
-
<div class="button-container">
|
91
|
-
${state === 'CREATED'
|
92
|
-
? html`<mwc-button raised @click=${() => this._processOoc('REVIEWED')}
|
93
|
-
>${i18next.t('button.reviewed')}</mwc-button
|
94
|
-
>`
|
95
|
-
: state === 'REVIEWED'
|
96
|
-
? html`<mwc-button raised @click=${() => this._processOoc('CORRECTED')}
|
97
|
-
>${i18next.t('button.corrected')}</mwc-button
|
98
|
-
>`
|
99
|
-
: html``}
|
79
|
+
<ox-data-ooc-brief-view .dataSet=${this.dataSet} .dataOoc=${this.dataOoc}></ox-data-ooc-brief-view>
|
100
80
|
</div>
|
101
81
|
`
|
102
82
|
}
|
@@ -141,38 +121,4 @@ class DataOocView extends localize(i18next)(LitElement) {
|
|
141
121
|
this.dataSet = response.data.dataSet
|
142
122
|
}
|
143
123
|
}
|
144
|
-
|
145
|
-
async _processOoc(state) {
|
146
|
-
const commentTextArea = this.commentTextArea
|
147
|
-
const comment = commentTextArea && commentTextArea.value
|
148
|
-
if (!comment || !comment.trim()) {
|
149
|
-
commentTextArea.focus()
|
150
|
-
return
|
151
|
-
}
|
152
|
-
|
153
|
-
const patch = {
|
154
|
-
state,
|
155
|
-
correctiveAction: comment
|
156
|
-
}
|
157
|
-
|
158
|
-
const response = await client.mutate({
|
159
|
-
mutation: gql`
|
160
|
-
mutation ($id: String!, $patch: DataOocPatch!) {
|
161
|
-
updateDataOoc(id: $id, patch: $patch) {
|
162
|
-
id
|
163
|
-
}
|
164
|
-
}
|
165
|
-
`,
|
166
|
-
variables: {
|
167
|
-
id: this.dataOoc?.id,
|
168
|
-
patch
|
169
|
-
}
|
170
|
-
})
|
171
|
-
|
172
|
-
if (!response.errors) {
|
173
|
-
document.dispatchEvent(
|
174
|
-
new CustomEvent('notify', { detail: { message: i18next.t('text.data ooc updated successfully') } })
|
175
|
-
)
|
176
|
-
}
|
177
|
-
}
|
178
124
|
}
|