@things-factory/dataset 7.0.0-alpha.3 → 7.0.0-alpha.30

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.
Files changed (165) hide show
  1. package/client/activities/activity-data-collect-edit.ts +1 -7
  2. package/client/activities/activity-data-collect-view.ts +7 -0
  3. package/client/activities/activity-data-review-edit.ts +66 -32
  4. package/client/activities/activity-data-review-view.ts +75 -29
  5. package/client/activities/activity-ooc-resolve-edit.ts +44 -48
  6. package/client/activities/activity-ooc-resolve-view.ts +25 -35
  7. package/client/activities/activity-ooc-review-edit.ts +36 -29
  8. package/client/activities/activity-ooc-review-view.ts +9 -19
  9. package/client/bootstrap.ts +5 -9
  10. package/client/pages/data-entry/data-entry-list-page.ts +8 -23
  11. package/client/pages/data-ooc/data-ooc-list-page.ts +71 -27
  12. package/client/pages/data-ooc/{data-ooc-view-page.ts → data-ooc-page.ts} +45 -1
  13. package/client/pages/data-ooc/data-ooc-view.ts +198 -41
  14. package/client/pages/data-ooc/data-oocs-page.ts +200 -0
  15. package/client/pages/data-sample/data-sample-list-page.ts +53 -31
  16. package/client/pages/data-sample/{data-sample-view-page.ts → data-sample-page.ts} +8 -1
  17. package/client/pages/data-sample/data-sample-search-page.ts +34 -29
  18. package/client/pages/data-sample/data-sample-view.ts +192 -21
  19. package/client/pages/data-sample/data-samples-page.ts +249 -0
  20. package/client/pages/data-sensor/data-sensor-list-page.ts +28 -6
  21. package/client/pages/data-set/data-item-list.ts +2 -2
  22. package/client/pages/data-summary/data-summary-list-page.ts +12 -24
  23. package/client/route.ts +10 -2
  24. package/dist-client/activities/activity-data-collect-edit.js +1 -7
  25. package/dist-client/activities/activity-data-collect-edit.js.map +1 -1
  26. package/dist-client/activities/activity-data-collect-view.js +7 -0
  27. package/dist-client/activities/activity-data-collect-view.js.map +1 -1
  28. package/dist-client/activities/activity-data-review-edit.d.ts +1 -1
  29. package/dist-client/activities/activity-data-review-edit.js +63 -33
  30. package/dist-client/activities/activity-data-review-edit.js.map +1 -1
  31. package/dist-client/activities/activity-data-review-view.d.ts +1 -1
  32. package/dist-client/activities/activity-data-review-view.js +72 -30
  33. package/dist-client/activities/activity-data-review-view.js.map +1 -1
  34. package/dist-client/activities/activity-ooc-resolve-edit.d.ts +1 -1
  35. package/dist-client/activities/activity-ooc-resolve-edit.js +44 -48
  36. package/dist-client/activities/activity-ooc-resolve-edit.js.map +1 -1
  37. package/dist-client/activities/activity-ooc-resolve-view.d.ts +13 -0
  38. package/dist-client/activities/activity-ooc-resolve-view.js +24 -34
  39. package/dist-client/activities/activity-ooc-resolve-view.js.map +1 -1
  40. package/dist-client/activities/activity-ooc-review-edit.js +39 -29
  41. package/dist-client/activities/activity-ooc-review-edit.js.map +1 -1
  42. package/dist-client/activities/activity-ooc-review-view.js +9 -19
  43. package/dist-client/activities/activity-ooc-review-view.js.map +1 -1
  44. package/dist-client/bootstrap.d.ts +4 -4
  45. package/dist-client/bootstrap.js +4 -4
  46. package/dist-client/bootstrap.js.map +1 -1
  47. package/dist-client/pages/data-entry/data-entry-list-page.js +3 -15
  48. package/dist-client/pages/data-entry/data-entry-list-page.js.map +1 -1
  49. package/dist-client/pages/data-ooc/data-ooc-list-page.d.ts +6 -0
  50. package/dist-client/pages/data-ooc/data-ooc-list-page.js +67 -24
  51. package/dist-client/pages/data-ooc/data-ooc-list-page.js.map +1 -1
  52. package/dist-client/pages/data-ooc/{data-ooc-view-page.js → data-ooc-page.js} +46 -2
  53. package/dist-client/pages/data-ooc/data-ooc-page.js.map +1 -0
  54. package/dist-client/pages/data-ooc/data-ooc-view.d.ts +11 -4
  55. package/dist-client/pages/data-ooc/data-ooc-view.js +193 -48
  56. package/dist-client/pages/data-ooc/data-ooc-view.js.map +1 -1
  57. package/dist-client/pages/data-ooc/data-oocs-page.d.ts +18 -0
  58. package/dist-client/pages/data-ooc/data-oocs-page.js +200 -0
  59. package/dist-client/pages/data-ooc/data-oocs-page.js.map +1 -0
  60. package/dist-client/pages/data-sample/data-sample-list-page.d.ts +6 -1
  61. package/dist-client/pages/data-sample/data-sample-list-page.js +51 -28
  62. package/dist-client/pages/data-sample/data-sample-list-page.js.map +1 -1
  63. package/dist-client/pages/data-sample/{data-sample-view-page.js → data-sample-page.js} +9 -2
  64. package/dist-client/pages/data-sample/data-sample-page.js.map +1 -0
  65. package/dist-client/pages/data-sample/data-sample-search-page.d.ts +6 -13
  66. package/dist-client/pages/data-sample/data-sample-search-page.js +32 -26
  67. package/dist-client/pages/data-sample/data-sample-search-page.js.map +1 -1
  68. package/dist-client/pages/data-sample/data-sample-view.d.ts +18 -0
  69. package/dist-client/pages/data-sample/data-sample-view.js +186 -19
  70. package/dist-client/pages/data-sample/data-sample-view.js.map +1 -1
  71. package/dist-client/pages/data-sample/data-samples-page.d.ts +21 -0
  72. package/dist-client/pages/data-sample/data-samples-page.js +249 -0
  73. package/dist-client/pages/data-sample/data-samples-page.js.map +1 -0
  74. package/dist-client/pages/data-sensor/data-sensor-list-page.js +28 -6
  75. package/dist-client/pages/data-sensor/data-sensor-list-page.js.map +1 -1
  76. package/dist-client/pages/data-set/data-item-list.js +2 -2
  77. package/dist-client/pages/data-set/data-item-list.js.map +1 -1
  78. package/dist-client/pages/data-summary/data-summary-list-page.js +12 -21
  79. package/dist-client/pages/data-summary/data-summary-list-page.js.map +1 -1
  80. package/dist-client/route.js +8 -2
  81. package/dist-client/route.js.map +1 -1
  82. package/dist-client/tsconfig.tsbuildinfo +1 -1
  83. package/dist-server/activities/activity-data-collect.js.map +1 -1
  84. package/dist-server/activities/activity-data-review.js.map +1 -1
  85. package/dist-server/activities/activity-ooc-review.js +3 -2
  86. package/dist-server/activities/activity-ooc-review.js.map +1 -1
  87. package/dist-server/controllers/create-data-sample.js +28 -30
  88. package/dist-server/controllers/create-data-sample.js.map +1 -1
  89. package/dist-server/controllers/issue-collect-data.js +55 -0
  90. package/dist-server/controllers/issue-collect-data.js.map +1 -0
  91. package/dist-server/engine/index.js +4 -0
  92. package/dist-server/engine/index.js.map +1 -0
  93. package/dist-server/engine/task/create-data-sample.js +81 -0
  94. package/dist-server/engine/task/create-data-sample.js.map +1 -0
  95. package/dist-server/engine/task/index.js +5 -0
  96. package/dist-server/engine/task/index.js.map +1 -0
  97. package/dist-server/engine/task/issue-collect-data.js +40 -0
  98. package/dist-server/engine/task/issue-collect-data.js.map +1 -0
  99. package/dist-server/index.js +1 -0
  100. package/dist-server/index.js.map +1 -1
  101. package/dist-server/routes.js +39 -65
  102. package/dist-server/routes.js.map +1 -1
  103. package/dist-server/service/data-ooc/data-ooc-query.js +32 -0
  104. package/dist-server/service/data-ooc/data-ooc-query.js.map +1 -1
  105. package/dist-server/service/data-ooc/data-ooc.js +44 -37
  106. package/dist-server/service/data-ooc/data-ooc.js.map +1 -1
  107. package/dist-server/service/data-sample/data-sample-query.js +24 -0
  108. package/dist-server/service/data-sample/data-sample-query.js.map +1 -1
  109. package/dist-server/service/data-sample/data-sample.js +30 -31
  110. package/dist-server/service/data-sample/data-sample.js.map +1 -1
  111. package/dist-server/service/data-sensor/data-sensor-query.js +16 -1
  112. package/dist-server/service/data-sensor/data-sensor-query.js.map +1 -1
  113. package/dist-server/service/data-sensor/data-sensor-type.js +8 -0
  114. package/dist-server/service/data-sensor/data-sensor-type.js.map +1 -1
  115. package/dist-server/service/data-sensor/data-sensor.js +15 -1
  116. package/dist-server/service/data-sensor/data-sensor.js.map +1 -1
  117. package/dist-server/service/data-set/data-item-type.js +1 -0
  118. package/dist-server/service/data-set/data-item-type.js.map +1 -1
  119. package/dist-server/service/data-set/data-set-query.js +2 -2
  120. package/dist-server/service/data-set/data-set-query.js.map +1 -1
  121. package/dist-server/service/data-summary/data-summary.js +8 -8
  122. package/dist-server/service/data-summary/data-summary.js.map +1 -1
  123. package/dist-server/tsconfig.tsbuildinfo +1 -1
  124. package/helps/dataset/task/create-data-sample.ja.md +28 -0
  125. package/helps/dataset/task/create-data-sample.ko.md +28 -0
  126. package/helps/dataset/task/create-data-sample.md +28 -0
  127. package/helps/dataset/task/create-data-sample.ms.md +30 -0
  128. package/helps/dataset/task/create-data-sample.zh.md +28 -0
  129. package/helps/dataset/task/issue-collect-data.ja.md +35 -0
  130. package/helps/dataset/task/issue-collect-data.ko.md +32 -0
  131. package/helps/dataset/task/issue-collect-data.md +32 -0
  132. package/helps/dataset/task/issue-collect-data.ms.md +34 -0
  133. package/helps/dataset/task/issue-collect-data.zh.md +32 -0
  134. package/package.json +15 -12
  135. package/server/activities/activity-data-collect.ts +3 -11
  136. package/server/activities/activity-data-review.ts +1 -5
  137. package/server/activities/activity-ooc-review.ts +6 -16
  138. package/server/controllers/create-data-sample.ts +32 -39
  139. package/server/controllers/issue-collect-data.ts +61 -0
  140. package/server/engine/index.ts +1 -0
  141. package/server/engine/task/create-data-sample.ts +93 -0
  142. package/server/engine/task/index.ts +2 -0
  143. package/server/engine/task/issue-collect-data.ts +45 -0
  144. package/server/index.ts +1 -0
  145. package/server/routes.ts +52 -77
  146. package/server/service/data-ooc/data-ooc-query.ts +17 -0
  147. package/server/service/data-ooc/data-ooc.ts +39 -51
  148. package/server/service/data-sample/data-sample-query.ts +17 -17
  149. package/server/service/data-sample/data-sample.ts +29 -52
  150. package/server/service/data-sensor/data-sensor-query.ts +13 -1
  151. package/server/service/data-sensor/data-sensor-type.ts +6 -0
  152. package/server/service/data-sensor/data-sensor.ts +13 -11
  153. package/server/service/data-set/data-item-type.ts +1 -0
  154. package/server/service/data-set/data-set-query.ts +7 -7
  155. package/server/service/data-summary/data-summary.ts +10 -23
  156. package/things-factory.config.js +10 -2
  157. package/translations/en.json +15 -2
  158. package/translations/ja.json +12 -1
  159. package/translations/ko.json +14 -1
  160. package/translations/ms.json +11 -0
  161. package/translations/zh.json +12 -1
  162. package/dist-client/pages/data-ooc/data-ooc-view-page.js.map +0 -1
  163. package/dist-client/pages/data-sample/data-sample-view-page.js.map +0 -1
  164. /package/dist-client/pages/data-ooc/{data-ooc-view-page.d.ts → data-ooc-page.d.ts} +0 -0
  165. /package/dist-client/pages/data-sample/{data-sample-view-page.d.ts → data-sample-page.d.ts} +0 -0
