@things-factory/worklist 6.0.27 → 6.0.32

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 (195) hide show
  1. package/client/bootstrap.ts +9 -1
  2. package/client/components/activity-starter-form.ts +35 -10
  3. package/client/grist-editor/grist-editor-activity-search-key.ts +79 -0
  4. package/client/grist-editor/popup-activity-search-keys-input.ts +167 -0
  5. package/client/pages/activity/activity-list-page.ts +122 -11
  6. package/client/pages/activity/activity-partial-view.ts +85 -0
  7. package/client/pages/activity/starter-list-page.ts +1 -0
  8. package/client/pages/activity-approval/activity-approval-page.ts +6 -6
  9. package/client/pages/activity-instance/activity-instance-search-page.ts +377 -0
  10. package/client/pages/activity-instance/activity-instance-view.ts +135 -0
  11. package/client/pages/activity-store/activity-store-page.ts +1 -1
  12. package/client/pages/activity-template/activity-template-list-page.ts +29 -1
  13. package/client/pages/activity-thread/activity-thread-page.ts +8 -3
  14. package/client/pages/activity-thread/activity-thread-view.ts +102 -0
  15. package/client/pages/installable-activity/installable-activity-list-page.ts +29 -1
  16. package/client/pages/todo/approval-waiting-list-page.ts +19 -9
  17. package/client/pages/todo/done-list-page.ts +344 -0
  18. package/client/pages/todo/draft-list-page.ts +13 -2
  19. package/client/pages/todo/todo-list-page.ts +14 -3
  20. package/client/route.ts +8 -0
  21. package/client/types/activity-instance-type.ts +123 -0
  22. package/client/types/activity-instance.ts +124 -0
  23. package/client/types/activity-model-type.ts +40 -0
  24. package/client/types/activity-search-key-item-type.ts +9 -0
  25. package/client/types/activity-thread-type.ts +19 -0
  26. package/client/types/activity-thread.ts +88 -0
  27. package/client/types/activity.ts +103 -0
  28. package/client/{types.js → types/types.ts} +0 -9
  29. package/dist-client/bootstrap.js +4 -1
  30. package/dist-client/bootstrap.js.map +1 -1
  31. package/dist-client/components/activity-starter-form.d.ts +1 -1
  32. package/dist-client/components/activity-starter-form.js +34 -9
  33. package/dist-client/components/activity-starter-form.js.map +1 -1
  34. package/dist-client/grist-editor/grist-editor-activity-search-key.d.ts +12 -0
  35. package/dist-client/grist-editor/grist-editor-activity-search-key.js +70 -0
  36. package/dist-client/grist-editor/grist-editor-activity-search-key.js.map +1 -0
  37. package/dist-client/grist-editor/popup-activity-search-keys-input.d.ts +17 -0
  38. package/dist-client/grist-editor/popup-activity-search-keys-input.js +177 -0
  39. package/dist-client/grist-editor/popup-activity-search-keys-input.js.map +1 -0
  40. package/dist-client/pages/activity/activity-list-page.d.ts +4 -0
  41. package/dist-client/pages/activity/activity-list-page.js +121 -11
  42. package/dist-client/pages/activity/activity-list-page.js.map +1 -1
  43. package/dist-client/pages/activity/activity-partial-view.d.ts +13 -0
  44. package/dist-client/pages/activity/activity-partial-view.js +56 -0
  45. package/dist-client/pages/activity/activity-partial-view.js.map +1 -0
  46. package/dist-client/pages/activity/starter-list-page.js.map +1 -1
  47. package/dist-client/pages/activity-approval/activity-approval-page.js +6 -6
  48. package/dist-client/pages/activity-approval/activity-approval-page.js.map +1 -1
  49. package/dist-client/pages/activity-instance/activity-instance-search-page.d.ts +76 -0
  50. package/dist-client/pages/activity-instance/activity-instance-search-page.js +371 -0
  51. package/dist-client/pages/activity-instance/activity-instance-search-page.js.map +1 -0
  52. package/dist-client/pages/activity-instance/activity-instance-view.d.ts +14 -0
  53. package/dist-client/pages/activity-instance/activity-instance-view.js +130 -0
  54. package/dist-client/pages/activity-instance/activity-instance-view.js.map +1 -0
  55. package/dist-client/pages/activity-store/activity-store-page.js +1 -1
  56. package/dist-client/pages/activity-store/activity-store-page.js.map +1 -1
  57. package/dist-client/pages/activity-template/activity-template-list-page.js +29 -1
  58. package/dist-client/pages/activity-template/activity-template-list-page.js.map +1 -1
  59. package/dist-client/pages/activity-thread/activity-thread-page.js +8 -3
  60. package/dist-client/pages/activity-thread/activity-thread-page.js.map +1 -1
  61. package/dist-client/pages/activity-thread/activity-thread-view.d.ts +11 -0
  62. package/dist-client/pages/activity-thread/activity-thread-view.js +103 -0
  63. package/dist-client/pages/activity-thread/activity-thread-view.js.map +1 -0
  64. package/dist-client/pages/installable-activity/installable-activity-list-page.js +29 -1
  65. package/dist-client/pages/installable-activity/installable-activity-list-page.js.map +1 -1
  66. package/dist-client/pages/todo/approval-waiting-list-page.js +19 -9
  67. package/dist-client/pages/todo/approval-waiting-list-page.js.map +1 -1
  68. package/dist-client/pages/todo/done-list-page.d.ts +44 -0
  69. package/dist-client/pages/todo/done-list-page.js +342 -0
  70. package/dist-client/pages/todo/done-list-page.js.map +1 -0
  71. package/dist-client/pages/todo/draft-list-page.js +12 -2
  72. package/dist-client/pages/todo/draft-list-page.js.map +1 -1
  73. package/dist-client/pages/todo/todo-list-page.js +13 -3
  74. package/dist-client/pages/todo/todo-list-page.js.map +1 -1
  75. package/dist-client/route.d.ts +1 -1
  76. package/dist-client/route.js +6 -0
  77. package/dist-client/route.js.map +1 -1
  78. package/dist-client/tsconfig.tsbuildinfo +1 -1
  79. package/dist-client/types/activity-instance-type.d.ts +76 -0
  80. package/dist-client/types/activity-instance-type.js +11 -0
  81. package/dist-client/types/activity-instance-type.js.map +1 -0
  82. package/dist-client/types/activity-instance.d.ts +70 -0
  83. package/dist-client/types/activity-instance.js +36 -0
  84. package/dist-client/types/activity-instance.js.map +1 -0
  85. package/dist-client/types/activity-model-type.d.ts +31 -0
  86. package/dist-client/types/activity-model-type.js +18 -0
  87. package/dist-client/types/activity-model-type.js.map +1 -0
  88. package/dist-client/types/activity-search-key-item-type.d.ts +6 -0
  89. package/dist-client/types/activity-search-key-item-type.js +3 -0
  90. package/dist-client/types/activity-search-key-item-type.js.map +1 -0
  91. package/dist-client/types/activity-thread-type.d.ts +15 -0
  92. package/dist-client/types/activity-thread-type.js +7 -0
  93. package/dist-client/types/activity-thread-type.js.map +1 -0
  94. package/dist-client/types/activity-thread.d.ts +37 -0
  95. package/dist-client/types/activity-thread.js +51 -0
  96. package/dist-client/types/activity-thread.js.map +1 -0
  97. package/dist-client/types/activity.d.ts +65 -0
  98. package/dist-client/types/activity.js +35 -0
  99. package/dist-client/types/activity.js.map +1 -0
  100. package/dist-client/{types.d.ts → types/types.d.ts} +3 -7
  101. package/dist-client/{types.js → types/types.js} +0 -8
  102. package/dist-client/types/types.js.map +1 -0
  103. package/dist-server/controllers/activity-approval/approve.js +2 -0
  104. package/dist-server/controllers/activity-approval/approve.js.map +1 -1
  105. package/dist-server/controllers/activity-approval/reject.js +2 -0
  106. package/dist-server/controllers/activity-approval/reject.js.map +1 -1
  107. package/dist-server/controllers/{activity-installation-controller.js → activity-installation/activity-installation-controller.js} +8 -0
  108. package/dist-server/controllers/activity-installation/activity-installation-controller.js.map +1 -0
  109. package/dist-server/controllers/activity-installation/call-webhook.js.map +1 -0
  110. package/dist-server/controllers/activity-instance/abort.js +1 -1
  111. package/dist-server/controllers/activity-instance/abort.js.map +1 -1
  112. package/dist-server/controllers/activity-instance/adjust.js +1 -1
  113. package/dist-server/controllers/activity-instance/adjust.js.map +1 -1
  114. package/dist-server/controllers/activity-instance/delegate.js +5 -0
  115. package/dist-server/controllers/activity-instance/delegate.js.map +1 -1
  116. package/dist-server/controllers/activity-instance/draft.js +16 -1
  117. package/dist-server/controllers/activity-instance/draft.js.map +1 -1
  118. package/dist-server/controllers/activity-instance/post.js +38 -3
  119. package/dist-server/controllers/activity-instance/post.js.map +1 -1
  120. package/dist-server/controllers/activity-instance/start.js +1 -1
  121. package/dist-server/controllers/activity-instance/start.js.map +1 -1
  122. package/dist-server/controllers/activity-thread/submit.js +1 -1
  123. package/dist-server/controllers/activity-thread/submit.js.map +1 -1
  124. package/dist-server/controllers/common.js +72 -25
  125. package/dist-server/controllers/common.js.map +1 -1
  126. package/dist-server/controllers/index.js +1 -1
  127. package/dist-server/controllers/index.js.map +1 -1
  128. package/dist-server/service/activity/activity-history.js +38 -1
  129. package/dist-server/service/activity/activity-history.js.map +1 -1
  130. package/dist-server/service/activity/activity-search-key-item-type.js +28 -0
  131. package/dist-server/service/activity/activity-search-key-item-type.js.map +1 -0
  132. package/dist-server/service/activity/activity-type.js +56 -0
  133. package/dist-server/service/activity/activity-type.js.map +1 -1
  134. package/dist-server/service/activity/activity.js +40 -4
  135. package/dist-server/service/activity/activity.js.map +1 -1
  136. package/dist-server/service/activity-approval/event-subscriber.js +1 -1
  137. package/dist-server/service/activity-approval/event-subscriber.js.map +1 -1
  138. package/dist-server/service/activity-instance/activity-instance-history.js +53 -0
  139. package/dist-server/service/activity-instance/activity-instance-history.js.map +1 -1
  140. package/dist-server/service/activity-instance/activity-instance-query.js +29 -0
  141. package/dist-server/service/activity-instance/activity-instance-query.js.map +1 -1
  142. package/dist-server/service/activity-instance/activity-instance-type.js +16 -0
  143. package/dist-server/service/activity-instance/activity-instance-type.js.map +1 -1
  144. package/dist-server/service/activity-instance/activity-instance.js +63 -0
  145. package/dist-server/service/activity-instance/activity-instance.js.map +1 -1
  146. package/dist-server/service/activity-instance/event-subscriber.js +4 -4
  147. package/dist-server/service/activity-instance/event-subscriber.js.map +1 -1
  148. package/dist-server/service/activity-thread/activity-thread-query.js +27 -0
  149. package/dist-server/service/activity-thread/activity-thread-query.js.map +1 -1
  150. package/dist-server/service/activity-thread/activity-thread.js +4 -1
  151. package/dist-server/service/activity-thread/activity-thread.js.map +1 -1
  152. package/dist-server/service/installable-activity/installable-activity-mutation.js +1 -1
  153. package/dist-server/service/installable-activity/installable-activity-mutation.js.map +1 -1
  154. package/dist-server/service/installable-activity/installable-activity-query.js +1 -1
  155. package/dist-server/service/installable-activity/installable-activity-query.js.map +1 -1
  156. package/dist-server/service/installable-activity/installable-activity.js.map +1 -1
  157. package/dist-server/tsconfig.tsbuildinfo +1 -1
  158. package/package.json +9 -8
  159. package/server/controllers/activity-approval/approve.ts +3 -0
  160. package/server/controllers/activity-approval/reject.ts +3 -0
  161. package/server/controllers/{activity-installation-controller.ts → activity-installation/activity-installation-controller.ts} +12 -1
  162. package/server/controllers/activity-instance/abort.ts +1 -1
  163. package/server/controllers/activity-instance/adjust.ts +1 -1
  164. package/server/controllers/activity-instance/delegate.ts +9 -1
  165. package/server/controllers/activity-instance/draft.ts +16 -5
  166. package/server/controllers/activity-instance/post.ts +54 -6
  167. package/server/controllers/activity-instance/start.ts +1 -1
  168. package/server/controllers/activity-thread/submit.ts +1 -0
  169. package/server/controllers/common.ts +85 -28
  170. package/server/controllers/index.ts +1 -1
  171. package/server/service/activity/activity-history.ts +32 -1
  172. package/server/service/activity/activity-search-key-item-type.ts +16 -0
  173. package/server/service/activity/activity-type.ts +46 -1
  174. package/server/service/activity/activity.ts +34 -4
  175. package/server/service/activity-approval/event-subscriber.ts +1 -1
  176. package/server/service/activity-instance/activity-instance-history.ts +41 -0
  177. package/server/service/activity-instance/activity-instance-query.ts +30 -1
  178. package/server/service/activity-instance/activity-instance-type.ts +12 -0
  179. package/server/service/activity-instance/activity-instance.ts +49 -0
  180. package/server/service/activity-instance/event-subscriber.ts +4 -4
  181. package/server/service/activity-thread/activity-thread-query.ts +24 -0
  182. package/server/service/activity-thread/activity-thread.ts +6 -3
  183. package/server/service/installable-activity/installable-activity-mutation.ts +1 -1
  184. package/server/service/installable-activity/installable-activity-query.ts +1 -1
  185. package/server/service/installable-activity/installable-activity.ts +3 -1
  186. package/things-factory.config.js +5 -1
  187. package/translations/en.json +7 -0
  188. package/translations/ko.json +7 -0
  189. package/translations/ms.json +7 -0
  190. package/translations/zh.json +7 -0
  191. package/dist-client/types.js.map +0 -1
  192. package/dist-server/controllers/activity-installation-controller.js.map +0 -1
  193. package/dist-server/controllers/call-webhook.js.map +0 -1
  194. /package/dist-server/controllers/{call-webhook.js → activity-installation/call-webhook.js} +0 -0
  195. /package/server/controllers/{call-webhook.ts → activity-installation/call-webhook.ts} +0 -0
