@things-factory/dataset 6.2.72 → 6.2.74

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 (29) hide show
  1. package/client/pages/data-ooc/data-ooc-view-page.ts +1 -1
  2. package/client/pages/data-sample/data-sample-view-page.ts +48 -0
  3. package/client/pages/data-set/data-set-list-page.ts +18 -1
  4. package/client/route.ts +4 -0
  5. package/dist-client/pages/data-ooc/data-ooc-view-page.js +1 -1
  6. package/dist-client/pages/data-ooc/data-ooc-view-page.js.map +1 -1
  7. package/dist-client/pages/data-sample/data-sample-view-page.d.ts +17 -0
  8. package/dist-client/pages/data-sample/data-sample-view-page.js +50 -0
  9. package/dist-client/pages/data-sample/data-sample-view-page.js.map +1 -0
  10. package/dist-client/pages/data-set/data-set-list-page.js +18 -1
  11. package/dist-client/pages/data-set/data-set-list-page.js.map +1 -1
  12. package/dist-client/route.js +3 -0
  13. package/dist-client/route.js.map +1 -1
  14. package/dist-client/tsconfig.tsbuildinfo +1 -1
  15. package/dist-server/controllers/create-data-sample.js +12 -7
  16. package/dist-server/controllers/create-data-sample.js.map +1 -1
  17. package/dist-server/service/data-set/data-set-query.js +1 -1
  18. package/dist-server/service/data-set/data-set-query.js.map +1 -1
  19. package/dist-server/service/data-set/data-set-type.js +8 -0
  20. package/dist-server/service/data-set/data-set-type.js.map +1 -1
  21. package/dist-server/service/data-set/data-set.js +5 -0
  22. package/dist-server/service/data-set/data-set.js.map +1 -1
  23. package/dist-server/tsconfig.tsbuildinfo +1 -1
  24. package/package.json +5 -5
  25. package/server/controllers/create-data-sample.ts +13 -8
  26. package/server/service/data-set/data-set-query.ts +1 -1
  27. package/server/service/data-set/data-set-type.ts +6 -0
  28. package/server/service/data-set/data-set.ts +4 -0
  29. package/things-factory.config.js +4 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/dataset",
3
- "version": "6.2.72",
3
+ "version": "6.2.74",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "dist-client/index.js",
6
6
  "things-factory": true,
@@ -39,17 +39,17 @@
39
39
  "@operato/utils": "^1.0.1",
40
40
  "@things-factory/auth-base": "^6.2.70",
41
41
  "@things-factory/aws-base": "^6.2.70",
42
- "@things-factory/board-service": "^6.2.70",
42
+ "@things-factory/board-service": "^6.2.73",
43
43
  "@things-factory/env": "^6.2.33",
44
- "@things-factory/organization": "^6.2.71",
44
+ "@things-factory/organization": "^6.2.73",
45
45
  "@things-factory/scheduler-client": "^6.2.70",
46
46
  "@things-factory/shell": "^6.2.70",
47
47
  "@things-factory/work-shift": "^6.2.70",
48
- "@things-factory/worklist": "^6.2.71",
48
+ "@things-factory/worklist": "^6.2.74",
49
49
  "cron-parser": "^4.3.0",
50
50
  "moment-timezone": "^0.5.40",
51
51
  "simple-statistics": "^7.8.3",
52
52
  "statistics": "^3.3.0"
53
53
  },
54
- "gitHead": "c7a65f34520199ca43fdc75749924799d7952747"
54
+ "gitHead": "01e9406e03162997a53ab93747c1a3b66544b4cf"
55
55
  }
@@ -62,7 +62,7 @@ export async function createDataSample(dataSample: NewDataSample, context: Resol
62
62
  relations: ['dataKeySet']
63
63
  })
64
64
 
65
- const dataItems = dataSet.dataItems
65
+ const { dataItems, tag: publishTag } = dataSet
66
66
  const collectedAt = dataSample.collectedAt || new Date()
67
67
 
68
68
  const timezone = dataSet.timezone || domain.timezone || 'UTC'
@@ -184,6 +184,16 @@ export async function createDataSample(dataSample: NewDataSample, context: Resol
184
184
  updater: user
185
185
  })
186
186
 
