@things-factory/worklist 6.2.95 → 6.2.97

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 (32) hide show
  1. package/client/components/activity-approval-timeline.ts +149 -0
  2. package/client/pages/activity-approval/activity-approval-page.ts +37 -134
  3. package/client/pages/activity-thread/activity-thread-page.ts +11 -3
  4. package/client/pages/activity-thread/activity-thread-view-page.ts +15 -8
  5. package/client/pages/activity-thread/activity-thread-view.ts +6 -114
  6. package/client/templates/activity-approval-context-template.ts +8 -13
  7. package/client/templates/activity-instance-context-template.ts +16 -18
  8. package/client/templates/activity-thread-context-template.ts +47 -157
  9. package/dist-client/components/activity-approval-timeline.d.ts +18 -0
  10. package/dist-client/components/activity-approval-timeline.js +145 -0
  11. package/dist-client/components/activity-approval-timeline.js.map +1 -0
  12. package/dist-client/pages/activity-approval/activity-approval-page.d.ts +1 -2
  13. package/dist-client/pages/activity-approval/activity-approval-page.js +36 -129
  14. package/dist-client/pages/activity-approval/activity-approval-page.js.map +1 -1
  15. package/dist-client/pages/activity-thread/activity-thread-page.js +10 -3
  16. package/dist-client/pages/activity-thread/activity-thread-page.js.map +1 -1
  17. package/dist-client/pages/activity-thread/activity-thread-view-page.d.ts +1 -0
  18. package/dist-client/pages/activity-thread/activity-thread-view-page.js +13 -4
  19. package/dist-client/pages/activity-thread/activity-thread-view-page.js.map +1 -1
  20. package/dist-client/pages/activity-thread/activity-thread-view.d.ts +0 -2
  21. package/dist-client/pages/activity-thread/activity-thread-view.js +6 -101
  22. package/dist-client/pages/activity-thread/activity-thread-view.js.map +1 -1
  23. package/dist-client/templates/activity-approval-context-template.d.ts +1 -0
  24. package/dist-client/templates/activity-approval-context-template.js +8 -13
  25. package/dist-client/templates/activity-approval-context-template.js.map +1 -1
  26. package/dist-client/templates/activity-instance-context-template.js +15 -16
  27. package/dist-client/templates/activity-instance-context-template.js.map +1 -1
  28. package/dist-client/templates/activity-thread-context-template.d.ts +1 -0
  29. package/dist-client/templates/activity-thread-context-template.js +46 -151
  30. package/dist-client/templates/activity-thread-context-template.js.map +1 -1
  31. package/dist-client/tsconfig.tsbuildinfo +1 -1
  32. package/package.json +9 -9
