@things-factory/worklist 6.2.105 → 6.2.110

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 (107) hide show
  1. package/client/components/activity-starter-form.ts +16 -23
  2. package/client/components/{activity-approval-timeline.ts → activity-thread-timeline.ts} +73 -10
  3. package/client/index.ts +2 -1
  4. package/client/pages/activity-approval/activity-approval-page.ts +19 -7
  5. package/client/pages/activity-instance/activity-instance-view.ts +10 -36
  6. package/client/pages/activity-thread/activity-thread-page.ts +19 -6
  7. package/client/pages/activity-thread/activity-thread-view-page.ts +26 -7
  8. package/client/pages/activity-thread/activity-thread-view.ts +44 -19
  9. package/client/templates/activity-approval-context-template.ts +8 -2
  10. package/client/templates/activity-thread-context-template.ts +4 -17
  11. package/client/types/activity-thread-history.ts +47 -0
  12. package/client/types/activity-thread.ts +5 -0
  13. package/dist-client/components/activity-starter-form.js +15 -21
  14. package/dist-client/components/activity-starter-form.js.map +1 -1
  15. package/dist-client/components/{activity-approval-timeline.d.ts → activity-thread-timeline.d.ts} +9 -3
  16. package/dist-client/components/{activity-approval-timeline.js → activity-thread-timeline.js} +74 -16
  17. package/dist-client/components/activity-thread-timeline.js.map +1 -0
  18. package/dist-client/index.d.ts +2 -1
  19. package/dist-client/index.js +2 -1
  20. package/dist-client/index.js.map +1 -1
  21. package/dist-client/pages/activity-approval/activity-approval-page.d.ts +1 -1
  22. package/dist-client/pages/activity-approval/activity-approval-page.js +19 -7
  23. package/dist-client/pages/activity-approval/activity-approval-page.js.map +1 -1
  24. package/dist-client/pages/activity-instance/activity-instance-view.js +8 -22
  25. package/dist-client/pages/activity-instance/activity-instance-view.js.map +1 -1
  26. package/dist-client/pages/activity-thread/activity-thread-page.d.ts +1 -0
  27. package/dist-client/pages/activity-thread/activity-thread-page.js +19 -6
  28. package/dist-client/pages/activity-thread/activity-thread-page.js.map +1 -1
  29. package/dist-client/pages/activity-thread/activity-thread-view-page.d.ts +1 -1
  30. package/dist-client/pages/activity-thread/activity-thread-view-page.js +26 -7
  31. package/dist-client/pages/activity-thread/activity-thread-view-page.js.map +1 -1
  32. package/dist-client/pages/activity-thread/activity-thread-view.js +44 -19
  33. package/dist-client/pages/activity-thread/activity-thread-view.js.map +1 -1
  34. package/dist-client/templates/activity-approval-context-template.d.ts +1 -1
  35. package/dist-client/templates/activity-approval-context-template.js +8 -2
  36. package/dist-client/templates/activity-approval-context-template.js.map +1 -1
  37. package/dist-client/templates/activity-thread-context-template.d.ts +1 -1
  38. package/dist-client/templates/activity-thread-context-template.js +5 -18
  39. package/dist-client/templates/activity-thread-context-template.js.map +1 -1
  40. package/dist-client/tsconfig.tsbuildinfo +1 -1
  41. package/dist-client/types/activity-thread-history.d.ts +28 -0
  42. package/dist-client/types/activity-thread-history.js +7 -0
  43. package/dist-client/types/activity-thread-history.js.map +1 -0
  44. package/dist-client/types/activity-thread.d.ts +3 -0
  45. package/dist-client/types/activity-thread.js.map +1 -1
  46. package/dist-server/controllers/activity-approval/_abort.js +3 -1
  47. package/dist-server/controllers/activity-approval/_abort.js.map +1 -1
  48. package/dist-server/controllers/activity-approval/abort.js.map +1 -1
  49. package/dist-server/controllers/activity-approval/approve.js +2 -2
  50. package/dist-server/controllers/activity-approval/approve.js.map +1 -1
  51. package/dist-server/controllers/activity-approval/delegate.js +2 -1
  52. package/dist-server/controllers/activity-approval/delegate.js.map +1 -1
  53. package/dist-server/controllers/activity-approval/reject.js +1 -1
  54. package/dist-server/controllers/activity-approval/reject.js.map +1 -1
  55. package/dist-server/controllers/activity-thread/_abort.js.map +1 -1
  56. package/dist-server/controllers/activity-thread/abort.js.map +1 -1
  57. package/dist-server/controllers/activity-thread/delegate.js +1 -2
  58. package/dist-server/controllers/activity-thread/delegate.js.map +1 -1
  59. package/dist-server/controllers/activity-thread/end.js.map +1 -1
  60. package/dist-server/controllers/activity-thread/restart.js.map +1 -1
  61. package/dist-server/controllers/activity-thread/save.js +1 -1
  62. package/dist-server/controllers/activity-thread/save.js.map +1 -1
  63. package/dist-server/controllers/activity-thread/start.js.map +1 -1
  64. package/dist-server/controllers/activity-thread/submit.js.map +1 -1
  65. package/dist-server/service/activity-approval/activity-approval-subscription.js.map +1 -1
  66. package/dist-server/service/activity-approval/activity-approval.js.map +1 -1
  67. package/dist-server/service/activity-thread/activity-thread-history-query.js +65 -0
  68. package/dist-server/service/activity-thread/activity-thread-history-query.js.map +1 -0
  69. package/dist-server/service/activity-thread/activity-thread-history.js +10 -11
  70. package/dist-server/service/activity-thread/activity-thread-history.js.map +1 -1
  71. package/dist-server/service/activity-thread/activity-thread-mutation.js +1 -1
  72. package/dist-server/service/activity-thread/activity-thread-mutation.js.map +1 -1
  73. package/dist-server/service/activity-thread/activity-thread-query.js +20 -3
  74. package/dist-server/service/activity-thread/activity-thread-query.js.map +1 -1
  75. package/dist-server/service/activity-thread/activity-thread.js +5 -0
  76. package/dist-server/service/activity-thread/activity-thread.js.map +1 -1
  77. package/dist-server/service/activity-thread/index.js +2 -1
  78. package/dist-server/service/activity-thread/index.js.map +1 -1
  79. package/dist-server/tsconfig.tsbuildinfo +1 -1
  80. package/package.json +3 -3
  81. package/server/controllers/activity-approval/_abort.ts +12 -1
  82. package/server/controllers/activity-approval/abort.ts +2 -9
  83. package/server/controllers/activity-approval/approve.ts +3 -4
  84. package/server/controllers/activity-approval/delegate.ts +6 -6
  85. package/server/controllers/activity-approval/reject.ts +3 -9
  86. package/server/controllers/activity-thread/_abort.ts +1 -4
  87. package/server/controllers/activity-thread/abort.ts +1 -4
  88. package/server/controllers/activity-thread/delegate.ts +1 -1
  89. package/server/controllers/activity-thread/end.ts +1 -4
  90. package/server/controllers/activity-thread/restart.ts +1 -6
  91. package/server/controllers/activity-thread/save.ts +1 -1
  92. package/server/controllers/activity-thread/start.ts +1 -6
  93. package/server/controllers/activity-thread/submit.ts +2 -6
  94. package/server/service/activity-approval/activity-approval-subscription.ts +1 -2
  95. package/server/service/activity-approval/activity-approval.ts +1 -11
  96. package/server/service/activity-thread/activity-thread-history-query.ts +34 -0
  97. package/server/service/activity-thread/activity-thread-history.ts +10 -22
  98. package/server/service/activity-thread/activity-thread-mutation.ts +4 -20
  99. package/server/service/activity-thread/activity-thread-query.ts +15 -7
  100. package/server/service/activity-thread/activity-thread.ts +8 -19
  101. package/server/service/activity-thread/index.ts +2 -1
  102. package/translations/en.json +11 -1
  103. package/translations/ja.json +12 -2
  104. package/translations/ko.json +12 -2
  105. package/translations/ms.json +12 -2
  106. package/translations/zh.json +11 -1
  107. package/dist-client/components/activity-approval-timeline.js.map +0 -1
