@things-factory/worklist 5.0.14 → 6.0.0-alpha.0
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-/{bowner-view.js → bowner-view.ts} +27 -34
- package/client/components/{activity-instance-preview.js → activity-instance-preview.ts} +38 -50
- package/client/components/{activity-reporter-view.js → activity-reporter-view.ts} +27 -39
- package/client/components/{activity-starter-form.js → activity-starter-form.ts} +53 -68
- package/client/pages/activity/activity-list-page.ts +4 -3
- package/client/pages/activity/{activity-model-item-list.js → activity-model-item-list.ts} +11 -18
- package/client/pages/activity/{activity-page.js → activity-page.ts} +36 -40
- package/client/pages/activity/{starter-list-page.js → starter-list-page.ts} +15 -20
- package/client/pages/activity-instance/{activity-instance-list-page.js → activity-instance-list-page.ts} +22 -30
- package/client/pages/activity-instance/{activity-instance-page.js → activity-instance-page.ts} +36 -41
- package/client/pages/activity-store/{activity-store-page.js → activity-store-page.ts} +22 -29
- package/client/pages/activity-supervisor/{reporter-list-page.js → reporter-list-page.ts} +14 -21
- package/client/pages/activity-template/{activity-template-importer.js → activity-template-importer.ts} +32 -38
- package/client/pages/activity-template/{activity-template-list-page.js → activity-template-list-page.ts} +30 -37
- package/client/pages/activity-template/{activity-template-model-item-list.js → activity-template-model-item-list.ts} +5 -4
- package/client/pages/activity-thread/{activity-thread-importer.js → activity-thread-importer.ts} +32 -37
- package/client/pages/activity-thread/{activity-thread-list-page.js → activity-thread-list-page.ts} +20 -27
- package/client/pages/activity-thread/{activity-thread-page.js → activity-thread-page.ts} +36 -40
- package/client/pages/dashboard/{dashboard-home.js → dashboard-home.ts} +3 -7
- package/client/pages/todo/{assigned-list-page.js → assigned-list-page.ts} +13 -20
- package/client/pages/todo/{draft-list-page.js → draft-list-page.ts} +13 -20
- package/client/pages/todo/{pickable-list-page.js → pickable-list-page.ts} +13 -20
- package/client/pages/todo/{todo-list-page.js → todo-list-page.ts} +12 -19
- package/client/pages/worklist-home.ts +1 -1
- package/dist-client/components/activity-/bowner-view.d.ts +1 -1
- package/dist-client/components/activity-/bowner-view.js +44 -36
- package/dist-client/components/activity-/bowner-view.js.map +1 -1
- package/dist-client/components/activity-instance-preview.d.ts +2 -1
- package/dist-client/components/activity-instance-preview.js +58 -51
- package/dist-client/components/activity-instance-preview.js.map +1 -1
- package/dist-client/components/activity-reporter-view.d.ts +1 -1
- package/dist-client/components/activity-reporter-view.js +44 -37
- package/dist-client/components/activity-reporter-view.js.map +1 -1
- package/dist-client/components/activity-starter-form.d.ts +16 -0
- package/dist-client/components/activity-starter-form.js +68 -67
- package/dist-client/components/activity-starter-form.js.map +1 -1
- package/dist-client/pages/activity/activity-list-page.d.ts +1 -0
- package/dist-client/pages/activity/activity-list-page.js +7 -4
- package/dist-client/pages/activity/activity-list-page.js.map +1 -1
- package/dist-client/pages/activity/activity-model-item-list.d.ts +13 -180
- package/dist-client/pages/activity/activity-model-item-list.js +52 -44
- package/dist-client/pages/activity/activity-model-item-list.js.map +1 -1
- package/dist-client/pages/activity/activity-page.d.ts +29 -22
- package/dist-client/pages/activity/activity-page.js +53 -44
- package/dist-client/pages/activity/activity-page.js.map +1 -1
- package/dist-client/pages/activity/starter-list-page.d.ts +14 -120
- package/dist-client/pages/activity/starter-list-page.js +47 -31
- package/dist-client/pages/activity/starter-list-page.js.map +1 -1
- package/dist-client/pages/activity-instance/activity-instance-list-page.d.ts +9 -114
- package/dist-client/pages/activity-instance/activity-instance-list-page.js +40 -30
- package/dist-client/pages/activity-instance/activity-instance-list-page.js.map +1 -1
- package/dist-client/pages/activity-instance/activity-instance-page.d.ts +22 -22
- package/dist-client/pages/activity-instance/activity-instance-page.js +57 -44
- package/dist-client/pages/activity-instance/activity-instance-page.js.map +1 -1
- package/dist-client/pages/activity-store/activity-store-page.d.ts +23 -150
- package/dist-client/pages/activity-store/activity-store-page.js +40 -31
- package/dist-client/pages/activity-store/activity-store-page.js.map +1 -1
- package/dist-client/pages/activity-supervisor/reporter-list-page.d.ts +13 -120
- package/dist-client/pages/activity-supervisor/reporter-list-page.js +47 -31
- package/dist-client/pages/activity-supervisor/reporter-list-page.js.map +1 -1
- package/dist-client/pages/activity-template/activity-template-importer.d.ts +7 -21
- package/dist-client/pages/activity-template/activity-template-importer.js +42 -36
- package/dist-client/pages/activity-template/activity-template-importer.js.map +1 -1
- package/dist-client/pages/activity-template/activity-template-list-page.d.ts +17 -218
- package/dist-client/pages/activity-template/activity-template-list-page.js +58 -37
- package/dist-client/pages/activity-template/activity-template-list-page.js.map +1 -1
- package/dist-client/pages/activity-template/activity-template-model-item-list.js +10 -5
- package/dist-client/pages/activity-template/activity-template-model-item-list.js.map +1 -1
- package/dist-client/pages/activity-thread/activity-thread-importer.d.ts +7 -21
- package/dist-client/pages/activity-thread/activity-thread-importer.js +42 -36
- package/dist-client/pages/activity-thread/activity-thread-importer.js.map +1 -1
- package/dist-client/pages/activity-thread/activity-thread-list-page.d.ts +16 -100
- package/dist-client/pages/activity-thread/activity-thread-list-page.js +55 -36
- package/dist-client/pages/activity-thread/activity-thread-list-page.js.map +1 -1
- package/dist-client/pages/activity-thread/activity-thread-page.d.ts +26 -19
- package/dist-client/pages/activity-thread/activity-thread-page.js +53 -44
- package/dist-client/pages/activity-thread/activity-thread-page.js.map +1 -1
- package/dist-client/pages/dashboard/dashboard-home.js +8 -7
- package/dist-client/pages/dashboard/dashboard-home.js.map +1 -1
- package/dist-client/pages/todo/assigned-list-page.d.ts +12 -100
- package/dist-client/pages/todo/assigned-list-page.js +45 -30
- package/dist-client/pages/todo/assigned-list-page.js.map +1 -1
- package/dist-client/pages/todo/draft-list-page.d.ts +13 -174
- package/dist-client/pages/todo/draft-list-page.js +46 -30
- package/dist-client/pages/todo/draft-list-page.js.map +1 -1
- package/dist-client/pages/todo/pickable-list-page.d.ts +13 -126
- package/dist-client/pages/todo/pickable-list-page.js +46 -30
- package/dist-client/pages/todo/pickable-list-page.js.map +1 -1
- package/dist-client/pages/todo/todo-list-page.d.ts +12 -206
- package/dist-client/pages/todo/todo-list-page.js +44 -30
- package/dist-client/pages/todo/todo-list-page.js.map +1 -1
- package/dist-client/pages/worklist-home.js +1 -1
- package/dist-client/pages/worklist-home.js.map +1 -1
- package/dist-client/route.d.ts +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/controllers/activity-instance/abort.js +4 -3
- package/dist-server/controllers/activity-instance/abort.js.map +1 -1
- package/dist-server/controllers/activity-instance/adjust.js +2 -1
- package/dist-server/controllers/activity-instance/adjust.js.map +1 -1
- package/dist-server/controllers/activity-instance/assign.js +3 -3
- package/dist-server/controllers/activity-instance/assign.js.map +1 -1
- package/dist-server/controllers/activity-instance/delegate.js +4 -3
- package/dist-server/controllers/activity-instance/delegate.js.map +1 -1
- package/dist-server/controllers/activity-instance/draft.js +3 -3
- package/dist-server/controllers/activity-instance/draft.js.map +1 -1
- package/dist-server/controllers/activity-instance/end.js +4 -3
- package/dist-server/controllers/activity-instance/end.js.map +1 -1
- package/dist-server/controllers/activity-instance/pick.js +4 -3
- package/dist-server/controllers/activity-instance/pick.js.map +1 -1
- package/dist-server/controllers/activity-instance/post.js +17 -3
- package/dist-server/controllers/activity-instance/post.js.map +1 -1
- package/dist-server/controllers/activity-instance/start.js +2 -1
- package/dist-server/controllers/activity-instance/start.js.map +1 -1
- package/dist-server/controllers/activity-instance/terminate.js +4 -3
- package/dist-server/controllers/activity-instance/terminate.js.map +1 -1
- package/dist-server/controllers/activity-thread/abort.js +4 -3
- package/dist-server/controllers/activity-thread/abort.js.map +1 -1
- package/dist-server/controllers/activity-thread/adjust.js +2 -1
- package/dist-server/controllers/activity-thread/adjust.js.map +1 -1
- package/dist-server/controllers/activity-thread/delegate.js +4 -3
- package/dist-server/controllers/activity-thread/delegate.js.map +1 -1
- package/dist-server/controllers/activity-thread/end.js +4 -3
- package/dist-server/controllers/activity-thread/end.js.map +1 -1
- package/dist-server/controllers/activity-thread/save.js +2 -1
- package/dist-server/controllers/activity-thread/save.js.map +1 -1
- package/dist-server/controllers/activity-thread/start.js +2 -1
- package/dist-server/controllers/activity-thread/start.js.map +1 -1
- package/dist-server/controllers/activity-thread/terminate.js +4 -3
- package/dist-server/controllers/activity-thread/terminate.js.map +1 -1
- package/dist-server/controllers/common.js +8 -4
- package/dist-server/controllers/common.js.map +1 -1
- package/dist-server/service/activity/activity-history.js +6 -7
- package/dist-server/service/activity/activity-history.js.map +1 -1
- package/dist-server/service/activity/activity-mutation.js +10 -4
- package/dist-server/service/activity/activity-mutation.js.map +1 -1
- package/dist-server/service/activity/activity-query.js +18 -19
- package/dist-server/service/activity/activity-query.js.map +1 -1
- package/dist-server/service/activity/activity-type.js +6 -7
- package/dist-server/service/activity/activity-type.js.map +1 -1
- package/dist-server/service/activity/activity.js +6 -7
- package/dist-server/service/activity/activity.js.map +1 -1
- package/dist-server/service/activity-instance/activity-instance-history.js +7 -8
- package/dist-server/service/activity-instance/activity-instance-history.js.map +1 -1
- package/dist-server/service/activity-instance/activity-instance-mutation.js +2 -2
- package/dist-server/service/activity-instance/activity-instance-mutation.js.map +1 -1
- package/dist-server/service/activity-instance/activity-instance-query.js +24 -25
- package/dist-server/service/activity-instance/activity-instance-query.js.map +1 -1
- package/dist-server/service/activity-instance/activity-instance-subscription.js +1 -2
- package/dist-server/service/activity-instance/activity-instance-subscription.js.map +1 -1
- package/dist-server/service/activity-instance/activity-instance-type.js +4 -5
- package/dist-server/service/activity-instance/activity-instance-type.js.map +1 -1
- package/dist-server/service/activity-instance/activity-instance.js +7 -8
- package/dist-server/service/activity-instance/activity-instance.js.map +1 -1
- package/dist-server/service/activity-instance/event-subscriber.js +0 -5
- package/dist-server/service/activity-instance/event-subscriber.js.map +1 -1
- package/dist-server/service/activity-template/activity-template-history.js +3 -4
- package/dist-server/service/activity-template/activity-template-history.js.map +1 -1
- package/dist-server/service/activity-template/activity-template-mutation.js +4 -4
- package/dist-server/service/activity-template/activity-template-mutation.js.map +1 -1
- package/dist-server/service/activity-template/activity-template-query.js +9 -11
- package/dist-server/service/activity-template/activity-template-query.js.map +1 -1
- package/dist-server/service/activity-template/activity-template.js +3 -4
- package/dist-server/service/activity-template/activity-template.js.map +1 -1
- package/dist-server/service/activity-thread/activity-thread-mutation.js +10 -6
- package/dist-server/service/activity-thread/activity-thread-mutation.js.map +1 -1
- package/dist-server/service/activity-thread/activity-thread-query.js +11 -13
- package/dist-server/service/activity-thread/activity-thread-query.js.map +1 -1
- package/dist-server/service/activity-thread/activity-thread.js +4 -5
- package/dist-server/service/activity-thread/activity-thread.js.map +1 -1
- package/dist-server/service/activity-thread/event-subscriber.js +15 -3
- package/dist-server/service/activity-thread/event-subscriber.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/server/controllers/activity-instance/abort.ts +7 -3
- package/server/controllers/activity-instance/adjust.ts +7 -2
- package/server/controllers/activity-instance/assign.ts +3 -3
- package/server/controllers/activity-instance/delegate.ts +3 -2
- package/server/controllers/activity-instance/draft.ts +6 -3
- package/server/controllers/activity-instance/end.ts +3 -2
- package/server/controllers/activity-instance/pick.ts +4 -3
- package/server/controllers/activity-instance/post.ts +21 -4
- package/server/controllers/activity-instance/start.ts +3 -2
- package/server/controllers/activity-instance/terminate.ts +3 -2
- package/server/controllers/activity-thread/abort.ts +7 -3
- package/server/controllers/activity-thread/adjust.ts +7 -2
- package/server/controllers/activity-thread/delegate.ts +3 -2
- package/server/controllers/activity-thread/end.ts +3 -2
- package/server/controllers/activity-thread/save.ts +3 -2
- package/server/controllers/activity-thread/start.ts +8 -2
- package/server/controllers/activity-thread/terminate.ts +3 -2
- package/server/controllers/common.ts +15 -11
- package/server/service/activity/activity-mutation.ts +19 -10
- package/server/service/activity/activity-query.ts +14 -14
- package/server/service/activity-instance/activity-instance-mutation.ts +8 -8
- package/server/service/activity-instance/activity-instance-query.ts +27 -21
- package/server/service/activity-instance/activity-instance-subscription.ts +1 -2
- package/server/service/activity-instance/event-subscriber.ts +0 -6
- package/server/service/activity-template/activity-template-mutation.ts +13 -10
- package/server/service/activity-template/activity-template-query.ts +8 -9
- package/server/service/activity-thread/activity-thread-mutation.ts +22 -15
- package/server/service/activity-thread/activity-thread-query.ts +10 -11
- package/server/service/activity-thread/event-subscriber.ts +15 -3
- package/translations/en.json +3 -0
- package/translations/ko.json +3 -0
- package/translations/ms.json +3 -0
- package/translations/zh.json +3 -0
|
@@ -4,6 +4,7 @@ import './activity-template-model-item-list.js'
|
|
|
4
4
|
|
|
5
5
|
import gql from 'graphql-tag'
|
|
6
6
|
import { css, html } from 'lit'
|
|
7
|
+
import { customElement, property, query } from 'lit/decorators.js'
|
|
7
8
|
import { connect } from 'pwa-helpers/connect-mixin.js'
|
|
8
9
|
|
|
9
10
|
import { getEditor, getRenderer } from '@operato/data-grist'
|
|
@@ -16,30 +17,25 @@ import { isMobileDevice } from '@operato/utils'
|
|
|
16
17
|
|
|
17
18
|
import { ActivityTypes, ActivityUITypes } from '../../types.js'
|
|
18
19
|
|
|
20
|
+
@customElement('activity-template-list-page')
|
|
19
21
|
export class ActivityTemplateListPage extends connect(store)(localize(i18next)(PageView)) {
|
|
20
|
-
static
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
static styles = [
|
|
23
|
+
ScrollbarStyles,
|
|
24
|
+
CommonGristStyles,
|
|
25
|
+
css`
|
|
26
|
+
:host {
|
|
27
|
+
display: flex;
|
|
26
28
|
|
|
27
|
-
|
|
28
|
-
return [
|
|
29
|
-
ScrollbarStyles,
|
|
30
|
-
CommonGristStyles,
|
|
31
|
-
css`
|
|
32
|
-
:host {
|
|
33
|
-
display: flex;
|
|
29
|
+
width: 100%;
|
|
34
30
|
|
|
35
|
-
|
|
31
|
+
--grid-record-emphasized-background-color: red;
|
|
32
|
+
--grid-record-emphasized-color: yellow;
|
|
33
|
+
}
|
|
34
|
+
`
|
|
35
|
+
]
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
`
|
|
41
|
-
]
|
|
42
|
-
}
|
|
37
|
+
@property({ type: Object }) gristConfig: any
|
|
38
|
+
@property({ type: String }) mode?: 'GRID' | 'LIST' | 'CARD' = isMobileDevice() ? 'CARD' : 'GRID'
|
|
43
39
|
|
|
44
40
|
get context() {
|
|
45
41
|
return {
|
|
@@ -67,8 +63,11 @@ export class ActivityTemplateListPage extends connect(store)(localize(i18next)(P
|
|
|
67
63
|
}
|
|
68
64
|
}
|
|
69
65
|
|
|
66
|
+
@query('#sorter-control') sorterControl?: any
|
|
67
|
+
@query('ox-grist') grist?: HTMLElement & { fetch: any; selected: any; dirtyRecords: any; dirtyData: any }
|
|
68
|
+
|
|
70
69
|
render() {
|
|
71
|
-
const mode = this.mode
|
|
70
|
+
const mode = this.mode
|
|
72
71
|
|
|
73
72
|
return html`
|
|
74
73
|
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
|
|
@@ -82,7 +81,7 @@ export class ActivityTemplateListPage extends connect(store)(localize(i18next)(P
|
|
|
82
81
|
<mwc-icon
|
|
83
82
|
@click=${e => {
|
|
84
83
|
const target = e.currentTarget
|
|
85
|
-
this.
|
|
84
|
+
this.sorterControl.open({
|
|
86
85
|
right: 0,
|
|
87
86
|
top: target.offsetTop + target.offsetHeight
|
|
88
87
|
})
|
|
@@ -104,10 +103,6 @@ export class ActivityTemplateListPage extends connect(store)(localize(i18next)(P
|
|
|
104
103
|
`
|
|
105
104
|
}
|
|
106
105
|
|
|
107
|
-
get grist() {
|
|
108
|
-
return this.renderRoot.querySelector('ox-grist')
|
|
109
|
-
}
|
|
110
|
-
|
|
111
106
|
async pageInitialized(lifecycle) {
|
|
112
107
|
this.gristConfig = {
|
|
113
108
|
list: {
|
|
@@ -135,7 +130,7 @@ export class ActivityTemplateListPage extends connect(store)(localize(i18next)(P
|
|
|
135
130
|
}
|
|
136
131
|
)
|
|
137
132
|
popup.onclosed = () => {
|
|
138
|
-
this.grist
|
|
133
|
+
this.grist?.fetch()
|
|
139
134
|
}
|
|
140
135
|
}
|
|
141
136
|
}
|
|
@@ -339,7 +334,7 @@ export class ActivityTemplateListPage extends connect(store)(localize(i18next)(P
|
|
|
339
334
|
|
|
340
335
|
async _deleteActivityTemplate() {
|
|
341
336
|
if (confirm(i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }))) {
|
|
342
|
-
const ids = this.grist
|
|
337
|
+
const ids = this.grist?.selected.map(record => record.id)
|
|
343
338
|
if (ids && ids.length > 0) {
|
|
344
339
|
const response = await client.mutate({
|
|
345
340
|
mutation: gql`
|
|
@@ -353,7 +348,7 @@ export class ActivityTemplateListPage extends connect(store)(localize(i18next)(P
|
|
|
353
348
|
})
|
|
354
349
|
|
|
355
350
|
if (!response.errors) {
|
|
356
|
-
this.grist
|
|
351
|
+
this.grist?.fetch()
|
|
357
352
|
notify({
|
|
358
353
|
message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })
|
|
359
354
|
})
|
|
@@ -363,7 +358,7 @@ export class ActivityTemplateListPage extends connect(store)(localize(i18next)(P
|
|
|
363
358
|
}
|
|
364
359
|
|
|
365
360
|
async _updateActivityTemplate() {
|
|
366
|
-
let patches = this.grist
|
|
361
|
+
let patches = this.grist?.dirtyRecords
|
|
367
362
|
if (patches && patches.length) {
|
|
368
363
|
patches = patches.map(patch => {
|
|
369
364
|
let patchField = patch.id ? { id: patch.id } : {}
|
|
@@ -371,7 +366,7 @@ export class ActivityTemplateListPage extends connect(store)(localize(i18next)(P
|
|
|
371
366
|
for (let key in dirtyFields) {
|
|
372
367
|
patchField[key] = dirtyFields[key].after
|
|
373
368
|
}
|
|
374
|
-
patchField.cuFlag = patch.__dirty__
|
|
369
|
+
;(patchField as any).cuFlag = patch.__dirty__
|
|
375
370
|
|
|
376
371
|
return patchField
|
|
377
372
|
})
|
|
@@ -393,13 +388,13 @@ export class ActivityTemplateListPage extends connect(store)(localize(i18next)(P
|
|
|
393
388
|
})
|
|
394
389
|
|
|
395
390
|
if (!response.errors) {
|
|
396
|
-
this.grist
|
|
391
|
+
this.grist?.fetch()
|
|
397
392
|
}
|
|
398
393
|
}
|
|
399
394
|
}
|
|
400
395
|
|
|
401
396
|
async exportHandler() {
|
|
402
|
-
const exportTargets = this.grist
|
|
397
|
+
const exportTargets = this.grist?.selected.length ? this.grist.selected : this.grist?.dirtyData.records
|
|
403
398
|
const targetFieldSet = new Set(['id', 'name', 'description', 'active'])
|
|
404
399
|
|
|
405
400
|
return exportTargets.map(activityTemplate => {
|
|
@@ -419,7 +414,7 @@ export class ActivityTemplateListPage extends connect(store)(localize(i18next)(P
|
|
|
419
414
|
.activityTemplates=${records}
|
|
420
415
|
@imported=${() => {
|
|
421
416
|
history.back()
|
|
422
|
-
this.grist
|
|
417
|
+
this.grist?.fetch()
|
|
423
418
|
}}
|
|
424
419
|
></activity-template-importer>
|
|
425
420
|
`,
|
|
@@ -431,9 +426,7 @@ export class ActivityTemplateListPage extends connect(store)(localize(i18next)(P
|
|
|
431
426
|
)
|
|
432
427
|
|
|
433
428
|
popup.onclosed = () => {
|
|
434
|
-
this.grist
|
|
429
|
+
this.grist?.fetch()
|
|
435
430
|
}
|
|
436
431
|
}
|
|
437
432
|
}
|
|
438
|
-
|
|
439
|
-
window.customElements.define('activity-template-list-page', ActivityTemplateListPage)
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import gql from 'graphql-tag'
|
|
2
2
|
|
|
3
|
+
import { customElement } from 'lit/decorators.js'
|
|
4
|
+
|
|
3
5
|
import { client } from '@operato/graphql'
|
|
4
6
|
import { i18next } from '@operato/i18n'
|
|
5
7
|
|
|
6
8
|
import { ActivityModelItemList } from '../activity/activity-model-item-list'
|
|
7
9
|
|
|
10
|
+
@customElement('activity-template-model-item-list')
|
|
8
11
|
class ActivityTemplateModelItemList extends ActivityModelItemList {
|
|
9
12
|
async _updateDataItems() {
|
|
10
|
-
this.grist
|
|
13
|
+
this.grist?.commit()
|
|
11
14
|
|
|
12
15
|
const response = await client.mutate({
|
|
13
16
|
mutation: gql`
|
|
@@ -20,7 +23,7 @@ class ActivityTemplateModelItemList extends ActivityModelItemList {
|
|
|
20
23
|
variables: {
|
|
21
24
|
id: this.activity.id,
|
|
22
25
|
patch: {
|
|
23
|
-
model: this.grist
|
|
26
|
+
model: this.grist?.data.records,
|
|
24
27
|
cuFlag: 'M'
|
|
25
28
|
}
|
|
26
29
|
}
|
|
@@ -39,5 +42,3 @@ class ActivityTemplateModelItemList extends ActivityModelItemList {
|
|
|
39
42
|
}
|
|
40
43
|
}
|
|
41
44
|
}
|
|
42
|
-
|
|
43
|
-
window.customElements.define('activity-template-model-item-list', ActivityTemplateModelItemList)
|
package/client/pages/activity-thread/{activity-thread-importer.js → activity-thread-importer.ts}
RENAMED
|
@@ -2,18 +2,41 @@ import '@operato/data-grist'
|
|
|
2
2
|
|
|
3
3
|
import gql from 'graphql-tag'
|
|
4
4
|
import { css, html, LitElement } from 'lit'
|
|
5
|
+
import { customElement, property } from 'lit/decorators.js'
|
|
5
6
|
|
|
6
7
|
import { client } from '@operato/graphql'
|
|
7
8
|
import { i18next } from '@operato/i18n'
|
|
8
9
|
import { isMobileDevice } from '@operato/utils'
|
|
9
10
|
|
|
11
|
+
@customElement('activity-thread-importer')
|
|
10
12
|
export class ActivityThreadImporter extends LitElement {
|
|
11
|
-
static
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
static styles = [
|
|
14
|
+
css`
|
|
15
|
+
:host {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
|
|
19
|
+
background-color: #fff;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
ox-grist {
|
|
23
|
+
flex: 1;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.button-container {
|
|
27
|
+
display: flex;
|
|
28
|
+
margin-left: auto;
|
|
29
|
+
padding: var(--padding-default);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
mwc-button {
|
|
33
|
+
margin-left: var(--margin-default);
|
|
34
|
+
}
|
|
35
|
+
`
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
@property({ type: Object }) columns?: any
|
|
39
|
+
@property({ type: Array }) activityThreads?: any
|
|
17
40
|
|
|
18
41
|
constructor() {
|
|
19
42
|
super()
|
|
@@ -43,32 +66,6 @@ export class ActivityThreadImporter extends LitElement {
|
|
|
43
66
|
}
|
|
44
67
|
}
|
|
45
68
|
|
|
46
|
-
static get styles() {
|
|
47
|
-
return [
|
|
48
|
-
css`
|
|
49
|
-
:host {
|
|
50
|
-
display: flex;
|
|
51
|
-
flex-direction: column;
|
|
52
|
-
|
|
53
|
-
background-color: #fff;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
ox-grist {
|
|
57
|
-
flex: 1;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.button-container {
|
|
61
|
-
display: flex;
|
|
62
|
-
margin-left: auto;
|
|
63
|
-
padding: var(--padding-default);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
mwc-button {
|
|
67
|
-
margin-left: var(--margin-default);
|
|
68
|
-
}
|
|
69
|
-
`
|
|
70
|
-
]
|
|
71
|
-
}
|
|
72
69
|
|
|
73
70
|
render() {
|
|
74
71
|
return html`
|
|
@@ -76,8 +73,8 @@ export class ActivityThreadImporter extends LitElement {
|
|
|
76
73
|
.mode=${isMobileDevice() ? 'LIST' : 'GRID'}
|
|
77
74
|
.config=${this.columns}
|
|
78
75
|
.data=${
|
|
79
|
-
{
|
|
80
|
-
records: this.activityThreads
|
|
76
|
+
{
|
|
77
|
+
records: this.activityThreads
|
|
81
78
|
}
|
|
82
79
|
}
|
|
83
80
|
></ox-grist>
|
|
@@ -98,10 +95,8 @@ export class ActivityThreadImporter extends LitElement {
|
|
|
98
95
|
variables: { activityThreads: this.activityThreads }
|
|
99
96
|
})
|
|
100
97
|
|
|
101
|
-
if (response.
|
|
98
|
+
if (response.errors?.length) return
|
|
102
99
|
|
|
103
100
|
this.dispatchEvent(new CustomEvent('imported'))
|
|
104
101
|
}
|
|
105
102
|
}
|
|
106
|
-
|
|
107
|
-
window.customElements.define('activity-thread-importer', ActivityThreadImporter)
|
package/client/pages/activity-thread/{activity-thread-list-page.js → activity-thread-list-page.ts}
RENAMED
|
@@ -3,6 +3,7 @@ import './activity-thread-importer.js'
|
|
|
3
3
|
|
|
4
4
|
import gql from 'graphql-tag'
|
|
5
5
|
import { css, html } from 'lit'
|
|
6
|
+
import { customElement, property, query } from 'lit/decorators.js'
|
|
6
7
|
import { connect } from 'pwa-helpers/connect-mixin.js'
|
|
7
8
|
|
|
8
9
|
import { client } from '@operato/graphql'
|
|
@@ -12,16 +13,9 @@ import { PageView, store } from '@operato/shell'
|
|
|
12
13
|
import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
|
13
14
|
import { isMobileDevice } from '@operato/utils'
|
|
14
15
|
|
|
16
|
+
@customElement('activity-thread-list-page')
|
|
15
17
|
export class ActivityThreadListPage extends connect(store)(localize(i18next)(PageView)) {
|
|
16
|
-
static
|
|
17
|
-
return {
|
|
18
|
-
gristConfig: Object,
|
|
19
|
-
mode: String
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
static get styles() {
|
|
24
|
-
return [
|
|
18
|
+
static styles = [
|
|
25
19
|
ScrollbarStyles,
|
|
26
20
|
CommonGristStyles,
|
|
27
21
|
css`
|
|
@@ -35,7 +29,9 @@ export class ActivityThreadListPage extends connect(store)(localize(i18next)(Pag
|
|
|
35
29
|
}
|
|
36
30
|
`
|
|
37
31
|
]
|
|
38
|
-
|
|
32
|
+
|
|
33
|
+
@property({ type: Object }) gristConfig?: any
|
|
34
|
+
@property({ type: String }) mode?: 'GRID' | 'LIST' | 'CARD' = (isMobileDevice() ? 'LIST' : 'GRID')
|
|
39
35
|
|
|
40
36
|
get context() {
|
|
41
37
|
return {
|
|
@@ -63,8 +59,11 @@ export class ActivityThreadListPage extends connect(store)(localize(i18next)(Pag
|
|
|
63
59
|
}
|
|
64
60
|
}
|
|
65
61
|
|
|
62
|
+
@query('#sorter-control') sorterControl?: any
|
|
63
|
+
@query('ox-grist') grist?: HTMLElement & { fetch: any; selected: any; dirtyRecords: any; dirtyData: any }
|
|
64
|
+
|
|
66
65
|
render() {
|
|
67
|
-
const mode = this.mode
|
|
66
|
+
const mode = this.mode
|
|
68
67
|
|
|
69
68
|
return html`
|
|
70
69
|
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
|
|
@@ -77,8 +76,8 @@ export class ActivityThreadListPage extends connect(store)(localize(i18next)(Pag
|
|
|
77
76
|
Sort
|
|
78
77
|
<mwc-icon
|
|
79
78
|
@click=${e => {
|
|
80
|
-
const target = e.currentTarget
|
|
81
|
-
this.
|
|
79
|
+
const target = e.currentTarget;
|
|
80
|
+
this.sorterControl.open({
|
|
82
81
|
right: 0,
|
|
83
82
|
top: target.offsetTop + target.offsetHeight
|
|
84
83
|
})
|
|
@@ -100,10 +99,6 @@ export class ActivityThreadListPage extends connect(store)(localize(i18next)(Pag
|
|
|
100
99
|
`
|
|
101
100
|
}
|
|
102
101
|
|
|
103
|
-
get grist() {
|
|
104
|
-
return this.renderRoot.querySelector('ox-grist')
|
|
105
|
-
}
|
|
106
|
-
|
|
107
102
|
async pageInitialized(lifecycle) {
|
|
108
103
|
this.gristConfig = {
|
|
109
104
|
list: {
|
|
@@ -221,7 +216,7 @@ export class ActivityThreadListPage extends connect(store)(localize(i18next)(Pag
|
|
|
221
216
|
|
|
222
217
|
async _deleteActivityThread() {
|
|
223
218
|
if (confirm(i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }))) {
|
|
224
|
-
const ids = this.grist
|
|
219
|
+
const ids = this.grist?.selected.map(record => record.id)
|
|
225
220
|
if (ids && ids.length > 0) {
|
|
226
221
|
const response = await client.mutate({
|
|
227
222
|
mutation: gql`
|
|
@@ -235,7 +230,7 @@ export class ActivityThreadListPage extends connect(store)(localize(i18next)(Pag
|
|
|
235
230
|
})
|
|
236
231
|
|
|
237
232
|
if (!response.errors) {
|
|
238
|
-
this.grist
|
|
233
|
+
this.grist?.fetch()
|
|
239
234
|
notify({
|
|
240
235
|
message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })
|
|
241
236
|
})
|
|
@@ -245,7 +240,7 @@ export class ActivityThreadListPage extends connect(store)(localize(i18next)(Pag
|
|
|
245
240
|
}
|
|
246
241
|
|
|
247
242
|
async _updateActivityThread() {
|
|
248
|
-
let patches = this.grist
|
|
243
|
+
let patches = this.grist?.dirtyRecords
|
|
249
244
|
if (patches && patches.length) {
|
|
250
245
|
patches = patches.map(patch => {
|
|
251
246
|
let patchField = patch.id ? { id: patch.id } : {}
|
|
@@ -253,7 +248,7 @@ export class ActivityThreadListPage extends connect(store)(localize(i18next)(Pag
|
|
|
253
248
|
for (let key in dirtyFields) {
|
|
254
249
|
patchField[key] = dirtyFields[key].after
|
|
255
250
|
}
|
|
256
|
-
patchField.cuFlag = patch.__dirty__
|
|
251
|
+
(patchField as any).cuFlag = patch.__dirty__
|
|
257
252
|
|
|
258
253
|
return patchField
|
|
259
254
|
})
|
|
@@ -272,13 +267,13 @@ export class ActivityThreadListPage extends connect(store)(localize(i18next)(Pag
|
|
|
272
267
|
})
|
|
273
268
|
|
|
274
269
|
if (!response.errors) {
|
|
275
|
-
this.grist
|
|
270
|
+
this.grist?.fetch()
|
|
276
271
|
}
|
|
277
272
|
}
|
|
278
273
|
}
|
|
279
274
|
|
|
280
275
|
async exportHandler() {
|
|
281
|
-
const exportTargets = this.grist
|
|
276
|
+
const exportTargets = this.grist?.selected.length ? this.grist?.selected : this.grist?.dirtyData.records
|
|
282
277
|
const targetFieldSet = new Set(['id', 'name', 'description', 'active'])
|
|
283
278
|
|
|
284
279
|
return exportTargets.map(activityThread => {
|
|
@@ -298,7 +293,7 @@ export class ActivityThreadListPage extends connect(store)(localize(i18next)(Pag
|
|
|
298
293
|
.activityThreads=${records}
|
|
299
294
|
@imported=${() => {
|
|
300
295
|
history.back()
|
|
301
|
-
this.grist
|
|
296
|
+
this.grist?.fetch()
|
|
302
297
|
}}
|
|
303
298
|
></activity-thread-importer>
|
|
304
299
|
`,
|
|
@@ -310,9 +305,7 @@ export class ActivityThreadListPage extends connect(store)(localize(i18next)(Pag
|
|
|
310
305
|
)
|
|
311
306
|
|
|
312
307
|
popup.onclosed = () => {
|
|
313
|
-
this.grist
|
|
308
|
+
this.grist?.fetch()
|
|
314
309
|
}
|
|
315
310
|
}
|
|
316
311
|
}
|
|
317
|
-
|
|
318
|
-
window.customElements.define('activity-thread-list-page', ActivityThreadListPage)
|
|
@@ -4,6 +4,7 @@ import '@operato/board/ox-board-viewer.js'
|
|
|
4
4
|
import gql from 'graphql-tag'
|
|
5
5
|
import { css, html } from 'lit'
|
|
6
6
|
import { unsafeHTML } from 'lit-html/directives/unsafe-html.js'
|
|
7
|
+
import { customElement, property, query } from 'lit/decorators.js'
|
|
7
8
|
import { connect } from 'pwa-helpers/connect-mixin.js'
|
|
8
9
|
|
|
9
10
|
import { client } from '@operato/graphql'
|
|
@@ -16,7 +17,7 @@ const formatter = new Intl.DateTimeFormat(navigator.language, { dateStyle: 'full
|
|
|
16
17
|
|
|
17
18
|
const ActivityThreadFetchResult = `\
|
|
18
19
|
{
|
|
19
|
-
id
|
|
20
|
+
id
|
|
20
21
|
state
|
|
21
22
|
dueAt
|
|
22
23
|
assignedAt
|
|
@@ -62,46 +63,41 @@ export const ActivityThreadStatus = {
|
|
|
62
63
|
Aborted: 'aborted'
|
|
63
64
|
}
|
|
64
65
|
|
|
66
|
+
@customElement('activity-thread-page')
|
|
65
67
|
export class ActivityThreadPage extends connect(store)(localize(i18next)(PageView)) {
|
|
66
|
-
static
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
static styles = [
|
|
69
|
+
ScrollbarStyles,
|
|
70
|
+
CommonGristStyles,
|
|
71
|
+
css`
|
|
72
|
+
:host {
|
|
73
|
+
display: flex;
|
|
74
|
+
flex-direction: column;
|
|
75
|
+
|
|
76
|
+
width: 100%;
|
|
77
|
+
padding: 5px;
|
|
78
|
+
overflow: auto;
|
|
79
|
+
}
|
|
72
80
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
css`
|
|
78
|
-
:host {
|
|
79
|
-
display: flex;
|
|
80
|
-
flex-direction: column;
|
|
81
|
-
|
|
82
|
-
width: 100%;
|
|
83
|
-
padding: 5px;
|
|
84
|
-
overflow: auto;
|
|
85
|
-
}
|
|
81
|
+
[header] {
|
|
82
|
+
display: block;
|
|
83
|
+
padding: 5px;
|
|
84
|
+
}
|
|
86
85
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
86
|
+
[content] {
|
|
87
|
+
flex: 1;
|
|
88
|
+
display: block;
|
|
89
|
+
padding: 5px;
|
|
90
|
+
}
|
|
91
91
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
92
|
+
ox-board-viewer {
|
|
93
|
+
width: 100%;
|
|
94
|
+
height: 100%;
|
|
95
|
+
}
|
|
96
|
+
`
|
|
97
|
+
]
|
|
97
98
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
height: 100%;
|
|
101
|
-
}
|
|
102
|
-
`
|
|
103
|
-
]
|
|
104
|
-
}
|
|
99
|
+
@property({ type: Object }) activityThread: any
|
|
100
|
+
@property({ type: Object }) board: any
|
|
105
101
|
|
|
106
102
|
get context() {
|
|
107
103
|
const startable = [ActivityThreadStatus.Assigned].includes(this.activityThread?.state)
|
|
@@ -128,7 +124,7 @@ export class ActivityThreadPage extends connect(store)(localize(i18next)(PageVie
|
|
|
128
124
|
endable && {
|
|
129
125
|
title: i18next.t('button.finish'),
|
|
130
126
|
action: this._endActivityThread.bind(this),
|
|
131
|
-
...CommonButtonStyles.
|
|
127
|
+
...CommonButtonStyles.save
|
|
132
128
|
}
|
|
133
129
|
].filter(Boolean /* truthy only */)
|
|
134
130
|
}
|
|
@@ -255,9 +251,11 @@ export class ActivityThreadPage extends connect(store)(localize(i18next)(PageVie
|
|
|
255
251
|
`
|
|
256
252
|
}
|
|
257
253
|
|
|
254
|
+
@query('ox-board-viewer') oxBoardViewer: any
|
|
255
|
+
|
|
258
256
|
getOutputFromBoard() {
|
|
259
257
|
const outputSpec = this.getOutputSpec()
|
|
260
|
-
const data = this.
|
|
258
|
+
const data = this.oxBoardViewer.getSceneData()
|
|
261
259
|
|
|
262
260
|
return outputSpec.reduce((output, spec) => {
|
|
263
261
|
output[spec.name] = data[spec.name]
|
|
@@ -394,5 +392,3 @@ export class ActivityThreadPage extends connect(store)(localize(i18next)(PageVie
|
|
|
394
392
|
}
|
|
395
393
|
}
|
|
396
394
|
}
|
|
397
|
-
|
|
398
|
-
window.customElements.define('activity-thread-page', ActivityThreadPage)
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { html } from 'lit
|
|
1
|
+
import { html } from 'lit'
|
|
2
|
+
import { customElement } from 'lit/decorators.js'
|
|
2
3
|
import { connect } from 'pwa-helpers/connect-mixin.js'
|
|
3
4
|
|
|
4
5
|
import { PageView, store } from '@operato/shell'
|
|
5
6
|
|
|
7
|
+
@customElement('worklist-dashboard')
|
|
6
8
|
class WorklistDashboardHome extends connect(store)(PageView) {
|
|
7
|
-
static get properties() {
|
|
8
|
-
return {}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
9
|
render() {
|
|
12
10
|
return html`
|
|
13
11
|
<section>
|
|
@@ -16,5 +14,3 @@ class WorklistDashboardHome extends connect(store)(PageView) {
|
|
|
16
14
|
`
|
|
17
15
|
}
|
|
18
16
|
}
|
|
19
|
-
|
|
20
|
-
window.customElements.define('worklist-dashboard', WorklistDashboardHome)
|
|
@@ -2,6 +2,7 @@ import '@operato/data-grist'
|
|
|
2
2
|
|
|
3
3
|
import gql from 'graphql-tag'
|
|
4
4
|
import { css, html } from 'lit'
|
|
5
|
+
import { customElement, property, query } from 'lit/decorators.js'
|
|
5
6
|
import { connect } from 'pwa-helpers/connect-mixin.js'
|
|
6
7
|
|
|
7
8
|
import { getRenderer } from '@operato/data-grist'
|
|
@@ -11,16 +12,9 @@ import { PageView, store } from '@operato/shell'
|
|
|
11
12
|
import { CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
|
12
13
|
import { isMobileDevice } from '@operato/utils'
|
|
13
14
|
|
|
15
|
+
@customElement('assigned-list-page')
|
|
14
16
|
export class AssignedListPage extends connect(store)(localize(i18next)(PageView)) {
|
|
15
|
-
static
|
|
16
|
-
return {
|
|
17
|
-
gristConfig: Object,
|
|
18
|
-
mode: String
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
static get styles() {
|
|
23
|
-
return [
|
|
17
|
+
static styles = [
|
|
24
18
|
ScrollbarStyles,
|
|
25
19
|
CommonGristStyles,
|
|
26
20
|
css`
|
|
@@ -34,7 +28,9 @@ export class AssignedListPage extends connect(store)(localize(i18next)(PageView)
|
|
|
34
28
|
}
|
|
35
29
|
`
|
|
36
30
|
]
|
|
37
|
-
|
|
31
|
+
|
|
32
|
+
@property({ type: Object }) gristConfig?: any
|
|
33
|
+
@property({ type: String }) mode : 'GRID' | 'LIST' | 'CARD' = (isMobileDevice() ? 'LIST' : 'GRID')
|
|
38
34
|
|
|
39
35
|
get context() {
|
|
40
36
|
return {
|
|
@@ -44,8 +40,11 @@ export class AssignedListPage extends connect(store)(localize(i18next)(PageView)
|
|
|
44
40
|
}
|
|
45
41
|
}
|
|
46
42
|
|
|
43
|
+
@query('#sorter-control') sorterControl?: any
|
|
44
|
+
@query('ox-grist') grist?: HTMLElement & { fetch: any; }
|
|
45
|
+
|
|
47
46
|
render() {
|
|
48
|
-
const mode = this.mode
|
|
47
|
+
const mode = this.mode
|
|
49
48
|
|
|
50
49
|
return html`
|
|
51
50
|
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
|
|
@@ -58,8 +57,8 @@ export class AssignedListPage extends connect(store)(localize(i18next)(PageView)
|
|
|
58
57
|
Sort
|
|
59
58
|
<mwc-icon
|
|
60
59
|
@click=${e => {
|
|
61
|
-
const target = e.currentTarget
|
|
62
|
-
this.
|
|
60
|
+
const target = e.currentTarget;
|
|
61
|
+
this.sorterControl.open({
|
|
63
62
|
right: 0,
|
|
64
63
|
top: target.offsetTop + target.offsetHeight
|
|
65
64
|
})
|
|
@@ -81,10 +80,6 @@ export class AssignedListPage extends connect(store)(localize(i18next)(PageView)
|
|
|
81
80
|
`
|
|
82
81
|
}
|
|
83
82
|
|
|
84
|
-
get grist() {
|
|
85
|
-
return this.renderRoot.querySelector('ox-grist')
|
|
86
|
-
}
|
|
87
|
-
|
|
88
83
|
async pageInitialized(lifecycle) {
|
|
89
84
|
this.gristConfig = {
|
|
90
85
|
list: {
|
|
@@ -196,7 +191,7 @@ export class AssignedListPage extends connect(store)(localize(i18next)(PageView)
|
|
|
196
191
|
|
|
197
192
|
async pageUpdated(changes, lifecycle, changedBefore) {
|
|
198
193
|
if (this.active) {
|
|
199
|
-
this.grist
|
|
194
|
+
this.grist?.fetch()
|
|
200
195
|
}
|
|
201
196
|
}
|
|
202
197
|
|
|
@@ -241,5 +236,3 @@ export class AssignedListPage extends connect(store)(localize(i18next)(PageView)
|
|
|
241
236
|
}
|
|
242
237
|
}
|
|
243
238
|
}
|
|
244
|
-
|
|
245
|
-
window.customElements.define('assigned-list-page', AssignedListPage)
|