@@ -38,13 +38,7 @@ export class DataCollectActivityEdit extends localize(i18next)(LitElement) {
38
38
  @query('ox-data-entry-form') entryForm!: OxDataEntryForm
39
39
 
40
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
- `
41
+ return html` <ox-data-entry-form .dataSet=${this.dataSet} .value=${this.output} @change=${this._updateDataItems}></ox-data-entry-form> `
48
42
  }
49
43
 
50
44
  async _updateDataItems() {
@@ -26,6 +26,13 @@ export class DataCollectActivityView extends localize(i18next)(LitElement) {
26
26
  padding: 10px;
27
27
  overflow: auto;
28
28
  }
29
+
30
+ @media print {
31
+ :host {
32
+ display: block;
33
+ overflow: visible;
34
+ }
35
+ }
29
36
  `
30
37
  ]
31
38
 
@@ -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) {
@@ -31,46 +33,18 @@ export class DataReviewActivityEdit extends localize(i18next)(LitElement) {
31
33
  padding: var(--padding-wide);
32
34
  overflow: auto;
33
35
  }
34
-
35
- label[instruction] {
36
- display: flex;
37
- flex-direction: column;
38
-
39
- padding: var(--padding-wide);
40
- }
41
-
42
- label[instruction] div {
43
- display: flex;
44
- }
45
-
46
- mwc-icon {
47
- color: var(--status-danger-color);
48
- }
49
-
50
- textarea {
51
- border: var(--input-field-border);
52
- border-radius: var(--input-border-radius);
53
- padding: var(--input-field-padding);
54
- font: var(--input-field-font);
55
- }
56
-
57
- .button-container {
58
- display: flex;
59
- margin-left: auto;
60
- padding: var(--padding-default);
61
- }
62
36
  `
63
37
  ]
64
38
 
65
39
  @property({ type: Object }) input?: any
66
40
  @property({ type: Object }) output?: any
67
41
 
68
- @state() dataReview?: any
42
+ @state() dataSample?: any
69
43
 
70
44
  render() {
71
45
  return html`
72
46
  <div content>
73
- <ox-data-sample-view .dataSample=${this.dataReview}></ox-data-sample-view>
47
+ <ox-data-sample-view .dataSample=${this.dataSample}></ox-data-sample-view>
74
48
  </div>
75
49
  `
76
50
  }
@@ -93,7 +67,67 @@ export class DataReviewActivityEdit extends localize(i18next)(LitElement) {
93
67
  }
94
68
 
95
69
  async fetchDataAssign() {
96
- const dataSample = this.input?.dataSample
97
- this.dataReview = dataSample
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
+ }
98
132
  }
99
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) {
@@ -32,32 +34,16 @@ export class DataReviewActivityView extends localize(i18next)(LitElement) {
32
34
  overflow: auto;
33
35
  }
34
36
 
35
- label[instruction] {
36
- display: flex;
37
- flex-direction: column;
37
+ @media print {
38
+ :host {
39
+ display: block;
40
+ overflow: visible;
41
+ }
38
42
 
39
- padding: var(--padding-wide);
40
- }
41
-
42
- label[instruction] div {
43
- display: flex;
44
- }
45
-
46
- mwc-icon {
47
- color: var(--status-danger-color);
48
- }
49
-
50
- textarea {
51
- border: var(--input-field-border);
52
- border-radius: var(--input-border-radius);
53
- padding: var(--input-field-padding);
54
- font: var(--input-field-font);
55
- }
56
-
57
- .button-container {
58
- display: flex;
59
- margin-left: auto;
60
- padding: var(--padding-default);
43
+ div[content] {
44
+ display: block;
45
+ overflow: visible;
46
+ }
61
47
  }
62
48
  `
63
49
  ]
