@things-factory/worklist 6.0.39 → 6.0.41

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 (100) hide show
  1. package/client/activity-summary-generator.ts +5 -5
  2. package/client/pages/activity/activity-page.ts +1 -1
  3. package/client/pages/activity/starter-list-page.ts +0 -1
  4. package/client/pages/activity-instance/activity-instance-page.ts +2 -2
  5. package/client/pages/activity-thread/activity-thread-page.ts +5 -5
  6. package/client/pages/installable-activity/installable-activity-list-page.ts +15 -0
  7. package/client/pages/todo/{approval-waiting-list-page.ts → approval-pending-list-page.ts} +5 -9
  8. package/client/pages/todo/done-list-page.ts +5 -6
  9. package/client/pages/todo/draft-list-page.ts +1 -1
  10. package/client/pages/todo/pickable-list-page.ts +24 -25
  11. package/client/pages/todo/todo-list-page.ts +16 -11
  12. package/client/route.ts +2 -6
  13. package/client/types/activity-instance.ts +1 -1
  14. package/dist-client/activity-summary-generator.js +5 -5
  15. package/dist-client/activity-summary-generator.js.map +1 -1
  16. package/dist-client/pages/activity/activity-page.d.ts +1 -1
  17. package/dist-client/pages/activity/activity-page.js +1 -1
  18. package/dist-client/pages/activity/activity-page.js.map +1 -1
  19. package/dist-client/pages/activity/starter-list-page.js +0 -1
  20. package/dist-client/pages/activity/starter-list-page.js.map +1 -1
  21. package/dist-client/pages/activity-instance/activity-instance-page.d.ts +1 -1
  22. package/dist-client/pages/activity-instance/activity-instance-page.js +2 -2
  23. package/dist-client/pages/activity-instance/activity-instance-page.js.map +1 -1
  24. package/dist-client/pages/activity-thread/activity-thread-page.js +5 -5
  25. package/dist-client/pages/activity-thread/activity-thread-page.js.map +1 -1
  26. package/dist-client/pages/installable-activity/installable-activity-list-page.js +15 -0
  27. package/dist-client/pages/installable-activity/installable-activity-list-page.js.map +1 -1
  28. package/dist-client/pages/todo/approval-pending-list-page.d.ts +40 -0
  29. package/dist-client/pages/todo/approval-pending-list-page.js +360 -0
  30. package/dist-client/pages/todo/approval-pending-list-page.js.map +1 -0
  31. package/dist-client/pages/todo/assigned-list-page.js +0 -1
  32. package/dist-client/pages/todo/assigned-list-page.js.map +1 -1
  33. package/dist-client/pages/todo/done-list-page.js +4 -5
  34. package/dist-client/pages/todo/done-list-page.js.map +1 -1
  35. package/dist-client/pages/todo/draft-list-page.js +1 -1
  36. package/dist-client/pages/todo/draft-list-page.js.map +1 -1
  37. package/dist-client/pages/todo/pickable-list-page.js +23 -24
  38. package/dist-client/pages/todo/pickable-list-page.js.map +1 -1
  39. package/dist-client/pages/todo/todo-list-page.js +16 -11
  40. package/dist-client/pages/todo/todo-list-page.js.map +1 -1
  41. package/dist-client/route.d.ts +1 -1
  42. package/dist-client/route.js +2 -5
  43. package/dist-client/route.js.map +1 -1
  44. package/dist-client/tsconfig.tsbuildinfo +1 -1
  45. package/dist-client/types/activity-instance.d.ts +1 -1
  46. package/dist-client/types/activity-instance.js +1 -1
  47. package/dist-client/types/activity-instance.js.map +1 -1
  48. package/dist-server/controllers/activity-instance/end.js +3 -0
  49. package/dist-server/controllers/activity-instance/end.js.map +1 -1
  50. package/dist-server/controllers/activity-instance/post.js +2 -1
  51. package/dist-server/controllers/activity-instance/post.js.map +1 -1
  52. package/dist-server/controllers/activity-instance/terminate.js +3 -0
  53. package/dist-server/controllers/activity-instance/terminate.js.map +1 -1
  54. package/dist-server/controllers/activity-thread/abort.js +5 -2
  55. package/dist-server/controllers/activity-thread/abort.js.map +1 -1
  56. package/dist-server/controllers/activity-thread/adjust.js +8 -0
  57. package/dist-server/controllers/activity-thread/adjust.js.map +1 -1
  58. package/dist-server/controllers/activity-thread/end.js +5 -2
  59. package/dist-server/controllers/activity-thread/end.js.map +1 -1
  60. package/dist-server/controllers/activity-thread/save.js +6 -3
  61. package/dist-server/controllers/activity-thread/save.js.map +1 -1
  62. package/dist-server/controllers/activity-thread/submit.js +6 -3
  63. package/dist-server/controllers/activity-thread/submit.js.map +1 -1
  64. package/dist-server/controllers/common.js +1 -1
  65. package/dist-server/controllers/common.js.map +1 -1
  66. package/dist-server/service/activity-approval/activity-approval-query.js +2 -2
  67. package/dist-server/service/activity-approval/activity-approval-query.js.map +1 -1
  68. package/dist-server/service/activity-instance/activity-instance-query.js +1 -1
  69. package/dist-server/service/activity-instance/activity-instance-query.js.map +1 -1
  70. package/dist-server/service/activity-instance/activity-instance.js +1 -1
  71. package/dist-server/service/activity-instance/activity-instance.js.map +1 -1
  72. package/dist-server/service/activity-summary/activity-summary-query.js +3 -3
  73. package/dist-server/service/activity-summary/activity-summary-query.js.map +1 -1
  74. package/dist-server/service/activity-summary/activity-summary.js +1 -1
  75. package/dist-server/service/activity-summary/activity-summary.js.map +1 -1
  76. package/dist-server/service/installable-activity/installable-activity.js +7 -0
  77. package/dist-server/service/installable-activity/installable-activity.js.map +1 -1
  78. package/dist-server/tsconfig.tsbuildinfo +1 -1
  79. package/package.json +3 -3
  80. package/server/controllers/activity-instance/end.ts +4 -0
  81. package/server/controllers/activity-instance/post.ts +2 -0
  82. package/server/controllers/activity-instance/terminate.ts +4 -0
  83. package/server/controllers/activity-thread/abort.ts +6 -2
  84. package/server/controllers/activity-thread/adjust.ts +12 -0
  85. package/server/controllers/activity-thread/end.ts +6 -2
  86. package/server/controllers/activity-thread/save.ts +7 -3
  87. package/server/controllers/activity-thread/submit.ts +7 -3
  88. package/server/controllers/common.ts +1 -1
  89. package/server/service/activity-approval/activity-approval-query.ts +1 -1
  90. package/server/service/activity-instance/activity-instance-query.ts +1 -1
  91. package/server/service/activity-instance/activity-instance.ts +1 -1
  92. package/server/service/activity-summary/activity-summary-query.ts +2 -2
  93. package/server/service/activity-summary/activity-summary.ts +1 -1
  94. package/server/service/installable-activity/installable-activity.ts +3 -0
  95. package/things-factory.config.js +1 -2
  96. package/translations/en.json +5 -3
  97. package/translations/ko.json +5 -3
  98. package/translations/ms.json +5 -3
  99. package/translations/zh.json +5 -3
  100. package/client/pages/todo/assigned-list-page.ts +0 -258
