@things-factory/dataset 7.0.0-alpha.4 → 7.0.0-alpha.6

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 (85) hide show
  1. package/client/activities/activity-data-collect-edit.ts +1 -7
  2. package/client/activities/activity-data-review-edit.ts +0 -28
  3. package/client/activities/activity-data-review-view.ts +0 -28
  4. package/client/activities/activity-ooc-resolve-edit.ts +44 -48
  5. package/client/activities/activity-ooc-resolve-view.ts +16 -38
  6. package/client/activities/activity-ooc-review-edit.ts +36 -29
  7. package/client/activities/activity-ooc-review-view.ts +0 -22
  8. package/client/bootstrap.ts +5 -9
  9. package/client/pages/data-entry/data-entry-list-page.ts +8 -23
  10. package/client/pages/data-ooc/data-ooc-list-page.ts +26 -11
  11. package/client/pages/data-ooc/{data-ooc-view-page.ts → data-ooc-page.ts} +1 -1
  12. package/client/pages/data-ooc/data-ooc-view.ts +53 -35
  13. package/client/pages/data-ooc/data-oocs-page.ts +132 -0
  14. package/client/pages/data-sample/data-sample-list-page.ts +25 -20
  15. package/client/pages/data-sample/{data-sample-view-page.ts → data-sample-page.ts} +1 -1
  16. package/client/pages/data-sample/data-sample-search-page.ts +25 -20
  17. package/client/pages/data-sample/data-sample-view.ts +60 -12
  18. package/client/pages/data-sample/data-samples-page.ts +121 -0
  19. package/client/route.ts +10 -2
  20. package/dist-client/activities/activity-data-collect-edit.js +1 -7
  21. package/dist-client/activities/activity-data-collect-edit.js.map +1 -1
  22. package/dist-client/activities/activity-data-review-edit.js +0 -28
  23. package/dist-client/activities/activity-data-review-edit.js.map +1 -1
  24. package/dist-client/activities/activity-data-review-view.js +0 -28
  25. package/dist-client/activities/activity-data-review-view.js.map +1 -1
  26. package/dist-client/activities/activity-ooc-resolve-edit.d.ts +1 -1
  27. package/dist-client/activities/activity-ooc-resolve-edit.js +44 -48
  28. package/dist-client/activities/activity-ooc-resolve-edit.js.map +1 -1
  29. package/dist-client/activities/activity-ooc-resolve-view.d.ts +13 -0
  30. package/dist-client/activities/activity-ooc-resolve-view.js +15 -37
  31. package/dist-client/activities/activity-ooc-resolve-view.js.map +1 -1
  32. package/dist-client/activities/activity-ooc-review-edit.js +39 -29
  33. package/dist-client/activities/activity-ooc-review-edit.js.map +1 -1
  34. package/dist-client/activities/activity-ooc-review-view.js +0 -22
  35. package/dist-client/activities/activity-ooc-review-view.js.map +1 -1
  36. package/dist-client/bootstrap.d.ts +4 -4
  37. package/dist-client/bootstrap.js +4 -4
  38. package/dist-client/bootstrap.js.map +1 -1
  39. package/dist-client/pages/data-entry/data-entry-list-page.js +3 -15
  40. package/dist-client/pages/data-entry/data-entry-list-page.js.map +1 -1
  41. package/dist-client/pages/data-ooc/data-ooc-list-page.d.ts +6 -0
  42. package/dist-client/pages/data-ooc/data-ooc-list-page.js +17 -3
  43. package/dist-client/pages/data-ooc/data-ooc-list-page.js.map +1 -1
  44. package/dist-client/pages/data-ooc/{data-ooc-view-page.js → data-ooc-page.js} +2 -2
  45. package/dist-client/pages/data-ooc/data-ooc-page.js.map +1 -0
  46. package/dist-client/pages/data-ooc/data-ooc-view.d.ts +5 -1
  47. package/dist-client/pages/data-ooc/data-ooc-view.js +50 -38
  48. package/dist-client/pages/data-ooc/data-ooc-view.js.map +1 -1
  49. package/dist-client/pages/data-ooc/data-oocs-page.d.ts +17 -0
  50. package/dist-client/pages/data-ooc/data-oocs-page.js +132 -0
  51. package/dist-client/pages/data-ooc/data-oocs-page.js.map +1 -0
  52. package/dist-client/pages/data-sample/data-sample-list-page.d.ts +6 -1
  53. package/dist-client/pages/data-sample/data-sample-list-page.js +19 -13
  54. package/dist-client/pages/data-sample/data-sample-list-page.js.map +1 -1
  55. package/dist-client/pages/data-sample/{data-sample-view-page.js → data-sample-page.js} +2 -2
  56. package/dist-client/pages/data-sample/data-sample-page.js.map +1 -0
  57. package/dist-client/pages/data-sample/data-sample-search-page.d.ts +6 -1
  58. package/dist-client/pages/data-sample/data-sample-search-page.js +19 -13
  59. package/dist-client/pages/data-sample/data-sample-search-page.js.map +1 -1
  60. package/dist-client/pages/data-sample/data-sample-view.js +55 -11
  61. package/dist-client/pages/data-sample/data-sample-view.js.map +1 -1
  62. package/dist-client/pages/data-sample/data-samples-page.d.ts +19 -0
  63. package/dist-client/pages/data-sample/data-samples-page.js +120 -0
  64. package/dist-client/pages/data-sample/data-samples-page.js.map +1 -0
  65. package/dist-client/route.js +8 -2
  66. package/dist-client/route.js.map +1 -1
  67. package/dist-client/tsconfig.tsbuildinfo +1 -1
  68. package/dist-server/service/data-ooc/data-ooc.js +33 -15
  69. package/dist-server/service/data-ooc/data-ooc.js.map +1 -1
  70. package/dist-server/service/data-sample/data-sample.js +15 -12
  71. package/dist-server/service/data-sample/data-sample.js.map +1 -1
  72. package/dist-server/tsconfig.tsbuildinfo +1 -1
  73. package/package.json +14 -11
  74. package/server/service/data-ooc/data-ooc.ts +27 -28
  75. package/server/service/data-sample/data-sample.ts +14 -32
  76. package/things-factory.config.js +10 -2
  77. package/translations/en.json +1 -0
  78. package/translations/ja.json +1 -0
  79. package/translations/ko.json +1 -0
  80. package/translations/ms.json +1 -0
  81. package/translations/zh.json +1 -0
  82. package/dist-client/pages/data-ooc/data-ooc-view-page.js.map +0 -1
  83. package/dist-client/pages/data-sample/data-sample-view-page.js.map +0 -1
  84. /package/dist-client/pages/data-ooc/{data-ooc-view-page.d.ts → data-ooc-page.d.ts} +0 -0
  85. /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() {
@@ -31,34 +31,6 @@ export class DataReviewActivityEdit extends localize(i18next)(LitElement) {
31
31
  padding: var(--padding-wide);
32
32
  overflow: auto;
33
33
  }
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
34
  `
63
35
  ]
64
36
 
@@ -31,34 +31,6 @@ export class DataReviewActivityView extends localize(i18next)(LitElement) {
31
31
  padding: var(--padding-wide);
32
32
  overflow: auto;
33
33
  }
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
34
  `
63
35
  ]
