@things-factory/dataset 8.0.0-beta.1 → 8.0.0-beta.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. package/package.json +13 -13
  2. package/client/activities/activity-data-collect-edit.ts +0 -105
  3. package/client/activities/activity-data-collect-view.ts +0 -91
  4. package/client/activities/activity-data-review-edit.ts +0 -133
  5. package/client/activities/activity-data-review-view.ts +0 -145
  6. package/client/activities/activity-ooc-resolve-edit.ts +0 -195
  7. package/client/activities/activity-ooc-resolve-view.ts +0 -143
  8. package/client/activities/activity-ooc-review-edit.ts +0 -173
  9. package/client/activities/activity-ooc-review-view.ts +0 -129
  10. package/client/bootstrap.ts +0 -35
  11. package/client/components/data-entry-form.ts +0 -109
  12. package/client/index.ts +0 -1
  13. package/client/pages/data-archive/data-archive-list-page.ts +0 -277
  14. package/client/pages/data-archive/data-archive-request-popup.ts +0 -177
  15. package/client/pages/data-entry/data-entry-list-page.ts +0 -464
  16. package/client/pages/data-key-set/data-key-item-list.ts +0 -183
  17. package/client/pages/data-key-set/data-key-set-importer.ts +0 -89
  18. package/client/pages/data-key-set/data-key-set-list-page.ts +0 -413
  19. package/client/pages/data-ooc/data-ooc-list-page.ts +0 -549
  20. package/client/pages/data-ooc/data-ooc-page.ts +0 -164
  21. package/client/pages/data-ooc/data-ooc-view.ts +0 -236
  22. package/client/pages/data-ooc/data-oocs-page.ts +0 -200
  23. package/client/pages/data-report/data-report-embed-page.ts +0 -108
  24. package/client/pages/data-report/data-report-list-page.ts +0 -454
  25. package/client/pages/data-report/data-report-samples-page.ts +0 -174
  26. package/client/pages/data-report/jasper-report-oocs-page.ts +0 -110
  27. package/client/pages/data-report/jasper-report-samples-crosstab-page.ts +0 -110
  28. package/client/pages/data-report/jasper-report-samples-page.ts +0 -110
  29. package/client/pages/data-sample/data-sample-list-page.ts +0 -442
  30. package/client/pages/data-sample/data-sample-page.ts +0 -55
  31. package/client/pages/data-sample/data-sample-search-page.ts +0 -424
  32. package/client/pages/data-sample/data-sample-view.ts +0 -292
  33. package/client/pages/data-sample/data-samples-page.ts +0 -249
  34. package/client/pages/data-sensor/data-sensor-list-page.ts +0 -456
  35. package/client/pages/data-set/data-item-list.ts +0 -304
  36. package/client/pages/data-set/data-set-importer.ts +0 -89
  37. package/client/pages/data-set/data-set-list-page.ts +0 -1078
  38. package/client/pages/data-summary/data-summary-list-page.ts +0 -363
  39. package/client/pages/data-summary/data-summary-period-page.ts +0 -439
  40. package/client/pages/data-summary/data-summary-search-page.ts +0 -426
  41. package/client/pages/data-summary/data-summary-view.ts +0 -133
  42. package/client/route.ts +0 -91
  43. package/client/tsconfig.json +0 -13
  44. package/server/activities/activity-data-collect.ts +0 -100
  45. package/server/activities/activity-data-review.ts +0 -82
  46. package/server/activities/activity-ooc-resolve.ts +0 -123
  47. package/server/activities/activity-ooc-review.ts +0 -144
  48. package/server/activities/index.ts +0 -11
  49. package/server/controllers/create-data-sample.ts +0 -426
  50. package/server/controllers/data-use-case.ts +0 -98
  51. package/server/controllers/finalize-data-collection.ts +0 -388
  52. package/server/controllers/index.ts +0 -3
  53. package/server/controllers/issue-data-collection-task.ts +0 -70
  54. package/server/controllers/jasper-report.ts +0 -186
  55. package/server/controllers/query-data-summary-by-period.ts +0 -178
  56. package/server/controllers/shiny-report.ts +0 -54
  57. package/server/engine/index.ts +0 -1
  58. package/server/engine/task/create-data-sample.ts +0 -100
  59. package/server/engine/task/index.ts +0 -2
  60. package/server/engine/task/issue-collect-data.ts +0 -45
  61. package/server/index.ts +0 -8
  62. package/server/routes.ts +0 -188
  63. package/server/service/data-archive/data-archive-mutation.ts +0 -273
  64. package/server/service/data-archive/data-archive-query.ts +0 -58
  65. package/server/service/data-archive/data-archive-type.ts +0 -48
  66. package/server/service/data-archive/data-archive.ts +0 -69
  67. package/server/service/data-archive/index.ts +0 -6
  68. package/server/service/data-key-set/data-key-item-type.ts +0 -31
  69. package/server/service/data-key-set/data-key-set-mutation.ts +0 -201
  70. package/server/service/data-key-set/data-key-set-query.ts +0 -68
  71. package/server/service/data-key-set/data-key-set-type.ts +0 -70
  72. package/server/service/data-key-set/data-key-set.ts +0 -86
  73. package/server/service/data-key-set/index.ts +0 -6
  74. package/server/service/data-ooc/data-ooc-mutation.ts +0 -154
  75. package/server/service/data-ooc/data-ooc-query.ts +0 -106
  76. package/server/service/data-ooc/data-ooc-subscription.ts +0 -48
  77. package/server/service/data-ooc/data-ooc-type.ts +0 -71
  78. package/server/service/data-ooc/data-ooc.ts +0 -259
  79. package/server/service/data-ooc/index.ts +0 -7
  80. package/server/service/data-sample/data-sample-mutation.ts +0 -18
  81. package/server/service/data-sample/data-sample-query.ts +0 -215
  82. package/server/service/data-sample/data-sample-type.ts +0 -47
  83. package/server/service/data-sample/data-sample.ts +0 -193
  84. package/server/service/data-sample/index.ts +0 -6
  85. package/server/service/data-sensor/data-sensor-mutation.ts +0 -116
  86. package/server/service/data-sensor/data-sensor-query.ts +0 -76
  87. package/server/service/data-sensor/data-sensor-type.ts +0 -104
  88. package/server/service/data-sensor/data-sensor.ts +0 -126
  89. package/server/service/data-sensor/index.ts +0 -6
  90. package/server/service/data-set/data-item-type.ts +0 -155
  91. package/server/service/data-set/data-set-mutation.ts +0 -552
  92. package/server/service/data-set/data-set-query.ts +0 -461
  93. package/server/service/data-set/data-set-type.ts +0 -204
  94. package/server/service/data-set/data-set.ts +0 -326
  95. package/server/service/data-set/index.ts +0 -6
  96. package/server/service/data-set-history/data-set-history-query.ts +0 -126
  97. package/server/service/data-set-history/data-set-history-type.ts +0 -12
  98. package/server/service/data-set-history/data-set-history.ts +0 -217
  99. package/server/service/data-set-history/event-subscriber.ts +0 -17
  100. package/server/service/data-set-history/index.ts +0 -7
  101. package/server/service/data-spec/data-spec-manager.ts +0 -21
  102. package/server/service/data-spec/data-spec-query.ts +0 -21
  103. package/server/service/data-spec/data-spec.ts +0 -45
  104. package/server/service/data-spec/index.ts +0 -5
  105. package/server/service/data-summary/data-summary-mutation.ts +0 -45
  106. package/server/service/data-summary/data-summary-query.ts +0 -179
  107. package/server/service/data-summary/data-summary-type.ts +0 -86
  108. package/server/service/data-summary/data-summary.ts +0 -170
  109. package/server/service/data-summary/index.ts +0 -7
  110. package/server/service/index.ts +0 -57
  111. package/server/tsconfig.json +0 -10
  112. package/server/utils/config-resolver.ts +0 -29
  113. package/server/utils/index.ts +0 -1
