@things-factory/worklist 6.0.42 → 6.0.45

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 (143) hide show
  1. package/client/pages/activity-stats/activity-stats-importer.ts +97 -0
  2. package/client/pages/activity-stats/activity-stats-list-page.ts +348 -0
  3. package/client/pages/todo/approval-done-list-page.ts +340 -0
  4. package/client/pages/todo/approval-pending-list-page.ts +1 -1
  5. package/client/pages/todo/done-list-calendar-page.ts +115 -0
  6. package/client/pages/todo/done-list-page.ts +2 -3
  7. package/client/pages/todo/pickable-list-page.ts +2 -1
  8. package/client/pages/todo/todo-list-page.ts +1 -1
  9. package/client/route.ts +12 -0
  10. package/client/themes/calendar-theme.css +54 -0
  11. package/dist-client/pages/activity-stats/activity-stats-importer.d.ts +22 -0
  12. package/dist-client/pages/activity-stats/activity-stats-importer.js +100 -0
  13. package/dist-client/pages/activity-stats/activity-stats-importer.js.map +1 -0
  14. package/dist-client/pages/activity-stats/activity-stats-list-page.d.ts +62 -0
  15. package/dist-client/pages/activity-stats/activity-stats-list-page.js +326 -0
  16. package/dist-client/pages/activity-stats/activity-stats-list-page.js.map +1 -0
  17. package/dist-client/pages/todo/approval-done-list-page.d.ts +39 -0
  18. package/dist-client/pages/todo/approval-done-list-page.js +338 -0
  19. package/dist-client/pages/todo/approval-done-list-page.js.map +1 -0
  20. package/dist-client/pages/todo/approval-pending-list-page.js +1 -1
  21. package/dist-client/pages/todo/approval-pending-list-page.js.map +1 -1
  22. package/dist-client/pages/todo/done-list-calendar-page.d.ts +24 -0
  23. package/dist-client/pages/todo/done-list-calendar-page.js +107 -0
  24. package/dist-client/pages/todo/done-list-calendar-page.js.map +1 -0
  25. package/dist-client/pages/todo/done-list-page.js +2 -3
  26. package/dist-client/pages/todo/done-list-page.js.map +1 -1
  27. package/dist-client/pages/todo/pickable-list-page.d.ts +1 -0
  28. package/dist-client/pages/todo/pickable-list-page.js +2 -1
  29. package/dist-client/pages/todo/pickable-list-page.js.map +1 -1
  30. package/dist-client/pages/todo/todo-list-page.js +1 -1
  31. package/dist-client/pages/todo/todo-list-page.js.map +1 -1
  32. package/dist-client/route.d.ts +1 -1
  33. package/dist-client/route.js +9 -0
  34. package/dist-client/route.js.map +1 -1
  35. package/dist-client/tsconfig.tsbuildinfo +1 -1
  36. package/dist-server/controllers/activity-approval/_abort.js +11 -0
  37. package/dist-server/controllers/activity-approval/_abort.js.map +1 -0
  38. package/dist-server/controllers/activity-approval/abort.js +34 -0
  39. package/dist-server/controllers/activity-approval/abort.js.map +1 -0
  40. package/dist-server/controllers/activity-approval/approve.js +10 -0
  41. package/dist-server/controllers/activity-approval/approve.js.map +1 -1
  42. package/dist-server/controllers/activity-approval/delegate.js +10 -0
  43. package/dist-server/controllers/activity-approval/delegate.js.map +1 -1
  44. package/dist-server/controllers/activity-approval/reject.js +10 -0
  45. package/dist-server/controllers/activity-approval/reject.js.map +1 -1
  46. package/dist-server/controllers/activity-instance/abort.js +35 -1
  47. package/dist-server/controllers/activity-instance/abort.js.map +1 -1
  48. package/dist-server/controllers/activity-instance/adjust-xxx.js +16 -0
  49. package/dist-server/controllers/activity-instance/adjust-xxx.js.map +1 -0
  50. package/dist-server/controllers/activity-instance/assign.js +11 -0
  51. package/dist-server/controllers/activity-instance/assign.js.map +1 -1
  52. package/dist-server/controllers/activity-instance/end.js +34 -1
  53. package/dist-server/controllers/activity-instance/end.js.map +1 -1
  54. package/dist-server/controllers/activity-instance/index.js +0 -4
  55. package/dist-server/controllers/activity-instance/index.js.map +1 -1
  56. package/dist-server/controllers/activity-instance/pick.js +11 -0
  57. package/dist-server/controllers/activity-instance/pick.js.map +1 -1
  58. package/dist-server/controllers/activity-instance/post.js +10 -0
  59. package/dist-server/controllers/activity-instance/post.js.map +1 -1
  60. package/dist-server/controllers/activity-instance/start-xxx.js +16 -0
  61. package/dist-server/controllers/activity-instance/start-xxx.js.map +1 -0
  62. package/dist-server/controllers/activity-instance/terminate-xxx.js +25 -0
  63. package/dist-server/controllers/activity-instance/terminate-xxx.js.map +1 -0
  64. package/dist-server/controllers/activity-thread/_abort.js +29 -0
  65. package/dist-server/controllers/activity-thread/_abort.js.map +1 -0
  66. package/dist-server/controllers/activity-thread/abort.js +15 -2
  67. package/dist-server/controllers/activity-thread/abort.js.map +1 -1
  68. package/dist-server/controllers/activity-thread/delegate.js +10 -0
  69. package/dist-server/controllers/activity-thread/delegate.js.map +1 -1
  70. package/dist-server/controllers/activity-thread/end.js +12 -0
  71. package/dist-server/controllers/activity-thread/end.js.map +1 -1
  72. package/dist-server/controllers/activity-thread/index.js +0 -2
  73. package/dist-server/controllers/activity-thread/index.js.map +1 -1
  74. package/dist-server/controllers/activity-thread/restart.js +11 -0
  75. package/dist-server/controllers/activity-thread/restart.js.map +1 -1
  76. package/dist-server/controllers/activity-thread/save.js +13 -0
  77. package/dist-server/controllers/activity-thread/save.js.map +1 -1
  78. package/dist-server/controllers/activity-thread/start.js +10 -0
  79. package/dist-server/controllers/activity-thread/start.js.map +1 -1
  80. package/dist-server/controllers/activity-thread/submit.js +10 -0
  81. package/dist-server/controllers/activity-thread/submit.js.map +1 -1
  82. package/dist-server/service/activity-approval/activity-approval-query.js +48 -0
  83. package/dist-server/service/activity-approval/activity-approval-query.js.map +1 -1
  84. package/dist-server/service/activity-approval/activity-approval.js +1 -1
  85. package/dist-server/service/activity-approval/activity-approval.js.map +1 -1
  86. package/dist-server/service/activity-instance/activity-instance-mutation.js +0 -29
  87. package/dist-server/service/activity-instance/activity-instance-mutation.js.map +1 -1
  88. package/dist-server/service/activity-stats/activity-stats-query.js +93 -0
  89. package/dist-server/service/activity-stats/activity-stats-query.js.map +1 -0
  90. package/dist-server/service/activity-stats/activity-stats-type.js +47 -0
  91. package/dist-server/service/activity-stats/activity-stats-type.js.map +1 -0
  92. package/dist-server/service/activity-stats/index.js +6 -0
  93. package/dist-server/service/activity-stats/index.js.map +1 -0
  94. package/dist-server/service/activity-summary/activity-summary-query.js +4 -22
  95. package/dist-server/service/activity-summary/activity-summary-query.js.map +1 -1
  96. package/dist-server/service/index.js +2 -0
  97. package/dist-server/service/index.js.map +1 -1
  98. package/dist-server/tsconfig.tsbuildinfo +1 -1
  99. package/helps/worklist/activity-bank.md +22 -0
  100. package/helps/worklist/{activity-approval.md → activity-stats.md} +1 -1
  101. package/helps/worklist/draft-list.md +15 -0
  102. package/helps/worklist/worklist-concept.md +72 -0
  103. package/package.json +10 -9
  104. package/server/controllers/activity-approval/_abort.ts +20 -0
  105. package/server/controllers/activity-approval/abort.ts +44 -0
  106. package/server/controllers/activity-approval/approve.ts +13 -0
  107. package/server/controllers/activity-approval/delegate.ts +13 -0
  108. package/server/controllers/activity-approval/reject.ts +13 -0
  109. package/server/controllers/activity-instance/abort.ts +46 -2
  110. package/server/controllers/activity-instance/assign.ts +17 -1
  111. package/server/controllers/activity-instance/end.ts +45 -2
  112. package/server/controllers/activity-instance/index.ts +0 -4
  113. package/server/controllers/activity-instance/pick.ts +17 -1
  114. package/server/controllers/activity-instance/post.ts +13 -0
  115. package/server/controllers/activity-thread/_abort.ts +43 -0
  116. package/server/controllers/activity-thread/abort.ts +20 -10
  117. package/server/controllers/activity-thread/delegate.ts +13 -0
  118. package/server/controllers/activity-thread/end.ts +17 -0
  119. package/server/controllers/activity-thread/index.ts +0 -2
  120. package/server/controllers/activity-thread/restart.ts +14 -0
  121. package/server/controllers/activity-thread/save.ts +18 -0
  122. package/server/controllers/activity-thread/start.ts +13 -0
  123. package/server/controllers/activity-thread/submit.ts +13 -0
  124. package/server/service/activity-approval/activity-approval-query.ts +45 -1
  125. package/server/service/activity-approval/activity-approval.ts +1 -1
  126. package/server/service/activity-instance/activity-instance-mutation.ts +1 -23
  127. package/server/service/activity-stats/activity-stats-query.ts +94 -0
  128. package/server/service/activity-stats/activity-stats-type.ts +34 -0
  129. package/server/service/activity-stats/index.ts +3 -0
  130. package/server/service/activity-summary/activity-summary-query.ts +4 -22
  131. package/server/service/index.ts +2 -0
  132. package/things-factory.config.js +4 -1
  133. package/translations/en.json +10 -0
  134. package/translations/ko.json +12 -2
  135. package/translations/ms.json +10 -0
  136. package/translations/zh.json +10 -0
  137. package/server/controllers/activity-instance/adjust.ts +0 -25
  138. package/server/controllers/activity-instance/bid.ts +0 -52
  139. package/server/controllers/activity-instance/delegate.ts +0 -56
  140. package/server/controllers/activity-instance/start.ts +0 -20
  141. package/server/controllers/activity-instance/terminate.ts +0 -39
  142. package/server/controllers/activity-thread/adjust.ts +0 -40
  143. package/server/controllers/activity-thread/terminate.ts +0 -37