64
36
 
@@ -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`
@@ -33,47 +33,12 @@ class OocResolveActivityView extends localize(i18next)(LitElement) {
33
33
  padding: var(--padding-wide);
34
34
  overflow: auto;
35
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
- 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
- }
68
-
69
- mwc-icon {
70
- color: var(--status-danger-color);
71
- }
72
36
  `
73
37
  ]
74
38
 
75
39
  @property({ type: Object }) input?: any
76
40
  @property({ type: Object }) output?: any
41
+ @property({ type: Object }) activityApproval?: any
77
42
 
78
43
  @state() dataOoc?: any
79
44
 
@@ -147,7 +112,20 @@ class OocResolveActivityView extends localize(i18next)(LitElement) {
147
112
  }
148
113
  })
149
114
 
150
- this.dataOoc = response.data.dataOoc
115
+ const dataOoc = {
116
+ ...response.data.dataOoc
117
+ }
118
+
119
+ const activityThread = this.activityApproval?.activityThread
120
+
121
+ if (activityThread?.output) {
122
+ /* approval 에서 사용되는 경우 corrective 관련정보를 보완한다. - approval과정에서는 아직 dataOoc.correctiveAction 정보는 채워지지 않았기 때문. */
123
+ dataOoc.correctiveAction = activityThread.output.action
124
+ dataOoc.correctedAt = activityThread.updatedAt
125
+ dataOoc.corrector = activityThread.assignee
126
+ }
127
+
128
+ this.dataOoc = dataOoc
151
129
  }
