@things-factory/dataset 5.0.0-alpha.19 → 5.0.0-alpha.21
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/README.md +13 -0
- package/assets/data-samples.jpg +0 -0
- package/client/pages/data-item-list.js +3 -1
- package/client/pages/data-ooc-view.js +90 -42
- package/client/pages/data-ooc.js +78 -77
- package/client/pages/data-sample-view.js +2 -1
- package/client/pages/data-sensor.js +2 -0
- package/client/pages/data-set.js +78 -51
- package/dist-server/controllers/create-data-sample.js +21 -3
- package/dist-server/controllers/create-data-sample.js.map +1 -1
- package/dist-server/routes.js.map +1 -1
- package/dist-server/service/data-ooc/data-ooc-mutation.js +32 -70
- package/dist-server/service/data-ooc/data-ooc-mutation.js.map +1 -1
- package/dist-server/service/data-ooc/data-ooc.js +9 -7
- package/dist-server/service/data-ooc/data-ooc.js.map +1 -1
- package/package.json +14 -14
- package/server/controllers/create-data-sample.ts +22 -4
- package/server/routes.ts +1 -1
- package/server/service/data-ooc/data-ooc-mutation.ts +106 -73
- package/server/service/data-ooc/data-ooc.ts +5 -4
- package/translations/en.json +3 -0
- package/translations/ko.json +3 -0
- package/translations/ms.json +3 -0
- package/translations/zh.json +3 -0
package/README.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# dataset
|
2
|
+
## partition keys
|
3
|
+
At the early stage, partition keys are desinged for dynamic partitioning for Athena. But It will be required so many AWS Glue crawlers also by each 'data-sets'.
|
4
|
+
Now partition keys are fixed with some cases. Default is daily dataset, which has S3 Key like 'domain={domain}/datasetid={datasetid}/year=2022/month=3/day=25'. It will be set default with empty value in 'data-sets'.
|
5
|
+
|
6
|
+
In another case, it is necessary to divide by hours or minutes and store them. This datetime item must be included in the S3 key. It will be required a new Glue Crawler and a Glue Catalog Table. For example if you need to separate directory hourly, you should add "%H" for 'hour' to partition_keys for this. and also should add a new crawler. And it would be needed a column to know it is daily or hourly or minutely for reporting client side. It's not developed yet.
|
7
|
+
Look at the below picture for understanding.
|
8
|
+
|
9
|
+

