@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
@@ -0,0 +1,143 @@
1
+ import { __decorate, __metadata } from "tslib";
2
+ import '@material/mwc-icon';
3
+ import '@things-factory/organization/dist-client/component/approval-line-view.js';
4
+ import { html, css, LitElement, nothing } from 'lit';
5
+ import { customElement, property } from 'lit/decorators.js';
6
+ import { connect } from 'pwa-helpers/connect-mixin';
7
+ import { store } from '@operato/shell';
8
+ import { i18next } from '@operato/i18n';
9
+ const formatter = new Intl.DateTimeFormat(navigator.language, { dateStyle: 'full', timeStyle: 'short' });
10
+ let ActivityApprovalTimeline = class ActivityApprovalTimeline extends connect(store)(LitElement) {
11
+ render() {
12
+ const { activityApprovals = [] } = this.activityThread || {};
13
+ return html ` ${activityApprovals.length > 0
14
+ ? html `
15
+ <span subtitle>${i18next.t('label.review-and-approval')}</span>
16
+
17
+ <ol>
18
+ ${activityApprovals.map(approval => this.renderActivityApproval(approval))}
19
+ </ol>
20
+ `
21
+ : nothing}`;
22
+ }
23
+ renderActivityApproval(activityApproval) {
24
+ const { judgment, approver, comment, createdAt, terminatedAt } = activityApproval;
25
+ const { name } = approver || {};
26
+ return html `
27
+ <li>
28
+ <span date>${formatter.format(new Date(terminatedAt || createdAt))}</span>
29
+ <span status></span>
30
+ <span info>
31
+ ${i18next.t('label.activity-state-' + (judgment || 'started'))}
32
+ <strong><mwc-icon>account_circle</mwc-icon>${name}</strong>
33
+ <p>${comment}</p>
34
+ </span>
35
+ </li>
36
+ `;
37
+ }
38
+ };
39
+ ActivityApprovalTimeline.styles = [
40
+ css `
41
+ :host {
42
+ display: block;
43
+ }
44
+
45
+ [subtitle] {
46
+ padding: var(--padding-narrow) var(--padding-default);
47
+ background-color: var(--theme-white-color);
48
+ border: 2px solid var(--secondary-text-color);
49
+ border-radius: 15px;
50
+ box-shadow: var(--box-shadow);
51
+ color: var(--secondary-text-color);
52
+ font-weight: bold;
53
+ }
54
+
55
+ ol {
56
+ list-style: none;
57
+ margin: var(--margin-default) 0 0 var(--margin-narrow);
58
+ padding: 0;
59
+ }
60
+
61
+ li {
62
+ display: flex;
63
+ border: none;
64
+ }
65
+
66
+ [info] {
67
+ flex: 1;
68
+ color: var(--secondary-color);
69
+
70
+ strong {
71
+ float: right;
72
+ }
73
+
74
+ mwc-icon {
75
+ position: relative;
76
+ top: 3px;
77
+ font-size: var(--fontsize-large);
78
+ }
79
+
80
+ p {
81
+ background-color: #f4f4f4;
82
+ margin: var(--margin-narrow) 0 var(--margin-default) 0;
83
+ padding: var(--padding-narrow) var(--padding-default);
84
+ font-size: var(--fontsize-small);
85
+ text-align: justify;
86
+ min-height: 20px;
87
+ }
88
+
89
+ p::before {
90
+ content: '';
91
+ float: right;
92
+ margin-top: -10px;
93
+ margin-right: 20px;
94
+ border: 7px solid transparent;
95
+ border-bottom-color: #f4f4f4;
96
+ border-top: 0;
97
+ }
98
+ }
99
+
100
+ [date] {
101
+ opacity: 0.7;
102
+ flex: initial;
103
+ width: 200px;
104
+ max-width: 30%;
105
+ font-size: var(--fontsize-small);
106
+ color: var(--primary-text-color);
107
+ }
108
+
109
+ [status] {
110
+ margin: 0 var(--margin-narrow);
111
+ display: block;
112
+ border-radius: 50%;
113
+ flex: initial;
114
+ width: 12px;
115
+ height: 12px;
116
+ position: relative;
117
+ top: 3px;
118
+ border: 2px solid #fff;
119
+ background-color: var(--worklist-status-color, tomato);
120
+ color: var(--primary-text-color);
121
+ }
122
+
123
+ [status]::before {
124
+ content: '';
125
+ height: 60px;
126
+ width: 2px;
127
+ display: block;
128
+ position: relative;
129
+ margin-left: 5px;
130
+ background-color: var(--worklist-status-color, tomato);
131
+ opacity: 0.2;
132
+ }
133
+ `
134
+ ];
135
+ __decorate([
136
+ property({ type: Object }),
137
+ __metadata("design:type", Object)
138
+ ], ActivityApprovalTimeline.prototype, "activityThread", void 0);
139
+ ActivityApprovalTimeline = __decorate([
140
+ customElement('activity-approval-timeline')
141
+ ], ActivityApprovalTimeline);
142
+ export { ActivityApprovalTimeline };
143
+ //# sourceMappingURL=activity-approval-timeline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activity-approval-timeline.js","sourceRoot":"","sources":["../../client/components/activity-approval-timeline.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,EA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,CAAA;IACH,CAAC;;AAhIM,+BAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA6FF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;gEAAuB;AAlGvC,wBAAwB;IADpC,aAAa,CAAC,4BAA4B,CAAC;GAC/B,wBAAwB,CAkIpC;SAlIY,wBAAwB","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 } from 'lit/decorators.js'\n\nimport { connect } from 'pwa-helpers/connect-mixin'\n\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-approval-timeline')\nexport class ActivityApprovalTimeline extends connect(store)(LitElement) {\n static styles = [\n css`\n :host {\n display: block;\n }\n\n [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\n ol {\n list-style: none;\n margin: var(--margin-default) 0 0 var(--margin-narrow);\n padding: 0;\n }\n\n li {\n display: flex;\n border: none;\n }\n\n [info] {\n flex: 1;\n color: var(--secondary-color);\n\n strong {\n float: right;\n }\n\n mwc-icon {\n position: relative;\n top: 3px;\n font-size: var(--fontsize-large);\n }\n\n 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 min-height: 20px;\n }\n\n 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\n [date] {\n opacity: 0.7;\n flex: initial;\n width: 200px;\n max-width: 30%;\n font-size: var(--fontsize-small);\n color: var(--primary-text-color);\n }\n\n [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\n [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 `\n ]\n\n @property({ type: Object }) private activityThread\n\n render() {\n const { activityApprovals = [] } = this.activityThread || {}\n\n return html` ${activityApprovals.length > 0\n ? html`\n <span subtitle>${i18next.t('label.review-and-approval')}</span>\n\n <ol>\n ${activityApprovals.map(approval => this.renderActivityApproval(approval))}\n </ol>\n `\n : nothing}`\n }\n\n renderActivityApproval(activityApproval: ActivityApproval) {\n const { judgment, approver, comment, createdAt, terminatedAt } = activityApproval\n const { name } = 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"]}
@@ -1,8 +1,8 @@
1
1
  import '@operato/property-editor/ox-properties-dynamic-view.js';
