@things-factory/worklist 6.2.96 → 6.2.98
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.
- package/client/components/activity-approval-timeline.ts +147 -0
- package/client/pages/activity-approval/activity-approval-page.ts +41 -145
- package/client/pages/activity-thread/activity-thread-page.ts +16 -3
- package/client/pages/activity-thread/activity-thread-view-page.ts +20 -8
- package/client/pages/activity-thread/activity-thread-view.ts +6 -114
- package/client/pages/todo/approval-done-list-page.ts +2 -1
- package/client/pages/todo/approval-pending-list-page.ts +17 -6
- package/client/pages/todo/done-list-page.ts +7 -2
- package/client/pages/todo/draft-list-page.ts +11 -1
- package/client/pages/todo/pickable-list-page.ts +25 -10
- package/client/pages/todo/todo-list-page.ts +10 -5
- package/client/templates/activity-approval-context-template.ts +8 -13
- package/client/templates/activity-instance-context-template.ts +16 -18
- package/client/templates/activity-thread-context-template.ts +47 -157
- package/dist-client/components/activity-approval-timeline.d.ts +18 -0
- package/dist-client/components/activity-approval-timeline.js +143 -0
- package/dist-client/components/activity-approval-timeline.js.map +1 -0
- package/dist-client/pages/activity-approval/activity-approval-page.d.ts +1 -2
- package/dist-client/pages/activity-approval/activity-approval-page.js +40 -137
- package/dist-client/pages/activity-approval/activity-approval-page.js.map +1 -1
- package/dist-client/pages/activity-thread/activity-thread-page.js +15 -3
- package/dist-client/pages/activity-thread/activity-thread-page.js.map +1 -1
- package/dist-client/pages/activity-thread/activity-thread-view-page.d.ts +1 -0
- package/dist-client/pages/activity-thread/activity-thread-view-page.js +18 -4
- package/dist-client/pages/activity-thread/activity-thread-view-page.js.map +1 -1
- package/dist-client/pages/activity-thread/activity-thread-view.d.ts +0 -2
- package/dist-client/pages/activity-thread/activity-thread-view.js +6 -101
- package/dist-client/pages/activity-thread/activity-thread-view.js.map +1 -1
- package/dist-client/pages/todo/approval-done-list-page.js +2 -1
- package/dist-client/pages/todo/approval-done-list-page.js.map +1 -1
- package/dist-client/pages/todo/approval-pending-list-page.js +14 -3
- package/dist-client/pages/todo/approval-pending-list-page.js.map +1 -1
- package/dist-client/pages/todo/done-list-page.js +7 -2
- package/dist-client/pages/todo/done-list-page.js.map +1 -1
- package/dist-client/pages/todo/draft-list-page.js +10 -1
- package/dist-client/pages/todo/draft-list-page.js.map +1 -1
- package/dist-client/pages/todo/pickable-list-page.js +19 -1
- package/dist-client/pages/todo/pickable-list-page.js.map +1 -1
- package/dist-client/pages/todo/todo-list-page.js +7 -2
- package/dist-client/pages/todo/todo-list-page.js.map +1 -1
- package/dist-client/templates/activity-approval-context-template.d.ts +1 -0
- package/dist-client/templates/activity-approval-context-template.js +8 -13
- package/dist-client/templates/activity-approval-context-template.js.map +1 -1
- package/dist-client/templates/activity-instance-context-template.js +15 -16
- package/dist-client/templates/activity-instance-context-template.js.map +1 -1
- package/dist-client/templates/activity-thread-context-template.d.ts +1 -0
- package/dist-client/templates/activity-thread-context-template.js +46 -151
- package/dist-client/templates/activity-thread-context-template.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/activity-approval/activity-approval-mutation.js +0 -3
- package/dist-server/service/activity-approval/activity-approval-mutation.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/server/service/activity-approval/activity-approval-mutation.ts +3 -19
|
@@ -125,7 +125,6 @@ export class DoneListPage extends connect(store)(localize(i18next)(PageView)) {
|
|
|
125
125
|
title: i18next.t('title.view page'),
|
|
126
126
|
handlers: {
|
|
127
127
|
click: (columns, data, column, record, rowIndex) => {
|
|
128
|
-
const { id } = record
|
|
129
128
|
this.openActivityThreadViewPage(record)
|
|
130
129
|
}
|
|
131
130
|
}
|
|
@@ -266,7 +265,13 @@ export class DoneListPage extends connect(store)(localize(i18next)(PageView)) {
|
|
|
266
265
|
}
|
|
267
266
|
],
|
|
268
267
|
rows: {
|
|
269
|
-
appendable: false
|
|
268
|
+
appendable: false,
|
|
269
|
+
editable: false,
|
|
270
|
+
handlers: {
|
|
271
|
+
click: (columns, data, column, record, rowIndex) => {
|
|
272
|
+
this.openActivityThreadViewPage(record)
|
|
273
|
+
}
|
|
274
|
+
}
|
|
270
275
|
},
|
|
271
276
|
sorters: [
|
|
272
277
|
{
|
|
@@ -200,7 +200,17 @@ export class DraftListPage extends connect(store)(localize(i18next)(PageView)) {
|
|
|
200
200
|
}
|
|
201
201
|
],
|
|
202
202
|
rows: {
|
|
203
|
-
appendable: false
|
|
203
|
+
appendable: false,
|
|
204
|
+
editable: false,
|
|
205
|
+
handlers: {
|
|
206
|
+
click: (columns, data, column, record, rowIndex) => {
|
|
207
|
+
if (!record.id) {
|
|
208
|
+
return
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
this.openActivityInstanceStart(record)
|
|
212
|
+
}
|
|
213
|
+
}
|
|
204
214
|
},
|
|
205
215
|
sorters: [
|
|
206
216
|
{
|
|
@@ -124,15 +124,12 @@ export class PickableListPage extends connect(store)(localize(i18next)(PageView)
|
|
|
124
124
|
return
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
const popup = openPopup(
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
title: i18next.t('title.activity preview')
|
|
134
|
-
}
|
|
135
|
-
)
|
|
127
|
+
const popup = openPopup(html` <activity-instance-preview .activityInstanceId=${record.id}></activity-instance-preview> `, {
|
|
128
|
+
backdrop: true,
|
|
129
|
+
help: 'worklist/activity-instance-preview',
|
|
130
|
+
size: 'large',
|
|
131
|
+
title: i18next.t('title.activity preview')
|
|
132
|
+
})
|
|
136
133
|
popup.onclosed = () => {
|
|
137
134
|
this.grist?.fetch()
|
|
138
135
|
}
|
|
@@ -224,7 +221,25 @@ export class PickableListPage extends connect(store)(localize(i18next)(PageView)
|
|
|
224
221
|
}
|
|
225
222
|
],
|
|
226
223
|
rows: {
|
|
227
|
-
appendable: false
|
|
224
|
+
appendable: false,
|
|
225
|
+
editable: false,
|
|
226
|
+
handlers: {
|
|
227
|
+
click: (columns, data, column, record, rowIndex) => {
|
|
228
|
+
if (!record.id) {
|
|
229
|
+
return
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
const popup = openPopup(html` <activity-instance-preview .activityInstanceId=${record.id}></activity-instance-preview> `, {
|
|
233
|
+
backdrop: true,
|
|
234
|
+
help: 'worklist/activity-instance-preview',
|
|
235
|
+
size: 'large',
|
|
236
|
+
title: i18next.t('title.activity preview')
|
|
237
|
+
})
|
|
238
|
+
popup.onclosed = () => {
|
|
239
|
+
this.grist?.fetch()
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
228
243
|
},
|
|
229
244
|
sorters: [
|
|
230
245
|
{
|
|
@@ -134,7 +134,6 @@ export class TodoListPage extends connect(store)(localize(i18next)(PageView)) {
|
|
|
134
134
|
title: i18next.t('title.open this activity page'),
|
|
135
135
|
handlers: {
|
|
136
136
|
click: (columns, data, column, record, rowIndex) => {
|
|
137
|
-
const { id } = record
|
|
138
137
|
this.openActivityThread(record)
|
|
139
138
|
}
|
|
140
139
|
}
|
|
@@ -269,7 +268,13 @@ export class TodoListPage extends connect(store)(localize(i18next)(PageView)) {
|
|
|
269
268
|
}
|
|
270
269
|
],
|
|
271
270
|
rows: {
|
|
272
|
-
appendable: false
|
|
271
|
+
appendable: false,
|
|
272
|
+
editable: false,
|
|
273
|
+
handlers: {
|
|
274
|
+
click: (columns, data, column, record, rowIndex) => {
|
|
275
|
+
this.openActivityThread(record)
|
|
276
|
+
}
|
|
277
|
+
}
|
|
273
278
|
},
|
|
274
279
|
sorters: [
|
|
275
280
|
{
|
|
@@ -383,9 +388,9 @@ export class TodoListPage extends connect(store)(localize(i18next)(PageView)) {
|
|
|
383
388
|
const minutes = Math.floor(secs / MIN)
|
|
384
389
|
const seconds = secs - minutes * MIN
|
|
385
390
|
|
|
386
|
-
yield `${positive ? '' : '- '}${days ? `${days}${i18next.t('label.days')} ` : ''}${
|
|
387
|
-
|
|
388
|
-
}
|
|
391
|
+
yield `${positive ? '' : '- '}${days ? `${days}${i18next.t('label.days')} ` : ''}${hours ? `${hours}${i18next.t('label.hours')} ` : ''}${
|
|
392
|
+
minutes ? `${minutes}${i18next.t('label.minutes')} ` : ''
|
|
393
|
+
}`
|
|
389
394
|
|
|
390
395
|
await sleep(60 * 1000)
|
|
391
396
|
}
|
|
@@ -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> <strong
|
|
144
|
-
>${i18next.t('label.activity-state-' + state)}</strong
|
|
145
|
-
>
|
|
146
|
-
</div>
|
|
142
|
+
<div><label>${i18next.t('field.status')}</label> <span></span> <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} />
|
|
@@ -23,6 +23,7 @@ class ActivityInstanceContextTemplate extends connect(store)(LitElement) {
|
|
|
23
23
|
background-color: var(--theme-white-color);
|
|
24
24
|
width: 100%;
|
|
25
25
|
min-width: 450px;
|
|
26
|
+
max-height: 100%;
|
|
26
27
|
overflow: auto;
|
|
27
28
|
--context-ui-padding: 0;
|
|
28
29
|
}
|
|
@@ -59,6 +60,16 @@ class ActivityInstanceContextTemplate extends connect(store)(LitElement) {
|
|
|
59
60
|
--worklist-status-color: #cb3a33;
|
|
60
61
|
}
|
|
61
62
|
|
|
63
|
+
:host:before {
|
|
64
|
+
content: '';
|
|
65
|
+
position: absolute;
|
|
66
|
+
width: 0;
|
|
67
|
+
height: 0;
|
|
68
|
+
border: 22px solid transparent;
|
|
69
|
+
border-left-color: var(--worklist-status-color);
|
|
70
|
+
border-right: 0;
|
|
71
|
+
}
|
|
72
|
+
|
|
62
73
|
[info],
|
|
63
74
|
[assignees] {
|
|
64
75
|
padding: var(--padding-default);
|
|
@@ -162,8 +173,7 @@ class ActivityInstanceContextTemplate extends connect(store)(LitElement) {
|
|
|
162
173
|
|
|
163
174
|
render() {
|
|
164
175
|
const activityInstance = this.context.activityInstance || this.activityInstance || {}
|
|
165
|
-
const { activity, name, description, state, assignees, approvalLine, assignedAt, startedAt, dueAt, thumbnail } =
|
|
166
|
-
activityInstance || {}
|
|
176
|
+
const { activity, name, description, state, assignees, approvalLine, assignedAt, startedAt, dueAt, thumbnail } = activityInstance || {}
|
|
167
177
|
const { startingType } = activity || {}
|
|
168
178
|
|
|
169
179
|
// const editable = state == 'draft'
|
|
@@ -178,23 +188,14 @@ class ActivityInstanceContextTemplate extends connect(store)(LitElement) {
|
|
|
178
188
|
@change=${e => (activityInstance.approvalLine = e.currentTarget.value)}
|
|
179
189
|
></approval-line-view>
|
|
180
190
|
`
|
|
181
|
-
: html`<mwc-icon-button
|
|
182
|
-
icon="group_add"
|
|
183
|
-
@click=${() => this.onClickApprovalLine(activityInstance)}
|
|
184
|
-
></mwc-icon-button>`}
|
|
191
|
+
: html`<mwc-icon-button icon="group_add" @click=${() => this.onClickApprovalLine(activityInstance)}></mwc-icon-button>`}
|
|
185
192
|
</div>
|
|
186
193
|
|
|
187
194
|
<div info>
|
|
188
195
|
<div><label>${i18next.t('field.name')}</label> <strong>${name}</strong></div>
|
|
189
196
|
<div><label>${i18next.t('field.description')}</label> ${description}</div>
|
|
190
|
-
<div>
|
|
191
|
-
|
|
192
|
-
>${i18next.t('label.activity-state-' + state)}</strong
|
|
193
|
-
>
|
|
194
|
-
</div>
|
|
195
|
-
<div>
|
|
196
|
-
<label>${i18next.t('field.assigned-at')}</label> ${assignedAt && formatter.format(new Date(assignedAt))}
|
|
197
|
-
</div>
|
|
197
|
+
<div><label>${i18next.t('field.status')}</label> <span></span> <strong>${i18next.t('label.activity-state-' + state)}</strong></div>
|
|
198
|
+
<div><label>${i18next.t('field.assigned-at')}</label> ${assignedAt && formatter.format(new Date(assignedAt))}</div>
|
|
198
199
|
<div><label>${i18next.t('field.due-at')}</label> ${dueAt && formatter.format(new Date(dueAt))}</div>
|
|
199
200
|
<div><label>${i18next.t('field.started-at')}</label> ${startedAt && formatter.format(new Date(startedAt))}</div>
|
|
200
201
|
</div>
|
|
@@ -211,10 +212,7 @@ class ActivityInstanceContextTemplate extends connect(store)(LitElement) {
|
|
|
211
212
|
@change=${e => (activityInstance.assignees = e.currentTarget.value)}
|
|
212
213
|
></assignees-view>
|
|
213
214
|
`
|
|
214
|
-
: html`<mwc-icon-button
|
|
215
|
-
icon="group_add"
|
|
216
|
-
@click=${() => this.onClickAssignees(activityInstance)}
|
|
217
|
-
></mwc-icon-button>`}
|
|
215
|
+
: html`<mwc-icon-button icon="group_add" @click=${() => this.onClickAssignees(activityInstance)}></mwc-icon-button>`}
|
|
218
216
|
</div>
|
|
219
217
|
</div>`
|
|
220
218
|
: html``}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import '@material/mwc-icon'
|
|
2
2
|
import '@things-factory/organization/dist-client/component/approval-line-view.js'
|
|
3
|
+
import '../components/activity-approval-timeline'
|
|
3
4
|
|
|
4
5
|
import { html, css, LitElement, nothing } from 'lit'
|
|
5
6
|
import { customElement, property, state } from 'lit/decorators.js'
|
|
@@ -10,8 +11,6 @@ import { ContextToolbarOverlayStyle } from '@operato/context/ox-context-toolbar-
|
|
|
10
11
|
import { store } from '@operato/shell'
|
|
11
12
|
import { i18next } from '@operato/i18n'
|
|
12
13
|
|
|
13
|
-
import { ActivityApproval } from '../types/activity-approval'
|
|
14
|
-
|
|
15
14
|
const formatter = new Intl.DateTimeFormat(navigator.language, { dateStyle: 'full', timeStyle: 'short' })
|
|
16
15
|
|
|
17
16
|
@customElement('activity-thread-context-template')
|
|
@@ -23,6 +22,7 @@ class ActivityThreadContextTemplate extends connect(store)(LitElement) {
|
|
|
23
22
|
background-color: var(--theme-white-color);
|
|
24
23
|
width: 100%;
|
|
25
24
|
min-width: 450px;
|
|
25
|
+
max-height: 100%;
|
|
26
26
|
overflow: auto;
|
|
27
27
|
--context-ui-padding: 0;
|
|
28
28
|
}
|
|
@@ -59,121 +59,49 @@ class ActivityThreadContextTemplate extends connect(store)(LitElement) {
|
|
|
59
59
|
--worklist-status-color: #cb3a33;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
:host:before {
|
|
63
|
+
content: '';
|
|
64
|
+
position: absolute;
|
|
65
|
+
width: 0;
|
|
66
|
+
height: 0;
|
|
67
|
+
border: 22px solid transparent;
|
|
68
|
+
border-left-color: var(--worklist-status-color);
|
|
69
|
+
border-right: 0;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
div[info] {
|
|
64
73
|
padding: var(--padding-default);
|
|
65
74
|
border-bottom: var(--border-dark-color);
|
|
66
75
|
color: var(--secondary-color);
|
|
67
|
-
}
|
|
68
76
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
div[timeline] {
|
|
99
|
-
margin-bottom: var(--margin-default);
|
|
100
|
-
padding: var(--padding-default);
|
|
101
|
-
}
|
|
102
|
-
div[timeline] [subtitle] {
|
|
103
|
-
padding: var(--padding-narrow) var(--padding-default);
|
|
104
|
-
background-color: var(--theme-white-color);
|
|
105
|
-
border: 2px solid var(--secondary-text-color);
|
|
106
|
-
border-radius: 15px;
|
|
107
|
-
box-shadow: var(--box-shadow);
|
|
108
|
-
color: var(--secondary-text-color);
|
|
109
|
-
font-weight: bold;
|
|
110
|
-
}
|
|
111
|
-
div[timeline] ol {
|
|
112
|
-
list-style: none;
|
|
113
|
-
margin: var(--margin-default) 0 0 var(--margin-narrow);
|
|
114
|
-
padding: 0;
|
|
115
|
-
}
|
|
116
|
-
[timeline] li {
|
|
117
|
-
display: flex;
|
|
118
|
-
border: none;
|
|
119
|
-
}
|
|
120
|
-
[timeline] [info] {
|
|
121
|
-
flex: 1;
|
|
122
|
-
color: initial;
|
|
123
|
-
}
|
|
124
|
-
[timeline] [date] {
|
|
125
|
-
opacity: 0.7;
|
|
126
|
-
flex: initial;
|
|
127
|
-
width: 130px;
|
|
128
|
-
font-size: var(--fontsize-small);
|
|
129
|
-
color: var(--primary-text-color);
|
|
130
|
-
}
|
|
131
|
-
[timeline] [info] strong {
|
|
132
|
-
float: right;
|
|
133
|
-
}
|
|
134
|
-
[timeline] [status] {
|
|
135
|
-
margin: 0 var(--margin-narrow);
|
|
136
|
-
display: block;
|
|
137
|
-
border-radius: 50%;
|
|
138
|
-
flex: initial;
|
|
139
|
-
width: 12px;
|
|
140
|
-
height: 12px;
|
|
141
|
-
position: relative;
|
|
142
|
-
top: 3px;
|
|
143
|
-
border: 2px solid #fff;
|
|
144
|
-
background-color: var(--worklist-status-color, tomato);
|
|
145
|
-
color: var(--primary-text-color);
|
|
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
|
-
font-size: var(--fontsize-small);
|
|
167
|
-
text-align: justify;
|
|
168
|
-
}
|
|
169
|
-
[timeline] [info] p::before {
|
|
170
|
-
content: '';
|
|
171
|
-
float: right;
|
|
172
|
-
margin-top: -10px;
|
|
173
|
-
margin-right: 20px;
|
|
174
|
-
border: 7px solid transparent;
|
|
175
|
-
border-bottom-color: #f4f4f4;
|
|
176
|
-
border-top: 0;
|
|
77
|
+
div {
|
|
78
|
+
display: flex;
|
|
79
|
+
align-items: center;
|
|
80
|
+
padding: var(--padding-narrow);
|
|
81
|
+
border-radius: var(--border-radius);
|
|
82
|
+
text-align: right;
|
|
83
|
+
clear: both;
|
|
84
|
+
overflow: hidden;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
div:nth-child(odd) {
|
|
88
|
+
background-color: var(--main-section-background-color);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
label {
|
|
92
|
+
display: inline-block;
|
|
93
|
+
width: 25%;
|
|
94
|
+
text-align: right;
|
|
95
|
+
margin-right: 20px;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
span {
|
|
99
|
+
width: 15px;
|
|
100
|
+
height: 15px;
|
|
101
|
+
background-color: var(--worklist-status-color, tomato);
|
|
102
|
+
display: inline-block;
|
|
103
|
+
border-radius: 50%;
|
|
104
|
+
}
|
|
177
105
|
}
|
|
178
106
|
|
|
179
107
|
[thumbnail] {
|
|
@@ -197,47 +125,26 @@ class ActivityThreadContextTemplate extends connect(store)(LitElement) {
|
|
|
197
125
|
render() {
|
|
198
126
|
const activityThread = this.context.activityThread || this.activityThread || {}
|
|
199
127
|
|
|
200
|
-
const { state, round, dueAt, assignedAt, terminatedAt, assignee, activityInstance, activityApprovals } =
|
|
201
|
-
activityThread || {}
|
|
128
|
+
const { state, round, dueAt, assignedAt, terminatedAt, assignee, activityInstance, activityApprovals } = activityThread || {}
|
|
202
129
|
const { name, description, thumbnail, approvalLine } = activityInstance || {}
|
|
203
130
|
|
|
204
131
|
return html`
|
|
205
132
|
<div flow>
|
|
206
|
-
<div approval-line>
|
|
207
|
-
${approvalLine ? html` <approval-line-view .model=${approvalLine}></approval-line-view> ` : html``}
|
|
208
|
-
</div>
|
|
133
|
+
<div approval-line>${approvalLine ? html` <approval-line-view .model=${approvalLine}></approval-line-view> ` : html``}</div>
|
|
209
134
|
</div>
|
|
210
135
|
|
|
211
136
|
<div info>
|
|
212
137
|
<div><label>${i18next.t('field.name')}</label> <strong>${name}</strong></div>
|
|
213
138
|
<div><label>${i18next.t('field.description')}</label> ${description}</div>
|
|
214
|
-
<div>
|
|
215
|
-
<label>${i18next.t('field.status')}</label> <span></span> <strong
|
|
216
|
-
>${i18next.t('label.activity-state-' + state)}</strong
|
|
217
|
-
>
|
|
218
|
-
</div>
|
|
139
|
+
<div><label>${i18next.t('field.status')}</label> <span></span> <strong>${i18next.t('label.activity-state-' + state)}</strong></div>
|
|
219
140
|
<div><label>${i18next.t('field.round')}</label> <strong>${round}</strong></div>
|
|
220
141
|
<div><label>${i18next.t('field.assignee')}</label> <strong>${assignee?.name}</strong></div>
|
|
221
|
-
<div>
|
|
222
|
-
<label>${i18next.t('field.assigned-at')}</label> ${assignedAt && formatter.format(new Date(assignedAt))}
|
|
223
|
-
</div>
|
|
142
|
+
<div><label>${i18next.t('field.assigned-at')}</label> ${assignedAt && formatter.format(new Date(assignedAt))}</div>
|
|
224
143
|
<div><label>${i18next.t('field.due-at')}</label> ${dueAt && formatter.format(new Date(dueAt))}</div>
|
|
225
|
-
<div>
|
|
226
|
-
<label>${i18next.t('field.terminated-at')}</label> ${terminatedAt && formatter.format(new Date(terminatedAt))}
|
|
227
|
-
</div>
|
|
144
|
+
<div><label>${i18next.t('field.terminated-at')}</label> ${terminatedAt && formatter.format(new Date(terminatedAt))}</div>
|
|
228
145
|
</div>
|
|
229
146
|
|
|
230
|
-
${activityApprovals && activityApprovals.length > 0
|
|
231
|
-
? html`
|
|
232
|
-
<div timeline>
|
|
233
|
-
<span subtitle>${i18next.t('label.review-and-approval')}</span>
|
|
234
|
-
|
|
235
|
-
<ol>
|
|
236
|
-
${activityApprovals.map(approval => this.renderActivityApproval(approval))}
|
|
237
|
-
</ol>
|
|
238
|
-
</div>
|
|
239
|
-
`
|
|
240
|
-
: nothing}
|
|
147
|
+
${activityApprovals && activityApprovals.length > 0 ? html` <activity-approval-timeline .activityThread=${activityThread}></activity-approval-timeline> ` : nothing}
|
|
241
148
|
${thumbnail
|
|
242
149
|
? html` <div thumbnail>
|
|
243
150
|
<img src=${thumbnail} />
|
|
@@ -246,23 +153,6 @@ class ActivityThreadContextTemplate extends connect(store)(LitElement) {
|
|
|
246
153
|
`
|
|
247
154
|
}
|
|
248
155
|
|
|
249
|
-
renderActivityApproval(activityApproval: ActivityApproval) {
|
|
250
|
-
const { judgment, approver, comment, round, order, createdAt, terminatedAt } = activityApproval
|
|
251
|
-
const { name, email } = approver || {}
|
|
252
|
-
|
|
253
|
-
return html`
|
|
254
|
-
<li>
|
|
255
|
-
<span date>${formatter.format(new Date(terminatedAt || createdAt!))}</span>
|
|
256
|
-
<span status></span>
|
|
257
|
-
<span info>
|
|
258
|
-
${i18next.t('label.activity-state-' + (judgment || 'started'))}
|
|
259
|
-
<strong><mwc-icon>account_circle</mwc-icon>${name}</strong>
|
|
260
|
-
<p>${comment}</p>
|
|
261
|
-
</span>
|
|
262
|
-
</li>
|
|
263
|
-
`
|
|
264
|
-
}
|
|
265
|
-
|
|
266
156
|
stateChanged(state) {
|
|
267
157
|
this.context = state.route.context
|
|
268
158
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import '@material/mwc-icon';
|
|
2
|
+
import '@things-factory/organization/dist-client/component/approval-line-view.js';
|
|
3
|
+
import { LitElement } from 'lit';
|
|
4
|
+
import { ActivityApproval } from '../types/activity-approval';
|
|
5
|
+
declare const ActivityApprovalTimeline_base: (new (...args: any[]) => {
|
|
6
|
+
_storeUnsubscribe: import("redux").Unsubscribe;
|
|
7
|
+
connectedCallback(): void;
|
|
8
|
+
disconnectedCallback(): void;
|
|
9
|
+
stateChanged(_state: unknown): void;
|
|
10
|
+
readonly isConnected: boolean;
|
|
11
|
+
}) & typeof LitElement;
|
|
12
|
+
export declare class ActivityApprovalTimeline extends ActivityApprovalTimeline_base {
|
|
13
|
+
static styles: import("lit").CSSResult[];
|
|
14
|
+
private activityThread;
|
|
15
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
16
|
+
renderActivityApproval(activityApproval: ActivityApproval): import("lit-html").TemplateResult<1>;
|
|
17
|
+
}
|
|
18
|
+
export {};
|