@things-factory/worklist 9.0.0-beta.8 → 9.0.0
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/README.md +30 -5
- package/dist-client/activity-summary-generator.js +17 -22
- package/dist-client/activity-summary-generator.js.map +1 -1
- package/dist-client/components/activity-/bowner-view.js +24 -24
- package/dist-client/components/activity-/bowner-view.js.map +1 -1
- package/dist-client/components/activity-approval-ribon.js +47 -48
- package/dist-client/components/activity-approval-ribon.js.map +1 -1
- package/dist-client/components/activity-instance-preview.js +34 -32
- package/dist-client/components/activity-instance-preview.js.map +1 -1
- package/dist-client/components/activity-instance-ribon.js +41 -41
- package/dist-client/components/activity-instance-ribon.js.map +1 -1
- package/dist-client/components/activity-intro-view.js +24 -24
- package/dist-client/components/activity-intro-view.js.map +1 -1
- package/dist-client/components/activity-reporter-view.js +24 -24
- package/dist-client/components/activity-reporter-view.js.map +1 -1
- package/dist-client/components/activity-starter-form.js +53 -54
- package/dist-client/components/activity-starter-form.js.map +1 -1
- package/dist-client/components/activity-thread-ribon.js +38 -38
- package/dist-client/components/activity-thread-ribon.js.map +1 -1
- package/dist-client/components/activity-thread-timeline.js +74 -74
- package/dist-client/components/activity-thread-timeline.js.map +1 -1
- package/dist-client/grist-editor/grist-editor-activity-search-key.js +2 -3
- package/dist-client/grist-editor/grist-editor-activity-search-key.js.map +1 -1
- package/dist-client/grist-editor/popup-activity-search-keys-input.js +19 -19
- package/dist-client/grist-editor/popup-activity-search-keys-input.js.map +1 -1
- package/dist-client/pages/activity/activity-list-page.js +34 -34
- package/dist-client/pages/activity/activity-list-page.js.map +1 -1
- package/dist-client/pages/activity/activity-model-item-list.js +18 -20
- package/dist-client/pages/activity/activity-model-item-list.js.map +1 -1
- package/dist-client/pages/activity/activity-page.js +64 -46
- package/dist-client/pages/activity/activity-page.js.map +1 -1
- package/dist-client/pages/activity/activity-partial-view.js +18 -18
- package/dist-client/pages/activity/activity-partial-view.js.map +1 -1
- package/dist-client/pages/activity/starter-list-page.js +22 -25
- package/dist-client/pages/activity/starter-list-page.js.map +1 -1
- package/dist-client/pages/activity-approval/activity-approval-importer.js +16 -17
- package/dist-client/pages/activity-approval/activity-approval-importer.js.map +1 -1
- package/dist-client/pages/activity-approval/activity-approval-list-page.js +30 -23
- package/dist-client/pages/activity-approval/activity-approval-list-page.js.map +1 -1
- package/dist-client/pages/activity-approval/activity-approval-page.js +105 -78
- package/dist-client/pages/activity-approval/activity-approval-page.js.map +1 -1
- package/dist-client/pages/activity-instance/activity-instance-list-page.d.ts +17 -2
- package/dist-client/pages/activity-instance/activity-instance-list-page.js +235 -40
- package/dist-client/pages/activity-instance/activity-instance-list-page.js.map +1 -1
- package/dist-client/pages/activity-instance/activity-instance-search-page.js +38 -38
- package/dist-client/pages/activity-instance/activity-instance-search-page.js.map +1 -1
- package/dist-client/pages/activity-instance/activity-instance-start-page.js +54 -41
- package/dist-client/pages/activity-instance/activity-instance-start-page.js.map +1 -1
- package/dist-client/pages/activity-instance/activity-instance-view.js +211 -213
- package/dist-client/pages/activity-instance/activity-instance-view.js.map +1 -1
- package/dist-client/pages/activity-stats/activity-stats-importer.js +16 -17
- package/dist-client/pages/activity-stats/activity-stats-importer.js.map +1 -1
- package/dist-client/pages/activity-stats/activity-stats-list-page.js +30 -23
- package/dist-client/pages/activity-stats/activity-stats-list-page.js.map +1 -1
- package/dist-client/pages/activity-store/activity-store-page.js +27 -26
- package/dist-client/pages/activity-store/activity-store-page.js.map +1 -1
- package/dist-client/pages/activity-supervisor/reporter-list-page.js +26 -29
- package/dist-client/pages/activity-supervisor/reporter-list-page.js.map +1 -1
- package/dist-client/pages/activity-template/activity-template-importer.js +16 -17
- package/dist-client/pages/activity-template/activity-template-importer.js.map +1 -1
- package/dist-client/pages/activity-template/activity-template-list-page.js +38 -37
- package/dist-client/pages/activity-template/activity-template-list-page.js.map +1 -1
- package/dist-client/pages/activity-template/activity-template-model-item-list.js +2 -3
- package/dist-client/pages/activity-template/activity-template-model-item-list.js.map +1 -1
- package/dist-client/pages/activity-thread/activity-thread-importer.js +16 -17
- package/dist-client/pages/activity-thread/activity-thread-importer.js.map +1 -1
- package/dist-client/pages/activity-thread/activity-thread-list-page.d.ts +1 -1
- package/dist-client/pages/activity-thread/activity-thread-list-page.js +38 -36
- package/dist-client/pages/activity-thread/activity-thread-list-page.js.map +1 -1
- package/dist-client/pages/activity-thread/activity-thread-page.js +71 -51
- package/dist-client/pages/activity-thread/activity-thread-page.js.map +1 -1
- package/dist-client/pages/activity-thread/activity-thread-view-page.js +69 -60
- package/dist-client/pages/activity-thread/activity-thread-view-page.js.map +1 -1
- package/dist-client/pages/activity-thread/activity-thread-view.js +150 -151
- package/dist-client/pages/activity-thread/activity-thread-view.js.map +1 -1
- package/dist-client/pages/installable-activity/installable-activity-list-page.js +25 -30
- package/dist-client/pages/installable-activity/installable-activity-list-page.js.map +1 -1
- package/dist-client/pages/todo/approval-done-list-page.js +39 -35
- package/dist-client/pages/todo/approval-done-list-page.js.map +1 -1
- package/dist-client/pages/todo/approval-pending-list-page.js +58 -53
- package/dist-client/pages/todo/approval-pending-list-page.js.map +1 -1
- package/dist-client/pages/todo/done-list-calendar-page.js +17 -17
- package/dist-client/pages/todo/done-list-calendar-page.js.map +1 -1
- package/dist-client/pages/todo/done-list-page.js +40 -35
- package/dist-client/pages/todo/done-list-page.js.map +1 -1
- package/dist-client/pages/todo/draft-list-page.js +27 -30
- package/dist-client/pages/todo/draft-list-page.js.map +1 -1
- package/dist-client/pages/todo/pickable-list-page.js +31 -37
- package/dist-client/pages/todo/pickable-list-page.js.map +1 -1
- package/dist-client/pages/todo/todo-list-page.js +55 -54
- package/dist-client/pages/todo/todo-list-page.js.map +1 -1
- package/dist-client/templates/activity-approval-context-template.js +49 -49
- package/dist-client/templates/activity-approval-context-template.js.map +1 -1
- package/dist-client/templates/activity-instance-context-template.js +104 -104
- package/dist-client/templates/activity-instance-context-template.js.map +1 -1
- package/dist-client/templates/activity-thread-context-template.js +41 -41
- package/dist-client/templates/activity-thread-context-template.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/controllers/activity-approval/_abort.js +18 -2
- package/dist-server/controllers/activity-approval/_abort.js.map +1 -1
- package/dist-server/controllers/activity-approval/approve.js +25 -3
- package/dist-server/controllers/activity-approval/approve.js.map +1 -1
- package/dist-server/controllers/activity-approval/check-authority.js +2 -3
- package/dist-server/controllers/activity-approval/check-authority.js.map +1 -1
- package/dist-server/controllers/activity-approval/delegate.js +17 -3
- package/dist-server/controllers/activity-approval/delegate.js.map +1 -1
- package/dist-server/controllers/activity-approval/reject.js +16 -2
- package/dist-server/controllers/activity-approval/reject.js.map +1 -1
- package/dist-server/controllers/activity-approval/save.js +6 -2
- package/dist-server/controllers/activity-approval/save.js.map +1 -1
- package/dist-server/controllers/activity-installation/activity-installation-controller.js +1 -1
- package/dist-server/controllers/activity-installation/activity-installation-controller.js.map +1 -1
- package/dist-server/controllers/activity-installation/call-webhook.js +3 -1
- package/dist-server/controllers/activity-installation/call-webhook.js.map +1 -1
- package/dist-server/controllers/activity-instance/abort.js +9 -1
- package/dist-server/controllers/activity-instance/abort.js.map +1 -1
- package/dist-server/controllers/activity-instance/draft.js +19 -2
- package/dist-server/controllers/activity-instance/draft.js.map +1 -1
- package/dist-server/controllers/activity-instance/end.js +10 -2
- package/dist-server/controllers/activity-instance/end.js.map +1 -1
- package/dist-server/controllers/activity-instance/issue.js +30 -5
- package/dist-server/controllers/activity-instance/issue.js.map +1 -1
- package/dist-server/controllers/activity-instance/pick.js +5 -1
- package/dist-server/controllers/activity-instance/pick.js.map +1 -1
- package/dist-server/controllers/activity-thread/_abort.js +9 -1
- package/dist-server/controllers/activity-thread/_abort.js.map +1 -1
- package/dist-server/controllers/activity-thread/check-authority.js +2 -3
- package/dist-server/controllers/activity-thread/check-authority.js.map +1 -1
- package/dist-server/controllers/activity-thread/delegate.js +9 -1
- package/dist-server/controllers/activity-thread/delegate.js.map +1 -1
- package/dist-server/controllers/activity-thread/end.js +9 -2
- package/dist-server/controllers/activity-thread/end.js.map +1 -1
- package/dist-server/controllers/activity-thread/restart.js +9 -1
- package/dist-server/controllers/activity-thread/restart.js.map +1 -1
- package/dist-server/controllers/activity-thread/save.js +7 -1
- package/dist-server/controllers/activity-thread/save.js.map +1 -1
- package/dist-server/controllers/activity-thread/start.js +8 -1
- package/dist-server/controllers/activity-thread/start.js.map +1 -1
- package/dist-server/controllers/activity-thread/submit.js +18 -4
- package/dist-server/controllers/activity-thread/submit.js.map +1 -1
- package/dist-server/controllers/common.js +5 -5
- package/dist-server/controllers/common.js.map +1 -1
- package/dist-server/routes.js +5 -2
- package/dist-server/routes.js.map +1 -1
- package/dist-server/service/activity/activity-mutation.js +43 -13
- package/dist-server/service/activity/activity-mutation.js.map +1 -1
- package/dist-server/service/activity/activity-query.js +3 -3
- package/dist-server/service/activity/activity-query.js.map +1 -1
- package/dist-server/service/activity-approval/activity-approval-subscription.js +3 -4
- package/dist-server/service/activity-approval/activity-approval-subscription.js.map +1 -1
- package/dist-server/service/activity-instance/activity-instance-mutation.d.ts +1 -0
- package/dist-server/service/activity-instance/activity-instance-mutation.js +36 -3
- package/dist-server/service/activity-instance/activity-instance-mutation.js.map +1 -1
- package/dist-server/service/activity-instance/activity-instance-query.d.ts +1 -0
- package/dist-server/service/activity-instance/activity-instance-query.js +25 -5
- package/dist-server/service/activity-instance/activity-instance-query.js.map +1 -1
- package/dist-server/service/activity-instance/activity-instance-subscription.js +3 -4
- package/dist-server/service/activity-instance/activity-instance-subscription.js.map +1 -1
- package/dist-server/service/activity-template/activity-template-mutation.js +25 -7
- package/dist-server/service/activity-template/activity-template-mutation.js.map +1 -1
- package/dist-server/service/activity-template/activity-template-query.js +1 -1
- package/dist-server/service/activity-template/activity-template-query.js.map +1 -1
- package/dist-server/service/activity-thread/activity-thread-subscription.js +3 -4
- package/dist-server/service/activity-thread/activity-thread-subscription.js.map +1 -1
- package/dist-server/service/installable-activity/installable-activity-mutation.js +19 -3
- package/dist-server/service/installable-activity/installable-activity-mutation.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/helps/worklist/activity-instance-list-page.md +90 -0
- package/helps/worklist/activity-instance-search-page.md +83 -0
- package/helps/worklist/activity-instance-start-page.md +92 -0
- package/helps/worklist/activity-thread-list-page.md +87 -0
- package/helps/worklist/activity-thread-page.md +93 -0
- package/helps/worklist/activity-thread-view-page.md +86 -0
- package/helps/worklist/approval-done-list-page.md +72 -0
- package/helps/worklist/approval-pending-list-page.md +89 -0
- package/helps/worklist/done-list-calendar-page.md +66 -0
- package/helps/worklist/done-list-page.md +76 -0
- package/helps/worklist/draft-list-page.md +80 -0
- package/helps/worklist/pickable-list-page.md +75 -0
- package/helps/worklist/todo-list-page.md +90 -0
- package/package.json +16 -15
- package/translations/en.json +3 -1
- package/translations/ja.json +2 -0
- package/translations/ko.json +2 -0
- package/translations/ms.json +2 -0
- package/translations/zh.json +2 -0
|
@@ -21,109 +21,9 @@ function getSafeFormatter(locale, options) {
|
|
|
21
21
|
}
|
|
22
22
|
const formatter = getSafeFormatter(navigator.language, { dateStyle: 'full', timeStyle: 'short' });
|
|
23
23
|
let ActivityInstanceContextTemplate = class ActivityInstanceContextTemplate extends connect(store)(LitElement) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const { startingType } = activity || {};
|
|
28
|
-
// const editable = state == 'draft'
|
|
29
|
-
return html `
|
|
30
|
-
<div flow>
|
|
31
|
-
${approvalLine
|
|
32
|
-
? html `
|
|
33
|
-
<approval-line-view
|
|
34
|
-
.model=${approvalLine}
|
|
35
|
-
@click=${() => this.onClickApprovalLine(activityInstance)}
|
|
36
|
-
@change=${e => (activityInstance.approvalLine = e.currentTarget.value)}
|
|
37
|
-
></approval-line-view>
|
|
38
|
-
`
|
|
39
|
-
: html `<md-elevated-button @click=${() => this.onClickApprovalLine(activityInstance)}>
|
|
40
|
-
<md-icon slot="icon">group_add</md-icon>
|
|
41
|
-
</md-elevated-button>`}
|
|
42
|
-
</div>
|
|
43
|
-
|
|
44
|
-
<div info>
|
|
45
|
-
<div><label>${i18next.t('field.name')}</label> <strong>${name}</strong></div>
|
|
46
|
-
<div><label>${i18next.t('field.description')}</label> ${description}</div>
|
|
47
|
-
<div>
|
|
48
|
-
<label>${i18next.t('field.status')}</label> <span></span> <strong
|
|
49
|
-
>${i18next.t('label.activity-state-' + state)}</strong
|
|
50
|
-
>
|
|
51
|
-
</div>
|
|
52
|
-
<div>
|
|
53
|
-
<label>${i18next.t('field.assigned-at')}</label> ${assignedAt && formatter.format(new Date(assignedAt))}
|
|
54
|
-
</div>
|
|
55
|
-
<div><label>${i18next.t('field.due-at')}</label> ${dueAt && formatter.format(new Date(dueAt))}</div>
|
|
56
|
-
<div><label>${i18next.t('field.started-at')}</label> ${startedAt && formatter.format(new Date(startedAt))}</div>
|
|
57
|
-
</div>
|
|
58
|
-
|
|
59
|
-
${startingType == 'issue'
|
|
60
|
-
? html `<div assignees>
|
|
61
|
-
<div>
|
|
62
|
-
<label>${i18next.t('field.assignees')}</label>
|
|
63
|
-
${assignees
|
|
64
|
-
? html `
|
|
65
|
-
<assignees-view
|
|
66
|
-
.value=${assignees}
|
|
67
|
-
@click=${() => this.onClickAssignees(activityInstance)}
|
|
68
|
-
@change=${e => (activityInstance.assignees = e.currentTarget.value)}
|
|
69
|
-
></assignees-view>
|
|
70
|
-
`
|
|
71
|
-
: html `<md-elevated-button @click=${() => this.onClickAssignees(activityInstance)}>
|
|
72
|
-
<md-icon slot="icon">group_add</md-icon>
|
|
73
|
-
</md-elevated-button>`}
|
|
74
|
-
</div>
|
|
75
|
-
</div>`
|
|
76
|
-
: html ``}
|
|
77
|
-
${thumbnail
|
|
78
|
-
? html ` <div thumbnail>
|
|
79
|
-
<img src=${thumbnail} />
|
|
80
|
-
</div>`
|
|
81
|
-
: html ``}
|
|
82
|
-
`;
|
|
83
|
-
}
|
|
84
|
-
stateChanged(state) {
|
|
85
|
-
this.context = state.route.context;
|
|
86
|
-
}
|
|
87
|
-
onClickAssignees(activityInstance) {
|
|
88
|
-
const { assignees } = activityInstance || {};
|
|
89
|
-
const popup = openPopup(html `
|
|
90
|
-
<assignees-editor-popup
|
|
91
|
-
.value=${assignees}
|
|
92
|
-
.confirmCallback=${value => {
|
|
93
|
-
activityInstance.assignees = value;
|
|
94
|
-
this.requestUpdate();
|
|
95
|
-
}}
|
|
96
|
-
></assignees-editor-popup>
|
|
97
|
-
`, {
|
|
98
|
-
backdrop: true,
|
|
99
|
-
help: 'organization/assignees-editor',
|
|
100
|
-
size: 'large',
|
|
101
|
-
title: i18next.t('title.assignee list')
|
|
102
|
-
});
|
|
103
|
-
popup.onclosed = () => { };
|
|
104
|
-
}
|
|
105
|
-
onClickApprovalLine(activityInstance) {
|
|
106
|
-
const { approvalLine } = activityInstance || {};
|
|
107
|
-
const popup = openPopup(html `
|
|
108
|
-
<approval-line-items-editor-popup
|
|
109
|
-
.value=${approvalLine}
|
|
110
|
-
.confirmCallback=${value => {
|
|
111
|
-
activityInstance.approvalLine = value;
|
|
112
|
-
this.requestUpdate();
|
|
113
|
-
}}
|
|
114
|
-
></approval-line-items-editor-popup>
|
|
115
|
-
`, {
|
|
116
|
-
backdrop: true,
|
|
117
|
-
help: 'organization/approval-line-items-editor',
|
|
118
|
-
size: 'large',
|
|
119
|
-
title: i18next.t('title.approval-line item list')
|
|
120
|
-
});
|
|
121
|
-
popup.onclosed = () => { };
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
ActivityInstanceContextTemplate.styles = [
|
|
125
|
-
ContextToolbarOverlayStyle,
|
|
126
|
-
css `
|
|
24
|
+
static { this.styles = [
|
|
25
|
+
ContextToolbarOverlayStyle,
|
|
26
|
+
css `
|
|
127
27
|
:host {
|
|
128
28
|
background-color: var(--md-sys-color-surface);
|
|
129
29
|
width: 100%;
|
|
@@ -266,7 +166,107 @@ ActivityInstanceContextTemplate.styles = [
|
|
|
266
166
|
height: auto;
|
|
267
167
|
}
|
|
268
168
|
`
|
|
269
|
-
];
|
|
169
|
+
]; }
|
|
170
|
+
render() {
|
|
171
|
+
const activityInstance = this.context.activityInstance || this.activityInstance || {};
|
|
172
|
+
const { activity, name, description, state, assignees, approvalLine, assignedAt, startedAt, dueAt, thumbnail } = activityInstance || {};
|
|
173
|
+
const { startingType } = activity || {};
|
|
174
|
+
// const editable = state == 'draft'
|
|
175
|
+
return html `
|
|
176
|
+
<div flow>
|
|
177
|
+
${approvalLine
|
|
178
|
+
? html `
|
|
179
|
+
<approval-line-view
|
|
180
|
+
.model=${approvalLine}
|
|
181
|
+
@click=${() => this.onClickApprovalLine(activityInstance)}
|
|
182
|
+
@change=${e => (activityInstance.approvalLine = e.currentTarget.value)}
|
|
183
|
+
></approval-line-view>
|
|
184
|
+
`
|
|
185
|
+
: html `<md-elevated-button @click=${() => this.onClickApprovalLine(activityInstance)}>
|
|
186
|
+
<md-icon slot="icon">group_add</md-icon>
|
|
187
|
+
</md-elevated-button>`}
|
|
188
|
+
</div>
|
|
189
|
+
|
|
190
|
+
<div info>
|
|
191
|
+
<div><label>${i18next.t('field.name')}</label> <strong>${name}</strong></div>
|
|
192
|
+
<div><label>${i18next.t('field.description')}</label> ${description}</div>
|
|
193
|
+
<div>
|
|
194
|
+
<label>${i18next.t('field.status')}</label> <span></span> <strong
|
|
195
|
+
>${i18next.t('label.activity-state-' + state)}</strong
|
|
196
|
+
>
|
|
197
|
+
</div>
|
|
198
|
+
<div>
|
|
199
|
+
<label>${i18next.t('field.assigned-at')}</label> ${assignedAt && formatter.format(new Date(assignedAt))}
|
|
200
|
+
</div>
|
|
201
|
+
<div><label>${i18next.t('field.due-at')}</label> ${dueAt && formatter.format(new Date(dueAt))}</div>
|
|
202
|
+
<div><label>${i18next.t('field.started-at')}</label> ${startedAt && formatter.format(new Date(startedAt))}</div>
|
|
203
|
+
</div>
|
|
204
|
+
|
|
205
|
+
${startingType == 'issue'
|
|
206
|
+
? html `<div assignees>
|
|
207
|
+
<div>
|
|
208
|
+
<label>${i18next.t('field.assignees')}</label>
|
|
209
|
+
${assignees
|
|
210
|
+
? html `
|
|
211
|
+
<assignees-view
|
|
212
|
+
.value=${assignees}
|
|
213
|
+
@click=${() => this.onClickAssignees(activityInstance)}
|
|
214
|
+
@change=${e => (activityInstance.assignees = e.currentTarget.value)}
|
|
215
|
+
></assignees-view>
|
|
216
|
+
`
|
|
217
|
+
: html `<md-elevated-button @click=${() => this.onClickAssignees(activityInstance)}>
|
|
218
|
+
<md-icon slot="icon">group_add</md-icon>
|
|
219
|
+
</md-elevated-button>`}
|
|
220
|
+
</div>
|
|
221
|
+
</div>`
|
|
222
|
+
: html ``}
|
|
223
|
+
${thumbnail
|
|
224
|
+
? html ` <div thumbnail>
|
|
225
|
+
<img src=${thumbnail} />
|
|
226
|
+
</div>`
|
|
227
|
+
: html ``}
|
|
228
|
+
`;
|
|
229
|
+
}
|
|
230
|
+
stateChanged(state) {
|
|
231
|
+
this.context = state.route.context;
|
|
232
|
+
}
|
|
233
|
+
onClickAssignees(activityInstance) {
|
|
234
|
+
const { assignees } = activityInstance || {};
|
|
235
|
+
const popup = openPopup(html `
|
|
236
|
+
<assignees-editor-popup
|
|
237
|
+
.value=${assignees}
|
|
238
|
+
.confirmCallback=${value => {
|
|
239
|
+
activityInstance.assignees = value;
|
|
240
|
+
this.requestUpdate();
|
|
241
|
+
}}
|
|
242
|
+
></assignees-editor-popup>
|
|
243
|
+
`, {
|
|
244
|
+
backdrop: true,
|
|
245
|
+
help: 'organization/assignees-editor',
|
|
246
|
+
size: 'large',
|
|
247
|
+
title: i18next.t('title.assignee list')
|
|
248
|
+
});
|
|
249
|
+
popup.onclosed = () => { };
|
|
250
|
+
}
|
|
251
|
+
onClickApprovalLine(activityInstance) {
|
|
252
|
+
const { approvalLine } = activityInstance || {};
|
|
253
|
+
const popup = openPopup(html `
|
|
254
|
+
<approval-line-items-editor-popup
|
|
255
|
+
.value=${approvalLine}
|
|
256
|
+
.confirmCallback=${value => {
|
|
257
|
+
activityInstance.approvalLine = value;
|
|
258
|
+
this.requestUpdate();
|
|
259
|
+
}}
|
|
260
|
+
></approval-line-items-editor-popup>
|
|
261
|
+
`, {
|
|
262
|
+
backdrop: true,
|
|
263
|
+
help: 'organization/approval-line-items-editor',
|
|
264
|
+
size: 'large',
|
|
265
|
+
title: i18next.t('title.approval-line item list')
|
|
266
|
+
});
|
|
267
|
+
popup.onclosed = () => { };
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
270
|
__decorate([
|
|
271
271
|
property({ type: Object }),
|
|
272
272
|
__metadata("design:type", Object)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity-instance-context-template.js","sourceRoot":"","sources":["../../client/templates/activity-instance-context-template.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,yCAAyC,CAAA;AAEhD,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AAEnD,OAAO,EAAE,0BAA0B,EAAE,MAAM,sDAAsD,CAAA;AACjG,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C,OAAO,0EAA0E,CAAA;AAEjF,SAAS,gBAAgB,CAAC,MAAc,EAAE,OAAmC;IAC3E,IAAI,CAAC;QACH,MAAM,UAAU,GAAG,MAAM,IAAI,OAAO,CAAA;QACpC,OAAO,IAAI,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,OAAO,CAAC,CAAA;IACrD,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,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AE,IAAI,EAAE,MAAM,EAAE,CAAC;;yEAAyB;AAEnC;IAAhB,KAAK,EAAE;;gEAAgB;AAtJpB,+BAA+B;IADpC,aAAa,CAAC,oCAAoC,CAAC;GAC9C,+BAA+B,CAyQpC","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@material/web/button/elevated-button.js'\n\nimport { html, css, LitElement } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { connect } from 'pwa-helpers/connect-mixin'\n\nimport { ContextToolbarOverlayStyle } from '@operato/context/ox-context-toolbar-overlay-style.js'\nimport { store } from '@operato/shell'\nimport { i18next } from '@operato/i18n'\nimport { openPopup } from '@operato/layout'\n\nimport '@things-factory/organization/dist-client/component/approval-line-view.js'\n\nfunction getSafeFormatter(locale: string, options: Intl.DateTimeFormatOptions): Intl.DateTimeFormat {\n try {\n const safeLocale = locale || 'en-US'\n return new Intl.DateTimeFormat(safeLocale, options)\n } catch (e) {\n console.warn(`Invalid locale or options provided: ${locale}, falling back to default en-US.`, e)\n return new Intl.DateTimeFormat('en-US', options)\n }\n}\n\nconst formatter = getSafeFormatter(navigator.language, { dateStyle: 'full', timeStyle: 'short' })\n@customElement('activity-instance-context-template')\nclass ActivityInstanceContextTemplate extends connect(store)(LitElement) {\n static styles = [\n ContextToolbarOverlayStyle,\n css`\n :host {\n background-color: var(--md-sys-color-surface);\n width: 100%;\n min-width: 450px;\n max-height: 100%;\n overflow: auto;\n --context-ui-padding: 0;\n }\n\n :host([state='draft']) {\n --worklist-status-color: #5f7184;\n }\n\n :host([state='issued']) {\n --worklist-status-color: #56af45;\n }\n\n :host([state='assigned']) {\n --worklist-status-color: #428df3;\n }\n\n :host([state='started']) {\n --worklist-status-color: #595de5;\n }\n\n :host([state='pending']) {\n --worklist-status-color: #f27429;\n }\n\n :host([state='ended']) {\n --worklist-status-color: #02acae;\n }\n\n :host([state='aborted']) {\n --worklist-status-color: #cb3a33;\n }\n\n :host:before {\n content: '';\n position: absolute;\n width: 0;\n height: 0;\n border: 22px solid transparent;\n border-left-color: var(--worklist-status-color);\n border-right: 0;\n }\n\n [info],\n [assignees] {\n padding: var(--spacing-medium);\n border-bottom: var(--border-dim-color);\n color: var(--md-sys-color-secondary);\n }\n\n [info] div {\n display: flex;\n align-items: center;\n padding: var(--spacing-small);\n border-radius: var(--border-radius);\n text-align: right;\n clear: both;\n overflow: hidden;\n }\n\n [info] div:nth-child(odd) {\n background-color: var(--md-sys-color-background);\n }\n\n [info] label {\n display: inline-block;\n width: 25%;\n text-align: right;\n margin-right: 20px;\n }\n\n [info] span {\n width: 15px;\n height: 15px;\n background-color: var(--worklist-status-color, tomato);\n display: inline-block;\n border-radius: 50%;\n }\n\n :host:before {\n content: '';\n position: absolute;\n width: 0;\n height: 0;\n border: 22px solid transparent;\n border-left-color: var(--worklist-status-color);\n border-right: 0;\n }\n\n section {\n padding: var(--spacing-medium);\n color: var(--md-sys-color-secondary);\n }\n\n section label {\n display: inline-block;\n width: 25%;\n margin-top: var(--spacing-medium);\n }\n\n [assignees] {\n text-align: right;\n clear: both;\n overflow: hidden;\n }\n\n [assignees] label {\n display: inline-block;\n padding-left: var(--spacing-small);\n width: 25%;\n text-align: left;\n }\n\n [assignees] md-elevated-button {\n float: right;\n }\n\n section input {\n display: inline-block;\n width: 70%;\n border: var(--border-dim-color);\n border-width: 0 0 1px 0;\n margin-top: var(--spacing-medium);\n font-size: var(--fontsize-large);\n }\n\n [thumbnail] {\n display: flex;\n justify-content: center;\n align-items: center;\n margin: var(--spacing-medium);\n }\n\n img {\n max-width: 85%;\n height: auto;\n }\n `\n ]\n\n @property({ type: Object }) private activityInstance\n\n @state() private context\n\n render() {\n const activityInstance = this.context.activityInstance || this.activityInstance || {}\n const { activity, name, description, state, assignees, approvalLine, assignedAt, startedAt, dueAt, thumbnail } =\n activityInstance || {}\n const { startingType } = activity || {}\n\n // const editable = state == 'draft'\n\n return html`\n <div flow>\n ${approvalLine\n ? html`\n <approval-line-view\n .model=${approvalLine}\n @click=${() => this.onClickApprovalLine(activityInstance)}\n @change=${e => (activityInstance.approvalLine = e.currentTarget.value)}\n ></approval-line-view>\n `\n : html`<md-elevated-button @click=${() => this.onClickApprovalLine(activityInstance)}>\n <md-icon slot=\"icon\">group_add</md-icon>\n </md-elevated-button>`}\n </div>\n\n <div info>\n <div><label>${i18next.t('field.name')}</label> <strong>${name}</strong></div>\n <div><label>${i18next.t('field.description')}</label> ${description}</div>\n <div>\n <label>${i18next.t('field.status')}</label> <span></span> <strong\n >${i18next.t('label.activity-state-' + state)}</strong\n >\n </div>\n <div>\n <label>${i18next.t('field.assigned-at')}</label> ${assignedAt && formatter.format(new Date(assignedAt))}\n </div>\n <div><label>${i18next.t('field.due-at')}</label> ${dueAt && formatter.format(new Date(dueAt))}</div>\n <div><label>${i18next.t('field.started-at')}</label> ${startedAt && formatter.format(new Date(startedAt))}</div>\n </div>\n\n ${startingType == 'issue'\n ? html`<div assignees>\n <div>\n <label>${i18next.t('field.assignees')}</label>\n ${assignees\n ? html`\n <assignees-view\n .value=${assignees}\n @click=${() => this.onClickAssignees(activityInstance)}\n @change=${e => (activityInstance.assignees = e.currentTarget.value)}\n ></assignees-view>\n `\n : html`<md-elevated-button @click=${() => this.onClickAssignees(activityInstance)}>\n <md-icon slot=\"icon\">group_add</md-icon>\n </md-elevated-button>`}\n </div>\n </div>`\n : html``}\n ${thumbnail\n ? html` <div thumbnail>\n <img src=${thumbnail} />\n </div>`\n : html``}\n `\n }\n\n stateChanged(state) {\n this.context = state.route.context\n }\n\n onClickAssignees(activityInstance) {\n const { assignees } = activityInstance || {}\n\n const popup = openPopup(\n html`\n <assignees-editor-popup\n .value=${assignees}\n .confirmCallback=${value => {\n activityInstance.assignees = value\n this.requestUpdate()\n }}\n ></assignees-editor-popup>\n `,\n {\n backdrop: true,\n help: 'organization/assignees-editor',\n size: 'large',\n title: i18next.t('title.assignee list')\n }\n )\n popup.onclosed = () => {}\n }\n\n onClickApprovalLine(activityInstance) {\n const { approvalLine } = activityInstance || {}\n\n const popup = openPopup(\n html`\n <approval-line-items-editor-popup\n .value=${approvalLine}\n .confirmCallback=${value => {\n activityInstance.approvalLine = value\n this.requestUpdate()\n }}\n ></approval-line-items-editor-popup>\n `,\n {\n backdrop: true,\n help: 'organization/approval-line-items-editor',\n size: 'large',\n title: i18next.t('title.approval-line item list')\n }\n )\n popup.onclosed = () => {}\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"activity-instance-context-template.js","sourceRoot":"","sources":["../../client/templates/activity-instance-context-template.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,yCAAyC,CAAA;AAEhD,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AAEnD,OAAO,EAAE,0BAA0B,EAAE,MAAM,sDAAsD,CAAA;AACjG,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C,OAAO,0EAA0E,CAAA;AAEjF,SAAS,gBAAgB,CAAC,MAAc,EAAE,OAAmC;IAC3E,IAAI,CAAC;QACH,MAAM,UAAU,GAAG,MAAM,IAAI,OAAO,CAAA;QACpC,OAAO,IAAI,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,OAAO,CAAC,CAAA;IACrD,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,IAAI,CAAC,uCAAuC,MAAM,kCAAkC,EAAE,CAAC,CAAC,CAAA;QAChG,OAAO,IAAI,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IAClD,CAAC;AACH,CAAC;AAED,MAAM,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web/icon/icon.js'\nimport '@material/web/button/elevated-button.js'\n\nimport { html, css, LitElement } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { connect } from 'pwa-helpers/connect-mixin'\n\nimport { ContextToolbarOverlayStyle } from '@operato/context/ox-context-toolbar-overlay-style.js'\nimport { store } from '@operato/shell'\nimport { i18next } from '@operato/i18n'\nimport { openPopup } from '@operato/layout'\n\nimport '@things-factory/organization/dist-client/component/approval-line-view.js'\n\nfunction getSafeFormatter(locale: string, options: Intl.DateTimeFormatOptions): Intl.DateTimeFormat {\n try {\n const safeLocale = locale || 'en-US'\n return new Intl.DateTimeFormat(safeLocale, options)\n } catch (e) {\n console.warn(`Invalid locale or options provided: ${locale}, falling back to default en-US.`, e)\n return new Intl.DateTimeFormat('en-US', options)\n }\n}\n\nconst formatter = getSafeFormatter(navigator.language, { dateStyle: 'full', timeStyle: 'short' })\n@customElement('activity-instance-context-template')\nclass ActivityInstanceContextTemplate extends connect(store)(LitElement) {\n static styles = [\n ContextToolbarOverlayStyle,\n css`\n :host {\n background-color: var(--md-sys-color-surface);\n width: 100%;\n min-width: 450px;\n max-height: 100%;\n overflow: auto;\n --context-ui-padding: 0;\n }\n\n :host([state='draft']) {\n --worklist-status-color: #5f7184;\n }\n\n :host([state='issued']) {\n --worklist-status-color: #56af45;\n }\n\n :host([state='assigned']) {\n --worklist-status-color: #428df3;\n }\n\n :host([state='started']) {\n --worklist-status-color: #595de5;\n }\n\n :host([state='pending']) {\n --worklist-status-color: #f27429;\n }\n\n :host([state='ended']) {\n --worklist-status-color: #02acae;\n }\n\n :host([state='aborted']) {\n --worklist-status-color: #cb3a33;\n }\n\n :host:before {\n content: '';\n position: absolute;\n width: 0;\n height: 0;\n border: 22px solid transparent;\n border-left-color: var(--worklist-status-color);\n border-right: 0;\n }\n\n [info],\n [assignees] {\n padding: var(--spacing-medium);\n border-bottom: var(--border-dim-color);\n color: var(--md-sys-color-secondary);\n }\n\n [info] div {\n display: flex;\n align-items: center;\n padding: var(--spacing-small);\n border-radius: var(--border-radius);\n text-align: right;\n clear: both;\n overflow: hidden;\n }\n\n [info] div:nth-child(odd) {\n background-color: var(--md-sys-color-background);\n }\n\n [info] label {\n display: inline-block;\n width: 25%;\n text-align: right;\n margin-right: 20px;\n }\n\n [info] span {\n width: 15px;\n height: 15px;\n background-color: var(--worklist-status-color, tomato);\n display: inline-block;\n border-radius: 50%;\n }\n\n :host:before {\n content: '';\n position: absolute;\n width: 0;\n height: 0;\n border: 22px solid transparent;\n border-left-color: var(--worklist-status-color);\n border-right: 0;\n }\n\n section {\n padding: var(--spacing-medium);\n color: var(--md-sys-color-secondary);\n }\n\n section label {\n display: inline-block;\n width: 25%;\n margin-top: var(--spacing-medium);\n }\n\n [assignees] {\n text-align: right;\n clear: both;\n overflow: hidden;\n }\n\n [assignees] label {\n display: inline-block;\n padding-left: var(--spacing-small);\n width: 25%;\n text-align: left;\n }\n\n [assignees] md-elevated-button {\n float: right;\n }\n\n section input {\n display: inline-block;\n width: 70%;\n border: var(--border-dim-color);\n border-width: 0 0 1px 0;\n margin-top: var(--spacing-medium);\n font-size: var(--fontsize-large);\n }\n\n [thumbnail] {\n display: flex;\n justify-content: center;\n align-items: center;\n margin: var(--spacing-medium);\n }\n\n img {\n max-width: 85%;\n height: auto;\n }\n `\n ]\n\n @property({ type: Object }) private activityInstance\n\n @state() private context\n\n render() {\n const activityInstance = this.context.activityInstance || this.activityInstance || {}\n const { activity, name, description, state, assignees, approvalLine, assignedAt, startedAt, dueAt, thumbnail } =\n activityInstance || {}\n const { startingType } = activity || {}\n\n // const editable = state == 'draft'\n\n return html`\n <div flow>\n ${approvalLine\n ? html`\n <approval-line-view\n .model=${approvalLine}\n @click=${() => this.onClickApprovalLine(activityInstance)}\n @change=${e => (activityInstance.approvalLine = e.currentTarget.value)}\n ></approval-line-view>\n `\n : html`<md-elevated-button @click=${() => this.onClickApprovalLine(activityInstance)}>\n <md-icon slot=\"icon\">group_add</md-icon>\n </md-elevated-button>`}\n </div>\n\n <div info>\n <div><label>${i18next.t('field.name')}</label> <strong>${name}</strong></div>\n <div><label>${i18next.t('field.description')}</label> ${description}</div>\n <div>\n <label>${i18next.t('field.status')}</label> <span></span> <strong\n >${i18next.t('label.activity-state-' + state)}</strong\n >\n </div>\n <div>\n <label>${i18next.t('field.assigned-at')}</label> ${assignedAt && formatter.format(new Date(assignedAt))}\n </div>\n <div><label>${i18next.t('field.due-at')}</label> ${dueAt && formatter.format(new Date(dueAt))}</div>\n <div><label>${i18next.t('field.started-at')}</label> ${startedAt && formatter.format(new Date(startedAt))}</div>\n </div>\n\n ${startingType == 'issue'\n ? html`<div assignees>\n <div>\n <label>${i18next.t('field.assignees')}</label>\n ${assignees\n ? html`\n <assignees-view\n .value=${assignees}\n @click=${() => this.onClickAssignees(activityInstance)}\n @change=${e => (activityInstance.assignees = e.currentTarget.value)}\n ></assignees-view>\n `\n : html`<md-elevated-button @click=${() => this.onClickAssignees(activityInstance)}>\n <md-icon slot=\"icon\">group_add</md-icon>\n </md-elevated-button>`}\n </div>\n </div>`\n : html``}\n ${thumbnail\n ? html` <div thumbnail>\n <img src=${thumbnail} />\n </div>`\n : html``}\n `\n }\n\n stateChanged(state) {\n this.context = state.route.context\n }\n\n onClickAssignees(activityInstance) {\n const { assignees } = activityInstance || {}\n\n const popup = openPopup(\n html`\n <assignees-editor-popup\n .value=${assignees}\n .confirmCallback=${value => {\n activityInstance.assignees = value\n this.requestUpdate()\n }}\n ></assignees-editor-popup>\n `,\n {\n backdrop: true,\n help: 'organization/assignees-editor',\n size: 'large',\n title: i18next.t('title.assignee list')\n }\n )\n popup.onclosed = () => {}\n }\n\n onClickApprovalLine(activityInstance) {\n const { approvalLine } = activityInstance || {}\n\n const popup = openPopup(\n html`\n <approval-line-items-editor-popup\n .value=${approvalLine}\n .confirmCallback=${value => {\n activityInstance.approvalLine = value\n this.requestUpdate()\n }}\n ></approval-line-items-editor-popup>\n `,\n {\n backdrop: true,\n help: 'organization/approval-line-items-editor',\n size: 'large',\n title: i18next.t('title.approval-line item list')\n }\n )\n popup.onclosed = () => {}\n }\n}\n"]}
|
|
@@ -20,46 +20,9 @@ function getSafeFormatter(locale, options) {
|
|
|
20
20
|
}
|
|
21
21
|
const formatter = getSafeFormatter(navigator.language, { dateStyle: 'full', timeStyle: 'short' });
|
|
22
22
|
let ActivityThreadContextTemplate = class ActivityThreadContextTemplate extends connect(store)(LitElement) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const { name, description, approvalLine } = activityInstance || {};
|
|
27
|
-
return html `
|
|
28
|
-
<div flow>
|
|
29
|
-
<div approval-line>
|
|
30
|
-
${approvalLine ? html ` <approval-line-view .model=${approvalLine}></approval-line-view> ` : html ``}
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
|
|
34
|
-
<div info>
|
|
35
|
-
<div><label>${i18next.t('field.name')}</label> <strong>${name}</strong></div>
|
|
36
|
-
<div><label>${i18next.t('field.description')}</label> ${description}</div>
|
|
37
|
-
<div>
|
|
38
|
-
<label>${i18next.t('field.status')}</label> <span></span> <strong
|
|
39
|
-
>${i18next.t('label.activity-state-' + state)}</strong
|
|
40
|
-
>
|
|
41
|
-
</div>
|
|
42
|
-
<div><label>${i18next.t('field.round')}</label> <strong>${round}</strong></div>
|
|
43
|
-
<div><label>${i18next.t('field.assignee')}</label> <strong>${assignee === null || assignee === void 0 ? void 0 : assignee.name}</strong></div>
|
|
44
|
-
<div>
|
|
45
|
-
<label>${i18next.t('field.assigned-at')}</label> ${assignedAt && formatter.format(new Date(assignedAt))}
|
|
46
|
-
</div>
|
|
47
|
-
<div><label>${i18next.t('field.due-at')}</label> ${dueAt && formatter.format(new Date(dueAt))}</div>
|
|
48
|
-
<div>
|
|
49
|
-
<label>${i18next.t('field.terminated-at')}</label> ${terminatedAt && formatter.format(new Date(terminatedAt))}
|
|
50
|
-
</div>
|
|
51
|
-
</div>
|
|
52
|
-
|
|
53
|
-
<activity-thread-timeline .activityThread=${activityThread} short-form></activity-thread-timeline>
|
|
54
|
-
`;
|
|
55
|
-
}
|
|
56
|
-
stateChanged(state) {
|
|
57
|
-
this.context = state.route.context;
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
ActivityThreadContextTemplate.styles = [
|
|
61
|
-
ContextToolbarOverlayStyle,
|
|
62
|
-
css `
|
|
23
|
+
static { this.styles = [
|
|
24
|
+
ContextToolbarOverlayStyle,
|
|
25
|
+
css `
|
|
63
26
|
:host {
|
|
64
27
|
background-color: var(--md-sys-color-surface);
|
|
65
28
|
width: 100%;
|
|
@@ -154,7 +117,44 @@ ActivityThreadContextTemplate.styles = [
|
|
|
154
117
|
margin: var(--spacing-medium);
|
|
155
118
|
}
|
|
156
119
|
`
|
|
157
|
-
];
|
|
120
|
+
]; }
|
|
121
|
+
render() {
|
|
122
|
+
const activityThread = this.context.activityThread || this.activityThread || {};
|
|
123
|
+
const { state, round, dueAt, assignedAt, terminatedAt, assignee, activityInstance, activityApprovals } = activityThread || {};
|
|
124
|
+
const { name, description, approvalLine } = activityInstance || {};
|
|
125
|
+
return html `
|
|
126
|
+
<div flow>
|
|
127
|
+
<div approval-line>
|
|
128
|
+
${approvalLine ? html ` <approval-line-view .model=${approvalLine}></approval-line-view> ` : html ``}
|
|
129
|
+
</div>
|
|
130
|
+
</div>
|
|
131
|
+
|
|
132
|
+
<div info>
|
|
133
|
+
<div><label>${i18next.t('field.name')}</label> <strong>${name}</strong></div>
|
|
134
|
+
<div><label>${i18next.t('field.description')}</label> ${description}</div>
|
|
135
|
+
<div>
|
|
136
|
+
<label>${i18next.t('field.status')}</label> <span></span> <strong
|
|
137
|
+
>${i18next.t('label.activity-state-' + state)}</strong
|
|
138
|
+
>
|
|
139
|
+
</div>
|
|
140
|
+
<div><label>${i18next.t('field.round')}</label> <strong>${round}</strong></div>
|
|
141
|
+
<div><label>${i18next.t('field.assignee')}</label> <strong>${assignee?.name}</strong></div>
|
|
142
|
+
<div>
|
|
143
|
+
<label>${i18next.t('field.assigned-at')}</label> ${assignedAt && formatter.format(new Date(assignedAt))}
|
|
144
|
+
</div>
|
|
145
|
+
<div><label>${i18next.t('field.due-at')}</label> ${dueAt && formatter.format(new Date(dueAt))}</div>
|
|
146
|
+
<div>
|
|
147
|
+
<label>${i18next.t('field.terminated-at')}</label> ${terminatedAt && formatter.format(new Date(terminatedAt))}
|
|
148
|
+
</div>
|
|
149
|
+
</div>
|
|
150
|
+
|
|
151
|
+
<activity-thread-timeline .activityThread=${activityThread} short-form></activity-thread-timeline>
|
|
152
|
+
`;
|
|
153
|
+
}
|
|
154
|
+
stateChanged(state) {
|
|
155
|
+
this.context = state.route.context;
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
158
|
__decorate([
|
|
159
159
|
property({ type: Object }),
|
|
160
160
|
__metadata("design:type", Object)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity-thread-context-template.js","sourceRoot":"","sources":["../../client/templates/activity-thread-context-template.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,0EAA0E,CAAA;AACjF,OAAO,wCAAwC,CAAA;AAE/C,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAW,MAAM,KAAK,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AAEnD,OAAO,EAAE,0BAA0B,EAAE,MAAM,sDAAsD,CAAA;AACjG,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC,SAAS,gBAAgB,CAAC,MAAc,EAAE,OAAmC;IAC3E,IAAI,CAAC;QACH,MAAM,UAAU,GAAG,MAAM,IAAI,OAAO,CAAA;QACpC,OAAO,IAAI,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,OAAO,CAAC,CAAA;IACrD,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,IAAI,CAAC,uCAAuC,MAAM,kCAAkC,EAAE,CAAC,CAAC,CAAA;QAChG,OAAO,IAAI,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IAClD,CAAC;AACH,CAAC;AAED,MAAM,SAAS,GAAG,gBAAgB,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAA;AAEjG,IAAM,6BAA6B,GAAnC,MAAM,6BAA8B,SAAQ,OAAO,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"activity-thread-context-template.js","sourceRoot":"","sources":["../../client/templates/activity-thread-context-template.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,0EAA0E,CAAA;AACjF,OAAO,wCAAwC,CAAA;AAE/C,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAW,MAAM,KAAK,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AAEnD,OAAO,EAAE,0BAA0B,EAAE,MAAM,sDAAsD,CAAA;AACjG,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC,SAAS,gBAAgB,CAAC,MAAc,EAAE,OAAmC;IAC3E,IAAI,CAAC;QACH,MAAM,UAAU,GAAG,MAAM,IAAI,OAAO,CAAA;QACpC,OAAO,IAAI,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,OAAO,CAAC,CAAA;IACrD,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,IAAI,CAAC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AuB,GAAG,KAAK,CAAC;;;sBAGnC,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,oBAAoB,KAAK;sBACjD,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC,oBAAoB,QAAQ,EAAE,IAAI;;mBAEhE,OAAO,CAAC,CAAC,CAAC,mBAAmB,CAAC,YAAY,UAAU,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC;;sBAE3F,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC,YAAY,KAAK,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;;mBAElF,OAAO,CAAC,CAAC,CAAC,qBAAqB,CAAC,YAAY,YAAY,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC;;;;kDAIrE,cAAc;KAC3D,CAAA;IACH,CAAC;IAED,YAAY,CAAC,KAAK;QAChB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,CAAA;IACpC,CAAC;;AA3CmC;IAAnC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qEAAuB;AAEjC;IAAhB,KAAK,EAAE;;8DAAgB;AAtGpB,6BAA6B;IADlC,aAAa,CAAC,kCAAkC,CAAC;GAC5C,6BAA6B,CAgJlC","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@things-factory/organization/dist-client/component/approval-line-view.js'\nimport '../components/activity-thread-timeline'\n\nimport { html, css, LitElement, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { connect } from 'pwa-helpers/connect-mixin'\n\nimport { ContextToolbarOverlayStyle } from '@operato/context/ox-context-toolbar-overlay-style.js'\nimport { store } from '@operato/shell'\nimport { i18next } from '@operato/i18n'\n\nfunction getSafeFormatter(locale: string, options: Intl.DateTimeFormatOptions): Intl.DateTimeFormat {\n try {\n const safeLocale = locale || 'en-US'\n return new Intl.DateTimeFormat(safeLocale, options)\n } catch (e) {\n console.warn(`Invalid locale or options provided: ${locale}, falling back to default en-US.`, e)\n return new Intl.DateTimeFormat('en-US', options)\n }\n}\n\nconst formatter = getSafeFormatter(navigator.language, { dateStyle: 'full', timeStyle: 'short' })\n@customElement('activity-thread-context-template')\nclass ActivityThreadContextTemplate extends connect(store)(LitElement) {\n static styles = [\n ContextToolbarOverlayStyle,\n css`\n :host {\n background-color: var(--md-sys-color-surface);\n width: 100%;\n min-width: 450px;\n max-height: 100%;\n overflow: auto;\n --context-ui-padding: 0;\n }\n\n :host([state='unassigned']) {\n --worklist-status-color: #5f7184;\n }\n\n :host([state='assigned']) {\n --worklist-status-color: #5f7184;\n }\n\n :host([state='started']) {\n --worklist-status-color: #56af45;\n }\n\n :host([state='delegated']) {\n --worklist-status-color: #8654b0;\n }\n\n :host([state='submitted']) {\n --worklist-status-color: #428df3;\n }\n\n :host([state='escalated']) {\n --worklist-status-color: #595de5;\n }\n\n :host([state='rejected']) {\n --worklist-status-color: #f27429;\n }\n\n :host([state='ended']) {\n --worklist-status-color: #02acae;\n }\n\n :host([state='aborted']) {\n --worklist-status-color: #cb3a33;\n }\n\n :host:before {\n content: '';\n position: absolute;\n width: 0;\n height: 0;\n border: 22px solid transparent;\n border-left-color: var(--worklist-status-color);\n border-right: 0;\n }\n\n div[info] {\n padding: var(--spacing-medium);\n border-bottom: var(--border-dim-color);\n color: var(--md-sys-color-secondary);\n\n div {\n display: flex;\n align-items: center;\n padding: var(--spacing-small);\n border-radius: var(--border-radius);\n text-align: right;\n clear: both;\n overflow: hidden;\n }\n\n div:nth-child(odd) {\n background-color: var(--md-sys-color-background);\n }\n\n label {\n display: inline-block;\n width: 25%;\n text-align: right;\n margin-right: 20px;\n }\n\n span {\n width: 15px;\n height: 15px;\n background-color: var(--worklist-status-color, tomato);\n display: inline-block;\n border-radius: 50%;\n }\n }\n\n activity-thread-timeline {\n margin: var(--spacing-medium);\n }\n `\n ]\n\n @property({ type: Object }) private activityThread\n\n @state() private context\n\n render() {\n const activityThread = this.context.activityThread || this.activityThread || {}\n\n const { state, round, dueAt, assignedAt, terminatedAt, assignee, activityInstance, activityApprovals } =\n activityThread || {}\n const { name, description, approvalLine } = activityInstance || {}\n\n return html`\n <div flow>\n <div approval-line>\n ${approvalLine ? html` <approval-line-view .model=${approvalLine}></approval-line-view> ` : html``}\n </div>\n </div>\n\n <div info>\n <div><label>${i18next.t('field.name')}</label> <strong>${name}</strong></div>\n <div><label>${i18next.t('field.description')}</label> ${description}</div>\n <div>\n <label>${i18next.t('field.status')}</label> <span></span> <strong\n >${i18next.t('label.activity-state-' + state)}</strong\n >\n </div>\n <div><label>${i18next.t('field.round')}</label> <strong>${round}</strong></div>\n <div><label>${i18next.t('field.assignee')}</label> <strong>${assignee?.name}</strong></div>\n <div>\n <label>${i18next.t('field.assigned-at')}</label> ${assignedAt && formatter.format(new Date(assignedAt))}\n </div>\n <div><label>${i18next.t('field.due-at')}</label> ${dueAt && formatter.format(new Date(dueAt))}</div>\n <div>\n <label>${i18next.t('field.terminated-at')}</label> ${terminatedAt && formatter.format(new Date(terminatedAt))}\n </div>\n </div>\n\n <activity-thread-timeline .activityThread=${activityThread} short-form></activity-thread-timeline>\n `\n }\n\n stateChanged(state) {\n this.context = state.route.context\n }\n}\n"]}
|