@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
|
@@ -10,15 +10,12 @@ import { ActivityThread } from '../../types/activity-thread';
|
|
|
10
10
|
const formatter = new Intl.DateTimeFormat(navigator.language, { dateStyle: 'short', timeStyle: 'short' });
|
|
11
11
|
let ActivityThreadView = class ActivityThreadView extends localize(i18next)(LitElement) {
|
|
12
12
|
render() {
|
|
13
|
-
var _a;
|
|
14
13
|
if (!this.activityThread) {
|
|
15
14
|
return html `<div>no activity thread info.</div>`;
|
|
16
15
|
}
|
|
17
|
-
const { state, assignee, output, round,
|
|
18
|
-
const { input
|
|
16
|
+
const { state, assignee, output, round, assignedAt, startedAt, terminatedAt, activityInstance } = this.activityThread;
|
|
17
|
+
const { input } = activityInstance;
|
|
19
18
|
const { name, email } = assignee || {};
|
|
20
|
-
const approvals = activityApprovals.sort((a, b) => a.round < b.round ? 1 : a.round > b.round ? -1 : a.order < b.order ? 1 : -1);
|
|
21
|
-
const current = ((_a = approvals[0]) === null || _a === void 0 ? void 0 : _a.round) == round ? approvals[0].order : -1;
|
|
22
19
|
return html `
|
|
23
20
|
<div assignee>
|
|
24
21
|
<mwc-icon>account_circle</mwc-icon>
|
|
@@ -32,13 +29,9 @@ let ActivityThreadView = class ActivityThreadView extends localize(i18next)(LitE
|
|
|
32
29
|
<span status></span>
|
|
33
30
|
<strong>${i18next.t('label.activity-state-' + state)}</strong>
|
|
34
31
|
</div>
|
|
35
|
-
<div>
|
|
36
|
-
<label>${i18next.t('field.assigned-at')}</label> ${assignedAt && formatter.format(new Date(assignedAt))}
|
|
37
|
-
</div>
|
|
32
|
+
<div><label>${i18next.t('field.assigned-at')}</label> ${assignedAt && formatter.format(new Date(assignedAt))}</div>
|
|
38
33
|
<div><label>${i18next.t('field.started-at')}</label> ${startedAt && formatter.format(new Date(startedAt))}</div>
|
|
39
|
-
<div>
|
|
40
|
-
<label>${i18next.t('field.terminated-at')}</label> ${terminatedAt && formatter.format(new Date(terminatedAt))}
|
|
41
|
-
</div>
|
|
34
|
+
<div><label>${i18next.t('field.terminated-at')}</label> ${terminatedAt && formatter.format(new Date(terminatedAt))}</div>
|
|
42
35
|
<div><label>${i18next.t('field.round')}</label> ${round}</div>
|
|
43
36
|
</div>
|
|
44
37
|
|
|
@@ -46,34 +39,6 @@ let ActivityThreadView = class ActivityThreadView extends localize(i18next)(LitE
|
|
|
46
39
|
<span subtitle>${i18next.t('field.artifact')}</span>
|
|
47
40
|
${this.renderInOut(Object.assign(Object.assign({}, input), output))}
|
|
48
41
|
</div>
|
|
49
|
-
<div timeline>
|
|
50
|
-
<span subtitle>${i18next.t('label.review-and-approval')}</span>
|
|
51
|
-
|
|
52
|
-
<div>
|
|
53
|
-
${approvalLine
|
|
54
|
-
? html `<approval-line-view .model=${approvalLine} .current=${current}></approval-line-view>`
|
|
55
|
-
: html ``}
|
|
56
|
-
</div>
|
|
57
|
-
|
|
58
|
-
<ol>
|
|
59
|
-
${approvals.map(approval => this.renderActivityApproval(approval))}
|
|
60
|
-
</ol>
|
|
61
|
-
</div>
|
|
62
|
-
`;
|
|
63
|
-
}
|
|
64
|
-
renderActivityApproval(activityApproval) {
|
|
65
|
-
const { judgment, approver, comment, round, order, createdAt, terminatedAt } = activityApproval;
|
|
66
|
-
const { name, email } = approver || {};
|
|
67
|
-
return html `
|
|
68
|
-
<li>
|
|
69
|
-
<span date>${formatter.format(new Date(terminatedAt || createdAt))}</span>
|
|
70
|
-
<span status></span>
|
|
71
|
-
<span info>
|
|
72
|
-
${i18next.t('label.activity-state-' + (judgment || 'started'))}
|
|
73
|
-
<strong><mwc-icon>account_circle</mwc-icon>${name}</strong>
|
|
74
|
-
<p>${comment}</p>
|
|
75
|
-
</span>
|
|
76
|
-
</li>
|
|
77
42
|
`;
|
|
78
43
|
}
|
|
79
44
|
renderInOut(data) {
|
|
@@ -294,74 +259,14 @@ ActivityThreadView.styles = [
|
|
|
294
259
|
font: bold 16px var(--theme-font);
|
|
295
260
|
color: var(--secondary-text-color);
|
|
296
261
|
}
|
|
297
|
-
|
|
298
|
-
list-style: none;
|
|
299
|
-
margin: 0;
|
|
300
|
-
padding: 0;
|
|
301
|
-
}
|
|
302
|
-
[timeline] li {
|
|
303
|
-
display: flex;
|
|
304
|
-
}
|
|
305
|
-
[timeline] [info] {
|
|
306
|
-
flex: 1;
|
|
307
|
-
}
|
|
308
|
-
[timeline] [date] {
|
|
309
|
-
opacity: 0.7;
|
|
310
|
-
width: 130px;
|
|
311
|
-
font-size: var(--fontsize-small);
|
|
312
|
-
}
|
|
313
|
-
[timeline] [info] strong {
|
|
314
|
-
float: right;
|
|
315
|
-
}
|
|
316
|
-
[timeline] [status] {
|
|
317
|
-
margin: 0 var(--margin-narrow);
|
|
318
|
-
display: block;
|
|
319
|
-
border-radius: 50%;
|
|
320
|
-
width: 12px;
|
|
321
|
-
height: 12px;
|
|
322
|
-
position: relative;
|
|
323
|
-
top: 3px;
|
|
324
|
-
border: 2px solid #fff;
|
|
325
|
-
background-color: var(--worklist-status-color, tomato);
|
|
326
|
-
}
|
|
327
|
-
[timeline] [status]::before {
|
|
328
|
-
content: '';
|
|
329
|
-
height: 60px;
|
|
330
|
-
width: 2px;
|
|
331
|
-
display: block;
|
|
332
|
-
position: relative;
|
|
333
|
-
margin-left: 5px;
|
|
334
|
-
background-color: var(--worklist-status-color, tomato);
|
|
335
|
-
opacity: 0.2;
|
|
336
|
-
}
|
|
337
|
-
[timeline] [info] mwc-icon {
|
|
338
|
-
position: relative;
|
|
339
|
-
top: 3px;
|
|
340
|
-
font-size: var(--fontsize-large);
|
|
341
|
-
}
|
|
342
|
-
[timeline] [info] p {
|
|
343
|
-
background-color: #f4f4f4;
|
|
344
|
-
margin: var(--margin-narrow) 0 var(--margin-default) 0;
|
|
345
|
-
padding: var(--padding-narrow) var(--padding-default);
|
|
346
|
-
border-radius: var(--border-radius);
|
|
347
|
-
font-size: var(--fontsize-small);
|
|
348
|
-
text-align: justify;
|
|
349
|
-
}
|
|
350
|
-
[timeline] [info] p::before {
|
|
351
|
-
content: '';
|
|
352
|
-
float: right;
|
|
353
|
-
margin-top: -10px;
|
|
354
|
-
margin-right: 20px;
|
|
355
|
-
border: 7px solid transparent;
|
|
356
|
-
border-bottom-color: #f4f4f4;
|
|
357
|
-
border-top: 0;
|
|
358
|
-
}
|
|
262
|
+
|
|
359
263
|
[thread] div {
|
|
360
264
|
border-bottom: var(--border-dark-color);
|
|
361
265
|
padding: var(--padding-narrow);
|
|
362
266
|
text-align: right;
|
|
363
267
|
overflow: hidden;
|
|
364
268
|
}
|
|
269
|
+
|
|
365
270
|
[thread] div label {
|
|
366
271
|
float: left;
|
|
367
272
|
width: 25%;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity-thread-view.js","sourceRoot":"","sources":["../../../client/pages/activity-thread/activity-thread-view.ts"],"names":[],"mappings":";AAAA,OAAO,0EAA0E,CAAA;AAEjF,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAS,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAEzE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEjD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAG5D,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAA;AAGlG,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;IAwLnE,MAAM;;QACJ,IAAI,CAAC,IAAI,CA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA0KF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC;QACR,IAAI,EAAE,MAAM;QACZ,SAAS,EAAE,oBAAoB;KAChC,CAAC;;4DACuB;AAEzB;IAAC,KAAK,EAAE;8BAAkB,cAAc;0DAAA;AAtL7B,kBAAkB;IAD9B,aAAa,CAAC,sBAAsB,CAAC;GACzB,kBAAkB,CAuY9B;SAvYY,kBAAkB","sourcesContent":["import '@things-factory/organization/dist-client/component/approval-line-view.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { ScrollbarStyles } from '@operato/styles'\n\nimport { ActivityThread } from '../../types/activity-thread'\nimport { ActivityApproval } from '../../types/activity-approval'\n\nconst formatter = new Intl.DateTimeFormat(navigator.language, { dateStyle: 'short', timeStyle: 'short' })\n\n@customElement('activity-thread-view')\nexport class ActivityThreadView extends localize(i18next)(LitElement) {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n overflow: auto;\n font-size: var(--fontsize-default);\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 [instance-container] {\n flex: 1;\n background-color: var(--main-section-background-color);\n border-right: var(--border-dark-color);\n padding: var(--padding-wide);\n color: var(--primary-text-color);\n }\n [thread-container] {\n flex: 2;\n padding: var(--padding-wide);\n }\n [instance-container] div {\n margin-bottom: var(--margin-default);\n padding-bottom: var(--padding-default);\n border-bottom: var(--border-dark-color);\n }\n [instance-container] div label {\n display: inline-block;\n margin-right: var(--margin-default);\n }\n span[status] {\n width: 15px;\n height: 15px;\n background-color: var(--worklist-status-color, tomato);\n display: inline-block;\n margin-right: var(--margin-narrow);\n border-radius: 50%;\n }\n table {\n width: 100%;\n border-collapse: collapse;\n }\n th {\n background-color: rgba(var(--primary-color-rgb), 0.05);\n border-top: var(--grid-header-top-border);\n border-bottom: var(--grid-header-bottom-border);\n padding: var(--grid-header-padding);\n text-overflow: ellipsis;\n font: var(--grid-header-font);\n color: var(--grid-header-color);\n }\n td {\n padding: var(--padding-narrow);\n border-bottom: var(--grid-record-border-bottom);\n }\n [assignee] * {\n vertical-align: middle;\n }\n [assignee] mwc-icon {\n opacity: 0.5;\n }\n [subtitle] {\n display: block;\n margin: var(--margin-wide) 0 var(--margin-narrow) 0;\n font: bold 16px var(--theme-font);\n color: var(--secondary-text-color);\n }\n [timeline] ol {\n list-style: none;\n margin: 0;\n padding: 0;\n }\n [timeline] li {\n display: flex;\n }\n [timeline] [info] {\n flex: 1;\n }\n [timeline] [date] {\n opacity: 0.7;\n width: 130px;\n font-size: var(--fontsize-small);\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 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 }\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 border-radius: var(--border-radius);\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 [thread] div {\n border-bottom: var(--border-dark-color);\n padding: var(--padding-narrow);\n text-align: right;\n overflow: hidden;\n }\n [thread] div label {\n float: left;\n width: 25%;\n text-align: left;\n }\n `\n ]\n\n @property({\n type: String,\n attribute: 'activity-thread-id'\n })\n activityThreadId?: string\n\n @state() activityThread?: ActivityThread\n\n render() {\n if (!this.activityThread) {\n return html`<div>no activity thread info.</div>`\n }\n\n const {\n state,\n assignee,\n output,\n round,\n activityApprovals = [],\n assignedAt,\n startedAt,\n terminatedAt,\n activityInstance\n } = this.activityThread\n const { input, approvalLine } = activityInstance!\n const { name, email } = assignee || {}\n const approvals = activityApprovals.sort((a, b) =>\n a.round < b.round ? 1 : a.round > b.round ? -1 : a.order! < b.order! ? 1 : -1\n )\n const current = approvals[0]?.round == round ? approvals[0].order : -1\n\n return html`\n <div assignee>\n <mwc-icon>account_circle</mwc-icon>\n <strong>${name}</strong>\n </div>\n\n <div thread>\n <span subtitle>${i18next.t('label.information')}</span>\n <div>\n <label>${i18next.t('label.status')}</label>\n <span status></span>\n <strong>${i18next.t('label.activity-state-' + state)}</strong>\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.started-at')}</label> ${startedAt && formatter.format(new Date(startedAt))}</div>\n <div>\n <label>${i18next.t('field.terminated-at')}</label> ${terminatedAt && formatter.format(new Date(terminatedAt))}\n </div>\n <div><label>${i18next.t('field.round')}</label> ${round}</div>\n </div>\n\n <div>\n <span subtitle>${i18next.t('field.artifact')}</span>\n ${this.renderInOut({ ...input, ...output })}\n </div>\n <div timeline>\n <span subtitle>${i18next.t('label.review-and-approval')}</span>\n\n <div>\n ${approvalLine\n ? html`<approval-line-view .model=${approvalLine} .current=${current}></approval-line-view>`\n : html``}\n </div>\n\n <ol>\n ${approvals.map(approval => this.renderActivityApproval(approval))}\n </ol>\n </div>\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 renderInOut(data) {\n const { activity } = this.activityThread!.activityInstance!\n const { model } = activity || {}\n\n return html`\n <table>\n <tr>\n <th>${i18next.t('label.name')}</th>\n <th>${i18next.t('label.value')}</th>\n </tr>\n ${model?.map(\n item => html`\n <tr>\n <td>${item.name}</td>\n <td>${item.tag ? data[item.tag] : ''}</td>\n </tr>\n `\n )}\n </table>\n `\n }\n\n updated(changes) {\n if (changes.has('activityThreadId')) {\n this.fetchActivityThread()\n }\n }\n\n async fetchActivityThread() {\n const id = this.activityThreadId\n\n const response = await client.query({\n query: gql`\n query ($id: String!) {\n activityThread(id: $id) {\n state\n transaction\n output\n assignee {\n id\n name\n email\n }\n round\n activityApprovals {\n round\n order\n approver {\n name\n email\n }\n judgment\n comment\n createdAt\n terminatedAt\n }\n assignedAt\n startedAt\n terminatedAt\n updater {\n id\n name\n }\n activityInstance {\n id\n name\n description\n state\n key01\n key02\n key03\n key04\n key05\n input\n output\n activity {\n id\n name\n description\n searchKeys {\n name\n description\n inputKey\n tKey\n }\n model {\n name\n description\n active\n tag\n inout\n type\n unit\n options\n quantifier\n spec\n }\n }\n approvalLine {\n type\n value\n approver {\n id\n name\n description\n controlNo\n }\n }\n assignedAt\n startedAt\n terminatedAt\n updatedAt\n }\n }\n }\n `,\n variables: {\n id\n }\n })\n\n this.activityThread = response.data.activityThread\n this.setAttribute('state', this.activityThread?.state || '')\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"activity-thread-view.js","sourceRoot":"","sources":["../../../client/pages/activity-thread/activity-thread-view.ts"],"names":[],"mappings":";AAAA,OAAO,0EAA0E,CAAA;AAEjF,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAS,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAEzE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEjD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAG5D,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAA;AAGlG,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;IA4HnE,MAAM;QACJ,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE;YACxB,OAAO,IAAI,CAAA,qCAAqC,CAAA;SACjD;QAED,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAC,cAAc,CAAA;QACrH,MAAM,EAAE,KAAK,EAAE,GAAG,gBAAiB,CAAA;QACnC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,Q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I,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE;;WAEvC,CACF;;KAEJ,CAAA;IACH,CAAC;IAED,OAAO,CAAC,OAAO;QACb,IAAI,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,EAAE;YACnC,IAAI,CAAC,mBAAmB,EAAE,CAAA;SAC3B;IACH,CAAC;IAED,KAAK,CAAC,mBAAmB;;QACvB,MAAM,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAA;QAEhC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;YAClC,KAAK,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmFT;YACD,SAAS,EAAE;gBACT,EAAE;aACH;SACF,CAAC,CAAA;QAEF,IAAI,CAAC,cAAc,GAAG,QAAQ,CAAC,IAAI,CAAC,cAAc,CAAA;QAClD,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAA,MAAA,IAAI,CAAC,cAAc,0CAAE,KAAK,KAAI,EAAE,CAAC,CAAA;IAC9D,CAAC;;AAzRM,yBAAM,GAAG;IACd,eAAe;IACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8GF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC;QACR,IAAI,EAAE,MAAM;QACZ,SAAS,EAAE,oBAAoB;KAChC,CAAC;;4DACuB;AAEzB;IAAC,KAAK,EAAE;8BAAkB,cAAc;0DAAA;AA1H7B,kBAAkB;IAD9B,aAAa,CAAC,sBAAsB,CAAC;GACzB,kBAAkB,CA2R9B;SA3RY,kBAAkB","sourcesContent":["import '@things-factory/organization/dist-client/component/approval-line-view.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { ScrollbarStyles } from '@operato/styles'\n\nimport { ActivityThread } from '../../types/activity-thread'\nimport { ActivityApproval } from '../../types/activity-approval'\n\nconst formatter = new Intl.DateTimeFormat(navigator.language, { dateStyle: 'short', timeStyle: 'short' })\n\n@customElement('activity-thread-view')\nexport class ActivityThreadView extends localize(i18next)(LitElement) {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n overflow: auto;\n font-size: var(--fontsize-default);\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 [instance-container] {\n flex: 1;\n background-color: var(--main-section-background-color);\n border-right: var(--border-dark-color);\n padding: var(--padding-wide);\n color: var(--primary-text-color);\n }\n [thread-container] {\n flex: 2;\n padding: var(--padding-wide);\n }\n [instance-container] div {\n margin-bottom: var(--margin-default);\n padding-bottom: var(--padding-default);\n border-bottom: var(--border-dark-color);\n }\n [instance-container] div label {\n display: inline-block;\n margin-right: var(--margin-default);\n }\n span[status] {\n width: 15px;\n height: 15px;\n background-color: var(--worklist-status-color, tomato);\n display: inline-block;\n margin-right: var(--margin-narrow);\n border-radius: 50%;\n }\n table {\n width: 100%;\n border-collapse: collapse;\n }\n th {\n background-color: rgba(var(--primary-color-rgb), 0.05);\n border-top: var(--grid-header-top-border);\n border-bottom: var(--grid-header-bottom-border);\n padding: var(--grid-header-padding);\n text-overflow: ellipsis;\n font: var(--grid-header-font);\n color: var(--grid-header-color);\n }\n td {\n padding: var(--padding-narrow);\n border-bottom: var(--grid-record-border-bottom);\n }\n [assignee] * {\n vertical-align: middle;\n }\n [assignee] mwc-icon {\n opacity: 0.5;\n }\n [subtitle] {\n display: block;\n margin: var(--margin-wide) 0 var(--margin-narrow) 0;\n font: bold 16px var(--theme-font);\n color: var(--secondary-text-color);\n }\n\n [thread] div {\n border-bottom: var(--border-dark-color);\n padding: var(--padding-narrow);\n text-align: right;\n overflow: hidden;\n }\n\n [thread] div label {\n float: left;\n width: 25%;\n text-align: left;\n }\n `\n ]\n\n @property({\n type: String,\n attribute: 'activity-thread-id'\n })\n activityThreadId?: string\n\n @state() activityThread?: ActivityThread\n\n render() {\n if (!this.activityThread) {\n return html`<div>no activity thread info.</div>`\n }\n\n const { state, assignee, output, round, assignedAt, startedAt, terminatedAt, activityInstance } = this.activityThread\n const { input } = activityInstance!\n const { name, email } = assignee || {}\n\n return html`\n <div assignee>\n <mwc-icon>account_circle</mwc-icon>\n <strong>${name}</strong>\n </div>\n\n <div thread>\n <span subtitle>${i18next.t('label.information')}</span>\n <div>\n <label>${i18next.t('label.status')}</label>\n <span status></span>\n <strong>${i18next.t('label.activity-state-' + state)}</strong>\n </div>\n <div><label>${i18next.t('field.assigned-at')}</label> ${assignedAt && formatter.format(new Date(assignedAt))}</div>\n <div><label>${i18next.t('field.started-at')}</label> ${startedAt && formatter.format(new Date(startedAt))}</div>\n <div><label>${i18next.t('field.terminated-at')}</label> ${terminatedAt && formatter.format(new Date(terminatedAt))}</div>\n <div><label>${i18next.t('field.round')}</label> ${round}</div>\n </div>\n\n <div>\n <span subtitle>${i18next.t('field.artifact')}</span>\n ${this.renderInOut({ ...input, ...output })}\n </div>\n `\n }\n\n renderInOut(data) {\n const { activity } = this.activityThread!.activityInstance!\n const { model } = activity || {}\n\n return html`\n <table>\n <tr>\n <th>${i18next.t('label.name')}</th>\n <th>${i18next.t('label.value')}</th>\n </tr>\n ${model?.map(\n item => html`\n <tr>\n <td>${item.name}</td>\n <td>${item.tag ? data[item.tag] : ''}</td>\n </tr>\n `\n )}\n </table>\n `\n }\n\n updated(changes) {\n if (changes.has('activityThreadId')) {\n this.fetchActivityThread()\n }\n }\n\n async fetchActivityThread() {\n const id = this.activityThreadId\n\n const response = await client.query({\n query: gql`\n query ($id: String!) {\n activityThread(id: $id) {\n state\n transaction\n output\n assignee {\n id\n name\n email\n }\n round\n activityApprovals {\n round\n order\n approver {\n name\n email\n }\n judgment\n comment\n createdAt\n terminatedAt\n }\n assignedAt\n startedAt\n terminatedAt\n updater {\n id\n name\n }\n activityInstance {\n id\n name\n description\n state\n key01\n key02\n key03\n key04\n key05\n input\n output\n activity {\n id\n name\n description\n searchKeys {\n name\n description\n inputKey\n tKey\n }\n model {\n name\n description\n active\n tag\n inout\n type\n unit\n options\n quantifier\n spec\n }\n }\n approvalLine {\n type\n value\n approver {\n id\n name\n description\n controlNo\n }\n }\n assignedAt\n startedAt\n terminatedAt\n updatedAt\n }\n }\n }\n `,\n variables: {\n id\n }\n })\n\n this.activityThread = response.data.activityThread\n this.setAttribute('state', this.activityThread?.state || '')\n }\n}\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
2
|
import '@material/mwc-icon';
|
|
3
|
-
import
|
|
3
|
+
import '../components/activity-approval-timeline';
|
|
4
|
+
import { html, css, LitElement, nothing } from 'lit';
|
|
4
5
|
import { customElement, property, state } from 'lit/decorators.js';
|
|
5
6
|
import { connect } from 'pwa-helpers/connect-mixin';
|
|
6
7
|
import { ContextToolbarOverlayStyle } from '@operato/context/ox-context-toolbar-overlay-style.js';
|
|
@@ -12,34 +13,27 @@ let ActivityApprovalContextTemplate = class ActivityApprovalContextTemplate exte
|
|
|
12
13
|
render() {
|
|
13
14
|
const activityApproval = this.context.activityApproval || this.activityApproval || {};
|
|
14
15
|
const { round, order, approver, createdAt, activityThread } = activityApproval || {};
|
|
15
|
-
const { state, dueAt, assignedAt, assignee, activityInstance } = activityThread || {};
|
|
16
|
+
const { state, dueAt, assignedAt, assignee, activityInstance, activityApprovals } = activityThread || {};
|
|
16
17
|
const { name, description, thumbnail, approvalLine } = activityInstance || {};
|
|
17
18
|
return html `
|
|
18
19
|
<div flow>
|
|
19
|
-
<div approval-line>
|
|
20
|
-
${approvalLine ? html ` <approval-line-view .model=${approvalLine}></approval-line-view> ` : html ``}
|
|
21
|
-
</div>
|
|
20
|
+
<div approval-line>${approvalLine ? html ` <approval-line-view .model=${approvalLine}></approval-line-view> ` : html ``}</div>
|
|
22
21
|
</div>
|
|
23
22
|
|
|
24
23
|
<div info>
|
|
25
24
|
<div><label>${i18next.t('field.name')}</label> <strong>${name}</strong></div>
|
|
26
25
|
<div><label>${i18next.t('field.description')}</label> ${description}</div>
|
|
27
|
-
<div>
|
|
28
|
-
<label>${i18next.t('field.status')}</label> <span></span> <strong
|
|
29
|
-
>${i18next.t('label.activity-state-' + state)}</strong
|
|
30
|
-
>
|
|
31
|
-
</div>
|
|
26
|
+
<div><label>${i18next.t('field.status')}</label> <span></span> <strong>${i18next.t('label.activity-state-' + state)}</strong></div>
|
|
32
27
|
<div><label>${i18next.t('field.round')}</label> <strong>${round}</strong></div>
|
|
33
28
|
<div><label>${i18next.t('field.approval-order')}</label> <strong>${order}</strong></div>
|
|
34
29
|
<div><label>${i18next.t('field.assignee')}</label> <strong>${assignee === null || assignee === void 0 ? void 0 : assignee.name}</strong></div>
|
|
35
30
|
<div><label>${i18next.t('field.approver')}</label> <strong>${approver === null || approver === void 0 ? void 0 : approver.name}</strong></div>
|
|
36
|
-
<div>
|
|
37
|
-
<label>${i18next.t('field.assigned-at')}</label> ${assignedAt && formatter.format(new Date(assignedAt))}
|
|
38
|
-
</div>
|
|
31
|
+
<div><label>${i18next.t('field.assigned-at')}</label> ${assignedAt && formatter.format(new Date(assignedAt))}</div>
|
|
39
32
|
<div><label>${i18next.t('field.due-at')}</label> ${dueAt && formatter.format(new Date(dueAt))}</div>
|
|
40
33
|
<div><label>since</label> ${createdAt && formatter.format(new Date(createdAt))}</div>
|
|
41
34
|
</div>
|
|
42
35
|
|
|
36
|
+
${activityApprovals && activityApprovals.length > 0 ? html ` <activity-approval-timeline .activityThread=${activityThread}></activity-approval-timeline> ` : nothing}
|
|
43
37
|
${thumbnail
|
|
44
38
|
? html ` <div thumbnail>
|
|
45
39
|
<img src=${thumbnail} />
|
|
@@ -58,6 +52,7 @@ ActivityApprovalContextTemplate.styles = [
|
|
|
58
52
|
background-color: var(--theme-white-color);
|
|
59
53
|
width: 100%;
|
|
60
54
|
min-width: 450px;
|
|
55
|
+
max-height: 100%;
|
|
61
56
|
overflow: auto;
|
|
62
57
|
--context-ui-padding: 0;
|
|
63
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity-approval-context-template.js","sourceRoot":"","sources":["../../client/templates/activity-approval-context-template.ts"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"activity-approval-context-template.js","sourceRoot":"","sources":["../../client/templates/activity-approval-context-template.ts"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,CAAA;AAC3B,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,EAAE,MAAM,sDAAsD,CAAA;AACjG,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC,OAAO,0EAA0E,CAAA;AAEjF,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,SAAS,CA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AC,gBAAgB,CAAC,oBAAoB,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,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;oCACjE,SAAS,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC;;;QAG9E,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;;AAhJM,sCAAM,GAAG;IACd,0BAA0B;IAC1B,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAmGF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;yEAAyB;AAEpD;IAAC,KAAK,EAAE;;gEAAgB;AA3GpB,+BAA+B;IADpC,aAAa,CAAC,oCAAoC,CAAC;GAC9C,+BAA+B,CAkJpC","sourcesContent":["import '@material/mwc-icon'\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\nimport '@things-factory/organization/dist-client/component/approval-line-view.js'\n\nconst formatter = new Intl.DateTimeFormat(navigator.language, { dateStyle: 'full', timeStyle: 'short' })\n\n@customElement('activity-approval-context-template')\nclass ActivityApprovalContextTemplate 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 [info],\n [assignees] {\n padding: var(--padding-default);\n border-bottom: var(--border-dark-color);\n color: var(--secondary-color);\n }\n\n [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 [info] div:nth-child(odd) {\n background-color: var(--main-section-background-color);\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 [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 activityApproval\n\n @state() private context\n\n render() {\n const activityApproval = this.context.activityApproval || this.activityApproval || {}\n\n const { round, order, approver, createdAt, activityThread } = activityApproval || {}\n const { state, dueAt, assignedAt, 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.approval-order')}</label> <strong>${order}</strong></div>\n <div><label>${i18next.t('field.assignee')}</label> <strong>${assignee?.name}</strong></div>\n <div><label>${i18next.t('field.approver')}</label> <strong>${approver?.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>since</label> ${createdAt && formatter.format(new Date(createdAt))}</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"]}
|
|
@@ -25,23 +25,14 @@ let ActivityInstanceContextTemplate = class ActivityInstanceContextTemplate exte
|
|
|
25
25
|
@change=${e => (activityInstance.approvalLine = e.currentTarget.value)}
|
|
26
26
|
></approval-line-view>
|
|
27
27
|
`
|
|
28
|
-
: html `<mwc-icon-button
|
|
29
|
-
icon="group_add"
|
|
30
|
-
@click=${() => this.onClickApprovalLine(activityInstance)}
|
|
31
|
-
></mwc-icon-button>`}
|
|
28
|
+
: html `<mwc-icon-button icon="group_add" @click=${() => this.onClickApprovalLine(activityInstance)}></mwc-icon-button>`}
|
|
32
29
|
</div>
|
|
33
30
|
|
|
34
31
|
<div info>
|
|
35
32
|
<div><label>${i18next.t('field.name')}</label> <strong>${name}</strong></div>
|
|
36
33
|
<div><label>${i18next.t('field.description')}</label> ${description}</div>
|
|
37
|
-
<div>
|
|
38
|
-
|
|
39
|
-
>${i18next.t('label.activity-state-' + state)}</strong
|
|
40
|
-
>
|
|
41
|
-
</div>
|
|
42
|
-
<div>
|
|
43
|
-
<label>${i18next.t('field.assigned-at')}</label> ${assignedAt && formatter.format(new Date(assignedAt))}
|
|
44
|
-
</div>
|
|
34
|
+
<div><label>${i18next.t('field.status')}</label> <span></span> <strong>${i18next.t('label.activity-state-' + state)}</strong></div>
|
|
35
|
+
<div><label>${i18next.t('field.assigned-at')}</label> ${assignedAt && formatter.format(new Date(assignedAt))}</div>
|
|
45
36
|
<div><label>${i18next.t('field.due-at')}</label> ${dueAt && formatter.format(new Date(dueAt))}</div>
|
|
46
37
|
<div><label>${i18next.t('field.started-at')}</label> ${startedAt && formatter.format(new Date(startedAt))}</div>
|
|
47
38
|
</div>
|
|
@@ -58,10 +49,7 @@ let ActivityInstanceContextTemplate = class ActivityInstanceContextTemplate exte
|
|
|
58
49
|
@change=${e => (activityInstance.assignees = e.currentTarget.value)}
|
|
59
50
|
></assignees-view>
|
|
60
51
|
`
|
|
61
|
-
: html `<mwc-icon-button
|
|
62
|
-
icon="group_add"
|
|
63
|
-
@click=${() => this.onClickAssignees(activityInstance)}
|
|
64
|
-
></mwc-icon-button>`}
|
|
52
|
+
: html `<mwc-icon-button icon="group_add" @click=${() => this.onClickAssignees(activityInstance)}></mwc-icon-button>`}
|
|
65
53
|
</div>
|
|
66
54
|
</div>`
|
|
67
55
|
: html ``}
|
|
@@ -119,6 +107,7 @@ ActivityInstanceContextTemplate.styles = [
|
|
|
119
107
|
background-color: var(--theme-white-color);
|
|
120
108
|
width: 100%;
|
|
121
109
|
min-width: 450px;
|
|
110
|
+
max-height: 100%;
|
|
122
111
|
overflow: auto;
|
|
123
112
|
--context-ui-padding: 0;
|
|
124
113
|
}
|
|
@@ -155,6 +144,16 @@ ActivityInstanceContextTemplate.styles = [
|
|
|
155
144
|
--worklist-status-color: #cb3a33;
|
|
156
145
|
}
|
|
157
146
|
|
|
147
|
+
:host:before {
|
|
148
|
+
content: '';
|
|
149
|
+
position: absolute;
|
|
150
|
+
width: 0;
|
|
151
|
+
height: 0;
|
|
152
|
+
border: 22px solid transparent;
|
|
153
|
+
border-left-color: var(--worklist-status-color);
|
|
154
|
+
border-right: 0;
|
|
155
|
+
}
|
|
156
|
+
|
|
158
157
|
[info],
|
|
159
158
|
[assignees] {
|
|
160
159
|
padding: var(--padding-default);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity-instance-context-template.js","sourceRoot":"","sources":["../../client/templates/activity-instance-context-template.ts"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,CAAA;AAE3B,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,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,cAAc,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, 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\nconst formatter = new Intl.DateTimeFormat(navigator.language, { dateStyle: 'full', timeStyle: 'short' })\n\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(--theme-white-color);\n width: 100%;\n min-width: 450px;\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='pending-assignment']) {\n --worklist-status-color: #8654b0;\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 [info],\n [assignees] {\n padding: var(--padding-default);\n border-bottom: var(--border-dark-color);\n color: var(--secondary-color);\n }\n\n [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 [info] div:nth-child(odd) {\n background-color: var(--main-section-background-color);\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(--padding-default);\n color: var(--secondary-color);\n }\n\n section label {\n display: inline-block;\n width: 25%;\n margin-top: var(--margin-default);\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(--padding-narrow);\n width: 25%;\n text-align: left;\n }\n\n [assignees] mwc-icon-button {\n float: right;\n }\n\n section input {\n display: inline-block;\n width: 70%;\n border: var(--border-dark-color);\n border-width: 0 0 1px 0;\n margin-top: var(--margin-default);\n font-size: var(--fontsize-large);\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 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`<mwc-icon-button\n icon=\"group_add\"\n @click=${() => this.onClickApprovalLine(activityInstance)}\n ></mwc-icon-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`<mwc-icon-button\n icon=\"group_add\"\n @click=${() => this.onClickAssignees(activityInstance)}\n ></mwc-icon-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,oBAAoB,CAAA;AAE3B,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,2BAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAkJF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;yEAAyB;AAEpD;IAAC,KAAK,EAAE;;gEAAgB;AA1JpB,+BAA+B;IADpC,aAAa,CAAC,oCAAoC,CAAC;GAC9C,+BAA+B,CAkQpC","sourcesContent":["import '@material/mwc-icon'\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\nconst formatter = new Intl.DateTimeFormat(navigator.language, { dateStyle: 'full', timeStyle: 'short' })\n\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(--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='draft']) {\n --worklist-status-color: #5f7184;\n }\n\n :host([state='issued']) {\n --worklist-status-color: #56af45;\n }\n\n :host([state='pending-assignment']) {\n --worklist-status-color: #8654b0;\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(--padding-default);\n border-bottom: var(--border-dark-color);\n color: var(--secondary-color);\n }\n\n [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 [info] div:nth-child(odd) {\n background-color: var(--main-section-background-color);\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(--padding-default);\n color: var(--secondary-color);\n }\n\n section label {\n display: inline-block;\n width: 25%;\n margin-top: var(--margin-default);\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(--padding-narrow);\n width: 25%;\n text-align: left;\n }\n\n [assignees] mwc-icon-button {\n float: right;\n }\n\n section input {\n display: inline-block;\n width: 70%;\n border: var(--border-dark-color);\n border-width: 0 0 1px 0;\n margin-top: var(--margin-default);\n font-size: var(--fontsize-large);\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 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 } = 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`<mwc-icon-button icon=\"group_add\" @click=${() => this.onClickApprovalLine(activityInstance)}></mwc-icon-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><label>${i18next.t('field.status')}</label> <span></span> <strong>${i18next.t('label.activity-state-' + state)}</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.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`<mwc-icon-button icon=\"group_add\" @click=${() => this.onClickAssignees(activityInstance)}></mwc-icon-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"]}
|