@@ -13,7 +13,7 @@ import { PageView, store } from '@operato/shell'
13
13
  import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'
14
14
  import { isMobileDevice } from '@operato/utils'
15
15
 
16
- import { ActivityTypes, ActivityUITypes } from '../../types.js'
16
+ import { ActivityTypes, ActivityUITypes } from '../../types/types.js'
17
17
 
18
18
  @customElement('installable-activity-list-page')
19
19
  export class ActivityTemplateListPage extends connect(store)(localize(i18next)(PageView)) {
@@ -229,6 +229,34 @@ export class ActivityTemplateListPage extends connect(store)(localize(i18next)(P
229
229
  },
230
230
  width: 140
231
231
  },
232
+ {
233
+ type: 'select',
234
+ name: 'viewType',
235
+ label: true,
236
+ header: i18next.t('field.view-type'),
237
+ record: {
238
+ editable: true,
239
+ options: ActivityUITypes
240
+ },
241
+ width: 80
242
+ },
243
+ {
244
+ type: 'string',
245
+ name: 'viewSource',
246
+ header: i18next.t('field.view-source'),
247
+ record: {
248
+ editable: true,
249
+ editor: function (value, column, record, rowIndex, field) {
250
+ var type = record.viewType !== 'board' ? 'script' : 'board'
251
+ return getEditor(type)(value, column, record, rowIndex, field)
252
+ },
253
+ renderer: function (value, column, record, rowIndex, field) {
254
+ var type = record.viewType !== 'board' ? 'script' : 'board'
255
+ return getRenderer(type)(value, column, record, rowIndex, field)
256
+ }
257
+ },
258
+ width: 140
259
+ },
232
260
  {
233
261
  type: 'select',
234
262
  name: 'reportType',
@@ -14,7 +14,7 @@ import { navigate, PageView, store } from '@operato/shell'
14
14
  import { CommonGristStyles, ScrollbarStyles } from '@operato/styles'
15
15
  import { isMobileDevice, sleep } from '@operato/utils'
16
16
 
17
- import { ActivityInstanceStatus, Priorities } from '../../types.js'
17
+ import { Priorities } from '../../types/types.js'
18
18
 
19
19
  const MIN = 60
20
20
  const HOUR = 60 * MIN
@@ -153,14 +153,14 @@ export class ApprovalWaitingListPage extends connect(store)(localize(i18next)(Pa
153
153
  },
154
154
  {
155
155
  type: 'string',
156
- name: 'uiSource',
157
- header: i18next.t('field.ui-source'),
156
+ name: 'viewSource',
157
+ header: i18next.t('field.view-source'),
158
158
  record: {
159
159
  editable: false,
160
160
  renderer: function (value, column, record, rowIndex, field) {
161
- const { uiType, uiSource } = record.activity || {}
162
- var type = uiType !== 'board' ? 'string' : 'board'
163
- return getRenderer(type)(uiSource, column, record, rowIndex, field)
161
+ const { viewType, viewSource } = record.activity || {}
162
+ var type = viewType !== 'board' ? 'string' : 'board'
163
+ return getRenderer(type)(viewSource, column, record, rowIndex, field)
164
164
  }
165
165
  },
166
166
  width: 140,
@@ -183,7 +183,17 @@ export class ApprovalWaitingListPage extends connect(store)(localize(i18next)(Pa
183
183
  header: i18next.t('field.status'),
184
184
  record: {
185
185
  editable: false,
186
- options: ActivityInstanceStatus
186
+ options: [
187
+ { display: 'Draft', value: 'draft' },
188
+ { display: 'Posted', value: 'posted' },
189
+ { display: 'WaitingAssignment', value: 'waiting-assignment' },
190
+ { display: 'Assigned', value: 'assigned' },
191
+ { display: 'Started', value: 'started' },
192
+ { display: 'Pending', value: 'pending' },
193
+ { display: 'Escalated', value: 'escalated' },
194
+ { display: 'Ended', value: 'ended' },
195
+ { display: 'Aborted', value: 'aborted' }
196
+ ]
187
197
  },
188
198
  // filter: true,
189
199
  width: 60
@@ -304,8 +314,8 @@ export class ApprovalWaitingListPage extends connect(store)(localize(i18next)(Pa
304
314
  input
305
315
  refBy
306
316
  activityType
307
- uiType
308
- uiSource
317
+ viewType
318
+ viewSource
309
319
  thumbnail
310
320
  updatedAt
311
321
  createdAt
@@ -0,0 +1,344 @@
1
+ import '@operato/data-grist'
2
+ import '@operato/input/ox-input-select-buttons.js'
3
+
4
+ import gql from 'graphql-tag'
5
+ import { css, html } from 'lit'
6
+ import { customElement, property, query, state } from 'lit/decorators.js'
7
+ import { connect } from 'pwa-helpers/connect-mixin.js'
8
+
9
+ import { DataGrist, getRenderer } from '@operato/data-grist'
10
+ import { client } from '@operato/graphql'
11
+ import { i18next, localize } from '@operato/i18n'
12
+ import { navigate, PageView, store } from '@operato/shell'
13
+ import { CommonGristStyles, ScrollbarStyles } from '@operato/styles'
14
+ import { isMobileDevice, sleep } from '@operato/utils'
15
+
16
+ import { Priorities } from '../../types/types.js'
17
+
18
+ const FILTERS = [
19
+ {
20
+ display: 'Important',
21
+ value: 'Important'
22
+ },
23
+ {
24
+ display: 'Imminent',
25
+ value: 'Imminent'
26
+ },
27
+ {
28
+ display: 'Disapproved',
29
+ value: 'Disapproved'
30
+ }
31
+ ]
32
+
33
+ @customElement('done-list-page')
34
+ export class DoneListPage extends connect(store)(localize(i18next)(PageView)) {
35
+ static styles = [
36
+ ScrollbarStyles,
37
+ CommonGristStyles,
38
+ css`
39
+ :host {
40
+ display: flex;
41
+
42
+ width: 100%;
43
+
44
+ --grid-record-emphasized-background-color: red;
45
+ --grid-record-emphasized-color: yellow;
46
+ }
47
+
48
+ #modes {
49
+ margin-left: auto;
50
+ }
51
+ `
52
+ ]
53
+
54
+ @property({ type: Object }) gristConfig?: any
55
+ @property({ type: String }) mode: 'GRID' | 'LIST' | 'CARD' = isMobileDevice() ? 'CARD' : 'GRID'
56
+
57
+ @query('ox-grist') grist!: DataGrist
58
+
59
+ @state() filters?: string[]
60
+
61
+ get context() {
62
+ return {
63
+ search: {
64
+ handler: (search: string) => {
65
+ this.grist.searchText = search
66
+ },
67
+ placeholder: i18next.t('title.done list'),
68
+ value: this.grist.searchText
69
+ },
70
+ filter: {
71
+ handler: () => {
72
+ this.grist.toggleHeadroom()
73
+ }
74
+ },
75
+ help: 'worklist/done-list',
76
+ actions: []
77
+ }
78
+ }
79
+
80
+ render() {
81
+ const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID')
82
+
83
+ return html`
84
+ <ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
85
+ <div slot="headroom">
86
+ <div id="filters">
87
+ <ox-input-select-buttons
88
+ .value=${this.filters}
89
+ .options=${FILTERS}
90
+ @change=${(e: CustomEvent) => {
91
+ this.filters = (e.currentTarget as any)?.value
92
+ }}
93
+ multiple
94
+ ></ox-input-select-buttons>
95
+ </div>
96
+
97
+ <div id="modes">
98
+ <mwc-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</mwc-icon>
99
+ <mwc-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</mwc-icon>
100
+ <mwc-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</mwc-icon>
101
+ </div>
102
+ </div>
103
+ </ox-grist>
104
+ `
105
+ }
106
+
107
+ async pageInitialized(lifecycle) {
108
+ this.gristConfig = {
109
+ list: {
110
+ thumbnail: 'thumbnail',
111
+ fields: ['name', 'description'],
112
+ details: ['createdAt', 'due']
113
+ },
114
+ columns: [
115
+ { type: 'gutter', gutterName: 'sequence' },
116
+ {
117
+ type: 'gutter',
118
+ gutterName: 'button',
119
+ name: 'start',
120
+ icon: 'play_arrow',
121
+ handlers: {
122
+ click: (columns, data, column, record, rowIndex) => {
123
+ const { id } = record
124
+ this.openActivityThread(record)
125
+ }
126
+ }
127
+ },
128
+ {
129
+ type: 'string',
130
+ name: 'name',
131
+ header: i18next.t('field.name'),
132
+ record: {
133
+ editable: false
134
+ },
135
+ filter: 'search',
136
+ sortable: true,
137
+ width: 150
138
+ },
139
+ {
140
+ type: 'string',
141
+ name: 'description',
142
+ header: i18next.t('field.description'),
143
+ record: {
144
+ editable: false
145
+ },
146
+ filter: 'search',
147
+ width: 200
148
+ },
149
+ {
150
+ type: 'string',
151
+ name: 'viewSource',
152
+ header: i18next.t('field.view-source'),
153
+ record: {
154
+ editable: false,
155
+ renderer: function (value, column, record, rowIndex, field) {
156
+ const { viewType, viewSource } = record.activity || {}
157
+ var type = viewType !== 'board' ? 'string' : 'board'
158
+ return getRenderer(type)(viewSource, column, record, rowIndex, field)
159
+ }
160
+ },
161
+ width: 140,
162
+ hidden: true
163
+ },
164
+ {
165
+ type: 'select',
166
+ name: 'priority',
167
+ header: i18next.t('field.priority'),
168
+ record: {
169
+ editable: false,
170
+ options: Priorities
171
+ },
172
+ // filter: true,
173
+ width: 60
174
+ },
175
+ {
176
+ type: 'select',
177
+ name: 'state',
178
+ header: i18next.t('field.status'),
179
+ record: {
180
+ editable: false,
181
+ options: [
182
+ { display: 'Draft', value: 'draft' },
183
+ { display: 'Posted', value: 'posted' },
184
+ { display: 'WaitingAssignment', value: 'waiting-assignment' },
185
+ { display: 'Assigned', value: 'assigned' },
186
+ { display: 'Started', value: 'started' },
187
+ { display: 'Pending', value: 'pending' },
188
+ { display: 'Escalated', value: 'escalated' },
189
+ { display: 'Ended', value: 'ended' },
190
+ { display: 'Aborted', value: 'aborted' }
191
+ ]
192
+ },
193
+ filter: false,
194
+ width: 60
195
+ },
196
+ {
197
+ type: 'datetime',
198
+ name: 'dueAt',
199
+ header: i18next.t('field.due-at'),
200
+ record: {
201
+ editable: false,
202
+ options: {
203
+ year: 'numeric',
204
+ month: 'numeric',
205
+ day: 'numeric'
206
+ }
207
+ },
208
+ sortable: true,
209
+ width: 100
210
+ },
211
+ {
212
+ type: 'datetime',
213
+ name: 'startedAt',
214
+ header: i18next.t('field.started-at'),
215
+ record: {
216
+ editable: false
217
+ },
218
+ sortable: true,
219
+ width: 100
220
+ },
221
+ {
222
+ type: 'datetime',
223
+ name: 'terminatedAt',
224
+ header: i18next.t('field.terminated-at'),
225
+ record: {
226
+ editable: false
227
+ },
228
+ sortable: true,
229
+ width: 100
230
+ },
231
+ {
232
+ type: 'resource-object',
233
+ name: 'creator',
234
+ header: i18next.t('field.issuer'),
235
+ record: {
236
+ editable: false
237
+ },
238
+ sortable: true,
239
+ width: 120
240
+ },
241
+ {
242
+ type: 'datetime',
243
+ name: 'createdAt',
244
+ header: i18next.t('field.posted-at'),
245
+ record: {
246
+ editable: false
247
+ },
248
+ sortable: true,
249
+ filter: false,
250
+ width: 180
251
+ },
252
+ {
253
+ type: 'image',
254
+ name: 'thumbnail',
255
+ header: i18next.t('field.thumbnail'),
256
+ record: { editable: false },
257
+ hidden: true
258
+ }
259
+ ],
260
+ rows: {
261
+ appendable: false
262
+ },
263
+ sorters: [
264
+ {
265
+ name: 'dueAt',
266
+ desc: false
267
+ }
268
+ ]
269
+ }
270
+ }
271
+
272
+ async pageUpdated(changes, lifecycle, changedBefore) {
273
+ if (this.active) {
274
+ this.grist?.fetch()
275
+ }
276
+ }
277
+
278
+ async fetchHandler({ page, limit, sortings = [], filters = [] }) {
279
+ const response = await client.query({
280
+ query: gql`
281
+ query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
282
+ responses: doneList(filters: $filters, pagination: $pagination, sortings: $sortings) {
283
+ items {
284
+ id
285
+ activityInstance {
286
+ activityId: id
287
+ name
288
+ description
289
+ priority
290
+ input
291
+ refBy
292
+ activityType
293
+ viewType
294
+ viewSource
295
+ thumbnail
296
+ createdAt
297
+ startedAt
298
+ terminatedAt
299
+ updatedAt
300
+ createdAt
301
+ creator {
302
+ id
303
+ name
304
+ }
305
+ }
306
+ state
307
+ output
308
+ dueAt
309
+ assignedAt
310
+ startedAt
311
+ terminatedAt
312
+ }
313
+ total
314
+ }
315
+ }
316
+ `,
317
+ variables: {
318
+ filters,
319
+ pagination: { page, limit },
320
+ sortings
321
+ }
322
+ })
323
+
324
+ return {
325
+ total: response.data.responses.total || 0,
326
+ records: (response.data.responses.items || []).map(item => {
327
+ return {
328
+ id: item.id,
329
+ state: item.state,
330
+ output: item.output,
331
+ dueAt: item.dueAt,
332
+ assignedAt: item.assignedAt,
333
+ startedAt: item.startedAt,
334
+ terminatedAt: item.terminatedAt,
335
+ ...item.activityInstance
336
+ }
337
+ })
338
+ }
339
+ }
340
+
341
+ openActivityThread(activityThread) {
342
+ navigate(`activity-thread/${activityThread.id}?title=${activityThread.name}`)
343
+ }
344
+ }
@@ -15,7 +15,8 @@ import { CommonGristStyles, ScrollbarStyles } from '@operato/styles'
15
15
  import { isMobileDevice } from '@operato/utils'
16
16
  import { OxPopup } from '@operato/popup'
17
17
 
18
- import { ActivityInstanceStatus, Priorities } from '../../types.js'
18
+ import { ActivityInstanceStatus } from '../../types/activity-instance'
19
+ import { Priorities } from '../../types/types.js'
19
20
 
20
21
  const MIN = 60
21
22
  const HOUR = 60 * MIN
@@ -193,7 +194,17 @@ export class DraftListPage extends connect(store)(localize(i18next)(PageView)) {
193
194
  header: i18next.t('field.status'),
194
195
  record: {
195
196
  editable: false,
196
- options: ActivityInstanceStatus
197
+ options: [
198
+ { display: 'Draft', value: 'draft' },
199
+ { display: 'Posted', value: 'posted' },
200
+ { display: 'WaitingAssignment', value: 'waiting-assignment' },
201
+ { display: 'Assigned', value: 'assigned' },
202
+ { display: 'Started', value: 'started' },
203
+ { display: 'Pending', value: 'pending' },
204
+ { display: 'Escalated', value: 'escalated' },
205
+ { display: 'Ended', value: 'ended' },
206
+ { display: 'Aborted', value: 'aborted' }
207
+ ]
197
208
  },
198
209
  // filter: true,
199
210
  width: 60
@@ -14,7 +14,8 @@ import { navigate, PageView, store } from '@operato/shell'
14
14
  import { CommonGristStyles, ScrollbarStyles } from '@operato/styles'
15
15
  import { isMobileDevice, sleep } from '@operato/utils'
16
16
 
17
- import { ActivityInstanceStatus, Priorities } from '../../types.js'
17
+ import { ActivityInstanceStatus } from '../../types/activity-instance'
18
+ import { Priorities } from '../../types/types.js'
18
19
 
19
20
  const MIN = 60
20
21
  const HOUR = 60 * MIN
@@ -183,9 +184,19 @@ export class TodoListPage extends connect(store)(localize(i18next)(PageView)) {
183
184
  header: i18next.t('field.status'),
184
185
  record: {
185
186
  editable: false,
186
- options: ActivityInstanceStatus
187
+ options: [
188
+ { display: 'Draft', value: 'draft' },
189
+ { display: 'Posted', value: 'posted' },
190
+ { display: 'WaitingAssignment', value: 'waiting-assignment' },
191
+ { display: 'Assigned', value: 'assigned' },
192
+ { display: 'Started', value: 'started' },
193
+ { display: 'Pending', value: 'pending' },
194
+ { display: 'Escalated', value: 'escalated' },
195
+ { display: 'Ended', value: 'ended' },
196
+ { display: 'Aborted', value: 'aborted' }
197
+ ]
187
198
  },
188
- // filter: true,
199
+ filter: false,
189
200
  width: 60
190
201
  },
191
202
  {
package/client/route.ts CHANGED
@@ -16,6 +16,10 @@ export default function route(page: string) {
16
16
  import('./pages/todo/todo-list-page.js')
17
17
  return page
18
18
 
19
+ case 'done-list':
20
+ import('./pages/todo/done-list-page.js')
21
+ return page
22
+
19
23
  case 'approval-waiting-list':
20
24
  import('./pages/todo/approval-waiting-list-page.js')
21
25
  return page
@@ -60,6 +64,10 @@ export default function route(page: string) {
60
64
  import('./pages/activity-instance/activity-instance-list-page.js')
61
65
  return page
62
66
 
67
+ case 'activity-instance-search':
68
+ import('./pages/activity-instance/activity-instance-search-page.js')
69
+ return page
70
+
63
71
  case 'activity-template-list':
64
72
  import('./pages/activity-template/activity-template-list-page.js')
65
73
  return page
@@ -0,0 +1,123 @@
1
+ import { Role } from '@operato/shell'
2
+ import { ApprovalLineItem } from '@things-factory/organization'
3
+
4
+ import { ActivityType, ActivityUIType } from './activity'
5
+ import { AssigneeItem, ActivityInstance, ActivityInstanceStatus } from './activity-instance'
6
+
7
+ export class NewActivityInstance {
8
+ name?: string
9
+
10
+ activityId?: string
11
+
12
+ description?: string
13
+
14
+ priority?: number
15
+
16
+ reason?: string
17
+
18
+ threadsMin?: number
19
+
20
+ threadsMax?: number
21
+
22
+ dueAt?: Date
23
+
24
+ input?: { [key: string]: any }
25
+
26
+ adhocType?: string
27
+
28
+ refBy?: string
29
+
30
+ activityType?: ActivityType
31
+
32
+ uiType?: ActivityUIType
33
+
34
+ uiSource?: string
35
+
36
+ supervisoryRole?: Role
37
+
38
+ assigneeRole?: Role
39
+
40
+ assignees?: AssigneeItem[]
41
+
42
+ approvalLine?: ApprovalLineItem[]
43
+ }
44
+
45
+ export class ActivityInstancePost {
46
+ id?: string
47
+
48
+ name?: string
49
+
50
+ activityId?: string
51
+
52
+ description?: string
53
+
54
+ priority?: number
55
+
56
+ reason?: string
57
+
58
+ threadsMin?: number
59
+
60
+ threadsMax?: number
61
+
62
+ dueAt?: Date
63
+
64
+ input?: { [key: string]: any }
65
+
66
+ adhocType?: string
67
+
68
+ refBy?: string
69
+
70
+ activityType?: ActivityType
71
+
72
+ uiType?: ActivityUIType
73
+
74
+ uiSource?: string
75
+
76
+ supervisoryRole?: Role
77
+
78
+ assigneeRole?: Role
79
+
80
+ assignees?: AssigneeItem[]
81
+
82
+ approvalLine?: ApprovalLineItem[]
83
+ }
84
+
85
+ export class ActivityInstanceSave {
86
+ output?: { [key: string]: any }
87
+
88
+ assignees?: AssigneeItem[]
89
+
90
+ approvalLine?: ApprovalLineItem[]
91
+ }
92
+
93
+ export class ActivityInstancePatch {
94
+ id?: string
95
+
96
+ name?: string
97
+
98
+ description?: string
99
+
100
+ priority?: number
101
+
102
+ state?: ActivityInstanceStatus
103
+
104
+ threadsMin?: number
105
+
106
+ threadsMax?: number
107
+
108
+ dueAt?: Date
109
+
110
+ input?: { [key: string]: any }
111
+
112
+ assignees?: AssigneeItem[]
113
+
114
+ approvalLine?: ApprovalLineItem[]
115
+
116
+ cuFlag?: string
117
+ }
118
+
119
+ export class ActivityInstanceList {
120
+ items?: ActivityInstance[]
121
+
122
+ total?: number
123
+ }