2
2
  import '@operato/board/ox-board-viewer.js';
3
3
  import '../../components/activity-approval-ribon.js';
4
+ import '../../components/activity-approval-timeline.js';
4
5
  import { PageView } from '@operato/shell';
5
- import { ActivityApproval } from '../../types/activity-approval.js';
6
6
  export declare const ActivityThreadStatus: {
7
7
  Assigned: string;
8
8
  Started: string;
@@ -39,7 +39,6 @@ export declare class ActivityApprovalPage extends ActivityApprovalPage_base {
39
39
  }[];
40
40
  };
41
41
  render(): import("lit-html").TemplateResult<1>;
42
- renderActivityApproval(activityApproval: ActivityApproval): import("lit-html").TemplateResult<1>;
43
42
  activityContent(): any;
44
43
  templateContent(): import("lit-html/directive.js").DirectiveResult<typeof import("lit-html/directives/unsafe-html.js").UnsafeHTMLDirective>;
45
44
  getInputSpec(): any;
@@ -2,8 +2,9 @@ import { __decorate, __metadata } from "tslib";
2
2
  import '@operato/property-editor/ox-properties-dynamic-view.js';
3
3
  import '@operato/board/ox-board-viewer.js';
4
4
  import '../../components/activity-approval-ribon.js';
5
+ import '../../components/activity-approval-timeline.js';
5
6
  import gql from 'graphql-tag';
6
- import { css, html } from 'lit';
7
+ import { css, html, nothing } from 'lit';
7
8
  import { unsafeHTML } from 'lit-html/directives/unsafe-html.js';
8
9
  import { customElement, query, state } from 'lit/decorators.js';
9
10
  import { keyed } from 'lit/directives/keyed.js';
@@ -13,7 +14,6 @@ import { i18next, localize } from '@operato/i18n';
13
14
  import { PageView, store } from '@operato/shell';
14
15
  import { CommonButtonStyles, ScrollbarStyles } from '@operato/styles';
15
16
  import { provider } from '@things-factory/board-ui';
16
- const formatter = new Intl.DateTimeFormat(navigator.language, { dateStyle: 'short', timeStyle: 'short' });
17
17
  const ActivityApprovalFetchResult = `\
18
18
  {
19
19
  id
@@ -26,6 +26,7 @@ const ActivityApprovalFetchResult = `\
26
26
  round
27
27
  order
28
28
  createdAt