@@ -1,258 +0,0 @@
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, FetchOption, getRenderer } from '@operato/data-grist'
10
- import { client } from '@operato/graphql'
11
- import { i18next, localize } from '@operato/i18n'
12
- import { PageView, store } from '@operato/shell'
13
- import { CommonGristStyles, ScrollbarStyles } from '@operato/styles'
14
- import { isMobileDevice } from '@operato/utils'
15
-
16
- const FILTERS = [
17
- {
18
- display: 'Important',
19
- value: 'Important'
20
- },
21
- {
22
- display: 'Imminent',
23
- value: 'Imminent'
24
- },
25
- {
26
- display: 'Disapproved',
27
- value: 'Disapproved'
28
- }
29
- ]
30
-
31
- @customElement('assigned-list-page')
32
- export class AssignedListPage extends connect(store)(localize(i18next)(PageView)) {
33
- static styles = [
34
- ScrollbarStyles,
35
- CommonGristStyles,
36
- css`
37
- :host {
38
- display: flex;
39
-
40
- width: 100%;
41
-
42
- --grid-record-emphasized-background-color: red;
43
- --grid-record-emphasized-color: yellow;
44
- }
45
-
46
- #modes {
47
- margin-left: auto;
48
- }
49
- `
50
- ]
51
-
52
- @property({ type: Object }) gristConfig?: any
53
- @property({ type: String }) mode: 'GRID' | 'LIST' | 'CARD' = isMobileDevice() ? 'LIST' : 'GRID'
54
-
55
- @query('ox-grist') grist!: DataGrist
56
-
57
- @state() filters?: string[]
58
-
59
- get context() {
60
- return {
61
- search: {
62
- handler: (search: string) => {
63
- this.grist.searchText = search
64
- },
65
- placeholder: i18next.t('title.assigned list'),
66
- value: this.grist.searchText
67
- },
68
- filter: {
69
- handler: () => {
70
- this.grist.toggleHeadroom()
71
- }
72
- }
73
- }
74
- }
75
-
76
- render() {
77
- const mode = this.mode
78
-
79
- return html`
80
- <ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
81
- <div slot="headroom">
82
- <div id="filters">
83
- <ox-input-select-buttons
84
- .value=${this.filters}
85
- .options=${FILTERS}
86
- @change=${(e: CustomEvent) => {
87
- this.filters = (e.currentTarget as any)?.value
88
- }}
89
- multiple
90
- ></ox-input-select-buttons>
91
- </div>
92
-
93
- <div id="modes">
94
- <mwc-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</mwc-icon>
95
- <mwc-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</mwc-icon>
96
- <mwc-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</mwc-icon>
97
- </div>
98
- </div>
99
- </ox-grist>
100
- `
101
- }
102
-
103
- async pageInitialized(lifecycle) {
104
- this.gristConfig = {
105
- list: {
106
- thumbnail: 'thumbnail',
107
- fields: ['name', 'description'],
108
- details: ['createdAt', 'due']
109
- },
110
- columns: [
111
- { type: 'gutter', gutterName: 'sequence' },
112
- {
113
- type: 'string',
114
- name: 'name',
115
- header: i18next.t('field.name'),
116
- record: {
117
- editable: false
118
- },
119
- filter: 'search',
120
- sortable: true,
121
- width: 150
122
- },
123
- {
124
- type: 'string',
125
- name: 'description',
126
- header: i18next.t('field.description'),
127
- record: {
128
- editable: false
129
- },
130
- filter: 'search',
131
- width: 200
132
- },
133
- {
134
- type: 'string',
135
- name: 'uiSource',
136
- header: i18next.t('field.ui-source'),
137
- record: {
138
- editable: false,
139
- renderer: function (value, column, record, rowIndex, field) {
140
- const { uiType, uiSource } = record.activity || {}
141
- var type = uiType !== 'board' ? 'string' : 'board'
142
- return getRenderer(type)(uiSource, column, record, rowIndex, field)
143
- }
144
- },
145
- width: 140,
146
- hidden: true
147
- },
148
- {
149
- type: 'resource-object',
150
- name: 'creator',
151
- header: i18next.t('field.creator'),
152
- record: {
153
- editable: false
154
- },
155
- sortable: true,
156
- width: 120
157
- },
158
- {
159
- type: 'datetime',
160
- name: 'dueAt',
161
- header: i18next.t('field.due-at'),
162
- record: {
163
- editable: false
164
- },
165
- sortable: true,
166
- // filter: {
167
- // type: 'date',
168
- // operator: 'between'
169
- // },
170
- width: 180
171
- },
172
- {
173
- type: 'datetime',
174
- name: 'updatedAt',
175
- header: i18next.t('field.updated_at'),
176
- record: {
177
- editable: false
178
- },
179
- sortable: true,
180
- width: 180
181
- },
182
- {
183
- type: 'datetime',
184
- name: 'createdAt',
185
- header: i18next.t('field.created_at'),
186
- record: {
187
- editable: false
188
- },
189
- sortable: true,
190
- // filter: 'between',
191
- width: 180
192
- },
193
- {
194
- type: 'image',
195
- name: 'thumbnail',
196
- header: i18next.t('field.thumbnail'),
197
- record: { editable: false },
198
- hidden: true
199
- }
200
- ],
201
- rows: {
202
- appendable: false
203
- },
204
- sorters: [
205
- {
206
- name: 'name'
207
- }
208
- ]
209
- }
210
- }
211
-
212
- async pageUpdated(changes, lifecycle, changedBefore) {
213
- if (this.active) {
214
- this.grist?.fetch()
215
- }
216
- }
217
-
218
- async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {
219
- const response = await client.query({
220
- query: gql`
221
- query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
222
- responses: activityInstances(filters: $filters, pagination: $pagination, sortings: $sortings) {
223
- items {
224
- id
225
- name
226
- description
227
- priority
228
- state
229
- input
230
- activityType
231
- uiType
232
- uiSource
233
- dueAt
234
- thumbnail
235
- updatedAt
236
- createdAt
237
- creator {
238
- id
239
- name
240
- }
241
- }
242
- total
243
- }
244
- }
245
- `,
246
- variables: {
247
- filters,
248
- pagination: { page, limit },
249
- sortings
250
- }
251
- })
252
-
253
- return {
254
- total: response.data.responses.total || 0,
255
- records: response.data.responses.items || []
256
- }
257
- }
258
- }