@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
|
@@ -3,6 +3,7 @@ import '../../components/activity-starter-form.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 { CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
|
13
14
|
import { isMobileDevice } from '@operato/utils'
|
|
14
15
|
|
|
16
|
+
@customElement('starter-list-page')
|
|
15
17
|
export class StarterListPage 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 StarterListPage extends connect(store)(localize(i18next)(PageView))
|
|
|
35
29
|
}
|
|
36
30
|
`
|
|
37
31
|
]
|
|
38
|
-
|
|
32
|
+
|
|
33
|
+
@property({ type: Object }) gristConfig?: any
|
|
34
|
+
@property({ type: String }) mode :'GRID' | 'LIST' | 'CARD' = (isMobileDevice() ? 'CARD' : 'GRID')
|
|
39
35
|
|
|
40
36
|
get context() {
|
|
41
37
|
return {
|
|
@@ -44,8 +40,11 @@ export class StarterListPage 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; dirtyRecords: 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 StarterListPage 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,9 +80,7 @@ export class StarterListPage extends connect(store)(localize(i18next)(PageView))
|
|
|
81
80
|
`
|
|
82
81
|
}
|
|
83
82
|
|
|
84
|
-
|
|
85
|
-
return this.renderRoot.querySelector('ox-grist')
|
|
86
|
-
}
|
|
83
|
+
|
|
87
84
|
|
|
88
85
|
async pageInitialized(lifecycle) {
|
|
89
86
|
this.gristConfig = {
|
|
@@ -115,7 +112,7 @@ export class StarterListPage extends connect(store)(localize(i18next)(PageView))
|
|
|
115
112
|
}
|
|
116
113
|
)
|
|
117
114
|
popup.onclosed = () => {
|
|
118
|
-
this.grist
|
|
115
|
+
this.grist?.fetch()
|
|
119
116
|
}
|
|
120
117
|
}
|
|
121
118
|
}
|
|
@@ -182,7 +179,7 @@ export class StarterListPage extends connect(store)(localize(i18next)(PageView))
|
|
|
182
179
|
|
|
183
180
|
async pageUpdated(changes, lifecycle, changedBefore) {
|
|
184
181
|
if (this.active) {
|
|
185
|
-
this.grist
|
|
182
|
+
this.grist?.fetch()
|
|
186
183
|
}
|
|
187
184
|
}
|
|
188
185
|
|
|
@@ -221,5 +218,3 @@ export class StarterListPage extends connect(store)(localize(i18next)(PageView))
|
|
|
221
218
|
}
|
|
222
219
|
}
|
|
223
220
|
}
|
|
224
|
-
|
|
225
|
-
window.customElements.define('starter-list-page', StarterListPage)
|
|
@@ -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 { client } from '@operato/graphql'
|
|
@@ -10,30 +11,25 @@ import { PageView, store } from '@operato/shell'
|
|
|
10
11
|
import { CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
|
11
12
|
import { isMobileDevice } from '@operato/utils'
|
|
12
13
|
|
|
14
|
+
@customElement('activity-instance-list-page')
|
|
13
15
|
export class ActivityInstanceListPage extends connect(store)(localize(i18next)(PageView)) {
|
|
14
|
-
static
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
static styles = [
|
|
17
|
+
ScrollbarStyles,
|
|
18
|
+
CommonGristStyles,
|
|
19
|
+
css`
|
|
20
|
+
:host {
|
|
21
|
+
display: flex;
|
|
20
22
|
|
|
21
|
-
|
|
22
|
-
return [
|
|
23
|
-
ScrollbarStyles,
|
|
24
|
-
CommonGristStyles,
|
|
25
|
-
css`
|
|
26
|
-
:host {
|
|
27
|
-
display: flex;
|
|
23
|
+
width: 100%;
|
|
28
24
|
|
|
29
|
-
|
|
25
|
+
--grid-record-emphasized-background-color: red;
|
|
26
|
+
--grid-record-emphasized-color: yellow;
|
|
27
|
+
}
|
|
28
|
+
`
|
|
29
|
+
]
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
`
|
|
35
|
-
]
|
|
36
|
-
}
|
|
31
|
+
@property({ type: Object }) gristConfig: any
|
|
32
|
+
@property({ type: String }) mode: string = isMobileDevice() ? 'CARD' : 'GRID'
|
|
37
33
|
|
|
38
34
|
get context() {
|
|
39
35
|
return {
|
|
@@ -43,8 +39,10 @@ export class ActivityInstanceListPage extends connect(store)(localize(i18next)(P
|
|
|
43
39
|
}
|
|
44
40
|
}
|
|
45
41
|
|
|
42
|
+
@query('#sorter-control') sorterControl?: any
|
|
43
|
+
|
|
46
44
|
render() {
|
|
47
|
-
const mode = this.mode
|
|
45
|
+
const mode = this.mode
|
|
48
46
|
|
|
49
47
|
return html`
|
|
50
48
|
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
|
|
@@ -56,9 +54,9 @@ export class ActivityInstanceListPage extends connect(store)(localize(i18next)(P
|
|
|
56
54
|
<div id="sorters">
|
|
57
55
|
Sort
|
|
58
56
|
<mwc-icon
|
|
59
|
-
@click=${e => {
|
|
60
|
-
const target = e.currentTarget
|
|
61
|
-
|
|
57
|
+
@click=${(e: MouseEvent) => {
|
|
58
|
+
const target = e.currentTarget as HTMLElement;
|
|
59
|
+
this.sorterControl.open({
|
|
62
60
|
right: 0,
|
|
63
61
|
top: target.offsetTop + target.offsetHeight
|
|
64
62
|
})
|
|
@@ -80,10 +78,6 @@ export class ActivityInstanceListPage extends connect(store)(localize(i18next)(P
|
|
|
80
78
|
`
|
|
81
79
|
}
|
|
82
80
|
|
|
83
|
-
get grist() {
|
|
84
|
-
return this.renderRoot.querySelector('ox-grist')
|
|
85
|
-
}
|
|
86
|
-
|
|
87
81
|
async pageInitialized(lifecycle) {
|
|
88
82
|
this.gristConfig = {
|
|
89
83
|
list: {
|
|
@@ -209,5 +203,3 @@ export class ActivityInstanceListPage extends connect(store)(localize(i18next)(P
|
|
|
209
203
|
}
|
|
210
204
|
}
|
|
211
205
|
}
|
|
212
|
-
|
|
213
|
-
window.customElements.define('activity-instance-list-page', ActivityInstanceListPage)
|
package/client/pages/activity-instance/{activity-instance-page.js → activity-instance-page.ts}
RENAMED
|
@@ -4,12 +4,13 @@ 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'
|
|
10
11
|
import { i18next, localize } from '@operato/i18n'
|
|
11
12
|
import { PageView, store } from '@operato/shell'
|
|
12
|
-
import {
|
|
13
|
+
import { CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
|
13
14
|
import { provider } from '@things-factory/board-ui'
|
|
14
15
|
|
|
15
16
|
const formatter = new Intl.DateTimeFormat(navigator.language, { dateStyle: 'full', timeStyle: 'short' })
|
|
@@ -25,46 +26,41 @@ export const ActivityInstanceStatus = {
|
|
|
25
26
|
Aborted: 'aborted'
|
|
26
27
|
}
|
|
27
28
|
|
|
29
|
+
@customElement('activity-instance-page')
|
|
28
30
|
export class ActivityInstancePage extends connect(store)(localize(i18next)(PageView)) {
|
|
29
|
-
static
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
static styles = [
|
|
32
|
+
ScrollbarStyles,
|
|
33
|
+
CommonGristStyles,
|
|
34
|
+
css`
|
|
35
|
+
:host {
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
|
|
39
|
+
width: 100%;
|
|
40
|
+
padding: 5px;
|
|
41
|
+
overflow: auto;
|
|
42
|
+
}
|
|
35
43
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
css`
|
|
41
|
-
:host {
|
|
42
|
-
display: flex;
|
|
43
|
-
flex-direction: column;
|
|
44
|
-
|
|
45
|
-
width: 100%;
|
|
46
|
-
padding: 5px;
|
|
47
|
-
overflow: auto;
|
|
48
|
-
}
|
|
44
|
+
[header] {
|
|
45
|
+
display: block;
|
|
46
|
+
padding: 5px;
|
|
47
|
+
}
|
|
49
48
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
[content] {
|
|
50
|
+
flex: 1;
|
|
51
|
+
display: block;
|
|
52
|
+
padding: 5px;
|
|
53
|
+
}
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
55
|
+
ox-board-viewer {
|
|
56
|
+
width: 100%;
|
|
57
|
+
height: 100%;
|
|
58
|
+
}
|
|
59
|
+
`
|
|
60
|
+
]
|
|
60
61
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
height: 100%;
|
|
64
|
-
}
|
|
65
|
-
`
|
|
66
|
-
]
|
|
67
|
-
}
|
|
62
|
+
@property({ type: Object }) activityInstance: any
|
|
63
|
+
@property({ type: Object }) board: any
|
|
68
64
|
|
|
69
65
|
get context() {
|
|
70
66
|
const assignable = [ActivityInstanceStatus.Posted, ActivityInstanceStatus.WaitingAssignment].includes(
|
|
@@ -81,13 +77,14 @@ export class ActivityInstancePage extends connect(store)(localize(i18next)(PageV
|
|
|
81
77
|
actions: [
|
|
82
78
|
finishable && {
|
|
83
79
|
title: i18next.t('button.finish'),
|
|
84
|
-
action: this._endActivityInstance.bind(this)
|
|
85
|
-
...CommonButtonStyles.finish
|
|
80
|
+
action: this._endActivityInstance.bind(this)
|
|
86
81
|
}
|
|
87
82
|
].filter(Boolean /* truthy only */)
|
|
88
83
|
}
|
|
89
84
|
}
|
|
90
85
|
|
|
86
|
+
@query('ox-board-viewer') viewer: any
|
|
87
|
+
|
|
91
88
|
render() {
|
|
92
89
|
const { name, description, state, thumbnail, dueAt, createdAt } = this.activityInstance || {}
|
|
93
90
|
return html`
|
|
@@ -206,7 +203,7 @@ export class ActivityInstancePage extends connect(store)(localize(i18next)(PageV
|
|
|
206
203
|
|
|
207
204
|
getOutputFromBoard() {
|
|
208
205
|
const outputSpec = this.getOutputSpec()
|
|
209
|
-
const data = this.
|
|
206
|
+
const data = this.viewer?.getSceneData() || {}
|
|
210
207
|
|
|
211
208
|
return outputSpec.reduce((output, spec) => {
|
|
212
209
|
output[spec.name] = data[spec.name]
|
|
@@ -417,5 +414,3 @@ export class ActivityInstancePage extends connect(store)(localize(i18next)(PageV
|
|
|
417
414
|
}
|
|
418
415
|
}
|
|
419
416
|
}
|
|
420
|
-
|
|
421
|
-
window.customElements.define('activity-instance-page', ActivityInstancePage)
|
|
@@ -3,6 +3,7 @@ import '../../components/activity-intro-view'
|
|
|
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'
|
|
@@ -13,29 +14,24 @@ import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato
|
|
|
13
14
|
|
|
14
15
|
import { ActivityTypes } from '../../types.js'
|
|
15
16
|
|
|
17
|
+
@customElement('activity-store-page')
|
|
16
18
|
export class ActivityStorePage extends connect(store)(localize(i18next)(PageView)) {
|
|
17
|
-
static
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
static styles = [
|
|
20
|
+
ScrollbarStyles,
|
|
21
|
+
CommonGristStyles,
|
|
22
|
+
css`
|
|
23
|
+
:host {
|
|
24
|
+
display: flex;
|
|
22
25
|
|
|
23
|
-
|
|
24
|
-
return [
|
|
25
|
-
ScrollbarStyles,
|
|
26
|
-
CommonGristStyles,
|
|
27
|
-
css`
|
|
28
|
-
:host {
|
|
29
|
-
display: flex;
|
|
26
|
+
width: 100%;
|
|
30
27
|
|
|
31
|
-
|
|
28
|
+
--grid-record-emphasized-background-color: red;
|
|
29
|
+
--grid-record-emphasized-color: yellow;
|
|
30
|
+
}
|
|
31
|
+
`
|
|
32
|
+
]
|
|
32
33
|
|
|
33
|
-
|
|
34
|
-
--grid-record-emphasized-color: yellow;
|
|
35
|
-
}
|
|
36
|
-
`
|
|
37
|
-
]
|
|
38
|
-
}
|
|
34
|
+
@property({ type: Object }) gristConfig?: any
|
|
39
35
|
|
|
40
36
|
get context() {
|
|
41
37
|
return {
|
|
@@ -45,12 +41,15 @@ export class ActivityStorePage extends connect(store)(localize(i18next)(PageView
|
|
|
45
41
|
{
|
|
46
42
|
title: i18next.t('button.buy'),
|
|
47
43
|
action: this._buyActivityTemplate.bind(this),
|
|
48
|
-
...CommonButtonStyles.
|
|
44
|
+
...CommonButtonStyles.save
|
|
49
45
|
}
|
|
50
46
|
]
|
|
51
47
|
}
|
|
52
48
|
}
|
|
53
49
|
|
|
50
|
+
@query('#sorter-control') sorterControl?: any
|
|
51
|
+
@query('ox-grist') grist?: HTMLElement & { fetch: any }
|
|
52
|
+
|
|
54
53
|
render() {
|
|
55
54
|
return html`
|
|
56
55
|
<ox-grist mode="CARD" .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
|
|
@@ -64,7 +63,7 @@ export class ActivityStorePage extends connect(store)(localize(i18next)(PageView
|
|
|
64
63
|
<mwc-icon
|
|
65
64
|
@click=${e => {
|
|
66
65
|
const target = e.currentTarget
|
|
67
|
-
this.
|
|
66
|
+
this.sorterControl.open({
|
|
68
67
|
right: 0,
|
|
69
68
|
top: target.offsetTop + target.offsetHeight
|
|
70
69
|
})
|
|
@@ -80,10 +79,6 @@ export class ActivityStorePage extends connect(store)(localize(i18next)(PageView
|
|
|
80
79
|
`
|
|
81
80
|
}
|
|
82
81
|
|
|
83
|
-
get grist() {
|
|
84
|
-
return this.renderRoot.querySelector('ox-grist')
|
|
85
|
-
}
|
|
86
|
-
|
|
87
82
|
async pageInitialized(lifecycle) {
|
|
88
83
|
this.gristConfig = {
|
|
89
84
|
list: {
|
|
@@ -115,7 +110,7 @@ export class ActivityStorePage extends connect(store)(localize(i18next)(PageView
|
|
|
115
110
|
)
|
|
116
111
|
|
|
117
112
|
popup.onclosed = () => {
|
|
118
|
-
this.grist
|
|
113
|
+
this.grist?.fetch()
|
|
119
114
|
}
|
|
120
115
|
}
|
|
121
116
|
}
|
|
@@ -187,7 +182,7 @@ export class ActivityStorePage extends connect(store)(localize(i18next)(PageView
|
|
|
187
182
|
|
|
188
183
|
async pageUpdated(changes, lifecycle) {
|
|
189
184
|
if (this.active) {
|
|
190
|
-
this.grist
|
|
185
|
+
this.grist?.fetch()
|
|
191
186
|
}
|
|
192
187
|
}
|
|
193
188
|
|
|
@@ -229,5 +224,3 @@ export class ActivityStorePage extends connect(store)(localize(i18next)(PageView
|
|
|
229
224
|
console.log('bought')
|
|
230
225
|
}
|
|
231
226
|
}
|
|
232
|
-
|
|
233
|
-
window.customElements.define('activity-store-page', ActivityStorePage)
|
|
@@ -3,6 +3,7 @@ import '../../components/activity-reporter-view.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 { CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
|
13
14
|
import { isMobileDevice } from '@operato/utils'
|
|
14
15
|
|
|
16
|
+
@customElement('reporter-list-page')
|
|
15
17
|
export class ReporterListPage 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 ReporterListPage extends connect(store)(localize(i18next)(PageView)
|
|
|
35
29
|
}
|
|
36
30
|
`
|
|
37
31
|
]
|
|
38
|
-
|
|
32
|
+
|
|
33
|
+
@property({type: Object}) gristConfig: any
|
|
34
|
+
@property({type: Object}) mode: 'GRID' | 'LIST' | 'CARD' = (isMobileDevice() ? 'CARD' : 'GRID')
|
|
39
35
|
|
|
40
36
|
get context() {
|
|
41
37
|
return {
|
|
@@ -44,8 +40,11 @@ export class ReporterListPage 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 ReporterListPage 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 ReporterListPage 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: {
|
|
@@ -115,7 +110,7 @@ export class ReporterListPage extends connect(store)(localize(i18next)(PageView)
|
|
|
115
110
|
}
|
|
116
111
|
)
|
|
117
112
|
popup.onclosed = () => {
|
|
118
|
-
this.grist
|
|
113
|
+
this.grist?.fetch()
|
|
119
114
|
}
|
|
120
115
|
}
|
|
121
116
|
}
|
|
@@ -182,7 +177,7 @@ export class ReporterListPage extends connect(store)(localize(i18next)(PageView)
|
|
|
182
177
|
|
|
183
178
|
async pageUpdated(changes, lifecycle, changedBefore) {
|
|
184
179
|
if (this.active) {
|
|
185
|
-
this.grist
|
|
180
|
+
this.grist?.fetch()
|
|
186
181
|
}
|
|
187
182
|
}
|
|
188
183
|
|
|
@@ -221,5 +216,3 @@ export class ReporterListPage extends connect(store)(localize(i18next)(PageView)
|
|
|
221
216
|
}
|
|
222
217
|
}
|
|
223
218
|
}
|
|
224
|
-
|
|
225
|
-
window.customElements.define('reporter-list-page', ReporterListPage)
|
|
@@ -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-template-importer')
|
|
10
12
|
export class ActivityTemplateImporter 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 }) activityTemplates?: any
|
|
17
40
|
|
|
18
41
|
constructor() {
|
|
19
42
|
super()
|
|
@@ -43,41 +66,14 @@ export class ActivityTemplateImporter 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
|
-
|
|
73
69
|
render() {
|
|
74
70
|
return html`
|
|
75
71
|
<ox-grist
|
|
76
72
|
.mode=${isMobileDevice() ? 'LIST' : 'GRID'}
|
|
77
73
|
.config=${this.columns}
|
|
78
74
|
.data=${
|
|
79
|
-
{
|
|
80
|
-
records: this.activityTemplates
|
|
75
|
+
{
|
|
76
|
+
records: this.activityTemplates
|
|
81
77
|
}
|
|
82
78
|
}
|
|
83
79
|
></ox-grist>
|
|
@@ -98,10 +94,8 @@ export class ActivityTemplateImporter extends LitElement {
|
|
|
98
94
|
variables: { activityTemplates: this.activityTemplates }
|
|
99
95
|
})
|
|
100
96
|
|
|
101
|
-
if (response.
|
|
97
|
+
if (response.errors?.length) return
|
|
102
98
|
|
|
103
99
|
this.dispatchEvent(new CustomEvent('imported'))
|
|
104
100
|
}
|
|
105
101
|
}
|
|
106
|
-
|
|
107
|
-
window.customElements.define('activity-template-importer', ActivityTemplateImporter)
|