@@ -1,143 +0,0 @@
1
- import '@operato/dataset/ox-data-ooc-brief-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('activity-ooc-resolve-view')
12
- export 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: 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-ooc-brief-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
- @property({ type: Object }) activityApproval?: any
54
-
55
- @state() dataOoc?: any
56
-
57
- render() {
58
- return html`
59
- <div content>
60
- <ox-data-ooc-brief-view .dataOoc=${this.dataOoc}></ox-data-ooc-brief-view>
61
- </div>
62
- `
63
- }
64
-
65
- updated(changes) {
66
- if (changes.has('input')) {
67
- this.fetchDataOoc()
68
- }
69
- }
70
-
71
- async fetchDataOoc() {
72
- const id = this.input.dataOocId
73
-
74
- if (id) {
75
- const response = await client.query({
76
- query: gql`
77
- query ($id: String!) {
78
- dataOoc(id: $id) {
79
- id
80
- name
81
- description
82
- ooc
83
- oos
84
- state
85
- type
86
- useCase
87
- data
88
- judgment
89
- history
90
- correctiveAction
91
- correctiveInstruction
92
- dataItems {
93
- name
94
- description
95
- active
96
- hidden
97
- tag
98
- group
99
- type
100
- unit
101
- options
102
- quota
103
- spec
104
- stat
105
- }
106
- workDate
107
- workShift
108
- reviewer {
109
- id
110
- name
111
- }
112
- corrector {
113
- id
114
- name
115
- }
116
- collectedAt
117
- reviewedAt
118
- correctedAt
119
- }
120
- }
121
- `,
122
- variables: {
123
- id
124
- }
125
- })
126
-
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
141
- }
142
- }
143
- }
@@ -1,173 +0,0 @@
1
- import '@material/web/icon/icon.js'
2
- import '@operato/dataset/ox-data-sample-view.js'
3
-
4
- import gql from 'graphql-tag'
5
- import { css, html, LitElement } 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-review-edit')
13
- class OocReviewActivityEdit 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-sample-view {
33
- flex: 1;
34
- padding: var(--spacing-large);
35
- overflow: auto;
36
- }
37
-
38
- label[instruction] {
39
- display: flex;
40
- flex-direction: column;
41
-
42
- padding: var(--spacing-large);
43
-
44
- h2 {
45
- display: flex;
46
-
47
- color: var(--title-text-color);
48
- text-transform: capitalize;
49
- margin: var(--title-margin);
50
- align-items: center;
51
- }
52
-
53
- div {
54
- padding: var(--spacing-large);
55
- font: var(--input-field-font);
56
- }
57
-
58
- md-icon {
59
- color: var(--status-danger-color);
60
- }
61
-
62
- textarea {
63
- border: var(--input-field-border);
64
- border-radius: var(--spacing-small);
65
- margin: var(--spacing-medium);
66
- padding: var(--spacing-medium);
67
- font: var(--input-field-font);
68
- color: var(--md-sys-color-on-surface);
69
- background: var(--md-sys-color-surface-variant);
70
-
71
- resize: none;
72
- outline: none;
73
- min-height: 200px;
74
- }
75
- }
76
- `
77
- ]
78
-
79
- @property({ type: Object }) input?: any
80
- @property({ type: Object }) output?: any
81
- @property({ type: Object }) activityThread?: any
82
-
83
- @state() dataOoc?: any
84
-
85
- render() {
86
- const instruction = this.output?.instruction
87
- const { state } = this.activityThread || {}
88
- const editable = state == 'unassigned' || state == 'assigned' || state == 'started' || state == 'submitted'
89
-
90
- return html`
91
- <div content>
92
- <ox-data-sample-view .dataSample=${this.dataOoc}></ox-data-sample-view>
93
- </div>
94
-
95
- <label instruction>
96
- <h2><md-icon>build_circle</md-icon>&nbsp;<span>${i18next.t('label.corrective instruction')}</span></h2>
97
- ${editable
98
- ? html`
99
- <textarea
100
- placeholder=${String(i18next.t('text.corrective instruction placeholder'))}
101
- .value=${instruction || ''}
102
- @change=${this.onChangeInstruction}
103
- ></textarea>
104
- `
105
- : html`<div>${instruction}</div>`}
106
- </label>
107
- `
108
- }
109
-
110
- onChangeInstruction(e: Event) {
111
- this.output ||= {}
112
- this.output.instruction = (e.target as HTMLTextAreaElement).value
113
-
114
- this.dispatchEvent(
115
- new CustomEvent('change', {
116
- detail: this.output
117
- })
118
- )
119
- }
120
-
121
- updated(changes) {
122
- if (changes.has('input')) {
123
- this.fetchDataOoc()
124
- }
125
- }
126
-
127
- async fetchDataOoc() {
128
- const id = this.input?.dataOocId
129
-
130
- if (id) {
131
- const response = await client.query({
132
- query: gql`
133
- query ($id: String!) {
134
- dataOoc(id: $id) {
135
- id
136
- name
137
- description
138
- ooc
139
- oos
140
- state
141
- type
142
- useCase
143
- data
144
- judgment
145
- dataItems {
146
- name
147
- description
148
- active
149
- hidden
150
- tag
151
- group
152
- type
153
- unit
154
- options
155
- quota
156
- spec
157
- stat
158
- }
159
- workDate
160
- workShift
161
- collectedAt
162
- }
163
- }
164
- `,
165
- variables: {
166
- id
167
- }
168
- })
169
-
170
- this.dataOoc = response.data.dataOoc
171
- }
172
- }
173
- }
@@ -1,129 +0,0 @@
1
- import '@operato/dataset/ox-data-ooc-brief-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('activity-ooc-review-view')
12
- class OocReviewActivityView 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-ooc-brief-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() dataOoc?: any
55
-
56
- render() {
57
- return html`
58
- <div content>
59
- <ox-data-ooc-brief-view .dataOoc=${this.dataOoc}></ox-data-ooc-brief-view>
60
- </div>
61
- `
62
- }
63
-
64
- updated(changes) {
65
- if (changes.has('input')) {
66
- this.fetchDataOoc()
67
- }
68
- }
69
-
70
- async fetchDataOoc() {
71
- const id = this.input?.dataOocId
72
-
73
- if (id) {
74
- const response = await client.query({
75
- query: gql`
76
- query ($id: String!) {
77
- dataOoc(id: $id) {
78
- id
79
- name
80
- description
81
- ooc
82
- oos
83
- state
84
- type
85
- useCase
86
- data
87
- judgment
88
- history
89
- correctiveAction
90
- correctiveInstruction
91
- dataItems {
92
- name
93
- description
94
- active
95
- hidden
96
- tag
97
- group
98
- type
99
- unit
100
- options
101
- quota
102
- spec
103
- stat
104
- }
105
- workDate
106
- workShift
107
- reviewer {
108
- id
109
- name
110
- }
111
- corrector {
112
- id
113
- name
114
- }
115
- collectedAt
116
- reviewedAt
117
- correctedAt
118
- }
119
- }
120
- `,
121
- variables: {
122
- id
123
- }
124
- })
125
-
126
- this.dataOoc = response.data.dataOoc
127
- }
128
- }
129
- }
@@ -1,35 +0,0 @@
1
- import './activities/activity-data-collect-edit' /* refered by the activity template (activity-data-collect) on server */
2
- import './activities/activity-data-collect-view' /* refered by the activity template (activity-data-collect) on server */
3
- import './activities/activity-data-review-edit' /* refered by the activity template (activity-data-review) on server */
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
- import '@operato/app/filter-renderer.js' /* register resource-object filter renderer */
10
-
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'
17
- import { OxGristEditorDataItemSpec } from '@operato/dataset/grist-editor/ox-grist-editor-data-item-spec.js'
18
- import { OxGristEditorPartitionKeys } from '@operato/grist-editor/ox-grist-editor-partition-keys.js'
19
- import { OxGristRendererPartitionKeys } from '@operato/grist-editor/ox-grist-renderer-partition-keys.js'
20
-
21
- import { OxGristEditorSignature } from '@operato/grist-editor/ox-grist-editor-signature.js'
22
- import { OxGristRendererSignature } from '@operato/grist-editor/ox-grist-renderer-signature.js'
23
-
24
- export default function bootstrap() {
25
- registerGristEditor('data-item-spec', OxGristEditorDataItemSpec)
26
- registerGristRenderer('data-item-spec', OxGristRendererJson5)
27
-
28
- registerGristEditor('script', OxGristEditorCode)
29
-
30
- registerGristEditor('partition-keys', OxGristEditorPartitionKeys)
31
- registerGristRenderer('partition-keys', OxGristRendererPartitionKeys)
32
-
33
- registerGristRenderer('signature', OxGristRendererSignature)
34
- registerGristEditor('signature', OxGristEditorSignature)
35
- }
@@ -1,109 +0,0 @@
1
- import '@material/web/icon/icon.js'
2
- import '@operato/dataset/ox-data-entry-form.js'
3
-
4
- import gql from 'graphql-tag'
5
- import { css, html, LitElement } 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 { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'
11
- import { OxDataEntryForm } from '@operato/dataset/ox-data-entry-form.js'
12
- import { DataSet } from '@operato/dataset'
13
-
14
- @customElement('data-entry-form')
15
- export class DataEntryForm extends localize(i18next)(LitElement) {
16
- static styles = [
17
- CommonHeaderStyles,
18
- ScrollbarStyles,
19
- css`
20
- :host {
21
- display: flex;
22
- flex-direction: column;
23
-
24
- background-color: var(--md-sys-color-surface);
25
- }
26
-
27
- ox-data-entry-form {
28
- flex: 1;
29
- padding: 10px;
30
- overflow: auto;
31
- }
32
-
33
- .footer span {
34
- font-size: 0.8em;
35
- color: var(--md-sys-color-on-surface);
36
- line-height: 1.5;
37
- padding: 10px;
38
- }
39
- `
40
- ]
41
-
42
- @property({ type: Object }) dataSet?: DataSet & { id: string }
43
-
44
- @state() dataSample?: { id: string; collectedAt: Date }
45
-
46
- @query('ox-data-entry-form') entryForm!: OxDataEntryForm
47
-
48
- render() {
49
- return html`
50
- <ox-data-entry-form .dataSet=${this.dataSet}></ox-data-entry-form>
51
-
52
- <div class="footer">
53
- <div filler></div>
54
- ${!this.dataSample
55
- ? html`
56
- <button @click=${this.updateDataItems.bind(this)} done>
57
- <md-icon>save</md-icon>${i18next.t('button.save')}
58
- </button>
59
- `
60
- : html` <span>${i18next.t('field.collected-at')}: ${this.dataSample.collectedAt.toLocaleString()}</span> `}
61
- </div>
62
- `
63
- }
64
-
65
- private async updateDataItems() {
66
- //@ts-ignore TODO replace with following line and confirm
67
- const data = this.entryForm.buildValue()
68
-
69
- const dataSample = {
70
- dataSet: {
71
- id: this.dataSet?.id
72
- },
73
- data
74
- } as any
75
-
76
- if (this.dataSample?.collectedAt) {
77
- dataSample.collectedAt = this.dataSample.collectedAt
78
- }
79
-
80
- const response = await client.mutate({
81
- mutation: gql`
82
- mutation ($dataSample: NewDataSample!) {
83
- createDataSample(dataSample: $dataSample) {
84
- id
85
- collectedAt
86
- }
87
- }
88
- `,
89
- variables: {
90
- dataSample
91
- },
92
- context: {
93
- hasUpload: true
94
- }
95
- })
96
-
97
- if (!response.errors) {
98
- const { id, collectedAt } = response.data.createDataSample
99
- this.dataSample = {
100
- id,
101
- collectedAt: new Date(collectedAt)
102
- }
103
-
104
- document.dispatchEvent(
105
- new CustomEvent('notify', { detail: { message: i18next.t('text.data sample created successfully') } })
106
- )
107
- }
108
- }
109
- }
package/client/index.ts DELETED
@@ -1 +0,0 @@
1
- export * from './components/data-entry-form.js'