@@ -65,12 +51,12 @@ export class DataReviewActivityView extends localize(i18next)(LitElement) {
65
51
  @property({ type: Object }) input?: any
66
52
  @property({ type: Object }) output?: any
67
53
 
68
- @state() dataReview?: any
54
+ @state() dataSample?: any
69
55
 
70
56
  render() {
71
57
  return html`
72
58
  <div content>
73
- <ox-data-sample-view .dataSample=${this.dataReview}></ox-data-sample-view>
59
+ <ox-data-sample-view .dataSample=${this.dataSample}></ox-data-sample-view>
74
60
  </div>
75
61
  `
76
62
  }
@@ -93,7 +79,67 @@ export class DataReviewActivityView extends localize(i18next)(LitElement) {
93
79
  }
94
80
 
95
81
  async fetchDataAssign() {
96
- const dataSample = this.input?.dataSample
97
- this.dataReview = dataSample
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
+ }
98
144
  }
99
145
  }
@@ -1,7 +1,8 @@
1
- import '@operato/dataset/ox-data-sample-view.js'
1
+ import '@operato/dataset/ox-data-ooc-brief-view.js'
2
+ // import '@operato/dataset/ox-data-ooc-correction-part.js'
2
3
 
3
4
  import gql from 'graphql-tag'