152
130
  }
153
131
  }
@@ -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
  }
@@ -33,26 +33,6 @@ class OocReviewActivityView extends localize(i18next)(LitElement) {
33
33
  padding: var(--padding-wide);
34
34
  overflow: auto;
35
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
- mwc-icon {
54
- color: var(--status-danger-color);
55
- }
56
36
  `
57
37
  ]
58
38
 
@@ -62,8 +42,6 @@ class OocReviewActivityView extends localize(i18next)(LitElement) {
62
42
  @state() dataOoc?: any
63
43
 
64
44
  render() {
65
- const instruction = this.output?.instruction
66
-
67
45
  return html`
68
46
  <div content>
69
47
  <ox-data-ooc-brief-view .dataOoc=${this.dataOoc}></ox-data-ooc-brief-view>
@@ -1,19 +1,15 @@
1
1
  import './activities/activity-data-collect-edit' /* refered by the activity template (activity-data-collect) on server */
2
- import './activities/activity-ooc-review-edit' /* refered by the activity template (activity-ooc-review) on server */
3
- import './activities/activity-ooc-resolve-edit' /* refered by the activity template (activity-ooc-resolve) on server */
4
2
  import './activities/activity-data-collect-view' /* refered by the activity template (activity-data-collect) on server */
5
- import './activities/activity-ooc-review-view' /* refered by the activity template (activity-ooc-review) on server */
6
- import './activities/activity-ooc-resolve-view' /* refered by the activity template (activity-ooc-resolve) on server */
7
3
  import './activities/activity-data-review-edit' /* refered by the activity template (activity-data-review) on server */
8
4
  import './activities/activity-data-review-view' /* refered by the activity template (activity-data-review) on server */
5
+ import './activities/activity-ooc-review-edit' /* refered by the activity template (activity-ooc-review) on server */
6
+ import './activities/activity-ooc-review-view' /* refered by the activity template (activity-ooc-review) on server */
7
+ import './activities/activity-ooc-resolve-edit' /* refered by the activity template (activity-ooc-resolve) on server */
8
+ import './activities/activity-ooc-resolve-view' /* refered by the activity template (activity-ooc-resolve) on server */
9
9
  import '@operato/app/filter-renderer.js' /* register resource-object filter renderer */
10
10
 
11
11
  import { OxGristEditorCode } from '@operato/app/grist-editor/ox-grist-editor-code.js'
12
- import {
13
- OxGristRendererJson5,
14
- registerEditor as registerGristEditor,
15
- registerRenderer as registerGristRenderer
16
- } from '@operato/data-grist'
12
+ import { OxGristRendererJson5, registerEditor as registerGristEditor, registerRenderer as registerGristRenderer } from '@operato/data-grist'
17
13
  import { OxGristEditorDataItemSpec } from '@operato/dataset/grist-editor/ox-grist-editor-data-item-spec.js'
18
14
  import { OxGristEditorPartitionKeys } from '@operato/grist-editor/ox-grist-editor-partition-keys.js'
19
15
  import { OxGristRendererPartitionKeys } from '@operato/grist-editor/ox-grist-renderer-partition-keys.js'
@@ -46,23 +46,12 @@ const showEntryView = async (columns, data, column, record, rowIndex) => {
46
46
  const board = {
47
47
  id: entryView
48
48
  }
49
- openPopup(
50
- html`
51
- <ox-board-viewer
52
- style="background-color: white;"
53
- .board=${board}
54
- .provider=${provider}
55
- hide-fullscreen
56
- hide-navigation
57
- ></ox-board-viewer>
58
- `,
59
- {
60
- closable: true,
61
- backdrop: true,
62
- size: 'large',
63
- title
64
- }
65
- )
49
+ openPopup(html` <ox-board-viewer style="background-color: white;" .board=${board} .provider=${provider} hide-fullscreen hide-navigation></ox-board-viewer> `, {
50
+ closable: true,
51
+ backdrop: true,
52
+ size: 'large',
53
+ title
54
+ })
66
55
 
67
56
  // navigate(`board-viewer/${entryView}?interactive=true&title=${title}`)
68
57
  break
@@ -129,12 +118,7 @@ export class DataEntryListPage extends connect(store)(localize(i18next)(PageView
129
118
  const mode = 'CARD'
130
119
 
131
120
  return html`
132
- <ox-grist
133
- .mode=${mode}
134
- .config=${this.gristConfig}
135
- .fetchHandler=${this.fetchHandler.bind(this)}
136
- ?url-params-sensitive=${this.active}
137
- >
121
+ <ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)} ?url-params-sensitive=${this.active}>
138
122
  <div slot="headroom" class="header">
139
123
  <div class="title">
140
124
  <mwc-icon>summarize</mwc-icon>
@@ -300,6 +284,7 @@ export class DataEntryListPage extends connect(store)(localize(i18next)(PageView
300
284
  ],
301
285
  rows: {
302
286
  appendable: false,
287
+ editable: false,
303
288
  selectable: {
304
289
  multiple: false
305
290
  },
@@ -1,6 +1,7 @@
1
1
  import '@operato/data-grist'
2
2
  import '@operato/context/ox-context-page-toolbar.js'
3
3
  import '@operato/input/ox-input-select-buttons.js'
4
+
4
5
  import './data-ooc-view.js'
5
6
 
6
7
  import gql from 'graphql-tag'
@@ -8,6 +9,8 @@ import { css, html } from 'lit'
8
9
  import { customElement, property, query, state } from 'lit/decorators.js'
9
10
  import { connect } from 'pwa-helpers/connect-mixin'
10
11
 
12
+ import { GhostPrint } from '@operato/ghost-print'
13
+
11
14
  function getOocStatus() {
12
15
  return [
13
16
  {
@@ -74,6 +77,13 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
74
77
  }
75
78
  },
76
79
  help: 'dataset/data-ooc',
80
+ actions: [
81
+ {
82
+ title: i18next.t('button.print'),
83
+ action: this.printOocs.bind(this),
84
+ icon: 'print'
85
+ }
86
+ ],
77
87
  exportable: {
78
88
  name: i18next.t('title.data-ooc list'),
79
89
  data: this._exportableData.bind(this)
@@ -126,14 +136,11 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
126
136
  title: i18next.t('title.view detail ooc data'),
127
137
  handlers: {
128
138
  click: (columns, data, column, record, rowIndex) => {
129
- const popup = openPopup(
130
- html` <data-ooc-view .dataOoc=${record} style="background-color: white;"></data-ooc-view> `,
131
- {
132
- backdrop: true,
133
- size: 'large',
134
- title: i18next.t('title.data-ooc view')
135
- }
136
- )
139
+ const popup = openPopup(html` <data-ooc-view .dataOoc=${record} style="background-color: white;"></data-ooc-view> `, {
140
+ backdrop: true,
141
+ size: 'large',
142
+ title: i18next.t('title.data-ooc view')
143
+ })
137
144
  popup.onclosed = () => {
138
145
  this.grist.fetch()
139
146
  }
@@ -479,9 +486,7 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
479
486
  .filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)
480
487
  .reduce((record, column) => {
481
488
  const key = column.imex === true ? column.name : column.imex.key
482
- record[key] = key
483
- .split('.')
484
- .reduce((obj, key) => (obj && obj[key] !== 'undefined' ? obj[key] : undefined), item)
489
+ record[key] = key.split('.').reduce((obj, key) => (obj && obj[key] !== 'undefined' ? obj[key] : undefined), item)
485
490
  return record
486
491
  }, {})
487
492
  }
@@ -489,4 +494,14 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
489
494
 
490
495
  return { header: headerSetting, data: data }
491
496
  }
497
+
498
+ printOocs() {
499
+ const selected = this.grist.selected
500
+ const ids = selected.map(record => record.id).join('|')
501
+
502
+ GhostPrint.print({
503
+ src: `./data-oocs?ids=${ids}`
504
+ // pending: 200 * selected.length
505
+ })
506
+ }
492
507
  }
@@ -8,7 +8,7 @@ import { client } from '@operato/graphql'
8
8
 
9
9
  import './data-ooc-view.js'
10
10
 
11
- @customElement('data-ooc-view-page')
11
+ @customElement('data-ooc-page')
12
12
  export class DataOocViewPage extends localize(i18next)(PageView) {
13
13
  static styles = [
14
14
  css`