@@ -40,20 +40,21 @@ export class ActivityStarterForm extends localize(i18next)(LitElement) {
40
40
  color: var(--secondary-color);
41
41
  }
42
42
 
43
- content label{
44
- font:var(--label-font)
43
+ content label {
44
+ font: var(--label-font);
45
45
  }
46
- content input, content textarea{
47
- border-radius:var(--border-radius);
48
- border:var(--border-dark-color);
49
- padding:var(--input-padding);
50
- margin:var(--input-margin);
51
- font:var(--input-font);
46
+ content input,
47
+ content textarea {
48
+ border-radius: var(--border-radius);
49
+ border: var(--border-dark-color);
50
+ padding: var(--input-padding);
51
+ margin: var(--input-margin);
52
+ font: var(--input-font);
52
53
  }
53
54
 
54
- content [desc]{
55
+ content [desc] {
55
56
  color: var(--secondary-text-color);
56
- font-size:0.9em
57
+ font-size: 0.9em;
57
58
  }
58
59
 
59
60
  #description {
@@ -84,23 +85,16 @@ export class ActivityStarterForm extends localize(i18next)(LitElement) {
84
85
  return html`
85
86
  <content>
86
87
  <div desc>
87
- <span
88
- >업무의 타이틀과 설명을 작성해서 초안저장을 클릭하시면, 업무 초안이 생성되고 편집할 수 있는 페이지로
89
- 이동합니다.</span
90
- >
88
+ <span>업무의 타이틀과 설명을 작성해서 초안저장을 클릭하시면, 업무 초안이 생성되고 편집할 수 있는 페이지로 이동합니다.</span>
91
89
 
92
90
  <span
93
- >이렇게 생성된 업무 초안은 '작성중인 업무' 리스트에서 찾아볼 수 있으며,
94
- '${startingType == 'issue' ? '이슈' : '게시'}' 전까지 언제든지 수정할 수 있습니다.</span
91
+ >이렇게 생성된 업무 초안은 '작성중인 업무' 리스트에서 찾아볼 수 있으며, '${startingType == 'issue' ? '이슈' : '게시'}' 전까지 언제든지 수정할 수
92
+ 있습니다.</span
95
93
  >
96
94
  </div>
97
95
  <div>
98
96
  <label for="name">${i18next.t('label.title')}</label>
99
- <input
100
- id="name"
101
- .value=${name || this.activity?.name}
102
- @change=${e => (this.activityInstance.name = e.currentTarget.value)}
103
- />
97
+ <input id="name" .value=${name || this.activity?.name} @change=${e => (this.activityInstance.name = e.currentTarget.value)} />
104
98
  </div>
105
99
 
106
100
  <div>
@@ -185,8 +179,7 @@ export class ActivityStarterForm extends localize(i18next)(LitElement) {
185
179
 
186
180
  async draftActivityInstance() {
187
181
  var { id: activityId } = this.activity
188
- var { id, name, description, priority, threadsMin, threadsMax, dueAt, input, assignees, approvalLine } =
189
- this.activityInstance
182
+ var { id, name, description, priority, threadsMin, threadsMax, dueAt, input, assignees, approvalLine } = this.activityInstance
190
183
 
191
184
  name ||= this.activity.name
192
185
  description ||= this.activity.description
@@ -9,12 +9,14 @@ import { connect } from 'pwa-helpers/connect-mixin'
9
9
  import { store } from '@operato/shell'
10
10
  import { i18next } from '@operato/i18n'
11
11
 
12
+ import { ActivityThread } from '../types/activity-thread'
13
+ import { ActivityThreadHistory } from '../types/activity-thread-history'
12
14
  import { ActivityApproval } from '../types/activity-approval'
13
15
 
14
16
  const formatter = new Intl.DateTimeFormat(navigator.language, { dateStyle: 'full', timeStyle: 'short' })
15
17
 
16
- @customElement('activity-approval-timeline')
17
- export class ActivityApprovalTimeline extends connect(store)(LitElement) {
18
+ @customElement('activity-thread-timeline')
19
+ export class ActivityThreadTimeline extends connect(store)(LitElement) {
18
20
  static styles = [
19
21
  css`
20
22
  :host {
@@ -46,8 +48,9 @@ export class ActivityApprovalTimeline extends connect(store)(LitElement) {
46
48
  flex: 1;
47
49
  color: var(--secondary-color);
48
50
 
49
- strong {
51
+ div {
50
52
  float: right;
53
+ opacity: 0.7;
51
54
  }
52
55
 
53
56
  mwc-icon {
@@ -109,25 +112,64 @@ export class ActivityApprovalTimeline extends connect(store)(LitElement) {
109
112
  background-color: var(--worklist-status-color, tomato);
110
113
  opacity: 0.2;
111
114
  }
115
+
116
+ table,
117
+ th,
118
+ td {
119
+ border: 1px solid lightgray;
120
+ border-collapse: collapse;
121
+ }
122
+
123
+ th,
124
+ td {
125
+ padding: 10px;
126
+ }
112
127
  `
113
128
  ]
114
129
 
115
- @property({ type: Object }) private activityThread
130
+ @property({ type: Object }) activityThread?: ActivityThread
131
+ @property({ type: String }) subtitle?: string
132
+ @property({ type: Boolean, attribute: 'short-form' }) shortForm?: boolean
116
133
 
117
134
  render() {
118
- const { activityApprovals = [] } = this.activityThread || {}
135
+ const { activityApprovals = [], activityThreadHistories = [] } = this.activityThread || {}
136
+
137
+ const timeline = [
138
+ ...activityThreadHistories.filter(item => item.transaction && (!this.shortForm || !/^.*(reject|approve|save|restart).*$/.test(item.transaction))),
139
+ ...activityApprovals.filter(item => item.judgment)
140
+ ].sort((a, b) => ((a.updatedAt || 0) > (b.updatedAt || 0) ? 1 : -1))
119
141
 
120
- return html` ${activityApprovals.length > 0
142
+ return html` ${timeline.length > 0
121
143
  ? html`
122
- <span subtitle>${i18next.t('label.review-and-approval')}</span>
144
+ <span subtitle>${this.subtitle || i18next.t('label.timeline')}</span>
123
145
 
124
146
  <ol>
125
- ${activityApprovals.map(approval => this.renderActivityApproval(approval))}
147
+ ${timeline.map(item =>
148
+ 'reason' in item ? this.renderActivityThreadHistory(item as ActivityThreadHistory) : this.renderActivityApproval(item as ActivityApproval)
149
+ )}
126
150
  </ol>
127
151
  `
128
152
  : nothing}`
129
153
  }
130
154
 
155
+ renderActivityThreadHistory(activityThreadHistory: ActivityThreadHistory) {
156
+ const { updater, updatedAt, state, reason, output, transaction } = activityThreadHistory
157
+ const { name } = updater || {}
158
+
159
+ return html`
160
+ <li>
161
+ <span date>${formatter.format(new Date(updatedAt!))}</span>
162
+ <span status></span>
163
+
164
+ <span info>
165
+ ${i18next.t('label.activity-transaction-' + transaction)}
166
+ <div><mwc-icon>account_circle</mwc-icon>${name}</div>
167
+ <p>${reason ? reason : output ? this.renderOutput(output) : nothing}</p>
168
+ </span>
169
+ </li>
170
+ `
171
+ }
172
+
131
173
  renderActivityApproval(activityApproval: ActivityApproval) {
132
174
  const { judgment, approver, comment, createdAt, terminatedAt } = activityApproval
133
175
  const { name } = approver || {}
@@ -137,11 +179,32 @@ export class ActivityApprovalTimeline extends connect(store)(LitElement) {
137
179
  <span date>${formatter.format(new Date(terminatedAt || createdAt!))}</span>
138
180
  <span status></span>
139
181
  <span info>
140
- ${i18next.t('label.activity-state-' + (judgment || 'started'))}
141
- <strong><mwc-icon>account_circle</mwc-icon>${name}</strong>
182
+ ${i18next.t('label.activity-state-' + judgment)}
183
+ <div><mwc-icon>account_circle</mwc-icon>${name}</div>
142
184
  <p>${comment}</p>
143
185
  </span>
144
186
  </li>
145
187
  `
146
188
  }
189
+
190
+ renderOutput(output: any) {
191
+ const rows = [] as [key: string, value: string][]
192
+
193
+ for (let key in output) {
194
+ rows.push([key, output[key]])
195
+ }
196
+
197
+ return html`
198
+ <table>
199
+ ${rows.map(
200
+ ([key, value]) => html`
201
+ <tr>
202
+ <td>${key}</td>
203
+ <td>${value}</td>
204
+ </tr>
205
+ `
206
+ )}
207
+ </table>
208
+ `
209
+ }
147
210
  }
package/client/index.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './pages/activity/activity-page.js'
2
- export * from './activity-summary-generator'
2
+ export * from './activity-summary-generator.js'
3
+ export * from './components/activity-thread-timeline.js'
@@ -1,7 +1,7 @@
1
1
  import '@operato/property-editor/ox-properties-dynamic-view.js'
2
2
  import '@operato/board/ox-board-viewer.js'
3
3
  import '../../components/activity-approval-ribon.js'
4
- import '../../components/activity-approval-timeline.js'
4
+ import '../../components/activity-thread-timeline.js'
5
5
 
6
6
  import gql from 'graphql-tag'
7
7
  import { css, html, nothing } from 'lit'
@@ -45,13 +45,23 @@ const ActivityApprovalFetchResult = `\
45
45
  order
46
46
  approver {
47
47
  name
48
- email
49
48
  }
50
49
  judgment
51
50
  comment
52
51
  createdAt
52
+ updatedAt
53
53
  terminatedAt
54
54
  }
55
+ activityThreadHistories {
56
+ transaction
57
+ reason
58
+ updater {
59
+ name
60
+ }
61
+ updatedAt
62
+ state
63
+ output
64
+ }
55
65
  activityInstance {
56
66
  id
57
67
  name
@@ -121,9 +131,8 @@ export class ActivityApprovalPage extends connect(store)(localize(i18next)(PageV
121
131
  height: 100%;
122
132
  }
123
133
 
124
- activity-approval-timeline {
134
+ activity-thread-timeline {
125
135
  margin: var(--margin-default);
126
- padding: var(--padding-default);
127
136
  }
128
137
 
129
138
  div[comment] {
@@ -148,7 +157,10 @@ export class ActivityApprovalPage extends connect(store)(localize(i18next)(PageV
148
157
  }
149
158
  }
150
159
 
151
- div[empty] {
160
+ [empty] {
161
+ flex: 1;
162
+ display: flex;
163
+ align-items: center;
152
164
  align-self: center;
153
165
  }
154
166
  `
@@ -193,7 +205,7 @@ export class ActivityApprovalPage extends connect(store)(localize(i18next)(PageV
193
205
 
194
206
  render() {
195
207
  if (!this.activityThread) {
196
- return html`<div empty>no activity thread info.</div>`
208
+ return html`<div empty>${i18next.t('text.no activity thread info')}</div>`
197
209
  }
198
210
 
199
211
  const { terminatedAt } = this.activityApproval
@@ -202,7 +214,7 @@ export class ActivityApprovalPage extends connect(store)(localize(i18next)(PageV
202
214
  return html`
203
215
  <activity-approval-ribon .activityApproval=${this.activityApproval}></activity-approval-ribon>
204
216
  ${this.activityContent()}
205
- <activity-approval-timeline .activityThread=${this.activityThread}></activity-approval-timeline>
217
+ <activity-thread-timeline .activityThread=${this.activityThread} short-form></activity-thread-timeline>
206
218
  ${editable
207
219
  ? html`
208
220
  <div comment>
@@ -228,8 +228,7 @@ export class ActivityInstanceView extends localize(i18next)(LitElement) {
228
228
  return html`<div>no activity instance info.</div>`
229
229
  }
230
230
 
231
- const { id, name, description, state, issuer, assignedAt, startedAt, activityThreads, terminatedAt, updatedAt } =
232
- this.activityInstance
231
+ const { id, name, description, state, issuer, assignedAt, startedAt, activityThreads, terminatedAt, updatedAt } = this.activityInstance
233
232
 
234
233
  return html`
235
234
  <div instance-container>
@@ -250,37 +249,20 @@ export class ActivityInstanceView extends localize(i18next)(LitElement) {
250
249
  <mwc-icon>account_circle</mwc-icon>
251
250
  <strong>${issuer?.name || ''}</strong>
252
251
  </div>
253
- <div>
254
- <label>${i18next.t('field.assigned-at')}</label>${assignedAt && formatter.format(new Date(assignedAt))}
255
- </div>
252
+ <div><label>${i18next.t('field.assigned-at')}</label>${assignedAt && formatter.format(new Date(assignedAt))}</div>
256
253
  <div><label>${i18next.t('field.started-at')}</label>${startedAt && formatter.format(new Date(startedAt))}</div>
257
254
  <div><label>${i18next.t('field.updated-at')}</label>${updatedAt && formatter.format(new Date(updatedAt))}</div>
258
- <div>
259
- <label>${i18next.t('field.terminated-at')}</label>${terminatedAt && formatter.format(new Date(terminatedAt))}
260
- </div>
261
- </div>
262
- <div thread-container>
263
- ${activityThreads?.map(activityThread => this.renderActivityThread(this.activityInstance!, activityThread))}
255
+ <div><label>${i18next.t('field.terminated-at')}</label>${terminatedAt && formatter.format(new Date(terminatedAt))}</div>
264
256
  </div>
257
+ <div thread-container>${activityThreads?.map(activityThread => this.renderActivityThread(this.activityInstance!, activityThread))}</div>
265
258
  `
266
259
  }
267
260
 
268
261
  renderActivityThread(activityInstance: ActivityInstance, activityThread: ActivityThread) {
269
- const {
270
- state,
271
- assignee,
272
- output,
273
- round,
274
- activityApprovals = [],
275
- assignedAt,
276
- startedAt,
277
- terminatedAt
278
- } = activityThread
262
+ const { state, assignee, output, round, activityApprovals = [], assignedAt, startedAt, terminatedAt } = activityThread
279
263
  const { approvalLine } = activityInstance!
280
264
  const { name, email } = assignee || {}
281
- const approvals = activityApprovals.sort((a, b) =>
282
- a.round < b.round ? 1 : a.round > b.round ? -1 : a.order! < b.order! ? 1 : -1
283
- )
265
+ const approvals = activityApprovals.sort((a, b) => (a.round < b.round ? 1 : a.round > b.round ? -1 : a.order! < b.order! ? 1 : -1))
284
266
  const current = approvals[0]?.round == round ? approvals[0].order : -1
285
267
 
286
268
  return html`
@@ -296,13 +278,9 @@ export class ActivityInstanceView extends localize(i18next)(LitElement) {
296
278
  <span status></span>
297
279
  <strong>${i18next.t('label.activity-state-' + state)}</strong>
298
280
  </div>
299
- <div>
300
- <label>${i18next.t('field.assigned-at')}</label> ${assignedAt && formatter.format(new Date(assignedAt))}
301
- </div>
281
+ <div><label>${i18next.t('field.assigned-at')}</label> ${assignedAt && formatter.format(new Date(assignedAt))}</div>
302
282
  <div><label>${i18next.t('field.started-at')}</label> ${startedAt && formatter.format(new Date(startedAt))}</div>
303
- <div>
304
- <label>${i18next.t('field.terminated-at')}</label> ${terminatedAt && formatter.format(new Date(terminatedAt))}
305
- </div>
283
+ <div><label>${i18next.t('field.terminated-at')}</label> ${terminatedAt && formatter.format(new Date(terminatedAt))}</div>
306
284
  <div><label>${i18next.t('field.round')}</label> ${round}</div>
307
285
  </div>
308
286
 
@@ -311,13 +289,9 @@ export class ActivityInstanceView extends localize(i18next)(LitElement) {
311
289
  ${this.renderInOut(output || {})}
312
290
  </div>
313
291
  <div timeline>
314
- <span subtitle>${i18next.t('label.review-and-approval')}</span>
292
+ <span subtitle>${i18next.t('label.timeline')}</span>
315
293
 
316
- <div>
317
- ${approvalLine
318
- ? html`<approval-line-view .model=${approvalLine} .current=${current}></approval-line-view>`
319
- : html``}
320
- </div>
294
+ <div>${approvalLine ? html`<approval-line-view .model=${approvalLine} .current=${current}></approval-line-view>` : html``}</div>
321
295
 
322
296
  <ol>
323
297
  ${approvals.map(approval => this.renderActivityApproval(approval))}
@@ -1,6 +1,7 @@
1
1
  import '@operato/property-editor/ox-properties-dynamic-view.js'
2
2
  import '@operato/board/ox-board-viewer.js'
3
3
  import '../../components/activity-thread-ribon.js'
4
+ import '../../components/activity-thread-timeline.js'
4
5
 
5
6
  import gql from 'graphql-tag'
6
7
  import { css, html } from 'lit'
@@ -33,13 +34,23 @@ const ActivityThreadFetchResult = `\
33
34
  order
34
35
  approver {
35
36
  name
36
- email
37
37
  }
38
38
  judgment
39
39
  comment
40
40
  createdAt
41
+ updatedAt
41
42
  terminatedAt
42
43
  }
44
+ activityThreadHistories {
45
+ transaction
46
+ reason
47
+ updater {
48
+ name
49
+ }
50
+ updatedAt
51
+ state
52
+ output
53
+ }
43
54
  activityInstance {
44
55
  id
45
56
  name
@@ -112,12 +123,14 @@ export class ActivityThreadPage extends connect(store)(localize(i18next)(PageVie
112
123
  height: 100%;
113
124
  }
114
125
 
115
- activity-approval-timeline {
126
+ activity-thread-timeline {
116
127
  margin: var(--margin-default);
117
- padding: var(--padding-default);
118
128
  }
119
129
 
120
- div[empty] {
130
+ [empty] {
131
+ flex: 1;
132
+ display: flex;
133
+ align-items: center;
121
134
  align-self: center;
122
135
  }
123
136
  `
@@ -177,13 +190,13 @@ export class ActivityThreadPage extends connect(store)(localize(i18next)(PageVie
177
190
  const activityThread = this.activityThread
178
191
 
179
192
  if (!activityThread) {
180
- return html`<div empty>no activity thread info.</div> `
193
+ return html`<div empty>${i18next.t('text.no activity thread info')}</div> `
181
194
  }
182
195
 
183
196
  return html`
184
197
  <activity-thread-ribon .activityThread=${activityThread}></activity-thread-ribon>
185
198
  ${this.activityContent()}
186
- <activity-approval-timeline .activityThread=${activityThread}></activity-approval-timeline>
199
+ <activity-thread-timeline .activityThread=${activityThread} short-form></activity-thread-timeline>
187
200
  `
188
201
  }
189
202
 
@@ -1,6 +1,6 @@
1
1
  import '@operato/board/ox-board-viewer.js'
2
2
  import '../../components/activity-thread-ribon.js'
3
- import '../../components/activity-approval-timeline.js'
3
+ import '../../components/activity-thread-timeline.js'
4
4
  import './activity-thread-view.js'
5
5
 
6
6
  import gql from 'graphql-tag'
@@ -33,13 +33,23 @@ const ActivityThreadFetchResult = `\
33
33
  order
34
34
  approver {
35
35
  name
36
- email
37
36
  }
38
37
  judgment
39
38
  comment
40
39
  createdAt
40
+ updatedAt
41
41
  terminatedAt
42
42
  }
43
+ activityThreadHistories {
44
+ transaction
45
+ reason
46
+ updater {
47
+ name
48
+ }
49
+ updatedAt
50
+ state
51
+ output
52
+ }
43
53
  activityInstance {
44
54
  id
45
55
  name
@@ -116,18 +126,27 @@ export class ActivityThreadViewPage extends connect(store)(localize(i18next)(Pag
116
126
  padding: var(--padding-default);
117
127
  }
118
128
 
119
- activity-approval-timeline {
129
+ activity-thread-timeline {
120
130
  margin: var(--margin-default);
121
- padding: var(--padding-default);
122
131
  }
123
132
 
124
133
  #custom-content {
125
134
  flex: 1;
126
135
  }
127
136
 
128
- div[empty] {
137
+ [empty] {
138
+ flex: 1;
139
+ display: flex;
140
+ align-items: center;
129
141
  align-self: center;
130
142
  }
143
+
144
+ @media print {
145
+ :host {
146
+ display: block;
147
+ overflow: visible;
148
+ }
149
+ }
131
150
  `
132
151
  ]
133
152
 
@@ -147,13 +166,13 @@ export class ActivityThreadViewPage extends connect(store)(localize(i18next)(Pag
147
166
  const activityThread = this.activityThread
148
167
 
149
168
  if (!activityThread) {
150
- return html`<div empty>no activity thread info.</div> `
169
+ return html`<div empty>${i18next.t('text.no activity thread info')}</div> `
151
170
  }
152
171
 
153
172
  return html`
154
173
  <activity-thread-ribon .activityThread=${activityThread}></activity-thread-ribon>
155
174
  ${this.activityContent()}
156
- <activity-approval-timeline .activityThread=${activityThread}></activity-approval-timeline>
175
+ <activity-thread-timeline .activityThread=${activityThread} short-form></activity-thread-timeline>
157
176
  `
158
177
  }
159
178
 
@@ -63,20 +63,24 @@ export class ActivityThreadView extends localize(i18next)(LitElement) {
63
63
  border-right: var(--border-dark-color);
64
64
  padding: var(--padding-wide);
65
65
  color: var(--primary-text-color);
66
+
67
+ div {
68
+ margin-bottom: var(--margin-default);
69
+ padding-bottom: var(--padding-default);
70
+ border-bottom: var(--border-dark-color);
71
+ }
72
+
73
+ div label {
74
+ display: inline-block;
75
+ margin-right: var(--margin-default);
76
+ }
66
77
  }
78
+
67
79
  [thread-container] {
68
80
  flex: 2;
69
81
  padding: var(--padding-wide);
70
82
  }
71
- [instance-container] div {
72
- margin-bottom: var(--margin-default);
73
- padding-bottom: var(--padding-default);
74
- border-bottom: var(--border-dark-color);
75
- }
76
- [instance-container] div label {
77
- display: inline-block;
78
- margin-right: var(--margin-default);
79
- }
83
+
80
84
  span[status] {
81
85
  width: 15px;
82
86
  height: 15px;
@@ -85,10 +89,12 @@ export class ActivityThreadView extends localize(i18next)(LitElement) {
85
89
  margin-right: var(--margin-narrow);
86
90
  border-radius: 50%;
87
91
  }
92
+
88
93
  table {
89
94
  width: 100%;
90
95
  border-collapse: collapse;
91
96
  }
97
+
92
98
  th {
93
99
  background-color: rgba(var(--primary-color-rgb), 0.05);
94
100
  border-top: var(--grid-header-top-border);
@@ -98,16 +104,21 @@ export class ActivityThreadView extends localize(i18next)(LitElement) {
98
104
  font: var(--grid-header-font);
99
105
  color: var(--grid-header-color);
100
106
  }
107
+
101
108
  td {
102
109
  padding: var(--padding-narrow);
103
110
  border-bottom: var(--grid-record-border-bottom);
104
111
  }
105
- [assignee] * {
106
- vertical-align: middle;
107
- }
108
- [assignee] mwc-icon {
109
- opacity: 0.5;
112
+
113
+ [assignee] {
114
+ * {
115
+ vertical-align: middle;
116
+ }
117
+ mwc-icon {
118
+ opacity: 0.5;
119
+ }
110
120
  }
121
+
111
122
  [subtitle] {
112
123
  display: block;
113
124
  margin: var(--margin-wide) 0 var(--margin-narrow) 0;
@@ -120,12 +131,26 @@ export class ActivityThreadView extends localize(i18next)(LitElement) {
120
131
  padding: var(--padding-narrow);
121
132
  text-align: right;
122
133
  overflow: hidden;
134
+
135
+ div label {
136
+ float: left;
137
+ width: 25%;
138
+ text-align: left;
139
+ }
140
+ }
141
+
142
+ [empty] {
143
+ flex: 1;
144
+ display: flex;
145
+ align-items: center;
146
+ align-self: center;
123
147
  }
124
148
 
125
- [thread] div label {
126
- float: left;
127
- width: 25%;
128
- text-align: left;
149
+ @media print {
150
+ :host {
151
+ display: block;
152
+ overflow: visible;
153
+ }
129
154
  }
130
155
  `
131
156
  ]
@@ -140,7 +165,7 @@ export class ActivityThreadView extends localize(i18next)(LitElement) {
140
165
 
141
166
  render() {
142
167
  if (!this.activityThread) {
143
- return html`<div>no activity thread info.</div>`
168
+ return html`<div empty>${i18next.t('text.no activity thread info')}</div>`
144
169
  }
145
170
 
146
171
  const { state, assignee, output, round, assignedAt, startedAt, terminatedAt, activityInstance } = this.activityThread
@@ -1,5 +1,5 @@
1
1
  import '@material/mwc-icon'
2
- import '../components/activity-approval-timeline'
2
+ import '../components/activity-thread-timeline'
3
3
 
4
4
  import { html, css, LitElement, nothing } from 'lit'
5
5
  import { customElement, property, state } from 'lit/decorators.js'
@@ -106,6 +106,10 @@ class ActivityApprovalContextTemplate extends connect(store)(LitElement) {
106
106
  border-right: 0;
107
107
  }
108
108
 
109
+ activity-thread-timeline {
110
+ margin: var(--margin-default);
111
+ }
112
+
109
113
  [thumbnail] {
110
114
  display: flex;
111
115
  justify-content: center;
@@ -149,7 +153,9 @@ class ActivityApprovalContextTemplate extends connect(store)(LitElement) {
149
153
  <div><label>since</label> ${createdAt && formatter.format(new Date(createdAt))}</div>
150
154
  </div>
151
155
 
152
- ${activityApprovals && activityApprovals.length > 0 ? html` <activity-approval-timeline .activityThread=${activityThread}></activity-approval-timeline> ` : nothing}
156
+ ${activityApprovals && activityApprovals.length > 0
157
+ ? html` <activity-thread-timeline .activityThread=${activityThread} short-form></activity-thread-timeline> `
158
+ : nothing}
153
159
  ${thumbnail
154
160
  ? html` <div thumbnail>
155
161
  <img src=${thumbnail} />