4
- import { css, html, LitElement } from 'lit'
5
+ import { css, html, LitElement, nothing } from 'lit'
5
6
  import { customElement, property, query, state } from 'lit/decorators.js'
6
7
 
7
8
  import { client } from '@operato/graphql'
@@ -28,35 +29,12 @@ class OocResolveActivityEdit extends localize(i18next)(LitElement) {
28
29
  overflow: auto;
29
30
  }
30
31
 
31
- ox-data-sample-view {
32
+ ox-data-ooc-brief-view {
32
33
  flex: 1;
33
34
  padding: var(--padding-wide);
34
35
  overflow: auto;
35
36
  }
36
37
 
37
- div[instruction] {
38
- display: flex;
39
- flex-direction: column;
40
-
41
- padding: var(--padding-wide);
42
- }
43
-
44
- label[instruction] {
45
- display: flex;
46
- flex-direction: column;
47
-
48
- padding: var(--padding-wide);
49
- }
50
-
51
- label[instruction] h2 {
52
- display: flex;
53
-
54
- color: var(--title-text-color);
55
- text-transform: capitalize;
56
- margin: var(--title-margin);
57
- align-items: center;
58
- }
59
-
60
38
  label[action] {
61
39
  display: flex;
62
40
  flex-direction: column;
@@ -79,25 +57,21 @@ class OocResolveActivityEdit extends localize(i18next)(LitElement) {
79
57
 
80
58
  textarea {
81
59
  border: var(--input-field-border);
82
- border-radius: var(--input-border-radius);
83
- padding: var(--input-field-padding);
60
+ border-radius: 10px;
61
+ margin: var(--margin-default);
62
+ padding: var(--input-padding);
84
63
  font: var(--input-field-font);
85
64
 
86
65
  resize: none;
87
66
  outline: none;
88
67
  min-height: 200px;
89
68
  }
90
-
91
- .button-container {
92
- display: flex;
93
- margin-left: auto;
94
- padding: var(--padding-default);
95
- }
96
69
  `
97
70
  ]
98
71
 
99
72
  @property({ type: Object }) input?: any
100
73
  @property({ type: Object }) output?: any
74
+ @property({ type: Object }) activityThread?: any
101
75
 
102
76
  @state() dataOoc?: any
103
77
 
@@ -105,25 +79,24 @@ class OocResolveActivityEdit extends localize(i18next)(LitElement) {
105
79
 
106
80
  render() {
107
81
  const action = this.output?.action
82
+ const state = this.activityThread?.state
83
+ const editable = state == 'assigned' || state == 'started'
108
84
 
109
85
  return html`
110
86
  <div content>
111
- <ox-data-sample-view .dataSample=${this.dataOoc}></ox-data-sample-view>
87
+ <ox-data-ooc-brief-view .dataOoc=${this.dataOoc}></ox-data-ooc-brief-view>
112
88
  </div>
113
89
 
114
- <div instruction>
115
- <h2><mwc-icon>build_circle</mwc-icon>&nbsp;<span>${i18next.t('label.corrective instruction')}</span></h2>
116
- <div content>${this.input?.instruction}</div>
117
- </div>
90
+ <!-- <ox-data-ooc-correction-part .dataOoc=${this.dataOoc}></ox-data-ooc-correction-part> -->
118
91
 
119
- <label action>
120
- <h2><mwc-icon>build_circle</mwc-icon>&nbsp;<span>${i18next.t('label.corrective action')}</span></h2>
121
- <textarea
122
- placeholder=${String(i18next.t('text.corrective action placeholder'))}
123
- .value=${action || ''}
124
- @change=${this.onChangeAction}
125
- ></textarea>
126
- </label>
92
+ ${editable
93
+ ? html`
94
+ <label action>
95
+ <h2><mwc-icon>build_circle</mwc-icon>&nbsp;<span>${i18next.t('label.corrective action')}</span></h2>
96
+ <textarea placeholder=${String(i18next.t('text.corrective action placeholder'))} .value=${action || ''} @change=${this.onChangeAction}></textarea>
97
+ </label>
98
+ `
99
+ : nothing}
127
100
  `
128
101
  }
129
102
 
@@ -162,6 +135,9 @@ class OocResolveActivityEdit extends localize(i18next)(LitElement) {
162
135
  useCase
163
136
  data
164
137
  judgment
138
+ history
139
+ correctiveAction
140
+ correctiveInstruction
165
141
  dataItems {
166
142
  name
167
143
  description
@@ -178,7 +154,17 @@ class OocResolveActivityEdit extends localize(i18next)(LitElement) {
178
154
  }
179
155
  workDate
180
156
  workShift
157
+ reviewer {
158
+ id
159
+ name
160
+ }
161
+ corrector {
162
+ id
163
+ name
164
+ }
181
165
  collectedAt
166
+ reviewedAt
167
+ correctedAt
182
168
  }
183
169
  }
184
170
  `,
@@ -187,7 +173,17 @@ class OocResolveActivityEdit extends localize(i18next)(LitElement) {
187
173
  }
188
174
  })
189
175
 
190
- this.dataOoc = response.data.dataOoc
176
+ const dataOoc = {
177
+ ...response.data.dataOoc
178
+ }
179
+
180
+ if (this.activityThread?.output) {
181
+ dataOoc.correctiveAction = this.activityThread.output.action
182
+ dataOoc.correctedAt = this.activityThread.updatedAt
183
+ dataOoc.corrector = this.activityThread.assignee
184
+ }
185
+
186
+ this.dataOoc = dataOoc
191
187
  }
