@things-factory/dataset 6.2.58 → 6.2.59

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/dataset",
3
- "version": "6.2.58",
3
+ "version": "6.2.59",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "dist-client/index.js",
6
6
  "things-factory": true,
@@ -51,5 +51,5 @@
51
51
  "simple-statistics": "^7.8.3",
52
52
  "statistics": "^3.3.0"
53
53
  },
54
- "gitHead": "decd44e000e44941409b829d72e99c49cb1829bf"
54
+ "gitHead": "44f0d0609b8db32e387059256d3852c8ec4856ee"
55
55
  }
@@ -229,8 +229,7 @@ export async function createDataSample(dataSample: NewDataSample, context: Resol
229
229
  dataOocId: dataOoc.id
230
230
  },
231
231
  assignees,
232
- approvalLine: [],
233
- outlierApprovalLine: []
232
+ approvalLine: []
234
233
  }
235
234
 
236
235
  await issue(activityInstance, context)
@@ -275,7 +274,7 @@ export async function createDataSample(dataSample: NewDataSample, context: Resol
275
274
 
276
275
  const assignees = dataSet.supervisoryRoleId ? [{ type: 'Role', value: dataSet.supervisoryRoleId, assignee }] : []
277
276
 
278
- /* 해당 dataset의 supervisor로 하여금, OOC를 리뷰하고 instruction을 작성해서, OOC 해결을 위한 태스크를 dataset assignees에게 지시하도록 한다. */
277
+ /* 해당 dataset의 supervisor로 하여금, data를 리뷰하고 instruction을 작성해서, approvalLine을 이용 해서 승인을 한다. */
279
278
  if (assignees && assignees instanceof Array && assignees.length > 0) {
280
279
  result.dataItems = dataItems
281
280
  const activityInstance = {
@@ -287,11 +286,30 @@ export async function createDataSample(dataSample: NewDataSample, context: Resol
287
286
  dataSample: result
288
287
  },
289
288
  assignees,
290
- approvalLine: [],
291
- outlierApprovalLine: []
289
+ approvalLine: dataSet.reviewApprovalLine
292
290
  }
293
291
 
294
292
  await issue(activityInstance, context)
293
+
294
+ try {
295
+ pubsub.publish('data-set', {
296
+ dataSet,
297
+ supervisoryRoleId: dataSet.supervisoryRoleId
298
+ })
299
+
300
+ pubsub.publish('notification', {
301
+ notification: {
302
+ domain,
303
+ type: 'info',
304
+ title: `[Data Review] ${dataSet.name}`,
305
+ body: `Data Review occurred on '${dataSet.name}'`,
306
+ url: getRedirectSubdomainPath(context, domain.subdomain, `/data-set/${dataSet.id}`),
307
+ timestamp: collectedAt
308
+ }
309
+ })
310
+ } catch (err) {
311
+ logger.error('Notification', err)
312
+ }
295
313
  } else {
296
314
  console.error(
297
315
  `Assignees are not set. So Data Review task for ${dataSet.name}(${dataSet.id}) could not be issued.`
@@ -300,26 +318,6 @@ export async function createDataSample(dataSample: NewDataSample, context: Resol
300
318
  } else {
301
319
  console.error('Data Review Activity not installed.')
302
320
  }
303
-
304
- try {
305
- pubsub.publish('data-set', {
306
- dataSet,
307
- supervisoryRoleId: dataSet.supervisoryRoleId
308
- })
309
-
310
- pubsub.publish('notification', {
311
- notification: {
312
- domain,
313
- type: 'info',
314
- title: `[Data Review] ${dataSet.name}`,
315
- body: `Data Review occurred on '${dataSet.name}'`,
316
- url: getRedirectSubdomainPath(context, domain.subdomain, `/data-set/${dataSet.id}`),
317
- timestamp: collectedAt
318
- }
319
- })
320
- } catch (err) {
321
- logger.error('Notification', err)
322
- }
323
321
  }
324
322
 
325
323
  return result