@@ -0,0 +1,149 @@
1
+ import '@material/mwc-icon'
2
+ import '@things-factory/organization/dist-client/component/approval-line-view.js'
3
+
4
+ import { html, css, LitElement, nothing } from 'lit'
5
+ import { customElement, property } from 'lit/decorators.js'
6
+
7
+ import { connect } from 'pwa-helpers/connect-mixin'
8
+
9
+ import { store } from '@operato/shell'
10
+ import { i18next } from '@operato/i18n'
11
+
12
+ import { ActivityApproval } from '../types/activity-approval'
13
+
14
+ const formatter = new Intl.DateTimeFormat(navigator.language, { dateStyle: 'full', timeStyle: 'short' })
15
+
16
+ @customElement('activity-approval-timeline')
17
+ export class ActivityApprovalTimeline extends connect(store)(LitElement) {
18
+ static styles = [
19
+ css`
20
+ :host {
21
+ display: block;
22
+ margin-bottom: var(--margin-default);
23
+ padding: var(--padding-default);
24
+ }
25
+
26
+ [subtitle] {
27
+ padding: var(--padding-narrow) var(--padding-default);
28
+ background-color: var(--theme-white-color);
29
+ border: 2px solid var(--secondary-text-color);
30
+ border-radius: 15px;
31
+ box-shadow: var(--box-shadow);
32
+ color: var(--secondary-text-color);
33
+ font-weight: bold;
34
+ }
35
+
36
+ ol {
37
+ list-style: none;
38
+ margin: var(--margin-default) 0 0 var(--margin-narrow);
39
+ padding: 0;
40
+ }
41
+
42
+ li {
43
+ display: flex;
44
+ border: none;
45
+ }
46
+
47
+ [info] {
48
+ flex: 1;
49
+ color: var(--secondary-color);
50
+
51
+ strong {
52
+ float: right;
53
+ }
54
+
55
+ mwc-icon {
56
+ position: relative;
57
+ top: 3px;
58
+ font-size: var(--fontsize-large);
59
+ }
60
+
61
+ p {
62
+ background-color: #f4f4f4;
63
+ margin: var(--margin-narrow) 0 var(--margin-default) 0;
64
+ padding: var(--padding-narrow) var(--padding-default);
65
+ font-size: var(--fontsize-small);
66
+ text-align: justify;
67
+ min-height: 20px;
68
+ }
69
+
70
+ p::before {
71
+ content: '';
72
+ float: right;
73
+ margin-top: -10px;
74
+ margin-right: 20px;
75
+ border: 7px solid transparent;
76
+ border-bottom-color: #f4f4f4;
77
+ border-top: 0;
78
+ }
79
+ }
80
+
81
+ [date] {
82
+ opacity: 0.7;
83
+ flex: initial;
84
+ width: 200px;
85
+ max-width: 30%;
86
+ font-size: var(--fontsize-small);
87
+ color: var(--primary-text-color);
88
+ }
89
+
90
+ [status] {
91
+ margin: 0 var(--margin-narrow);
92
+ display: block;
93
+ border-radius: 50%;
94
+ flex: initial;
95
+ width: 12px;
96
+ height: 12px;
97
+ position: relative;
98
+ top: 3px;
99
+ border: 2px solid #fff;
100
+ background-color: var(--worklist-status-color, tomato);
101
+ color: var(--primary-text-color);
102
+ }
103
+
104
+ [status]::before {
105
+ content: '';
106
+ height: 60px;
107
+ width: 2px;
108
+ display: block;
109
+ position: relative;
110
+ margin-left: 5px;
111
+ background-color: var(--worklist-status-color, tomato);
112
+ opacity: 0.2;
113
+ }
114
+ `
115
+ ]
116
+
117
+ @property({ type: Object }) private activityThread
118
+
119
+ render() {
120
+ const { activityApprovals = [] } = this.activityThread || {}
121
+
122
+ return html` ${activityApprovals.length > 0
123
+ ? html`
124
+ <span subtitle>${i18next.t('label.review-and-approval')}</span>
125
+
126
+ <ol>
127
+ ${activityApprovals.map(approval => this.renderActivityApproval(approval))}
128
+ </ol>
129
+ `
130
+ : nothing}`
131
+ }
132
+
133
+ renderActivityApproval(activityApproval: ActivityApproval) {
134
+ const { judgment, approver, comment, createdAt, terminatedAt } = activityApproval
135
+ const { name } = approver || {}
136
+
137
+ return html`
138
+ <li>
139
+ <span date>${formatter.format(new Date(terminatedAt || createdAt!))}</span>
140
+ <span status></span>
141
+ <span info>
142
+ ${i18next.t('label.activity-state-' + (judgment || 'started'))}
143
+ <strong><mwc-icon>account_circle</mwc-icon>${name}</strong>
144
+ <p>${comment}</p>
145
+ </span>
146
+ </li>
147
+ `
148
+ }
149
+ }
@@ -1,11 +1,12 @@
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
5
 
5
6
  import gql from 'graphql-tag'
6
- import { css, html } from 'lit'
7
+ import { css, html, nothing } from 'lit'
7
8
  import { unsafeHTML } from 'lit-html/directives/unsafe-html.js'
8
- import { customElement, property, query, state } from 'lit/decorators.js'
9
+ import { customElement, query, state } from 'lit/decorators.js'
9
10
  import { keyed } from 'lit/directives/keyed.js'