|
10
|
+
|
11
|
+
These tasks are related for S3 request limitations.
|
12
|
+
> __3,500 PUT/COPY/POST/DELETE or 5,500 GET/HEAD requests per second per prefix in a bucket__
|
13
|
+
- https://docs.aws.amazon.com/AmazonS3/latest/userguide/optimizing-performance.html
|
Binary file
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import '@operato/dataset/ox-data-
|
1
|
+
import '@operato/dataset/ox-data-ooc-view.js'
|
2
2
|
|
3
3
|
import { LitElement, css, html } from 'lit'
|
4
4
|
import { i18next, localize } from '@operato/i18n'
|
@@ -8,13 +8,6 @@ import { client } from '@operato/graphql'
|
|
8
8
|
import gql from 'graphql-tag'
|
9
9
|
|
10
10
|
class DataOocView extends localize(i18next)(LitElement) {
|
11
|
-
static get properties() {
|
12
|
-
return {
|
13
|
-
dataSet: Object,
|
14
|
-
dataSample: Object
|
15
|
-
}
|
16
|
-
}
|
17
|
-
|
18
11
|
static get styles() {
|
19
12
|
return [
|
20
13
|
ScrollbarStyles,
|
@@ -30,11 +23,34 @@ class DataOocView extends localize(i18next)(LitElement) {
|
|
30
23
|
flex: 1;
|
31
24
|
|
32
25
|
display: flex;
|
33
|
-
overflow:
|
26
|
+
overflow: auto;
|
34
27
|
}
|
35
28
|
|
36
|
-
ox-data-
|
29
|
+
ox-data-ooc-view {
|
37
30
|
flex: 1;
|
31
|
+
padding: var(--padding-wide);
|
32
|
+
}
|
33
|
+
|
34
|
+
label[comment] {
|
35
|
+
display: flex;
|
36
|
+
flex-direction: column;
|
37
|
+
|
38
|
+
padding: var(--padding-wide);
|
39
|
+
}
|
40
|
+
|
41
|
+
label[comment] div {
|
42
|
+
display: flex;
|
43
|
+
}
|
44
|
+
|
45
|
+
mwc-icon {
|
46
|
+
color: var(--status-danger-color);
|
47
|
+
}
|
48
|
+
|
49
|
+
textarea {
|
50
|
+
border: var(--input-field-border);
|
51
|
+
border-radius: var(--input-border-radius);
|
52
|
+
padding: var(--input-field-padding);
|
53
|
+
font: var(--input-field-font);
|
38
54
|
}
|
39
55
|
|
40
56
|
.button-container {
|
@@ -46,30 +62,56 @@ class DataOocView extends localize(i18next)(LitElement) {
|
|
46
62
|
]
|
47
63
|
}
|
48
64
|
|
65
|
+
static get properties() {
|
66
|
+
return {
|
67
|
+
dataSet: Object,
|
68
|
+
dataOoc: Object
|
69
|
+
}
|
70
|
+
}
|
71
|
+
|
49
72
|
get sampleView() {
|
50
|
-
return this.renderRoot.querySelector('ox-data-
|
73
|
+
return this.renderRoot.querySelector('ox-data-ooc-view')
|
51
74
|
}
|
52
75
|
|
53
76
|
render() {
|
77
|
+
const state = this.dataOoc.state
|
78
|
+
|
54
79
|
return html`
|
55
80
|
<div content>
|
56
|
-
<ox-data-
|
81
|
+
<ox-data-ooc-view .dataSet=${this.dataSet} .dataOoc=${this.dataOoc}></ox-data-ooc-view>
|
57
82
|
</div>
|
58
83
|
|
84
|
+
${state === 'CREATED' || state === 'REVIEWED'
|
85
|
+
? html`
|
86
|
+
<label comment>
|
87
|
+
<div><mwc-icon>build_circle</mwc-icon> <span>correction activity</span></div>
|
88
|
+
<textarea placeholder="조치 내용을 입력해주세요."></textarea>
|
89
|
+
</label>
|
90
|
+
`
|
91
|
+
: html``}
|
92
|
+
|
59
93
|
<div class="button-container">
|
60
|
-
|
94
|
+
${state === 'CREATED'
|
95
|
+
? html`<mwc-button raised @click=${() => this._processOoc('REVIEWED')}
|
96
|
+
>${i18next.t('button.reviewed')}</mwc-button
|
97
|
+
>`
|
98
|
+
: state === 'REVIEWED'
|
99
|
+
? html`<mwc-button raised @click=${() => this._processOoc('CORRECTED')}
|
100
|
+
>${i18next.t('button.corrected')}</mwc-button
|
101
|
+
>`
|
102
|
+
: html``}
|
61
103
|
</div>
|
62
104
|
`
|
63
105
|
}
|
64
106
|
|
65
107
|
updated(changes) {
|
66
|
-
if (changes.has('
|
108
|
+
if (changes.has('dataOoc')) {
|
67
109
|
this.fetchDataSet()
|
68
110
|
}
|
69
111
|
}
|
70
112
|
|
71
113
|
async fetchDataSet() {
|
72
|
-
const id = this.
|
114
|
+
const id = this.dataOoc?.dataSet?.id
|
73
115
|
|
74
116
|
if (id) {
|
75
117
|
const response = await client.query({
|
@@ -94,7 +136,7 @@ class DataOocView extends localize(i18next)(LitElement) {
|
|
94
136
|
}
|
95
137
|
`,
|
96
138
|
variables: {
|
97
|
-
id: this.
|
139
|
+
id: this.dataOoc.dataSet.id
|
98
140
|
}
|
99
141
|
})
|
100
142
|
|
@@ -102,32 +144,38 @@ class DataOocView extends localize(i18next)(LitElement) {
|
|
102
144
|
}
|
103
145
|
}
|
104
146
|
|
105
|
-
async
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
147
|
+
async _processOoc(state) {
|
148
|
+
const commentTextArea = this.renderRoot.querySelector('textarea')
|
149
|
+
const comment = commentTextArea && commentTextArea.value
|
150
|
+
if (!comment || !comment.trim()) {
|
151
|
+
commentTextArea.focus()
|
152
|
+
return
|
153
|
+
}
|
154
|
+
|
155
|
+
const patch = {
|
156
|
+
state,
|
157
|
+
correctiveAction: comment
|
158
|
+
}
|
159
|
+
|
160
|
+
const response = await client.mutate({
|
161
|
+
mutation: gql`
|
162
|
+
mutation ($id: String!, $patch: DataOocPatch!) {
|
163
|
+
updateDataOoc(id: $id, patch: $patch) {
|
164
|
+
id
|
165
|
+
}
|
166
|
+
}
|
167
|
+
`,
|
168
|
+
variables: {
|
169
|
+
id: this.dataOoc.id,
|
170
|
+
patch
|
171
|
+
}
|
172
|
+
})
|
173
|
+
|
174
|
+
if (!response.errors) {
|
175
|
+
document.dispatchEvent(
|
176
|
+
new CustomEvent('notify', { detail: { message: i18next.t('text.data ooc updated successfully') } })
|
177
|
+
)
|
178
|
+
}
|
131
179
|
}
|
132
180
|
}
|
133
181
|
|
package/client/pages/data-ooc.js
CHANGED
@@ -56,11 +56,11 @@ export class DataOoc extends connect(store)(localize(i18next)(PageView)) {
|
|
56
56
|
title: i18next.t('title.data-ooc list'),
|
57
57
|
help: 'integration/ui/data-ooc',
|
58
58
|
actions: [
|
59
|
-
{
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
}
|
59
|
+
// {
|
60
|
+
// title: i18next.t('button.save'),
|
61
|
+
// action: this._updateDataOoc.bind(this),
|
62
|
+
// ...CommonButtonStyles.save
|
63
|
+
// }
|
64
64
|
],
|
65
65
|
exportable: {
|
66
66
|
name: i18next.t('title.data-ooc list'),
|
@@ -124,14 +124,17 @@ export class DataOoc extends connect(store)(localize(i18next)(PageView)) {
|
|
124
124
|
icon: 'assignment_turned_in',
|
125
125
|
handlers: {
|
126
126
|
click: (columns, data, column, record, rowIndex) => {
|
127
|
-
openPopup(
|
128
|
-
html` <data-ooc-view .
|
127
|
+
const popup = openPopup(
|
128
|
+
html` <data-ooc-view .dataOoc=${record} style="background-color: white;"></data-ooc-view> `,
|
129
129
|
{
|
130
130
|
backdrop: true,
|
131
131
|
size: 'large',
|
132
132
|
title: i18next.t('title.data-ooc view')
|
133
133
|
}
|
134
134
|
)
|
135
|
+
popup.onclosed = () => {
|
136
|
+
this.grist.fetch()
|
137
|
+
}
|
135
138
|
}
|
136
139
|
}
|
137
140
|
},
|
@@ -160,6 +163,12 @@ export class DataOoc extends connect(store)(localize(i18next)(PageView)) {
|
|
160
163
|
width: 150,
|
161
164
|
imex: true
|
162
165
|
},
|
166
|
+
{
|
167
|
+
type: 'string',
|
168
|
+
name: 'history',
|
169
|
+
hidden: true,
|
170
|
+
imex: true
|
171
|
+
},
|
163
172
|
{
|
164
173
|
type: 'checkbox',
|
165
174
|
name: 'ooc',
|
@@ -179,14 +188,16 @@ export class DataOoc extends connect(store)(localize(i18next)(PageView)) {
|
|
179
188
|
width: 30
|
180
189
|
},
|
181
190
|
{
|
182
|
-
type: '
|
191
|
+
type: 'select',
|
183
192
|
name: 'state',
|
184
193
|
label: true,
|
185
194
|
header: i18next.t('field.state'),
|
186
195
|
record: {
|
187
|
-
editable: false
|
196
|
+
editable: false,
|
197
|
+
options: ['', 'CREATED', 'REVIEWED', 'CORRECTED']
|
188
198
|
},
|
189
|
-
width:
|
199
|
+
width: 100,
|
200
|
+
filter: true,
|
190
201
|
imex: true
|
191
202
|
},
|
192
203
|
{
|
@@ -211,17 +222,6 @@ export class DataOoc extends connect(store)(localize(i18next)(PageView)) {
|
|
211
222
|
width: 120,
|
212
223
|
imex: true
|
213
224
|
},
|
214
|
-
{
|
215
|
-
type: 'resource-object',
|
216
|
-
name: 'dataSample',
|
217
|
-
header: i18next.t('field.data-sample'),
|
218
|
-
record: {
|
219
|
-
editable: false
|
220
|
-
},
|
221
|
-
sortable: true,
|
222
|
-
width: 120,
|
223
|
-
imex: true
|
224
|
-
},
|
225
225
|
{
|
226
226
|
type: 'json5',
|
227
227
|
name: 'partitionKeys',
|
@@ -338,6 +338,7 @@ export class DataOoc extends connect(store)(localize(i18next)(PageView)) {
|
|
338
338
|
spec
|
339
339
|
ooc
|
340
340
|
oos
|
341
|
+
history
|
341
342
|
correctiveAction
|
342
343
|
correctedAt
|
343
344
|
corrector {
|
@@ -368,62 +369,62 @@ export class DataOoc extends connect(store)(localize(i18next)(PageView)) {
|
|
368
369
|
}
|
369
370
|
}
|
370
371
|
|
371
|
-
async _updateDataOoc() {
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
}
|
402
|
-
|
403
|
-
async _deleteDataOoc() {
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
}
|
372
|
+
// async _updateDataOoc() {
|
373
|
+
// let patches = this.grist.dirtyRecords
|
374
|
+
// if (patches && patches.length) {
|
375
|
+
// patches = patches.map(patch => {
|
376
|
+
// let patchField = patch.id ? { id: patch.id } : {}
|
377
|
+
// const dirtyFields = patch.__dirtyfields__
|
378
|
+
// for (let key in dirtyFields) {
|
379
|
+
// patchField[key] = dirtyFields[key].after
|
380
|
+
// }
|
381
|
+
// this._setDefaultFieldsValue(patchField)
|
382
|
+
// patchField.cuFlag = patch.__dirty__
|
383
|
+
|
384
|
+
// return patchField
|
385
|
+
// })
|
386
|
+
|
387
|
+
// const response = await client.mutate({
|
388
|
+
// mutation: gql`
|
389
|
+
// mutation ($patches: [DataOocPatch!]!) {
|
390
|
+
// updateMultipleDataOoc(patches: $patches) {
|
391
|
+
// name
|
392
|
+
// }
|
393
|
+
// }
|
394
|
+
// `,
|
395
|
+
// variables: {
|
396
|
+
// patches
|
397
|
+
// }
|
398
|
+
// })
|
399
|
+
|
400
|
+
// if (!response.errors) this.grist.fetch()
|
401
|
+
// }
|
402
|
+
// }
|
403
|
+
|
404
|
+
// async _deleteDataOoc() {
|
405
|
+
// if (confirm(i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }))) {
|
406
|
+
// const ids = this.grist.selected.map(record => record.id)
|
407
|
+
// if (ids && ids.length > 0) {
|
408
|
+
// const response = await client.mutate({
|
409
|
+
// mutation: gql`
|
410
|
+
// mutation ($ids: [String!]!) {
|
411
|
+
// deleteDataOocs(ids: $ids)
|
412
|
+
// }
|
413
|
+
// `,
|
414
|
+
// variables: {
|
415
|
+
// ids
|
416
|
+
// }
|
417
|
+
// })
|
418
|
+
|
419
|
+
// if (!response.errors) {
|
420
|
+
// this.grist.fetch()
|
421
|
+
// notify({
|
422
|
+
// message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })
|
423
|
+
// })
|
424
|
+
// }
|
425
|
+
// }
|
426
|
+
// }
|
427
|
+
// }
|
427
428
|
|
428
429
|
_exportableData() {
|
429
430
|
let records = []
|
@@ -153,6 +153,7 @@ export class DataSensor extends connect(store)(localize(i18next)(PageView)) {
|
|
153
153
|
editable: true
|
154
154
|
},
|
155
155
|
sortable: true,
|
156
|
+
filter: true,
|
156
157
|
width: 60
|
157
158
|
},
|
158
159
|
{
|
@@ -176,6 +177,7 @@ export class DataSensor extends connect(store)(localize(i18next)(PageView)) {
|
|
176
177
|
editable: true
|
177
178
|
},
|
178
179
|
sortable: true,
|
180
|
+
filter: 'search',
|
179
181
|
width: 150
|
180
182
|
},
|
181
183
|
{
|