@things-factory/worklist 6.0.45 → 6.0.47

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 (161) hide show
  1. package/client/bootstrap.ts +5 -0
  2. package/client/components/activity-starter-form.ts +53 -303
  3. package/client/pages/activity/activity-list-page.ts +44 -28
  4. package/client/pages/activity/activity-page.ts +7 -5
  5. package/client/pages/activity/activity-partial-view.ts +2 -1
  6. package/client/pages/activity/starter-list-page.ts +16 -11
  7. package/client/pages/activity-approval/activity-approval-page.ts +21 -9
  8. package/client/pages/activity-instance/activity-instance-search-page.ts +2 -19
  9. package/client/pages/activity-instance/activity-instance-start-page.ts +517 -0
  10. package/client/pages/activity-thread/activity-thread-page.ts +5 -3
  11. package/client/pages/activity-thread/activity-thread-view-page.ts +4 -2
  12. package/client/pages/installable-activity/installable-activity-list-page.ts +7 -5
  13. package/client/pages/todo/approval-done-list-page.ts +7 -7
  14. package/client/pages/todo/approval-pending-list-page.ts +48 -10
  15. package/client/pages/todo/done-list-page.ts +1 -1
  16. package/client/pages/todo/draft-list-page.ts +26 -102
  17. package/client/pages/todo/todo-list-page.ts +1 -1
  18. package/client/route.ts +2 -2
  19. package/client/templates/activity-approval-context-template.ts +4 -0
  20. package/client/templates/activity-instance-context-template.ts +171 -0
  21. package/client/templates/activity-thread-context-template.ts +4 -0
  22. package/client/types/activity-instance-type.ts +4 -2
  23. package/client/types/activity-instance.ts +2 -2
  24. package/client/types/activity.ts +7 -0
  25. package/client/types/types.ts +8 -0
  26. package/dist-client/bootstrap.d.ts +1 -0
  27. package/dist-client/bootstrap.js +5 -0
  28. package/dist-client/bootstrap.js.map +1 -1
  29. package/dist-client/components/activity-starter-form.d.ts +2 -5
  30. package/dist-client/components/activity-starter-form.js +55 -247
  31. package/dist-client/components/activity-starter-form.js.map +1 -1
  32. package/dist-client/pages/activity/activity-list-page.d.ts +1 -1
  33. package/dist-client/pages/activity/activity-list-page.js +45 -30
  34. package/dist-client/pages/activity/activity-list-page.js.map +1 -1
  35. package/dist-client/pages/activity/activity-page.d.ts +1 -1
  36. package/dist-client/pages/activity/activity-page.js +5 -5
  37. package/dist-client/pages/activity/activity-page.js.map +1 -1
  38. package/dist-client/pages/activity/activity-partial-view.js +2 -2
  39. package/dist-client/pages/activity/activity-partial-view.js.map +1 -1
  40. package/dist-client/pages/activity/starter-list-page.d.ts +1 -0
  41. package/dist-client/pages/activity/starter-list-page.js +14 -11
  42. package/dist-client/pages/activity/starter-list-page.js.map +1 -1
  43. package/dist-client/pages/activity-approval/activity-approval-page.d.ts +3 -3
  44. package/dist-client/pages/activity-approval/activity-approval-page.js +16 -9
  45. package/dist-client/pages/activity-approval/activity-approval-page.js.map +1 -1
  46. package/dist-client/pages/activity-instance/activity-instance-page.d.ts +2 -2
  47. package/dist-client/pages/activity-instance/activity-instance-page.js +19 -10
  48. package/dist-client/pages/activity-instance/activity-instance-page.js.map +1 -1
  49. package/dist-client/pages/activity-instance/activity-instance-search-page.js +1 -8
  50. package/dist-client/pages/activity-instance/activity-instance-search-page.js.map +1 -1
  51. package/dist-client/pages/activity-instance/activity-instance-start-page.d.ts +49 -0
  52. package/dist-client/pages/activity-instance/activity-instance-start-page.js +451 -0
  53. package/dist-client/pages/activity-instance/activity-instance-start-page.js.map +1 -0
  54. package/dist-client/pages/activity-thread/activity-thread-page.js +3 -3
  55. package/dist-client/pages/activity-thread/activity-thread-page.js.map +1 -1
  56. package/dist-client/pages/activity-thread/activity-thread-view-page.js +2 -2
  57. package/dist-client/pages/activity-thread/activity-thread-view-page.js.map +1 -1
  58. package/dist-client/pages/installable-activity/installable-activity-list-page.js +7 -5
  59. package/dist-client/pages/installable-activity/installable-activity-list-page.js.map +1 -1
  60. package/dist-client/pages/todo/approval-done-list-page.js +7 -7
  61. package/dist-client/pages/todo/approval-done-list-page.js.map +1 -1
  62. package/dist-client/pages/todo/approval-pending-list-page.js +44 -9
  63. package/dist-client/pages/todo/approval-pending-list-page.js.map +1 -1
  64. package/dist-client/pages/todo/done-list-page.js +1 -1
  65. package/dist-client/pages/todo/done-list-page.js.map +1 -1
  66. package/dist-client/pages/todo/draft-list-page.d.ts +1 -0
  67. package/dist-client/pages/todo/draft-list-page.js +25 -99
  68. package/dist-client/pages/todo/draft-list-page.js.map +1 -1
  69. package/dist-client/pages/todo/todo-list-page.js +1 -1
  70. package/dist-client/pages/todo/todo-list-page.js.map +1 -1
  71. package/dist-client/route.d.ts +1 -1
  72. package/dist-client/route.js +2 -2
  73. package/dist-client/route.js.map +1 -1
  74. package/dist-client/templates/activity-approval-context-template.js +4 -0
  75. package/dist-client/templates/activity-approval-context-template.js.map +1 -1
  76. package/dist-client/templates/activity-instance-context-template.d.ts +2 -0
  77. package/dist-client/templates/activity-instance-context-template.js +145 -0
  78. package/dist-client/templates/activity-instance-context-template.js.map +1 -0
  79. package/dist-client/templates/activity-thread-context-template.js +4 -0
  80. package/dist-client/templates/activity-thread-context-template.js.map +1 -1
  81. package/dist-client/tsconfig.tsbuildinfo +1 -1
  82. package/dist-client/types/activity-instance-type.d.ts +3 -2
  83. package/dist-client/types/activity-instance-type.js +2 -2
  84. package/dist-client/types/activity-instance-type.js.map +1 -1
  85. package/dist-client/types/activity-instance.d.ts +1 -1
  86. package/dist-client/types/activity-instance.js +2 -2
  87. package/dist-client/types/activity-instance.js.map +1 -1
  88. package/dist-client/types/activity.d.ts +5 -0
  89. package/dist-client/types/activity.js +5 -0
  90. package/dist-client/types/activity.js.map +1 -1
  91. package/dist-client/types/types.d.ts +4 -0
  92. package/dist-client/types/types.js +6 -0
  93. package/dist-client/types/types.js.map +1 -1
  94. package/dist-server/controllers/activity-instance/assign.js +1 -1
  95. package/dist-server/controllers/activity-instance/assign.js.map +1 -1
  96. package/dist-server/controllers/activity-instance/draft.js +24 -6
  97. package/dist-server/controllers/activity-instance/draft.js.map +1 -1
  98. package/dist-server/controllers/activity-instance/index.js +1 -1
  99. package/dist-server/controllers/activity-instance/index.js.map +1 -1
  100. package/dist-server/controllers/activity-instance/issue.js +105 -0
  101. package/dist-server/controllers/activity-instance/issue.js.map +1 -0
  102. package/dist-server/controllers/activity-instance/pick.js +1 -1
  103. package/dist-server/controllers/activity-instance/pick.js.map +1 -1
  104. package/dist-server/controllers/activity-instance/post.js +7 -7
  105. package/dist-server/controllers/activity-instance/post.js.map +1 -1
  106. package/dist-server/controllers/common.js +33 -9
  107. package/dist-server/controllers/common.js.map +1 -1
  108. package/dist-server/routes.js +2 -2
  109. package/dist-server/routes.js.map +1 -1
  110. package/dist-server/service/activity/activity-history.js +6 -2
  111. package/dist-server/service/activity/activity-history.js.map +1 -1
  112. package/dist-server/service/activity/activity-query.js +84 -1
  113. package/dist-server/service/activity/activity-query.js.map +1 -1
  114. package/dist-server/service/activity/activity-type.js +8 -0
  115. package/dist-server/service/activity/activity-type.js.map +1 -1
  116. package/dist-server/service/activity/activity.js +36 -3
  117. package/dist-server/service/activity/activity.js.map +1 -1
  118. package/dist-server/service/activity-instance/activity-instance-history.js +1 -1
  119. package/dist-server/service/activity-instance/activity-instance-history.js.map +1 -1
  120. package/dist-server/service/activity-instance/activity-instance-mutation.js +6 -6
  121. package/dist-server/service/activity-instance/activity-instance-mutation.js.map +1 -1
  122. package/dist-server/service/activity-instance/activity-instance-query.js +2 -2
  123. package/dist-server/service/activity-instance/activity-instance-query.js.map +1 -1
  124. package/dist-server/service/activity-instance/activity-instance-type.js +62 -50
  125. package/dist-server/service/activity-instance/activity-instance-type.js.map +1 -1
  126. package/dist-server/service/activity-instance/activity-instance.js +4 -23
  127. package/dist-server/service/activity-instance/activity-instance.js.map +1 -1
  128. package/dist-server/service/activity-summary/activity-summary-query.js +1 -1
  129. package/dist-server/service/activity-summary/activity-summary-query.js.map +1 -1
  130. package/dist-server/service/installable-activity/installable-activity.js +4 -0
  131. package/dist-server/service/installable-activity/installable-activity.js.map +1 -1
  132. package/dist-server/tsconfig.tsbuildinfo +1 -1
  133. package/helps/worklist/activity.md +91 -0
  134. package/helps/worklist/draft-list.md +5 -1
  135. package/helps/worklist/starter-list.md +34 -0
  136. package/package.json +2 -2
  137. package/server/controllers/activity-instance/assign.ts +1 -1
  138. package/server/controllers/activity-instance/draft.ts +33 -6
  139. package/server/controllers/activity-instance/index.ts +1 -1
  140. package/server/controllers/activity-instance/issue.ts +175 -0
  141. package/server/controllers/activity-instance/pick.ts +1 -1
  142. package/server/controllers/common.ts +43 -9
  143. package/server/routes.ts +2 -2
  144. package/server/service/activity/activity-history.ts +5 -2
  145. package/server/service/activity/activity-query.ts +85 -2
  146. package/server/service/activity/activity-type.ts +15 -2
  147. package/server/service/activity/activity.ts +28 -2
  148. package/server/service/activity-instance/activity-instance-history.ts +1 -1
  149. package/server/service/activity-instance/activity-instance-mutation.ts +7 -7
  150. package/server/service/activity-instance/activity-instance-query.ts +3 -3
  151. package/server/service/activity-instance/activity-instance-type.ts +13 -4
  152. package/server/service/activity-instance/activity-instance.ts +4 -16
  153. package/server/service/activity-summary/activity-summary-query.ts +1 -1
  154. package/server/service/installable-activity/installable-activity.ts +4 -1
  155. package/things-factory.config.js +1 -1
  156. package/translations/en.json +13 -0
  157. package/translations/ko.json +17 -4
  158. package/translations/ms.json +13 -0
  159. package/translations/zh.json +13 -0
  160. package/client/pages/activity-instance/activity-instance-page.ts +0 -445
  161. package/server/controllers/activity-instance/post.ts +0 -140