10
11
  import { connect } from 'pwa-helpers/connect-mixin.js'
11
12
 
@@ -14,9 +15,6 @@ import { i18next, localize } from '@operato/i18n'
14
15
  import { PageView, store } from '@operato/shell'
15
16
  import { CommonButtonStyles, ScrollbarStyles } from '@operato/styles'
16
17
  import { provider } from '@things-factory/board-ui'
17
- import { ActivityApproval } from '../../types/activity-approval.js'
18
-
19
- const formatter = new Intl.DateTimeFormat(navigator.language, { dateStyle: 'short', timeStyle: 'short' })
20
18
 
21
19
  const ActivityApprovalFetchResult = `\
22
20
  {
@@ -30,6 +28,7 @@ const ActivityApprovalFetchResult = `\
30
28
  round
31
29
  order
32
30
  createdAt
31
+ terminatedAt
33
32
  activityThread {
34
33
  state
35
34
  dueAt
@@ -122,106 +121,30 @@ export class ActivityApprovalPage extends connect(store)(localize(i18next)(PageV
122
121
  height: 100%;
123
122
  }
124
123
 
125
- #custom-content {
126
- overflow: auto;
127
- }
128
-
129
124
  div[comment] {
130
125
  display: flex;
131
- flex-direction: column;
132
- width: 100%;
133
- right: 0;
126
+ position: sticky;
134
127
  bottom: 0;
135
128
  margin: 0;
136
129
  padding: 0;
137
- opacity: 0.8;
138
- margin-top: auto;
130
+ width: 100%;
131
+ background-color: var(--main-section-background-color);
139
132
 
140
- max-height: 40%;
133
+ textarea {
134
+ flex: 1;
135
+ margin: var(--margin-default);
136
+ padding: var(--input-padding);
137
+ font: var(--input-font);
138
+ outline: none;
139
+ height: 80px;
140
+ border-radius: 10px;
141
+ border: var(--input-field-border);
142
+ resize: none;
143
+ }
141
144
  }
142
145
 
143
- div[timeline] {
144
- margin-bottom: var(--margin-default);
145
- padding: var(--padding-default);
146
- border-bottom: var(--border-dark-color);
147
- overflow: auto;
148
- }
149
- div[timeline] [subtitle] {
150
- padding: var(--padding-narrow) var(--padding-default);
151
- background-color: var(--theme-white-color);
152
- border: 2px solid var(--secondary-text-color);
153
- border-radius: 15px;
154
- box-shadow: var(--box-shadow);
155
- color: var(--secondary-text-color);
156
- font-weight: bold;
157
- }
158
- div[timeline] ol {
159
- list-style: none;
160
- margin: var(--margin-default) 0 0 var(--margin-narrow);
161
- padding: 0;
162
- }
163
- [timeline] li {
164
- display: flex;
165
- }
166
- [timeline] [info] {
167
- flex: 1;
168
- }
169
- [timeline] [date] {
170
- opacity: 0.7;
171
- width: 130px;
172
- font-size: var(--fontsize-small);
173
- }
174
- [timeline] [info] strong {
175
- float: right;
176
- }
177
- [timeline] [status] {
178
- margin: 0 var(--margin-narrow);
179
- display: block;
180
- border-radius: 50%;
181
- width: 12px;
182
- height: 12px;
183
- position: relative;
184
- top: 3px;
185
- border: 2px solid #fff;
186
- background-color: var(--worklist-status-color, tomato);
187
- }
188
- [timeline] [status]::before {
189
- content: '';
190
- height: 60px;
191
- width: 2px;
192
- display: block;
193
- position: relative;
194
- margin-left: 5px;
195
- background-color: var(--worklist-status-color, tomato);
196
- opacity: 0.2;
197
- }
198
- [timeline] [info] mwc-icon {
199
- position: relative;
200
- top: 3px;
201
- font-size: var(--fontsize-large);
202
- }
203
- [timeline] [info] p {
204
- background-color: var(--theme-white-color);
205
- margin: var(--margin-narrow) 0 var(--margin-default) 0;
206
- padding: var(--padding-narrow) var(--padding-default);
207
- font-size: var(--fontsize-small);
208
- text-align: justify;
209
- }
210
- [timeline] [info] p::before {
211
- content: '';
212
- float: right;
213
- margin-top: -10px;
214
- margin-right: 20px;
215
- border: 7px solid transparent;
216
- border-bottom-color: #f4f4f4;
217
- border-top: 0;
218
- }
219
- div[comment] textarea {
220
- margin: 0 var(--margin-default) var(--margin-default) var(--margin-default);
221
- padding: var(--input-padding);
222
- resize: none;
223
- font: var(--input-font);
224
- outline: none;
146
+ div[empty] {
147
+ align-self: center;
225
148
  }
226
149
  `
227
150
  ]
@@ -265,49 +188,29 @@ export class ActivityApprovalPage extends connect(store)(localize(i18next)(PageV
265
188
 
266
189
  render() {
267
190
  if (!this.activityThread) {
268
- return html`<div>no activity thread info.</div>`
191
+ return html`<div empty>no activity thread info.</div>`
269
192
  }
270
193
 
271
- const { activityApprovals = [] } = this.activityThread
272
- const approvals = activityApprovals.sort((a, b) => (a.round > b.round ? 1 : a.round < b.round ? -1 : a.order! > b.order! ? 1 : -1)).slice(0, -1)
194
+ const { terminatedAt } = this.activityApproval
195
+ const editable = !terminatedAt
273
196
 
274
197
  return html`
275
198
  <activity-approval-ribon .activityApproval=${this.activityApproval}></activity-approval-ribon>
276
199
  ${this.activityContent()}
277
- <div comment>
278
- <div timeline>
279
- <span subtitle>${i18next.t('label.review-and-approval')}</span>
280
-
281
- <ol>
282
- ${approvals.map(approval => this.renderActivityApproval(approval))}
283
- </ol>
284
- </div>
285
-
286
- <textarea
287
- placeholder=${String(i18next.t('text.explain the reason for approval/rejection'))}
288
- .value=${this.activityApproval?.comment}
289
- @change=${(e: Event) => {
290
- this.activityApproval.comment = (e.target as HTMLTextAreaElement).value
291
- }}
292
- ></textarea>
293
- </div>
294
- `
295
- }
296
-
297
- renderActivityApproval(activityApproval: ActivityApproval) {
298
- const { judgment, approver, comment, round, order, createdAt, terminatedAt } = activityApproval
299
- const { name, email } = approver || {}
300
-
301
- return html`
302
- <li>
303
- <span date>${formatter.format(new Date(terminatedAt || createdAt!))}</span>
304
- <span status></span>
305
- <span info>
306
- ${i18next.t('label.activity-state-' + (judgment || 'started'))}
307
- <strong><mwc-icon>account_circle</mwc-icon>${name}</strong>
308
- <p>${comment}</p>
309
- </span>
310
- </li>
200
+ <activity-approval-timeline .activityThread=${this.activityThread}></activity-approval-timeline>
201
+ ${editable
202
+ ? html`
203
+ <div comment>
204
+ <textarea
205
+ placeholder=${String(i18next.t('text.explain the reason for approval/rejection'))}
206
+ .value=${this.activityApproval?.comment}
207
+ @change=${(e: Event) => {
208
+ this.activityApproval.comment = (e.target as HTMLTextAreaElement).value
209
+ }}
210
+ ></textarea>
211
+ </div>
212
+ `
213
+ : nothing}
311
214
  `
312
215
  }
313
216
 
@@ -112,8 +112,8 @@ export class ActivityThreadPage extends connect(store)(localize(i18next)(PageVie
112
112
  height: 100%;
113
113
  }
114
114
 
115
- #custom-content {
116
- flex: 1;
115
+ div[empty] {
116
+ align-self: center;
117
117
  }
118
118
  `
119
119
  ]
@@ -171,7 +171,15 @@ export class ActivityThreadPage extends connect(store)(localize(i18next)(PageVie
171
171
  render() {
172
172
  const activityThread = this.activityThread
173
173
 
174
- return html` ${activityThread ? html`<activity-thread-ribon .activityThread=${activityThread}></activity-thread-ribon>` : html``} ${this.activityContent()}`
174
+ if (!activityThread) {
175
+ return html`<div empty>no activity thread info.</div> `
176
+ }
177
+
178
+ return html`
179
+ <activity-thread-ribon .activityThread=${activityThread}></activity-thread-ribon>
180
+ ${this.activityContent()}
181
+ <activity-approval-timeline .activityThread=${activityThread}></activity-approval-timeline>
182
+ `
175
183
  }
176
184
 
177
185
  activityContent() {
@@ -1,5 +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
4
  import './activity-thread-view.js'
4
5
 
5
6
  import gql from 'graphql-tag'
@@ -118,6 +119,10 @@ export class ActivityThreadViewPage extends connect(store)(localize(i18next)(Pag
118
119
  #custom-content {
119
120
  flex: 1;
120
121
  }
122
+
123
+ div[empty] {
124
+ align-self: center;
125
+ }
121
126
  `
122
127
  ]
123
128
 
@@ -136,10 +141,15 @@ export class ActivityThreadViewPage extends connect(store)(localize(i18next)(Pag
136
141
  render() {
137
142
  const activityThread = this.activityThread
138
143
 
139
- return html` ${activityThread
140
- ? html`<activity-thread-ribon .activityThread=${activityThread}></activity-thread-ribon>`
141
- : html``}
142
- ${this.activityContent()}`
144
+ if (!activityThread) {
145
+ return html`<div empty>no activity thread info.</div> `
146
+ }
147
+
148
+ return html`
149
+ <activity-thread-ribon .activityThread=${activityThread}></activity-thread-ribon>
150
+ ${this.activityContent()}
151
+ <activity-approval-timeline .activityThread=${activityThread}></activity-approval-timeline>
152
+ `
143
153
  }
144
154
 
145
155
  activityContent() {
@@ -204,10 +214,7 @@ export class ActivityThreadViewPage extends connect(store)(localize(i18next)(Pag
204
214
  return html``
205
215
  }
206
216
 
207
- return keyed(
208
- this.activityThread.id,
209
- html` <activity-thread-view .activityThreadId=${this.activityThread.id}></activity-thread-view> `
210
- )
217
+ return keyed(this.activityThread.id, html` <activity-thread-view .activityThreadId=${this.activityThread.id}></activity-thread-view> `)
211
218
  }
212
219
 
213
220
  boardContent() {
@@ -114,74 +114,14 @@ export class ActivityThreadView extends localize(i18next)(LitElement) {
114
114
  font: bold 16px var(--theme-font);
115
115
  color: var(--secondary-text-color);
116
116
  }
117
- [timeline] ol {
118
- list-style: none;
119
- margin: 0;
120
- padding: 0;
121
- }
122
- [timeline] li {
123
- display: flex;
124
- }
125
- [timeline] [info] {
126
- flex: 1;
127
- }
128
- [timeline] [date] {
129
- opacity: 0.7;
130
- width: 130px;
131
- font-size: var(--fontsize-small);
132
- }
133
- [timeline] [info] strong {
134
- float: right;
135
- }
136
- [timeline] [status] {
137
- margin: 0 var(--margin-narrow);
138
- display: block;
139
- border-radius: 50%;
140
- width: 12px;
141
- height: 12px;
142
- position: relative;
143
- top: 3px;
144
- border: 2px solid #fff;
145
- background-color: var(--worklist-status-color, tomato);
146
- }
147
- [timeline] [status]::before {
148
- content: '';
149
- height: 60px;
150
- width: 2px;
151
- display: block;
152
- position: relative;
153
- margin-left: 5px;
154
- background-color: var(--worklist-status-color, tomato);
155
- opacity: 0.2;
156
- }
157
- [timeline] [info] mwc-icon {
158
- position: relative;
159
- top: 3px;
160
- font-size: var(--fontsize-large);
161
- }
162
- [timeline] [info] p {
163
- background-color: #f4f4f4;
164
- margin: var(--margin-narrow) 0 var(--margin-default) 0;
165
- padding: var(--padding-narrow) var(--padding-default);
166
- border-radius: var(--border-radius);
167
- font-size: var(--fontsize-small);
168
- text-align: justify;
169
- }
170
- [timeline] [info] p::before {
171
- content: '';
172
- float: right;
173
- margin-top: -10px;
174
- margin-right: 20px;
175
- border: 7px solid transparent;
176
- border-bottom-color: #f4f4f4;
177
- border-top: 0;
178
- }
117
+
179
118
  [thread] div {
180
119
  border-bottom: var(--border-dark-color);
181
120
  padding: var(--padding-narrow);
182
121
  text-align: right;
183
122
  overflow: hidden;
184
123
  }
124
+
185
125
  [thread] div label {
186
126
  float: left;
187
127
  width: 25%;
@@ -203,23 +143,9 @@ export class ActivityThreadView extends localize(i18next)(LitElement) {
203
143
  return html`<div>no activity thread info.</div>`
204
144
  }
205
145
 
206
- const {
207
- state,
208
- assignee,
209
- output,
210
- round,
211
- activityApprovals = [],
212
- assignedAt,
213
- startedAt,
214
- terminatedAt,
215
- activityInstance
216
- } = this.activityThread
217
- const { input, approvalLine } = activityInstance!
146
+ const { state, assignee, output, round, assignedAt, startedAt, terminatedAt, activityInstance } = this.activityThread
147
+ const { input } = activityInstance!
218
148
  const { name, email } = assignee || {}
219
- const approvals = activityApprovals.sort((a, b) =>
220
- a.round < b.round ? 1 : a.round > b.round ? -1 : a.order! < b.order! ? 1 : -1
221
- )
222
- const current = approvals[0]?.round == round ? approvals[0].order : -1
223
149
 
224
150
  return html`
225
151
  <div assignee>
@@ -234,13 +160,9 @@ export class ActivityThreadView extends localize(i18next)(LitElement) {
234
160
  <span status></span>
235
161
  <strong>${i18next.t('label.activity-state-' + state)}</strong>
236
162
  </div>
237
- <div>
238
- <label>${i18next.t('field.assigned-at')}</label> ${assignedAt && formatter.format(new Date(assignedAt))}
239
- </div>
163
+ <div><label>${i18next.t('field.assigned-at')}</label> ${assignedAt && formatter.format(new Date(assignedAt))}</div>
240
164
  <div><label>${i18next.t('field.started-at')}</label> ${startedAt && formatter.format(new Date(startedAt))}</div>
241
- <div>
242
- <label>${i18next.t('field.terminated-at')}</label> ${terminatedAt && formatter.format(new Date(terminatedAt))}
243
- </div>
165
+ <div><label>${i18next.t('field.terminated-at')}</label> ${terminatedAt && formatter.format(new Date(terminatedAt))}</div>
244
166
  <div><label>${i18next.t('field.round')}</label> ${round}</div>
245
167
  </div>
246
168
 
@@ -248,36 +170,6 @@ export class ActivityThreadView extends localize(i18next)(LitElement) {
248
170
  <span subtitle>${i18next.t('field.artifact')}</span>
249
171
  ${this.renderInOut({ ...input, ...output })}
250
172
  </div>
251
- <div timeline>
252
- <span subtitle>${i18next.t('label.review-and-approval')}</span>
253
-
254
- <div>
255
- ${approvalLine
256
- ? html`<approval-line-view .model=${approvalLine} .current=${current}></approval-line-view>`
257
- : html``}
258
- </div>
259
-
260
- <ol>
261
- ${approvals.map(approval => this.renderActivityApproval(approval))}
262
- </ol>
263
- </div>
264
- `
265
- }
266
-
267
- renderActivityApproval(activityApproval: ActivityApproval) {
268
- const { judgment, approver, comment, round, order, createdAt, terminatedAt } = activityApproval
269
- const { name, email } = approver || {}
270
-
271
- return html`
272
- <li>
273
- <span date>${formatter.format(new Date(terminatedAt || createdAt!))}</span>
274
- <span status></span>
275
- <span info>
276
- ${i18next.t('label.activity-state-' + (judgment || 'started'))}
277
- <strong><mwc-icon>account_circle</mwc-icon>${name}</strong>
278
- <p>${comment}</p>
279
- </span>
280
- </li>
281
173
  `
282
174
  }
283
175
 
@@ -1,6 +1,7 @@
1
1
  import '@material/mwc-icon'
2
+ import '../components/activity-approval-timeline'
2
3
 
3
- import { html, css, LitElement } from 'lit'
4
+ import { html, css, LitElement, nothing } from 'lit'
4
5
  import { customElement, property, state } from 'lit/decorators.js'
5
6
 
6
7
  import { connect } from 'pwa-helpers/connect-mixin'
@@ -22,6 +23,7 @@ class ActivityApprovalContextTemplate extends connect(store)(LitElement) {
22
23
  background-color: var(--theme-white-color);
23
24
  width: 100%;
24
25
  min-width: 450px;
26
+ max-height: 100%;
25
27
  overflow: auto;
26
28
  --context-ui-padding: 0;
27
29
  }
@@ -126,35 +128,28 @@ class ActivityApprovalContextTemplate extends connect(store)(LitElement) {
126
128
  const activityApproval = this.context.activityApproval || this.activityApproval || {}
127
129
 
128
130
  const { round, order, approver, createdAt, activityThread } = activityApproval || {}
129
- const { state, dueAt, assignedAt, assignee, activityInstance } = activityThread || {}
131
+ const { state, dueAt, assignedAt, assignee, activityInstance, activityApprovals } = activityThread || {}
130
132
  const { name, description, thumbnail, approvalLine } = activityInstance || {}
131
133
 
132
134
  return html`
133
135
  <div flow>
134
- <div approval-line>
135
- ${approvalLine ? html` <approval-line-view .model=${approvalLine}></approval-line-view> ` : html``}
136
- </div>
136
+ <div approval-line>${approvalLine ? html` <approval-line-view .model=${approvalLine}></approval-line-view> ` : html``}</div>
137
137
  </div>
138
138
 
139
139
  <div info>
140
140
  <div><label>${i18next.t('field.name')}</label> <strong>${name}</strong></div>
141
141
  <div><label>${i18next.t('field.description')}</label> ${description}</div>
142
- <div>
143
- <label>${i18next.t('field.status')}</label> <span></span>&nbsp;<strong
144
- >${i18next.t('label.activity-state-' + state)}</strong
145
- >
146
- </div>
142
+ <div><label>${i18next.t('field.status')}</label> <span></span>&nbsp;<strong>${i18next.t('label.activity-state-' + state)}</strong></div>
147
143
  <div><label>${i18next.t('field.round')}</label> <strong>${round}</strong></div>
148
144
  <div><label>${i18next.t('field.approval-order')}</label> <strong>${order}</strong></div>
149
145
  <div><label>${i18next.t('field.assignee')}</label> <strong>${assignee?.name}</strong></div>
150
146
  <div><label>${i18next.t('field.approver')}</label> <strong>${approver?.name}</strong></div>
151
- <div>
152
- <label>${i18next.t('field.assigned-at')}</label> ${assignedAt && formatter.format(new Date(assignedAt))}
153
- </div>
147
+ <div><label>${i18next.t('field.assigned-at')}</label> ${assignedAt && formatter.format(new Date(assignedAt))}</div>
154
148
  <div><label>${i18next.t('field.due-at')}</label> ${dueAt && formatter.format(new Date(dueAt))}</div>
155
149
  <div><label>since</label> ${createdAt && formatter.format(new Date(createdAt))}</div>
156
150
  </div>
157
151
 
152
+ ${activityApprovals && activityApprovals.length > 0 ? html` <activity-approval-timeline .activityThread=${activityThread}></activity-approval-timeline> ` : nothing}
158
153
  ${thumbnail
159
154
  ? html` <div thumbnail>
160
155
  <img src=${thumbnail} />