@things-factory/worklist 6.2.96 → 6.2.98

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/client/components/activity-approval-timeline.ts +147 -0
  2. package/client/pages/activity-approval/activity-approval-page.ts +41 -145
  3. package/client/pages/activity-thread/activity-thread-page.ts +16 -3
  4. package/client/pages/activity-thread/activity-thread-view-page.ts +20 -8
  5. package/client/pages/activity-thread/activity-thread-view.ts +6 -114
  6. package/client/pages/todo/approval-done-list-page.ts +2 -1
  7. package/client/pages/todo/approval-pending-list-page.ts +17 -6
  8. package/client/pages/todo/done-list-page.ts +7 -2
  9. package/client/pages/todo/draft-list-page.ts +11 -1
  10. package/client/pages/todo/pickable-list-page.ts +25 -10
  11. package/client/pages/todo/todo-list-page.ts +10 -5
  12. package/client/templates/activity-approval-context-template.ts +8 -13
  13. package/client/templates/activity-instance-context-template.ts +16 -18
  14. package/client/templates/activity-thread-context-template.ts +47 -157
  15. package/dist-client/components/activity-approval-timeline.d.ts +18 -0
  16. package/dist-client/components/activity-approval-timeline.js +143 -0
  17. package/dist-client/components/activity-approval-timeline.js.map +1 -0
  18. package/dist-client/pages/activity-approval/activity-approval-page.d.ts +1 -2
  19. package/dist-client/pages/activity-approval/activity-approval-page.js +40 -137
  20. package/dist-client/pages/activity-approval/activity-approval-page.js.map +1 -1
  21. package/dist-client/pages/activity-thread/activity-thread-page.js +15 -3
  22. package/dist-client/pages/activity-thread/activity-thread-page.js.map +1 -1
  23. package/dist-client/pages/activity-thread/activity-thread-view-page.d.ts +1 -0
  24. package/dist-client/pages/activity-thread/activity-thread-view-page.js +18 -4
  25. package/dist-client/pages/activity-thread/activity-thread-view-page.js.map +1 -1
  26. package/dist-client/pages/activity-thread/activity-thread-view.d.ts +0 -2
  27. package/dist-client/pages/activity-thread/activity-thread-view.js +6 -101
  28. package/dist-client/pages/activity-thread/activity-thread-view.js.map +1 -1
  29. package/dist-client/pages/todo/approval-done-list-page.js +2 -1
  30. package/dist-client/pages/todo/approval-done-list-page.js.map +1 -1
  31. package/dist-client/pages/todo/approval-pending-list-page.js +14 -3
  32. package/dist-client/pages/todo/approval-pending-list-page.js.map +1 -1
  33. package/dist-client/pages/todo/done-list-page.js +7 -2
  34. package/dist-client/pages/todo/done-list-page.js.map +1 -1
  35. package/dist-client/pages/todo/draft-list-page.js +10 -1
  36. package/dist-client/pages/todo/draft-list-page.js.map +1 -1
  37. package/dist-client/pages/todo/pickable-list-page.js +19 -1
  38. package/dist-client/pages/todo/pickable-list-page.js.map +1 -1
  39. package/dist-client/pages/todo/todo-list-page.js +7 -2
  40. package/dist-client/pages/todo/todo-list-page.js.map +1 -1
  41. package/dist-client/templates/activity-approval-context-template.d.ts +1 -0
  42. package/dist-client/templates/activity-approval-context-template.js +8 -13
  43. package/dist-client/templates/activity-approval-context-template.js.map +1 -1
  44. package/dist-client/templates/activity-instance-context-template.js +15 -16
  45. package/dist-client/templates/activity-instance-context-template.js.map +1 -1
  46. package/dist-client/templates/activity-thread-context-template.d.ts +1 -0
  47. package/dist-client/templates/activity-thread-context-template.js +46 -151
  48. package/dist-client/templates/activity-thread-context-template.js.map +1 -1
  49. package/dist-client/tsconfig.tsbuildinfo +1 -1
  50. package/dist-server/service/activity-approval/activity-approval-mutation.js +0 -3
  51. package/dist-server/service/activity-approval/activity-approval-mutation.js.map +1 -1
  52. package/dist-server/tsconfig.tsbuildinfo +1 -1
  53. package/package.json +3 -3
  54. package/server/service/activity-approval/activity-approval-mutation.ts +3 -19
@@ -1,6 +1,7 @@
1
1
  import { __decorate, __metadata } from "tslib";
2
2
  import '@material/mwc-icon';
