@things-factory/worklist 6.1.55 → 6.1.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/components/activity-approval-ribon.ts +165 -0
- package/client/components/activity-instance-ribon.ts +19 -93
- package/client/components/activity-thread-ribon.ts +160 -0
- package/client/pages/activity/activity-page.ts +2 -0
- package/client/pages/activity-approval/activity-approval-page.ts +32 -3
- package/client/pages/activity-instance/activity-instance-start-page.ts +4 -2
- package/client/pages/activity-instance/activity-instance-view.ts +17 -10
- package/client/pages/activity-thread/activity-thread-page.ts +14 -7
- package/client/pages/activity-thread/activity-thread-view-page.ts +2 -0
- package/client/templates/activity-approval-context-template.ts +121 -23
- package/client/templates/activity-instance-context-template.ts +116 -115
- package/client/templates/activity-thread-context-template.ts +117 -18
- package/dist-client/components/activity-approval-ribon.d.ts +13 -0
- package/dist-client/components/activity-approval-ribon.js +166 -0
- package/dist-client/components/activity-approval-ribon.js.map +1 -0
- package/dist-client/components/activity-instance-ribon.d.ts +1 -0
- package/dist-client/components/activity-instance-ribon.js +19 -80
- package/dist-client/components/activity-instance-ribon.js.map +1 -1
- package/dist-client/components/activity-thread-ribon.d.ts +13 -0
- package/dist-client/components/activity-thread-ribon.js +160 -0
- package/dist-client/components/activity-thread-ribon.js.map +1 -0
- package/dist-client/pages/activity/activity-page.js +2 -2
- package/dist-client/pages/activity/activity-page.js.map +1 -1
- package/dist-client/pages/activity-approval/activity-approval-page.d.ts +5 -4
- package/dist-client/pages/activity-approval/activity-approval-page.js +28 -5
- package/dist-client/pages/activity-approval/activity-approval-page.js.map +1 -1
- package/dist-client/pages/activity-instance/activity-instance-start-page.d.ts +0 -1
- package/dist-client/pages/activity-instance/activity-instance-start-page.js +4 -4
- package/dist-client/pages/activity-instance/activity-instance-start-page.js.map +1 -1
- package/dist-client/pages/activity-instance/activity-instance-view.d.ts +1 -1
- package/dist-client/pages/activity-instance/activity-instance-view.js +17 -10
- package/dist-client/pages/activity-instance/activity-instance-view.js.map +1 -1
- package/dist-client/pages/activity-thread/activity-thread-page.d.ts +4 -4
- package/dist-client/pages/activity-thread/activity-thread-page.js +13 -9
- package/dist-client/pages/activity-thread/activity-thread-page.js.map +1 -1
- package/dist-client/pages/activity-thread/activity-thread-view-page.js +2 -2
- package/dist-client/pages/activity-thread/activity-thread-view-page.js.map +1 -1
- package/dist-client/route.d.ts +1 -1
- package/dist-client/templates/activity-approval-context-template.js +124 -23
- package/dist-client/templates/activity-approval-context-template.js.map +1 -1
- package/dist-client/templates/activity-instance-context-template.js +116 -102
- package/dist-client/templates/activity-instance-context-template.js.map +1 -1
- package/dist-client/templates/activity-thread-context-template.js +120 -18
- package/dist-client/templates/activity-thread-context-template.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/activity-approval/activity-approval-mutation.js +12 -0
- package/dist-server/service/activity-approval/activity-approval-mutation.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/server/service/activity-approval/activity-approval-mutation.ts +19 -1
- package/translations/en.json +3 -0
- package/translations/ja.json +3 -0
- package/translations/ko.json +3 -0
- package/translations/ms.json +136 -133
- package/translations/zh.json +133 -130
|
@@ -1,39 +1,50 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
2
|
import '@material/mwc-icon';
|
|
3
3
|
import { html, css, LitElement } from 'lit';
|
|
4
|
-
import { customElement, state } from 'lit/decorators.js';
|
|
4
|
+
import { customElement, property, state } from 'lit/decorators.js';
|
|
5
5
|
import { connect } from 'pwa-helpers/connect-mixin';
|
|
6
6
|
import { ContextToolbarOverlayStyle } from '@operato/context/ox-context-toolbar-overlay-style.js';
|
|
7
7
|
import { store } from '@operato/shell';
|
|
8
|
+
import { i18next } from '@operato/i18n';
|
|
8
9
|
import '@things-factory/organization/dist-client/component/approval-line-view.js';
|
|
9
10
|
const formatter = new Intl.DateTimeFormat(navigator.language, { dateStyle: 'full', timeStyle: 'short' });
|
|
10
11
|
let ActivityApprovalContextTemplate = class ActivityApprovalContextTemplate extends connect(store)(LitElement) {
|
|
11
12
|
render() {
|
|
12
|
-
const activityApproval = this.context.activityApproval || {};
|
|
13
|
+
const activityApproval = this.context.activityApproval || this.activityApproval || {};
|
|
13
14
|
const { round, order, approver, createdAt, activityThread } = activityApproval || {};
|
|
14
15
|
const { state, dueAt, assignedAt, assignee, activityInstance } = activityThread || {};
|
|
15
16
|
const { name, description, thumbnail, approvalLine } = activityInstance || {};
|
|
16
17
|
return html `
|
|
17
|
-
<div>
|
|
18
|
-
<div>name: ${name}</div>
|
|
19
|
-
<div>description: ${description}</div>
|
|
20
|
-
<div>state: ${state}</div>
|
|
21
|
-
<div>round: ${round}</div>
|
|
22
|
-
<div>order: ${order}</div>
|
|
23
|
-
<div>assigned at: ${assignedAt && formatter.format(new Date(assignedAt))}</div>
|
|
24
|
-
<div>due at: ${dueAt && formatter.format(new Date(dueAt))}</div>
|
|
25
|
-
<div>assignee: ${assignee === null || assignee === void 0 ? void 0 : assignee.name}</div>
|
|
26
|
-
<div>approver: ${approver === null || approver === void 0 ? void 0 : approver.name}</div>
|
|
27
|
-
<div>waited since: ${createdAt && formatter.format(new Date(createdAt))}</div>
|
|
28
|
-
</div>
|
|
29
|
-
<div>
|
|
18
|
+
<div flow>
|
|
30
19
|
<div approval-line>
|
|
31
|
-
${approvalLine
|
|
32
|
-
|
|
33
|
-
|
|
20
|
+
${approvalLine ? html ` <approval-line-view .model=${approvalLine}></approval-line-view> ` : html ``}
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<div info>
|
|
25
|
+
<div><label>${i18next.t('field.name')}</label> <strong>${name}</strong></div>
|
|
26
|
+
<div><label>${i18next.t('field.description')}</label> ${description}</div>
|
|
27
|
+
<div>
|
|
28
|
+
<label>${i18next.t('field.status')}</label> <span></span> <strong
|
|
29
|
+
>${i18next.t('label.activity-state-' + state)}</strong
|
|
30
|
+
>
|
|
31
|
+
</div>
|
|
32
|
+
<div><label>${i18next.t('field.round')}</label> <strong>${round}</strong></div>
|
|
33
|
+
<div><label>${i18next.t('field.approval-order')}</label> <strong>${order}</strong></div>
|
|
34
|
+
<div><label>${i18next.t('field.assignee')}</label> <strong>${assignee === null || assignee === void 0 ? void 0 : assignee.name}</strong></div>
|
|
35
|
+
<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))}
|
|
34
38
|
</div>
|
|
35
|
-
<
|
|
39
|
+
<div><label>${i18next.t('field.due-at')}</label> ${dueAt && formatter.format(new Date(dueAt))}</div>
|
|
40
|
+
<div><label>since</label> ${createdAt && formatter.format(new Date(createdAt))}</div>
|
|
36
41
|
</div>
|
|
42
|
+
|
|
43
|
+
${thumbnail
|
|
44
|
+
? html ` <div thumbnail>
|
|
45
|
+
<img src=${thumbnail} />
|
|
46
|
+
</div>`
|
|
47
|
+
: html ``}
|
|
37
48
|
`;
|
|
38
49
|
}
|
|
39
50
|
stateChanged(state) {
|
|
@@ -44,18 +55,108 @@ ActivityApprovalContextTemplate.styles = [
|
|
|
44
55
|
ContextToolbarOverlayStyle,
|
|
45
56
|
css `
|
|
46
57
|
:host {
|
|
47
|
-
background-color: white;
|
|
48
|
-
|
|
58
|
+
background-color: var(--theme-white-color);
|
|
49
59
|
width: 100%;
|
|
50
|
-
|
|
60
|
+
min-width: 450px;
|
|
51
61
|
overflow: auto;
|
|
62
|
+
--context-ui-padding: 0;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
:host([state='assigned']) {
|
|
66
|
+
--worklist-status-color: #5f7184;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
:host([state='started']) {
|
|
70
|
+
--worklist-status-color: #56af45;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
:host([state='delegated']) {
|
|
74
|
+
--worklist-status-color: #8654b0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
:host([state='submitted']) {
|
|
78
|
+
--worklist-status-color: #428df3;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
:host([state='escalated']) {
|
|
82
|
+
--worklist-status-color: #595de5;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
:host([state='rejected']) {
|
|
86
|
+
--worklist-status-color: #f27429;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
:host([state='ended']) {
|
|
90
|
+
--worklist-status-color: #02acae;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
:host([state='aborted']) {
|
|
94
|
+
--worklist-status-color: #cb3a33;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
[info],
|
|
98
|
+
[assignees] {
|
|
99
|
+
padding: var(--padding-default);
|
|
100
|
+
border-bottom: var(--border-dark-color);
|
|
101
|
+
color: var(--secondary-color);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
[info] 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
|
+
[info] div:nth-child(odd) {
|
|
115
|
+
background-color: var(--main-section-background-color);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
[info] label {
|
|
119
|
+
display: inline-block;
|
|
120
|
+
width: 25%;
|
|
121
|
+
text-align: right;
|
|
122
|
+
margin-right: 20px;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
[info] span {
|
|
126
|
+
width: 15px;
|
|
127
|
+
height: 15px;
|
|
128
|
+
background-color: var(--worklist-status-color, tomato);
|
|
129
|
+
display: inline-block;
|
|
130
|
+
border-radius: 50%;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
:host:before {
|
|
134
|
+
content: '';
|
|
135
|
+
position: absolute;
|
|
136
|
+
width: 0;
|
|
137
|
+
height: 0;
|
|
138
|
+
border: 22px solid transparent;
|
|
139
|
+
border-left-color: var(--worklist-status-color);
|
|
140
|
+
border-right: 0;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
[thumbnail] {
|
|
144
|
+
display: flex;
|
|
145
|
+
justify-content: center;
|
|
146
|
+
align-items: center;
|
|
147
|
+
margin: var(--margin-default);
|
|
52
148
|
}
|
|
53
149
|
|
|
54
150
|
img {
|
|
55
|
-
max-width:
|
|
151
|
+
max-width: 85%;
|
|
152
|
+
height: auto;
|
|
56
153
|
}
|
|
57
154
|
`
|
|
58
155
|
];
|
|
156
|
+
__decorate([
|
|
157
|
+
property({ type: Object }),
|
|
158
|
+
__metadata("design:type", Object)
|
|
159
|
+
], ActivityApprovalContextTemplate.prototype, "activityApproval", void 0);
|
|
59
160
|
__decorate([
|
|
60
161
|
state(),
|
|
61
162
|
__metadata("design:type", Object)
|
|
@@ -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,KAAK,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"activity-approval-context-template.js","sourceRoot":"","sources":["../../client/templates/activity-approval-context-template.ts"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,CAAA;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;A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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> <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,7 +1,7 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
2
|
import '@material/mwc-icon';
|
|
3
3
|
import { html, css, LitElement } from 'lit';
|
|
4
|
-
import { customElement, state } from 'lit/decorators.js';
|
|
4
|
+
import { customElement, property, state } from 'lit/decorators.js';
|
|
5
5
|
import { connect } from 'pwa-helpers/connect-mixin';
|
|
6
6
|
import { ContextToolbarOverlayStyle } from '@operato/context/ox-context-toolbar-overlay-style.js';
|
|
7
7
|
import { store } from '@operato/shell';
|
|
@@ -11,9 +11,10 @@ import '@things-factory/organization/dist-client/component/approval-line-view.js
|
|
|
11
11
|
const formatter = new Intl.DateTimeFormat(navigator.language, { dateStyle: 'full', timeStyle: 'short' });
|
|
12
12
|
let ActivityInstanceContextTemplate = class ActivityInstanceContextTemplate extends connect(store)(LitElement) {
|
|
13
13
|
render() {
|
|
14
|
-
const activityInstance = this.context.activityInstance || {};
|
|
15
|
-
const { name, description, state,
|
|
16
|
-
const
|
|
14
|
+
const activityInstance = this.context.activityInstance || this.activityInstance || {};
|
|
15
|
+
const { activity, name, description, state, assignees, approvalLine, assignedAt, startedAt, dueAt, thumbnail } = activityInstance || {};
|
|
16
|
+
const { startingType } = activity || {};
|
|
17
|
+
// const editable = state == 'draft'
|
|
17
18
|
return html `
|
|
18
19
|
<div flow>
|
|
19
20
|
${approvalLine
|
|
@@ -29,55 +30,46 @@ let ActivityInstanceContextTemplate = class ActivityInstanceContextTemplate exte
|
|
|
29
30
|
@click=${() => this.onClickApprovalLine(activityInstance)}
|
|
30
31
|
></mwc-icon-button>`}
|
|
31
32
|
</div>
|
|
32
|
-
|
|
33
|
-
<div info>
|
|
34
|
-
<div><label>name</label> <strong>${name}</strong></div>
|
|
35
|
-
<div><label>description</label> ${description}</div>
|
|
36
|
-
<div><label>state</label> <span></span> <strong>${state}</strong></div>
|
|
37
|
-
<div><label>assigned at</label> ${assignedAt && formatter.format(new Date(assignedAt))}</div>
|
|
38
|
-
<div><label>due at</label> ${dueAt && formatter.format(new Date(dueAt))}</div>
|
|
39
|
-
<div><label>started at</label> ${startedAt && formatter.format(new Date(startedAt))}</div>
|
|
40
|
-
</div>
|
|
41
33
|
|
|
42
|
-
<div>
|
|
43
|
-
<div
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
@click=${() => this.onClickAssignees(activityInstance)}
|
|
50
|
-
@change=${e => (activityInstance.assignees = e.currentTarget.value)}
|
|
51
|
-
></assignees-view>
|
|
52
|
-
`
|
|
53
|
-
: html `<mwc-icon-button
|
|
54
|
-
icon="group_add"
|
|
55
|
-
@click=${() => this.onClickAssignees(activityInstance)}
|
|
56
|
-
></mwc-icon-button>`}
|
|
34
|
+
<div info>
|
|
35
|
+
<div><label>${i18next.t('field.name')}</label> <strong>${name}</strong></div>
|
|
36
|
+
<div><label>${i18next.t('field.description')}</label> ${description}</div>
|
|
37
|
+
<div>
|
|
38
|
+
<label>${i18next.t('field.status')}</label> <span></span> <strong
|
|
39
|
+
>${i18next.t('label.activity-state-' + state)}</strong
|
|
40
|
+
>
|
|
57
41
|
</div>
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
<
|
|
62
|
-
|
|
63
|
-
<input
|
|
64
|
-
id="threadsMin"
|
|
65
|
-
type="number"
|
|
66
|
-
.value=${threadsMin || 0}
|
|
67
|
-
@change=${e => (activityInstance.threadsMin = e.currentTarget.valueAsNumber)}
|
|
68
|
-
/>
|
|
69
|
-
|
|
70
|
-
<label for="threads-max">Threads Max</label>
|
|
71
|
-
<input
|
|
72
|
-
id="threads-max"
|
|
73
|
-
type="number"
|
|
74
|
-
.value=${threadsMax || 0}
|
|
75
|
-
@change=${e => (activityInstance.threadsMax = e.currentTarget.valueAsNumber)}
|
|
76
|
-
/>
|
|
77
|
-
</section>
|
|
78
|
-
|
|
79
|
-
<img src=${thumbnail} />
|
|
42
|
+
<div>
|
|
43
|
+
<label>${i18next.t('field.assigned-at')}</label> ${assignedAt && formatter.format(new Date(assignedAt))}
|
|
44
|
+
</div>
|
|
45
|
+
<div><label>${i18next.t('field.due-at')}</label> ${dueAt && formatter.format(new Date(dueAt))}</div>
|
|
46
|
+
<div><label>${i18next.t('field.started-at')}</label> ${startedAt && formatter.format(new Date(startedAt))}</div>
|
|
80
47
|
</div>
|
|
48
|
+
|
|
49
|
+
${startingType == 'issue'
|
|
50
|
+
? html `<div assignees>
|
|
51
|
+
<div>
|
|
52
|
+
<label>${i18next.t('field.assignees')}</label>
|
|
53
|
+
${assignees
|
|
54
|
+
? html `
|
|
55
|
+
<assignees-view
|
|
56
|
+
.value=${assignees}
|
|
57
|
+
@click=${() => this.onClickAssignees(activityInstance)}
|
|
58
|
+
@change=${e => (activityInstance.assignees = e.currentTarget.value)}
|
|
59
|
+
></assignees-view>
|
|
60
|
+
`
|
|
61
|
+
: html `<mwc-icon-button
|
|
62
|
+
icon="group_add"
|
|
63
|
+
@click=${() => this.onClickAssignees(activityInstance)}
|
|
64
|
+
></mwc-icon-button>`}
|
|
65
|
+
</div>
|
|
66
|
+
</div>`
|
|
67
|
+
: html ``}
|
|
68
|
+
${thumbnail
|
|
69
|
+
? html ` <div thumbnail>
|
|
70
|
+
<img src=${thumbnail} />
|
|
71
|
+
</div>`
|
|
72
|
+
: html ``}
|
|
81
73
|
`;
|
|
82
74
|
}
|
|
83
75
|
stateChanged(state) {
|
|
@@ -126,11 +118,11 @@ ActivityInstanceContextTemplate.styles = [
|
|
|
126
118
|
:host {
|
|
127
119
|
background-color: var(--theme-white-color);
|
|
128
120
|
width: 100%;
|
|
129
|
-
min-width:450px;
|
|
121
|
+
min-width: 450px;
|
|
130
122
|
overflow: auto;
|
|
131
|
-
--context-ui-padding:0;
|
|
123
|
+
--context-ui-padding: 0;
|
|
132
124
|
}
|
|
133
|
-
|
|
125
|
+
|
|
134
126
|
:host([state='draft']) {
|
|
135
127
|
--worklist-status-color: #5f7184;
|
|
136
128
|
}
|
|
@@ -162,36 +154,41 @@ ActivityInstanceContextTemplate.styles = [
|
|
|
162
154
|
:host([state='aborted']) {
|
|
163
155
|
--worklist-status-color: #cb3a33;
|
|
164
156
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
157
|
+
|
|
158
|
+
[info],
|
|
159
|
+
[assignees] {
|
|
160
|
+
padding: var(--padding-default);
|
|
161
|
+
border-bottom: var(--border-dark-color);
|
|
162
|
+
color: var(--secondary-color);
|
|
169
163
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
164
|
+
|
|
165
|
+
[info] div {
|
|
166
|
+
display: flex;
|
|
167
|
+
align-items: center;
|
|
168
|
+
padding: var(--padding-narrow);
|
|
169
|
+
border-radius: var(--border-radius);
|
|
170
|
+
text-align: right;
|
|
171
|
+
clear: both;
|
|
175
172
|
overflow: hidden;
|
|
176
173
|
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
[info] div:nth-child(odd){
|
|
181
|
-
background-color:var(--main-section-background-color);
|
|
174
|
+
|
|
175
|
+
[info] div:nth-child(odd) {
|
|
176
|
+
background-color: var(--main-section-background-color);
|
|
182
177
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
text-align:
|
|
178
|
+
|
|
179
|
+
[info] label {
|
|
180
|
+
display: inline-block;
|
|
181
|
+
width: 25%;
|
|
182
|
+
text-align: right;
|
|
183
|
+
margin-right: 20px;
|
|
188
184
|
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
185
|
+
|
|
186
|
+
[info] span {
|
|
187
|
+
width: 15px;
|
|
188
|
+
height: 15px;
|
|
189
|
+
background-color: var(--worklist-status-color, tomato);
|
|
190
|
+
display: inline-block;
|
|
191
|
+
border-radius: 50%;
|
|
195
192
|
}
|
|
196
193
|
|
|
197
194
|
:host:before {
|
|
@@ -203,44 +200,61 @@ ActivityInstanceContextTemplate.styles = [
|
|
|
203
200
|
border-left-color: var(--worklist-status-color);
|
|
204
201
|
border-right: 0;
|
|
205
202
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
203
|
+
|
|
204
|
+
section {
|
|
205
|
+
padding: var(--padding-default);
|
|
206
|
+
color: var(--secondary-color);
|
|
209
207
|
}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
208
|
+
|
|
209
|
+
section label {
|
|
210
|
+
display: inline-block;
|
|
211
|
+
width: 25%;
|
|
212
|
+
margin-top: var(--margin-default);
|
|
214
213
|
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
214
|
+
|
|
215
|
+
[assignees] {
|
|
216
|
+
text-align: right;
|
|
217
|
+
clear: both;
|
|
218
218
|
overflow: hidden;
|
|
219
219
|
}
|
|
220
|
-
|
|
221
|
-
|
|
220
|
+
|
|
221
|
+
[assignees] label {
|
|
222
|
+
display: inline-block;
|
|
222
223
|
padding-left: var(--padding-narrow);
|
|
223
|
-
width:25%;
|
|
224
|
-
|
|
225
|
-
text-align:left;
|
|
224
|
+
width: 25%;
|
|
225
|
+
text-align: left;
|
|
226
226
|
}
|
|
227
|
-
|
|
228
|
-
|
|
227
|
+
|
|
228
|
+
[assignees] mwc-icon-button {
|
|
229
|
+
float: right;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
section input {
|
|
233
|
+
display: inline-block;
|
|
234
|
+
width: 70%;
|
|
235
|
+
border: var(--border-dark-color);
|
|
236
|
+
border-width: 0 0 1px 0;
|
|
237
|
+
margin-top: var(--margin-default);
|
|
238
|
+
font-size: var(--fontsize-large);
|
|
229
239
|
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
margin
|
|
236
|
-
font-size:var(--fontsize-large);
|
|
240
|
+
|
|
241
|
+
[thumbnail] {
|
|
242
|
+
display: flex;
|
|
243
|
+
justify-content: center;
|
|
244
|
+
align-items: center;
|
|
245
|
+
margin: var(--margin-default);
|
|
237
246
|
}
|
|
238
247
|
|
|
239
248
|
img {
|
|
240
249
|
max-width: 85%;
|
|
250
|
+
height: auto;
|
|
241
251
|
}
|
|
242
252
|
`
|
|
243
253
|
];
|
|
254
|
+
__decorate([
|
|
255
|
+
property({ type: Object }),
|
|
256
|
+
__metadata("design:type", Object)
|
|
257
|
+
], ActivityInstanceContextTemplate.prototype, "activityInstance", void 0);
|
|
244
258
|
__decorate([
|
|
245
259
|
state(),
|
|
246
260
|
__metadata("design:type", Object)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity-instance-context-template.js","sourceRoot":"","sources":["../../client/templates/activity-instance-context-template.ts"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,CAAA;AAE3B,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAExD,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;IA6HtE,MAAM;QACJ,MAAM,gBAAgB,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,IAAI,EAAE,CAAA;QAC5D,MAAM,EACJ,IAAI,EACJ,WAAW,EACX,KAAK,EACL,SAAS,EACT,SAAS,EACT,YAAY,EACZ,UAAU,EACV,SAAS,EACT,KAAK,E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AG,EAAE,GAAE,CAAC,CAAA;IAC3B,CAAC;;AAjQM,sCAAM,GAAG;IACd,0BAA0B;IAC1B,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAqHF;CACF,CAAA;AAED;IAAC,KAAK,EAAE;;gEAAgB;AA3HpB,+BAA+B;IADpC,aAAa,CAAC,oCAAoC,CAAC;GAC9C,+BAA+B,CAmQpC","sourcesContent":["import '@material/mwc-icon'\n\nimport { html, css, LitElement } from 'lit'\nimport { customElement, 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 [info], [assignees]{\n padding:var(--padding-default);\n border-bottom:var(--border-dark-color);\n color:var(--secondary-color)\n }\n [info] div{\n padding:var(--padding-narrow);\n border-radius:var(--border-radius);\n text-align:right;\n clear:both;\n overflow: hidden;\n }\n [info] div *{\n vertical-align:middle;\n }\n [info] div:nth-child(odd){\n background-color:var(--main-section-background-color);\n }\n [info] label{\n display:inline-block;\n width:25%;\n float:left;\n text-align:left;\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 section{\n padding:var(--padding-default);\n color:var(--secondary-color)\n }\n section label{\n display:inline-block;\n width:25%;\n margin-top:var(--margin-default);\n }\n [assignees]{\n text-align:right;\n clear:both;\n overflow: hidden;\n }\n [assignees] label{\n display:inline-block;\n padding-left: var(--padding-narrow);\n width:25%;\n float:left;\n text-align:left;\n }\n [assignees] mwc-icon-button{\n float:right\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 img {\n max-width: 85%;\n }\n `\n ]\n\n @state() private context\n\n render() {\n const activityInstance = this.context.activityInstance || {}\n const {\n name,\n description,\n state,\n thumbnail,\n assignees,\n approvalLine,\n assignedAt,\n startedAt,\n dueAt,\n threadsMin,\n threadsMax\n } = activityInstance || {}\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>name</label> <strong>${name}</strong></div>\n <div><label>description</label> ${description}</div>\n <div><label>state</label> <span></span> <strong>${state}</strong></div>\n <div><label>assigned at</label> ${assignedAt && formatter.format(new Date(assignedAt))}</div>\n <div><label>due at</label> ${dueAt && formatter.format(new Date(dueAt))}</div>\n <div><label>started at</label> ${startedAt && formatter.format(new Date(startedAt))}</div>\n </div>\n\n <div>\n <div assignees>\n <label>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\n \n\n <section>\n <label for=\"threads-min\">Threads Min</label>\n <input\n id=\"threadsMin\"\n type=\"number\"\n .value=${threadsMin || 0}\n @change=${e => (activityInstance.threadsMin = e.currentTarget.valueAsNumber)}\n />\n\n <label for=\"threads-max\">Threads Max</label>\n <input\n id=\"threads-max\"\n type=\"number\"\n .value=${threadsMax || 0}\n @change=${e => (activityInstance.threadsMax = e.currentTarget.valueAsNumber)}\n />\n </section>\n\n <img src=${thumbnail} />\n </div>\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;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,EAAE,GAAG,QAAQ,IAAI,EAAE,CAAA;QAEvC,oCAAoC;QAEpC,OAAO,IA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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> <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"]}
|