@@ -22,6 +22,20 @@ export async function restart(
22
22
  )
23
23
  }
24
24
 
25
+ /*
26
+ Prerequisites for a activity thread to Be Delegated.
27
+ - The previous state of the activity thread should be Rejected.
28
+ */
29
+ if (activityThread.state !== ActivityThreadStatus.Rejected) {
30
+ throw new Error(
31
+ context.t(`error.activity-thread should be the state`, {
32
+ id,
33
+ state: ActivityThreadStatus.Rejected,
34
+ actual: activityThread.state
35
+ })
36
+ )
37
+ }
38
+
25
39
  if (output) {
26
40
  activityThread.output = output
27
41
  }
@@ -18,7 +18,25 @@ export async function save(id: string, save: ActivityThreadSave, context: Resolv
18
18
  )
19
19
  }
20
20
 
21
+ /*
22
+ Prerequisites for a activity thread to Be Saved.
23
+ - The previous state of the activity thread must not be terminated.
24
+ */
25
+ if (
26
+ activityThread.state == ActivityThreadStatus.Aborted ||
27
+ activityThread.state == ActivityThreadStatus.Ended ||
28
+ activityThread.state == ActivityThreadStatus.Delegated
29
+ ) {
30
+ throw new Error(
31
+ context.t(`error.activity-thread is already terminated`, {
32
+ id,
33
+ actual: activityThread.state
34
+ })
35
+ )
36
+ }
37
+
21
38
  if (!activityThread.startedAt) {
39
+ /* The act of saving means automatically starting the work. */
22
40
  activityThread.startedAt = new Date()
23
41
  }
