@things-factory/dataset 5.0.0-alpha.24 → 5.0.0-alpha.27
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/client/pages/{data-entry-form.js → data-entry/data-entry-form.js} +1 -0
- package/client/pages/data-entry/data-entry-list-page.js +324 -0
- package/client/pages/{data-ooc.js → data-ooc/data-ooc-list-page.js} +3 -3
- package/client/pages/{data-ooc-view.js → data-ooc/data-ooc-view.js} +0 -0
- package/client/pages/{data-sample.js → data-sample/data-sample-list-page.js} +3 -3
- package/client/pages/{data-sample-view.js → data-sample/data-sample-view.js} +0 -0
- package/client/pages/{data-sensor.js → data-sensor/data-sensor-list-page.js} +3 -3
- package/client/pages/{data-item-list.js → data-set/data-item-list.js} +0 -0
- package/client/pages/{data-set-importer.js → data-set/data-set-importer.js} +0 -0
- package/client/pages/{data-set.js → data-set/data-set-list-page.js} +6 -6
- package/client/route.js +12 -8
- package/dist-server/controllers/create-data-sample.js +1 -1
- package/dist-server/controllers/create-data-sample.js.map +1 -1
- package/package.json +15 -15
- package/server/controllers/create-data-sample.ts +1 -1
- package/things-factory.config.js +12 -8
- package/translations/en.json +2 -1
- package/yarn-error.log +23244 -0
@@ -0,0 +1,324 @@
|
|
1
|
+
import '@operato/data-grist'
|
2
|
+
import './data-entry-form'
|
3
|
+
|
4
|
+
import { CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
5
|
+
import { PageView, store } from '@operato/shell'
|
6
|
+
import { css, html } from 'lit'
|
7
|
+
import { i18next, localize } from '@operato/i18n'
|
8
|
+
import { notify, openPopup } from '@operato/layout'
|
9
|
+
|
10
|
+
import JSON5 from 'json5'
|
11
|
+
import { OxDataUseCase } from '@operato/dataset'
|
12
|
+
import { client } from '@operato/graphql'
|
13
|
+
import { connect } from 'pwa-helpers/connect-mixin'
|
14
|
+
import gql from 'graphql-tag'
|
15
|
+
|
16
|
+
export class DataEntryListPage extends connect(store)(localize(i18next)(PageView)) {
|
17
|
+
static get properties() {
|
18
|
+
return {
|
19
|
+
active: String,
|
20
|
+
gristConfig: Object,
|
21
|
+
filters: Object,
|
22
|
+
sorters: Object,
|
23
|
+
mode: String
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
27
|
+
static get styles() {
|
28
|
+
return [
|
29
|
+
ScrollbarStyles,
|
30
|
+
CommonGristStyles,
|
31
|
+
css`
|
32
|
+
:host {
|
33
|
+
display: flex;
|
34
|
+
|
35
|
+
width: 100%;
|
36
|
+
|
37
|
+
--grid-record-emphasized-background-color: red;
|
38
|
+
--grid-record-emphasized-color: yellow;
|
39
|
+
}
|
40
|
+
`
|
41
|
+
]
|
42
|
+
}
|
43
|
+
|
44
|
+
get context() {
|
45
|
+
return {
|
46
|
+
title: i18next.t('title.data-entry list'),
|
47
|
+
help: 'dataset/data-entry-list'
|
48
|
+
}
|
49
|
+
}
|
50
|
+
|
51
|
+
render() {
|
52
|
+
const mode = 'CARD'
|
53
|
+
|
54
|
+
return html`
|
55
|
+
<ox-grist
|
56
|
+
.mode=${mode}
|
57
|
+
.config=${this.gristConfig}
|
58
|
+
.filters=${this.filters}
|
59
|
+
.orders=${this.orders}
|
60
|
+
.fetchHandler=${this.fetchHandler.bind(this)}
|
61
|
+
>
|
62
|
+
<div slot="headroom" id="filters">
|
63
|
+
<div id="filters">
|
64
|
+
<ox-filters-form></ox-filters-form>
|
65
|
+
</div>
|
66
|
+
|
67
|
+
<div id="sorters">
|
68
|
+
Sort
|
69
|
+
<mwc-icon
|
70
|
+
@click=${e => {
|
71
|
+
const target = e.currentTarget
|
72
|
+
this.renderRoot.querySelector('#sorter-control').open({
|
73
|
+
right: 0,
|
74
|
+
top: target.offsetTop + target.offsetHeight
|
75
|
+
})
|
76
|
+
}}
|
77
|
+
>expand_more</mwc-icon
|
78
|
+
>
|
79
|
+
<ox-popup id="sorter-control">
|
80
|
+
<ox-sorters-control> </ox-sorters-control>
|
81
|
+
</ox-popup>
|
82
|
+
</div>
|
83
|
+
</div>
|
84
|
+
</ox-grist>
|
85
|
+
`
|
86
|
+
}
|
87
|
+
|
88
|
+
get grist() {
|
89
|
+
return this.renderRoot.querySelector('ox-grist')
|
90
|
+
}
|
91
|
+
|
92
|
+
async pageInitialized(lifecycle) {
|
93
|
+
this.gristConfig = {
|
94
|
+
list: {
|
95
|
+
fields: ['name', 'description'],
|
96
|
+
details: ['schedule', 'active']
|
97
|
+
},
|
98
|
+
columns: [
|
99
|
+
{
|
100
|
+
type: 'string',
|
101
|
+
name: 'name',
|
102
|
+
header: i18next.t('field.name'),
|
103
|
+
record: {
|
104
|
+
editable: true
|
105
|
+
},
|
106
|
+
filter: 'search',
|
107
|
+
sortable: true,
|
108
|
+
width: 150
|
109
|
+
},
|
110
|
+
{
|
111
|
+
type: 'string',
|
112
|
+
name: 'description',
|
113
|
+
header: i18next.t('field.description'),
|
114
|
+
record: {
|
115
|
+
editable: true
|
116
|
+
},
|
117
|
+
filter: 'search',
|
118
|
+
width: 200
|
119
|
+
},
|
120
|
+
{
|
121
|
+
type: 'checkbox',
|
122
|
+
name: 'active',
|
123
|
+
label: true,
|
124
|
+
header: i18next.t('field.active'),
|
125
|
+
record: {
|
126
|
+
editable: false
|
127
|
+
},
|
128
|
+
filter: true,
|
129
|
+
sortable: true,
|
130
|
+
width: 60
|
131
|
+
},
|
132
|
+
{
|
133
|
+
type: 'select',
|
134
|
+
name: 'type',
|
135
|
+
label: true,
|
136
|
+
header: i18next.t('field.type'),
|
137
|
+
record: {
|
138
|
+
editable: false,
|
139
|
+
options: [
|
140
|
+
{},
|
141
|
+
{
|
142
|
+
display: 'Manually Collected',
|
143
|
+
value: 'manual'
|
144
|
+
},
|
145
|
+
{
|
146
|
+
display: 'Automatically Collected',
|
147
|
+
value: 'automatic'
|
148
|
+
}
|
149
|
+
]
|
150
|
+
},
|
151
|
+
sortable: true,
|
152
|
+
filter: true,
|
153
|
+
width: 60
|
154
|
+
},
|
155
|
+
{
|
156
|
+
type: 'select',
|
157
|
+
name: 'useCase',
|
158
|
+
label: true,
|
159
|
+
header: i18next.t('field.use-case'),
|
160
|
+
record: {
|
161
|
+
editable: false,
|
162
|
+
options: () => {
|
163
|
+
return ['', ...OxDataUseCase.getUseCaseNames()].map(name => {
|
164
|
+
return {
|
165
|
+
display: name,
|
166
|
+
value: name
|
167
|
+
}
|
168
|
+
})
|
169
|
+
}
|
170
|
+
},
|
171
|
+
sortable: true,
|
172
|
+
filter: {
|
173
|
+
operator: 'eq',
|
174
|
+
options: () => {
|
175
|
+
return ['', ...OxDataUseCase.getUseCaseNames()].map(name => {
|
176
|
+
return {
|
177
|
+
display: name,
|
178
|
+
value: name
|
179
|
+
}
|
180
|
+
})
|
181
|
+
}
|
182
|
+
},
|
183
|
+
width: 80
|
184
|
+
},
|
185
|
+
{
|
186
|
+
type: 'crontab',
|
187
|
+
name: 'schedule',
|
188
|
+
label: true,
|
189
|
+
header: i18next.t('field.schedule'),
|
190
|
+
record: {
|
191
|
+
editable: true,
|
192
|
+
options: {
|
193
|
+
objectified: true
|
194
|
+
}
|
195
|
+
},
|
196
|
+
width: 80,
|
197
|
+
label: true
|
198
|
+
},
|
199
|
+
{
|
200
|
+
type: 'resource-object',
|
201
|
+
name: 'supervisoryRole',
|
202
|
+
header: i18next.t('field.supervisory-role'),
|
203
|
+
record: {
|
204
|
+
editable: true,
|
205
|
+
options: {
|
206
|
+
queryName: 'roles'
|
207
|
+
}
|
208
|
+
},
|
209
|
+
sortable: true,
|
210
|
+
width: 120
|
211
|
+
}
|
212
|
+
],
|
213
|
+
rows: {
|
214
|
+
selectable: {
|
215
|
+
multiple: false
|
216
|
+
},
|
217
|
+
handlers: {
|
218
|
+
click: (columns, data, column, record, rowIndex) => {
|
219
|
+
openPopup(html` <data-entry-form .dataSet=${record} style="background-color: white;"></data-entry-form> `, {
|
220
|
+
backdrop: true,
|
221
|
+
size: 'large',
|
222
|
+
title: i18next.t('title.data-entry-form')
|
223
|
+
})
|
224
|
+
}
|
225
|
+
},
|
226
|
+
classifier: function (record, rowIndex) {}
|
227
|
+
},
|
228
|
+
sorters: [
|
229
|
+
{
|
230
|
+
name: 'name'
|
231
|
+
}
|
232
|
+
]
|
233
|
+
}
|
234
|
+
|
235
|
+
await this.updateComplete
|
236
|
+
|
237
|
+
this.grist.fetch()
|
238
|
+
}
|
239
|
+
|
240
|
+
async pageUpdated(changes, lifecycle) {
|
241
|
+
if (this.active) {
|
242
|
+
await this.updateComplete
|
243
|
+
|
244
|
+
var filters = lifecycle.params?.['filters']
|
245
|
+
if (filters) {
|
246
|
+
try {
|
247
|
+
filters = JSON5.parse(filters)
|
248
|
+
this.filters = filters
|
249
|
+
} catch (e) {
|
250
|
+
console.error(`filters parameter parsing error: ${e}`)
|
251
|
+
}
|
252
|
+
}
|
253
|
+
|
254
|
+
var sorters = lifecycle.params?.['sorters']
|
255
|
+
if (sorters) {
|
256
|
+
try {
|
257
|
+
sorters = JSON5.parse(sorters)
|
258
|
+
this.sorters = sorters
|
259
|
+
} catch (e) {
|
260
|
+
console.error(`sorters parameter parsing error: ${e}`)
|
261
|
+
}
|
262
|
+
}
|
263
|
+
|
264
|
+
this.grist.fetch()
|
265
|
+
}
|
266
|
+
}
|
267
|
+
|
268
|
+
async fetchHandler({ page, limit, sortings = [], filters = [] }) {
|
269
|
+
const response = await client.query({
|
270
|
+
query: gql`
|
271
|
+
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
272
|
+
responses: dataSets(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
273
|
+
items {
|
274
|
+
id
|
275
|
+
name
|
276
|
+
description
|
277
|
+
partitionKeys
|
278
|
+
slugger
|
279
|
+
active
|
280
|
+
type
|
281
|
+
useCase
|
282
|
+
schedule
|
283
|
+
timezone
|
284
|
+
supervisoryRole {
|
285
|
+
id
|
286
|
+
name
|
287
|
+
}
|
288
|
+
updater {
|
289
|
+
id
|
290
|
+
name
|
291
|
+
}
|
292
|
+
updatedAt
|
293
|
+
dataItems {
|
294
|
+
name
|
295
|
+
description
|
296
|
+
sequence
|
297
|
+
active
|
298
|
+
tag
|
299
|
+
type
|
300
|
+
unit
|
301
|
+
options
|
302
|
+
quota
|
303
|
+
spec
|
304
|
+
}
|
305
|
+
}
|
306
|
+
total
|
307
|
+
}
|
308
|
+
}
|
309
|
+
`,
|
310
|
+
variables: {
|
311
|
+
filters,
|
312
|
+
pagination: { page, limit },
|
313
|
+
sortings
|
314
|
+
}
|
315
|
+
})
|
316
|
+
|
317
|
+
return {
|
318
|
+
total: response.data.responses.total || 0,
|
319
|
+
records: response.data.responses.items || []
|
320
|
+
}
|
321
|
+
}
|
322
|
+
}
|
323
|
+
|
324
|
+
window.customElements.define('data-entry-list-page', DataEntryListPage)
|
@@ -12,7 +12,7 @@ import { PageView, store } from '@operato/shell'
|
|
12
12
|
import { ScrollbarStyles } from '@operato/styles'
|
13
13
|
import { isMobileDevice } from '@operato/utils'
|
14
14
|
|
15
|
-
export class
|
15
|
+
export class DataOocListPage extends connect(store)(localize(i18next)(PageView)) {
|
16
16
|
static get properties() {
|
17
17
|
return {
|
18
18
|
active: String,
|
@@ -54,7 +54,7 @@ export class DataOoc extends connect(store)(localize(i18next)(PageView)) {
|
|
54
54
|
get context() {
|
55
55
|
return {
|
56
56
|
title: i18next.t('title.data-ooc list'),
|
57
|
-
help: '
|
57
|
+
help: 'dataset/data-ooc',
|
58
58
|
actions: [
|
59
59
|
// {
|
60
60
|
// title: i18next.t('button.save'),
|
@@ -485,4 +485,4 @@ export class DataOoc extends connect(store)(localize(i18next)(PageView)) {
|
|
485
485
|
}
|
486
486
|
}
|
487
487
|
|
488
|
-
window.customElements.define('data-ooc-page',
|
488
|
+
window.customElements.define('data-ooc-list-page', DataOocListPage)
|
File without changes
|
@@ -12,7 +12,7 @@ import { PageView, store } from '@operato/shell'
|
|
12
12
|
import { ScrollbarStyles } from '@operato/styles'
|
13
13
|
import { isMobileDevice } from '@operato/utils'
|
14
14
|
|
15
|
-
export class
|
15
|
+
export class DataSampleListPage extends connect(store)(localize(i18next)(PageView)) {
|
16
16
|
static get properties() {
|
17
17
|
return {
|
18
18
|
active: String,
|
@@ -54,7 +54,7 @@ export class DataSample extends connect(store)(localize(i18next)(PageView)) {
|
|
54
54
|
get context() {
|
55
55
|
return {
|
56
56
|
title: i18next.t('title.data-sample list'),
|
57
|
-
help: '
|
57
|
+
help: 'dataset/data-sample',
|
58
58
|
actions: [],
|
59
59
|
exportable: {
|
60
60
|
name: i18next.t('title.data-sample list'),
|
@@ -388,4 +388,4 @@ export class DataSample extends connect(store)(localize(i18next)(PageView)) {
|
|
388
388
|
}
|
389
389
|
}
|
390
390
|
|
391
|
-
window.customElements.define('data-sample-page',
|
391
|
+
window.customElements.define('data-sample-list-page', DataSampleListPage)
|
File without changes
|
@@ -11,7 +11,7 @@ import gql from 'graphql-tag'
|
|
11
11
|
import { isMobileDevice } from '@operato/utils'
|
12
12
|
import { notify } from '@operato/layout'
|
13
13
|
|
14
|
-
export class
|
14
|
+
export class DataSensorListPage extends connect(store)(localize(i18next)(PageView)) {
|
15
15
|
static get properties() {
|
16
16
|
return {
|
17
17
|
active: String,
|
@@ -53,7 +53,7 @@ export class DataSensor extends connect(store)(localize(i18next)(PageView)) {
|
|
53
53
|
get context() {
|
54
54
|
return {
|
55
55
|
title: i18next.t('title.data-sensor list'),
|
56
|
-
help: '
|
56
|
+
help: 'dataset/data-sensor',
|
57
57
|
actions: [
|
58
58
|
{
|
59
59
|
title: i18next.t('button.copy'),
|
@@ -438,4 +438,4 @@ export class DataSensor extends connect(store)(localize(i18next)(PageView)) {
|
|
438
438
|
}
|
439
439
|
}
|
440
440
|
|
441
|
-
window.customElements.define('data-sensor-page',
|
441
|
+
window.customElements.define('data-sensor-list-page', DataSensorListPage)
|
File without changes
|
File without changes
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import '@operato/data-grist'
|
2
|
-
import './data-item-list'
|
3
|
-
import './data-set-importer'
|
4
|
-
import '
|
2
|
+
import './data-item-list.js'
|
3
|
+
import './data-set-importer.js'
|
4
|
+
import '../data-entry/data-entry-form.js'
|
5
5
|
|
6
6
|
import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
7
7
|
import { PageView, store } from '@operato/shell'
|
@@ -17,7 +17,7 @@ import gql from 'graphql-tag'
|
|
17
17
|
import { isMobileDevice } from '@operato/utils'
|
18
18
|
import moment from 'moment-timezone'
|
19
19
|
|
20
|
-
export class
|
20
|
+
export class DataSetListPage extends connect(store)(localize(i18next)(PageView)) {
|
21
21
|
static get properties() {
|
22
22
|
return {
|
23
23
|
active: String,
|
@@ -48,7 +48,7 @@ export class DataSet extends connect(store)(localize(i18next)(PageView)) {
|
|
48
48
|
get context() {
|
49
49
|
return {
|
50
50
|
title: i18next.t('title.data-set list'),
|
51
|
-
help: '
|
51
|
+
help: 'dataset/data-set',
|
52
52
|
actions: [
|
53
53
|
{
|
54
54
|
title: i18next.t('button.copy'),
|
@@ -549,4 +549,4 @@ export class DataSet extends connect(store)(localize(i18next)(PageView)) {
|
|
549
549
|
}
|
550
550
|
}
|
551
551
|
|
552
|
-
window.customElements.define('data-set-page',
|
552
|
+
window.customElements.define('data-set-list-page', DataSetListPage)
|
package/client/route.js
CHANGED
@@ -1,19 +1,23 @@
|
|
1
1
|
export default function route(page) {
|
2
2
|
switch (page) {
|
3
|
-
case 'data-set':
|
4
|
-
import('./pages/data-set')
|
3
|
+
case 'data-set-list':
|
4
|
+
import('./pages/data-set/data-set-list-page.js')
|
5
5
|
return page
|
6
6
|
|
7
|
-
case 'data-sensor':
|
8
|
-
import('./pages/data-sensor')
|
7
|
+
case 'data-sensor-list':
|
8
|
+
import('./pages/data-sensor/data-sensor-list-page.js')
|
9
9
|
return page
|
10
10
|
|
11
|
-
case 'data-sample':
|
12
|
-
import('./pages/data-sample')
|
11
|
+
case 'data-sample-list':
|
12
|
+
import('./pages/data-sample/data-sample-list-page.js')
|
13
13
|
return page
|
14
14
|
|
15
|
-
case 'data-ooc':
|
16
|
-
import('./pages/data-ooc')
|
15
|
+
case 'data-ooc-list':
|
16
|
+
import('./pages/data-ooc/data-ooc-list-page.js')
|
17
|
+
return page
|
18
|
+
|
19
|
+
case 'data-entry-list':
|
20
|
+
import('./pages/data-entry/data-entry-list-page.js')
|
17
21
|
return page
|
18
22
|
}
|
19
23
|
}
|
@@ -67,7 +67,7 @@ async function createDataSample(dataSample, context) {
|
|
67
67
|
partitionKeys = formatDate(partitionKeys, momentUtc);
|
68
68
|
partitionKeys = replaceVariables(partitionKeys, Object.assign({}, dataSample.data));
|
69
69
|
const { ooc, oos } = data_use_case_1.DataUseCase.evaluate(dataSet, dataItems, dataSample.data) || {};
|
70
|
-
const { workDate, workShift } = (0, work_shift_1.getWorkDateAndShift)(domain, collectedAt);
|
70
|
+
const { workDate, workShift } = await (0, work_shift_1.getWorkDateAndShift)(domain, collectedAt);
|
71
71
|
const result = await tx.getRepository(data_sample_1.DataSample).save(Object.assign(Object.assign({ name: dataSet.name, description: dataSet.description, useCase: dataSet.useCase }, dataSample), { domain,
|
72
72
|
partitionKeys,
|
73
73
|
spec,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"create-data-sample.js","sourceRoot":"","sources":["../../server/controllers/create-data-sample.ts"],"names":[],"mappings":";;;;;;AAAA,2DAAqE;AACrE,iDAAgF;AAEhF,8DAAyD;AACzD,oEAA+D;AAC/D,2DAAsD;AACtD,mDAA6C;AAI7C,2DAAgE;AAChE,oDAA2B;AAE3B,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,oDAAoD,CAAC,CAAA;AAEpF,2CAA2C;AAC3C,MAAM,gBAAgB,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;IACrC,KAAK,MAAM,CAAC,IAAI,IAAI,EAAE;QACpB,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,CAAA;QAC3C,OAAO;YACL,OAAO,CAAC,OAAO,CAAC,CAAC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
{"version":3,"file":"create-data-sample.js","sourceRoot":"","sources":["../../server/controllers/create-data-sample.ts"],"names":[],"mappings":";;;;;;AAAA,2DAAqE;AACrE,iDAAgF;AAEhF,8DAAyD;AACzD,oEAA+D;AAC/D,2DAAsD;AACtD,mDAA6C;AAI7C,2DAAgE;AAChE,oDAA2B;AAE3B,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,oDAAoD,CAAC,CAAA;AAEpF,2CAA2C;AAC3C,MAAM,gBAAgB,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;IACrC,KAAK,MAAM,CAAC,IAAI,IAAI,EAAE;QACpB,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,CAAA;QAC3C,OAAO;YACL,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;gBAClB,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;YACnD,CAAC,CAAC,CAAA;KACL;IACD,OAAO,IAAI,CAAA;AACb,CAAC,CAAA;AAED,gFAAgF;AAChF,sBAAsB;AACtB,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE;IACnC,KAAK,MAAM,CAAC,IAAI,IAAI,EAAE;QACpB,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;QACtC,OAAO;YACL,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;gBAClB,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;YA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;YACb,IAAI;YACJ,GAAG;YACH,GAAG;YACH,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE;wBACJ,EAAE,EAAE,IAAI,CAAC,EAAE;wBACX,IAAI,EAAE,IAAI,CAAC,IAAI;qBAChB;oBACD,KAAK,EAAE,wBAAa,CAAC,OAAO;oBAC5B,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;iBACtB;aACF;YACD,KAAK,EAAE,wBAAa,CAAC,OAAO;YAC5B,QAAQ;YACR,SAAS;YACT,WAAW;YACX,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,IAAI;SACd,CAAC,CAAA;QAEF,cAAM,CAAC,OAAO,CAAC,UAAU,EAAE;YACzB,OAAO;YACP,iBAAiB,EAAE,OAAO,CAAC,iBAAiB;SAC7C,CAAC,CAAA;QAEF,cAAM,CAAC,OAAO,CAAC,cAAc,EAAE;YAC7B,YAAY,EAAE;gBACZ,MAAM;gBACN,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,yBAAyB,OAAO,CAAC,IAAI,GAAG;gBAC/C,IAAI,EAAE,yBAAyB,OAAO,CAAC,IAAI,GAAG;gBAC9C,GAAG,EAAE,IAAA,gCAAwB,EAAC,OAAO,EAAE,MAAM,CAAC,SAAS,EAAE,aAAa,OAAO,CAAC,EAAE,EAAE,CAAC;gBACnF,SAAS,EAAE,WAAW;aACvB;SACF,CAAC,CAAA;KACH;IAED,OAAO,MAAM,CAAA;AACf,CAAC;AA7HD,4CA6HC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@things-factory/dataset",
|
3
|
-
"version": "5.0.0-alpha.
|
3
|
+
"version": "5.0.0-alpha.27",
|
4
4
|
"main": "dist-server/index.js",
|
5
5
|
"browser": "client/index.js",
|
6
6
|
"things-factory": true,
|
@@ -24,20 +24,20 @@
|
|
24
24
|
"migration:create": "node ../../node_modules/typeorm/cli.js migration:create -d ./server/migrations"
|
25
25
|
},
|
26
26
|
"dependencies": {
|
27
|
-
"@operato/app": "1.0.0-alpha.
|
28
|
-
"@operato/data-grist": "1.0.0-alpha.
|
29
|
-
"@operato/dataset": "1.0.0-alpha.
|
30
|
-
"@operato/graphql": "1.0.0-alpha.
|
31
|
-
"@operato/i18n": "1.0.0-alpha.
|
32
|
-
"@operato/layout": "1.0.0-alpha.
|
33
|
-
"@operato/shell": "1.0.0-alpha.
|
34
|
-
"@operato/styles": "1.0.0-alpha.
|
35
|
-
"@operato/utils": "1.0.0-alpha.
|
36
|
-
"@things-factory/auth-base": "^5.0.0-alpha.
|
37
|
-
"@things-factory/env": "^5.0.0-alpha.
|
38
|
-
"@things-factory/shell": "^5.0.0-alpha.
|
39
|
-
"@things-factory/work-shift": "^5.0.0-alpha.
|
27
|
+
"@operato/app": "1.0.0-alpha.48",
|
28
|
+
"@operato/data-grist": "1.0.0-alpha.48",
|
29
|
+
"@operato/dataset": "1.0.0-alpha.48",
|
30
|
+
"@operato/graphql": "1.0.0-alpha.48",
|
31
|
+
"@operato/i18n": "1.0.0-alpha.48",
|
32
|
+
"@operato/layout": "1.0.0-alpha.48",
|
33
|
+
"@operato/shell": "1.0.0-alpha.48",
|
34
|
+
"@operato/styles": "1.0.0-alpha.48",
|
35
|
+
"@operato/utils": "1.0.0-alpha.48",
|
36
|
+
"@things-factory/auth-base": "^5.0.0-alpha.27",
|
37
|
+
"@things-factory/env": "^5.0.0-alpha.27",
|
38
|
+
"@things-factory/shell": "^5.0.0-alpha.27",
|
39
|
+
"@things-factory/work-shift": "^5.0.0-alpha.27",
|
40
40
|
"moment": "^2.29.1"
|
41
41
|
},
|
42
|
-
"gitHead": "
|
42
|
+
"gitHead": "57962482d2b5a5aaba07d7477f3f35938d6e66b8"
|
43
43
|
}
|
@@ -94,7 +94,7 @@ export async function createDataSample(
|
|
94
94
|
})
|
95
95
|
|
96
96
|
const { ooc, oos } = DataUseCase.evaluate(dataSet, dataItems, dataSample.data) || {}
|
97
|
-
const { workDate, workShift } = getWorkDateAndShift(domain, collectedAt)
|
97
|
+
const { workDate, workShift } = await getWorkDateAndShift(domain, collectedAt)
|
98
98
|
|
99
99
|
const result = await tx.getRepository(DataSample).save({
|
100
100
|
name: dataSet.name,
|
package/things-factory.config.js
CHANGED
@@ -5,20 +5,24 @@ export default {
|
|
5
5
|
route,
|
6
6
|
routes: [
|
7
7
|
{
|
8
|
-
tagname: 'data-set-page',
|
9
|
-
page: 'data-set'
|
8
|
+
tagname: 'data-set-list-page',
|
9
|
+
page: 'data-set-list'
|
10
10
|
},
|
11
11
|
{
|
12
|
-
tagname: 'data-sensor-page',
|
13
|
-
page: 'data-sensor'
|
12
|
+
tagname: 'data-sensor-list-page',
|
13
|
+
page: 'data-sensor-list'
|
14
14
|
},
|
15
15
|
{
|
16
|
-
tagname: 'data-sample-page',
|
17
|
-
page: 'data-sample'
|
16
|
+
tagname: 'data-sample-list-page',
|
17
|
+
page: 'data-sample-list'
|
18
18
|
},
|
19
19
|
{
|
20
|
-
tagname: 'data-ooc-page',
|
21
|
-
page: 'data-ooc'
|
20
|
+
tagname: 'data-ooc-list-page',
|
21
|
+
page: 'data-ooc-list'
|
22
|
+
},
|
23
|
+
{
|
24
|
+
tagname: 'data-entry-list-page',
|
25
|
+
page: 'data-entry-list'
|
22
26
|
}
|
23
27
|
],
|
24
28
|
bootstrap
|
package/translations/en.json
CHANGED
@@ -30,6 +30,7 @@
|
|
30
30
|
"text.data sample created successfully": "a data sample created successfully",
|
31
31
|
"text.data ooc updated successfully": "a data ooc updated successfully",
|
32
32
|
"title.data-entry-form": "data entry form",
|
33
|
+
"title.data-entry list": "data entry list",
|
33
34
|
"title.data-item list": "data item list",
|
34
35
|
"title.data-ooc list": "data OOC list",
|
35
36
|
"title.data-ooc view": "data OOC view",
|
@@ -37,4 +38,4 @@
|
|
37
38
|
"title.data-sample view": "data sample view",
|
38
39
|
"title.data-sensor list": "data sensor list",
|
39
40
|
"title.data-set list": "data set list"
|
40
|
-
}
|
41
|
+
}
|