192
188
  }
193
189
  }
@@ -9,7 +9,7 @@ import { i18next, localize } from '@operato/i18n'
9
9
  import { ScrollbarStyles } from '@operato/styles'
10
10
 
11
11
  @customElement('activity-ooc-resolve-view')
12
- class OocResolveActivityView extends localize(i18next)(LitElement) {
12
+ export class OocResolveActivityView extends localize(i18next)(LitElement) {
13
13
  static styles = [
14
14
  ScrollbarStyles,
15
15
  css`
@@ -34,46 +34,23 @@ class OocResolveActivityView extends localize(i18next)(LitElement) {
34
34
  overflow: auto;
35
35
  }
36
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
- div[action] {
54
- display: flex;
55
- flex-direction: column;
56
-
57
- padding: var(--padding-wide);
58
- }
59
-
60
- div[action] div {
61
- display: flex;
62
- }
63
-
64
- div[action] div[content] {
65
- display: flex;
66
- min-height: 50px;
67
- }
37
+ @media print {
38
+ :host {
39
+ display: block;
40
+ overflow: visible;
41
+ }
68
42
 
69
- mwc-icon {
70
- color: var(--status-danger-color);
43
+ div[content] {
44
+ display: block;
45
+ overflow: visible;
46
+ }
71
47
  }
72
48
  `
73
49
  ]
74
50
 
75
51
  @property({ type: Object }) input?: any
76
52
  @property({ type: Object }) output?: any
53
+ @property({ type: Object }) activityApproval?: any
77
54
 
78
55
  @state() dataOoc?: any
79
56
 
@@ -147,7 +124,20 @@ class OocResolveActivityView extends localize(i18next)(LitElement) {
147
124
  }
148
125
  })