24
42
 
@@ -22,6 +22,19 @@ export async function start(
22
22
  )
23
23
  }
24
24
 
25
+ /*
26
+ Prerequisites for a activity thread to Be Started.
27
+ - The previous state of the activity thread must not be terminated.
28
+ */
29
+ if (activityThread.state !== ActivityThreadStatus.Assigned) {
30
+ throw new Error(
31
+ context.t(`error.activity-thread should not be started`, {
32
+ id,
33
+ actual: activityThread.state
34
+ })
35
+ )
36
+ }
37
+
25
38
  if (output) {
26
39
  activityThread.output = output
27
40
  }
@@ -25,6 +25,19 @@ export async function submit(
25
25
  )
26
26
  }
27
27
 
28
+ /*
29
+ Prerequisites for a activity thread to Be Started.
30
+ - The previous state of the activity thread must not be terminated.
31
+ */
32
+ if (activityThread.state !== ActivityThreadStatus.Assigned && activityThread.state !== ActivityThreadStatus.Started) {
33
+ throw new Error(
34
+ context.t(`error.activity-thread should not be submitted`, {
35
+ id,
36
+ actual: activityThread.state
37
+ })
38
+ )
39
+ }
40
+
28
41
  if (!activityThread.startedAt) {
29
42
  activityThread.startedAt = new Date()
30
43
  }
@@ -1,7 +1,6 @@
1
1
  import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'
