@things-factory/worklist 6.0.24 → 6.0.26
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/activity-summary-generator.ts +132 -0
- package/client/bootstrap.ts +37 -0
- package/client/components/activity-starter-form.ts +89 -3
- package/client/index.ts +1 -0
- package/client/pages/activity-approval/activity-approval-page.ts +5 -50
- package/client/pages/activity-thread/activity-thread-page.ts +5 -44
- package/client/pages/installable-activity/installable-activity-list-page.ts +400 -0
- package/client/pages/installable-activity/installable-activity-model-item-list.ts +18 -0
- package/client/pages/todo/draft-list-page.ts +9 -0
- package/client/route.ts +4 -0
- package/client/templates/activity-approval-context-template.ts +67 -0
- package/client/templates/activity-thread-context-template.ts +62 -0
- package/dist-client/activity-summary-generator.d.ts +2 -0
- package/dist-client/activity-summary-generator.js +114 -0
- package/dist-client/activity-summary-generator.js.map +1 -0
- package/dist-client/bootstrap.d.ts +2 -0
- package/dist-client/bootstrap.js +35 -0
- package/dist-client/bootstrap.js.map +1 -1
- package/dist-client/components/activity-starter-form.d.ts +1 -0
- package/dist-client/components/activity-starter-form.js +66 -4
- package/dist-client/components/activity-starter-form.js.map +1 -1
- package/dist-client/index.d.ts +1 -0
- package/dist-client/index.js +1 -0
- package/dist-client/index.js.map +1 -1
- package/dist-client/pages/activity-approval/activity-approval-page.d.ts +1 -0
- package/dist-client/pages/activity-approval/activity-approval-page.js +4 -48
- package/dist-client/pages/activity-approval/activity-approval-page.js.map +1 -1
- package/dist-client/pages/activity-thread/activity-thread-page.d.ts +1 -0
- package/dist-client/pages/activity-thread/activity-thread-page.js +4 -42
- package/dist-client/pages/activity-thread/activity-thread-page.js.map +1 -1
- package/dist-client/pages/installable-activity/installable-activity-list-page.d.ts +45 -0
- package/dist-client/pages/installable-activity/installable-activity-list-page.js +404 -0
- package/dist-client/pages/installable-activity/installable-activity-list-page.js.map +1 -0
- package/dist-client/pages/installable-activity/installable-activity-model-item-list.d.ts +1 -0
- package/dist-client/pages/installable-activity/installable-activity-model-item-list.js +20 -0
- package/dist-client/pages/installable-activity/installable-activity-model-item-list.js.map +1 -0
- package/dist-client/pages/installed-activity/installed-activity-list-page.d.ts +45 -0
- package/dist-client/pages/installed-activity/installed-activity-list-page.js +412 -0
- package/dist-client/pages/installed-activity/installed-activity-list-page.js.map +1 -0
- package/dist-client/pages/installed-activity/installed-activity-model-item-list.d.ts +1 -0
- package/dist-client/pages/installed-activity/installed-activity-model-item-list.js +20 -0
- package/dist-client/pages/installed-activity/installed-activity-model-item-list.js.map +1 -0
- package/dist-client/pages/todo/draft-list-page.js +9 -0
- package/dist-client/pages/todo/draft-list-page.js.map +1 -1
- package/dist-client/route.d.ts +1 -1
- package/dist-client/route.js +3 -0
- package/dist-client/route.js.map +1 -1
- package/dist-client/templates/activity-approval-context-template.d.ts +2 -0
- package/dist-client/templates/activity-approval-context-template.js +62 -0
- package/dist-client/templates/activity-approval-context-template.js.map +1 -0
- package/dist-client/templates/activity-context-template.d.ts +2 -0
- package/dist-client/templates/activity-context-template.js +62 -0
- package/dist-client/templates/activity-context-template.js.map +1 -0
- package/dist-client/templates/activity-thread-context-template.d.ts +2 -0
- package/dist-client/templates/activity-thread-context-template.js +57 -0
- package/dist-client/templates/activity-thread-context-template.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/controllers/activity-installation-controller.js +17 -0
- package/dist-server/controllers/activity-installation-controller.js.map +1 -0
- package/dist-server/controllers/activity-instance/post.js +3 -6
- package/dist-server/controllers/activity-instance/post.js.map +1 -1
- package/dist-server/controllers/activity-thread/submit.js.map +1 -1
- package/dist-server/controllers/call-webhook.js +4 -2
- package/dist-server/controllers/call-webhook.js.map +1 -1
- package/dist-server/controllers/common.js +44 -4
- package/dist-server/controllers/common.js.map +1 -1
- package/dist-server/controllers/index.js +4 -0
- package/dist-server/controllers/index.js.map +1 -1
- package/dist-server/index.js +1 -1
- package/dist-server/index.js.map +1 -1
- package/dist-server/service/activity/activity-model-type.js +1 -1
- package/dist-server/service/activity/activity-model-type.js.map +1 -1
- package/dist-server/service/activity/activity-query.js +1 -0
- package/dist-server/service/activity/activity-query.js.map +1 -1
- package/dist-server/service/activity-approval/event-subscriber.js +20 -6
- package/dist-server/service/activity-approval/event-subscriber.js.map +1 -1
- package/dist-server/service/activity-instance/activity-instance-query.js +40 -0
- package/dist-server/service/activity-instance/activity-instance-query.js.map +1 -1
- package/dist-server/service/activity-instance/activity-instance-type.js +13 -1
- package/dist-server/service/activity-instance/activity-instance-type.js.map +1 -1
- package/dist-server/service/activity-instance/activity-instance.js +25 -1
- package/dist-server/service/activity-instance/activity-instance.js.map +1 -1
- package/dist-server/service/index.js +4 -0
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/installable-activity/index.js +10 -0
- package/dist-server/service/installable-activity/index.js.map +1 -0
- package/dist-server/service/installable-activity/installable-activity-mutation.js +60 -0
- package/dist-server/service/installable-activity/installable-activity-mutation.js.map +1 -0
- package/dist-server/service/installable-activity/installable-activity-query.js +48 -0
- package/dist-server/service/installable-activity/installable-activity-query.js.map +1 -0
- package/dist-server/service/installable-activity/installable-activity-type.js +21 -0
- package/dist-server/service/installable-activity/installable-activity-type.js.map +1 -0
- package/dist-server/service/installable-activity/installable-activity.js +70 -0
- package/dist-server/service/installable-activity/installable-activity.js.map +1 -0
- package/dist-server/service/installed-activity/index.js +10 -0
- package/dist-server/service/installed-activity/index.js.map +1 -0
- package/dist-server/service/installed-activity/installed-activity-mutation.js +60 -0
- package/dist-server/service/installed-activity/installed-activity-mutation.js.map +1 -0
- package/dist-server/service/installed-activity/installed-activity-query.js +48 -0
- package/dist-server/service/installed-activity/installed-activity-query.js.map +1 -0
- package/dist-server/service/installed-activity/installed-activity-type.js +21 -0
- package/dist-server/service/installed-activity/installed-activity-type.js.map +1 -0
- package/dist-server/service/installed-activity/installed-activity.js +70 -0
- package/dist-server/service/installed-activity/installed-activity.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/server/controllers/activity-installation-controller.ts +17 -0
- package/server/controllers/activity-instance/post.ts +9 -9
- package/server/controllers/activity-thread/submit.ts +1 -1
- package/server/controllers/call-webhook.ts +5 -2
- package/server/controllers/common.ts +41 -5
- package/server/controllers/index.ts +1 -0
- package/server/index.ts +1 -1
- package/server/service/activity/activity-model-type.ts +3 -3
- package/server/service/activity/activity-query.ts +2 -1
- package/server/service/activity-approval/event-subscriber.ts +19 -7
- package/server/service/activity-instance/activity-instance-query.ts +44 -1
- package/server/service/activity-instance/activity-instance-type.ts +12 -4
- package/server/service/activity-instance/activity-instance.ts +17 -1
- package/server/service/index.ts +7 -0
- package/server/service/installable-activity/index.ts +7 -0
- package/server/service/installable-activity/installable-activity-mutation.ts +61 -0
- package/server/service/installable-activity/installable-activity-query.ts +36 -0
- package/server/service/installable-activity/installable-activity-type.ts +12 -0
- package/server/service/installable-activity/installable-activity.ts +49 -0
- package/things-factory.config.js +1 -0
- package/translations/en.json +3 -0
- package/translations/ko.json +3 -0
- package/translations/ms.json +3 -0
- package/translations/zh.json +3 -0
- package/server/controllers/activity-extension-controller.ts +0 -12
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import debounce from 'lodash-es/debounce'
|
|
2
|
+
import gql from 'graphql-tag'
|
|
3
|
+
import { client, subscribe } from '@operato/graphql'
|
|
4
|
+
import { AsyncLock } from '@operato/utils'
|
|
5
|
+
|
|
6
|
+
async function subscribeActivityInstance() {
|
|
7
|
+
return await subscribe(
|
|
8
|
+
{
|
|
9
|
+
query: gql`
|
|
10
|
+
subscription {
|
|
11
|
+
activityInstance {
|
|
12
|
+
name
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
`
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
next: async ({ data }) => {
|
|
19
|
+
if (data) {
|
|
20
|
+
fetchActivitySummary()
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async function subscribeActivityThread() {
|
|
28
|
+
return await subscribe(
|
|
29
|
+
{
|
|
30
|
+
query: gql`
|
|
31
|
+
subscription {
|
|
32
|
+
activityThread {
|
|
33
|
+
transaction
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
`
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
next: async ({ data }) => {
|
|
40
|
+
if (data) {
|
|
41
|
+
fetchActivitySummary()
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
async function subscribeActivityApproval() {
|
|
49
|
+
return await subscribe(
|
|
50
|
+
{
|
|
51
|
+
query: gql`
|
|
52
|
+
subscription {
|
|
53
|
+
activityApproval {
|
|
54
|
+
judgment
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
`
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
next: async ({ data }) => {
|
|
61
|
+
if (data) {
|
|
62
|
+
fetchActivitySummary()
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
var summary = {}
|
|
70
|
+
var generatorLocks = {
|
|
71
|
+
numberOfToDos: new AsyncLock(true),
|
|
72
|
+
numberOfApprovalWaitings: new AsyncLock(true),
|
|
73
|
+
numberOfPicks: new AsyncLock(true),
|
|
74
|
+
numberOfDrafts: new AsyncLock(true)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const fetchActivitySummary = debounce(async () => {
|
|
78
|
+
const response = await client.query({
|
|
79
|
+
query: gql`
|
|
80
|
+
query {
|
|
81
|
+
activitySummary {
|
|
82
|
+
numberOfToDos
|
|
83
|
+
numberOfApprovalWaitings
|
|
84
|
+
numberOfPicks
|
|
85
|
+
numberOfDrafts
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
`
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
if (response.data) {
|
|
92
|
+
const { numberOfToDos, numberOfApprovalWaitings, numberOfPicks, numberOfDrafts } = response.data.activitySummary
|
|
93
|
+
|
|
94
|
+
summary['numberOfToDos'] = numberOfToDos
|
|
95
|
+
summary['numberOfApprovalWaitings'] = numberOfApprovalWaitings
|
|
96
|
+
summary['numberOfPicks'] = numberOfPicks
|
|
97
|
+
summary['numberOfDrafts'] = numberOfDrafts
|
|
98
|
+
|
|
99
|
+
generatorLocks['numberOfToDos']?.unlock(numberOfToDos)
|
|
100
|
+
generatorLocks['numberOfApprovalWaitings']?.unlock(numberOfApprovalWaitings)
|
|
101
|
+
generatorLocks['numberOfPicks']?.unlock(numberOfPicks)
|
|
102
|
+
generatorLocks['numberOfDrafts']?.unlock(numberOfDrafts)
|
|
103
|
+
}
|
|
104
|
+
}, 1000)
|
|
105
|
+
|
|
106
|
+
export async function* generateActivitySummary(name: string) {
|
|
107
|
+
/* 1. 앞에 사용되었던 generator가 종료될 기회를 준다. */
|
|
108
|
+
generatorLocks[name]?.unlock()
|
|
109
|
+
|
|
110
|
+
/* 2. 마지막 값을 일단 yield 한다. */
|
|
111
|
+
yield summary[name]
|
|
112
|
+
|
|
113
|
+
while (true) {
|
|
114
|
+
generatorLocks[name].lock()
|
|
115
|
+
|
|
116
|
+
let badge = await generatorLocks[name].promise
|
|
117
|
+
if (badge === undefined) {
|
|
118
|
+
/* 새로운 generator가 생성된 경우이면, 기존 generator는 종료한다. */
|
|
119
|
+
return
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
yield badge
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export async function startSubscribeActivitySummary() {
|
|
127
|
+
await subscribeActivityInstance()
|
|
128
|
+
await subscribeActivityThread()
|
|
129
|
+
await subscribeActivityApproval()
|
|
130
|
+
|
|
131
|
+
fetchActivitySummary()
|
|
132
|
+
}
|
package/client/bootstrap.ts
CHANGED
|
@@ -1,10 +1,47 @@
|
|
|
1
|
+
import { html } from 'lit-html'
|
|
2
|
+
import { store } from '@operato/shell'
|
|
3
|
+
import { openOverlay, TOOL_POSITION } from '@operato/layout'
|
|
4
|
+
import { APPEND_CONTEXT_TOOL } from '@things-factory/context-ui'
|
|
5
|
+
|
|
1
6
|
import { registerEditor as registerGristEditor, registerRenderer as registerGristRenderer } from '@operato/data-grist'
|
|
2
7
|
import { OxGristEditorDuration } from '@operato/grist-editor/ox-grist-editor-duration.js'
|
|
3
8
|
import { OxGristEditorQuantifier } from '@operato/grist-editor/ox-grist-editor-quantifier.js'
|
|
4
9
|
import { OxGristRendererDuration } from '@operato/grist-editor/ox-grist-renderer-duration.js'
|
|
5
10
|
import { OxGristRendererQuantifier } from '@operato/grist-editor/ox-grist-renderer-quantifier.js'
|
|
6
11
|
|
|
12
|
+
import './templates/activity-approval-context-template.js'
|
|
13
|
+
import './templates/activity-thread-context-template.js'
|
|
14
|
+
|
|
7
15
|
export default function bootstrap() {
|
|
16
|
+
;[
|
|
17
|
+
{
|
|
18
|
+
template: html` <activity-approval-context-template></activity-approval-context-template> `,
|
|
19
|
+
context: 'activityApproval'
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
template: html` <activity-thread-context-template></activity-thread-context-template> `,
|
|
23
|
+
context: 'activityThread'
|
|
24
|
+
}
|
|
25
|
+
].forEach(({ template, context }) => {
|
|
26
|
+
store.dispatch({
|
|
27
|
+
type: APPEND_CONTEXT_TOOL,
|
|
28
|
+
tool: {
|
|
29
|
+
position: TOOL_POSITION.FRONT,
|
|
30
|
+
template: html`
|
|
31
|
+
<mwc-icon
|
|
32
|
+
@click=${async e => {
|
|
33
|
+
openOverlay('context-toolbar-overlay', {
|
|
34
|
+
template
|
|
35
|
+
})
|
|
36
|
+
}}
|
|
37
|
+
>info</mwc-icon
|
|
38
|
+
>
|
|
39
|
+
`,
|
|
40
|
+
context
|
|
41
|
+
}
|
|
42
|
+
})
|
|
43
|
+
})
|
|
44
|
+
|
|
8
45
|
registerGristEditor('duration', OxGristEditorDuration)
|
|
9
46
|
registerGristRenderer('duration', OxGristRendererDuration)
|
|
10
47
|
registerGristEditor('quantifier', OxGristEditorQuantifier)
|
|
@@ -77,6 +77,7 @@ export class ActivityStarterForm extends localize(i18next)(LitElement) {
|
|
|
77
77
|
input,
|
|
78
78
|
state,
|
|
79
79
|
approvalLine,
|
|
80
|
+
assignees,
|
|
80
81
|
threadsMin = 0,
|
|
81
82
|
threadsMax = 0
|
|
82
83
|
} = this.activityInstance || {}
|
|
@@ -123,6 +124,19 @@ export class ActivityStarterForm extends localize(i18next)(LitElement) {
|
|
|
123
124
|
/>
|
|
124
125
|
</section>
|
|
125
126
|
|
|
127
|
+
<section>
|
|
128
|
+
<label>Assignees</label>
|
|
129
|
+
${assignees
|
|
130
|
+
? html`
|
|
131
|
+
<assignees-view
|
|
132
|
+
.value=${assignees}
|
|
133
|
+
@click=${this.onClickAssignees.bind(this)}
|
|
134
|
+
@change=${e => (this.activityInstance.assignees = e.currentTarget.value)}
|
|
135
|
+
></assignees-view>
|
|
136
|
+
`
|
|
137
|
+
: html`<mwc-icon-button icon="group_add" @click=${this.onClickAssignees.bind(this)}></mwc-icon-button>`}
|
|
138
|
+
</section>
|
|
139
|
+
|
|
126
140
|
<section>
|
|
127
141
|
<label>Approval Line</label>
|
|
128
142
|
${approvalLine
|
|
@@ -130,6 +144,7 @@ export class ActivityStarterForm extends localize(i18next)(LitElement) {
|
|
|
130
144
|
<approval-line-view
|
|
131
145
|
.model=${approvalLine}
|
|
132
146
|
@click=${this.onClickApprovalLine.bind(this)}
|
|
147
|
+
@change=${e => (this.activityInstance.approvalLine = e.currentTarget.value)}
|
|
133
148
|
></approval-line-view>
|
|
134
149
|
`
|
|
135
150
|
: html`<mwc-icon-button icon="group_add" @click=${this.onClickApprovalLine.bind(this)}></mwc-icon-button>`}
|
|
@@ -230,6 +245,15 @@ export class ActivityStarterForm extends localize(i18next)(LitElement) {
|
|
|
230
245
|
description
|
|
231
246
|
input
|
|
232
247
|
state
|
|
248
|
+
assignees {
|
|
249
|
+
type
|
|
250
|
+
assignee {
|
|
251
|
+
id
|
|
252
|
+
name
|
|
253
|
+
description
|
|
254
|
+
controlNo
|
|
255
|
+
}
|
|
256
|
+
}
|
|
233
257
|
approvalLine {
|
|
234
258
|
type
|
|
235
259
|
approver {
|
|
@@ -260,7 +284,16 @@ export class ActivityStarterForm extends localize(i18next)(LitElement) {
|
|
|
260
284
|
}
|
|
261
285
|
|
|
262
286
|
async updateActivityInstance() {
|
|
263
|
-
const {
|
|
287
|
+
const {
|
|
288
|
+
id,
|
|
289
|
+
name,
|
|
290
|
+
description,
|
|
291
|
+
input,
|
|
292
|
+
threadsMin = 0,
|
|
293
|
+
threadsMax = 0,
|
|
294
|
+
assignees,
|
|
295
|
+
approvalLine
|
|
296
|
+
} = this.activityInstance
|
|
264
297
|
|
|
265
298
|
const patch = {
|
|
266
299
|
name: name || this.activity.name,
|
|
@@ -268,6 +301,7 @@ export class ActivityStarterForm extends localize(i18next)(LitElement) {
|
|
|
268
301
|
input,
|
|
269
302
|
threadsMin,
|
|
270
303
|
threadsMax,
|
|
304
|
+
assignees,
|
|
271
305
|
approvalLine
|
|
272
306
|
}
|
|
273
307
|
|
|
@@ -280,6 +314,15 @@ export class ActivityStarterForm extends localize(i18next)(LitElement) {
|
|
|
280
314
|
description
|
|
281
315
|
input
|
|
282
316
|
state
|
|
317
|
+
assignees {
|
|
318
|
+
type
|
|
319
|
+
assignee {
|
|
320
|
+
id
|
|
321
|
+
name
|
|
322
|
+
description
|
|
323
|
+
controlNo
|
|
324
|
+
}
|
|
325
|
+
}
|
|
283
326
|
approvalLine {
|
|
284
327
|
type
|
|
285
328
|
approver {
|
|
@@ -311,7 +354,16 @@ export class ActivityStarterForm extends localize(i18next)(LitElement) {
|
|
|
311
354
|
}
|
|
312
355
|
|
|
313
356
|
async postActivityInstance() {
|
|
314
|
-
const {
|
|
357
|
+
const {
|
|
358
|
+
id,
|
|
359
|
+
name,
|
|
360
|
+
description,
|
|
361
|
+
input,
|
|
362
|
+
threadsMin = 0,
|
|
363
|
+
threadsMax = 0,
|
|
364
|
+
assignees,
|
|
365
|
+
approvalLine
|
|
366
|
+
} = this.activityInstance
|
|
315
367
|
|
|
316
368
|
const activityInstance = {
|
|
317
369
|
id,
|
|
@@ -319,7 +371,9 @@ export class ActivityStarterForm extends localize(i18next)(LitElement) {
|
|
|
319
371
|
description: description || this.activity.description,
|
|
320
372
|
threadsMin,
|
|
321
373
|
threadsMax,
|
|
322
|
-
input
|
|
374
|
+
input,
|
|
375
|
+
assignees,
|
|
376
|
+
approvalLine
|
|
323
377
|
}
|
|
324
378
|
|
|
325
379
|
const response = await client.mutate({
|
|
@@ -331,6 +385,15 @@ export class ActivityStarterForm extends localize(i18next)(LitElement) {
|
|
|
331
385
|
description
|
|
332
386
|
input
|
|
333
387
|
state
|
|
388
|
+
assignees {
|
|
389
|
+
type
|
|
390
|
+
assignee {
|
|
391
|
+
id
|
|
392
|
+
name
|
|
393
|
+
description
|
|
394
|
+
controlNo
|
|
395
|
+
}
|
|
396
|
+
}
|
|
334
397
|
approvalLine {
|
|
335
398
|
type
|
|
336
399
|
approver {
|
|
@@ -360,6 +423,29 @@ export class ActivityStarterForm extends localize(i18next)(LitElement) {
|
|
|
360
423
|
}
|
|
361
424
|
}
|
|
362
425
|
|
|
426
|
+
onClickAssignees() {
|
|
427
|
+
const { assignees } = this.activityInstance || {}
|
|
428
|
+
|
|
429
|
+
const popup = openPopup(
|
|
430
|
+
html`
|
|
431
|
+
<assignees-editor-popup
|
|
432
|
+
.value=${assignees}
|
|
433
|
+
.confirmCallback=${value => {
|
|
434
|
+
this.activityInstance.assignees = value
|
|
435
|
+
this.requestUpdate()
|
|
436
|
+
}}
|
|
437
|
+
></assignees-editor-popup>
|
|
438
|
+
`,
|
|
439
|
+
{
|
|
440
|
+
backdrop: true,
|
|
441
|
+
help: 'organization/assignees-editor',
|
|
442
|
+
size: 'large',
|
|
443
|
+
title: i18next.t('title.assignee list')
|
|
444
|
+
}
|
|
445
|
+
)
|
|
446
|
+
popup.onclosed = () => {}
|
|
447
|
+
}
|
|
448
|
+
|
|
363
449
|
onClickApprovalLine() {
|
|
364
450
|
const { approvalLine } = this.activityInstance || {}
|
|
365
451
|
|
package/client/index.ts
CHANGED
|
@@ -15,8 +15,6 @@ import { PageView, store } from '@operato/shell'
|
|
|
15
15
|
import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
|
16
16
|
import { provider } from '@things-factory/board-ui'
|
|
17
17
|
|
|
18
|
-
const formatter = new Intl.DateTimeFormat(navigator.language, { dateStyle: 'full', timeStyle: 'short' })
|
|
19
|
-
|
|
20
18
|
const ActivityApprovalFetchResult = `\
|
|
21
19
|
{
|
|
22
20
|
id
|
|
@@ -100,23 +98,6 @@ export class ActivityApprovalPage extends connect(store)(localize(i18next)(PageV
|
|
|
100
98
|
overflow: auto;
|
|
101
99
|
}
|
|
102
100
|
|
|
103
|
-
[header] {
|
|
104
|
-
display: flex;
|
|
105
|
-
padding: 5px;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
[header] > div {
|
|
109
|
-
flex: 1;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
[content] {
|
|
113
|
-
clear: left;
|
|
114
|
-
|
|
115
|
-
flex: 1;
|
|
116
|
-
display: block;
|
|
117
|
-
padding: 5px;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
101
|
ox-board-viewer {
|
|
121
102
|
width: 100%;
|
|
122
103
|
height: 100%;
|
|
@@ -154,41 +135,13 @@ export class ActivityApprovalPage extends connect(store)(localize(i18next)(PageV
|
|
|
154
135
|
action: this._saveActivityApproval.bind(this),
|
|
155
136
|
...CommonButtonStyles.save
|
|
156
137
|
}
|
|
157
|
-
]
|
|
138
|
+
],
|
|
139
|
+
activityApproval: this.activityApproval
|
|
158
140
|
}
|
|
159
141
|
}
|
|
160
142
|
|
|
161
143
|
render() {
|
|
162
|
-
|
|
163
|
-
const { state, dueAt, assignedAt, assignee, activityInstance } = this.activityThread || {}
|
|
164
|
-
const { name, description, thumbnail, approvalLine } = activityInstance || {}
|
|
165
|
-
|
|
166
|
-
return html`
|
|
167
|
-
<div header>
|
|
168
|
-
<div>
|
|
169
|
-
<div>name: ${name}</div>
|
|
170
|
-
<div>description: ${description}</div>
|
|
171
|
-
<div>state: ${state}</div>
|
|
172
|
-
<div>round: ${round}</div>
|
|
173
|
-
<div>order: ${order}</div>
|
|
174
|
-
<div>assigned at: ${assignedAt && formatter.format(new Date(assignedAt))}</div>
|
|
175
|
-
<div>due at: ${dueAt && formatter.format(new Date(dueAt))}</div>
|
|
176
|
-
<div>assignee: ${assignee?.name}</div>
|
|
177
|
-
<div>approver: ${approver?.name}</div>
|
|
178
|
-
<div>waited since: ${createdAt && formatter.format(new Date(createdAt))}</div>
|
|
179
|
-
</div>
|
|
180
|
-
<div>
|
|
181
|
-
<div approval-line>
|
|
182
|
-
${approvalLine
|
|
183
|
-
? html` <approval-line-view .model=${approvalLine} .current=${order}></approval-line-view> `
|
|
184
|
-
: html``}
|
|
185
|
-
</div>
|
|
186
|
-
<img src=${thumbnail} />
|
|
187
|
-
</div>
|
|
188
|
-
</div>
|
|
189
|
-
|
|
190
|
-
<div content>${this.activityContent()}</div>
|
|
191
|
-
`
|
|
144
|
+
return html` ${this.activityContent()}`
|
|
192
145
|
}
|
|
193
146
|
|
|
194
147
|
activityContent() {
|
|
@@ -341,6 +294,8 @@ export class ActivityApprovalPage extends connect(store)(localize(i18next)(PageV
|
|
|
341
294
|
|
|
342
295
|
this.activityApproval = response.data.activityApproval
|
|
343
296
|
this.activityThread = this.activityApproval.activityThread
|
|
297
|
+
|
|
298
|
+
this.updateContext()
|
|
344
299
|
}
|
|
345
300
|
|
|
346
301
|
async _rejectActivityApproval() {
|
|
@@ -15,8 +15,6 @@ import { PageView, store } from '@operato/shell'
|
|
|
15
15
|
import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
|
16
16
|
import { provider } from '@things-factory/board-ui'
|
|
17
17
|
|
|
18
|
-
const formatter = new Intl.DateTimeFormat(navigator.language, { dateStyle: 'full', timeStyle: 'short' })
|
|
19
|
-
|
|
20
18
|
const ActivityThreadFetchResult = `\
|
|
21
19
|
{
|
|
22
20
|
id
|
|
@@ -91,23 +89,6 @@ export class ActivityThreadPage extends connect(store)(localize(i18next)(PageVie
|
|
|
91
89
|
overflow: auto;
|
|
92
90
|
}
|
|
93
91
|
|
|
94
|
-
[header] {
|
|
95
|
-
display: flex;
|
|
96
|
-
padding: 5px;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
[header] > div {
|
|
100
|
-
flex: 1;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
[content] {
|
|
104
|
-
clear: left;
|
|
105
|
-
|
|
106
|
-
flex: 1;
|
|
107
|
-
display: block;
|
|
108
|
-
padding: 5px;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
92
|
ox-board-viewer {
|
|
112
93
|
width: 100%;
|
|
113
94
|
height: 100%;
|
|
@@ -167,35 +148,13 @@ export class ActivityThreadPage extends connect(store)(localize(i18next)(PageVie
|
|
|
167
148
|
action: this._abortActivityThread.bind(this),
|
|
168
149
|
...CommonButtonStyles.cancel
|
|
169
150
|
}
|
|
170
|
-
].filter(Boolean /* truthy only */)
|
|
151
|
+
].filter(Boolean /* truthy only */),
|
|
152
|
+
activityThread: this.activityThread
|
|
171
153
|
}
|
|
172
154
|
}
|
|
173
155
|
|
|
174
156
|
render() {
|
|
175
|
-
|
|
176
|
-
const { name, description, thumbnail, approvalLine } = activityInstance || {}
|
|
177
|
-
|
|
178
|
-
return html`
|
|
179
|
-
<div header>
|
|
180
|
-
<div>
|
|
181
|
-
<div>name: ${name}</div>
|
|
182
|
-
<div>description: ${description}</div>
|
|
183
|
-
<div>state: ${state}</div>
|
|
184
|
-
<div>round: ${round}</div>
|
|
185
|
-
<div>assigned at: ${assignedAt && formatter.format(new Date(assignedAt))}</div>
|
|
186
|
-
<div>due at: ${dueAt && formatter.format(new Date(dueAt))}</div>
|
|
187
|
-
<div>assignee: ${assignee?.name}</div>
|
|
188
|
-
</div>
|
|
189
|
-
<div>
|
|
190
|
-
<div approval-line>
|
|
191
|
-
${approvalLine ? html` <approval-line-view .model=${approvalLine}></approval-line-view> ` : html``}
|
|
192
|
-
</div>
|
|
193
|
-
<img src=${thumbnail} />
|
|
194
|
-
</div>
|
|
195
|
-
</div>
|
|
196
|
-
|
|
197
|
-
<div content>${this.activityContent()}</div>
|
|
198
|
-
`
|
|
157
|
+
return html` ${this.activityContent()}`
|
|
199
158
|
}
|
|
200
159
|
|
|
201
160
|
activityContent() {
|
|
@@ -347,6 +306,8 @@ export class ActivityThreadPage extends connect(store)(localize(i18next)(PageVie
|
|
|
347
306
|
})
|
|
348
307
|
|
|
349
308
|
this.activityThread = response.data.activityThread
|
|
309
|
+
|
|
310
|
+
this.updateContext()
|
|
350
311
|
}
|
|
351
312
|
|
|
352
313
|
async _startActivityThread() {
|