29
+ terminatedAt
29
30
  activityThread {
30
31
  state
31
32
  dueAt
@@ -116,45 +117,27 @@ let ActivityApprovalPage = class ActivityApprovalPage extends connect(store)(loc
116
117
  render() {
117
118
  var _a;
118
119
  if (!this.activityThread) {
119
- return html `<div>no activity thread info.</div>`;
120
+ return html `<div empty>no activity thread info.</div>`;
120
121
  }
121
- const { activityApprovals = [] } = this.activityThread;
122
- const approvals = activityApprovals.sort((a, b) => (a.round > b.round ? 1 : a.round < b.round ? -1 : a.order > b.order ? 1 : -1)).slice(0, -1);
122
+ const { terminatedAt } = this.activityApproval;
123
+ const editable = !terminatedAt;
123
124
  return html `
124
125
  <activity-approval-ribon .activityApproval=${this.activityApproval}></activity-approval-ribon>
125
126
  ${this.activityContent()}
126
- <div comment>
127
- <div timeline>
128
- <span subtitle>${i18next.t('label.review-and-approval')}</span>
129
-
130
- <ol>
131
- ${approvals.map(approval => this.renderActivityApproval(approval))}
132
- </ol>
133
- </div>
134
-
135
- <textarea
136
- placeholder=${String(i18next.t('text.explain the reason for approval/rejection'))}
137
- .value=${(_a = this.activityApproval) === null || _a === void 0 ? void 0 : _a.comment}
138
- @change=${(e) => {
139
- this.activityApproval.comment = e.target.value;
140
- }}
141
- ></textarea>
142
- </div>
143
- `;
144
- }
145
- renderActivityApproval(activityApproval) {
146
- const { judgment, approver, comment, round, order, createdAt, terminatedAt } = activityApproval;
147
- const { name, email } = approver || {};
148
- return html `
149
- <li>
150
- <span date>${formatter.format(new Date(terminatedAt || createdAt))}</span>
151
- <span status></span>
152
- <span info>
153
- ${i18next.t('label.activity-state-' + (judgment || 'started'))}
154
- <strong><mwc-icon>account_circle</mwc-icon>${name}</strong>
155
- <p>${comment}</p>
156
- </span>
157
- </li>
127
+ <activity-approval-timeline .activityThread=${this.activityThread}></activity-approval-timeline>
128
+ ${editable
129
+ ? html `
130
+ <div comment>
131
+ <textarea
132
+ placeholder=${String(i18next.t('text.explain the reason for approval/rejection'))}
133
+ .value=${(_a = this.activityApproval) === null || _a === void 0 ? void 0 : _a.comment}
134
+ @change=${(e) => {
135
+ this.activityApproval.comment = e.target.value;
136
+ }}
137
+ ></textarea>
138
+ </div>
139
+ `
140
+ : nothing}
158
141
  `;
159
142
  }
160
143
  activityContent() {
@@ -338,18 +321,9 @@ let ActivityApprovalPage = class ActivityApprovalPage extends connect(store)(loc
338
321
  }
339
322
  async approveActivityApproval() {
340
323
  var { id, comment } = this.activityApproval;
341
- if (!comment) {
342
- document.dispatchEvent(new CustomEvent('notify', {
343
- detail: {
344
- message: i18next.t('text.enter a comment')
345
- }
346
- }));
347
- this.commentInput.focus();
348
- return;
349
- }
350
324
  const response = await client.mutate({
351
325
  mutation: gql `
352
- mutation ($id: String!, $comment: String!) {
326
+ mutation ($id: String!, $comment: String) {
353
327
  approveActivityApproval(id: $id, comment: $comment) ${ActivityApprovalFetchResult}
354
328
  }
355
329
  `,
@@ -412,106 +386,35 @@ ActivityApprovalPage.styles = [
412
386
  height: 100%;
413
387
  }
414
388
 
415
- #custom-content {
416
- overflow: auto;
389
+ activity-approval-timeline {
390
+ margin: var(--margin-default);
391
+ padding: var(--padding-default);
417
392
  }
418
393
 
419
394
  div[comment] {
420
395
  display: flex;
421
- flex-direction: column;
422
- width: 100%;
423
- right: 0;
396
+ position: sticky;
424
397
  bottom: 0;
425
398
  margin: 0;
426
399
  padding: 0;
427
- opacity: 0.8;
428
- margin-top: auto;
400
+ width: 100%;
401
+ background-color: var(--main-section-background-color);
429
402
 
430
- max-height: 40%;
403
+ textarea {
404
+ flex: 1;
405
+ margin: var(--margin-default);
406
+ padding: var(--input-padding);
407
+ font: var(--input-font);
408
+ outline: none;
409
+ height: 80px;
410
+ border-radius: 10px;
411
+ border: var(--input-field-border);
412
+ resize: none;
413
+ }
431
414
  }
432
415
 
433
- div[timeline] {
434
- margin-bottom: var(--margin-default);
435
- padding: var(--padding-default);
436
- border-bottom: var(--border-dark-color);
437
- overflow: auto;
438
- }
439
- div[timeline] [subtitle] {
440
- padding: var(--padding-narrow) var(--padding-default);
441
- background-color: var(--theme-white-color);
442
- border: 2px solid var(--secondary-text-color);
443
- border-radius: 15px;
444
- box-shadow: var(--box-shadow);
445
- color: var(--secondary-text-color);
446
- font-weight: bold;
447
- }
448
- div[timeline] ol {
449
- list-style: none;
450
- margin: var(--margin-default) 0 0 var(--margin-narrow);
451
- padding: 0;
452
- }
453
- [timeline] li {
454
- display: flex;
455
- }
456
- [timeline] [info] {
457
- flex: 1;
458
- }
459
- [timeline] [date] {
460
- opacity: 0.7;
461
- width: 130px;
462
- font-size: var(--fontsize-small);
463
- }
464
- [timeline] [info] strong {
465
- float: right;
466
- }
467
- [timeline] [status] {
468
- margin: 0 var(--margin-narrow);
469
- display: block;
470
- border-radius: 50%;
471
- width: 12px;
472
- height: 12px;
473
- position: relative;
474
- top: 3px;
475
- border: 2px solid #fff;
476
- background-color: var(--worklist-status-color, tomato);
477
- }
478
- [timeline] [status]::before {
479
- content: '';
480
- height: 60px;
481
- width: 2px;
482
- display: block;
483
- position: relative;
484
- margin-left: 5px;
485
- background-color: var(--worklist-status-color, tomato);
486
- opacity: 0.2;
487
- }
488
- [timeline] [info] mwc-icon {
489
- position: relative;
490
- top: 3px;
491
- font-size: var(--fontsize-large);
492
- }
493
- [timeline] [info] p {
494
- background-color: var(--theme-white-color);
495
- margin: var(--margin-narrow) 0 var(--margin-default) 0;
496
- padding: var(--padding-narrow) var(--padding-default);
497
- font-size: var(--fontsize-small);
498
- text-align: justify;
499
- }
500
- [timeline] [info] p::before {
501
- content: '';
502
- float: right;
503
- margin-top: -10px;
504
- margin-right: 20px;
505
- border: 7px solid transparent;
506
- border-bottom-color: #f4f4f4;
507
- border-top: 0;
508
- }
509
- div[comment] textarea {
510
- margin: 0 var(--margin-default) var(--margin-default) var(--margin-default);
511
- padding: var(--input-padding);
512
- resize: none;
513
- font: var(--input-font);
514
- outline: none;
416
+ div[empty] {
417
+ align-self: center;
515
418
  }
516
419
  `
517
420
  ];
@@ -1 +1 @@
1
- {"version":3,"file":"activity-approval-page.js","sourceRoot":"","sources":["../../../client/pages/activity-approval/activity-approval-page.ts"],"names":[],"mappings":";AAAA,OAAO,wDAAwD,CAAA;AAC/D,OAAO,mCAAmC,CAAA;AAC1C,OAAO,6CAA6C,CAAA;AAEpD,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAA;AAC/D,OAAO,EAAE,aA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e;IACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAqHF;CACF,CAAA;AAED;IAAC,KAAK,EAAE;;8DAAsB;AAC9B;IAAC,KAAK,EAAE;;4DAAoB;AAC5B;IAAC,KAAK,EAAE;;mDAAW;AAEnB;IAAC,KAAK,CAAC,UAAU,CAAC;8BAAgB,mBAAmB;0DAAA;AAkOrD;IAAC,KAAK,CAAC,iBAAiB,CAAC;;2DAAmB;AAjWjC,oBAAoB;IADhC,aAAa,CAAC,wBAAwB,CAAC;GAC3B,oBAAoB,CA+fhC;SA/fY,oBAAoB","sourcesContent":["import '@operato/property-editor/ox-properties-dynamic-view.js'\nimport '@operato/board/ox-board-viewer.js'\nimport '../../components/activity-approval-ribon.js'\n\nimport gql from 'graphql-tag'\nimport { css, html } from 'lit'\nimport { unsafeHTML } from 'lit-html/directives/unsafe-html.js'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { keyed } from 'lit/directives/keyed.js'\nimport { connect } from 'pwa-helpers/connect-mixin.js'\n\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { PageView, store } from '@operato/shell'\nimport { CommonButtonStyles, ScrollbarStyles } from '@operato/styles'\nimport { provider } from '@things-factory/board-ui'\nimport { ActivityApproval } from '../../types/activity-approval.js'\n\nconst formatter = new Intl.DateTimeFormat(navigator.language, { dateStyle: 'short', timeStyle: 'short' })\n\nconst ActivityApprovalFetchResult = `\\\n{\n id\n judgment\n comment\n approver {\n id\n name\n }\n round\n order\n createdAt\n activityThread {\n state\n dueAt\n assignedAt\n assignee {\n id\n name\n }\n updatedAt\n terminatedAt\n output\n activityApprovals {\n round\n order\n approver {\n name\n email\n }\n judgment\n comment\n createdAt\n terminatedAt\n }\n activityInstance {\n id\n name\n description\n state\n activity {\n id\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 thumbnail\n input\n output\n viewType\n viewSource\n dueAt\n createdAt\n } \n }\n}`\n\nexport const ActivityThreadStatus = {\n Assigned: 'assigned',\n Started: 'started',\n Delegated: 'delegated',\n Ended: 'ended',\n Aborted: 'aborted'\n}\n\n@customElement('activity-approval-page')\nexport class ActivityApprovalPage extends connect(store)(localize(i18next)(PageView)) {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n position: relative;\n\n width: 100%;\n overflow: auto;\n background-color: var(--main-section-background-color);\n }\n\n ox-board-viewer {\n width: 100%;\n height: 100%;\n }\n\n #custom-content {\n overflow: auto;\n }\n\n div[comment] {\n display: flex;\n flex-direction: column;\n width: 100%;\n right: 0;\n bottom: 0;\n margin: 0;\n padding: 0;\n opacity: 0.8;\n margin-top: auto;\n\n max-height: 40%;\n }\n\n div[timeline] {\n margin-bottom: var(--margin-default);\n padding: var(--padding-default);\n border-bottom: var(--border-dark-color);\n overflow: auto;\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 }\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: var(--theme-white-color);\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 div[comment] textarea {\n margin: 0 var(--margin-default) var(--margin-default) var(--margin-default);\n padding: var(--input-padding);\n resize: none;\n font: var(--input-font);\n outline: none;\n }\n `\n ]\n\n @state() activityApproval: any\n @state() activityThread: any\n @state() board: any\n\n @query('textarea') commentInput!: HTMLTextAreaElement\n\n get context() {\n const judgment = this.activityApproval?.judgment\n\n return {\n title: this.lifecycle?.params?.['title'] || i18next.t('title.activity approval'),\n help: 'worklist/activity-approval',\n actions: judgment\n ? []\n : [\n {\n title: i18next.t('button.reject'),\n action: this.rejectActivityApproval.bind(this),\n ...CommonButtonStyles.play\n },\n\n {\n title: i18next.t('button.approve'),\n action: this.approveActivityApproval.bind(this),\n ...CommonButtonStyles.save\n },\n\n {\n title: i18next.t('button.save'),\n action: this.saveActivityApproval.bind(this),\n ...CommonButtonStyles.save\n }\n ]\n // activityApproval: this.activityApproval\n }\n }\n\n render() {\n if (!this.activityThread) {\n return html`<div>no activity thread info.</div>`\n }\n\n const { activityApprovals = [] } = this.activityThread\n const approvals = activityApprovals.sort((a, b) => (a.round > b.round ? 1 : a.round < b.round ? -1 : a.order! > b.order! ? 1 : -1)).slice(0, -1)\n\n return html`\n <activity-approval-ribon .activityApproval=${this.activityApproval}></activity-approval-ribon>\n ${this.activityContent()}\n <div comment>\n <div timeline>\n <span subtitle>${i18next.t('label.review-and-approval')}</span>\n\n <ol>\n ${approvals.map(approval => this.renderActivityApproval(approval))}\n </ol>\n </div>\n\n <textarea\n placeholder=${String(i18next.t('text.explain the reason for approval/rejection'))}\n .value=${this.activityApproval?.comment}\n @change=${(e: Event) => {\n this.activityApproval.comment = (e.target as HTMLTextAreaElement).value\n }}\n ></textarea>\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 activityContent() {\n switch (this.activityThread?.activityInstance?.viewType) {\n case 'template':\n return this.templateContent()\n case 'generated':\n return this.generatedContent()\n case 'board':\n return this.boardContent()\n case 'custom-element':\n return this.customElementContent()\n case 'page':\n case 'external':\n return html``\n default:\n return this.generatedContent()\n }\n }\n\n templateContent() {\n if (!this.activityApproval) {\n return html``\n }\n\n const { viewSource: template } = this.activityThread?.activityInstance\n return unsafeHTML(template)\n }\n\n getInputSpec() {\n const model = this.activityThread?.activityInstance?.activity?.model\n\n return (model || [])\n .filter(item => item.inout === 'in' || item.inout === 'inout')\n .map(item => {\n return {\n ...item,\n name: item.tag,\n label: item.tKey || item.name,\n property: item.options\n }\n })\n }\n\n getOutputSpec() {\n const model = this.activityThread?.activityInstance?.activity?.model\n\n return (model || [])\n .filter(item => item.inout === 'inout' || item.inout === 'out')\n .map(item => {\n return {\n ...item,\n name: item.tag,\n label: item.tKey || item.name,\n property: item.options\n }\n })\n }\n\n generatedContent() {\n if (!this.activityApproval) {\n return html``\n }\n\n var { output, activityInstance } = this.activityThread || {}\n var { input } = activityInstance || {}\n\n const inputSpec = this.getInputSpec()\n const outputSpec = this.getOutputSpec()\n\n if (!output) {\n output = inputSpec\n .filter(item => item.inout === 'inout')\n .reduce((inout, item) => {\n inout[item.name] = input[item.name]\n return inout\n }, {})\n }\n\n return keyed(\n this.activityApproval.id,\n html`\n <fieldset>\n <legend>Input</legend>\n <ox-properties-dynamic-view data-name=\"input\" .props=${inputSpec} .value=${input}></ox-properties-dynamic-view>\n </fieldset>\n\n <fieldset>\n <legend>Output</legend>\n <ox-properties-dynamic-view\n data-name=\"output\"\n .props=${outputSpec}\n .value=${output}\n @property-change=${e => (this.activityApproval.output = e.currentTarget.value)}\n ></ox-properties-dynamic-view>\n </fieldset>\n `\n )\n }\n\n boardContent() {\n if (!this.activityApproval) {\n return html``\n }\n\n const { output, activityInstance } = this.activityThread\n const { viewSource: boardId, input } = activityInstance || {}\n\n if (!this.board || this.board.id !== boardId) {\n this.board = {\n id: boardId\n }\n }\n\n return keyed(\n this.activityApproval.id,\n html`\n <ox-board-viewer\n style=\"background-color: white;\"\n .board=${this.board}\n .provider=${provider}\n .values=${{ ...input, ...output }}\n hide-fullscreen\n hide-navigation\n ></ox-board-viewer>\n `\n )\n }\n\n customElementContent() {\n if (!this.activityApproval) {\n return html``\n }\n\n const { output, activityInstance } = this.activityThread\n const { viewSource: tagName, input } = activityInstance || {}\n\n const element = document.createElement(tagName)\n element.id = 'custom-content'\n element.activityId = activityInstance.activity.id\n element.input = input\n element.output = output\n element.activityApproval = this.activityApproval\n\n return element\n }\n\n @query('ox-board-viewer') oxBoardViewer: any\n\n getOutputFromBoard() {\n const outputSpec = this.getOutputSpec()\n const data = this.oxBoardViewer.getSceneValues()\n\n return outputSpec.reduce((output, spec) => {\n output[spec.name] = data[spec.name]\n return output\n }, {})\n }\n\n updated(changes) {\n if (changes.has('activityApproval')) {\n this.updateContext()\n }\n }\n\n async pageUpdated(changes, lifecycle, changedBefore) {\n if (this.active && lifecycle.resourceId) {\n this.fetchActivityApproval(lifecycle.resourceId)\n }\n }\n\n async fetchActivityApproval(id) {\n const response = await client.query({\n query: gql`\n query activityApproval($id: String!) {\n activityApproval(id: $id) ${ActivityApprovalFetchResult}\n }\n `,\n variables: {\n id\n }\n })\n\n this.activityApproval = response.data.activityApproval\n this.activityThread = this.activityApproval.activityThread\n\n this.updateContext()\n }\n\n async rejectActivityApproval() {\n var { id, comment } = this.activityApproval\n\n if (!comment) {\n document.dispatchEvent(\n new CustomEvent('notify', {\n detail: {\n message: i18next.t('text.enter a comment')\n }\n })\n )\n this.commentInput.focus()\n return\n }\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!, $comment: String!) {\n rejectActivityApproval(id: $id, comment: $comment) ${ActivityApprovalFetchResult}\n }\n `,\n variables: {\n id,\n comment\n }\n })\n\n if (!response.errors) {\n this.activityApproval = response.data.rejectActivityApproval\n this.activityThread = this.activityApproval.activityThread\n\n this.updateContext()\n\n document.dispatchEvent(\n new CustomEvent('notify', {\n detail: {\n message: i18next.t('text.task_is_rejected_successfully')\n }\n })\n )\n }\n }\n\n async approveActivityApproval() {\n var { id, comment } = this.activityApproval\n\n if (!comment) {\n document.dispatchEvent(\n new CustomEvent('notify', {\n detail: {\n message: i18next.t('text.enter a comment')\n }\n })\n )\n this.commentInput.focus()\n return\n }\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!, $comment: String!) {\n approveActivityApproval(id: $id, comment: $comment) ${ActivityApprovalFetchResult}\n }\n `,\n variables: {\n id,\n comment\n }\n })\n\n if (!response.errors) {\n this.activityApproval = response.data.approveActivityApproval\n this.activityThread = this.activityApproval.activityThread\n\n this.updateContext()\n\n document.dispatchEvent(\n new CustomEvent('notify', {\n detail: {\n message: i18next.t('text.task_is_approved_successfully')\n }\n })\n )\n }\n }\n\n async saveActivityApproval() {\n var { id, comment } = this.activityApproval\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!, $comment: String) {\n saveActivityApproval(id: $id, comment: $comment) ${ActivityApprovalFetchResult}\n }\n `,\n variables: {\n id,\n comment\n }\n })\n\n if (!response.errors) {\n this.activityApproval = response.data.saveActivityApproval\n this.activityThread = this.activityApproval.activityThread\n\n this.updateContext()\n\n document.dispatchEvent(\n new CustomEvent('notify', {\n detail: {\n message: i18next.t('text.task_is_saved_successfully')\n }\n })\n )\n }\n }\n}\n"]}
1
+ {"version":3,"file":"activity-approval-page.js","sourceRoot":"","sources":["../../../client/pages/activity-approval/activity-approval-page.ts"],"names":[],"mappings":";AAAA,OAAO,wDAAwD,CAAA;AAC/D,OAAO,mCAAmC,CAAA;AAC1C,OAAO,6CAA6C,CAAA;AACpD,OAAO,gDAAgD,CAAA;AAEvD,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AAEtD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAEnD,MAAM,2BAA2B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2ElC,CAAA;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;IACtB,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SA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B,IAAI,CAAC,gBAAgB,GAAG,QAAQ,CAAC,IAAI,CAAC,oBAAoB,CAAA;YAC1D,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAAA;YAE1D,IAAI,CAAC,aAAa,EAAE,CAAA;YAEpB,QAAQ,CAAC,aAAa,CACpB,IAAI,WAAW,CAAC,QAAQ,EAAE;gBACxB,MAAM,EAAE;oBACN,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,iCAAiC,CAAC;iBACtD;aACF,CAAC,CACH,CAAA;SACF;IACH,CAAC;;AAtZM,2BAAM,GAAG;IACd,eAAe;IACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8CF;CACF,CAAA;AAED;IAAC,KAAK,EAAE;;8DAAsB;AAC9B;IAAC,KAAK,EAAE;;4DAAoB;AAC5B;IAAC,KAAK,EAAE;;mDAAW;AAEnB;IAAC,KAAK,CAAC,UAAU,CAAC;8BAAgB,mBAAmB;0DAAA;AA8MrD;IAAC,KAAK,CAAC,iBAAiB,CAAC;;2DAAmB;AAtQjC,oBAAoB;IADhC,aAAa,CAAC,wBAAwB,CAAC;GAC3B,oBAAoB,CAwZhC;SAxZY,oBAAoB","sourcesContent":["import '@operato/property-editor/ox-properties-dynamic-view.js'\nimport '@operato/board/ox-board-viewer.js'\nimport '../../components/activity-approval-ribon.js'\nimport '../../components/activity-approval-timeline.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, nothing } from 'lit'\nimport { unsafeHTML } from 'lit-html/directives/unsafe-html.js'\nimport { customElement, query, state } from 'lit/decorators.js'\nimport { keyed } from 'lit/directives/keyed.js'\nimport { connect } from 'pwa-helpers/connect-mixin.js'\n\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { PageView, store } from '@operato/shell'\nimport { CommonButtonStyles, ScrollbarStyles } from '@operato/styles'\nimport { provider } from '@things-factory/board-ui'\n\nconst ActivityApprovalFetchResult = `\\\n{\n id\n judgment\n comment\n approver {\n id\n name\n }\n round\n order\n createdAt\n terminatedAt\n activityThread {\n state\n dueAt\n assignedAt\n assignee {\n id\n name\n }\n updatedAt\n terminatedAt\n output\n activityApprovals {\n round\n order\n approver {\n name\n email\n }\n judgment\n comment\n createdAt\n terminatedAt\n }\n activityInstance {\n id\n name\n description\n state\n activity {\n id\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 thumbnail\n input\n output\n viewType\n viewSource\n dueAt\n createdAt\n } \n }\n}`\n\nexport const ActivityThreadStatus = {\n Assigned: 'assigned',\n Started: 'started',\n Delegated: 'delegated',\n Ended: 'ended',\n Aborted: 'aborted'\n}\n\n@customElement('activity-approval-page')\nexport class ActivityApprovalPage extends connect(store)(localize(i18next)(PageView)) {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n position: relative;\n\n width: 100%;\n overflow: auto;\n background-color: var(--main-section-background-color);\n }\n\n ox-board-viewer {\n width: 100%;\n height: 100%;\n }\n\n activity-approval-timeline {\n margin: var(--margin-default);\n padding: var(--padding-default);\n }\n\n div[comment] {\n display: flex;\n position: sticky;\n bottom: 0;\n margin: 0;\n padding: 0;\n width: 100%;\n background-color: var(--main-section-background-color);\n\n textarea {\n flex: 1;\n margin: var(--margin-default);\n padding: var(--input-padding);\n font: var(--input-font);\n outline: none;\n height: 80px;\n border-radius: 10px;\n border: var(--input-field-border);\n resize: none;\n }\n }\n\n div[empty] {\n align-self: center;\n }\n `\n ]\n\n @state() activityApproval: any\n @state() activityThread: any\n @state() board: any\n\n @query('textarea') commentInput!: HTMLTextAreaElement\n\n get context() {\n const judgment = this.activityApproval?.judgment\n\n return {\n title: this.lifecycle?.params?.['title'] || i18next.t('title.activity approval'),\n help: 'worklist/activity-approval',\n actions: judgment\n ? []\n : [\n {\n title: i18next.t('button.reject'),\n action: this.rejectActivityApproval.bind(this),\n ...CommonButtonStyles.play\n },\n\n {\n title: i18next.t('button.approve'),\n action: this.approveActivityApproval.bind(this),\n ...CommonButtonStyles.save\n },\n\n {\n title: i18next.t('button.save'),\n action: this.saveActivityApproval.bind(this),\n ...CommonButtonStyles.save\n }\n ]\n // activityApproval: this.activityApproval\n }\n }\n\n render() {\n if (!this.activityThread) {\n return html`<div empty>no activity thread info.</div>`\n }\n\n const { terminatedAt } = this.activityApproval\n const editable = !terminatedAt\n\n return html`\n <activity-approval-ribon .activityApproval=${this.activityApproval}></activity-approval-ribon>\n ${this.activityContent()}\n <activity-approval-timeline .activityThread=${this.activityThread}></activity-approval-timeline>\n ${editable\n ? html`\n <div comment>\n <textarea\n placeholder=${String(i18next.t('text.explain the reason for approval/rejection'))}\n .value=${this.activityApproval?.comment}\n @change=${(e: Event) => {\n this.activityApproval.comment = (e.target as HTMLTextAreaElement).value\n }}\n ></textarea>\n </div>\n `\n : nothing}\n `\n }\n\n activityContent() {\n switch (this.activityThread?.activityInstance?.viewType) {\n case 'template':\n return this.templateContent()\n case 'generated':\n return this.generatedContent()\n case 'board':\n return this.boardContent()\n case 'custom-element':\n return this.customElementContent()\n case 'page':\n case 'external':\n return html``\n default:\n return this.generatedContent()\n }\n }\n\n templateContent() {\n if (!this.activityApproval) {\n return html``\n }\n\n const { viewSource: template } = this.activityThread?.activityInstance\n return unsafeHTML(template)\n }\n\n getInputSpec() {\n const model = this.activityThread?.activityInstance?.activity?.model\n\n return (model || [])\n .filter(item => item.inout === 'in' || item.inout === 'inout')\n .map(item => {\n return {\n ...item,\n name: item.tag,\n label: item.tKey || item.name,\n property: item.options\n }\n })\n }\n\n getOutputSpec() {\n const model = this.activityThread?.activityInstance?.activity?.model\n\n return (model || [])\n .filter(item => item.inout === 'inout' || item.inout === 'out')\n .map(item => {\n return {\n ...item,\n name: item.tag,\n label: item.tKey || item.name,\n property: item.options\n }\n })\n }\n\n generatedContent() {\n if (!this.activityApproval) {\n return html``\n }\n\n var { output, activityInstance } = this.activityThread || {}\n var { input } = activityInstance || {}\n\n const inputSpec = this.getInputSpec()\n const outputSpec = this.getOutputSpec()\n\n if (!output) {\n output = inputSpec\n .filter(item => item.inout === 'inout')\n .reduce((inout, item) => {\n inout[item.name] = input[item.name]\n return inout\n }, {})\n }\n\n return keyed(\n this.activityApproval.id,\n html`\n <fieldset>\n <legend>Input</legend>\n <ox-properties-dynamic-view data-name=\"input\" .props=${inputSpec} .value=${input}></ox-properties-dynamic-view>\n </fieldset>\n\n <fieldset>\n <legend>Output</legend>\n <ox-properties-dynamic-view\n data-name=\"output\"\n .props=${outputSpec}\n .value=${output}\n @property-change=${e => (this.activityApproval.output = e.currentTarget.value)}\n ></ox-properties-dynamic-view>\n </fieldset>\n `\n )\n }\n\n boardContent() {\n if (!this.activityApproval) {\n return html``\n }\n\n const { output, activityInstance } = this.activityThread\n const { viewSource: boardId, input } = activityInstance || {}\n\n if (!this.board || this.board.id !== boardId) {\n this.board = {\n id: boardId\n }\n }\n\n return keyed(\n this.activityApproval.id,\n html`\n <ox-board-viewer\n style=\"background-color: white;\"\n .board=${this.board}\n .provider=${provider}\n .values=${{ ...input, ...output }}\n hide-fullscreen\n hide-navigation\n ></ox-board-viewer>\n `\n )\n }\n\n customElementContent() {\n if (!this.activityApproval) {\n return html``\n }\n\n const { output, activityInstance } = this.activityThread\n const { viewSource: tagName, input } = activityInstance || {}\n\n const element = document.createElement(tagName)\n element.id = 'custom-content'\n element.activityId = activityInstance.activity.id\n element.input = input\n element.output = output\n element.activityApproval = this.activityApproval\n\n return element\n }\n\n @query('ox-board-viewer') oxBoardViewer: any\n\n getOutputFromBoard() {\n const outputSpec = this.getOutputSpec()\n const data = this.oxBoardViewer.getSceneValues()\n\n return outputSpec.reduce((output, spec) => {\n output[spec.name] = data[spec.name]\n return output\n }, {})\n }\n\n updated(changes) {\n if (changes.has('activityApproval')) {\n this.updateContext()\n }\n }\n\n async pageUpdated(changes, lifecycle, changedBefore) {\n if (this.active && lifecycle.resourceId) {\n this.fetchActivityApproval(lifecycle.resourceId)\n }\n }\n\n async fetchActivityApproval(id) {\n const response = await client.query({\n query: gql`\n query activityApproval($id: String!) {\n activityApproval(id: $id) ${ActivityApprovalFetchResult}\n }\n `,\n variables: {\n id\n }\n })\n\n this.activityApproval = response.data.activityApproval\n this.activityThread = this.activityApproval.activityThread\n\n this.updateContext()\n }\n\n async rejectActivityApproval() {\n var { id, comment } = this.activityApproval\n\n if (!comment) {\n document.dispatchEvent(\n new CustomEvent('notify', {\n detail: {\n message: i18next.t('text.enter a comment')\n }\n })\n )\n this.commentInput.focus()\n return\n }\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!, $comment: String!) {\n rejectActivityApproval(id: $id, comment: $comment) ${ActivityApprovalFetchResult}\n }\n `,\n variables: {\n id,\n comment\n }\n })\n\n if (!response.errors) {\n this.activityApproval = response.data.rejectActivityApproval\n this.activityThread = this.activityApproval.activityThread\n\n this.updateContext()\n\n document.dispatchEvent(\n new CustomEvent('notify', {\n detail: {\n message: i18next.t('text.task_is_rejected_successfully')\n }\n })\n )\n }\n }\n\n async approveActivityApproval() {\n var { id, comment } = this.activityApproval\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!, $comment: String) {\n approveActivityApproval(id: $id, comment: $comment) ${ActivityApprovalFetchResult}\n }\n `,\n variables: {\n id,\n comment\n }\n })\n\n if (!response.errors) {\n this.activityApproval = response.data.approveActivityApproval\n this.activityThread = this.activityApproval.activityThread\n\n this.updateContext()\n\n document.dispatchEvent(\n new CustomEvent('notify', {\n detail: {\n message: i18next.t('text.task_is_approved_successfully')\n }\n })\n )\n }\n }\n\n async saveActivityApproval() {\n var { id, comment } = this.activityApproval\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!, $comment: String) {\n saveActivityApproval(id: $id, comment: $comment) ${ActivityApprovalFetchResult}\n }\n `,\n variables: {\n id,\n comment\n }\n })\n\n if (!response.errors) {\n this.activityApproval = response.data.saveActivityApproval\n this.activityThread = this.activityApproval.activityThread\n\n this.updateContext()\n\n document.dispatchEvent(\n new CustomEvent('notify', {\n detail: {\n message: i18next.t('text.task_is_saved_successfully')\n }\n })\n )\n }\n }\n}\n"]}
@@ -122,7 +122,14 @@ let ActivityThreadPage = class ActivityThreadPage extends connect(store)(localiz
122
122
  }
123
123
  render() {
124
124
  const activityThread = this.activityThread;
125
- return html ` ${activityThread ? html `<activity-thread-ribon .activityThread=${activityThread}></activity-thread-ribon>` : html ``} ${this.activityContent()}`;
125
+ if (!activityThread) {
126
+ return html `<div empty>no activity thread info.</div> `;
127
+ }
128
+ return html `
129
+ <activity-thread-ribon .activityThread=${activityThread}></activity-thread-ribon>
130
+ ${this.activityContent()}
131
+ <activity-approval-timeline .activityThread=${activityThread}></activity-approval-timeline>
132
+ `;
126
133
  }
127
134
  activityContent() {
128
135
  var _a, _b;
@@ -427,8 +434,13 @@ ActivityThreadPage.styles = [
427
434
  height: 100%;
428
435
  }
429
436
 
430
- #custom-content {
431
- flex: 1;
437
+ activity-approval-timeline {
438
+ margin: var(--margin-default);
439
+ padding: var(--padding-default);
440
+ }
441
+
442
+ div[empty] {
443
+ align-self: center;
432
444
  }
433
445
  `
434
446
  ];