@things-factory/worklist 5.0.7 → 5.0.13
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/{bootstrap.js → bootstrap.ts} +0 -0
- package/client/components/activity-/bowner-view.js +0 -1
- package/client/components/activity-instance-preview.js +1 -2
- package/client/components/{activity-intro-view.js → activity-intro-view.ts} +29 -42
- package/client/components/activity-reporter-view.js +0 -1
- package/client/components/activity-starter-form.js +2 -3
- package/client/{index.js → index.ts} +0 -0
- package/client/pages/activity/{activity-list-page.js → activity-list-page.ts} +26 -36
- package/client/pages/activity/activity-model-item-list.js +4 -1
- package/client/pages/activity/activity-page.js +2 -3
- package/client/pages/activity/starter-list-page.js +1 -1
- package/client/pages/activity-instance/activity-instance-list-page.js +1 -1
- package/client/pages/activity-instance/activity-instance-page.js +2 -2
- package/client/pages/activity-store/activity-store-page.js +1 -1
- package/client/pages/activity-supervisor/reporter-list-page.js +1 -1
- package/client/pages/activity-template/activity-template-list-page.js +1 -1
- package/client/pages/activity-thread/activity-thread-list-page.js +1 -1
- package/client/pages/activity-thread/activity-thread-page.js +2 -2
- package/client/pages/todo/assigned-list-page.js +1 -1
- package/client/pages/todo/draft-list-page.js +4 -2
- package/client/pages/todo/pickable-list-page.js +2 -2
- package/client/pages/todo/todo-list-page.js +2 -2
- package/client/pages/{worklist-home.js → worklist-home.ts} +2 -6
- package/client/{route.js → route.ts} +1 -1
- package/client/tsconfig.json +11 -0
- package/dist-client/bootstrap.d.ts +1 -0
- package/dist-client/bootstrap.js +12 -0
- package/dist-client/bootstrap.js.map +1 -0
- package/dist-client/components/activity-/bowner-view.d.ts +1 -0
- package/dist-client/components/activity-/bowner-view.js +96 -0
- package/dist-client/components/activity-/bowner-view.js.map +1 -0
- package/dist-client/components/activity-instance-preview.d.ts +1 -0
- package/dist-client/components/activity-instance-preview.js +180 -0
- package/dist-client/components/activity-instance-preview.js.map +1 -0
- package/dist-client/components/activity-intro-view.d.ts +1 -0
- package/dist-client/components/activity-intro-view.js +104 -0
- package/dist-client/components/activity-intro-view.js.map +1 -0
- package/dist-client/components/activity-reporter-view.d.ts +1 -0
- package/dist-client/components/activity-reporter-view.js +96 -0
- package/dist-client/components/activity-reporter-view.js.map +1 -0
- package/dist-client/components/activity-starter-form.d.ts +1 -0
- package/dist-client/components/activity-starter-form.js +293 -0
- package/dist-client/components/activity-starter-form.js.map +1 -0
- package/dist-client/index.d.ts +1 -0
- package/dist-client/index.js +2 -0
- package/dist-client/index.js.map +1 -0
- package/dist-client/pages/activity/activity-list-page.d.ts +47 -0
- package/dist-client/pages/activity/activity-list-page.js +479 -0
- package/dist-client/pages/activity/activity-list-page.js.map +1 -0
- package/dist-client/pages/activity/activity-model-item-list.d.ts +194 -0
- package/dist-client/pages/activity/activity-model-item-list.js +288 -0
- package/dist-client/pages/activity/activity-model-item-list.js.map +1 -0
- package/dist-client/pages/activity/activity-page.d.ts +49 -0
- package/dist-client/pages/activity/activity-page.js +367 -0
- package/dist-client/pages/activity/activity-page.js.map +1 -0
- package/dist-client/pages/activity/starter-list-page.d.ts +143 -0
- package/dist-client/pages/activity/starter-list-page.js +209 -0
- package/dist-client/pages/activity/starter-list-page.js.map +1 -0
- package/dist-client/pages/activity-instance/activity-instance-list-page.d.ts +137 -0
- package/dist-client/pages/activity-instance/activity-instance-list-page.js +202 -0
- package/dist-client/pages/activity-instance/activity-instance-list-page.js.map +1 -0
- package/dist-client/pages/activity-instance/activity-instance-page.d.ts +49 -0
- package/dist-client/pages/activity-instance/activity-instance-page.js +365 -0
- package/dist-client/pages/activity-instance/activity-instance-page.js.map +1 -0
- package/dist-client/pages/activity-store/activity-store-page.d.ts +174 -0
- package/dist-client/pages/activity-store/activity-store-page.js +211 -0
- package/dist-client/pages/activity-store/activity-store-page.js.map +1 -0
- package/dist-client/pages/activity-supervisor/reporter-list-page.d.ts +143 -0
- package/dist-client/pages/activity-supervisor/reporter-list-page.js +209 -0
- package/dist-client/pages/activity-supervisor/reporter-list-page.js.map +1 -0
- package/dist-client/pages/activity-template/activity-template-importer.d.ts +24 -0
- package/dist-client/pages/activity-template/activity-template-importer.js +98 -0
- package/dist-client/pages/activity-template/activity-template-importer.js.map +1 -0
- package/dist-client/pages/activity-template/activity-template-list-page.d.ts +263 -0
- package/dist-client/pages/activity-template/activity-template-list-page.js +402 -0
- package/dist-client/pages/activity-template/activity-template-list-page.js.map +1 -0
- package/dist-client/pages/activity-template/activity-template-model-item-list.d.ts +1 -0
- package/dist-client/pages/activity-template/activity-template-model-item-list.js +36 -0
- package/dist-client/pages/activity-template/activity-template-model-item-list.js.map +1 -0
- package/dist-client/pages/activity-thread/activity-thread-importer.d.ts +24 -0
- package/dist-client/pages/activity-thread/activity-thread-importer.js +98 -0
- package/dist-client/pages/activity-thread/activity-thread-importer.js.map +1 -0
- package/dist-client/pages/activity-thread/activity-thread-list-page.d.ts +145 -0
- package/dist-client/pages/activity-thread/activity-thread-list-page.js +284 -0
- package/dist-client/pages/activity-thread/activity-thread-list-page.js.map +1 -0
- package/dist-client/pages/activity-thread/activity-thread-page.d.ts +46 -0
- package/dist-client/pages/activity-thread/activity-thread-page.js +331 -0
- package/dist-client/pages/activity-thread/activity-thread-page.js.map +1 -0
- package/dist-client/pages/dashboard/dashboard-home.d.ts +1 -0
- package/dist-client/pages/dashboard/dashboard-home.js +17 -0
- package/dist-client/pages/dashboard/dashboard-home.js.map +1 -0
- package/dist-client/pages/todo/assigned-list-page.d.ts +124 -0
- package/dist-client/pages/todo/assigned-list-page.js +233 -0
- package/dist-client/pages/todo/assigned-list-page.js.map +1 -0
- package/dist-client/pages/todo/draft-list-page.d.ts +198 -0
- package/dist-client/pages/todo/draft-list-page.js +312 -0
- package/dist-client/pages/todo/draft-list-page.js.map +1 -0
- package/dist-client/pages/todo/pickable-list-page.d.ts +150 -0
- package/dist-client/pages/todo/pickable-list-page.js +260 -0
- package/dist-client/pages/todo/pickable-list-page.js.map +1 -0
- package/dist-client/pages/todo/todo-list-page.d.ts +232 -0
- package/dist-client/pages/todo/todo-list-page.js +333 -0
- package/dist-client/pages/todo/todo-list-page.js.map +1 -0
- package/dist-client/pages/worklist-home.d.ts +1 -0
- package/dist-client/pages/worklist-home.js +18 -0
- package/dist-client/pages/worklist-home.js.map +1 -0
- package/dist-client/route.d.ts +1 -0
- package/dist-client/route.js +53 -0
- package/dist-client/route.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -0
- package/dist-client/types.d.ts +19 -0
- package/dist-client/types.js +37 -0
- package/dist-client/types.js.map +1 -0
- package/dist-server/controllers/activity-extension-controller.js.map +1 -1
- package/dist-server/controllers/activity-instance/abort.js +4 -5
- package/dist-server/controllers/activity-instance/abort.js.map +1 -1
- package/dist-server/controllers/activity-instance/adjust.js +3 -2
- package/dist-server/controllers/activity-instance/adjust.js.map +1 -1
- package/dist-server/controllers/activity-instance/assign.js +9 -25
- package/dist-server/controllers/activity-instance/assign.js.map +1 -1
- package/dist-server/controllers/activity-instance/delegate.js +5 -6
- package/dist-server/controllers/activity-instance/delegate.js.map +1 -1
- package/dist-server/controllers/activity-instance/draft.js +6 -7
- package/dist-server/controllers/activity-instance/draft.js.map +1 -1
- package/dist-server/controllers/activity-instance/end.js +5 -6
- package/dist-server/controllers/activity-instance/end.js.map +1 -1
- package/dist-server/controllers/activity-instance/index.js +11 -24
- package/dist-server/controllers/activity-instance/index.js.map +1 -1
- package/dist-server/controllers/activity-instance/pick.js +6 -6
- package/dist-server/controllers/activity-instance/pick.js.map +1 -1
- package/dist-server/controllers/activity-instance/post.js +10 -6
- package/dist-server/controllers/activity-instance/post.js.map +1 -1
- package/dist-server/controllers/activity-instance/start.js +3 -2
- package/dist-server/controllers/activity-instance/start.js.map +1 -1
- package/dist-server/controllers/activity-instance/terminate.js +5 -6
- package/dist-server/controllers/activity-instance/terminate.js.map +1 -1
- package/dist-server/controllers/activity-thread/abort.js +3 -4
- package/dist-server/controllers/activity-thread/abort.js.map +1 -1
- package/dist-server/controllers/activity-thread/adjust.js +2 -1
- package/dist-server/controllers/activity-thread/adjust.js.map +1 -1
- package/dist-server/controllers/activity-thread/delegate.js +4 -5
- package/dist-server/controllers/activity-thread/delegate.js.map +1 -1
- package/dist-server/controllers/activity-thread/end.js +4 -5
- package/dist-server/controllers/activity-thread/end.js.map +1 -1
- package/dist-server/controllers/activity-thread/index.js +8 -21
- package/dist-server/controllers/activity-thread/index.js.map +1 -1
- package/dist-server/controllers/activity-thread/save.js +2 -1
- package/dist-server/controllers/activity-thread/save.js.map +1 -1
- package/dist-server/controllers/activity-thread/start.js +4 -5
- package/dist-server/controllers/activity-thread/start.js.map +1 -1
- package/dist-server/controllers/activity-thread/terminate.js +3 -4
- package/dist-server/controllers/activity-thread/terminate.js.map +1 -1
- package/dist-server/controllers/common.js +23 -6
- package/dist-server/controllers/common.js.map +1 -1
- package/dist-server/controllers/index.js.map +1 -1
- package/dist-server/index.js +4 -17
- package/dist-server/index.js.map +1 -1
- package/dist-server/middlewares/index.js.map +1 -1
- package/dist-server/migrations/index.js.map +1 -1
- package/dist-server/routes.js +0 -1
- package/dist-server/routes.js.map +1 -1
- package/dist-server/service/activity/activity-history.js +68 -76
- package/dist-server/service/activity/activity-history.js.map +1 -1
- package/dist-server/service/activity/activity-model-type.js +51 -60
- package/dist-server/service/activity/activity-model-type.js.map +1 -1
- package/dist-server/service/activity/activity-mutation.js +39 -50
- package/dist-server/service/activity/activity-mutation.js.map +1 -1
- package/dist-server/service/activity/activity-query.js +61 -72
- package/dist-server/service/activity/activity-query.js.map +1 -1
- package/dist-server/service/activity/activity-type.js +91 -102
- package/dist-server/service/activity/activity-type.js.map +1 -1
- package/dist-server/service/activity/activity.js +68 -76
- package/dist-server/service/activity/activity.js.map +1 -1
- package/dist-server/service/activity/event-subscriber.js +2 -7
- package/dist-server/service/activity/event-subscriber.js.map +1 -1
- package/dist-server/service/activity/index.js.map +1 -1
- package/dist-server/service/activity-instance/activity-instance-history.js +81 -89
- package/dist-server/service/activity-instance/activity-instance-history.js.map +1 -1
- package/dist-server/service/activity-instance/activity-instance-mutation.js +71 -85
- package/dist-server/service/activity-instance/activity-instance-mutation.js.map +1 -1
- package/dist-server/service/activity-instance/activity-instance-query.js +67 -78
- package/dist-server/service/activity-instance/activity-instance-query.js.map +1 -1
- package/dist-server/service/activity-instance/activity-instance-subscription.js +8 -21
- package/dist-server/service/activity-instance/activity-instance-subscription.js.map +1 -1
- package/dist-server/service/activity-instance/activity-instance-type.js +106 -106
- package/dist-server/service/activity-instance/activity-instance-type.js.map +1 -1
- package/dist-server/service/activity-instance/activity-instance.js +85 -93
- package/dist-server/service/activity-instance/activity-instance.js.map +1 -1
- package/dist-server/service/activity-instance/event-subscriber.js +3 -8
- package/dist-server/service/activity-instance/event-subscriber.js.map +1 -1
- package/dist-server/service/activity-instance/index.js.map +1 -1
- package/dist-server/service/activity-template/activity-template-history.js +50 -58
- package/dist-server/service/activity-template/activity-template-history.js.map +1 -1
- package/dist-server/service/activity-template/activity-template-mutation.js +39 -50
- package/dist-server/service/activity-template/activity-template-mutation.js.map +1 -1
- package/dist-server/service/activity-template/activity-template-query.js +48 -45
- package/dist-server/service/activity-template/activity-template-query.js.map +1 -1
- package/dist-server/service/activity-template/activity-template-type.js +65 -76
- package/dist-server/service/activity-template/activity-template-type.js.map +1 -1
- package/dist-server/service/activity-template/activity-template.js +48 -56
- package/dist-server/service/activity-template/activity-template.js.map +1 -1
- package/dist-server/service/activity-template/event-subscriber.js +2 -7
- package/dist-server/service/activity-template/event-subscriber.js.map +1 -1
- package/dist-server/service/activity-template/index.js.map +1 -1
- package/dist-server/service/activity-thread/activity-thread-mutation.js +84 -95
- package/dist-server/service/activity-thread/activity-thread-mutation.js.map +1 -1
- package/dist-server/service/activity-thread/activity-thread-query.js +45 -56
- package/dist-server/service/activity-thread/activity-thread-query.js.map +1 -1
- package/dist-server/service/activity-thread/activity-thread-subscription.js +7 -20
- package/dist-server/service/activity-thread/activity-thread-subscription.js.map +1 -1
- package/dist-server/service/activity-thread/activity-thread-type.js +25 -34
- package/dist-server/service/activity-thread/activity-thread-type.js.map +1 -1
- package/dist-server/service/activity-thread/activity-thread.js +43 -51
- package/dist-server/service/activity-thread/activity-thread.js.map +1 -1
- package/dist-server/service/activity-thread/event-subscriber.js +5 -10
- package/dist-server/service/activity-thread/event-subscriber.js.map +1 -1
- package/dist-server/service/activity-thread/index.js.map +1 -1
- package/dist-server/service/index.js +5 -18
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/package.json +13 -11
- package/server/controllers/activity-instance/abort.ts +5 -10
- package/server/controllers/activity-instance/adjust.ts +5 -7
- package/server/controllers/activity-instance/assign.ts +13 -45
- package/server/controllers/activity-instance/delegate.ts +6 -8
- package/server/controllers/activity-instance/draft.ts +7 -13
- package/server/controllers/activity-instance/end.ts +6 -9
- package/server/controllers/activity-instance/pick.ts +12 -9
- package/server/controllers/activity-instance/post.ts +14 -12
- package/server/controllers/activity-instance/start.ts +5 -3
- package/server/controllers/activity-instance/terminate.ts +6 -8
- package/server/controllers/activity-thread/abort.ts +3 -9
- package/server/controllers/activity-thread/adjust.ts +3 -6
- package/server/controllers/activity-thread/delegate.ts +4 -7
- package/server/controllers/activity-thread/end.ts +4 -7
- package/server/controllers/activity-thread/save.ts +3 -6
- package/server/controllers/activity-thread/start.ts +4 -11
- package/server/controllers/activity-thread/terminate.ts +3 -7
- package/server/controllers/common.ts +33 -14
- package/server/routes.ts +0 -2
- package/server/service/activity/activity-model-type.ts +4 -4
- package/server/service/activity-instance/activity-instance-history.ts +2 -2
- package/server/service/activity-instance/activity-instance-mutation.ts +11 -15
- package/server/service/activity-instance/activity-instance-subscription.ts +1 -5
- package/server/service/activity-instance/activity-instance-type.ts +17 -11
- package/server/service/activity-instance/activity-instance.ts +2 -2
- package/server/service/activity-template/activity-template-query.ts +10 -0
- package/server/service/activity-thread/activity-thread-mutation.ts +7 -7
- package/server/service/activity-thread/activity-thread-subscription.ts +0 -4
- package/server/service/activity-thread/activity-thread-type.ts +1 -1
- package/server/service/activity-thread/activity-thread.ts +1 -1
- package/server/service/activity-thread/event-subscriber.ts +3 -3
- package/server/tsconfig.json +10 -0
- package/things-factory.config.js +2 -2
- package/tsconfig.json +0 -9
|
@@ -54,7 +54,7 @@ export class ActivityModelItem {
|
|
|
54
54
|
type?: ActivityModelItemType
|
|
55
55
|
|
|
56
56
|
@Field(type => ScalarObject, { nullable: true })
|
|
57
|
-
options?:
|
|
57
|
+
options?: { [option: string]: any }
|
|
58
58
|
|
|
59
59
|
@Field({ nullable: true })
|
|
60
60
|
unit?: string
|
|
@@ -63,7 +63,7 @@ export class ActivityModelItem {
|
|
|
63
63
|
quantifier: number[]
|
|
64
64
|
|
|
65
65
|
@Field(type => ScalarObject, { nullable: true })
|
|
66
|
-
spec?:
|
|
66
|
+
spec?: { [key: string]: any }
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
@InputType()
|
|
@@ -84,7 +84,7 @@ export class ActivityModelItemPatch {
|
|
|
84
84
|
type?: ActivityModelItemType
|
|
85
85
|
|
|
86
86
|
@Field(type => ScalarObject, { nullable: true })
|
|
87
|
-
options?:
|
|
87
|
+
options?: { [option: string]: any }
|
|
88
88
|
|
|
89
89
|
@Field({ nullable: true })
|
|
90
90
|
unit?: string
|
|
@@ -102,5 +102,5 @@ export class ActivityModelItemPatch {
|
|
|
102
102
|
hidden?: boolean
|
|
103
103
|
|
|
104
104
|
@Field(type => ScalarObject, { nullable: true })
|
|
105
|
-
spec?:
|
|
105
|
+
spec?: { [key: string]: any }
|
|
106
106
|
}
|
|
@@ -101,11 +101,11 @@ export class ActivityInstanceHistory implements HistoryEntityInterface<ActivityI
|
|
|
101
101
|
|
|
102
102
|
@Column('simple-json', { nullable: true })
|
|
103
103
|
@Field(type => ScalarObject, { nullable: true })
|
|
104
|
-
input?:
|
|
104
|
+
input?: { [key: string]: any }
|
|
105
105
|
|
|
106
106
|
@Column('simple-json', { nullable: true })
|
|
107
107
|
@Field(type => ScalarObject, { nullable: true })
|
|
108
|
-
output?:
|
|
108
|
+
output?: { [key: string]: any }
|
|
109
109
|
|
|
110
110
|
@Column({ nullable: true })
|
|
111
111
|
@Field({ nullable: true })
|
|
@@ -7,8 +7,6 @@ import { ActivityThread } from '../activity-thread/activity-thread'
|
|
|
7
7
|
import { ActivityInstance } from './activity-instance'
|
|
8
8
|
import { ActivityInstancePatch, ActivityInstancePost, NewActivityInstance } from './activity-instance-type'
|
|
9
9
|
|
|
10
|
-
const debug = require('debug')('things-factory:worklist:activity-instance-mutation')
|
|
11
|
-
|
|
12
10
|
@Resolver(ActivityInstance)
|
|
13
11
|
export class ActivityInstanceMutation {
|
|
14
12
|
@Directive('@transaction')
|
|
@@ -17,7 +15,7 @@ export class ActivityInstanceMutation {
|
|
|
17
15
|
@Arg('activityInstance') activityInstance: NewActivityInstance,
|
|
18
16
|
@Ctx() context: any
|
|
19
17
|
): Promise<ActivityInstance> {
|
|
20
|
-
return await draft(activityInstance, context
|
|
18
|
+
return await draft(activityInstance, context)
|
|
21
19
|
}
|
|
22
20
|
|
|
23
21
|
@Directive('@transaction')
|
|
@@ -26,7 +24,7 @@ export class ActivityInstanceMutation {
|
|
|
26
24
|
@Arg('activityInstance') activityInstance: ActivityInstancePost,
|
|
27
25
|
@Ctx() context: any
|
|
28
26
|
): Promise<ActivityInstance> {
|
|
29
|
-
return await post(activityInstance, context
|
|
27
|
+
return await post(activityInstance, context)
|
|
30
28
|
}
|
|
31
29
|
|
|
32
30
|
@Directive('@transaction')
|
|
@@ -36,15 +34,14 @@ export class ActivityInstanceMutation {
|
|
|
36
34
|
'To pick an activity ActivityInstance voluntarily. [cautions] This resolver will return a assigned ActivityThread.'
|
|
37
35
|
})
|
|
38
36
|
async pickActivityInstance(@Arg('id') id: string, @Ctx() context: any): Promise<ActivityThread> {
|
|
39
|
-
return await pick(id, context
|
|
37
|
+
return await pick(id, context)
|
|
40
38
|
}
|
|
41
39
|
|
|
42
40
|
@Directive('@transaction')
|
|
43
41
|
@Mutation(returns => ActivityInstance, { description: 'To assign a ActivityInstance' })
|
|
44
42
|
async assignActivityInstance(
|
|
45
43
|
@Arg('id') id: string,
|
|
46
|
-
@Arg('
|
|
47
|
-
@Arg('supervisoryRole', { nullable: true }) supervisoryRole: string,
|
|
44
|
+
@Arg('assignees', type => [String], { nullable: true, description: 'Email of assignee users' }) assignees: string[],
|
|
48
45
|
@Arg('reason', { nullable: true }) reason: string,
|
|
49
46
|
@Arg('dueAt', { nullable: true }) dueAt: Date,
|
|
50
47
|
@Ctx() context: any
|
|
@@ -52,12 +49,11 @@ export class ActivityInstanceMutation {
|
|
|
52
49
|
return await assign(
|
|
53
50
|
{
|
|
54
51
|
id,
|
|
55
|
-
|
|
56
|
-
supervisoryRole,
|
|
52
|
+
assignees,
|
|
57
53
|
reason,
|
|
58
54
|
dueAt
|
|
59
55
|
},
|
|
60
|
-
context
|
|
56
|
+
context
|
|
61
57
|
)
|
|
62
58
|
}
|
|
63
59
|
|
|
@@ -68,7 +64,7 @@ export class ActivityInstanceMutation {
|
|
|
68
64
|
@Arg('patch') patch: ActivityInstancePatch,
|
|
69
65
|
@Ctx() context: any
|
|
70
66
|
): Promise<ActivityInstance> {
|
|
71
|
-
return await adjust(id, patch, context
|
|
67
|
+
return await adjust(id, patch, context)
|
|
72
68
|
}
|
|
73
69
|
|
|
74
70
|
@Directive('@transaction')
|
|
@@ -80,18 +76,18 @@ export class ActivityInstanceMutation {
|
|
|
80
76
|
@Arg('reason', { nullable: true }) reason: string,
|
|
81
77
|
@Ctx() context: any
|
|
82
78
|
): Promise<ActivityInstance> {
|
|
83
|
-
return await delegate({ id, assigneeRole, dueAt, reason }, context
|
|
79
|
+
return await delegate({ id, assigneeRole, dueAt, reason }, context)
|
|
84
80
|
}
|
|
85
81
|
|
|
86
82
|
@Directive('@transaction')
|
|
87
83
|
@Mutation(returns => ActivityInstance, { description: 'To end a ActivityInstance' })
|
|
88
84
|
async endActivityInstance(
|
|
89
85
|
@Arg('id') id: string,
|
|
90
|
-
@Arg('output', type => ScalarObject, { nullable: true }) output:
|
|
86
|
+
@Arg('output', type => ScalarObject, { nullable: true }) output: { [key: string]: any },
|
|
91
87
|
@Arg('reason', { nullable: true }) reason: string,
|
|
92
88
|
@Ctx() context: any
|
|
93
89
|
): Promise<ActivityInstance> {
|
|
94
|
-
return await end({ id, output, reason }, context
|
|
90
|
+
return await end({ id, output, reason }, context)
|
|
95
91
|
}
|
|
96
92
|
|
|
97
93
|
@Directive('@transaction')
|
|
@@ -101,6 +97,6 @@ export class ActivityInstanceMutation {
|
|
|
101
97
|
@Arg('reason', { nullable: true }) reason: string,
|
|
102
98
|
@Ctx() context: any
|
|
103
99
|
): Promise<ActivityInstance> {
|
|
104
|
-
return await abort({ id, reason }, context
|
|
100
|
+
return await abort({ id, reason }, context)
|
|
105
101
|
}
|
|
106
102
|
}
|
|
@@ -7,8 +7,6 @@ import { pubsub } from '@things-factory/shell'
|
|
|
7
7
|
|
|
8
8
|
import { ActivityInstance } from './activity-instance'
|
|
9
9
|
|
|
10
|
-
const debug = require('debug')('things-factory:worklist:activity-instance-subscription')
|
|
11
|
-
|
|
12
10
|
@Resolver(ActivityInstance)
|
|
13
11
|
export class ActivityInstanceSubscription {
|
|
14
12
|
@Subscription({
|
|
@@ -16,8 +14,6 @@ export class ActivityInstanceSubscription {
|
|
|
16
14
|
const { domain, user } = context.state
|
|
17
15
|
const subdomain = domain?.subdomain
|
|
18
16
|
|
|
19
|
-
debug('subscribe', subdomain)
|
|
20
|
-
|
|
21
17
|
if (!domain) {
|
|
22
18
|
throw new Error('domain required')
|
|
23
19
|
}
|
|
@@ -46,7 +42,7 @@ export class ActivityInstanceSubscription {
|
|
|
46
42
|
relations: ['roles']
|
|
47
43
|
})
|
|
48
44
|
|
|
49
|
-
return userWithRoles.roles.find(role => role.id === activityInstance.assigneeRoleId)
|
|
45
|
+
return !!userWithRoles.roles.find(role => role.id === activityInstance.assigneeRoleId)
|
|
50
46
|
}
|
|
51
47
|
)(_, args, context, info)
|
|
52
48
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Field, ID, InputType, Int, ObjectType } from 'type-graphql'
|
|
2
2
|
|
|
3
|
-
import { Role
|
|
3
|
+
import { Role } from '@things-factory/auth-base'
|
|
4
4
|
import { ObjectRef, ScalarDate, ScalarObject } from '@things-factory/shell'
|
|
5
5
|
|
|
6
6
|
import { ActivityType, ActivityUIType } from '../activity/activity'
|
|
@@ -12,7 +12,7 @@ export class NewActivityInstance {
|
|
|
12
12
|
name: string
|
|
13
13
|
|
|
14
14
|
@Field({ nullable: true })
|
|
15
|
-
activityId
|
|
15
|
+
activityId: string
|
|
16
16
|
|
|
17
17
|
@Field({ nullable: true })
|
|
18
18
|
description?: string
|
|
@@ -30,10 +30,10 @@ export class NewActivityInstance {
|
|
|
30
30
|
threadsMax?: number
|
|
31
31
|
|
|
32
32
|
@Field(type => ScalarDate, { nullable: true })
|
|
33
|
-
dueAt?:
|
|
33
|
+
dueAt?: Date
|
|
34
34
|
|
|
35
35
|
@Field(type => ScalarObject, { nullable: true })
|
|
36
|
-
input?:
|
|
36
|
+
input?: { [key: string]: any }
|
|
37
37
|
|
|
38
38
|
@Field({ nullable: true })
|
|
39
39
|
adhocType?: string
|
|
@@ -84,10 +84,10 @@ export class ActivityInstancePost {
|
|
|
84
84
|
threadsMax?: number
|
|
85
85
|
|
|
86
86
|
@Field(type => ScalarDate, { nullable: true })
|
|
87
|
-
dueAt?:
|
|
87
|
+
dueAt?: Date
|
|
88
88
|
|
|
89
89
|
@Field(type => ScalarObject, { nullable: true })
|
|
90
|
-
input?:
|
|
90
|
+
input?: { [key: string]: any }
|
|
91
91
|
|
|
92
92
|
@Field({ nullable: true })
|
|
93
93
|
adhocType?: string
|
|
@@ -110,14 +110,14 @@ export class ActivityInstancePost {
|
|
|
110
110
|
@Field(type => ObjectRef, { nullable: true })
|
|
111
111
|
assigneeRole?: Role
|
|
112
112
|
|
|
113
|
-
@Field(type => [
|
|
114
|
-
assignees?:
|
|
113
|
+
@Field(type => [String], { nullable: true, description: 'Email of assignee users' })
|
|
114
|
+
assignees?: string[]
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
@InputType()
|
|
118
118
|
export class ActivityInstanceSave {
|
|
119
119
|
@Field(type => ScalarObject, { nullable: true })
|
|
120
|
-
output?:
|
|
120
|
+
output?: { [key: string]: any }
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
@InputType()
|
|
@@ -137,11 +137,17 @@ export class ActivityInstancePatch {
|
|
|
137
137
|
@Field({ nullable: true })
|
|
138
138
|
state?: ActivityInstanceStatus
|
|
139
139
|
|
|
140
|
+
@Field(type => Int, { nullable: true })
|
|
141
|
+
threadsMin?: number
|
|
142
|
+
|
|
143
|
+
@Field(type => Int, { nullable: true })
|
|
144
|
+
threadsMax?: number
|
|
145
|
+
|
|
140
146
|
@Field(type => ScalarDate, { nullable: true })
|
|
141
|
-
dueAt?:
|
|
147
|
+
dueAt?: Date
|
|
142
148
|
|
|
143
149
|
@Field(type => ScalarObject, { nullable: true })
|
|
144
|
-
input?:
|
|
150
|
+
input?: { [key: string]: any }
|
|
145
151
|
|
|
146
152
|
@Field({ nullable: true })
|
|
147
153
|
cuFlag?: string
|
|
@@ -112,11 +112,11 @@ export class ActivityInstance {
|
|
|
112
112
|
|
|
113
113
|
@Column('simple-json', { nullable: true })
|
|
114
114
|
@Field(type => ScalarObject, { nullable: true })
|
|
115
|
-
input?:
|
|
115
|
+
input?: { [key: string]: any }
|
|
116
116
|
|
|
117
117
|
@Column('simple-json', { nullable: true })
|
|
118
118
|
@Field(type => ScalarObject, { nullable: true })
|
|
119
|
-
output?:
|
|
119
|
+
output?: { [key: string]: any }
|
|
120
120
|
|
|
121
121
|
@Column({ nullable: true })
|
|
122
122
|
@Field({ nullable: true })
|
|
@@ -5,6 +5,7 @@ import { Attachment } from '@things-factory/attachment-base'
|
|
|
5
5
|
import { User } from '@things-factory/auth-base'
|
|
6
6
|
import { Domain, getQueryBuilderFromListParams, ListParam } from '@things-factory/shell'
|
|
7
7
|
|
|
8
|
+
import { ActivityModelItem } from '../activity/activity-model-type'
|
|
8
9
|
import { ActivityTemplate } from './activity-template'
|
|
9
10
|
import { ActivityTemplateList } from './activity-template-type'
|
|
10
11
|
|
|
@@ -35,6 +36,15 @@ export class ActivityTemplateQuery {
|
|
|
35
36
|
return { items, total }
|
|
36
37
|
}
|
|
37
38
|
|
|
39
|
+
@FieldResolver(type => [ActivityModelItem])
|
|
40
|
+
async model(@Root() activityTemplate: ActivityTemplate): Promise<ActivityModelItem[]> {
|
|
41
|
+
if (activityTemplate.model instanceof Array) {
|
|
42
|
+
return activityTemplate.model.filter(model => model.name)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return []
|
|
46
|
+
}
|
|
47
|
+
|
|
38
48
|
@FieldResolver(type => String)
|
|
39
49
|
async thumbnail(@Root() activityTemplate: ActivityTemplate): Promise<string | undefined> {
|
|
40
50
|
const attachment: Attachment = await getRepository(Attachment).findOne({
|
|
@@ -139,11 +139,11 @@ export class ActivityThreadMutation {
|
|
|
139
139
|
@Mutation(returns => ActivityThread!, { nullable: true, description: 'To start ActivityThread information' })
|
|
140
140
|
async startActivityThread(
|
|
141
141
|
@Arg('id') id: string,
|
|
142
|
-
@Arg('output', type => ScalarObject, { nullable: true }) output:
|
|
142
|
+
@Arg('output', type => ScalarObject, { nullable: true }) output: { [key: string]: any },
|
|
143
143
|
@Arg('reason', { nullable: true }) reason: string,
|
|
144
144
|
@Ctx() context: any
|
|
145
145
|
): Promise<ActivityThread> {
|
|
146
|
-
return await start(id, output, reason, context
|
|
146
|
+
return await start(id, output, reason, context)
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
@Directive('@transaction')
|
|
@@ -155,7 +155,7 @@ export class ActivityThreadMutation {
|
|
|
155
155
|
@Arg('reason', { nullable: true }) reason: string,
|
|
156
156
|
@Ctx() context: any
|
|
157
157
|
): Promise<ActivityThread> {
|
|
158
|
-
return await delegate({ id, assigneeRole, dueAt, reason }, context
|
|
158
|
+
return await delegate({ id, assigneeRole, dueAt, reason }, context)
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
@Directive('@transaction')
|
|
@@ -165,18 +165,18 @@ export class ActivityThreadMutation {
|
|
|
165
165
|
@Arg('save') save: ActivityThreadSave,
|
|
166
166
|
@Ctx() context: any
|
|
167
167
|
): Promise<ActivityThread> {
|
|
168
|
-
return await saveActivityThread(id, save, context
|
|
168
|
+
return await saveActivityThread(id, save, context)
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
@Directive('@transaction')
|
|
172
172
|
@Mutation(returns => ActivityThread, { description: 'To end a ActivityThread' })
|
|
173
173
|
async endActivityThread(
|
|
174
174
|
@Arg('id') id: string,
|
|
175
|
-
@Arg('output', type => ScalarObject, { nullable: true }) output:
|
|
175
|
+
@Arg('output', type => ScalarObject, { nullable: true }) output: { [key: string]: any },
|
|
176
176
|
@Arg('reason', { nullable: true }) reason: string,
|
|
177
177
|
@Ctx() context: any
|
|
178
178
|
): Promise<ActivityThread> {
|
|
179
|
-
return await end({ id, output, reason }, context
|
|
179
|
+
return await end({ id, output, reason }, context)
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
@Directive('@transaction')
|
|
@@ -186,6 +186,6 @@ export class ActivityThreadMutation {
|
|
|
186
186
|
@Arg('reason', { nullable: true }) reason: string,
|
|
187
187
|
@Ctx() context: any
|
|
188
188
|
): Promise<ActivityThread> {
|
|
189
|
-
return await abort({ id, reason }, context
|
|
189
|
+
return await abort({ id, reason }, context)
|
|
190
190
|
}
|
|
191
191
|
}
|
|
@@ -5,8 +5,6 @@ import { pubsub } from '@things-factory/shell'
|
|
|
5
5
|
|
|
6
6
|
import { ActivityThread } from './activity-thread'
|
|
7
7
|
|
|
8
|
-
const debug = require('debug')('things-factory:worklist:activity-thread-subscription')
|
|
9
|
-
|
|
10
8
|
@Resolver(ActivityThread)
|
|
11
9
|
export class ActivityThreadSubscription {
|
|
12
10
|
@Subscription({
|
|
@@ -14,8 +12,6 @@ export class ActivityThreadSubscription {
|
|
|
14
12
|
const { domain, user } = context.state
|
|
15
13
|
const subdomain = domain?.subdomain
|
|
16
14
|
|
|
17
|
-
debug('subscribe', subdomain)
|
|
18
|
-
|
|
19
15
|
if (!domain) {
|
|
20
16
|
throw new Error('domain required')
|
|
21
17
|
}
|
|
@@ -15,7 +15,7 @@ export class ActivityThreadSubscriber implements EntitySubscriberInterface<Activ
|
|
|
15
15
|
async afterInsert(event: InsertEvent<ActivityThread>): Promise<any> {
|
|
16
16
|
const activityThread = event.entity
|
|
17
17
|
|
|
18
|
-
await updateActivityInstanceState(activityThread.activityInstanceId, { tx: event.manager })
|
|
18
|
+
await updateActivityInstanceState(activityThread.activityInstanceId, { state: { tx: event.manager } })
|
|
19
19
|
|
|
20
20
|
pubsub.publish('activity-thread', {
|
|
21
21
|
activityThread
|
|
@@ -27,7 +27,7 @@ export class ActivityThreadSubscriber implements EntitySubscriberInterface<Activ
|
|
|
27
27
|
async afterUpdate(event: UpdateEvent<ActivityThread>): Promise<any> {
|
|
28
28
|
const activityThread = event.entity
|
|
29
29
|
|
|
30
|
-
await updateActivityInstanceState(activityThread.activityInstanceId, { tx: event.manager })
|
|
30
|
+
await updateActivityInstanceState(activityThread.activityInstanceId, { state: { tx: event.manager } })
|
|
31
31
|
|
|
32
32
|
pubsub.publish('activity-thread', {
|
|
33
33
|
activityThread
|
|
@@ -38,6 +38,6 @@ export class ActivityThreadSubscriber implements EntitySubscriberInterface<Activ
|
|
|
38
38
|
async afterRemove(event: RemoveEvent<ActivityThread>): Promise<any> {
|
|
39
39
|
const activityThread = event.entity
|
|
40
40
|
|
|
41
|
-
await updateActivityInstanceState(activityThread.activityInstanceId, { tx: event.manager })
|
|
41
|
+
await updateActivityInstanceState(activityThread.activityInstanceId, { state: { tx: event.manager } })
|
|
42
42
|
}
|
|
43
43
|
}
|
package/things-factory.config.js
CHANGED