@things-factory/dataset 6.0.39 → 6.0.41

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.0.39",
3
+ "version": "6.0.41",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "dist-client/index.js",
6
6
  "things-factory": true,
@@ -39,13 +39,13 @@
39
39
  "@things-factory/aws-base": "^6.0.34",
40
40
  "@things-factory/board-service": "^6.0.34",
41
41
  "@things-factory/env": "^6.0.34",
42
- "@things-factory/organization": "^6.0.39",
42
+ "@things-factory/organization": "^6.0.40",
43
43
  "@things-factory/scheduler-client": "^6.0.35",
44
44
  "@things-factory/shell": "^6.0.34",
45
45
  "@things-factory/work-shift": "^6.0.34",
46
- "@things-factory/worklist": "^6.0.39",
46
+ "@things-factory/worklist": "^6.0.41",
47
47
  "cron-parser": "^4.3.0",
48
48
  "moment-timezone": "^0.5.40"
49
49
  },
50
- "gitHead": "0785dcb60e33faa110e9d6056909384c4f50b7bf"
50
+ "gitHead": "781f8ef2c026fc38c7485eaa6bd51367fbe7ec09"
51
51
  }
@@ -38,6 +38,7 @@ export const ActivityDataCollect = {
38
38
  provider: 'hatiolab.com',
39
39
  category: 'quality',
40
40
  activityType: 'user',
41
+ priority: 1,
41
42
  searchKeys: [
42
43
  {
43
44
  name: 'dataSetName',
@@ -55,6 +55,7 @@ export const ActivityOocResolve = {
55
55
  provider: 'hatiolab.com',
56
56
  category: 'quality',
57
57
  activityType: 'user',
58
+ priority: 3,
58
59
  searchKeys: [
59
60
  {
60
61
  name: 'dataOocId',
@@ -72,6 +72,7 @@ export const ActivityOocReview = {
72
72
  provider: 'hatiolab.com',
73
73
  category: 'quality',
74
74
  activityType: 'user',
75
+ priority: 2,
75
76
  searchKeys: [
76
77
  {
77
78
  name: 'dataOocId',
@@ -4,6 +4,7 @@ import { Attachment } from '@things-factory/attachment-base'
4
4
  import { Role, User } from '@things-factory/auth-base'
5
5
  import { Board } from '@things-factory/board-service'
6
6
  import { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'
7
+ import { ApprovalLineItem } from '@things-factory/organization'
7
8
 
8
9
  import { DataKeySet } from '../data-key-set/data-key-set'
9
10
  import { DataSample } from '../data-sample/data-sample'
@@ -165,6 +166,46 @@ export class DataSetQuery {
165
166
  )
166
167
  }
167
168
 
169
+ @FieldResolver(type => [ApprovalLineItem])
170
+ async approvalLine(@Root() dataSet: DataSet, @Ctx() context: ResolverContext): Promise<ApprovalLineItem[]> {
171
+ const { domain, user } = context.state
172
+ const { approvalLine } = dataSet
173
+
174
+ if (!approvalLine || !(approvalLine instanceof Array)) {
175
+ return null
176
+ }
177
+
178
+ var approvalLineItems = []
179
+
180
+ for (let item of approvalLine) {
181
+ var { type, value: id } = item
182
+ var approver
183
+
184
+ switch (type) {
185
+ case 'Employee':
186
+ approver = id && (await getRepository('Employee').findOneBy({ domain: { id: domain.id }, id }))
187
+ break
188
+ case 'Department':
189
+ approver = id && (await getRepository('Department').findOneBy({ domain: { id: domain.id }, id }))
190
+ break
191
+ case 'Role':
192
+ approver = id && (await getRepository('Role').findOneBy({ domain: { id: domain.id }, id }))
193
+ break
194
+ case 'Myself':
195
+ approver = user
196
+ break
197
+ case 'MyDepartment':
198
+ case 'MySupervisor':
199
+ break
200
+ default:
201
+ }
202
+
203
+ id ? approvalLineItems.push({ type, value: id, approver }) : approvalLineItems.push({ type })
204
+ }
205
+
206
+ return approvalLineItems
207
+ }
208
+
168
209
  @FieldResolver(type => Board, { nullable: true })
169
210
  async entryBoard(@Root() dataSet: DataSet) {
170
211
  if (dataSet.entryType == 'board' && dataSet.entryView) {
@@ -98,6 +98,7 @@
98
98
  "title.edit json": "edit json",
99
99
  "title.open data sample report page": "open data sample report page",
100
100
  "title.open data sample search page": "open data sample search page",
101
+ "title.open data sample view": "open data sample view",
101
102
  "title.ready": "ready",
102
103
  "title.view detail ooc data": "view detail ooc data"
103
104
  }