@things-factory/worklist 6.0.26 → 6.0.28
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/bootstrap.ts +13 -4
- package/client/components/activity-starter-form.ts +41 -10
- package/client/grist-editor/grist-editor-activity-search-key.ts +79 -0
- package/client/grist-editor/popup-activity-search-keys-input.ts +167 -0
- package/client/pages/activity/activity-list-page.ts +74 -11
- package/client/pages/activity/activity-partial-view.ts +82 -0
- package/client/pages/activity/starter-list-page.ts +1 -0
- package/client/pages/activity-approval/activity-approval-page.ts +61 -14
- package/client/pages/activity-instance/activity-instance-page.ts +18 -0
- package/client/pages/activity-instance/activity-instance-search-page.ts +377 -0
- package/client/pages/activity-instance/activity-instance-view.ts +135 -0
- package/client/pages/activity-store/activity-store-page.ts +1 -1
- package/client/pages/activity-template/activity-template-list-page.ts +1 -1
- package/client/pages/activity-thread/activity-thread-page.ts +32 -6
- package/client/pages/activity-thread/activity-thread-view.ts +102 -0
- package/client/pages/installable-activity/installable-activity-list-page.ts +1 -1
- package/client/pages/todo/approval-waiting-list-page.ts +12 -2
- package/client/pages/todo/draft-list-page.ts +19 -5
- package/client/pages/todo/todo-list-page.ts +14 -3
- package/client/route.ts +4 -0
- package/client/types/activity-instance-type.ts +123 -0
- package/client/types/activity-instance.ts +124 -0
- package/client/types/activity-model-type.ts +40 -0
- package/client/types/activity-search-key-item-type.ts +9 -0
- package/client/types/activity-thread-type.ts +19 -0
- package/client/types/activity-thread.ts +88 -0
- package/client/types/activity.ts +97 -0
- package/client/{types.js → types/types.ts} +1 -9
- package/dist-client/bootstrap.d.ts +1 -0
- package/dist-client/bootstrap.js +7 -3
- package/dist-client/bootstrap.js.map +1 -1
- package/dist-client/components/activity-starter-form.d.ts +1 -1
- package/dist-client/components/activity-starter-form.js +40 -9
- package/dist-client/components/activity-starter-form.js.map +1 -1
- package/dist-client/grist-editor/grist-editor-activity-search-key.d.ts +12 -0
- package/dist-client/grist-editor/grist-editor-activity-search-key.js +70 -0
- package/dist-client/grist-editor/grist-editor-activity-search-key.js.map +1 -0
- package/dist-client/grist-editor/popup-activity-search-keys-input.d.ts +17 -0
- package/dist-client/grist-editor/popup-activity-search-keys-input.js +177 -0
- package/dist-client/grist-editor/popup-activity-search-keys-input.js.map +1 -0
- package/dist-client/pages/activity/activity-list-page.d.ts +4 -0
- package/dist-client/pages/activity/activity-list-page.js +73 -11
- package/dist-client/pages/activity/activity-list-page.js.map +1 -1
- package/dist-client/pages/activity/activity-partial-view.d.ts +13 -0
- package/dist-client/pages/activity/activity-partial-view.js +56 -0
- package/dist-client/pages/activity/activity-partial-view.js.map +1 -0
- package/dist-client/pages/activity/starter-list-page.js.map +1 -1
- package/dist-client/pages/activity-approval/activity-approval-page.d.ts +2 -2
- package/dist-client/pages/activity-approval/activity-approval-page.js +59 -14
- package/dist-client/pages/activity-approval/activity-approval-page.js.map +1 -1
- package/dist-client/pages/activity-instance/activity-instance-page.d.ts +2 -1
- package/dist-client/pages/activity-instance/activity-instance-page.js +15 -0
- package/dist-client/pages/activity-instance/activity-instance-page.js.map +1 -1
- package/dist-client/pages/activity-instance/activity-instance-search-page.d.ts +76 -0
- package/dist-client/pages/activity-instance/activity-instance-search-page.js +371 -0
- package/dist-client/pages/activity-instance/activity-instance-search-page.js.map +1 -0
- package/dist-client/pages/activity-instance/activity-instance-view.d.ts +14 -0
- package/dist-client/pages/activity-instance/activity-instance-view.js +130 -0
- package/dist-client/pages/activity-instance/activity-instance-view.js.map +1 -0
- package/dist-client/pages/activity-store/activity-store-page.js +1 -1
- package/dist-client/pages/activity-store/activity-store-page.js.map +1 -1
- package/dist-client/pages/activity-template/activity-template-list-page.js +1 -1
- package/dist-client/pages/activity-template/activity-template-list-page.js.map +1 -1
- package/dist-client/pages/activity-thread/activity-thread-page.d.ts +2 -2
- package/dist-client/pages/activity-thread/activity-thread-page.js +29 -6
- package/dist-client/pages/activity-thread/activity-thread-page.js.map +1 -1
- package/dist-client/pages/activity-thread/activity-thread-view.d.ts +11 -0
- package/dist-client/pages/activity-thread/activity-thread-view.js +103 -0
- package/dist-client/pages/activity-thread/activity-thread-view.js.map +1 -0
- package/dist-client/pages/installable-activity/installable-activity-list-page.js +1 -1
- package/dist-client/pages/installable-activity/installable-activity-list-page.js.map +1 -1
- package/dist-client/pages/todo/approval-waiting-list-page.js +12 -2
- package/dist-client/pages/todo/approval-waiting-list-page.js.map +1 -1
- package/dist-client/pages/todo/draft-list-page.d.ts +4 -8
- package/dist-client/pages/todo/draft-list-page.js +16 -3
- package/dist-client/pages/todo/draft-list-page.js.map +1 -1
- package/dist-client/pages/todo/todo-list-page.js +13 -3
- package/dist-client/pages/todo/todo-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/tsconfig.tsbuildinfo +1 -1
- package/dist-client/types/activity-instance-type.d.ts +76 -0
- package/dist-client/types/activity-instance-type.js +11 -0
- package/dist-client/types/activity-instance-type.js.map +1 -0
- package/dist-client/types/activity-instance.d.ts +70 -0
- package/dist-client/types/activity-instance.js +36 -0
- package/dist-client/types/activity-instance.js.map +1 -0
- package/dist-client/types/activity-model-type.d.ts +31 -0
- package/dist-client/types/activity-model-type.js +18 -0
- package/dist-client/types/activity-model-type.js.map +1 -0
- package/dist-client/types/activity-search-key-item-type.d.ts +6 -0
- package/dist-client/types/activity-search-key-item-type.js +3 -0
- package/dist-client/types/activity-search-key-item-type.js.map +1 -0
- package/dist-client/types/activity-thread-type.d.ts +15 -0
- package/dist-client/types/activity-thread-type.js +7 -0
- package/dist-client/types/activity-thread-type.js.map +1 -0
- package/dist-client/types/activity-thread.d.ts +37 -0
- package/dist-client/types/activity-thread.js +51 -0
- package/dist-client/types/activity-thread.js.map +1 -0
- package/dist-client/types/activity.d.ts +62 -0
- package/dist-client/types/activity.js +35 -0
- package/dist-client/types/activity.js.map +1 -0
- package/dist-client/types/types.d.ts +15 -0
- package/dist-client/types/types.js +30 -0
- package/dist-client/types/types.js.map +1 -0
- package/dist-client/types.js +1 -0
- package/dist-client/types.js.map +1 -1
- package/dist-server/controllers/activity-approval/approve.js +3 -1
- package/dist-server/controllers/activity-approval/approve.js.map +1 -1
- package/dist-server/controllers/activity-approval/reject.js +2 -0
- package/dist-server/controllers/activity-approval/reject.js.map +1 -1
- package/dist-server/controllers/activity-installation/activity-installation-controller.js +25 -0
- package/dist-server/controllers/activity-installation/activity-installation-controller.js.map +1 -0
- package/dist-server/controllers/activity-installation/call-webhook.js +41 -0
- package/dist-server/controllers/activity-installation/call-webhook.js.map +1 -0
- package/dist-server/controllers/activity-installation/callback-registry.js +21 -0
- package/dist-server/controllers/activity-installation/callback-registry.js.map +1 -0
- package/dist-server/controllers/activity-instance/abort.js +1 -1
- package/dist-server/controllers/activity-instance/abort.js.map +1 -1
- package/dist-server/controllers/activity-instance/adjust.js +1 -1
- package/dist-server/controllers/activity-instance/adjust.js.map +1 -1
- package/dist-server/controllers/activity-instance/delegate.js +5 -0
- package/dist-server/controllers/activity-instance/delegate.js.map +1 -1
- package/dist-server/controllers/activity-instance/draft.js +27 -1
- package/dist-server/controllers/activity-instance/draft.js.map +1 -1
- package/dist-server/controllers/activity-instance/post.js +39 -4
- package/dist-server/controllers/activity-instance/post.js.map +1 -1
- package/dist-server/controllers/activity-instance/start.js +1 -1
- package/dist-server/controllers/activity-instance/start.js.map +1 -1
- package/dist-server/controllers/activity-thread/submit.js +2 -2
- package/dist-server/controllers/activity-thread/submit.js.map +1 -1
- package/dist-server/controllers/common.js +105 -57
- package/dist-server/controllers/common.js.map +1 -1
- package/dist-server/controllers/index.js +1 -1
- package/dist-server/controllers/index.js.map +1 -1
- package/dist-server/service/activity/activity-history.js +15 -0
- package/dist-server/service/activity/activity-history.js.map +1 -1
- package/dist-server/service/activity/activity-search-key-item-type.js +28 -0
- package/dist-server/service/activity/activity-search-key-item-type.js.map +1 -0
- package/dist-server/service/activity/activity-type.js +32 -0
- package/dist-server/service/activity/activity-type.js.map +1 -1
- package/dist-server/service/activity/activity.js +25 -3
- package/dist-server/service/activity/activity.js.map +1 -1
- package/dist-server/service/activity-approval/event-subscriber.js +1 -1
- package/dist-server/service/activity-approval/event-subscriber.js.map +1 -1
- package/dist-server/service/activity-instance/activity-instance-history.js +53 -0
- package/dist-server/service/activity-instance/activity-instance-history.js.map +1 -1
- package/dist-server/service/activity-instance/activity-instance-query.js +70 -0
- package/dist-server/service/activity-instance/activity-instance-query.js.map +1 -1
- package/dist-server/service/activity-instance/activity-instance.js +53 -0
- package/dist-server/service/activity-instance/activity-instance.js.map +1 -1
- package/dist-server/service/activity-instance/event-subscriber.js +4 -4
- package/dist-server/service/activity-instance/event-subscriber.js.map +1 -1
- package/dist-server/service/activity-thread/activity-thread.js +4 -1
- package/dist-server/service/activity-thread/activity-thread.js.map +1 -1
- package/dist-server/service/installable-activity/installable-activity-mutation.js +1 -1
- package/dist-server/service/installable-activity/installable-activity-mutation.js.map +1 -1
- package/dist-server/service/installable-activity/installable-activity-query.js +1 -1
- package/dist-server/service/installable-activity/installable-activity-query.js.map +1 -1
- package/dist-server/service/installable-activity/installable-activity.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -7
- package/server/controllers/activity-approval/approve.ts +5 -2
- package/server/controllers/activity-approval/reject.ts +3 -0
- package/server/controllers/{activity-installation-controller.ts → activity-installation/activity-installation-controller.ts} +12 -1
- package/server/controllers/activity-instance/abort.ts +1 -1
- package/server/controllers/activity-instance/adjust.ts +1 -1
- package/server/controllers/activity-instance/delegate.ts +9 -1
- package/server/controllers/activity-instance/draft.ts +30 -3
- package/server/controllers/activity-instance/post.ts +55 -7
- package/server/controllers/activity-instance/start.ts +1 -1
- package/server/controllers/activity-thread/submit.ts +3 -2
- package/server/controllers/common.ts +133 -56
- package/server/controllers/index.ts +1 -1
- package/server/service/activity/activity-history.ts +13 -0
- package/server/service/activity/activity-search-key-item-type.ts +16 -0
- package/server/service/activity/activity-type.ts +28 -1
- package/server/service/activity/activity.ts +22 -3
- package/server/service/activity-approval/event-subscriber.ts +1 -1
- package/server/service/activity-instance/activity-instance-history.ts +41 -0
- package/server/service/activity-instance/activity-instance-query.ts +74 -1
- package/server/service/activity-instance/activity-instance.ts +41 -0
- package/server/service/activity-instance/event-subscriber.ts +4 -4
- package/server/service/activity-thread/activity-thread.ts +6 -3
- package/server/service/installable-activity/installable-activity-mutation.ts +1 -1
- package/server/service/installable-activity/installable-activity-query.ts +1 -1
- package/server/service/installable-activity/installable-activity.ts +3 -1
- package/things-factory.config.js +5 -5
- package/translations/en.json +5 -0
- package/translations/ko.json +5 -0
- package/translations/ms.json +5 -0
- package/translations/zh.json +5 -0
- package/dist-client/pages/installed-activity/installed-activity-list-page.d.ts +0 -45
- package/dist-client/pages/installed-activity/installed-activity-list-page.js +0 -412
- package/dist-client/pages/installed-activity/installed-activity-list-page.js.map +0 -1
- package/dist-client/pages/installed-activity/installed-activity-model-item-list.d.ts +0 -1
- package/dist-client/pages/installed-activity/installed-activity-model-item-list.js +0 -20
- package/dist-client/pages/installed-activity/installed-activity-model-item-list.js.map +0 -1
- package/dist-client/templates/activity-context-template.d.ts +0 -2
- package/dist-client/templates/activity-context-template.js +0 -62
- package/dist-client/templates/activity-context-template.js.map +0 -1
- package/dist-server/service/installed-activity/index.js +0 -10
- package/dist-server/service/installed-activity/index.js.map +0 -1
- package/dist-server/service/installed-activity/installed-activity-mutation.js +0 -60
- package/dist-server/service/installed-activity/installed-activity-mutation.js.map +0 -1
- package/dist-server/service/installed-activity/installed-activity-query.js +0 -48
- package/dist-server/service/installed-activity/installed-activity-query.js.map +0 -1
- package/dist-server/service/installed-activity/installed-activity-type.js +0 -21
- package/dist-server/service/installed-activity/installed-activity-type.js.map +0 -1
- package/dist-server/service/installed-activity/installed-activity.js +0 -70
- package/dist-server/service/installed-activity/installed-activity.js.map +0 -1
- /package/server/controllers/{call-webhook.ts → activity-installation/call-webhook.ts} +0 -0
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import '@operato/property-editor/ox-properties-dynamic-view.js'
|
|
2
2
|
import '@operato/board/ox-board-viewer.js'
|
|
3
|
-
import '@things-factory/organization'
|
|
4
3
|
|
|
5
4
|
import gql from 'graphql-tag'
|
|
6
5
|
import { css, html } from 'lit'
|
|
7
6
|
import { unsafeHTML } from 'lit-html/directives/unsafe-html.js'
|
|
8
|
-
import { customElement, property, query } from 'lit/decorators.js'
|
|
7
|
+
import { customElement, property, query, state } from 'lit/decorators.js'
|
|
9
8
|
import { keyed } from 'lit/directives/keyed.js'
|
|
10
9
|
import { connect } from 'pwa-helpers/connect-mixin.js'
|
|
11
10
|
|
|
@@ -57,6 +56,7 @@ const ActivityApprovalFetchResult = `\
|
|
|
57
56
|
}
|
|
58
57
|
approvalLine {
|
|
59
58
|
type
|
|
59
|
+
value
|
|
60
60
|
approver {
|
|
61
61
|
id
|
|
62
62
|
name
|
|
@@ -92,6 +92,7 @@ export class ActivityApprovalPage extends connect(store)(localize(i18next)(PageV
|
|
|
92
92
|
:host {
|
|
93
93
|
display: flex;
|
|
94
94
|
flex-direction: column;
|
|
95
|
+
position: relative;
|
|
95
96
|
|
|
96
97
|
width: 100%;
|
|
97
98
|
padding: 5px;
|
|
@@ -102,12 +103,36 @@ export class ActivityApprovalPage extends connect(store)(localize(i18next)(PageV
|
|
|
102
103
|
width: 100%;
|
|
103
104
|
height: 100%;
|
|
104
105
|
}
|
|
106
|
+
|
|
107
|
+
#custom-content {
|
|
108
|
+
flex: 1;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
div[comment] {
|
|
112
|
+
display: flex;
|
|
113
|
+
width: 100%;
|
|
114
|
+
height: 100px;
|
|
115
|
+
right: 0;
|
|
116
|
+
bottom: 0;
|
|
117
|
+
margin: 0;
|
|
118
|
+
padding: 0;
|
|
119
|
+
opacity: 0.8;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
textarea {
|
|
123
|
+
flex: 1;
|
|
124
|
+
padding: 10px;
|
|
125
|
+
resize: none;
|
|
126
|
+
background-color: black;
|
|
127
|
+
color: yellow;
|
|
128
|
+
outline: none;
|
|
129
|
+
}
|
|
105
130
|
`
|
|
106
131
|
]
|
|
107
132
|
|
|
108
|
-
@
|
|
109
|
-
@
|
|
110
|
-
@
|
|
133
|
+
@state() activityApproval: any
|
|
134
|
+
@state() activityThread: any
|
|
135
|
+
@state() board: any
|
|
111
136
|
|
|
112
137
|
get context() {
|
|
113
138
|
const judgment = this.activityApproval?.judgment
|
|
@@ -141,7 +166,18 @@ export class ActivityApprovalPage extends connect(store)(localize(i18next)(PageV
|
|
|
141
166
|
}
|
|
142
167
|
|
|
143
168
|
render() {
|
|
144
|
-
return html`
|
|
169
|
+
return html`
|
|
170
|
+
${this.activityContent()}
|
|
171
|
+
<div comment>
|
|
172
|
+
<textarea
|
|
173
|
+
placeholder="Jot down your comment here."
|
|
174
|
+
.value=${this.activityApproval?.comment}
|
|
175
|
+
@change=${(e: Event) => {
|
|
176
|
+
this.activityApproval.comment = (e.target as HTMLTextAreaElement).value
|
|
177
|
+
}}
|
|
178
|
+
></textarea>
|
|
179
|
+
</div>
|
|
180
|
+
`
|
|
145
181
|
}
|
|
146
182
|
|
|
147
183
|
activityContent() {
|
|
@@ -152,6 +188,8 @@ export class ActivityApprovalPage extends connect(store)(localize(i18next)(PageV
|
|
|
152
188
|
return this.generatedContent()
|
|
153
189
|
case 'board':
|
|
154
190
|
return this.boardContent()
|
|
191
|
+
case 'custom-element':
|
|
192
|
+
return this.customElementContent()
|
|
155
193
|
case 'page':
|
|
156
194
|
case 'external':
|
|
157
195
|
default:
|
|
@@ -207,7 +245,7 @@ export class ActivityApprovalPage extends connect(store)(localize(i18next)(PageV
|
|
|
207
245
|
}
|
|
208
246
|
|
|
209
247
|
return keyed(
|
|
210
|
-
|
|
248
|
+
this.activityApproval.id,
|
|
211
249
|
html`
|
|
212
250
|
<fieldset>
|
|
213
251
|
<legend>Input</legend>
|
|
@@ -242,7 +280,7 @@ export class ActivityApprovalPage extends connect(store)(localize(i18next)(PageV
|
|
|
242
280
|
}
|
|
243
281
|
|
|
244
282
|
return keyed(
|
|
245
|
-
|
|
283
|
+
this.activityApproval.id,
|
|
246
284
|
html`
|
|
247
285
|
<ox-board-viewer
|
|
248
286
|
style="background-color: white;"
|
|
@@ -256,6 +294,18 @@ export class ActivityApprovalPage extends connect(store)(localize(i18next)(PageV
|
|
|
256
294
|
)
|
|
257
295
|
}
|
|
258
296
|
|
|
297
|
+
customElementContent() {
|
|
298
|
+
const { output, activityInstance } = this.activityThread
|
|
299
|
+
const { uiSource: tagName, input } = activityInstance || {}
|
|
300
|
+
|
|
301
|
+
const element = document.createElement(tagName)
|
|
302
|
+
element.id = 'custom-content'
|
|
303
|
+
element.input = input
|
|
304
|
+
element.output = output
|
|
305
|
+
|
|
306
|
+
return element
|
|
307
|
+
}
|
|
308
|
+
|
|
259
309
|
@query('ox-board-viewer') oxBoardViewer: any
|
|
260
310
|
|
|
261
311
|
getOutputFromBoard() {
|
|
@@ -299,8 +349,7 @@ export class ActivityApprovalPage extends connect(store)(localize(i18next)(PageV
|
|
|
299
349
|
}
|
|
300
350
|
|
|
301
351
|
async _rejectActivityApproval() {
|
|
302
|
-
var { id } = this.activityApproval
|
|
303
|
-
var comment = 'xxxxxxxxxxxxxxxxxxx'
|
|
352
|
+
var { id, comment } = this.activityApproval
|
|
304
353
|
|
|
305
354
|
const response = await client.mutate({
|
|
306
355
|
mutation: gql`
|
|
@@ -328,8 +377,7 @@ export class ActivityApprovalPage extends connect(store)(localize(i18next)(PageV
|
|
|
328
377
|
}
|
|
329
378
|
|
|
330
379
|
async _approveActivityApproval() {
|
|
331
|
-
var { id } = this.activityApproval
|
|
332
|
-
var comment = 'xxxxxxxxxxxxxxxxxxx'
|
|
380
|
+
var { id, comment } = this.activityApproval
|
|
333
381
|
|
|
334
382
|
const response = await client.mutate({
|
|
335
383
|
mutation: gql`
|
|
@@ -357,8 +405,7 @@ export class ActivityApprovalPage extends connect(store)(localize(i18next)(PageV
|
|
|
357
405
|
}
|
|
358
406
|
|
|
359
407
|
async _saveActivityApproval() {
|
|
360
|
-
var { id } = this.activityApproval
|
|
361
|
-
var comment = 'yyyyyyyyyyyyyyyyyyy'
|
|
408
|
+
var { id, comment } = this.activityApproval
|
|
362
409
|
|
|
363
410
|
const response = await client.mutate({
|
|
364
411
|
mutation: gql`
|
|
@@ -57,6 +57,10 @@ export class ActivityInstancePage extends connect(store)(localize(i18next)(PageV
|
|
|
57
57
|
width: 100%;
|
|
58
58
|
height: 100%;
|
|
59
59
|
}
|
|
60
|
+
|
|
61
|
+
#custom-content {
|
|
62
|
+
flex: 1;
|
|
63
|
+
}
|
|
60
64
|
`
|
|
61
65
|
]
|
|
62
66
|
|
|
@@ -111,6 +115,8 @@ export class ActivityInstancePage extends connect(store)(localize(i18next)(PageV
|
|
|
111
115
|
return this.generatedContent()
|
|
112
116
|
case 'board':
|
|
113
117
|
return this.boardContent()
|
|
118
|
+
case 'custom-element':
|
|
119
|
+
return this.customElementContent()
|
|
114
120
|
case 'page':
|
|
115
121
|
case 'external':
|
|
116
122
|
default:
|
|
@@ -203,6 +209,17 @@ export class ActivityInstancePage extends connect(store)(localize(i18next)(PageV
|
|
|
203
209
|
`
|
|
204
210
|
}
|
|
205
211
|
|
|
212
|
+
customElementContent() {
|
|
213
|
+
const { uiSource: tagName, input, output } = this.activityInstance
|
|
214
|
+
|
|
215
|
+
const element = document.createElement(tagName)
|
|
216
|
+
element.id = 'custom-content'
|
|
217
|
+
element.input = input
|
|
218
|
+
element.output = output
|
|
219
|
+
|
|
220
|
+
return element
|
|
221
|
+
}
|
|
222
|
+
|
|
206
223
|
getOutputFromBoard() {
|
|
207
224
|
const outputSpec = this.getOutputSpec()
|
|
208
225
|
const data = this.viewer?.getSceneValues() || {}
|
|
@@ -255,6 +272,7 @@ export class ActivityInstancePage extends connect(store)(localize(i18next)(PageV
|
|
|
255
272
|
uiSource
|
|
256
273
|
approvalLine {
|
|
257
274
|
type
|
|
275
|
+
value
|
|
258
276
|
approver {
|
|
259
277
|
id
|
|
260
278
|
name
|
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
import '@operato/data-grist'
|
|
2
|
+
import './activity-instance-view.js'
|
|
3
|
+
|
|
4
|
+
import gql from 'graphql-tag'
|
|
5
|
+
import { css, html } from 'lit'
|
|
6
|
+
import { customElement, property, query, state } from 'lit/decorators.js'
|
|
7
|
+
import { connect } from 'pwa-helpers/connect-mixin'
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
getEditor,
|
|
11
|
+
getRenderer,
|
|
12
|
+
ColumnConfig,
|
|
13
|
+
DataGrist,
|
|
14
|
+
FetchOption,
|
|
15
|
+
SortersControl,
|
|
16
|
+
GristRecord
|
|
17
|
+
} from '@operato/data-grist'
|
|
18
|
+
import { client } from '@operato/graphql'
|
|
19
|
+
import { i18next, localize } from '@operato/i18n'
|
|
20
|
+
import { openPopup } from '@operato/layout'
|
|
21
|
+
import { PageView, store } from '@operato/shell'
|
|
22
|
+
import { CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
|
23
|
+
import { isMobileDevice } from '@operato/utils'
|
|
24
|
+
import { OxPopup } from '@operato/popup'
|
|
25
|
+
import { ActivitySearchKeyItem } from '../../types/activity-search-key-item-type'
|
|
26
|
+
|
|
27
|
+
@customElement('activity-instance-search-page')
|
|
28
|
+
export class ActivityInstanceSearchPage extends connect(store)(localize(i18next)(PageView)) {
|
|
29
|
+
static styles = [
|
|
30
|
+
ScrollbarStyles,
|
|
31
|
+
CommonGristStyles,
|
|
32
|
+
css`
|
|
33
|
+
:host {
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
|
|
37
|
+
overflow: hidden;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
ox-grist {
|
|
41
|
+
overflow-y: auto;
|
|
42
|
+
flex: 1;
|
|
43
|
+
}
|
|
44
|
+
`
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
@state() activityId?: string
|
|
48
|
+
@state() activity: any
|
|
49
|
+
@state() searchKeys: ActivitySearchKeyItem[] = []
|
|
50
|
+
|
|
51
|
+
@state() gristConfig: any
|
|
52
|
+
@state() mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'
|
|
53
|
+
|
|
54
|
+
@query('ox-grist') private grist!: DataGrist
|
|
55
|
+
@query('#sorter-control') private sortersControl!: OxPopup
|
|
56
|
+
|
|
57
|
+
get context() {
|
|
58
|
+
return {
|
|
59
|
+
search: {
|
|
60
|
+
handler: (search: string) => {
|
|
61
|
+
this.grist.searchText = search
|
|
62
|
+
},
|
|
63
|
+
placeholder: i18next.t('title.activity instance search'),
|
|
64
|
+
value: this.grist.searchText
|
|
65
|
+
},
|
|
66
|
+
filter: {
|
|
67
|
+
handler: () => {
|
|
68
|
+
this.grist.toggleHeadroom()
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
help: 'dataset/activity-instance-search',
|
|
72
|
+
actions: [],
|
|
73
|
+
exportable: {
|
|
74
|
+
name: i18next.t('title.activity instance search'),
|
|
75
|
+
data: this._exportableData.bind(this)
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
render() {
|
|
81
|
+
const mode = this.mode || (isMobileDevice() ? 'LIST' : 'GRID')
|
|
82
|
+
|
|
83
|
+
return html`
|
|
84
|
+
<ox-grist
|
|
85
|
+
.mode=${mode}
|
|
86
|
+
.config=${this.gristConfig}
|
|
87
|
+
.fetchHandler=${this.fetchHandler.bind(this)}
|
|
88
|
+
?url-params-sensitive=${this.active}
|
|
89
|
+
>
|
|
90
|
+
<div slot="headroom">
|
|
91
|
+
<div id="filters">
|
|
92
|
+
<ox-filters-form autofocus without-search></ox-filters-form>
|
|
93
|
+
</div>
|
|
94
|
+
|
|
95
|
+
<div id="sorters">
|
|
96
|
+
Sort
|
|
97
|
+
<mwc-icon
|
|
98
|
+
@click=${e => {
|
|
99
|
+
const target = e.currentTarget
|
|
100
|
+
this.sortersControl.open({
|
|
101
|
+
right: 0,
|
|
102
|
+
top: target.offsetTop + target.offsetHeight
|
|
103
|
+
})
|
|
104
|
+
}}
|
|
105
|
+
>expand_more</mwc-icon
|
|
106
|
+
>
|
|
107
|
+
<ox-popup id="sorter-control">
|
|
108
|
+
<ox-sorters-control> </ox-sorters-control>
|
|
109
|
+
</ox-popup>
|
|
110
|
+
</div>
|
|
111
|
+
|
|
112
|
+
<div id="modes">
|
|
113
|
+
<mwc-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</mwc-icon>
|
|
114
|
+
<mwc-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</mwc-icon>
|
|
115
|
+
<mwc-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</mwc-icon>
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
</ox-grist>
|
|
119
|
+
`
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
pageUpdated(changes, lifecycle) {
|
|
123
|
+
if (this.active) {
|
|
124
|
+
this.activityId = lifecycle.resourceId
|
|
125
|
+
return
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
async updated(changes) {
|
|
130
|
+
if (changes.has('activityId')) {
|
|
131
|
+
const response = await client.query({
|
|
132
|
+
query: gql`
|
|
133
|
+
query ($id: String!) {
|
|
134
|
+
activity(id: $id) {
|
|
135
|
+
id
|
|
136
|
+
name
|
|
137
|
+
description
|
|
138
|
+
searchKeys {
|
|
139
|
+
name
|
|
140
|
+
description
|
|
141
|
+
inputKey
|
|
142
|
+
tKey
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
`,
|
|
147
|
+
variables: {
|
|
148
|
+
id: this.activityId
|
|
149
|
+
}
|
|
150
|
+
})
|
|
151
|
+
|
|
152
|
+
this.activity = response.data.activity
|
|
153
|
+
this.searchKeys = this.activity?.searchKeys
|
|
154
|
+
this.refreshGristConfig()
|
|
155
|
+
|
|
156
|
+
this.grist.fetch()
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
getSearchKeyColumns() {
|
|
161
|
+
return (
|
|
162
|
+
this.searchKeys?.map((item, index) => {
|
|
163
|
+
return {
|
|
164
|
+
type: 'string',
|
|
165
|
+
name: `key0${index + 1}`,
|
|
166
|
+
header: item.tKey ? i18next.t(item.tKey) : `key0${index + 1}`,
|
|
167
|
+
record: {
|
|
168
|
+
editable: false
|
|
169
|
+
},
|
|
170
|
+
sortable: true,
|
|
171
|
+
filter: 'i_like',
|
|
172
|
+
width: 120,
|
|
173
|
+
imex: true
|
|
174
|
+
}
|
|
175
|
+
}) || []
|
|
176
|
+
)
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
refreshGristConfig() {
|
|
180
|
+
const today = new Date().toISOString().split('T')[0]
|
|
181
|
+
|
|
182
|
+
this.gristConfig = {
|
|
183
|
+
list: {
|
|
184
|
+
fields: ['name', 'description'],
|
|
185
|
+
details: ['input', 'updatedAt']
|
|
186
|
+
},
|
|
187
|
+
columns: [
|
|
188
|
+
{ type: 'gutter', gutterName: 'sequence' },
|
|
189
|
+
{ type: 'gutter', gutterName: 'row-selector', multiple: true },
|
|
190
|
+
{
|
|
191
|
+
type: 'gutter',
|
|
192
|
+
gutterName: 'button',
|
|
193
|
+
icon: 'assignment',
|
|
194
|
+
handlers: {
|
|
195
|
+
click: (columns, data, column, record, rowIndex) => {
|
|
196
|
+
openPopup(
|
|
197
|
+
html`
|
|
198
|
+
<activity-instance-view
|
|
199
|
+
activity-instance-id=${record.id}
|
|
200
|
+
style="background-color: white;"
|
|
201
|
+
></activity-instance-view>
|
|
202
|
+
`,
|
|
203
|
+
{
|
|
204
|
+
backdrop: true,
|
|
205
|
+
size: 'large',
|
|
206
|
+
title: i18next.t('title.activity instance view')
|
|
207
|
+
}
|
|
208
|
+
)
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
type: 'string',
|
|
214
|
+
name: 'name',
|
|
215
|
+
label: true,
|
|
216
|
+
header: i18next.t('field.name'),
|
|
217
|
+
record: {
|
|
218
|
+
editable: false
|
|
219
|
+
},
|
|
220
|
+
filter: 'search',
|
|
221
|
+
sortable: true,
|
|
222
|
+
width: 120,
|
|
223
|
+
imex: true
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
type: 'string',
|
|
227
|
+
name: 'description',
|
|
228
|
+
label: true,
|
|
229
|
+
header: i18next.t('field.description'),
|
|
230
|
+
record: {
|
|
231
|
+
editable: false
|
|
232
|
+
},
|
|
233
|
+
filter: 'search',
|
|
234
|
+
width: 150,
|
|
235
|
+
imex: true
|
|
236
|
+
},
|
|
237
|
+
...this.getSearchKeyColumns(),
|
|
238
|
+
{
|
|
239
|
+
type: 'json5',
|
|
240
|
+
name: 'input',
|
|
241
|
+
header: i18next.t('field.input'),
|
|
242
|
+
record: {
|
|
243
|
+
editable: false
|
|
244
|
+
},
|
|
245
|
+
hidden: true,
|
|
246
|
+
imex: true
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
type: 'json5',
|
|
250
|
+
name: 'output',
|
|
251
|
+
header: i18next.t('field.output'),
|
|
252
|
+
record: {
|
|
253
|
+
editable: false
|
|
254
|
+
},
|
|
255
|
+
hidden: true,
|
|
256
|
+
imex: true
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
type: 'resource-object',
|
|
260
|
+
name: 'updater',
|
|
261
|
+
header: i18next.t('field.updater'),
|
|
262
|
+
sortable: true,
|
|
263
|
+
width: 120,
|
|
264
|
+
imex: true
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
type: 'datetime',
|
|
268
|
+
name: 'updatedAt',
|
|
269
|
+
header: i18next.t('field.updated_at'),
|
|
270
|
+
sortable: true,
|
|
271
|
+
width: 180,
|
|
272
|
+
imex: true
|
|
273
|
+
}
|
|
274
|
+
],
|
|
275
|
+
rows: {
|
|
276
|
+
appendable: false,
|
|
277
|
+
selectable: {
|
|
278
|
+
multiple: true
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
sorters: [
|
|
282
|
+
{
|
|
283
|
+
name: 'updatedAt',
|
|
284
|
+
desc: true
|
|
285
|
+
}
|
|
286
|
+
]
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {
|
|
291
|
+
if (!this.activity) {
|
|
292
|
+
return { records: [], total: 0 }
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
const response = await client.query({
|
|
296
|
+
query: gql`
|
|
297
|
+
query ($activityId: String!, $filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
|
298
|
+
responses: activityInstancesByActivity(
|
|
299
|
+
activityId: $activityId
|
|
300
|
+
filters: $filters
|
|
301
|
+
pagination: $pagination
|
|
302
|
+
sortings: $sortings
|
|
303
|
+
) {
|
|
304
|
+
items {
|
|
305
|
+
id
|
|
306
|
+
name
|
|
307
|
+
description
|
|
308
|
+
key01
|
|
309
|
+
key02
|
|
310
|
+
key03
|
|
311
|
+
key04
|
|
312
|
+
key05
|
|
313
|
+
input
|
|
314
|
+
output
|
|
315
|
+
updater {
|
|
316
|
+
id
|
|
317
|
+
name
|
|
318
|
+
}
|
|
319
|
+
updatedAt
|
|
320
|
+
}
|
|
321
|
+
total
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
`,
|
|
325
|
+
variables: {
|
|
326
|
+
activityId: this.activityId,
|
|
327
|
+
filters,
|
|
328
|
+
pagination: { page, limit },
|
|
329
|
+
sortings
|
|
330
|
+
}
|
|
331
|
+
})
|
|
332
|
+
|
|
333
|
+
return {
|
|
334
|
+
total: response.data.responses.total || 0,
|
|
335
|
+
records: response.data.responses.items || []
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
_exportableData() {
|
|
340
|
+
let records = [] as GristRecord[]
|
|
341
|
+
if (this.grist.selected && this.grist.selected.length > 0) {
|
|
342
|
+
records = this.grist.selected
|
|
343
|
+
} else {
|
|
344
|
+
records = this.grist.data.records
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
var headerSetting = this.grist.compiledConfig.columns
|
|
348
|
+
.filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)
|
|
349
|
+
.map(column => {
|
|
350
|
+
return column.imex === true
|
|
351
|
+
? {
|
|
352
|
+
header: column.header.renderer(column),
|
|
353
|
+
key: column.name,
|
|
354
|
+
width: column.width,
|
|
355
|
+
type: column.type
|
|
356
|
+
}
|
|
357
|
+
: column.imex
|
|
358
|
+
})
|
|
359
|
+
|
|
360
|
+
var data = records.map(item => {
|
|
361
|
+
return {
|
|
362
|
+
id: item.id,
|
|
363
|
+
...this.gristConfig.columns
|
|
364
|
+
.filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)
|
|
365
|
+
.reduce((record, column) => {
|
|
366
|
+
const key = column.imex === true ? column.name : column.imex.key
|
|
367
|
+
record[key] = key
|
|
368
|
+
.split('.')
|
|
369
|
+
.reduce((obj, key) => (obj && obj[key] !== 'undefined' ? obj[key] : undefined), item)
|
|
370
|
+
return record
|
|
371
|
+
}, {})
|
|
372
|
+
}
|
|
373
|
+
})
|
|
374
|
+
|
|
375
|
+
return { header: headerSetting, data: data }
|
|
376
|
+
}
|
|
377
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import gql from 'graphql-tag'
|
|
2
|
+
import { css, html, LitElement } from 'lit'
|
|
3
|
+
import { customElement, property, query, state } from 'lit/decorators.js'
|
|
4
|
+
|
|
5
|
+
import { client } from '@operato/graphql'
|
|
6
|
+
import { i18next, localize } from '@operato/i18n'
|
|
7
|
+
import { ScrollbarStyles } from '@operato/styles'
|
|
8
|
+
|
|
9
|
+
import { ActivityInstance } from '../../types/activity-instance'
|
|
10
|
+
|
|
11
|
+
@customElement('activity-instance-view')
|
|
12
|
+
export class ActivityInstanceView extends localize(i18next)(LitElement) {
|
|
13
|
+
static styles = [
|
|
14
|
+
ScrollbarStyles,
|
|
15
|
+
css`
|
|
16
|
+
:host {
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
|
|
20
|
+
background-color: #fff;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
div[content] {
|
|
24
|
+
flex: 1;
|
|
25
|
+
|
|
26
|
+
display: flex;
|
|
27
|
+
overflow: auto;
|
|
28
|
+
}
|
|
29
|
+
`
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
@property({
|
|
33
|
+
type: String,
|
|
34
|
+
attribute: 'activity-instance-id'
|
|
35
|
+
})
|
|
36
|
+
activityInstanceId?: string
|
|
37
|
+
|
|
38
|
+
@state() activityInstance?: ActivityInstance
|
|
39
|
+
|
|
40
|
+
render() {
|
|
41
|
+
if (!this.activityInstance) {
|
|
42
|
+
return html`<div>no activity instance info.</div>`
|
|
43
|
+
}
|
|
44
|
+
const { id, name, description, activity } = this.activityInstance
|
|
45
|
+
const instance = this.activityInstance
|
|
46
|
+
|
|
47
|
+
return html`
|
|
48
|
+
<div>name: ${name}</div>
|
|
49
|
+
<div>description: ${description}</div>
|
|
50
|
+
${this.renderSearchKeys()} ${this.renderInOut()}
|
|
51
|
+
`
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
renderSearchKeys() {
|
|
55
|
+
const { key01, key02, key03, key04, key05 } = this.activityInstance!
|
|
56
|
+
|
|
57
|
+
return html`
|
|
58
|
+
<div>key01: ${key01}</div>
|
|
59
|
+
<div>key02: ${key02}</div>
|
|
60
|
+
<div>key03: ${key03}</div>
|
|
61
|
+
<div>key04: ${key04}</div>
|
|
62
|
+
<div>key05: ${key05}</div>
|
|
63
|
+
`
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
renderInOut() {
|
|
67
|
+
const { input, output } = this.activityInstance!
|
|
68
|
+
|
|
69
|
+
return html`
|
|
70
|
+
<div>input: ${input}</div>
|
|
71
|
+
<div>output: ${output}</div>
|
|
72
|
+
`
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
updated(changes) {
|
|
76
|
+
if (changes.has('activityInstanceId')) {
|
|
77
|
+
this.fetchActivityInstance()
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
async fetchActivityInstance() {
|
|
82
|
+
const id = this.activityInstanceId
|
|
83
|
+
|
|
84
|
+
const response = await client.query({
|
|
85
|
+
query: gql`
|
|
86
|
+
query ($id: String!) {
|
|
87
|
+
activityInstance(id: $id) {
|
|
88
|
+
id
|
|
89
|
+
name
|
|
90
|
+
description
|
|
91
|
+
key01
|
|
92
|
+
key02
|
|
93
|
+
key03
|
|
94
|
+
key04
|
|
95
|
+
key05
|
|
96
|
+
input
|
|
97
|
+
output
|
|
98
|
+
activity {
|
|
99
|
+
id
|
|
100
|
+
name
|
|
101
|
+
description
|
|
102
|
+
}
|
|
103
|
+
activityThreads {
|
|
104
|
+
state
|
|
105
|
+
transaction
|
|
106
|
+
output
|
|
107
|
+
assignee {
|
|
108
|
+
id
|
|
109
|
+
name
|
|
110
|
+
email
|
|
111
|
+
}
|
|
112
|
+
round
|
|
113
|
+
assignedAt
|
|
114
|
+
startedAt
|
|
115
|
+
terminatedAt
|
|
116
|
+
}
|
|
117
|
+
updater {
|
|
118
|
+
id
|
|
119
|
+
name
|
|
120
|
+
}
|
|
121
|
+
assignedAt
|
|
122
|
+
startedAt
|
|
123
|
+
terminatedAt
|
|
124
|
+
updatedAt
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
`,
|
|
128
|
+
variables: {
|
|
129
|
+
id
|
|
130
|
+
}
|
|
131
|
+
})
|
|
132
|
+
|
|
133
|
+
this.activityInstance = response.data.activityInstance
|
|
134
|
+
}
|
|
135
|
+
}
|