@things-factory/worklist 6.0.37 → 6.0.40

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 (134) hide show
  1. package/client/activity-summary-generator.ts +5 -5
  2. package/client/bootstrap.ts +3 -6
  3. package/client/grist-editor/grist-editor-activity-search-key.ts +3 -2
  4. package/client/grist-editor/grist-renderer-activity-search-key.ts +25 -0
  5. package/client/pages/activity/activity-list-page.ts +25 -52
  6. package/client/pages/activity/activity-page.ts +1 -1
  7. package/client/pages/activity/activity-partial-view.ts +0 -3
  8. package/client/pages/activity/starter-list-page.ts +0 -1
  9. package/client/pages/activity-instance/activity-instance-list-page.ts +8 -3
  10. package/client/pages/activity-instance/activity-instance-page.ts +2 -2
  11. package/client/pages/activity-thread/activity-thread-page.ts +4 -11
  12. package/client/pages/installable-activity/installable-activity-list-page.ts +19 -26
  13. package/client/pages/todo/{approval-waiting-list-page.ts → approval-pending-list-page.ts} +14 -23
  14. package/client/pages/todo/done-list-page.ts +23 -22
  15. package/client/pages/todo/draft-list-page.ts +16 -14
  16. package/client/pages/todo/pickable-list-page.ts +24 -26
  17. package/client/pages/todo/todo-list-page.ts +34 -19
  18. package/client/route.ts +2 -6
  19. package/client/types/activity-instance.ts +1 -1
  20. package/client/types/activity.ts +0 -6
  21. package/dist-client/activity-summary-generator.js +5 -5
  22. package/dist-client/activity-summary-generator.js.map +1 -1
  23. package/dist-client/bootstrap.js +3 -2
  24. package/dist-client/bootstrap.js.map +1 -1
  25. package/dist-client/grist-editor/grist-editor-activity-search-key.js +3 -2
  26. package/dist-client/grist-editor/grist-editor-activity-search-key.js.map +1 -1
  27. package/dist-client/grist-editor/grist-renderer-activity-search-key.d.ts +3 -0
  28. package/dist-client/grist-editor/grist-renderer-activity-search-key.js +22 -0
  29. package/dist-client/grist-editor/grist-renderer-activity-search-key.js.map +1 -0
  30. package/dist-client/pages/activity/activity-list-page.js +25 -52
  31. package/dist-client/pages/activity/activity-list-page.js.map +1 -1
  32. package/dist-client/pages/activity/activity-page.d.ts +1 -1
  33. package/dist-client/pages/activity/activity-page.js +1 -1
  34. package/dist-client/pages/activity/activity-page.js.map +1 -1
  35. package/dist-client/pages/activity/activity-partial-view.js +1 -1
  36. package/dist-client/pages/activity/activity-partial-view.js.map +1 -1
  37. package/dist-client/pages/activity/starter-list-page.js +0 -1
  38. package/dist-client/pages/activity/starter-list-page.js.map +1 -1
  39. package/dist-client/pages/activity-instance/activity-instance-list-page.js +8 -3
  40. package/dist-client/pages/activity-instance/activity-instance-list-page.js.map +1 -1
  41. package/dist-client/pages/activity-instance/activity-instance-page.d.ts +1 -1
  42. package/dist-client/pages/activity-instance/activity-instance-page.js +2 -2
  43. package/dist-client/pages/activity-instance/activity-instance-page.js.map +1 -1
  44. package/dist-client/pages/activity-thread/activity-thread-page.js +4 -6
  45. package/dist-client/pages/activity-thread/activity-thread-page.js.map +1 -1
  46. package/dist-client/pages/installable-activity/installable-activity-list-page.d.ts +0 -1
  47. package/dist-client/pages/installable-activity/installable-activity-list-page.js +17 -24
  48. package/dist-client/pages/installable-activity/installable-activity-list-page.js.map +1 -1
  49. package/dist-client/pages/todo/approval-pending-list-page.d.ts +40 -0
  50. package/dist-client/pages/todo/approval-pending-list-page.js +360 -0
  51. package/dist-client/pages/todo/approval-pending-list-page.js.map +1 -0
  52. package/dist-client/pages/todo/approval-waiting-list-page.js +9 -15
  53. package/dist-client/pages/todo/approval-waiting-list-page.js.map +1 -1
  54. package/dist-client/pages/todo/assigned-list-page.js +0 -1
  55. package/dist-client/pages/todo/assigned-list-page.js.map +1 -1
  56. package/dist-client/pages/todo/done-list-page.js +22 -21
  57. package/dist-client/pages/todo/done-list-page.js.map +1 -1
  58. package/dist-client/pages/todo/draft-list-page.js +16 -15
  59. package/dist-client/pages/todo/draft-list-page.js.map +1 -1
  60. package/dist-client/pages/todo/pickable-list-page.js +26 -31
  61. package/dist-client/pages/todo/pickable-list-page.js.map +1 -1
  62. package/dist-client/pages/todo/todo-list-page.js +34 -20
  63. package/dist-client/pages/todo/todo-list-page.js.map +1 -1
  64. package/dist-client/route.d.ts +1 -1
  65. package/dist-client/route.js +2 -5
  66. package/dist-client/route.js.map +1 -1
  67. package/dist-client/tsconfig.tsbuildinfo +1 -1
  68. package/dist-client/types/activity-instance.d.ts +1 -1
  69. package/dist-client/types/activity-instance.js +1 -1
  70. package/dist-client/types/activity-instance.js.map +1 -1
  71. package/dist-client/types/activity.d.ts +0 -3
  72. package/dist-client/types/activity.js.map +1 -1
  73. package/dist-server/controllers/activity-instance/end.js +3 -0
  74. package/dist-server/controllers/activity-instance/end.js.map +1 -1
  75. package/dist-server/controllers/activity-instance/post.js +2 -1
  76. package/dist-server/controllers/activity-instance/post.js.map +1 -1
  77. package/dist-server/controllers/activity-instance/terminate.js +3 -0
  78. package/dist-server/controllers/activity-instance/terminate.js.map +1 -1
  79. package/dist-server/controllers/activity-thread/abort.js +5 -2
  80. package/dist-server/controllers/activity-thread/abort.js.map +1 -1
  81. package/dist-server/controllers/activity-thread/adjust.js +8 -0
  82. package/dist-server/controllers/activity-thread/adjust.js.map +1 -1
  83. package/dist-server/controllers/activity-thread/end.js +5 -2
  84. package/dist-server/controllers/activity-thread/end.js.map +1 -1
  85. package/dist-server/controllers/activity-thread/save.js +7 -4
  86. package/dist-server/controllers/activity-thread/save.js.map +1 -1
  87. package/dist-server/controllers/activity-thread/submit.js +6 -3
  88. package/dist-server/controllers/activity-thread/submit.js.map +1 -1
  89. package/dist-server/controllers/common.js +1 -1
  90. package/dist-server/controllers/common.js.map +1 -1
  91. package/dist-server/service/activity/activity-history.js +0 -15
  92. package/dist-server/service/activity/activity-history.js.map +1 -1
  93. package/dist-server/service/activity/activity-type.js +0 -24
  94. package/dist-server/service/activity/activity-type.js.map +1 -1
  95. package/dist-server/service/activity/activity.js +7 -22
  96. package/dist-server/service/activity/activity.js.map +1 -1
  97. package/dist-server/service/activity-approval/activity-approval-query.js +2 -2
  98. package/dist-server/service/activity-approval/activity-approval-query.js.map +1 -1
  99. package/dist-server/service/activity-instance/activity-instance-query.js +1 -1
  100. package/dist-server/service/activity-instance/activity-instance-query.js.map +1 -1
  101. package/dist-server/service/activity-instance/activity-instance.js +1 -1
  102. package/dist-server/service/activity-instance/activity-instance.js.map +1 -1
  103. package/dist-server/service/activity-summary/activity-summary-query.js +3 -3
  104. package/dist-server/service/activity-summary/activity-summary-query.js.map +1 -1
  105. package/dist-server/service/activity-summary/activity-summary.js +1 -1
  106. package/dist-server/service/activity-summary/activity-summary.js.map +1 -1
  107. package/dist-server/service/installable-activity/installable-activity.js +7 -0
  108. package/dist-server/service/installable-activity/installable-activity.js.map +1 -1
  109. package/dist-server/tsconfig.tsbuildinfo +1 -1
  110. package/package.json +3 -3
  111. package/server/controllers/activity-instance/end.ts +4 -0
  112. package/server/controllers/activity-instance/post.ts +2 -0
  113. package/server/controllers/activity-instance/terminate.ts +4 -0
  114. package/server/controllers/activity-thread/abort.ts +6 -2
  115. package/server/controllers/activity-thread/adjust.ts +12 -0
  116. package/server/controllers/activity-thread/end.ts +6 -2
  117. package/server/controllers/activity-thread/save.ts +9 -4
  118. package/server/controllers/activity-thread/submit.ts +7 -3
  119. package/server/controllers/common.ts +1 -1
  120. package/server/service/activity/activity-history.ts +0 -12
  121. package/server/service/activity/activity-type.ts +0 -18
  122. package/server/service/activity/activity.ts +7 -19
  123. package/server/service/activity-approval/activity-approval-query.ts +1 -1
  124. package/server/service/activity-instance/activity-instance-query.ts +1 -1
  125. package/server/service/activity-instance/activity-instance.ts +1 -1
  126. package/server/service/activity-summary/activity-summary-query.ts +2 -2
  127. package/server/service/activity-summary/activity-summary.ts +1 -1
  128. package/server/service/installable-activity/installable-activity.ts +3 -0
  129. package/things-factory.config.js +1 -2
  130. package/translations/en.json +25 -3
  131. package/translations/ko.json +25 -3
  132. package/translations/ms.json +67 -45
  133. package/translations/zh.json +66 -44
  134. package/client/pages/todo/assigned-list-page.ts +0 -258