149
126
 
150
- this.dataOoc = response.data.dataOoc
127
+ const dataOoc = {
128
+ ...response.data.dataOoc
129
+ }
130
+
131
+ const activityThread = this.activityApproval?.activityThread
132
+
133
+ if (activityThread?.output) {
134
+ /* approval 에서 사용되는 경우 corrective 관련정보를 보완한다. - approval과정에서는 아직 dataOoc.correctiveAction 정보는 채워지지 않았기 때문. */
135
+ dataOoc.correctiveAction = activityThread.output.action
136
+ dataOoc.correctedAt = activityThread.updatedAt
137
+ dataOoc.corrector = activityThread.assignee
138
+ }
139
+
140
+ this.dataOoc = dataOoc
151
141
  }
152
142
  }
153
143
  }
@@ -39,47 +39,50 @@ class OocReviewActivityEdit extends localize(i18next)(LitElement) {
39
39
  flex-direction: column;
40
40
 
41
41
  padding: var(--padding-wide);
42
- }
43
42
 
44
- label[instruction] h2 {
45
- display: flex;
43
+ h2 {
44
+ display: flex;
46
45
 
47
- color: var(--title-text-color);
48
- text-transform: capitalize;
49
- margin: var(--title-margin);
50
- align-items: center;
51
- }
46
+ color: var(--title-text-color);
47
+ text-transform: capitalize;
48
+ margin: var(--title-margin);
49
+ align-items: center;
50
+ }
52
51
 
