@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.
- package/client/components/activity-approval-timeline.ts +149 -0
- package/client/pages/activity-approval/activity-approval-page.ts +37 -134
- package/client/pages/activity-thread/activity-thread-page.ts +11 -3
- package/client/pages/activity-thread/activity-thread-view-page.ts +15 -8
- package/client/pages/activity-thread/activity-thread-view.ts +6 -114
- 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 +145 -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 +36 -129
- package/dist-client/pages/activity-approval/activity-approval-page.js.map +1 -1
- package/dist-client/pages/activity-thread/activity-thread-page.js +10 -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 +13 -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/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/package.json +9 -9
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
2
|
import '@material/mwc-icon';
|
|
3
3
|
import '@things-factory/organization/dist-client/component/approval-line-view.js';
|
|
4
|
+
import '../components/activity-approval-timeline';
|
|
4
5
|
import { html, css, LitElement, nothing } from 'lit';
|
|
5
6
|
import { customElement, property, state } from 'lit/decorators.js';
|
|
6
7
|
import { connect } from 'pwa-helpers/connect-mixin';
|
|
@@ -15,41 +16,21 @@ let ActivityThreadContextTemplate = class ActivityThreadContextTemplate extends
|
|
|
15
16
|
const { name, description, thumbnail, approvalLine } = activityInstance || {};
|
|
16
17
|
return html `
|
|
17
18
|
<div flow>
|
|
18
|
-
<div approval-line>
|
|
19
|
-
${approvalLine ? html ` <approval-line-view .model=${approvalLine}></approval-line-view> ` : html ``}
|
|
20
|
-
</div>
|
|
19
|
+
<div approval-line>${approvalLine ? html ` <approval-line-view .model=${approvalLine}></approval-line-view> ` : html ``}</div>
|
|
21
20
|
</div>
|
|
22
21
|
|
|
23
22
|
<div info>
|
|
24
23
|
<div><label>${i18next.t('field.name')}</label> <strong>${name}</strong></div>
|
|
25
24
|
<div><label>${i18next.t('field.description')}</label> ${description}</div>
|
|
26
|
-
<div>
|
|
27
|
-
<label>${i18next.t('field.status')}</label> <span></span> <strong
|
|
28
|
-
>${i18next.t('label.activity-state-' + state)}</strong
|
|
29
|
-
>
|
|
30
|
-
</div>
|
|
25
|
+
<div><label>${i18next.t('field.status')}</label> <span></span> <strong>${i18next.t('label.activity-state-' + state)}</strong></div>
|
|
31
26
|
<div><label>${i18next.t('field.round')}</label> <strong>${round}</strong></div>
|
|
32
27
|
<div><label>${i18next.t('field.assignee')}</label> <strong>${assignee === null || assignee === void 0 ? void 0 : assignee.name}</strong></div>
|
|
33
|
-
<div>
|
|
34
|
-
<label>${i18next.t('field.assigned-at')}</label> ${assignedAt && formatter.format(new Date(assignedAt))}
|
|
35
|
-
</div>
|
|
28
|
+
<div><label>${i18next.t('field.assigned-at')}</label> ${assignedAt && formatter.format(new Date(assignedAt))}</div>
|
|
36
29
|
<div><label>${i18next.t('field.due-at')}</label> ${dueAt && formatter.format(new Date(dueAt))}</div>
|
|
37
|
-
<div>
|
|
38
|
-
<label>${i18next.t('field.terminated-at')}</label> ${terminatedAt && formatter.format(new Date(terminatedAt))}
|
|
39
|
-
</div>
|
|
30
|
+
<div><label>${i18next.t('field.terminated-at')}</label> ${terminatedAt && formatter.format(new Date(terminatedAt))}</div>
|
|
40
31
|
</div>
|
|
41
32
|
|
|
42
|
-
${activityApprovals && activityApprovals.length > 0
|
|
43
|
-
? html `
|
|
44
|
-
<div timeline>
|
|
45
|
-
<span subtitle>${i18next.t('label.review-and-approval')}</span>
|
|
46
|
-
|
|
47
|
-
<ol>
|
|
48
|
-
${activityApprovals.map(approval => this.renderActivityApproval(approval))}
|
|
49
|
-
</ol>
|
|
50
|
-
</div>
|
|
51
|
-
`
|
|
52
|
-
: nothing}
|
|
33
|
+
${activityApprovals && activityApprovals.length > 0 ? html ` <activity-approval-timeline .activityThread=${activityThread}></activity-approval-timeline> ` : nothing}
|
|
53
34
|
${thumbnail
|
|
54
35
|
? html ` <div thumbnail>
|
|
55
36
|
<img src=${thumbnail} />
|
|
@@ -57,21 +38,6 @@ let ActivityThreadContextTemplate = class ActivityThreadContextTemplate extends
|
|
|
57
38
|
: html ``}
|
|
58
39
|
`;
|
|
59
40
|
}
|
|
60
|
-
renderActivityApproval(activityApproval) {
|
|
61
|
-
const { judgment, approver, comment, round, order, createdAt, terminatedAt } = activityApproval;
|
|
62
|
-
const { name, email } = approver || {};
|
|
63
|
-
return html `
|
|
64
|
-
<li>
|
|
65
|
-
<span date>${formatter.format(new Date(terminatedAt || createdAt))}</span>
|
|
66
|
-
<span status></span>
|
|
67
|
-
<span info>
|
|
68
|
-
${i18next.t('label.activity-state-' + (judgment || 'started'))}
|
|
69
|
-
<strong><mwc-icon>account_circle</mwc-icon>${name}</strong>
|
|
70
|
-
<p>${comment}</p>
|
|
71
|
-
</span>
|
|
72
|
-
</li>
|
|
73
|
-
`;
|
|
74
|
-
}
|
|
75
41
|
stateChanged(state) {
|
|
76
42
|
this.context = state.route.context;
|
|
77
43
|
}
|
|
@@ -83,6 +49,7 @@ ActivityThreadContextTemplate.styles = [
|
|
|
83
49
|
background-color: var(--theme-white-color);
|
|
84
50
|
width: 100%;
|
|
85
51
|
min-width: 450px;
|
|
52
|
+
max-height: 100%;
|
|
86
53
|
overflow: auto;
|
|
87
54
|
--context-ui-padding: 0;
|
|
88
55
|
}
|
|
@@ -119,121 +86,49 @@ ActivityThreadContextTemplate.styles = [
|
|
|
119
86
|
--worklist-status-color: #cb3a33;
|
|
120
87
|
}
|
|
121
88
|
|
|
122
|
-
|
|
123
|
-
|
|
89
|
+
:host:before {
|
|
90
|
+
content: '';
|
|
91
|
+
position: absolute;
|
|
92
|
+
width: 0;
|
|
93
|
+
height: 0;
|
|
94
|
+
border: 22px solid transparent;
|
|
95
|
+
border-left-color: var(--worklist-status-color);
|
|
96
|
+
border-right: 0;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
div[info] {
|
|
124
100
|
padding: var(--padding-default);
|
|
125
101
|
border-bottom: var(--border-dark-color);
|
|
126
102
|
color: var(--secondary-color);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
div[info] div {
|
|
130
|
-
display: flex;
|
|
131
|
-
align-items: center;
|
|
132
|
-
padding: var(--padding-narrow);
|
|
133
|
-
border-radius: var(--border-radius);
|
|
134
|
-
text-align: right;
|
|
135
|
-
clear: both;
|
|
136
|
-
overflow: hidden;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
div[info] div:nth-child(odd) {
|
|
140
|
-
background-color: var(--main-section-background-color);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
div[info] label {
|
|
144
|
-
display: inline-block;
|
|
145
|
-
width: 25%;
|
|
146
|
-
text-align: right;
|
|
147
|
-
margin-right: 20px;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
div[info] span {
|
|
151
|
-
width: 15px;
|
|
152
|
-
height: 15px;
|
|
153
|
-
background-color: var(--worklist-status-color, tomato);
|
|
154
|
-
display: inline-block;
|
|
155
|
-
border-radius: 50%;
|
|
156
|
-
}
|
|
157
103
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
flex: initial;
|
|
187
|
-
width: 130px;
|
|
188
|
-
font-size: var(--fontsize-small);
|
|
189
|
-
color: var(--primary-text-color);
|
|
190
|
-
}
|
|
191
|
-
[timeline] [info] strong {
|
|
192
|
-
float: right;
|
|
193
|
-
}
|
|
194
|
-
[timeline] [status] {
|
|
195
|
-
margin: 0 var(--margin-narrow);
|
|
196
|
-
display: block;
|
|
197
|
-
border-radius: 50%;
|
|
198
|
-
flex: initial;
|
|
199
|
-
width: 12px;
|
|
200
|
-
height: 12px;
|
|
201
|
-
position: relative;
|
|
202
|
-
top: 3px;
|
|
203
|
-
border: 2px solid #fff;
|
|
204
|
-
background-color: var(--worklist-status-color, tomato);
|
|
205
|
-
color: var(--primary-text-color);
|
|
206
|
-
}
|
|
207
|
-
[timeline] [status]::before {
|
|
208
|
-
content: '';
|
|
209
|
-
height: 60px;
|
|
210
|
-
width: 2px;
|
|
211
|
-
display: block;
|
|
212
|
-
position: relative;
|
|
213
|
-
margin-left: 5px;
|
|
214
|
-
background-color: var(--worklist-status-color, tomato);
|
|
215
|
-
opacity: 0.2;
|
|
216
|
-
}
|
|
217
|
-
[timeline] [info] mwc-icon {
|
|
218
|
-
position: relative;
|
|
219
|
-
top: 3px;
|
|
220
|
-
font-size: var(--fontsize-large);
|
|
221
|
-
}
|
|
222
|
-
[timeline] [info] p {
|
|
223
|
-
background-color: #f4f4f4;
|
|
224
|
-
margin: var(--margin-narrow) 0 var(--margin-default) 0;
|
|
225
|
-
padding: var(--padding-narrow) var(--padding-default);
|
|
226
|
-
font-size: var(--fontsize-small);
|
|
227
|
-
text-align: justify;
|
|
228
|
-
}
|
|
229
|
-
[timeline] [info] p::before {
|
|
230
|
-
content: '';
|
|
231
|
-
float: right;
|
|
232
|
-
margin-top: -10px;
|
|
233
|
-
margin-right: 20px;
|
|
234
|
-
border: 7px solid transparent;
|
|
235
|
-
border-bottom-color: #f4f4f4;
|
|
236
|
-
border-top: 0;
|
|
104
|
+
div {
|
|
105
|
+
display: flex;
|
|
106
|
+
align-items: center;
|
|
107
|
+
padding: var(--padding-narrow);
|
|
108
|
+
border-radius: var(--border-radius);
|
|
109
|
+
text-align: right;
|
|
110
|
+
clear: both;
|
|
111
|
+
overflow: hidden;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
div:nth-child(odd) {
|
|
115
|
+
background-color: var(--main-section-background-color);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
label {
|
|
119
|
+
display: inline-block;
|
|
120
|
+
width: 25%;
|
|
121
|
+
text-align: right;
|
|
122
|
+
margin-right: 20px;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
span {
|
|
126
|
+
width: 15px;
|
|
127
|
+
height: 15px;
|
|
128
|
+
background-color: var(--worklist-status-color, tomato);
|
|
129
|
+
display: inline-block;
|
|
130
|
+
border-radius: 50%;
|
|
131
|
+
}
|
|
237
132
|
}
|
|
238
133
|
|
|
239
134
|
[thumbnail] {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity-thread-context-template.js","sourceRoot":"","sources":["../../client/templ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E,GAAG,gBAAgB,CAAA;QAC/F,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,QAAQ,IAAI,EAAE,CAAA;QAEtC,OAAO,IAAI,CAAA;;qBAEM,SAAS,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,YAAY,IAAI,SAAU,CAAC,CAAC;;;YAG/D,OAAO,CAAC,CAAC,CAAC,uBAAuB,GAAG,CAAC,QAAQ,IAAI,SAAS,CAAC,CAAC;uDACjB,IAAI;eAC5C,OAAO;;;KAGjB,CAAA;IACH,CAAC;IAED,YAAY,CAAC,KAAK;QAChB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,CAAA;IACpC,CAAC;;AAzPM,oCAAM,GAAG;IACd,0BAA0B;IAC1B,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAyKF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qEAAuB;AAElD;IAAC,KAAK,EAAE;;8DAAgB;AAjLpB,6BAA6B;IADlC,aAAa,CAAC,kCAAkC,CAAC;GAC5C,6BAA6B,CA2PlC","sourcesContent":["import '@material/mwc-icon'\nimport '@things-factory/organization/dist-client/component/approval-line-view.js'\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\nimport { ActivityApproval } from '../types/activity-approval'\n\nconst formatter = new Intl.DateTimeFormat(navigator.language, { dateStyle: 'full', timeStyle: 'short' })\n\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(--theme-white-color);\n width: 100%;\n min-width: 450px;\n overflow: auto;\n --context-ui-padding: 0;\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 div[info],\n [assignees] {\n padding: var(--padding-default);\n border-bottom: var(--border-dark-color);\n color: var(--secondary-color);\n }\n\n div[info] div {\n display: flex;\n align-items: center;\n padding: var(--padding-narrow);\n border-radius: var(--border-radius);\n text-align: right;\n clear: both;\n overflow: hidden;\n }\n\n div[info] div:nth-child(odd) {\n background-color: var(--main-section-background-color);\n }\n\n div[info] label {\n display: inline-block;\n width: 25%;\n text-align: right;\n margin-right: 20px;\n }\n\n div[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 div[timeline] {\n margin-bottom: var(--margin-default);\n padding: var(--padding-default);\n }\n div[timeline] [subtitle] {\n padding: var(--padding-narrow) var(--padding-default);\n background-color: var(--theme-white-color);\n border: 2px solid var(--secondary-text-color);\n border-radius: 15px;\n box-shadow: var(--box-shadow);\n color: var(--secondary-text-color);\n font-weight: bold;\n }\n div[timeline] ol {\n list-style: none;\n margin: var(--margin-default) 0 0 var(--margin-narrow);\n padding: 0;\n }\n [timeline] li {\n display: flex;\n border: none;\n }\n [timeline] [info] {\n flex: 1;\n color: initial;\n }\n [timeline] [date] {\n opacity: 0.7;\n flex: initial;\n width: 130px;\n font-size: var(--fontsize-small);\n color: var(--primary-text-color);\n }\n [timeline] [info] strong {\n float: right;\n }\n [timeline] [status] {\n margin: 0 var(--margin-narrow);\n display: block;\n border-radius: 50%;\n flex: initial;\n width: 12px;\n height: 12px;\n position: relative;\n top: 3px;\n border: 2px solid #fff;\n background-color: var(--worklist-status-color, tomato);\n color: var(--primary-text-color);\n }\n [timeline] [status]::before {\n content: '';\n height: 60px;\n width: 2px;\n display: block;\n position: relative;\n margin-left: 5px;\n background-color: var(--worklist-status-color, tomato);\n opacity: 0.2;\n }\n [timeline] [info] mwc-icon {\n position: relative;\n top: 3px;\n font-size: var(--fontsize-large);\n }\n [timeline] [info] p {\n background-color: #f4f4f4;\n margin: var(--margin-narrow) 0 var(--margin-default) 0;\n padding: var(--padding-narrow) var(--padding-default);\n font-size: var(--fontsize-small);\n text-align: justify;\n }\n [timeline] [info] p::before {\n content: '';\n float: right;\n margin-top: -10px;\n margin-right: 20px;\n border: 7px solid transparent;\n border-bottom-color: #f4f4f4;\n border-top: 0;\n }\n\n [thumbnail] {\n display: flex;\n justify-content: center;\n align-items: center;\n margin: var(--margin-default);\n }\n\n img {\n max-width: 85%;\n height: auto;\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, thumbnail, 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 ${activityApprovals && activityApprovals.length > 0\n ? html`\n <div timeline>\n <span subtitle>${i18next.t('label.review-and-approval')}</span>\n\n <ol>\n ${activityApprovals.map(approval => this.renderActivityApproval(approval))}\n </ol>\n </div>\n `\n : nothing}\n ${thumbnail\n ? html` <div thumbnail>\n <img src=${thumbnail} />\n </div>`\n : html``}\n `\n }\n\n renderActivityApproval(activityApproval: ActivityApproval) {\n const { judgment, approver, comment, round, order, createdAt, terminatedAt } = activityApproval\n const { name, email } = approver || {}\n\n return html`\n <li>\n <span date>${formatter.format(new Date(terminatedAt || createdAt!))}</span>\n <span status></span>\n <span info>\n ${i18next.t('label.activity-state-' + (judgment || 'started'))}\n <strong><mwc-icon>account_circle</mwc-icon>${name}</strong>\n <p>${comment}</p>\n </span>\n </li>\n `\n }\n\n stateChanged(state) {\n this.context = state.route.context\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"activity-thread-context-template.js","sourceRoot":"","sources":["../../client/templates/activity-thread-context-template.ts"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,CAAA;AAC3B,OAAO,0EAA0E,CAAA;AACjF,OAAO,0CAA0C,CAAA;AAEjD,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,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,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,IAAI;sBAC7D,OAAO,CAAC,CAAC,CAAC,mBAAmB,CAAC,YAAY,UAAU,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC;sBAC9F,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC,YAAY,KAAK,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;sBAC/E,OAAO,CAAC,CAAC,CAAC,qBAAqB,CAAC,YAAY,YAAY,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC;;;QAGlH,iBAAiB,IAAI,iBAAiB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA,gDAAgD,cAAc,iCAAiC,CAAC,CAAC,CAAC,OAAO;QACjK,SAAS;YACT,CAAC,CAAC,IAAI,CAAA;uBACS,SAAS;iBACf;YACT,CAAC,CAAC,IAAI,CAAA,EAAE;KACX,CAAA;IACH,CAAC;IAED,YAAY,CAAC,KAAK;QAChB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,CAAA;IACpC,CAAC;;AA5IM,oCAAM,GAAG;IACd,0BAA0B;IAC1B,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAkGF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qEAAuB;AAElD;IAAC,KAAK,EAAE;;8DAAgB;AA1GpB,6BAA6B;IADlC,aAAa,CAAC,kCAAkC,CAAC;GAC5C,6BAA6B,CA8IlC","sourcesContent":["import '@material/mwc-icon'\nimport '@things-factory/organization/dist-client/component/approval-line-view.js'\nimport '../components/activity-approval-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\nconst formatter = new Intl.DateTimeFormat(navigator.language, { dateStyle: 'full', timeStyle: 'short' })\n\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(--theme-white-color);\n width: 100%;\n min-width: 450px;\n max-height: 100%;\n overflow: auto;\n --context-ui-padding: 0;\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(--padding-default);\n border-bottom: var(--border-dark-color);\n color: var(--secondary-color);\n\n div {\n display: flex;\n align-items: center;\n padding: var(--padding-narrow);\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(--main-section-background-color);\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 [thumbnail] {\n display: flex;\n justify-content: center;\n align-items: center;\n margin: var(--margin-default);\n }\n\n img {\n max-width: 85%;\n height: auto;\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 } = activityThread || {}\n const { name, description, thumbnail, approvalLine } = activityInstance || {}\n\n return html`\n <div flow>\n <div approval-line>${approvalLine ? html` <approval-line-view .model=${approvalLine}></approval-line-view> ` : html``}</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><label>${i18next.t('field.status')}</label> <span></span> <strong>${i18next.t('label.activity-state-' + state)}</strong></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><label>${i18next.t('field.assigned-at')}</label> ${assignedAt && formatter.format(new Date(assignedAt))}</div>\n <div><label>${i18next.t('field.due-at')}</label> ${dueAt && formatter.format(new Date(dueAt))}</div>\n <div><label>${i18next.t('field.terminated-at')}</label> ${terminatedAt && formatter.format(new Date(terminatedAt))}</div>\n </div>\n\n ${activityApprovals && activityApprovals.length > 0 ? html` <activity-approval-timeline .activityThread=${activityThread}></activity-approval-timeline> ` : nothing}\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"]}
|