@@ -69,7 +69,7 @@ async function subscribeActivityApproval() {
69
69
  var summary = {}
70
70
  var generatorLocks = {
71
71
  numberOfToDos: new AsyncLock(true),
72
- numberOfApprovalWaitings: new AsyncLock(true),
72
+ numberOfApprovalPendings: new AsyncLock(true),
73
73
  numberOfPicks: new AsyncLock(true),
74
74
  numberOfDrafts: new AsyncLock(true)
75
75
  }
@@ -80,7 +80,7 @@ const fetchActivitySummary = debounce(async () => {
80
80
  query {
81
81
  activitySummary {
82
82
  numberOfToDos
83
- numberOfApprovalWaitings
83
+ numberOfApprovalPendings
84
84
  numberOfPicks
85
85
  numberOfDrafts
86
86
  }
@@ -89,15 +89,15 @@ const fetchActivitySummary = debounce(async () => {
89
89
  })
90
90
 
91
91
  if (response.data) {
92
- const { numberOfToDos, numberOfApprovalWaitings, numberOfPicks, numberOfDrafts } = response.data.activitySummary
92
+ const { numberOfToDos, numberOfApprovalPendings, numberOfPicks, numberOfDrafts } = response.data.activitySummary
93
93
 
94
94
  summary['numberOfToDos'] = numberOfToDos
95
- summary['numberOfApprovalWaitings'] = numberOfApprovalWaitings
95
+ summary['numberOfApprovalPendings'] = numberOfApprovalPendings
96
96
  summary['numberOfPicks'] = numberOfPicks
97
97
  summary['numberOfDrafts'] = numberOfDrafts
98
98
 
99
99
  generatorLocks['numberOfToDos']?.unlock(numberOfToDos)
100
- generatorLocks['numberOfApprovalWaitings']?.unlock(numberOfApprovalWaitings)
100
+ generatorLocks['numberOfApprovalPendings']?.unlock(numberOfApprovalPendings)
101
101
  generatorLocks['numberOfPicks']?.unlock(numberOfPicks)
102
102
  generatorLocks['numberOfDrafts']?.unlock(numberOfDrafts)
103
103
  }
@@ -7,16 +7,13 @@ import { store } from '@operato/shell'
7
7
  import { openOverlay, TOOL_POSITION } from '@operato/layout'
8
8
  import { APPEND_CONTEXT_TOOL } from '@things-factory/context-ui'
9
9
 
10
- import {
11
- OxGristRendererJson5,
12
- registerEditor as registerGristEditor,
13
- registerRenderer as registerGristRenderer
14
- } from '@operato/data-grist'
10
+ import { registerEditor as registerGristEditor, registerRenderer as registerGristRenderer } from '@operato/data-grist'
15
11
  import { OxGristEditorDuration } from '@operato/grist-editor/ox-grist-editor-duration.js'
16
12
  import { OxGristEditorQuantifier } from '@operato/grist-editor/ox-grist-editor-quantifier.js'
17
13
  import { OxGristRendererDuration } from '@operato/grist-editor/ox-grist-renderer-duration.js'
18
14
  import { OxGristRendererQuantifier } from '@operato/grist-editor/ox-grist-renderer-quantifier.js'
19
15
  import { GristEditorActivitySearchKeys } from './grist-editor/grist-editor-activity-search-key.js'
16
+ import { GristRendererActivitySearchKeys } from './grist-editor/grist-renderer-activity-search-key.js'
20
17
 
21
18
  export default function bootstrap() {
22
19
  ;[
@@ -54,5 +51,5 @@ export default function bootstrap() {
54
51
  registerGristRenderer('quantifier', OxGristRendererQuantifier)
55
52
 
56
53
  registerGristEditor('activity-search-keys', GristEditorActivitySearchKeys)
57
- registerGristRenderer('activity-search-keys', OxGristRendererJson5)
54
+ registerGristRenderer('activity-search-keys', GristRendererActivitySearchKeys)
58
55
  }
@@ -16,8 +16,9 @@ export class GristEditorActivitySearchKeys extends OxGristEditor {
16
16
  private popup?: PopupHandle
17
17
 
18
18
  get editorTemplate() {
19
- const value = typeof this.value === 'object' ? JSON.stringify(this.value) : this.value
20
- return html` <div tabindex="0">${value || ''}</div> `
19
+ return this.value && this.value instanceof Array && this.value.length > 0
20
+ ? html`<mwc-icon style="--mdc-icon-size:1.3em">key</mwc-icon>`
21
+ : html``
21
22
  }
22
23
 
23
24
  _onclick(e: Event): void {
@@ -0,0 +1,25 @@
1
+ import '@material/mwc-icon'
2
+ import { html } from 'lit'
3
+ import { FieldRenderer } from '@operato/data-grist'
4
+
5
+ function onmouseover(e: MouseEvent, value: any[]) {
6
+ const element = e.target as HTMLPreElement
7
+ const tooltip = value.map(key => key.name).join(',')
8
+ element.setAttribute('data-tooltip', tooltip)
9
+ }
10
+
11
+ function onmouseout(e: MouseEvent) {
12
+ const element = e.target as HTMLPreElement
13
+ element.removeAttribute('data-tooltip')
14
+ }
15
+
16
+ export const GristRendererActivitySearchKeys: FieldRenderer = (value, column, record, rowIndex, field) => {
17
+ return value && value instanceof Array && value.length > 0
18
+ ? html`<mwc-icon
19
+ style="--mdc-icon-size:1.3em"
20
+ @mouseover=${(e: MouseEvent) => onmouseover(e, value)}
21
+ @mouseout=${onmouseout}
22
+ >key</mwc-icon
23
+ >`
24
+ : html``
25
+ }
@@ -19,9 +19,9 @@ import { ActivityTypes, ActivityUITypes } from '../../types/types.js'
19
19
 
20
20
  export const ActivityStatus = [
21
21
  { display: '', value: '' },
22
- { display: 'Draft', value: 'draft' },
23
- { display: 'Released', value: 'released' },
24
- { display: 'Deprecated', value: 'deprecated' }
22
+ { display: i18next.t('label.activity-state-draft'), value: 'draft' },
23
+ { display: i18next.t('label.activity-state-released'), value: 'released' },
24
+ { display: i18next.t('label.activity-state-deprecated'), value: 'deprecated' }
25
25
  ]
26
26
  const DEFAULT_TZ = Intl.DateTimeFormat().resolvedOptions().timeZone
27
27
  const TIMEZONE_OPTIONS = ['', DEFAULT_TZ, ...moment.tz.names().filter(tz => tz !== DEFAULT_TZ)]
@@ -123,6 +123,7 @@ export class ActivityListPage extends connect(store)(localize(i18next)(PageView)
123
123
  {
124
124
  type: 'gutter',
125
125
  gutterName: 'button',
126
+ title: i18next.t('title.activity schedule (un)register'),
126
127
  icon: record => (!record || !record.name ? '' : record.scheduleId ? 'pause' : 'play_arrow'),
127
128
  handlers: {
128
129
  click: (columns, data, column, record, rowIndex) => {
@@ -141,6 +142,7 @@ export class ActivityListPage extends connect(store)(localize(i18next)(PageView)
141
142
  {
142
143
  type: 'gutter',
143
144
  gutterName: 'button',
145
+ title: i18next.t('title.activity model item list'),
144
146
  icon: 'reorder',
145
147
  handlers: {
146
148
  click: (columns, data, column, record, rowIndex) => {
@@ -202,9 +204,18 @@ export class ActivityListPage extends connect(store)(localize(i18next)(PageView)
202
204
  options: ActivityTypes
203
205
  },
204
206
  sortable: true,
205
- // filter: true,
206
207
  width: 60
207
208
  },
209
+ {
210
+ type: 'boolean',
211
+ name: 'startable',
212
+ label: true,
213
+ header: i18next.t('field.startable'),
214
+ record: {
215
+ editable: true
216
+ },
217
+ width: 50
218
+ },
208
219
  {
209
220
  type: 'activity-search-keys',
210
221
  name: 'searchKeys',
@@ -213,26 +224,21 @@ export class ActivityListPage extends connect(store)(localize(i18next)(PageView)
213
224
  record: {
214
225
  editable: true
215
226
  },
216
- width: 120
227
+ width: 50
217
228
  },
218
229
  {
219
230
  type: 'number',
220
231
  name: 'priority',
221
232
  header: i18next.t('field.priority'),
222
233
  record: {
223
- editable: true
224
- },
225
- width: 30
226
- },
227
- {
228
- type: 'boolean',
229
- name: 'startable',
230
- label: true,
231
- header: i18next.t('field.startable'),
232
- record: {
233
- editable: true
234
+ editable: true,
235
+ renderer: function (value, column, record, rowIndex, field) {
236
+ const color = ['', 'gray', 'yellow', 'orange', 'red'][value || 0]
237
+ const count = new Array(value > 4 ? 4 : value || 0).fill('')
238
+ return html`${count.map(() => html`<mwc-icon style="color:${color};">star</mwc-icon>`)}`
239
+ }
234
240
  },
235
- width: 80
241
+ width: 60
236
242
  },
237
243
  {
238
244
  type: 'crontab',
@@ -319,7 +325,7 @@ export class ActivityListPage extends connect(store)(localize(i18next)(PageView)
319
325
  record: {
320
326
  editable: true
321
327
  },
322
- width: 120
328
+ width: 50
323
329
  },
324
330
  {
325
331
  type: 'approval-line',
@@ -328,7 +334,7 @@ export class ActivityListPage extends connect(store)(localize(i18next)(PageView)
328
334
  record: {
329
335
  editable: true
330
336
  },
331
- width: 120
337
+ width: 50
332
338
  },
333
339
  {
334
340
  type: 'select',
@@ -424,36 +430,6 @@ export class ActivityListPage extends connect(store)(localize(i18next)(PageView)
424
430
  sortable: true,
425
431
  width: 80
426
432
  },
427
- {
428
- type: 'duration',
429
- name: 'cycleTime',
430
- header: i18next.t('field.cycle-time'),
431
- record: {
432
- editable: true
433
- },
434
- sortable: true,
435
- width: 80
436
- },
437
- {
438
- type: 'duration',
439
- name: 'tactTime',
440
- header: i18next.t('field.tact-time'),
441
- record: {
442
- editable: true
443
- },
444
- sortable: true,
445
- width: 80
446
- },
447
- {
448
- type: 'duration',
449
- name: 'leadTime',
450
- header: i18next.t('field.lead-time'),
451
- record: {
452
- editable: true
453
- },
454
- sortable: true,
455
- width: 80
456
- },
457
433
  {
458
434
  type: 'resource-object',
459
435
  name: 'updater',
@@ -565,9 +541,6 @@ export class ActivityListPage extends connect(store)(localize(i18next)(PageView)
565
541
  timezone
566
542
  scheduleId
567
543
  standardTime
568
- leadTime
569
- cycleTime
570
- tactTime
571
544
  updater {
572
545
  id
573
546
  name
@@ -18,7 +18,7 @@ const formatter = new Intl.DateTimeFormat(navigator.language, { dateStyle: 'full
18
18
  export const ActivityInstanceStatus = {
19
19
  Draft: 'draft',
20
20
  Posted: 'posted',
21
- WaitingAssignment: 'waiting-assignment',
21
+ PendingAssignment: 'pending-assignment',
22
22
  Assigned: 'assigned',
23
23
  Started: 'started',
24
24
  Pending: 'pending',
@@ -48,9 +48,6 @@ export class ActivityView extends localize(i18next)(LitElement) {
48
48
  schedule,
49
49
  timzeone,
50
50
  standardTime,
51
- cycleTime,
52
- tactTime,
53
- leadTime,
54
51
  issuerRole,
55
52
  assigneeRole,
56
53
  supervisoryRole,
@@ -89,7 +89,6 @@ export class StarterListPage extends connect(store)(localize(i18next)(PageView))
89
89
  @change=${(e: CustomEvent) => {
90
90
  this.filters = (e.currentTarget as any)?.value
91
91
  }}
92
- multiple
93
92
  ></ox-input-select-buttons>
94
93
  </div>
95
94
 
@@ -127,9 +127,14 @@ export class ActivityInstanceListPage extends connect(store)(localize(i18next)(P
127
127
  name: 'priority',
128
128
  header: i18next.t('field.priority'),
129
129
  record: {
130
- editable: false
130
+ editable: false,
131
+ renderer: function (value, column, record, rowIndex, field) {
132
+ const color = ['', 'gray', 'yellow', 'orange', 'red'][value || 0]
133
+ const count = new Array(value > 4 ? 4 : value || 0).fill('')
134
+ return html`${count.map(() => html`<mwc-icon style="color:${color};">star</mwc-icon>`)}`
135
+ }
131
136
  },
132
- width: 30
137
+ width: 60
133
138
  },
134
139
  {
135
140
  type: 'string',
@@ -138,7 +143,7 @@ export class ActivityInstanceListPage extends connect(store)(localize(i18next)(P
138
143
  record: {
139
144
  editable: false
140
145
  },
141
- width: 60
146
+ width: 80
142
147
  },
143
148
  {
144
149
  type: 'resource-object',
@@ -19,7 +19,7 @@ const formatter = new Intl.DateTimeFormat(navigator.language, { dateStyle: 'full
19
19
  export const ActivityInstanceStatus = {
20
20
  Draft: 'draft',
21
21
  Posted: 'posted',
22
- WaitingAssignment: 'waiting-assignment',
22
+ PendingAssignment: 'pending-assignment',
23
23
  Assigned: 'assigned',
24
24
  Started: 'started',
25
25
  Pending: 'pending',
@@ -68,7 +68,7 @@ export class ActivityInstancePage extends connect(store)(localize(i18next)(PageV
68
68
  @property({ type: Object }) board: any
69
69
 
70
70
  get context() {
71
- const assignable = [ActivityInstanceStatus.Posted, ActivityInstanceStatus.WaitingAssignment].includes(
71
+ const assignable = [ActivityInstanceStatus.Posted, ActivityInstanceStatus.PendingAssignment].includes(
72
72
  this.activityInstance?.state
73
73
  )
74
74
  const abortable = [ActivityInstanceStatus.Draft, ActivityInstanceStatus.Posted].includes(
@@ -106,23 +106,16 @@ export class ActivityThreadPage extends connect(store)(localize(i18next)(PageVie
106
106
  get context() {
107
107
  const state = this.activityThread?.state
108
108
 
109
- const startable = [ActivityThreadStatus.Assigned].includes(state)
110
- const endable = [ActivityThreadStatus.Started].includes(state)
111
- const savable = endable
112
109
  const restartable = [ActivityThreadStatus.Rejected].includes(state)
113
- const delegatable = [ActivityThreadStatus.Assigned, ActivityThreadStatus.Started].includes(state)
114
- const abortable = [ActivityThreadStatus.Assigned, ActivityThreadStatus.Started].includes(state)
110
+ const savable = !restartable
111
+ const endable = !restartable
112
+ const delegatable = !restartable
113
+ const abortable = !restartable
115
114
 
116
115
  return {
117
116
  title: this.lifecycle?.params?.['title'] || i18next.t('title.activity'),
118
117
  help: 'worklist/activity',
119
118
  actions: [
120
- startable && {
121
- title: i18next.t('button.start'),
122
- action: this._startActivityThread.bind(this),
123
- ...CommonButtonStyles.play
124
- },
125
-
126
119
  savable && {
127
120
  title: i18next.t('button.save'),
128
121
  action: this._saveActivityThread.bind(this),
@@ -1,5 +1,6 @@
1
1
  import '@operato/data-grist'
2
2
  import './installable-activity-model-item-list.js'
3
+
3
4
  import gql from 'graphql-tag'
4
5
  import { css, html } from 'lit'
5
6
  import { customElement, property, query } from 'lit/decorators.js'
@@ -10,7 +11,7 @@ import { client } from '@operato/graphql'
10
11
  import { i18next, localize } from '@operato/i18n'
11
12
  import { notify, openPopup } from '@operato/layout'
12
13
  import { PageView, store } from '@operato/shell'
13
- import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'
14
+ import { CommonGristStyles, ScrollbarStyles } from '@operato/styles'
14
15
  import { isMobileDevice } from '@operato/utils'
15
16
 
16
17
  import { ActivityTypes, ActivityUITypes } from '../../types/types.js'
@@ -172,7 +173,7 @@ export class ActivityTemplateListPage extends connect(store)(localize(i18next)(P
172
173
  },
173
174
  filter: 'search',
174
175
  sortable: true,
175
- width: 150
176
+ width: 80
176
177
  },
177
178
  {
178
179
  type: 'string',
@@ -183,7 +184,7 @@ export class ActivityTemplateListPage extends connect(store)(localize(i18next)(P
183
184
  },
184
185
  filter: 'search',
185
186
  sortable: true,
186
- width: 150
187
+ width: 120
187
188
  },
188
189
  {
189
190
  type: 'select',
@@ -195,7 +196,20 @@ export class ActivityTemplateListPage extends connect(store)(localize(i18next)(P
195
196
  options: ActivityTypes
196
197
  },
197
198
  sortable: true,
198
- // filter: true,
199
+ width: 60
200
+ },
201
+ {
202
+ type: 'number',
203
+ name: 'priority',
204
+ header: i18next.t('field.priority'),
205
+ record: {
206
+ editable: false,
207
+ renderer: function (value, column, record, rowIndex, field) {
208
+ const color = ['', 'gray', 'yellow', 'orange', 'red'][value || 0]
209
+ const count = new Array(value > 4 ? 4 : value || 0).fill('')
210
+ return html`${count.map(() => html`<mwc-icon style="color:${color};">star</mwc-icon>`)}`
211
+ }
212
+ },
199
213
  width: 60
200
214
  },
201
215
  {
@@ -293,23 +307,6 @@ export class ActivityTemplateListPage extends connect(store)(localize(i18next)(P
293
307
  record: {
294
308
  editable: false
295
309
  },
296
- // filter: true,
297
- sortable: true,
298
- width: 60
299
- },
300
- {
301
- type: 'checkbox',
302
- name: 'active',
303
- label: true,
304
- header: i18next.t('field.active'),
305
- record: {
306
- editable: false,
307
- renderer: function (value, column, record, rowIndex, field) {
308
- var type = record.reportType !== 'board' ? 'script' : 'board'
309
- return getRenderer(type)(value, column, record, rowIndex, field)
310
- }
311
- },
312
- // filter: true,
313
310
  sortable: true,
314
311
  width: 60
315
312
  }
@@ -326,11 +323,6 @@ export class ActivityTemplateListPage extends connect(store)(localize(i18next)(P
326
323
  }
327
324
  }
328
325
 
329
- async pageUpdated(changes, lifecycle) {
330
- if (this.active) {
331
- }
332
- }
333
-
334
326
  async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {
335
327
  const response = await client.query({
336
328
  query: gql`
@@ -346,6 +338,7 @@ export class ActivityTemplateListPage extends connect(store)(localize(i18next)(P
346
338
  provider
347
339
  release
348
340
  activityType
341
+ priority
349
342
  startable
350
343
  model {
351
344
  name
@@ -14,15 +14,12 @@ import { navigate, PageView, store } from '@operato/shell'
14
14
  import { CommonGristStyles, ScrollbarStyles } from '@operato/styles'
15
15
  import { adjustFilters, isMobileDevice, sleep } from '@operato/utils'
16
16
 
17
- import { ActivityThreadStatus } from '../../types/activity-thread'
18
- import { Priorities } from '../../types/types.js'
19
-
20
17
  const MIN = 60
21
18
  const HOUR = 60 * MIN
22
19
  const DAY = 24 * HOUR
23
20
 
24
- @customElement('approval-waiting-list-page')
25
- export class ApprovalWaitingListPage extends connect(store)(localize(i18next)(PageView)) {
21
+ @customElement('approval-pending-list-page')
22
+ export class ApprovalPendingListPage extends connect(store)(localize(i18next)(PageView)) {
26
23
  static styles = [
27
24
  ScrollbarStyles,
28
25
  CommonGristStyles,
@@ -55,7 +52,7 @@ export class ApprovalWaitingListPage extends connect(store)(localize(i18next)(Pa
55
52
  handler: (search: string) => {
56
53
  this.grist.searchText = search
57
54
  },
58
- placeholder: i18next.t('title.approval waiting list'),
55
+ placeholder: i18next.t('title.approval pending list'),
59
56
  value: this.grist.searchText
60
57
  },
61
58
  filter: {
@@ -63,7 +60,7 @@ export class ApprovalWaitingListPage extends connect(store)(localize(i18next)(Pa
63
60
  this.grist.toggleHeadroom()
64
61
  }
65
62
  },
66
- help: 'worklist/approval-waiting-list',
63
+ help: 'worklist/approval-pending-list',
67
64
  actions: []
68
65
  }
69
66
  }
@@ -95,7 +92,6 @@ export class ApprovalWaitingListPage extends connect(store)(localize(i18next)(Pa
95
92
  this.filters = (e.currentTarget as any)?.value
96
93
  this.grist.fetch()
97
94
  }}
98
- multiple
99
95
  ></ox-input-select-buttons>
100
96
  </div>
101
97
 
@@ -167,14 +163,17 @@ export class ApprovalWaitingListPage extends connect(store)(localize(i18next)(Pa
167
163
  hidden: true
168
164
  },
169
165
  {
170
- type: 'select',
166
+ type: 'number',
171
167
  name: 'priority',
172
168
  header: i18next.t('field.priority'),
173
169
  record: {
174
170
  editable: false,
175
- options: Priorities
171
+ renderer: function (value, column, record, rowIndex, field) {
172
+ const color = ['', 'gray', 'yellow', 'orange', 'red'][value || 0]
173
+ const count = new Array(value > 4 ? 4 : value || 0).fill('')
174
+ return html`${count.map(() => html`<mwc-icon style="color:${color};">star</mwc-icon>`)}`
175
+ }
176
176
  },
177
- // filter: true,
178
177
  width: 60
179
178
  },
180
179
  {
@@ -184,19 +183,11 @@ export class ApprovalWaitingListPage extends connect(store)(localize(i18next)(Pa
184
183
  record: {
185
184
  editable: false,
186
185
  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' }
186
+ { display: i18next.t('label.activity-state-submitted'), value: 'submitted' },
187
+ { display: i18next.t('label.activity-state-escalated'), value: 'escalated' }
196
188
  ]
197
189
  },
198
- // filter: true,
199
- width: 60
190
+ width: 80
200
191
  },
201
192
  {
202
193
  type: 'datetime',
@@ -289,7 +280,7 @@ export class ApprovalWaitingListPage extends connect(store)(localize(i18next)(Pa
289
280
  const response = await client.query({
290
281
  query: gql`
291
282
  query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
292
- responses: approvalWaitingList(filters: $filters, pagination: $pagination, sortings: $sortings) {
283
+ responses: approvalPendingList(filters: $filters, pagination: $pagination, sortings: $sortings) {
293
284
  items {
294
285
  id
295
286
  round
@@ -14,7 +14,6 @@ import { CommonGristStyles, ScrollbarStyles } from '@operato/styles'
14
14
  import { adjustFilters, isMobileDevice } from '@operato/utils'
15
15
 
16
16
  import { ActivityThreadStatus } from '../../types/activity-thread'
17
- import { Priorities } from '../../types/types.js'
18
17
 
19
18
  @customElement('done-list-page')
20
19
  export class DoneListPage extends connect(store)(localize(i18next)(PageView)) {
@@ -90,7 +89,6 @@ export class DoneListPage extends connect(store)(localize(i18next)(PageView)) {
90
89
  this.filters = (e.currentTarget as any)?.value
91
90
  this.grist.fetch()
92
91
  }}
93
- multiple
94
92
  ></ox-input-select-buttons>
95
93
  </div>
96
94
 
@@ -116,8 +114,9 @@ export class DoneListPage extends connect(store)(localize(i18next)(PageView)) {
116
114
  {
117
115
  type: 'gutter',
118
116
  gutterName: 'button',
119
- name: 'start',
120
- icon: 'play_arrow',
117
+ name: 'view',
118
+ icon: 'pageview',
119
+ title: i18next.t('title.view page'),
121
120
  handlers: {
122
121
  click: (columns, data, column, record, rowIndex) => {
123
122
  const { id } = record
@@ -162,14 +161,17 @@ export class DoneListPage extends connect(store)(localize(i18next)(PageView)) {
162
161
  hidden: true
163
162
  },
164
163
  {
165
- type: 'select',
164
+ type: 'number',
166
165
  name: 'priority',
167
166
  header: i18next.t('field.priority'),
168
167
  record: {
169
168
  editable: false,
170
- options: Priorities
169
+ renderer: function (value, column, record, rowIndex, field) {
170
+ const color = ['', 'gray', 'yellow', 'orange', 'red'][value || 0]
171
+ const count = new Array(value > 4 ? 4 : value || 0).fill('')
172
+ return html`${count.map(() => html`<mwc-icon style="color:${color};">star</mwc-icon>`)}`
173
+ }
171
174
  },
172
- // filter: true,
173
175
  width: 60
174
176
  },
175
177
  {
@@ -179,19 +181,18 @@ export class DoneListPage extends connect(store)(localize(i18next)(PageView)) {
179
181
  record: {
180
182
  editable: false,
181
183
  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' }
184
+ { display: i18next.t('label.activity-state-draft'), value: 'draft' },
185
+ { display: i18next.t('label.activity-state-posted'), value: 'posted' },
186
+ { display: i18next.t('label.activity-state-pending-assignment'), value: 'pending-assignment' },
187
+ { display: i18next.t('label.activity-state-assigned'), value: 'assigned' },
188
+ { display: i18next.t('label.activity-state-started'), value: 'started' },
189
+ { display: i18next.t('label.activity-state-pending'), value: 'pending' },
190
+ { display: i18next.t('label.activity-state-escalated'), value: 'escalated' },
191
+ { display: i18next.t('label.activity-state-ended'), value: 'ended' },
192
+ { display: i18next.t('label.activity-state-aborted'), value: 'aborted' }
191
193
  ]
192
194
  },
193
- filter: false,
194
- width: 60
195
+ width: 80
195
196
  },
196
197
  {
197
198
  type: 'datetime',
@@ -262,8 +263,8 @@ export class DoneListPage extends connect(store)(localize(i18next)(PageView)) {
262
263
  },
263
264
  sorters: [
264
265
  {
265
- name: 'dueAt',
266
- desc: false
266
+ name: 'terminatedAt',
267
+ desc: true
267
268
  }
268
269
  ]
269
270
  }
@@ -339,14 +340,14 @@ export class DoneListPage extends connect(store)(localize(i18next)(PageView)) {
339
340
  total: response.data.responses.total || 0,
340
341
  records: (response.data.responses.items || []).map(item => {
341
342
  return {
343
+ ...item.activityInstance,
342
344
  id: item.id,
343
345
  state: item.state,
344
346
  output: item.output,
345
347
  dueAt: item.dueAt,
346
348
  assignedAt: item.assignedAt,
347
349
  startedAt: item.startedAt,
348
- terminatedAt: item.terminatedAt,
349
- ...item.activityInstance
350
+ terminatedAt: item.terminatedAt
350
351
  }
351
352
  })
352
353
  }