2
2
  import { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'
3
3
  import { User } from '@things-factory/auth-base'
4
- import { ActivityInstance } from '../activity-instance/activity-instance'
5
4
  import { ActivityThread } from '../activity-thread/activity-thread'
6
5
  import { ActivityApproval, ActivityApprovalJudgment } from './activity-approval'
7
6
  import { ActivityApprovalList } from './activity-approval-type'
@@ -76,6 +75,51 @@ export class ActivityApprovalQuery {
76
75
  return { items, total }
77
76
  }
78
77
 
78
+ @Query(returns => ActivityApprovalList, {
79
+ description: 'To fetch the approvals(ActivityApprovals) which has done by me'
80
+ })
81
+ async approvalDoneList(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<ActivityApprovalList> {
82
+ var { domain, user } = context.state
83
+
84
+ const judgment = [
85
+ ActivityApprovalJudgment.Escalated,
86
+ ActivityApprovalJudgment.Delegated,
87
+ ActivityApprovalJudgment.Approved,
88
+ ActivityApprovalJudgment.Rejected
89
+ ]
90
+
91
+ const [items, total] = await getQueryBuilderFromListParams({
92
+ repository: getRepository(ActivityApproval),
93
+ params,
94
+ domain,
95
+ alias: 'ap',
96
+ searchables: ['name', 'description'],
97
+ filtersMap: {
98
+ name: {
99
+ relationColumn: 'activityThread.activityInstance',
100
+ columnName: 'name'
101
+ },
102
+ description: {
103
+ relationColumn: 'activityThread.activityInstance',
104
+ columnName: 'description'
105
+ },
106
+ priority: {
107
+ relationColumn: 'activityThread.activityInstance',
108
+ columnName: 'priority'
109
+ },
110
+ dueAt: {
111
+ relationColumn: 'activityThread.activityInstance',
112
+ columnName: 'dueAt'
113
+ }
114
+ }
115
+ })
116
+ .andWhere('ap.judgment IN (:...judgment)', { judgment })
117
+ .andWhere('ap.approver = :user', { user: user.id })
118
+ .getManyAndCount()
119
+
120
+ return { items, total }
121
+ }
122
+
79
123
  @FieldResolver(type => ActivityThread)
80
124
  async activityThread(@Root() activityApproval: ActivityApproval): Promise<ActivityThread> {
81
125
  return await getRepository(ActivityThread).findOneBy({ id: activityApproval.activityThreadId })
@@ -77,7 +77,7 @@ export class ActivityApproval {
77
77
  round: number = 1
78
78
 
79
79
  @Column({ nullable: true, default: 0 })
80
- @Field({ nullable: true, description: 'Nth order approval for given activity thread' })
80
+ @Field({ nullable: true, description: 'Nth order approval for the given activity thread' })
81
81
  order?: number = 0
82
82
 
83
83
  @ManyToOne(type => User, { nullable: true })
@@ -2,7 +2,7 @@ import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'
2
2
 
3
3
  import { ObjectRef, ScalarObject } from '@things-factory/shell'
4
4
 
5
- import { abort, adjust, assign, delegate, draft, end, pick, post } from '../../controllers/activity-instance'
5
+ import { abort, assign, draft, end, pick, post } from '../../controllers/activity-instance'
6
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'
@@ -57,28 +57,6 @@ export class ActivityInstanceMutation {
57
57
  )
58
58
  }
59
59
 
60
- @Directive('@transaction')
61
- @Mutation(returns => ActivityInstance, { description: 'To modify ActivityInstance information' })
62
- async updateActivityInstance(
63
- @Arg('id') id: string,
64
- @Arg('patch') patch: ActivityInstancePatch,
65
- @Ctx() context: ResolverContext
66
- ): Promise<ActivityInstance> {
67
- return await adjust(id, patch, context)
68
- }
69
-
70
- @Directive('@transaction')
71
- @Mutation(returns => ActivityInstance, { description: 'To delegate a ActivityInstance' })
72
- async delegateActivityInstance(
73
- @Arg('id') id: string,
74
- @Arg('assigneeRole', type => ObjectRef, { nullable: true }) assigneeRole: ObjectRef,
75
- @Arg('dueAt', { nullable: true }) dueAt: Date,
76
- @Arg('reason', { nullable: true }) reason: string,
77
- @Ctx() context: ResolverContext
78
- ): Promise<ActivityInstance> {
79
- return await delegate({ id, assigneeRole, dueAt, reason }, context)
80
- }
81
-
82
60
  @Directive('@transaction')
83
61
  @Mutation(returns => ActivityInstance, { description: 'To end a ActivityInstance' })
84
62
  async endActivityInstance(
@@ -0,0 +1,94 @@
1
+ import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'
2
+ import { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'
3
+ import { User } from '@things-factory/auth-base'
4
+ import { ActivityEvent, ActivityEventStatus } from './activity-stats-type'
5
+ import { ActivityThread, ActivityThreadStatus } from '../activity-thread/activity-thread'
6
+ import { ActivityApproval, ActivityApprovalJudgment } from '../activity-approval/activity-approval'
7
+
8
+ @Resolver(ActivityStatsQuery)
9
+ export class ActivityStatsQuery {
10
+ @Query(returns => [ActivityEvent], { description: 'To fetch activity events by period' })
11
+ async activityEvents(
12
+ @Arg('from') from: string,
13
+ @Arg('to') to: string,
14
+ @Ctx() context: ResolverContext
15
+ ): Promise<ActivityEvent[]> {
16
+ const { domain, user } = context.state
17
+
18
+ if (!from) {
19
+ const beginOfToday = new Date()
20
+ beginOfToday.setHours(0, 0, 0, 0)
21
+ from = beginOfToday.toISOString().split('T').join(' ')
22
+ }
23
+
24
+ if (!to) {
25
+ const endOfToday = new Date()
26
+ endOfToday.setDate(endOfToday.getDate() + 1)
27
+ endOfToday.setHours(0, 0, 0, 0)
28
+ to = endOfToday.toISOString().split('T').join(' ')
29
+ }
30
+
31
+ const status = [ActivityThreadStatus.Ended, ActivityThreadStatus.Aborted]
32
+
33
+ var params = { filters: [{ name: 'terminatedAt', operator: 'between', value: [from, to] }] }
34
+
35
+ var doneItems = await getQueryBuilderFromListParams({
36
+ repository: getRepository(ActivityThread),
37
+ params,
38
+ domain,
39
+ alias: 'at'
40
+ })
41
+ .leftJoinAndSelect('at.activityInstance', 'ai')
42
+ .andWhere('at.state IN (:...status)', { status })
43
+ .andWhere('at.assignee = :user', { user: user.id })
44
+ .getMany()
45
+
46
+ const activityThreadDoneEvents = doneItems.map(({ id, activityInstance, terminatedAt }) => {
47
+ return {
48
+ id,
49
+ name: activityInstance.name,
50
+ date: terminatedAt,
51
+ priority: activityInstance.priority,
52
+ state: ActivityEventStatus.Done,
53
+ type: 'activity-thread'
54
+ }
55
+ })
56
+
57
+ const judgment = [
58
+ ActivityApprovalJudgment.Escalated,
59
+ ActivityApprovalJudgment.Delegated,
60
+ ActivityApprovalJudgment.Approved,
61
+ ActivityApprovalJudgment.Rejected
62
+ ]
63
+
64
+ const approvalDoneItems = await getQueryBuilderFromListParams({
65
+ repository: getRepository(ActivityApproval),
66
+ params,
67
+ domain,
68
+ alias: 'ap'
69
+ })
70
+ .leftJoinAndSelect('ap.activityThread', 'at')
71
+ .leftJoinAndSelect('at.activityInstance', 'ai')
72
+ .andWhere('ap.judgment IN (:...judgment)', { judgment })
73
+ .andWhere('ap.approver = :user', { user: user.id })
74
+ .getMany()
75
+
76
+ const activityApprovalDoneEvents = approvalDoneItems.map(({ id, activityThread, terminatedAt, judgment }) => {
77
+ const activityInstance = activityThread.activityInstance
78
+
79
+ return {
80
+ id,
81
+ name: activityInstance.name,
82
+ date: terminatedAt,
83
+ priority: activityInstance.priority,
84
+ state:
85
+ judgment == ActivityApprovalJudgment.Approved || ActivityApprovalJudgment.Escalated
86
+ ? ActivityEventStatus.Approved
87
+ : ActivityEventStatus.Rejected,
88
+ type: 'activity-approval'
89
+ }
90
+ })
91
+
92
+ return [...activityThreadDoneEvents, ...activityApprovalDoneEvents]
93
+ }
94
+ }
@@ -0,0 +1,34 @@
1
+ import { ObjectType, Field, Int, ID, registerEnumType } from 'type-graphql'
2
+
3
+ export enum ActivityEventStatus {
4
+ Done = 'done',
5
+ Pending = 'pending',
6
+ Approved = 'approved',
7
+ Rejected = 'rejected'
8
+ }
9
+
10
+ registerEnumType(ActivityEventStatus, {
11
+ name: 'ActivityEventStatus',
12
+ description: 'state enumeration of a Activity Event'
13
+ })
14
+
15
+ @ObjectType()
16
+ export class ActivityEvent {
17
+ @Field({ nullable: true })
18
+ id?: string
19
+
20
+ @Field({ nullable: true })
21
+ name?: string
22
+
23
+ @Field({ nullable: true })
24
+ type?: string
25
+
26
+ @Field({ nullable: true })
27
+ priority?: number
28
+
29
+ @Field({ nullable: true })
30
+ state?: ActivityEventStatus
31
+
32
+ @Field({ nullable: true })
33
+ date?: Date
34
+ }
@@ -0,0 +1,3 @@
1
+ import { ActivityStatsQuery } from './activity-stats-query'
2
+
3
+ export const resolvers = [ActivityStatsQuery]
@@ -25,12 +25,7 @@ export class ActivitySummaryQuery {
25
25
  repository: getRepository(ActivityThread),
26
26
  params: {},
27
27
  domain,
28
- alias: 'at',
29
- searchables: ['name', 'description'],
30
- filtersMap: {
31
- name: { columnName: 'name', relationColumn: 'activityInstance' },
32
- description: { columnName: 'description', relationColumn: 'activityInstance' }
33
- }
28
+ alias: 'at'
34
29
  })
35
30
  .andWhere('at.state NOT IN (:...status)', { status })
36
31
  .andWhere('at.assignee = :user', { user: user.id })
@@ -55,18 +50,7 @@ export class ActivitySummaryQuery {
55
50
  repository: getRepository(ActivityApproval),
56
51
  params: {},
57
52
  domain,
58
- alias: 'ap',
59
- searchables: ['name', 'description'],
60
- filtersMap: {
61
- name: {
62
- relationColumn: 'activityThread.activityInstance',
63
- columnName: 'name'
64
- },
65
- description: {
66
- relationColumn: 'activityThread.activityInstance',
67
- columnName: 'description'
68
- }
69
- }
53
+ alias: 'ap'
70
54
  })
71
55
  .andWhere('ap.judgment NOT IN (:...judgment)', { judgment })
72
56
  .andWhere('ap.approver = :user', { user: user.id })
@@ -99,8 +83,7 @@ export class ActivitySummaryQuery {
99
83
  repository: getRepository(ActivityInstance),
100
84
  params: {},
101
85
  domain,
102
- alias: 'ai',
103
- searchables: ['name', 'description']
86
+ alias: 'ai'
104
87
  })
105
88
  .leftJoinAndSelect('ai.activityThreads', 'threads', 'threads.assignee = :user', { user: user.id })
106
89
  .andWhere('ai.state IN (:...status)', {
@@ -122,8 +105,7 @@ export class ActivitySummaryQuery {
122
105
  repository: getRepository(ActivityInstance),
123
106
  params: {},
124
107
  domain,
125
- alias: 'ai',
126
- searchables: ['name', 'description']
108
+ alias: 'ai'
127
109
  })
128
110
  .andWhere('ai.state IN (:...status)', { status })
129
111
  .andWhere('ai.creator = :user', { user: user.id })
@@ -8,6 +8,7 @@ export * from './installable-activity/installable-activity'
8
8
  export * from './activity-summary/activity-summary'
9
9
 
10
10
  /* IMPORT ENTITIES AND RESOLVERS */
11
+ import { resolvers as ActivityStatsResolvers } from './activity-stats'
11
12
  import {
12
13
  entities as ActivityApprovalEntities,
13
14
  resolvers as ActivityApprovalResolvers,
@@ -57,6 +58,7 @@ export const subscribers = [
57
58
  export const schema = {
58
59
  resolverClasses: [
59
60
  /* RESOLVER CLASSES */
61
+ ...ActivityStatsResolvers,
60
62
  ...ActivityApprovalResolvers,
61
63
  ...ActivityResolvers,
62
64
  ...ActivityInstanceResolvers,
@@ -9,8 +9,10 @@ export default {
9
9
  { tagname: 'worklist-dashboard', page: 'worklist-dashboard' },
10
10
  { tagname: 'pickable-list-page', page: 'pickable-list' },
11
11
  { tagname: 'todo-list-page', page: 'todo-list' },
12
+ { tagname: 'done-list-calendar-page', page: 'done-list-calendar' },
12
13
  { tagname: 'done-list-page', page: 'done-list' },
13
14
  { tagname: 'approval-pending-list-page', page: 'approval-pending-list' },
15
+ { tagname: 'approval-done-list-page', page: 'approval-done-list' },
14
16
  { tagname: 'draft-list-page', page: 'draft-list' },
15
17
  { tagname: 'starter-list-page', page: 'starter-list' },
16
18
  { tagname: 'reporter-list-page', page: 'reporter-list' },
@@ -29,6 +31,7 @@ export default {
29
31
  { tagname: 'activity-store-page', page: 'activity-store' },
30
32
  { tagname: 'activity-thread-list-page', page: 'activity-thread-list' },
31
33
  { tagname: 'installable-activity-list-page', page: 'installable-activity-list' },
32
- { tagname: 'activity-approval-list-page', page: 'activity-approval-list' }
34
+ { tagname: 'activity-approval-list-page', page: 'activity-approval-list' },
35
+ { tagname: 'activity-stats-list-page', page: 'activity-stats-list' }
33
36
  ]
34
37
  }
@@ -23,6 +23,9 @@
23
23
  "field.inout": "inout",
24
24
  "field.input-key": "input-key",
25
25
  "field.issuer": "issuer",
26
+ "field.round": "round",
27
+ "field.judgment": "judgment",
28
+ "field.comment": "comment",
26
29
  "field.posted-at": "posted at",
27
30
  "field.issuer-role": "issuer role",
28
31
  "field.lead-time": "LT(sec)",
@@ -44,6 +47,8 @@
44
47
  "field.supervisory-role": "supervisory role",
45
48
  "field.tact-time": "TT(sec)",
46
49
  "field.tag": "tag name",
50
+ "field.created-at": "created at",
51
+ "field.updated-at": "terminated at",
47
52
  "field.terminated-at": "terminated at",
48
53
  "field.ui-type": "UI type",
49
54
  "field.ui-source": "UI source",
@@ -62,11 +67,13 @@
62
67
  "label.activity-state-submitted": "submitted",
63
68
  "label.activity-state-escalated": "escalated",
64
69
  "label.activity-state-pending": "pending",
70
+ "label.activity-state-approved": "approved",
65
71
  "label.activity-state-rejected": "rejected",
66
72
  "label.activity-state-ended": "ended",
67
73
  "label.activity-state-aborted": "aborted",
68
74
  "label.days": "days",
69
75
  "label.filter-aborted": "aborted",
76
+ "label.filter-rejected": "rejected",
70
77
  "label.filter-important": "important",
71
78
  "label.filter-due": "due",
72
79
  "label.filter-recent": "recent",
@@ -85,6 +92,7 @@
85
92
  "text.task_is_saved_successfully": "task is saved successfully",
86
93
  "text.task_is_started_successfully": "task is started successfully.",
87
94
  "title.activity bank": "activity bank",
95
+ "title.activity shopping": "activity shopping",
88
96
  "title.activity list": "activity list",
89
97
  "title.activity model item list": "activity model item list",
90
98
  "title.activity instance list": "activity instance list",
@@ -100,9 +108,11 @@
100
108
  "title.activity summary": "activity summary",
101
109
  "title.activity template model item list": "activity template model item list",
102
110
  "title.activity template list": "activity template list",
111
+ "title.approval done list": "approval done list",
103
112
  "title.approval pending list": "approval pending list",
104
113
  "title.assigned list": "assigned list",
105
114
  "title.done list": "done list",
115
+ "title.done list calendar": "done list calendar",
106
116
  "title.draft list": "draft list",
107
117
  "title.edit duration": "edit duration",
108
118
  "title.installable activity list": "installable activity list",
@@ -23,6 +23,9 @@
23
23
  "field.inout": "입출력",
24
24
  "field.input-key": "입력키",
25
25
  "field.issuer": "발급자",
26
+ "field.round": "차수",
27
+ "field.judgment": "판정",
28
+ "field.comment": "코멘트",
26
29
  "field.posted-at": "발급일",
27
30
  "field.issuer-role": "발급자 역할",
28
31
  "field.lead-time": "LT(초)",
@@ -44,6 +47,8 @@
44
47
  "field.supervisory-role": "관리자 역할",
45
48
  "field.tact-time": "TT(초)",
46
49
  "field.tag": "태그이름",
50
+ "field.created-at": "생성 시간",
51
+ "field.updated-at": "수정 시간",
47
52
  "field.terminated-at": "완료 시간",
48
53
  "field.ui-type": "화면 타입",
49
54
  "field.ui-source": "화면 소스",
@@ -60,13 +65,15 @@
60
65
  "label.activity-state-started": "진행중",
61
66
  "label.activity-state-delegated": "위임됨",
62
67
  "label.activity-state-submitted": "제출됨",
63
- "label.activity-state-escalated": "승인진행중",
68
+ "label.activity-state-escalated": "상위승인중",
64
69
  "label.activity-state-pending": "지연중",
65
70
  "label.activity-state-rejected": "반려됨",
71
+ "label.activity-state-approved": "승인됨",
66
72
  "label.activity-state-ended": "완료됨",
67
73
  "label.activity-state-aborted": "취소됨",
68
74
  "label.days": "일",
69
75
  "label.filter-aborted": "중단",
76
+ "label.filter-rejected": "반려",
70
77
  "label.filter-important": "중요",
71
78
  "label.filter-due": "만기",
72
79
  "label.filter-recent": "최근",
@@ -85,6 +92,7 @@
85
92
  "text.task_is_saved_successfully": "업무가 성공적으로 저장되었습니다.",
86
93
  "text.task_is_started_successfully": "업무가 성공적으로 시작되었습니다.",
87
94
  "title.activity bank": "업무 뱅크",
95
+ "title.activity shopping": "업무 쇼핑",
88
96
  "title.activity list": "업무정의 리스트",
89
97
  "title.activity model item list": "업무 모델 항목",
90
98
  "title.activity instance list": "업무 리스트",
@@ -100,9 +108,11 @@
100
108
  "title.activity summary": "업무 종합 현황",
101
109
  "title.activity template model item list": "업무 템플릿 모델 항목",
102
110
  "title.activity template list": "업무 템플릿",
111
+ "title.approval done list": "내가 수행한 승인 리스트",
103
112
  "title.approval pending list": "승인 대기 리스트",
104
113
  "title.assigned list": "나의 연관 업무 현황",
105
- "title.done list": "완료한 업무",
114
+ "title.done list": "업무 이력",
115
+ "title.done list calendar": "업무 이력 캘린더",
106
116
  "title.draft list": "작성중인 업무",
107
117
  "title.edit duration": "소요시간 편집",
108
118
  "title.installable activity list": "설치 가능 업무",
@@ -23,6 +23,9 @@
23
23
  "field.inout": "[ms] inout",
24
24
  "field.input-key": "[ms] input-key",
25
25
  "field.issuer": "issuer",
26
+ "field.round": "round",
27
+ "field.judgment": "judgment",
28
+ "field.comment": "comment",
26
29
  "field.posted-at": "posted at",
27
30
  "field.issuer-role": "issuer role",
28
31
  "field.lead-time": "LT(sec)",
@@ -44,6 +47,8 @@
44
47
  "field.supervisory-role": "supervisory role",
45
48
  "field.tact-time": "TT(sec)",
46
49
  "field.tag": "[ms] tag name",
50
+ "field.created-at": "[ms] created at",
51
+ "field.updated-at": "[ms] updated at",
47
52
  "field.terminated-at": "[ms] terminated at",
48
53
  "field.ui-type": "UI type",
49
54
  "field.ui-source": "UI source",
@@ -62,11 +67,13 @@
62
67
  "label.activity-state-submitted": "[ms] submitted",
63
68
  "label.activity-state-escalated": "[ms] escalated",
64
69
  "label.activity-state-pending": "[ms] pending",
70
+ "label.activity-state-approved": "[ms] approved",
65
71
  "label.activity-state-rejected": "[ms] rejected",
66
72
  "label.activity-state-ended": "[ms] ended",
67
73
  "label.activity-state-aborted": "[ms] aborted",
68
74
  "label.days": "[ms] days",
69
75
  "label.filter-aborted": "aborted",
76
+ "label.filter-rejected": "rejected",
70
77
  "label.filter-important": "important",
71
78
  "label.filter-due": "due",
72
79
  "label.filter-recent": "recent",
@@ -85,6 +92,7 @@
85
92
  "text.task_is_saved_successfully": "[ms] task is saved successfully",
86
93
  "text.task_is_started_successfully": "[ms] task is started successfully.",
87
94
  "title.activity bank": "[ms] activity bank",
95
+ "title.activity shopping": "[ms] activity shopping",
88
96
  "title.activity list": "[ms] activity list",
89
97
  "title.activity model item list": "[ms] activity model item list",
90
98
  "title.activity instance list": "[ms] activity instance list",
@@ -100,9 +108,11 @@
100
108
  "title.activity summary": "[ms] activity summary",
101
109
  "title.activity template model item list": "[ms] activity template model item list",
102
110
  "title.activity template list": "[ms] activity template list",
111
+ "title.approval done list": "[ms] approval done list",
103
112
  "title.approval pending list": "[ms] approval pending list",
104
113
  "title.assigned list": "[ms] assigned list",
105
114
  "title.done list": "[ms] done list",
115
+ "title.done list calendar": "[ms] done list calendar",
106
116
  "title.draft list": "[ms] draft list",
107
117
  "title.edit duration": "[ms] edit duration",
108
118
  "title.installable activity list": "[ms] installable activity list",
@@ -22,6 +22,9 @@
22
22
  "field.inout": "[zh] inout",
23
23
  "field.input-key": "[zh] input-key",
24
24
  "field.issuer": "issuer",
25
+ "field.round": "round",
26
+ "field.judgment": "judgment",
27
+ "field.comment": "comment",
25
28
  "field.hidden": "hidden",
26
29
  "field.posted-at": "posted at",
27
30
  "field.provider": "provider",
@@ -44,6 +47,8 @@
44
47
  "field.supervisory-role": "supervisory role",
45
48
  "field.tact-time": "TT(sec)",
46
49
  "field.tag": "[zh] tag name",
50
+ "field.created-at": "[zh] created at",
51
+ "field.updated-at": "[zh] updated at",
47
52
  "field.terminated-at": "[zh] terminated at",
48
53
  "field.ui-type": "UI type",
49
54
  "field.ui-source": "UI source",
@@ -62,11 +67,13 @@
62
67
  "label.activity-state-submitted": "[zh] submitted",
63
68
  "label.activity-state-escalated": "[zh] escalated",
64
69
  "label.activity-state-pending": "[zh] pending",
70
+ "label.activity-state-approved": "[zh] approved",
65
71
  "label.activity-state-rejected": "[zh] rejected",
66
72
  "label.activity-state-ended": "[zh] ended",
67
73
  "label.activity-state-aborted": "[zh] aborted",
68
74
  "label.days": "天",
69
75
  "label.filter-aborted": "aborted",
76
+ "label.filter-rejected": "rejected",
70
77
  "label.filter-important": "important",
71
78
  "label.filter-due": "due",
72
79
  "label.filter-recent": "recent",
@@ -85,6 +92,7 @@
85
92
  "text.task_is_saved_successfully": "[zh] task is saved successfully",
86
93
  "text.task_is_started_successfully": "[zh] task is started successfully.",
87
94
  "title.activity bank": "[zh] activity bank",
95
+ "title.activity shopping": "[zh] activity shopping",
88
96
  "title.activity list": "[zh] activity list",
89
97
  "title.activity model item list": "[zh] activity model item list",
90
98
  "title.activity instance list": "[zh] activity instance list",
@@ -100,9 +108,11 @@
100
108
  "title.activity summary": "[zh] activity summary",
101
109
  "title.activity template model item list": "[zh] activity template model item list",
102
110
  "title.activity template list": "[zh] activity template list",
111
+ "title.approval done list": "[zh] approval done list",
103
112
  "title.approval pending list": "[zh] approval pending list",
104
113
  "title.assigned list": "[zh] assigned list",
105
114
  "title.done list": "[zh] done list",
115
+ "title.done list calendar": "[zh] done list calendar",
106
116
  "title.draft list": "[zh] draft list",
107
117
  "title.edit duration": "[zh] edit duration",
108
118
  "title.installable activity list": "[zh] installable activity list",
@@ -1,25 +0,0 @@
1
- import { ActivityInstance } from '../../service/activity-instance/activity-instance'
2
- import { ActivityInstancePatch } from '../../service/activity-instance/activity-instance-type'
3
- import { evalActivityInstanceState } from '../common'
4
-
5
- export async function adjust(
6
- id: string,
7
- patch: ActivityInstancePatch,
8
- context: ResolverContext
9
- ): Promise<ActivityInstance> {
10
- const { domain, user, tx } = context.state
11
-
12
- const repository = tx.getRepository(ActivityInstance)
13
- const activityInstance = await repository.findOne({
14
- where: { domain: { id: domain.id }, id },
15
- relations: ['domain', 'activity', 'assigneeRole', 'supervisoryRole', 'updater', 'creator', 'starter', 'terminator']
16
- })
17
-
18
- return await repository.save({
19
- ...activityInstance,
20
- ...patch,
21
- transaction: 'adjust',
22
- ...(await evalActivityInstanceState(id, context)),
23
- updater: user
24
- })
25
- }