3
- import { html, css, LitElement } from 'lit';
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>&nbsp;<strong
29
- >${i18next.t('label.activity-state-' + state)}</strong
30
- >
31
- </div>
26
+ <div><label>${i18next.t('field.status')}</label> <span></span>&nbsp;<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;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;AAEvC,OAAO,0EAA0E,CAAA;AAEjF,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAA;AAGxG,IAAM,+BAA+B,GAArC,MAAM,+BAAgC,SAAQ,OAAO,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC;IA4GtE,MAAM;QACJ,MAAM,gBAAgB,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,IAAI,IAAI,CAAC,gBAAgB,IAAI,EAAE,CAAA;QAErF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AK,CAAC,CAAC;oCACjE,SAAS,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC;;;QAG9E,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;;AAtJM,sCAAM,GAAG;IACd,0BAA0B;IAC1B,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAkGF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;yEAAyB;AAEpD;IAAC,KAAK,EAAE;;gEAAgB;AA1GpB,+BAA+B;IADpC,aAAa,CAAC,oCAAoC,CAAC;GAC9C,+BAA+B,CAwJpC","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'\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 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 } = 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>&nbsp;<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.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>\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>since</label> ${createdAt && formatter.format(new Date(createdAt))}</div>\n </div>\n\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"]}
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,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAA;AAGxG,IAAM,+BAA+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AC,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>&nbsp;<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
- <label>${i18next.t('field.status')}</label> <span></span>&nbsp;<strong
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>&nbsp;<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,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAA;AAGxG,IAAM,+BAA+B,GAArC,MAAM,+BAAgC,SAAQ,OAAO,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC;IAiJtE,MAAM;QACJ,MAAM,gBAAgB,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,IAAI,IAAI,CAAC,gBAAgB,IAAI,EAAE,CAAA;QACrF,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,GAC5G,gBAAgB,IAAI,EAAE,CAAA;QACxB,MAAM,EAAE,YAAY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AE,CAAA;QACtB,CAAC;;OAEJ,EACD;YACE,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,yCAAyC;YAC/C,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,+BAA+B,CAAC;SAClD,CACF,CAAA;QACD,KAAK,CAAC,QAAQ,GAAG,GAAG,EAAE,GAAE,CAAC,CAAA;IAC3B,CAAC;;AAlQM,sCAAM,GAAG;IACd,0BAA0B;IAC1B,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAuIF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;yEAAyB;AAEpD;IAAC,KAAK,EAAE;;gEAAgB;AA/IpB,+BAA+B;IADpC,aAAa,CAAC,oCAAoC,CAAC;GAC9C,+BAA+B,CAoQpC","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 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>&nbsp;<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,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,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAA;AAGxG,IAAM,+BAA+B,GAArC,MAAM,+BAAgC,SAAQ,OAAO,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC;IA4JtE,MAAM;QACJ,MAA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AAG,EAAE,GAAE,CAAC,CAAA;IAC3B,CAAC;IAED,mBAAmB,CAAC,gBAAgB;QAClC,MAAM,EAAE,YAAY,EAAE,GAAG,gBAAgB,IAAI,EAAE,CAAA;QAE/C,MAAM,KAAK,GAAG,SAAS,CACrB,IAAI,CAAA;;mBAES,YAAY;6BACF,KAAK,CAAC,EAAE;YACzB,gBAAgB,CAAC,YAAY,GAAG,KAAK,CAAA;YACrC,IAAI,CAAC,aAAa,EAAE,CAAA;QACtB,CAAC;;OAEJ,EACD;YACE,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,yCAAyC;YAC/C,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,+BAA+B,CAAC;SAClD,CACF,CAAA;QACD,KAAK,CAAC,QAAQ,GAAG,GAAG,EAAE,GAAE,CAAC,CAAA;IAC3B,CAAC;;AAhQM,sCAAM,GAAG;IACd,0BAA0B;IAC1B,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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>&nbsp;<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"]}
@@ -1,2 +1,3 @@
1
1
  import '@material/mwc-icon';
2
2
  import '@things-factory/organization/dist-client/component/approval-line-view.js';
3
+ import '../components/activity-approval-timeline';
@@ -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>&nbsp;<strong
28
- >${i18next.t('label.activity-state-' + state)}</strong
29
- >
30
- </div>
25
+ <div><label>${i18next.t('field.status')}</label> <span></span>&nbsp;<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
- div[info],
123
- [assignees] {
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
- div[timeline] {
159
- margin-bottom: var(--margin-default);
160
- padding: var(--padding-default);
161
- }
162
- div[timeline] [subtitle] {
163
- padding: var(--padding-narrow) var(--padding-default);
164
- background-color: var(--theme-white-color);
165
- border: 2px solid var(--secondary-text-color);
166
- border-radius: 15px;
167
- box-shadow: var(--box-shadow);
168
- color: var(--secondary-text-color);
169
- font-weight: bold;
170
- }
171
- div[timeline] ol {
172
- list-style: none;
173
- margin: var(--margin-default) 0 0 var(--margin-narrow);
174
- padding: 0;
175
- }
176
- [timeline] li {
177
- display: flex;
178
- border: none;
179
- }
180
- [timeline] [info] {
181
- flex: 1;
182
- color: initial;
183
- }
184
- [timeline] [date] {
185
- opacity: 0.7;
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/templates/activity-thread-context-template.ts"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,CAAA;AAC3B,OAAO,0EAA0E,CAAA;AAEjF,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;AAIvC,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAA;AAGxG,IAAM,6BAA6B,GAAnC,MAAM,6BAA8B,SAAQ,OAAO,CAAC,KAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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>&nbsp;<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,EAAE,MAAM,sDAAsD,CAAA;AACjG,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAA;AAGxG,IAAM,6BAA6B,GAAnC,MAAM,6BAA8B,SAAQ,OAAO,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC;IA4GpE,MAAM;QACJ,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,IAAI,IAAI,CAAC,cAAc,IAAI,EAAE,CAAA;QAE/E,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,GAAG,cAAc,IAAI,EAAE,CAAA;QAC7H,MAAM,EAAE,IAAI,EAAE,WAAW,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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>&nbsp;<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"]}