53
- mwc-icon {
54
- color: var(--status-danger-color);
55
- }
52
+ div {
53
+ padding: var(--padding-wide);
54
+ font: var(--input-field-font);
55
+ }
56
56
 
57
- textarea {
58
- border: var(--input-field-border);
59
- border-radius: var(--input-border-radius);
60
- padding: var(--input-field-padding);
61
- font: var(--input-field-font);
57
+ mwc-icon {
58
+ color: var(--status-danger-color);
59
+ }
62
60
 
63
- resize: none;
64
- outline: none;
65
- min-height: 200px;
66
- }
61
+ textarea {
62
+ border: var(--input-field-border);
63
+ border-radius: 10px;
64
+ margin: var(--margin-default);
65
+ padding: var(--input-padding);
66
+ font: var(--input-field-font);
67
67
 
68
- .button-container {
69
- display: flex;
70
- margin-left: auto;
71
- padding: var(--padding-default);
68
+ resize: none;
69
+ outline: none;
70
+ min-height: 200px;
71
+ }
72
72
  }
73
73
  `
74
74
  ]
75
75
 
76
76
  @property({ type: Object }) input?: any
77
77
  @property({ type: Object }) output?: any
78
+ @property({ type: Object }) activityThread?: any
78
79
 
79
80
  @state() dataOoc?: any
80
81
 
81
82
  render() {
82
83
  const instruction = this.output?.instruction
84
+ const { state } = this.activityThread || {}
85
+ const editable = state == 'assigned' || state == 'started' || state == 'submitted'
83
86
 
84
87
  return html`
85
88
  <div content>
@@ -88,11 +91,15 @@ class OocReviewActivityEdit extends localize(i18next)(LitElement) {
88
91
 
89
92
  <label instruction>
90
93
  <h2><mwc-icon>build_circle</mwc-icon>&nbsp;<span>${i18next.t('label.corrective instruction')}</span></h2>
91
- <textarea
92
- placeholder=${String(i18next.t('text.corrective instruction placeholder'))}
93
- .value=${instruction || ''}
94
- @change=${this.onChangeInstruction}
95
- ></textarea>
94
+ ${editable
95
+ ? html`
96
+ <textarea
97
+ placeholder=${String(i18next.t('text.corrective instruction placeholder'))}
98
+ .value=${instruction || ''}
99
+ @change=${this.onChangeInstruction}
100
+ ></textarea>
101
+ `
102
+ : html`<div>${instruction}</div>`}
96
103
  </label>
97
104
  `
98
105
  }
@@ -34,24 +34,16 @@ class OocReviewActivityView extends localize(i18next)(LitElement) {
34
34
  overflow: auto;
35
35
  }
36
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
- }
37
+ @media print {
38
+ :host {
39
+ display: block;
40
+ overflow: visible;
41
+ }
52
42
 
53
- mwc-icon {
54
- color: var(--status-danger-color);
43
+ div[content] {
44
+ display: block;
45
+ overflow: visible;
46
+ }
55
47
  }
56
48
  `
57
49
  ]
@@ -62,8 +54,6 @@ class OocReviewActivityView extends localize(i18next)(LitElement) {
62
54
  @state() dataOoc?: any
63
55
 
64
56
  render() {
65
- const instruction = this.output?.instruction
66
-
67
57
  return html`
68
58
  <div content>
69
59
  <ox-data-ooc-brief-view .dataOoc=${this.dataOoc}></ox-data-ooc-brief-view>