187
+ if (publishTag) {
188
+ pubsub.publish('data', {
189
+ data: {
190
+ domain,
191
+ tag: publishTag,
192
+ data
193
+ }
194
+ })
195
+ }
196
+
187
197
  /* post-process for for file attachment. */
188
198
  if (attachments.length > 0) {
189
199
  attachments.forEach(attachment => (attachment.refId = result.id))
@@ -274,7 +284,7 @@ export async function createDataSample(dataSample: NewDataSample, context: Resol
274
284
 
275
285
  const assignees = dataSet.supervisoryRoleId ? [{ type: 'Role', value: dataSet.supervisoryRoleId, assignee }] : []
276
286
 
277
- /* 해당 dataset의 supervisor로 하여금, data를 리뷰하고 instruction을 작성해서, approvalLine을 이용 해서 승인을 한다. */
287
+ /* 해당 dataset의 supervisor로 하여금, data를 리뷰하고 instruction을 작성해서, approvalLine을 이용해서 승인을 한다. */
278
288
  if (assignees && assignees instanceof Array && assignees.length > 0) {
279
289
  result.dataItems = dataItems
280
290
  const activityInstance = {
@@ -292,18 +302,13 @@ export async function createDataSample(dataSample: NewDataSample, context: Resol
292
302
  await issue(activityInstance, context)
293
303
 
294
304
  try {
295
- pubsub.publish('data-set', {
296
- dataSet,
297
- supervisoryRoleId: dataSet.supervisoryRoleId
298
- })
299
-
300
305
  pubsub.publish('notification', {
301
306
  notification: {
302
307
  domain,
303
308
  type: 'info',
304
309
  title: `[Data Review] ${dataSet.name}`,
305
310
  body: `Data Review occurred on '${dataSet.name}'`,
306
- url: getRedirectSubdomainPath(context, domain.subdomain, `/data-set/${dataSet.id}`),
311
+ url: getRedirectSubdomainPath(context, domain.subdomain, `/data-sample/${result.id}`),
307
312
  timestamp: collectedAt
308
313
  }
309
314
  })
@@ -48,7 +48,7 @@ export class DataSetQuery {
48
48
  params,
49
49
  domain,
50
50
  alias: 'dataset',
51
- searchables: ['name', 'description', 'supervisoryRole']
51
+ searchables: ['name', 'description', 'tag', 'supervisoryRole']
52
52
  })
53
53
 
54
54
  const [items, total] = await queryBuilder.getManyAndCount()
@@ -17,6 +17,9 @@ export class NewDataSet {
17
17
  @Field({ nullable: true })
18
18
  description?: string
19
19
 
20
+ @Field({ nullable: true, description: 'A tag name of data to be published when a data sample created' })
21
+ tag?: string
22
+
20
23
  @Field(type => ObjectRef, { nullable: true })
21
24
  dataKeySet?: ObjectRef
22
25
 
@@ -95,6 +98,9 @@ export class DataSetPatch {
95
98
  @Field({ nullable: true })
96
99
  description?: string
97
100
 
101
+ @Field({ nullable: true, description: 'A tag name of data to be published when a data sample created' })
102
+ tag?: string
103
+
98
104
  @Field(type => ObjectRef, { nullable: true })
99
105
  dataKeySet?: ObjectRef
100
106
 
@@ -113,6 +113,10 @@ export class DataSet {
113
113
  @Field({ nullable: true, description: 'A description of the dataset' })
114
114
  description?: string
115
115
 
116
+ @Column({ nullable: true })
117
+ @Field({ nullable: true, description: 'A tag name of data to be published when a data sample created' })
118
+ tag?: string
119
+
116
120
  @VersionColumn({ nullable: true, default: 1 })
117
121
  @Field({ nullable: true, description: 'The version of the dataset' })
118
122
  version?: number = 1
@@ -12,6 +12,10 @@ export default {
12
12
  tagname: 'data-sensor-list-page',
13
13
  page: 'data-sensor-list'
14
14
  },
15
+ {
16
+ tagname: 'data-sample-view-page',
17
+ page: 'data-sample'
18
+ },
15
19
  {
16
20
  tagname: 'data-sample-list-page',
17
21
  page: 'data-sample-list'