@things-factory/worklist 9.1.19 → 10.0.0-beta.2
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/dist-client/components/activity-thread-timeline.d.ts +1 -9
- package/dist-client/components/activity-thread-timeline.js +1 -3
- package/dist-client/components/activity-thread-timeline.js.map +1 -1
- package/dist-client/pages/activity/activity-list-page.d.ts +1 -7
- package/dist-client/pages/activity/activity-list-page.js +125 -234
- package/dist-client/pages/activity/activity-list-page.js.map +1 -1
- package/dist-client/pages/activity/activity-page.d.ts +1 -7
- package/dist-client/pages/activity/activity-page.js +51 -93
- package/dist-client/pages/activity/activity-page.js.map +1 -1
- package/dist-client/pages/activity/starter-list-page.d.ts +1 -7
- package/dist-client/pages/activity/starter-list-page.js +33 -62
- package/dist-client/pages/activity/starter-list-page.js.map +1 -1
- package/dist-client/pages/activity-approval/activity-approval-list-page.d.ts +1 -7
- package/dist-client/pages/activity-approval/activity-approval-list-page.js +50 -95
- package/dist-client/pages/activity-approval/activity-approval-list-page.js.map +1 -1
- package/dist-client/pages/activity-approval/activity-approval-page.d.ts +1 -7
- package/dist-client/pages/activity-approval/activity-approval-page.js +73 -119
- package/dist-client/pages/activity-approval/activity-approval-page.js.map +1 -1
- package/dist-client/pages/activity-instance/activity-instance-list-page.d.ts +0 -6
- package/dist-client/pages/activity-instance/activity-instance-list-page.js +63 -120
- package/dist-client/pages/activity-instance/activity-instance-list-page.js.map +1 -1
- package/dist-client/pages/activity-instance/activity-instance-search-page.d.ts +1 -7
- package/dist-client/pages/activity-instance/activity-instance-search-page.js +55 -101
- package/dist-client/pages/activity-instance/activity-instance-search-page.js.map +1 -1
- package/dist-client/pages/activity-instance/activity-instance-start-page.d.ts +1 -7
- package/dist-client/pages/activity-instance/activity-instance-start-page.js +65 -109
- package/dist-client/pages/activity-instance/activity-instance-start-page.js.map +1 -1
- package/dist-client/pages/activity-stats/activity-stats-list-page.d.ts +1 -7
- package/dist-client/pages/activity-stats/activity-stats-list-page.js +50 -95
- package/dist-client/pages/activity-stats/activity-stats-list-page.js.map +1 -1
- package/dist-client/pages/activity-store/activity-store-page.d.ts +1 -7
- package/dist-client/pages/activity-store/activity-store-page.js +2 -3
- package/dist-client/pages/activity-store/activity-store-page.js.map +1 -1
- package/dist-client/pages/activity-supervisor/reporter-list-page.d.ts +1 -7
- package/dist-client/pages/activity-supervisor/reporter-list-page.js +36 -66
- package/dist-client/pages/activity-supervisor/reporter-list-page.js.map +1 -1
- package/dist-client/pages/activity-template/activity-template-list-page.d.ts +1 -7
- package/dist-client/pages/activity-template/activity-template-list-page.js +70 -134
- package/dist-client/pages/activity-template/activity-template-list-page.js.map +1 -1
- package/dist-client/pages/activity-thread/activity-thread-list-page.d.ts +1 -7
- package/dist-client/pages/activity-thread/activity-thread-list-page.js +49 -93
- package/dist-client/pages/activity-thread/activity-thread-list-page.js.map +1 -1
- package/dist-client/pages/activity-thread/activity-thread-page.d.ts +1 -7
- package/dist-client/pages/activity-thread/activity-thread-page.js +80 -135
- package/dist-client/pages/activity-thread/activity-thread-page.js.map +1 -1
- package/dist-client/pages/activity-thread/activity-thread-view-page.d.ts +1 -7
- package/dist-client/pages/activity-thread/activity-thread-view-page.js +54 -80
- package/dist-client/pages/activity-thread/activity-thread-view-page.js.map +1 -1
- package/dist-client/pages/activity-thread/activity-thread-view.js +4 -0
- package/dist-client/pages/activity-thread/activity-thread-view.js.map +1 -1
- package/dist-client/pages/dashboard/dashboard-home.js +3 -5
- package/dist-client/pages/dashboard/dashboard-home.js.map +1 -1
- package/dist-client/pages/installable-activity/installable-activity-list-page.d.ts +0 -6
- package/dist-client/pages/installable-activity/installable-activity-list-page.js +68 -130
- package/dist-client/pages/installable-activity/installable-activity-list-page.js.map +1 -1
- package/dist-client/pages/todo/approval-done-list-page.d.ts +1 -7
- package/dist-client/pages/todo/approval-done-list-page.js +53 -100
- package/dist-client/pages/todo/approval-done-list-page.js.map +1 -1
- package/dist-client/pages/todo/approval-pending-list-page.d.ts +0 -6
- package/dist-client/pages/todo/approval-pending-list-page.js +63 -119
- package/dist-client/pages/todo/approval-pending-list-page.js.map +1 -1
- package/dist-client/pages/todo/done-list-calendar-page.d.ts +1 -7
- package/dist-client/pages/todo/done-list-calendar-page.js +2 -3
- package/dist-client/pages/todo/done-list-calendar-page.js.map +1 -1
- package/dist-client/pages/todo/done-list-page.d.ts +1 -7
- package/dist-client/pages/todo/done-list-page.js +56 -106
- package/dist-client/pages/todo/done-list-page.js.map +1 -1
- package/dist-client/pages/todo/draft-list-page.d.ts +1 -7
- package/dist-client/pages/todo/draft-list-page.js +49 -88
- package/dist-client/pages/todo/draft-list-page.js.map +1 -1
- package/dist-client/pages/todo/pickable-list-page.d.ts +1 -7
- package/dist-client/pages/todo/pickable-list-page.js +48 -91
- package/dist-client/pages/todo/pickable-list-page.js.map +1 -1
- package/dist-client/pages/todo/todo-list-page.d.ts +0 -6
- package/dist-client/pages/todo/todo-list-page.js +56 -106
- package/dist-client/pages/todo/todo-list-page.js.map +1 -1
- package/dist-client/pages/worklist-home.js +2 -3
- package/dist-client/pages/worklist-home.js.map +1 -1
- package/dist-client/route.d.ts +1 -1
- package/dist-client/templates/activity-approval-context-template.js +8 -12
- package/dist-client/templates/activity-approval-context-template.js.map +1 -1
- package/dist-client/templates/activity-instance-context-template.js +8 -12
- package/dist-client/templates/activity-instance-context-template.js.map +1 -1
- package/dist-client/templates/activity-thread-context-template.js +8 -12
- package/dist-client/templates/activity-thread-context-template.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/controllers/activity-approval/approve.js +2 -2
- package/dist-server/controllers/activity-approval/approve.js.map +1 -1
- package/dist-server/controllers/activity-thread/submit.js +2 -2
- package/dist-server/controllers/activity-thread/submit.js.map +1 -1
- package/dist-server/service/index.d.ts +2 -2
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +16 -16
- package/spec/integration/approval-mixed-types.spec.ts +491 -0
- package/spec/integration/approval-role-based.spec.ts +389 -0
- package/spec/integration/instance-lifecycle.spec.ts +406 -0
- package/spec/integration/role-approval-edge-cases.spec.ts +581 -0
- package/spec/unit/controllers/activity-instance-issue.spec.ts +360 -0
- package/spec/unit/controllers/activity-thread-submit.spec.ts +384 -0
- package/spec/unit/role-approval-escalate-logic.spec.ts +499 -0
- package/spec/unit/role-approval-submit-logic.spec.ts +481 -0
- package/spec/unit/thread-state-helpers.spec.ts +253 -0
- package/translations/en.json +1 -1
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ActivityThread State Helper Unit Tests
|
|
3
|
+
* ActivityThread 상태 헬퍼 함수 단위 테스트
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
isPendingStarted,
|
|
8
|
+
isPendingEnded,
|
|
9
|
+
isValidThread,
|
|
10
|
+
isTerminalThreadState,
|
|
11
|
+
isTerminalInstanceState
|
|
12
|
+
} from '../../../../test/helpers/workflow-helpers'
|
|
13
|
+
import {
|
|
14
|
+
ActivityThreadStatus,
|
|
15
|
+
ActivityInstanceStatus
|
|
16
|
+
} from '../../../../test/entities/schemas'
|
|
17
|
+
|
|
18
|
+
describe('ActivityThread State Helpers', () => {
|
|
19
|
+
describe('isPendingStarted', () => {
|
|
20
|
+
it('Assigned 상태이면 true를 반환해야 한다', () => {
|
|
21
|
+
const thread = { state: ActivityThreadStatus.Assigned } as any
|
|
22
|
+
expect(isPendingStarted(thread)).toBe(true)
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
it('Started 상태이면 false를 반환해야 한다', () => {
|
|
26
|
+
const thread = { state: ActivityThreadStatus.Started } as any
|
|
27
|
+
expect(isPendingStarted(thread)).toBe(false)
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
it('Unassigned 상태이면 false를 반환해야 한다', () => {
|
|
31
|
+
const thread = { state: ActivityThreadStatus.Unassigned } as any
|
|
32
|
+
expect(isPendingStarted(thread)).toBe(false)
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
it('Ended 상태이면 false를 반환해야 한다', () => {
|
|
36
|
+
const thread = { state: ActivityThreadStatus.Ended } as any
|
|
37
|
+
expect(isPendingStarted(thread)).toBe(false)
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
it('Submitted 상태이면 false를 반환해야 한다', () => {
|
|
41
|
+
const thread = { state: ActivityThreadStatus.Submitted } as any
|
|
42
|
+
expect(isPendingStarted(thread)).toBe(false)
|
|
43
|
+
})
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
describe('isPendingEnded', () => {
|
|
47
|
+
it('Started 상태이면 true를 반환해야 한다', () => {
|
|
48
|
+
const thread = { state: ActivityThreadStatus.Started } as any
|
|
49
|
+
expect(isPendingEnded(thread)).toBe(true)
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
it('Submitted 상태이면 true를 반환해야 한다', () => {
|
|
53
|
+
const thread = { state: ActivityThreadStatus.Submitted } as any
|
|
54
|
+
expect(isPendingEnded(thread)).toBe(true)
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
it('Escalated 상태이면 true를 반환해야 한다', () => {
|
|
58
|
+
const thread = { state: ActivityThreadStatus.Escalated } as any
|
|
59
|
+
expect(isPendingEnded(thread)).toBe(true)
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
it('Rejected 상태이면 true를 반환해야 한다', () => {
|
|
63
|
+
const thread = { state: ActivityThreadStatus.Rejected } as any
|
|
64
|
+
expect(isPendingEnded(thread)).toBe(true)
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
it('Assigned 상태이면 false를 반환해야 한다', () => {
|
|
68
|
+
const thread = { state: ActivityThreadStatus.Assigned } as any
|
|
69
|
+
expect(isPendingEnded(thread)).toBe(false)
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
it('Ended 상태이면 false를 반환해야 한다', () => {
|
|
73
|
+
const thread = { state: ActivityThreadStatus.Ended } as any
|
|
74
|
+
expect(isPendingEnded(thread)).toBe(false)
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
it('Aborted 상태이면 false를 반환해야 한다', () => {
|
|
78
|
+
const thread = { state: ActivityThreadStatus.Aborted } as any
|
|
79
|
+
expect(isPendingEnded(thread)).toBe(false)
|
|
80
|
+
})
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
describe('isValidThread', () => {
|
|
84
|
+
it('Assigned 상태이면 true를 반환해야 한다', () => {
|
|
85
|
+
const thread = { state: ActivityThreadStatus.Assigned } as any
|
|
86
|
+
expect(isValidThread(thread)).toBe(true)
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
it('Started 상태이면 true를 반환해야 한다', () => {
|
|
90
|
+
const thread = { state: ActivityThreadStatus.Started } as any
|
|
91
|
+
expect(isValidThread(thread)).toBe(true)
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
it('Ended 상태이면 true를 반환해야 한다', () => {
|
|
95
|
+
const thread = { state: ActivityThreadStatus.Ended } as any
|
|
96
|
+
expect(isValidThread(thread)).toBe(true)
|
|
97
|
+
})
|
|
98
|
+
|
|
99
|
+
it('Unassigned 상태이면 false를 반환해야 한다', () => {
|
|
100
|
+
const thread = { state: ActivityThreadStatus.Unassigned } as any
|
|
101
|
+
expect(isValidThread(thread)).toBe(false)
|
|
102
|
+
})
|
|
103
|
+
})
|
|
104
|
+
|
|
105
|
+
describe('isTerminalThreadState', () => {
|
|
106
|
+
it('Ended 상태이면 true를 반환해야 한다', () => {
|
|
107
|
+
expect(isTerminalThreadState(ActivityThreadStatus.Ended)).toBe(true)
|
|
108
|
+
})
|
|
109
|
+
|
|
110
|
+
it('Aborted 상태이면 true를 반환해야 한다', () => {
|
|
111
|
+
expect(isTerminalThreadState(ActivityThreadStatus.Aborted)).toBe(true)
|
|
112
|
+
})
|
|
113
|
+
|
|
114
|
+
it('Started 상태이면 false를 반환해야 한다', () => {
|
|
115
|
+
expect(isTerminalThreadState(ActivityThreadStatus.Started)).toBe(false)
|
|
116
|
+
})
|
|
117
|
+
|
|
118
|
+
it('Assigned 상태이면 false를 반환해야 한다', () => {
|
|
119
|
+
expect(isTerminalThreadState(ActivityThreadStatus.Assigned)).toBe(false)
|
|
120
|
+
})
|
|
121
|
+
|
|
122
|
+
it('Submitted 상태이면 false를 반환해야 한다', () => {
|
|
123
|
+
expect(isTerminalThreadState(ActivityThreadStatus.Submitted)).toBe(false)
|
|
124
|
+
})
|
|
125
|
+
|
|
126
|
+
it('Rejected 상태이면 false를 반환해야 한다', () => {
|
|
127
|
+
expect(isTerminalThreadState(ActivityThreadStatus.Rejected)).toBe(false)
|
|
128
|
+
})
|
|
129
|
+
})
|
|
130
|
+
|
|
131
|
+
describe('isTerminalInstanceState', () => {
|
|
132
|
+
it('Ended 상태이면 true를 반환해야 한다', () => {
|
|
133
|
+
expect(isTerminalInstanceState(ActivityInstanceStatus.Ended)).toBe(true)
|
|
134
|
+
})
|
|
135
|
+
|
|
136
|
+
it('Aborted 상태이면 true를 반환해야 한다', () => {
|
|
137
|
+
expect(isTerminalInstanceState(ActivityInstanceStatus.Aborted)).toBe(true)
|
|
138
|
+
})
|
|
139
|
+
|
|
140
|
+
it('Started 상태이면 false를 반환해야 한다', () => {
|
|
141
|
+
expect(isTerminalInstanceState(ActivityInstanceStatus.Started)).toBe(false)
|
|
142
|
+
})
|
|
143
|
+
|
|
144
|
+
it('Issued 상태이면 false를 반환해야 한다', () => {
|
|
145
|
+
expect(isTerminalInstanceState(ActivityInstanceStatus.Issued)).toBe(false)
|
|
146
|
+
})
|
|
147
|
+
|
|
148
|
+
it('Assigned 상태이면 false를 반환해야 한다', () => {
|
|
149
|
+
expect(isTerminalInstanceState(ActivityInstanceStatus.Assigned)).toBe(false)
|
|
150
|
+
})
|
|
151
|
+
})
|
|
152
|
+
})
|
|
153
|
+
|
|
154
|
+
describe('ActivityThreadStatus Enum', () => {
|
|
155
|
+
it('모든 상태 값이 정의되어야 한다', () => {
|
|
156
|
+
expect(ActivityThreadStatus.Unassigned).toBe('unassigned')
|
|
157
|
+
expect(ActivityThreadStatus.Assigned).toBe('assigned')
|
|
158
|
+
expect(ActivityThreadStatus.Started).toBe('started')
|
|
159
|
+
expect(ActivityThreadStatus.Submitted).toBe('submitted')
|
|
160
|
+
expect(ActivityThreadStatus.Escalated).toBe('escalated')
|
|
161
|
+
expect(ActivityThreadStatus.Rejected).toBe('rejected')
|
|
162
|
+
expect(ActivityThreadStatus.Ended).toBe('ended')
|
|
163
|
+
expect(ActivityThreadStatus.Aborted).toBe('aborted')
|
|
164
|
+
})
|
|
165
|
+
|
|
166
|
+
it('총 8개의 상태가 있어야 한다', () => {
|
|
167
|
+
const statusValues = Object.values(ActivityThreadStatus)
|
|
168
|
+
expect(statusValues.length).toBe(8)
|
|
169
|
+
})
|
|
170
|
+
})
|
|
171
|
+
|
|
172
|
+
describe('ActivityInstanceStatus Enum', () => {
|
|
173
|
+
it('모든 상태 값이 정의되어야 한다', () => {
|
|
174
|
+
expect(ActivityInstanceStatus.Draft).toBe('draft')
|
|
175
|
+
expect(ActivityInstanceStatus.Issued).toBe('issued')
|
|
176
|
+
expect(ActivityInstanceStatus.Unassigned).toBe('unassigned')
|
|
177
|
+
expect(ActivityInstanceStatus.Assigned).toBe('assigned')
|
|
178
|
+
expect(ActivityInstanceStatus.Started).toBe('started')
|
|
179
|
+
expect(ActivityInstanceStatus.Pending).toBe('pending')
|
|
180
|
+
expect(ActivityInstanceStatus.Ended).toBe('ended')
|
|
181
|
+
expect(ActivityInstanceStatus.Aborted).toBe('aborted')
|
|
182
|
+
})
|
|
183
|
+
|
|
184
|
+
it('총 8개의 상태가 있어야 한다', () => {
|
|
185
|
+
const statusValues = Object.values(ActivityInstanceStatus)
|
|
186
|
+
expect(statusValues.length).toBe(8)
|
|
187
|
+
})
|
|
188
|
+
})
|
|
189
|
+
|
|
190
|
+
describe('Thread State Transition Rules', () => {
|
|
191
|
+
describe('Unassigned 상태 규칙', () => {
|
|
192
|
+
it('Unassigned 스레드는 assignee가 없어야 한다', () => {
|
|
193
|
+
const thread = {
|
|
194
|
+
state: ActivityThreadStatus.Unassigned,
|
|
195
|
+
assignee: undefined
|
|
196
|
+
}
|
|
197
|
+
expect(thread.assignee).toBeUndefined()
|
|
198
|
+
})
|
|
199
|
+
})
|
|
200
|
+
|
|
201
|
+
describe('Assigned 상태 규칙', () => {
|
|
202
|
+
it('Assigned 스레드는 assignee가 있어야 한다', () => {
|
|
203
|
+
const thread = {
|
|
204
|
+
state: ActivityThreadStatus.Assigned,
|
|
205
|
+
assignee: { id: 'user-1', name: 'User' }
|
|
206
|
+
}
|
|
207
|
+
expect(thread.assignee).toBeDefined()
|
|
208
|
+
})
|
|
209
|
+
|
|
210
|
+
it('Assigned 시 assignedAt이 설정되어야 한다', () => {
|
|
211
|
+
const now = new Date()
|
|
212
|
+
const thread = {
|
|
213
|
+
state: ActivityThreadStatus.Assigned,
|
|
214
|
+
assignedAt: now
|
|
215
|
+
}
|
|
216
|
+
expect(thread.assignedAt).toEqual(now)
|
|
217
|
+
})
|
|
218
|
+
})
|
|
219
|
+
|
|
220
|
+
describe('Started 상태 규칙', () => {
|
|
221
|
+
it('Started 시 startedAt이 설정되어야 한다', () => {
|
|
222
|
+
const now = new Date()
|
|
223
|
+
const thread = {
|
|
224
|
+
state: ActivityThreadStatus.Started,
|
|
225
|
+
startedAt: now
|
|
226
|
+
}
|
|
227
|
+
expect(thread.startedAt).toEqual(now)
|
|
228
|
+
})
|
|
229
|
+
})
|
|
230
|
+
|
|
231
|
+
describe('Ended 상태 규칙', () => {
|
|
232
|
+
it('Ended 시 terminatedAt이 설정되어야 한다', () => {
|
|
233
|
+
const now = new Date()
|
|
234
|
+
const thread = {
|
|
235
|
+
state: ActivityThreadStatus.Ended,
|
|
236
|
+
terminatedAt: now
|
|
237
|
+
}
|
|
238
|
+
expect(thread.terminatedAt).toEqual(now)
|
|
239
|
+
})
|
|
240
|
+
})
|
|
241
|
+
|
|
242
|
+
describe('Rejected 상태 규칙', () => {
|
|
243
|
+
it('Rejected 후 다시 시작할 수 있어야 한다 (round 증가)', () => {
|
|
244
|
+
const thread = {
|
|
245
|
+
state: ActivityThreadStatus.Rejected,
|
|
246
|
+
round: 1
|
|
247
|
+
}
|
|
248
|
+
// 재시작 시 round 증가
|
|
249
|
+
const nextRound = thread.round + 1
|
|
250
|
+
expect(nextRound).toBe(2)
|
|
251
|
+
})
|
|
252
|
+
})
|
|
253
|
+
})
|
package/translations/en.json
CHANGED
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
"text.assign": "assign",
|
|
132
132
|
"text.draft": "draft",
|
|
133
133
|
"text.installable-activities": "installable activities",
|
|
134
|
-
"text.no activity thread info": "
|
|
134
|
+
"text.no activity thread info": "No activity thread information",
|
|
135
135
|
"text.pick": "pick",
|
|
136
136
|
"text.save": "save",
|
|
137
137
|
"text.enter a comment": "please, enter a comment",
|