@things-factory/process 7.0.2 → 7.0.7
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/pages/event/event-list-page.ts +14 -28
- package/client/pages/gateway/gateway-list-page.ts +14 -29
- package/client/pages/process/process-list-page.ts +14 -28
- package/client/pages/process-instance/process-instance-list-page.ts +14 -29
- package/client/pages/process-thread/process-thread-list-page.ts +14 -29
- package/dist-client/pages/event/event-list-page.d.ts +0 -1
- package/dist-client/pages/event/event-list-page.js +13 -31
- package/dist-client/pages/event/event-list-page.js.map +1 -1
- package/dist-client/pages/gateway/gateway-list-page.d.ts +0 -1
- package/dist-client/pages/gateway/gateway-list-page.js +13 -31
- package/dist-client/pages/gateway/gateway-list-page.js.map +1 -1
- package/dist-client/pages/process/process-list-page.d.ts +0 -1
- package/dist-client/pages/process/process-list-page.js +13 -31
- package/dist-client/pages/process/process-list-page.js.map +1 -1
- package/dist-client/pages/process-instance/process-instance-list-page.d.ts +0 -1
- package/dist-client/pages/process-instance/process-instance-list-page.js +13 -31
- package/dist-client/pages/process-instance/process-instance-list-page.js.map +1 -1
- package/dist-client/pages/process-thread/process-thread-list-page.d.ts +0 -1
- package/dist-client/pages/process-thread/process-thread-list-page.js +13 -31
- package/dist-client/pages/process-thread/process-thread-list-page.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -10
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import '@operato/data-grist'
|
|
2
2
|
|
|
3
|
-
import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
|
3
|
+
import { CommonButtonStyles, CommonHeaderStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
|
4
4
|
import { PageView, store } from '@operato/shell'
|
|
5
5
|
import { css, html } from 'lit'
|
|
6
6
|
import { customElement, property, query } from 'lit/decorators.js'
|
|
7
7
|
import { ScopedElementsMixin } from '@open-wc/scoped-elements'
|
|
8
|
-
import { ColumnConfig, DataGrist, FetchOption
|
|
8
|
+
import { ColumnConfig, DataGrist, FetchOption } from '@operato/data-grist'
|
|
9
9
|
import { client } from '@operato/graphql'
|
|
10
10
|
import { i18next, localize } from '@operato/i18n'
|
|
11
11
|
import { notify, openPopup } from '@operato/layout'
|
|
@@ -22,6 +22,7 @@ export class EventListPage extends connect(store)(localize(i18next)(ScopedElemen
|
|
|
22
22
|
static styles = [
|
|
23
23
|
ScrollbarStyles,
|
|
24
24
|
CommonGristStyles,
|
|
25
|
+
CommonHeaderStyles,
|
|
25
26
|
css`
|
|
26
27
|
:host {
|
|
27
28
|
display: flex;
|
|
@@ -36,6 +37,10 @@ export class EventListPage extends connect(store)(localize(i18next)(ScopedElemen
|
|
|
36
37
|
overflow-y: auto;
|
|
37
38
|
flex: 1;
|
|
38
39
|
}
|
|
40
|
+
|
|
41
|
+
ox-filters-form {
|
|
42
|
+
flex: 1;
|
|
43
|
+
}
|
|
39
44
|
`
|
|
40
45
|
]
|
|
41
46
|
|
|
@@ -49,7 +54,6 @@ export class EventListPage extends connect(store)(localize(i18next)(ScopedElemen
|
|
|
49
54
|
@property({ type: String }) mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'
|
|
50
55
|
|
|
51
56
|
@query('ox-grist') private grist!: DataGrist
|
|
52
|
-
@query('#sorter-control') private sortersControl!: OxPopup
|
|
53
57
|
|
|
54
58
|
get context() {
|
|
55
59
|
return {
|
|
@@ -93,33 +97,15 @@ export class EventListPage extends connect(store)(localize(i18next)(ScopedElemen
|
|
|
93
97
|
|
|
94
98
|
return html`
|
|
95
99
|
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
|
|
96
|
-
<div slot="headroom">
|
|
97
|
-
<div
|
|
100
|
+
<div slot="headroom" class="header">
|
|
101
|
+
<div class="filters">
|
|
98
102
|
<ox-filters-form autofocus></ox-filters-form>
|
|
99
|
-
</div>
|
|
100
103
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
@click=${
|
|
105
|
-
|
|
106
|
-
this.sortersControl.open({
|
|
107
|
-
right: 0,
|
|
108
|
-
top: target.offsetTop + target.offsetHeight
|
|
109
|
-
})
|
|
110
|
-
}}
|
|
111
|
-
>expand_more</md-icon
|
|
112
|
-
>
|
|
113
|
-
<ox-popup id="sorter-control">
|
|
114
|
-
<ox-sorters-control> </ox-sorters-control>
|
|
115
|
-
</ox-popup>
|
|
116
|
-
</div>
|
|
117
|
-
|
|
118
|
-
<div id="modes">
|
|
119
|
-
<md-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</md-icon>
|
|
120
|
-
<md-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</md-icon>
|
|
121
|
-
<md-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</md-icon>
|
|
122
|
-
</div>
|
|
104
|
+
<div id="modes">
|
|
105
|
+
<md-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</md-icon>
|
|
106
|
+
<md-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</md-icon>
|
|
107
|
+
<md-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</md-icon>
|
|
108
|
+
</div>
|
|
123
109
|
</div>
|
|
124
110
|
</div>
|
|
125
111
|
</ox-grist>
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import '@operato/data-grist'
|
|
2
2
|
|
|
3
|
-
import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
|
3
|
+
import { CommonButtonStyles, CommonHeaderStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
|
4
4
|
import { PageView, store } from '@operato/shell'
|
|
5
5
|
import { css, html } from 'lit'
|
|
6
6
|
import { customElement, property, query } from 'lit/decorators.js'
|
|
7
7
|
import { ScopedElementsMixin } from '@open-wc/scoped-elements'
|
|
8
|
-
import { ColumnConfig, DataGrist, FetchOption
|
|
8
|
+
import { ColumnConfig, DataGrist, FetchOption } from '@operato/data-grist'
|
|
9
9
|
import { client } from '@operato/graphql'
|
|
10
10
|
import { i18next, localize } from '@operato/i18n'
|
|
11
11
|
import { notify, openPopup } from '@operato/layout'
|
|
12
|
-
import { OxPopup } from '@operato/popup'
|
|
13
12
|
import { isMobileDevice } from '@operato/utils'
|
|
14
13
|
|
|
15
14
|
import { connect } from 'pwa-helpers/connect-mixin'
|
|
@@ -22,6 +21,7 @@ export class GatewayListPage extends connect(store)(localize(i18next)(ScopedElem
|
|
|
22
21
|
static styles = [
|
|
23
22
|
ScrollbarStyles,
|
|
24
23
|
CommonGristStyles,
|
|
24
|
+
CommonHeaderStyles,
|
|
25
25
|
css`
|
|
26
26
|
:host {
|
|
27
27
|
display: flex;
|
|
@@ -36,6 +36,10 @@ export class GatewayListPage extends connect(store)(localize(i18next)(ScopedElem
|
|
|
36
36
|
overflow-y: auto;
|
|
37
37
|
flex: 1;
|
|
38
38
|
}
|
|
39
|
+
|
|
40
|
+
ox-filters-form {
|
|
41
|
+
flex: 1;
|
|
42
|
+
}
|
|
39
43
|
`
|
|
40
44
|
]
|
|
41
45
|
|
|
@@ -49,7 +53,6 @@ export class GatewayListPage extends connect(store)(localize(i18next)(ScopedElem
|
|
|
49
53
|
@property({ type: String }) mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'
|
|
50
54
|
|
|
51
55
|
@query('ox-grist') private grist!: DataGrist
|
|
52
|
-
@query('#sorter-control') private sortersControl!: OxPopup
|
|
53
56
|
|
|
54
57
|
get context() {
|
|
55
58
|
return {
|
|
@@ -93,33 +96,15 @@ export class GatewayListPage extends connect(store)(localize(i18next)(ScopedElem
|
|
|
93
96
|
|
|
94
97
|
return html`
|
|
95
98
|
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
|
|
96
|
-
<div slot="headroom">
|
|
97
|
-
<div
|
|
99
|
+
<div slot="headroom" class="header">
|
|
100
|
+
<div class="filters">
|
|
98
101
|
<ox-filters-form autofocus></ox-filters-form>
|
|
99
|
-
</div>
|
|
100
102
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
@click=${
|
|
105
|
-
|
|
106
|
-
this.sortersControl.open({
|
|
107
|
-
right: 0,
|
|
108
|
-
top: target.offsetTop + target.offsetHeight
|
|
109
|
-
})
|
|
110
|
-
}}
|
|
111
|
-
>expand_more</md-icon
|
|
112
|
-
>
|
|
113
|
-
<ox-popup id="sorter-control">
|
|
114
|
-
<ox-sorters-control> </ox-sorters-control>
|
|
115
|
-
</ox-popup>
|
|
116
|
-
</div>
|
|
117
|
-
|
|
118
|
-
<div id="modes">
|
|
119
|
-
<md-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</md-icon>
|
|
120
|
-
<md-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</md-icon>
|
|
121
|
-
<md-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</md-icon>
|
|
122
|
-
</div>
|
|
103
|
+
<div id="modes">
|
|
104
|
+
<md-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</md-icon>
|
|
105
|
+
<md-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</md-icon>
|
|
106
|
+
<md-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</md-icon>
|
|
107
|
+
</div>
|
|
123
108
|
</div>
|
|
124
109
|
</div>
|
|
125
110
|
</ox-grist>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import '@operato/data-grist'
|
|
2
2
|
|
|
3
|
-
import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
|
3
|
+
import { CommonButtonStyles, CommonHeaderStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
|
4
4
|
import { PageView, store } from '@operato/shell'
|
|
5
5
|
import { css, html } from 'lit'
|
|
6
6
|
import { customElement, property, query } from 'lit/decorators.js'
|
|
7
7
|
import { ScopedElementsMixin } from '@open-wc/scoped-elements'
|
|
8
|
-
import { ColumnConfig, DataGrist, FetchOption
|
|
8
|
+
import { ColumnConfig, DataGrist, FetchOption } from '@operato/data-grist'
|
|
9
9
|
import { client } from '@operato/graphql'
|
|
10
10
|
import { i18next, localize } from '@operato/i18n'
|
|
11
11
|
import { notify, openPopup } from '@operato/layout'
|
|
@@ -22,6 +22,7 @@ export class ProcessListPage extends connect(store)(localize(i18next)(ScopedElem
|
|
|
22
22
|
static styles = [
|
|
23
23
|
ScrollbarStyles,
|
|
24
24
|
CommonGristStyles,
|
|
25
|
+
CommonHeaderStyles,
|
|
25
26
|
css`
|
|
26
27
|
:host {
|
|
27
28
|
display: flex;
|
|
@@ -36,6 +37,10 @@ export class ProcessListPage extends connect(store)(localize(i18next)(ScopedElem
|
|
|
36
37
|
overflow-y: auto;
|
|
37
38
|
flex: 1;
|
|
38
39
|
}
|
|
40
|
+
|
|
41
|
+
ox-filters-form {
|
|
42
|
+
flex: 1;
|
|
43
|
+
}
|
|
39
44
|
`
|
|
40
45
|
]
|
|
41
46
|
|
|
@@ -49,7 +54,6 @@ export class ProcessListPage extends connect(store)(localize(i18next)(ScopedElem
|
|
|
49
54
|
@property({ type: String }) mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'
|
|
50
55
|
|
|
51
56
|
@query('ox-grist') private grist!: DataGrist
|
|
52
|
-
@query('#sorter-control') private sortersControl!: OxPopup
|
|
53
57
|
|
|
54
58
|
get context() {
|
|
55
59
|
return {
|
|
@@ -93,33 +97,15 @@ export class ProcessListPage extends connect(store)(localize(i18next)(ScopedElem
|
|
|
93
97
|
|
|
94
98
|
return html`
|
|
95
99
|
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
|
|
96
|
-
<div slot="headroom">
|
|
97
|
-
<div
|
|
100
|
+
<div slot="headroom" class="header">
|
|
101
|
+
<div class="filters">
|
|
98
102
|
<ox-filters-form autofocus></ox-filters-form>
|
|
99
|
-
</div>
|
|
100
103
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
@click=${
|
|
105
|
-
|
|
106
|
-
this.sortersControl.open({
|
|
107
|
-
right: 0,
|
|
108
|
-
top: target.offsetTop + target.offsetHeight
|
|
109
|
-
})
|
|
110
|
-
}}
|
|
111
|
-
>expand_more</md-icon
|
|
112
|
-
>
|
|
113
|
-
<ox-popup id="sorter-control">
|
|
114
|
-
<ox-sorters-control> </ox-sorters-control>
|
|
115
|
-
</ox-popup>
|
|
116
|
-
</div>
|
|
117
|
-
|
|
118
|
-
<div id="modes">
|
|
119
|
-
<md-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</md-icon>
|
|
120
|
-
<md-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</md-icon>
|
|
121
|
-
<md-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</md-icon>
|
|
122
|
-
</div>
|
|
104
|
+
<div id="modes">
|
|
105
|
+
<md-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</md-icon>
|
|
106
|
+
<md-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</md-icon>
|
|
107
|
+
<md-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</md-icon>
|
|
108
|
+
</div>
|
|
123
109
|
</div>
|
|
124
110
|
</div>
|
|
125
111
|
</ox-grist>
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import '@operato/data-grist'
|
|
2
2
|
|
|
3
|
-
import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
|
3
|
+
import { CommonButtonStyles, CommonHeaderStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
|
4
4
|
import { PageView, store } from '@operato/shell'
|
|
5
5
|
import { css, html } from 'lit'
|
|
6
6
|
import { customElement, property, query } from 'lit/decorators.js'
|
|
7
7
|
import { ScopedElementsMixin } from '@open-wc/scoped-elements'
|
|
8
|
-
import { ColumnConfig, DataGrist, FetchOption
|
|
8
|
+
import { ColumnConfig, DataGrist, FetchOption } from '@operato/data-grist'
|
|
9
9
|
import { client } from '@operato/graphql'
|
|
10
10
|
import { i18next, localize } from '@operato/i18n'
|
|
11
11
|
import { notify, openPopup } from '@operato/layout'
|
|
12
|
-
import { OxPopup } from '@operato/popup'
|
|
13
12
|
import { isMobileDevice } from '@operato/utils'
|
|
14
13
|
|
|
15
14
|
import { connect } from 'pwa-helpers/connect-mixin'
|
|
@@ -22,6 +21,7 @@ export class ProcessInstanceListPage extends connect(store)(localize(i18next)(Sc
|
|
|
22
21
|
static styles = [
|
|
23
22
|
ScrollbarStyles,
|
|
24
23
|
CommonGristStyles,
|
|
24
|
+
CommonHeaderStyles,
|
|
25
25
|
css`
|
|
26
26
|
:host {
|
|
27
27
|
display: flex;
|
|
@@ -36,6 +36,10 @@ export class ProcessInstanceListPage extends connect(store)(localize(i18next)(Sc
|
|
|
36
36
|
overflow-y: auto;
|
|
37
37
|
flex: 1;
|
|
38
38
|
}
|
|
39
|
+
|
|
40
|
+
ox-filters-form {
|
|
41
|
+
flex: 1;
|
|
42
|
+
}
|
|
39
43
|
`
|
|
40
44
|
]
|
|
41
45
|
|
|
@@ -49,7 +53,6 @@ export class ProcessInstanceListPage extends connect(store)(localize(i18next)(Sc
|
|
|
49
53
|
@property({ type: String }) mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'
|
|
50
54
|
|
|
51
55
|
@query('ox-grist') private grist!: DataGrist
|
|
52
|
-
@query('#sorter-control') private sortersControl!: OxPopup
|
|
53
56
|
|
|
54
57
|
get context() {
|
|
55
58
|
return {
|
|
@@ -93,33 +96,15 @@ export class ProcessInstanceListPage extends connect(store)(localize(i18next)(Sc
|
|
|
93
96
|
|
|
94
97
|
return html`
|
|
95
98
|
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
|
|
96
|
-
<div slot="headroom">
|
|
97
|
-
<div
|
|
99
|
+
<div slot="headroom" class="header">
|
|
100
|
+
<div class="filters">
|
|
98
101
|
<ox-filters-form autofocus></ox-filters-form>
|
|
99
|
-
</div>
|
|
100
102
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
@click=${
|
|
105
|
-
|
|
106
|
-
this.sortersControl.open({
|
|
107
|
-
right: 0,
|
|
108
|
-
top: target.offsetTop + target.offsetHeight
|
|
109
|
-
})
|
|
110
|
-
}}
|
|
111
|
-
>expand_more</md-icon
|
|
112
|
-
>
|
|
113
|
-
<ox-popup id="sorter-control">
|
|
114
|
-
<ox-sorters-control> </ox-sorters-control>
|
|
115
|
-
</ox-popup>
|
|
116
|
-
</div>
|
|
117
|
-
|
|
118
|
-
<div id="modes">
|
|
119
|
-
<md-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</md-icon>
|
|
120
|
-
<md-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</md-icon>
|
|
121
|
-
<md-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</md-icon>
|
|
122
|
-
</div>
|
|
103
|
+
<div id="modes">
|
|
104
|
+
<md-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</md-icon>
|
|
105
|
+
<md-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</md-icon>
|
|
106
|
+
<md-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</md-icon>
|
|
107
|
+
</div>
|
|
123
108
|
</div>
|
|
124
109
|
</div>
|
|
125
110
|
</ox-grist>
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import '@operato/data-grist'
|
|
2
2
|
|
|
3
|
-
import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
|
3
|
+
import { CommonButtonStyles, CommonHeaderStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
|
4
4
|
import { PageView, store } from '@operato/shell'
|
|
5
5
|
import { css, html } from 'lit'
|
|
6
6
|
import { customElement, property, query } from 'lit/decorators.js'
|
|
7
7
|
import { ScopedElementsMixin } from '@open-wc/scoped-elements'
|
|
8
|
-
import { ColumnConfig, DataGrist, FetchOption
|
|
8
|
+
import { ColumnConfig, DataGrist, FetchOption } from '@operato/data-grist'
|
|
9
9
|
import { client } from '@operato/graphql'
|
|
10
10
|
import { i18next, localize } from '@operato/i18n'
|
|
11
11
|
import { notify, openPopup } from '@operato/layout'
|
|
12
|
-
import { OxPopup } from '@operato/popup'
|
|
13
12
|
import { isMobileDevice } from '@operato/utils'
|
|
14
13
|
|
|
15
14
|
import { connect } from 'pwa-helpers/connect-mixin'
|
|
@@ -22,6 +21,7 @@ export class ProcessThreadListPage extends connect(store)(localize(i18next)(Scop
|
|
|
22
21
|
static styles = [
|
|
23
22
|
ScrollbarStyles,
|
|
24
23
|
CommonGristStyles,
|
|
24
|
+
CommonHeaderStyles,
|
|
25
25
|
css`
|
|
26
26
|
:host {
|
|
27
27
|
display: flex;
|
|
@@ -36,6 +36,10 @@ export class ProcessThreadListPage extends connect(store)(localize(i18next)(Scop
|
|
|
36
36
|
overflow-y: auto;
|
|
37
37
|
flex: 1;
|
|
38
38
|
}
|
|
39
|
+
|
|
40
|
+
ox-filters-form {
|
|
41
|
+
flex: 1;
|
|
42
|
+
}
|
|
39
43
|
`
|
|
40
44
|
]
|
|
41
45
|
|
|
@@ -49,7 +53,6 @@ export class ProcessThreadListPage extends connect(store)(localize(i18next)(Scop
|
|
|
49
53
|
@property({ type: String }) mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'
|
|
50
54
|
|
|
51
55
|
@query('ox-grist') private grist!: DataGrist
|
|
52
|
-
@query('#sorter-control') private sortersControl!: OxPopup
|
|
53
56
|
|
|
54
57
|
get context() {
|
|
55
58
|
return {
|
|
@@ -93,33 +96,15 @@ export class ProcessThreadListPage extends connect(store)(localize(i18next)(Scop
|
|
|
93
96
|
|
|
94
97
|
return html`
|
|
95
98
|
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
|
|
96
|
-
<div slot="headroom">
|
|
97
|
-
<div
|
|
99
|
+
<div slot="headroom" class="header">
|
|
100
|
+
<div class="filters">
|
|
98
101
|
<ox-filters-form autofocus></ox-filters-form>
|
|
99
|
-
</div>
|
|
100
102
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
@click=${
|
|
105
|
-
|
|
106
|
-
this.sortersControl.open({
|
|
107
|
-
right: 0,
|
|
108
|
-
top: target.offsetTop + target.offsetHeight
|
|
109
|
-
})
|
|
110
|
-
}}
|
|
111
|
-
>expand_more</md-icon
|
|
112
|
-
>
|
|
113
|
-
<ox-popup id="sorter-control">
|
|
114
|
-
<ox-sorters-control> </ox-sorters-control>
|
|
115
|
-
</ox-popup>
|
|
116
|
-
</div>
|
|
117
|
-
|
|
118
|
-
<div id="modes">
|
|
119
|
-
<md-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</md-icon>
|
|
120
|
-
<md-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</md-icon>
|
|
121
|
-
<md-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</md-icon>
|
|
122
|
-
</div>
|
|
103
|
+
<div id="modes">
|
|
104
|
+
<md-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</md-icon>
|
|
105
|
+
<md-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</md-icon>
|
|
106
|
+
<md-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</md-icon>
|
|
107
|
+
</div>
|
|
123
108
|
</div>
|
|
124
109
|
</div>
|
|
125
110
|
</ox-grist>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
2
|
import '@operato/data-grist';
|
|
3
|
-
import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles';
|
|
3
|
+
import { CommonButtonStyles, CommonHeaderStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles';
|
|
4
4
|
import { PageView, store } from '@operato/shell';
|
|
5
5
|
import { css, html } from 'lit';
|
|
6
6
|
import { customElement, property, query } from 'lit/decorators.js';
|
|
@@ -9,7 +9,6 @@ import { DataGrist } from '@operato/data-grist';
|
|
|
9
9
|
import { client } from '@operato/graphql';
|
|
10
10
|
import { i18next, localize } from '@operato/i18n';
|
|
11
11
|
import { notify, openPopup } from '@operato/layout';
|
|
12
|
-
import { OxPopup } from '@operato/popup';
|
|
13
12
|
import { isMobileDevice } from '@operato/utils';
|
|
14
13
|
import { connect } from 'pwa-helpers/connect-mixin';
|
|
15
14
|
import gql from 'graphql-tag';
|
|
@@ -57,33 +56,15 @@ let EventListPage = class EventListPage extends connect(store)(localize(i18next)
|
|
|
57
56
|
const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID');
|
|
58
57
|
return html `
|
|
59
58
|
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
|
|
60
|
-
<div slot="headroom">
|
|
61
|
-
<div
|
|
59
|
+
<div slot="headroom" class="header">
|
|
60
|
+
<div class="filters">
|
|
62
61
|
<ox-filters-form autofocus></ox-filters-form>
|
|
63
|
-
</div>
|
|
64
|
-
|
|
65
|
-
<div id="sorters">
|
|
66
|
-
Sort
|
|
67
|
-
<md-icon
|
|
68
|
-
@click=${e => {
|
|
69
|
-
const target = e.currentTarget;
|
|
70
|
-
this.sortersControl.open({
|
|
71
|
-
right: 0,
|
|
72
|
-
top: target.offsetTop + target.offsetHeight
|
|
73
|
-
});
|
|
74
|
-
}}
|
|
75
|
-
>expand_more</md-icon
|
|
76
|
-
>
|
|
77
|
-
<ox-popup id="sorter-control">
|
|
78
|
-
<ox-sorters-control> </ox-sorters-control>
|
|
79
|
-
</ox-popup>
|
|
80
|
-
</div>
|
|
81
62
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
63
|
+
<div id="modes">
|
|
64
|
+
<md-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</md-icon>
|
|
65
|
+
<md-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</md-icon>
|
|
66
|
+
<md-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</md-icon>
|
|
67
|
+
</div>
|
|
87
68
|
</div>
|
|
88
69
|
</div>
|
|
89
70
|
</ox-grist>
|
|
@@ -285,6 +266,7 @@ let EventListPage = class EventListPage extends connect(store)(localize(i18next)
|
|
|
285
266
|
EventListPage.styles = [
|
|
286
267
|
ScrollbarStyles,
|
|
287
268
|
CommonGristStyles,
|
|
269
|
+
CommonHeaderStyles,
|
|
288
270
|
css `
|
|
289
271
|
:host {
|
|
290
272
|
display: flex;
|
|
@@ -299,6 +281,10 @@ EventListPage.styles = [
|
|
|
299
281
|
overflow-y: auto;
|
|
300
282
|
flex: 1;
|
|
301
283
|
}
|
|
284
|
+
|
|
285
|
+
ox-filters-form {
|
|
286
|
+
flex: 1;
|
|
287
|
+
}
|
|
302
288
|
`
|
|
303
289
|
];
|
|
304
290
|
__decorate([
|
|
@@ -313,10 +299,6 @@ __decorate([
|
|
|
313
299
|
query('ox-grist'),
|
|
314
300
|
__metadata("design:type", DataGrist)
|
|
315
301
|
], EventListPage.prototype, "grist", void 0);
|
|
316
|
-
__decorate([
|
|
317
|
-
query('#sorter-control'),
|
|
318
|
-
__metadata("design:type", OxPopup)
|
|
319
|
-
], EventListPage.prototype, "sortersControl", void 0);
|
|
320
302
|
EventListPage = __decorate([
|
|
321
303
|
customElement('event-list-page')
|
|
322
304
|
], EventListPage);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-list-page.js","sourceRoot":"","sources":["../../../client/pages/event/event-list-page.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACxF,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAgB,SAAS,EAA+B,MAAM,qBAAqB,CAAA;AAC1F,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAE/C,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACnD,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAGzC,IAAM,aAAa,GAAn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AlBY,CAkBZ;AAQ2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;kDAAiB;AAChB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;2CAAoE;AAEpE;IAA1B,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;4CAAA;AACV;IAAjC,KAAK,CAAC,iBAAiB,CAAC;8BAA0B,OAAO;qDAAA;AA/B/C,aAAa;IADzB,aAAa,CAAC,iBAAiB,CAAC;GACpB,aAAa,CA6TzB","sourcesContent":["import '@operato/data-grist'\n\nimport { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageView, store } from '@operato/shell'\nimport { css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\nimport { ColumnConfig, DataGrist, FetchOption, SortersControl } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { notify, openPopup } from '@operato/layout'\nimport { OxPopup } from '@operato/popup'\nimport { isMobileDevice } from '@operato/utils'\n\nimport { connect } from 'pwa-helpers/connect-mixin'\nimport gql from 'graphql-tag'\n\nimport { EventImporter } from './event-importer'\n\n@customElement('event-list-page')\nexport class EventListPage extends connect(store)(localize(i18next)(ScopedElementsMixin(PageView))) {\n static styles = [\n ScrollbarStyles,\n CommonGristStyles,\n css`\n :host {\n display: flex;\n\n width: 100%;\n\n --grid-record-emphasized-background-color: #8b0000;\n --grid-record-emphasized-color: #ff6b6b;\n }\n\n ox-grist {\n overflow-y: auto;\n flex: 1;\n }\n `\n ]\n\n static get scopedElements() {\n return {\n 'event-importer': EventImporter\n }\n }\n\n @property({ type: Object }) gristConfig: any\n @property({ type: String }) mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'\n\n @query('ox-grist') private grist!: DataGrist\n @query('#sorter-control') private sortersControl!: OxPopup\n\n get context() {\n return {\n title: i18next.t('title.event list'),\n search: {\n handler: (search: string) => {\n this.grist.searchText = search\n },\n value: this.grist?.searchText || ''\n },\n filter: {\n handler: () => {\n this.grist.toggleHeadroom()\n }\n },\n help: 'process/event',\n actions: [\n {\n title: i18next.t('button.save'),\n action: this._updateEvent.bind(this),\n ...CommonButtonStyles.save\n },\n {\n title: i18next.t('button.delete'),\n action: this._deleteEvent.bind(this),\n ...CommonButtonStyles.delete\n }\n ],\n exportable: {\n name: i18next.t('title.event list'),\n data: this.exportHandler.bind(this)\n },\n importable: {\n handler: this.importHandler.bind(this)\n }\n }\n }\n\n render() {\n const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID')\n\n return html`\n <ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>\n <div slot=\"headroom\">\n <div id=\"filters\">\n <ox-filters-form autofocus></ox-filters-form>\n </div>\n\n <div id=\"sorters\">\n Sort\n <md-icon\n @click=${e => {\n const target = e.currentTarget\n this.sortersControl.open({\n right: 0,\n top: target.offsetTop + target.offsetHeight\n })\n }}\n >expand_more</md-icon\n >\n <ox-popup id=\"sorter-control\">\n <ox-sorters-control> </ox-sorters-control>\n </ox-popup>\n </div>\n\n <div id=\"modes\">\n <md-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</md-icon>\n <md-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</md-icon>\n <md-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</md-icon>\n </div>\n </div>\n </div>\n </ox-grist>\n `\n }\n\n async pageInitialized(lifecycle: any) {\n this.gristConfig = {\n list: {\n fields: ['name', 'description'],\n details: ['active', 'updatedAt']\n },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n {\n type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n record: {\n editable: true\n },\n filter: 'search',\n sortable: true,\n width: 150\n },\n {\n type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n record: {\n editable: true\n },\n filter: 'search',\n width: 200\n },\n {\n type: 'checkbox',\n name: 'active',\n label: true,\n header: i18next.t('field.active'),\n record: {\n editable: true\n },\n filter: true,\n sortable: true,\n width: 60\n },\n {\n type: 'resource-object',\n name: 'updater',\n header: i18next.t('field.updater'),\n record: {\n editable: false\n },\n sortable: true,\n width: 120\n },\n {\n type: 'datetime',\n name: 'updatedAt',\n header: i18next.t('field.updated_at'),\n record: {\n editable: false\n },\n sortable: true,\n width: 180\n }\n ],\n rows: {\n selectable: {\n multiple: true\n }\n },\n sorters: [\n {\n name: 'name'\n }\n ]\n }\n }\n\n async pageUpdated(changes: any, lifecycle: any) {\n if (this.active) {\n // do something here when this page just became as active\n }\n }\n\n async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) {\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n responses: events(filters: $filters, pagination: $pagination, sortings: $sortings) {\n items {\n id\n name\n description\n active\n updater {\n id\n name\n }\n updatedAt\n }\n total\n }\n }\n `,\n variables: {\n filters,\n pagination: { page, limit },\n sortings\n }\n })\n\n return {\n total: response.data.responses.total || 0,\n records: response.data.responses.items || []\n }\n }\n\n async _deleteEvent() {\n if (confirm(i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }))) {\n const ids = this.grist.selected.map(record => record.id)\n if (ids && ids.length > 0) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($ids: [String!]!) {\n deleteEvents(ids: $ids)\n }\n `,\n variables: {\n ids\n }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n notify({\n message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })\n })\n }\n }\n }\n }\n\n async _updateEvent() {\n let patches = this.grist.dirtyRecords\n if (patches && patches.length) {\n patches = patches.map(patch => {\n let patchField: any = patch.id ? { id: patch.id } : {}\n const dirtyFields = patch.__dirtyfields__\n for (let key in dirtyFields) {\n patchField[key] = dirtyFields[key].after\n }\n patchField.cuFlag = patch.__dirty__\n\n return patchField\n })\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($patches: [EventPatch!]!) {\n updateMultipleEvent(patches: $patches) {\n name\n }\n }\n `,\n variables: {\n patches\n }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n }\n }\n }\n\n async exportHandler() {\n const exportTargets = this.grist.selected.length ? this.grist.selected : this.grist.dirtyData.records\n const targetFieldSet = new Set(['id', 'name', 'description', 'active'])\n\n return exportTargets.map(event => {\n let tempObj = {}\n for (const field of targetFieldSet) {\n tempObj[field] = event[field]\n }\n\n return tempObj\n })\n }\n\n async importHandler(records) {\n const popup = openPopup(\n html`\n <event-importer\n .events=${records}\n @imported=${() => {\n history.back()\n this.grist.fetch()\n }}\n ></event-importer>\n `,\n {\n backdrop: true,\n size: 'large',\n title: i18next.t('title.import event')\n }\n )\n\n popup.onclosed = () => {\n this.grist.fetch()\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"event-list-page.js","sourceRoot":"","sources":["../../../client/pages/event/event-list-page.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAC5G,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAgB,SAAS,EAAe,MAAM,qBAAqB,CAAA;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAA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G;IACd,eAAe;IACf,iBAAiB;IACjB,kBAAkB;IAClB,GAAG,CAAA;;;;;;;;;;;;;;;;;;KAkBF;CACF,AAvBY,CAuBZ;AAQ2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;kDAAiB;AAChB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;2CAAoE;AAEpE;IAA1B,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;4CAAA;AAnCjC,aAAa;IADzB,aAAa,CAAC,iBAAiB,CAAC;GACpB,aAAa,CA+SzB","sourcesContent":["import '@operato/data-grist'\n\nimport { CommonButtonStyles, CommonHeaderStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageView, store } from '@operato/shell'\nimport { css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\nimport { ColumnConfig, DataGrist, FetchOption } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { notify, openPopup } from '@operato/layout'\nimport { OxPopup } from '@operato/popup'\nimport { isMobileDevice } from '@operato/utils'\n\nimport { connect } from 'pwa-helpers/connect-mixin'\nimport gql from 'graphql-tag'\n\nimport { EventImporter } from './event-importer'\n\n@customElement('event-list-page')\nexport class EventListPage extends connect(store)(localize(i18next)(ScopedElementsMixin(PageView))) {\n static styles = [\n ScrollbarStyles,\n CommonGristStyles,\n CommonHeaderStyles,\n css`\n :host {\n display: flex;\n\n width: 100%;\n\n --grid-record-emphasized-background-color: #8b0000;\n --grid-record-emphasized-color: #ff6b6b;\n }\n\n ox-grist {\n overflow-y: auto;\n flex: 1;\n }\n\n ox-filters-form {\n flex: 1;\n }\n `\n ]\n\n static get scopedElements() {\n return {\n 'event-importer': EventImporter\n }\n }\n\n @property({ type: Object }) gristConfig: any\n @property({ type: String }) mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'\n\n @query('ox-grist') private grist!: DataGrist\n\n get context() {\n return {\n title: i18next.t('title.event list'),\n search: {\n handler: (search: string) => {\n this.grist.searchText = search\n },\n value: this.grist?.searchText || ''\n },\n filter: {\n handler: () => {\n this.grist.toggleHeadroom()\n }\n },\n help: 'process/event',\n actions: [\n {\n title: i18next.t('button.save'),\n action: this._updateEvent.bind(this),\n ...CommonButtonStyles.save\n },\n {\n title: i18next.t('button.delete'),\n action: this._deleteEvent.bind(this),\n ...CommonButtonStyles.delete\n }\n ],\n exportable: {\n name: i18next.t('title.event list'),\n data: this.exportHandler.bind(this)\n },\n importable: {\n handler: this.importHandler.bind(this)\n }\n }\n }\n\n render() {\n const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID')\n\n return html`\n <ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>\n <div slot=\"headroom\" class=\"header\">\n <div class=\"filters\">\n <ox-filters-form autofocus></ox-filters-form>\n\n <div id=\"modes\">\n <md-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</md-icon>\n <md-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</md-icon>\n <md-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</md-icon>\n </div>\n </div>\n </div>\n </ox-grist>\n `\n }\n\n async pageInitialized(lifecycle: any) {\n this.gristConfig = {\n list: {\n fields: ['name', 'description'],\n details: ['active', 'updatedAt']\n },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n {\n type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n record: {\n editable: true\n },\n filter: 'search',\n sortable: true,\n width: 150\n },\n {\n type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n record: {\n editable: true\n },\n filter: 'search',\n width: 200\n },\n {\n type: 'checkbox',\n name: 'active',\n label: true,\n header: i18next.t('field.active'),\n record: {\n editable: true\n },\n filter: true,\n sortable: true,\n width: 60\n },\n {\n type: 'resource-object',\n name: 'updater',\n header: i18next.t('field.updater'),\n record: {\n editable: false\n },\n sortable: true,\n width: 120\n },\n {\n type: 'datetime',\n name: 'updatedAt',\n header: i18next.t('field.updated_at'),\n record: {\n editable: false\n },\n sortable: true,\n width: 180\n }\n ],\n rows: {\n selectable: {\n multiple: true\n }\n },\n sorters: [\n {\n name: 'name'\n }\n ]\n }\n }\n\n async pageUpdated(changes: any, lifecycle: any) {\n if (this.active) {\n // do something here when this page just became as active\n }\n }\n\n async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) {\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n responses: events(filters: $filters, pagination: $pagination, sortings: $sortings) {\n items {\n id\n name\n description\n active\n updater {\n id\n name\n }\n updatedAt\n }\n total\n }\n }\n `,\n variables: {\n filters,\n pagination: { page, limit },\n sortings\n }\n })\n\n return {\n total: response.data.responses.total || 0,\n records: response.data.responses.items || []\n }\n }\n\n async _deleteEvent() {\n if (confirm(i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }))) {\n const ids = this.grist.selected.map(record => record.id)\n if (ids && ids.length > 0) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($ids: [String!]!) {\n deleteEvents(ids: $ids)\n }\n `,\n variables: {\n ids\n }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n notify({\n message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })\n })\n }\n }\n }\n }\n\n async _updateEvent() {\n let patches = this.grist.dirtyRecords\n if (patches && patches.length) {\n patches = patches.map(patch => {\n let patchField: any = patch.id ? { id: patch.id } : {}\n const dirtyFields = patch.__dirtyfields__\n for (let key in dirtyFields) {\n patchField[key] = dirtyFields[key].after\n }\n patchField.cuFlag = patch.__dirty__\n\n return patchField\n })\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($patches: [EventPatch!]!) {\n updateMultipleEvent(patches: $patches) {\n name\n }\n }\n `,\n variables: {\n patches\n }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n }\n }\n }\n\n async exportHandler() {\n const exportTargets = this.grist.selected.length ? this.grist.selected : this.grist.dirtyData.records\n const targetFieldSet = new Set(['id', 'name', 'description', 'active'])\n\n return exportTargets.map(event => {\n let tempObj = {}\n for (const field of targetFieldSet) {\n tempObj[field] = event[field]\n }\n\n return tempObj\n })\n }\n\n async importHandler(records) {\n const popup = openPopup(\n html`\n <event-importer\n .events=${records}\n @imported=${() => {\n history.back()\n this.grist.fetch()\n }}\n ></event-importer>\n `,\n {\n backdrop: true,\n size: 'large',\n title: i18next.t('title.import event')\n }\n )\n\n popup.onclosed = () => {\n this.grist.fetch()\n }\n }\n}\n"]}
|