@@ -0,0 +1,517 @@
1
+ import '@operato/property-editor/ox-properties-dynamic-view.js'
2
+ import '@operato/board/ox-board-viewer.js'
3
+ import '@things-factory/organization'
4
+
5
+ import gql from 'graphql-tag'
6
+ import { css, html } from 'lit'
7
+ import { unsafeHTML } from 'lit-html/directives/unsafe-html.js'
8
+ import { customElement, property, query, state } from 'lit/decorators.js'
9
+ import { keyed } from 'lit/directives/keyed.js'
10
+ import { connect } from 'pwa-helpers/connect-mixin.js'
11
+ import { client } from '@operato/graphql'
12
+ import { i18next, localize } from '@operato/i18n'
13
+ import { PageView, store } from '@operato/shell'
14
+ import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'
15
+ import { provider } from '@things-factory/board-ui'
16
+ import { notify } from '@operato/layout'
17
+
18
+ @customElement('activity-instance-start-page')
19
+ export class ActivityInstanceStartPage extends connect(store)(localize(i18next)(PageView)) {
20
+ static styles = [
21
+ ScrollbarStyles,
22
+ CommonGristStyles,
23
+ css`
24
+ :host {
25
+ display: flex;
26
+ flex-direction: column;
27
+
28
+ width: 100%;
29
+ padding: 5px;
30
+ overflow: auto;
31
+ }
32
+
33
+ ox-board-viewer {
34
+ width: 100%;
35
+ height: 100%;
36
+ }
37
+
38
+ #custom-content {
39
+ flex: 1;
40
+ }
41
+ `
42
+ ]
43
+
44
+ @state() activity: any = {}
45
+ @state() activityInstance: any = {}
46
+ @state() board: any
47
+
48
+ @query('ox-board-viewer') viewer: any
49
+
50
+ get context() {
51
+ const { startingType } = this.activity
52
+ const { state } = this.activityInstance
53
+
54
+ const issuable = state === 'draft'
55
+
56
+ return {
57
+ title: this.lifecycle?.params?.['title'] || i18next.t('title.activity'),
58
+ help: 'worklist/activity-instance-single-post',
59
+ actions: [
60
+ issuable && {
61
+ title: i18next.t('button.draft'),
62
+ action: this.draftActivityInstance.bind(this),
63
+ ...CommonButtonStyles.save
64
+ },
65
+ issuable && {
66
+ title: i18next.t(startingType == 'issue' ? 'button.issue' : 'button.post'),
67
+ action: this.issueActivityInstance.bind(this),
68
+ ...CommonButtonStyles.submit
69
+ }
70
+ ].filter(Boolean /* truthy only */),
71
+ activityInstance: this.activityInstance
72
+ }
73
+ }
74
+
75
+ render() {
76
+ return html` ${this.activityContent()}`
77
+ }
78
+
79
+ activityContent() {
80
+ switch (this.activityInstance?.uiType) {
81
+ case 'template':
82
+ return this.templateContent()
83
+ case 'generated':
84
+ return this.generatedContent()
85
+ case 'board':
86
+ return this.boardContent()
87
+ case 'custom-element':
88
+ return this.customElementContent()
89
+ case 'page':
90
+ case 'external':
91
+ default:
92
+ return html``
93
+ }
94
+ }
95
+
96
+ templateContent() {
97
+ const { uiSource: template } = this.activityInstance
98
+ return unsafeHTML(template)
99
+ }
100
+
101
+ getInputSpec() {
102
+ const model = this.activity?.model
103
+
104
+ return (model || [])
105
+ .filter(item => item.inout === 'in' || item.inout === 'inout')
106
+ .map(item => {
107
+ return {
108
+ ...item,
109
+ label: item.name,
110
+ property: item.options
111
+ }
112
+ })
113
+ }
114
+
115
+ getOutputSpec() {
116
+ const model = this.activity?.model
117
+
118
+ return (model || [])
119
+ .filter(item => item.inout === 'inout' || item.inout === 'out')
120
+ .map(item => {
121
+ return {
122
+ ...item,
123
+ label: item.name,
124
+ property: item.options
125
+ }
126
+ })
127
+ }
128
+
129
+ generatedContent() {
130
+ var { input, output } = this.activityInstance || {}
131
+
132
+ const inputSpec = this.getInputSpec()
133
+ const outputSpec = this.getOutputSpec()
134
+
135
+ if (!output) {
136
+ output = inputSpec
137
+ .filter(item => item.inout === 'inout')
138
+ .reduce((inout, item) => {
139
+ inout[item.name] = input?.[item.name]
140
+ return inout
141
+ }, {})
142
+ }
143
+
144
+ return keyed(
145
+ this.activityInstance.id,
146
+ html`
147
+ <fieldset>
148
+ <legend>Input</legend>
149
+ <ox-properties-dynamic-view
150
+ data-name="input"
151
+ .props=${inputSpec}
152
+ .value=${input}
153
+ @property-change=${e => (this.activityInstance.input = e.currentTarget.value)}
154
+ ></ox-properties-dynamic-view>
155
+ </fieldset>
156
+
157
+ <fieldset>
158
+ <legend>Output</legend>
159
+ <ox-properties-dynamic-view
160
+ data-name="output"
161
+ .props=${outputSpec}
162
+ .value=${output}
163
+ @property-change=${e => (this.activityInstance.output = e.currentTarget.value)}
164
+ ></ox-properties-dynamic-view>
165
+ </fieldset>
166
+ `
167
+ )
168
+ }
169
+
170
+ boardContent() {
171
+ const { uiSource: boardId, input, output } = this.activityInstance
172
+
173
+ if (!this.board || this.board.id !== boardId) {
174
+ this.board = {
175
+ id: boardId
176
+ }
177
+ }
178
+
179
+ /*
180
+ ox-board-viewer에서 provider에 의해 공급되는 board가 각 id별로 instance를 하나씩 밖에 가지지 않으므로,
181
+ 동일한 id의 보드를 다른 page에 뺏기는 경우가 있다.
182
+ 따라서, Page가 active될 때마다 타임스탬프를 refresh key로 설정하였다.
183
+ */
184
+ return keyed(
185
+ this.activityInstance.id,
186
+ html`
187
+ <ox-board-viewer
188
+ style="background-color: white;"
189
+ .board=${this.board}
190
+ .provider=${provider}
191
+ .values=${{ ...input, ...output }}
192
+ hide-fullscreen
193
+ hide-navigation
194
+ ></ox-board-viewer>
195
+ `
196
+ )
197
+ }
198
+
199
+ customElementContent() {
200
+ const { uiSource: tagName, input, output } = this.activityInstance
201
+
202
+ const element = document.createElement(tagName)
203
+ element.id = 'custom-content'
204
+ element.input = input
205
+ element.output = output
206
+
207
+ element.addEventListener('change-input', (e: CustomEvent) => {
208
+ this.activityInstance.input = e.detail
209
+ })
210
+ element.addEventListener('change-output', (e: CustomEvent) => {
211
+ this.activityInstance.output = e.detail
212
+ })
213
+
214
+ /* DEPRECATED 일반적으로 output만 수정될 가능성이 높기때문에, change 이벤트는 output을 수정하는 것으로 한다. */
215
+ element.addEventListener('change', (e: CustomEvent) => {
216
+ this.activityInstance.output = e.detail
217
+ })
218
+
219
+ return element
220
+ }
221
+
222
+ getInOutFromBoard() {
223
+ const inputSpec = this.getInputSpec()
224
+ const outputSpec = this.getOutputSpec()
225
+ const data = this.viewer?.getSceneValues() || {}
226
+
227
+ const input = inputSpec.reduce((input, spec) => {
228
+ input[spec.name] = data[spec.name]
229
+ return input
230
+ }, {})
231
+
232
+ const output = outputSpec.reduce((output, spec) => {
233
+ output[spec.name] = data[spec.name]
234
+ return output
235
+ }, {})
236
+
237
+ return [input, output]
238
+ }
239
+
240
+ updated(changes) {
241
+ if (changes.has('activityInstance')) {
242
+ this.updateContext()
243
+ }
244
+ }
245
+
246
+ async pageUpdated(changes, lifecycle, changedBefore) {
247
+ if (this.active) {
248
+ this.fetchActivityInstance(lifecycle.resourceId)
249
+ }
250
+ }
251
+
252
+ async fetchActivityInstance(id) {
253
+ const response = await client.query({
254
+ query: gql`
255
+ query activityInstance($id: String!) {
256
+ activityInstance(id: $id) {
257
+ id
258
+ name
259
+ description
260
+ state
261
+ activity {
262
+ startingType
263
+ model {
264
+ name
265
+ description
266
+ active
267
+ tag
268
+ inout
269
+ type
270
+ unit
271
+ options
272
+ quantifier
273
+ spec
274
+ }
275
+ }
276
+ thumbnail
277
+ input
278
+ output
279
+ uiType
280
+ uiSource
281
+ approvalLine {
282
+ type
283
+ value
284
+ approver {
285
+ id
286
+ name
287
+ description
288
+ controlNo
289
+ }
290
+ }
291
+ dueAt
292
+ createdAt
293
+ }
294
+ }
295
+ `,
296
+ variables: {
297
+ id
298
+ }
299
+ })
300
+
301
+ this.activityInstance = response.data.activityInstance
302
+ this.activity = this.activityInstance.activity
303
+ }
304
+
305
+ async draftActivityInstance() {
306
+ var { id: activityId } = this.activity
307
+ var {
308
+ id,
309
+ name,
310
+ description,
311
+ priority,
312
+ threadsMin,
313
+ threadsMax,
314
+ dueAt,
315
+ input,
316
+ output,
317
+ reason,
318
+ uiType,
319
+ assignees,
320
+ approvalLine
321
+ } = this.activityInstance
322
+
323
+ if (uiType === 'board') {
324
+ ;[input, output] = this.getInOutFromBoard()
325
+ }
326
+
327
+ name ||= this.activity.name
328
+ description ||= this.activity.description
329
+ assignees ||= this.activity.assignees
330
+ approvalLine ||= this.activity.approvalLine
331
+
332
+ var activityInstance = {
333
+ id,
334
+ activityId,
335
+ name,
336
+ description,
337
+ priority,
338
+ threadsMax,
339
+ threadsMin,
340
+ dueAt,
341
+ input,
342
+ output,
343
+ reason,
344
+ assignees,
345
+ approvalLine
346
+ }
347
+
348
+ const response = await client.mutate({
349
+ mutation: gql`
350
+ mutation ($activityInstance: ActivityInstanceDraft!) {
351
+ draftActivityInstance(activityInstance: $activityInstance) {
352
+ id
353
+ name
354
+ description
355
+ input
356
+ output
357
+ state
358
+ activity {
359
+ startingType
360
+ model {
361
+ name
362
+ description
363
+ active
364
+ tag
365
+ inout
366
+ type
367
+ unit
368
+ options
369
+ quantifier
370
+ spec
371
+ }
372
+ }
373
+ assignees {
374
+ type
375
+ value
376
+ assignee {
377
+ id
378
+ name
379
+ description
380
+ controlNo
381
+ }
382
+ }
383
+ approvalLine {
384
+ type
385
+ value
386
+ approver {
387
+ id
388
+ name
389
+ description
390
+ controlNo
391
+ }
392
+ }
393
+ uiType
394
+ uiSource
395
+ threadsMin
396
+ threadsMax
397
+ }
398
+ }
399
+ `,
400
+ variables: {
401
+ activityInstance
402
+ }
403
+ })
404
+
405
+ if (!response.errors) {
406
+ this.activityInstance = response.data.draftActivityInstance
407
+ this.activity = this.activityInstance.activity
408
+
409
+ notify({
410
+ message: i18next.t('text.info_x_successfully', {
411
+ x: `${i18next.t('label.activity-instance')} ${i18next.t('text.draft')}`
412
+ })
413
+ })
414
+ }
415
+ }
416
+
417
+ async issueActivityInstance() {
418
+ var {
419
+ id,
420
+ name,
421
+ description,
422
+ input,
423
+ output,
424
+ reason,
425
+ uiType,
426
+ threadsMin = 0,
427
+ threadsMax = 0,
428
+ assignees,
429
+ approvalLine
430
+ } = this.activityInstance
431
+
432
+ if (uiType === 'board') {
433
+ ;[input, output] = this.getInOutFromBoard()
434
+ }
435
+
436
+ const activityInstance = {
437
+ id,
438
+ name: name || this.activity.name,
439
+ description: description || this.activity.description,
440
+ threadsMin,
441
+ threadsMax,
442
+ input,
443
+ output,
444
+ reason,
445
+ assignees,
446
+ approvalLine
447
+ }
448
+
449
+ const response = await client.mutate({
450
+ mutation: gql`
451
+ mutation ($activityInstance: ActivityInstanceIssue!) {
452
+ issueActivityInstance(activityInstance: $activityInstance) {
453
+ id
454
+ name
455
+ description
456
+ input
457
+ output
458
+ state
459
+ activity {
460
+ startingType
461
+ model {
462
+ name
463
+ description
464
+ active
465
+ tag
466
+ inout
467
+ type
468
+ unit
469
+ options
470
+ quantifier
471
+ spec
472
+ }
473
+ }
474
+ assignees {
475
+ type
476
+ value
477
+ assignee {
478
+ id
479
+ name
480
+ description
481
+ controlNo
482
+ }
483
+ }
484
+ approvalLine {
485
+ type
486
+ value
487
+ approver {
488
+ id
489
+ name
490
+ description
491
+ controlNo
492
+ }
493
+ }
494
+ uiType
495
+ uiSource
496
+ threadsMin
497
+ threadsMax
498
+ }
499
+ }
500
+ `,
501
+ variables: {
502
+ activityInstance
503
+ }
504
+ })
505
+
506
+ if (!response.errors) {
507
+ this.activityInstance = response.data.issueActivityInstance
508
+ this.activity = this.activityInstance.activity
509
+
510
+ notify({
511
+ message: i18next.t('text.info_x_successfully', {
512
+ x: `${i18next.t('label.activity-instance')} ${i18next.t('text.assign')}`
513
+ })
514
+ })
515
+ }
516
+ }
517
+ }
@@ -125,7 +125,7 @@ export class ActivityThreadPage extends connect(store)(localize(i18next)(PageVie
125
125
  submittable && {
126
126
  title: i18next.t('button.submit'),
127
127
  action: this._submitActivityThread.bind(this),
128
- ...CommonButtonStyles.save
128
+ ...CommonButtonStyles.submit
129
129
  },
130
130
 
131
131
  delegatable && {
@@ -184,7 +184,8 @@ export class ActivityThreadPage extends connect(store)(localize(i18next)(PageVie
184
184
  .map(item => {
185
185
  return {
186
186
  ...item,
187
- label: item.name
187
+ label: item.name,
188
+ property: item.options
188
189
  }
189
190
  })
190
191
  }
@@ -197,7 +198,8 @@ export class ActivityThreadPage extends connect(store)(localize(i18next)(PageVie
197
198
  .map(item => {
198
199
  return {
199
200
  ...item,
200
- label: item.name
201
+ label: item.name,
202
+ property: item.options
201
203
  }
202
204
  })
203
205
  }
@@ -146,7 +146,8 @@ export class ActivityThreadViewPage extends connect(store)(localize(i18next)(Pag
146
146
  .map(item => {
147
147
  return {
148
148
  ...item,
149
- label: item.name
149
+ label: item.name,
150
+ property: item.options
150
151
  }
151
152
  })
152
153
  }
@@ -159,7 +160,8 @@ export class ActivityThreadViewPage extends connect(store)(localize(i18next)(Pag
159
160
  .map(item => {
160
161
  return {
161
162
  ...item,
162
- label: item.name
163
+ label: item.name,
164
+ property: item.options
163
165
  }
164
166
  })
165
167
  }
@@ -14,7 +14,7 @@ import { PageView, store } from '@operato/shell'
14
14
  import { CommonGristStyles, ScrollbarStyles } from '@operato/styles'
15
15
  import { isMobileDevice } from '@operato/utils'
16
16
 
17
- import { ActivityTypes, ActivityUITypes } from '../../types/types.js'
17
+ import { ActivityStartingTypes, ActivityTypes, ActivityUITypes } from '../../types/types.js'
18
18
 
19
19
  @customElement('installable-activity-list-page')
20
20
  export class ActivityTemplateListPage extends connect(store)(localize(i18next)(PageView)) {
@@ -300,12 +300,13 @@ export class ActivityTemplateListPage extends connect(store)(localize(i18next)(P
300
300
  width: 140
301
301
  },
302
302
  {
303
- type: 'checkbox',
304
- name: 'startable',
303
+ type: 'select',
304
+ name: 'startingType',
305
305
  label: true,
306
- header: i18next.t('field.startable'),
306
+ header: i18next.t('field.starting-type'),
307
307
  record: {
308
- editable: false
308
+ editable: false,
309
+ options: ActivityStartingTypes
309
310
  },
310
311
  sortable: true,
311
312
  width: 60
@@ -340,6 +341,7 @@ export class ActivityTemplateListPage extends connect(store)(localize(i18next)(P
340
341
  activityType
341
342
  priority
342
343
  startable
344
+ startingType
343
345
  model {
344
346
  name
345
347
  description
@@ -240,13 +240,13 @@ export class ApprovalDoneListPage extends connect(store)(localize(i18next)(PageV
240
240
  ],
241
241
  rows: {
242
242
  appendable: false
243
- }
244
- // sorters: [
245
- // {
246
- // name: 'dueAt',
247
- // desc: false
248
- // }
249
- // ]
243
+ },
244
+ sorters: [
245
+ {
246
+ name: 'terminatedAt',
247
+ desc: true
248
+ }
249
+ ]
250
250
  }
251
251
  }
252
252