@things-factory/dataset 6.2.29 → 6.2.30
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/activities/activity-data-collect-assign-edit.ts +99 -0
- package/client/activities/activity-data-collect-assign-view.ts +99 -0
- package/client/bootstrap.ts +2 -1
- package/client/pages/data-entry/data-entry-list-page.ts +17 -23
- package/client/pages/data-ooc/data-ooc-list-page.ts +16 -31
- package/client/pages/data-sensor/data-sensor-list-page.ts +40 -32
- package/client/pages/data-set/data-set-list-page.ts +23 -12
- package/client/pages/data-summary/data-summary-list-page.ts +15 -30
- package/client/pages/data-summary/data-summary-period-page.ts +0 -11
- package/client/pages/data-summary/data-summary-search-page.ts +12 -27
- package/dist-client/activities/activity-data-collect-assign-edit.d.ts +14 -0
- package/dist-client/activities/activity-data-collect-assign-edit.js +102 -0
- package/dist-client/activities/activity-data-collect-assign-edit.js.map +1 -0
- package/dist-client/activities/activity-data-collect-assign-view.d.ts +14 -0
- package/dist-client/activities/activity-data-collect-assign-view.js +102 -0
- package/dist-client/activities/activity-data-collect-assign-view.js.map +1 -0
- package/dist-client/bootstrap.d.ts +2 -0
- package/dist-client/bootstrap.js +2 -0
- package/dist-client/bootstrap.js.map +1 -1
- package/dist-client/pages/data-entry/data-entry-list-page.d.ts +3 -2
- package/dist-client/pages/data-entry/data-entry-list-page.js +16 -26
- package/dist-client/pages/data-entry/data-entry-list-page.js.map +1 -1
- package/dist-client/pages/data-ooc/data-ooc-list-page.d.ts +5 -4
- package/dist-client/pages/data-ooc/data-ooc-list-page.js +13 -32
- package/dist-client/pages/data-ooc/data-ooc-list-page.js.map +1 -1
- package/dist-client/pages/data-sensor/data-sensor-list-page.d.ts +12 -5
- package/dist-client/pages/data-sensor/data-sensor-list-page.js +41 -35
- package/dist-client/pages/data-sensor/data-sensor-list-page.js.map +1 -1
- package/dist-client/pages/data-set/data-set-list-page.js +22 -3
- package/dist-client/pages/data-set/data-set-list-page.js.map +1 -1
- package/dist-client/pages/data-summary/data-summary-list-page.d.ts +4 -3
- package/dist-client/pages/data-summary/data-summary-list-page.js +18 -37
- package/dist-client/pages/data-summary/data-summary-list-page.js.map +1 -1
- package/dist-client/pages/data-summary/data-summary-period-page.js +0 -11
- package/dist-client/pages/data-summary/data-summary-period-page.js.map +1 -1
- package/dist-client/pages/data-summary/data-summary-search-page.d.ts +2 -1
- package/dist-client/pages/data-summary/data-summary-search-page.js +12 -31
- package/dist-client/pages/data-summary/data-summary-search-page.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/activities/activity-data-collect-assign.js +85 -0
- package/dist-server/activities/activity-data-collect-assign.js.map +1 -0
- package/dist-server/activities/activity-ooc-review.js +3 -2
- package/dist-server/activities/activity-ooc-review.js.map +1 -1
- package/dist-server/controllers/create-data-sample.js +59 -5
- package/dist-server/controllers/create-data-sample.js.map +1 -1
- package/dist-server/service/data-set/data-set-mutation.js +36 -6
- package/dist-server/service/data-set/data-set-mutation.js.map +1 -1
- package/dist-server/service/data-set/data-set-type.js +8 -0
- package/dist-server/service/data-set/data-set-type.js.map +1 -1
- package/dist-server/service/data-set/data-set.js +10 -2
- package/dist-server/service/data-set/data-set.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/server/activities/activity-data-collect-assign.ts +98 -0
- package/server/activities/activity-ooc-review.ts +4 -3
- package/server/controllers/create-data-sample.ts +64 -6
- package/server/service/data-set/data-set-mutation.ts +41 -3
- package/server/service/data-set/data-set-type.ts +7 -1
- package/server/service/data-set/data-set.ts +9 -2
- package/translations/en.json +1 -0
- package/translations/ja.json +1 -0
- package/translations/ko.json +1 -0
- package/translations/ms.json +1 -0
- package/translations/zh.json +1 -0
@@ -0,0 +1,99 @@
|
|
1
|
+
import '@operato/dataset/ox-data-entry-form.js'
|
2
|
+
|
3
|
+
import { css, html, LitElement } from 'lit'
|
4
|
+
import { customElement, property, state } from 'lit/decorators.js'
|
5
|
+
|
6
|
+
import { i18next, localize } from '@operato/i18n'
|
7
|
+
import { ScrollbarStyles } from '@operato/styles'
|
8
|
+
|
9
|
+
@customElement('activity-data-collect-assign-edit')
|
10
|
+
export class DataCollectAssignActivityEdit extends localize(i18next)(LitElement) {
|
11
|
+
static styles = [
|
12
|
+
ScrollbarStyles,
|
13
|
+
css`
|
14
|
+
:host {
|
15
|
+
display: flex;
|
16
|
+
flex-direction: column;
|
17
|
+
|
18
|
+
background-color: #fff;
|
19
|
+
}
|
20
|
+
|
21
|
+
div[content] {
|
22
|
+
flex: 1;
|
23
|
+
flex-direction: column;
|
24
|
+
|
25
|
+
display: flex;
|
26
|
+
overflow: auto;
|
27
|
+
}
|
28
|
+
|
29
|
+
ox-data-sample-view {
|
30
|
+
flex: 1;
|
31
|
+
padding: var(--padding-wide);
|
32
|
+
overflow: auto;
|
33
|
+
}
|
34
|
+
|
35
|
+
label[instruction] {
|
36
|
+
display: flex;
|
37
|
+
flex-direction: column;
|
38
|
+
|
39
|
+
padding: var(--padding-wide);
|
40
|
+
}
|
41
|
+
|
42
|
+
label[instruction] div {
|
43
|
+
display: flex;
|
44
|
+
}
|
45
|
+
|
46
|
+
mwc-icon {
|
47
|
+
color: var(--status-danger-color);
|
48
|
+
}
|
49
|
+
|
50
|
+
textarea {
|
51
|
+
border: var(--input-field-border);
|
52
|
+
border-radius: var(--input-border-radius);
|
53
|
+
padding: var(--input-field-padding);
|
54
|
+
font: var(--input-field-font);
|
55
|
+
}
|
56
|
+
|
57
|
+
.button-container {
|
58
|
+
display: flex;
|
59
|
+
margin-left: auto;
|
60
|
+
padding: var(--padding-default);
|
61
|
+
}
|
62
|
+
`
|
63
|
+
]
|
64
|
+
|
65
|
+
@property({ type: Object }) input?: any
|
66
|
+
@property({ type: Object }) output?: any
|
67
|
+
|
68
|
+
@state() dataReview?: any
|
69
|
+
|
70
|
+
render() {
|
71
|
+
return html`
|
72
|
+
<div content>
|
73
|
+
<ox-data-sample-view .dataSample=${this.dataReview}></ox-data-sample-view>
|
74
|
+
</div>
|
75
|
+
`
|
76
|
+
}
|
77
|
+
|
78
|
+
onChangeInstruction(e: Event) {
|
79
|
+
this.output ||= {}
|
80
|
+
this.output.instruction = (e.target as HTMLTextAreaElement).value
|
81
|
+
|
82
|
+
this.dispatchEvent(
|
83
|
+
new CustomEvent('change', {
|
84
|
+
detail: this.output
|
85
|
+
})
|
86
|
+
)
|
87
|
+
}
|
88
|
+
|
89
|
+
updated(changes) {
|
90
|
+
if (changes.has('input')) {
|
91
|
+
this.fetchDataAssign()
|
92
|
+
}
|
93
|
+
}
|
94
|
+
|
95
|
+
async fetchDataAssign() {
|
96
|
+
const dataSample = this.input?.dataSample
|
97
|
+
this.dataReview = dataSample
|
98
|
+
}
|
99
|
+
}
|
@@ -0,0 +1,99 @@
|
|
1
|
+
import '@operato/dataset/ox-data-entry-form.js'
|
2
|
+
|
3
|
+
import { css, html, LitElement } from 'lit'
|
4
|
+
import { customElement, property, state } from 'lit/decorators.js'
|
5
|
+
|
6
|
+
import { i18next, localize } from '@operato/i18n'
|
7
|
+
import { ScrollbarStyles } from '@operato/styles'
|
8
|
+
|
9
|
+
@customElement('activity-data-collect-assign-view')
|
10
|
+
export class DataCollectAssignActivityView extends localize(i18next)(LitElement) {
|
11
|
+
static styles = [
|
12
|
+
ScrollbarStyles,
|
13
|
+
css`
|
14
|
+
:host {
|
15
|
+
display: flex;
|
16
|
+
flex-direction: column;
|
17
|
+
|
18
|
+
background-color: #fff;
|
19
|
+
}
|
20
|
+
|
21
|
+
div[content] {
|
22
|
+
flex: 1;
|
23
|
+
flex-direction: column;
|
24
|
+
|
25
|
+
display: flex;
|
26
|
+
overflow: auto;
|
27
|
+
}
|
28
|
+
|
29
|
+
ox-data-sample-view {
|
30
|
+
flex: 1;
|
31
|
+
padding: var(--padding-wide);
|
32
|
+
overflow: auto;
|
33
|
+
}
|
34
|
+
|
35
|
+
label[instruction] {
|
36
|
+
display: flex;
|
37
|
+
flex-direction: column;
|
38
|
+
|
39
|
+
padding: var(--padding-wide);
|
40
|
+
}
|
41
|
+
|
42
|
+
label[instruction] div {
|
43
|
+
display: flex;
|
44
|
+
}
|
45
|
+
|
46
|
+
mwc-icon {
|
47
|
+
color: var(--status-danger-color);
|
48
|
+
}
|
49
|
+
|
50
|
+
textarea {
|
51
|
+
border: var(--input-field-border);
|
52
|
+
border-radius: var(--input-border-radius);
|
53
|
+
padding: var(--input-field-padding);
|
54
|
+
font: var(--input-field-font);
|
55
|
+
}
|
56
|
+
|
57
|
+
.button-container {
|
58
|
+
display: flex;
|
59
|
+
margin-left: auto;
|
60
|
+
padding: var(--padding-default);
|
61
|
+
}
|
62
|
+
`
|
63
|
+
]
|
64
|
+
|
65
|
+
@property({ type: Object }) input?: any
|
66
|
+
@property({ type: Object }) output?: any
|
67
|
+
|
68
|
+
@state() dataReview?: any
|
69
|
+
|
70
|
+
render() {
|
71
|
+
return html`
|
72
|
+
<div content>
|
73
|
+
<ox-data-sample-view .dataSample=${this.dataReview}></ox-data-sample-view>
|
74
|
+
</div>
|
75
|
+
`
|
76
|
+
}
|
77
|
+
|
78
|
+
onChangeInstruction(e: Event) {
|
79
|
+
this.output ||= {}
|
80
|
+
this.output.instruction = (e.target as HTMLTextAreaElement).value
|
81
|
+
|
82
|
+
this.dispatchEvent(
|
83
|
+
new CustomEvent('change', {
|
84
|
+
detail: this.output
|
85
|
+
})
|
86
|
+
)
|
87
|
+
}
|
88
|
+
|
89
|
+
updated(changes) {
|
90
|
+
if (changes.has('input')) {
|
91
|
+
this.fetchDataAssign()
|
92
|
+
}
|
93
|
+
}
|
94
|
+
|
95
|
+
async fetchDataAssign() {
|
96
|
+
const dataSample = this.input?.dataSample
|
97
|
+
this.dataReview = dataSample
|
98
|
+
}
|
99
|
+
}
|
package/client/bootstrap.ts
CHANGED
@@ -4,7 +4,8 @@ import './activities/activity-ooc-resolve-edit' /* refered by the activity templ
|
|
4
4
|
import './activities/activity-data-collect-view' /* refered by the activity template (activity-data-collect) on server */
|
5
5
|
import './activities/activity-ooc-review-view' /* refered by the activity template (activity-ooc-review) on server */
|
6
6
|
import './activities/activity-ooc-resolve-view' /* refered by the activity template (activity-ooc-resolve) on server */
|
7
|
-
|
7
|
+
import './activities/activity-data-collect-assign-edit'
|
8
|
+
import './activities/activity-data-collect-assign-view'
|
8
9
|
import '@operato/app/filter-renderer.js' /* register resource-object filter renderer */
|
9
10
|
|
10
11
|
import { OxGristEditorCode } from '@operato/app/grist-editor/ox-grist-editor-code.js'
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import '@operato/data-grist'
|
2
|
+
import '@operato/context/ox-context-page-toolbar.js'
|
2
3
|
import '@operato/board/ox-board-viewer.js'
|
3
4
|
import '../../components/data-entry-form.js'
|
4
5
|
|
@@ -14,7 +15,7 @@ import { client } from '@operato/graphql'
|
|
14
15
|
import { i18next, localize } from '@operato/i18n'
|
15
16
|
import { openPopup } from '@operato/layout'
|
16
17
|
import { navigate, PageView, store } from '@operato/shell'
|
17
|
-
import {
|
18
|
+
import { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'
|
18
19
|
import { provider } from '@things-factory/board-ui'
|
19
20
|
import { OxPopup } from '@operato/popup'
|
20
21
|
|
@@ -83,7 +84,7 @@ const showEntryView = async (columns, data, column, record, rowIndex) => {
|
|
83
84
|
export class DataEntryListPage extends connect(store)(localize(i18next)(PageView)) {
|
84
85
|
static styles = [
|
85
86
|
ScrollbarStyles,
|
86
|
-
|
87
|
+
CommonHeaderStyles,
|
87
88
|
css`
|
88
89
|
:host {
|
89
90
|
display: flex;
|
@@ -93,13 +94,17 @@ export class DataEntryListPage extends connect(store)(localize(i18next)(PageView
|
|
93
94
|
--grid-record-emphasized-background-color: red;
|
94
95
|
--grid-record-emphasized-color: yellow;
|
95
96
|
}
|
97
|
+
|
98
|
+
ox-grist {
|
99
|
+
overflow-y: auto;
|
100
|
+
flex: 1;
|
101
|
+
}
|
96
102
|
`
|
97
103
|
]
|
98
104
|
|
99
|
-
@state() gristConfig: any
|
105
|
+
@state() private gristConfig: any
|
100
106
|
|
101
107
|
@query('ox-grist') private grist!: DataGrist
|
102
|
-
@query('#sorter-control') private sortersControl!: OxPopup
|
103
108
|
|
104
109
|
get context() {
|
105
110
|
return {
|
@@ -115,7 +120,8 @@ export class DataEntryListPage extends connect(store)(localize(i18next)(PageView
|
|
115
120
|
this.grist.toggleHeadroom()
|
116
121
|
}
|
117
122
|
},
|
118
|
-
help: 'dataset/data-entry-list'
|
123
|
+
help: 'dataset/data-entry-list',
|
124
|
+
toolbar: false
|
119
125
|
}
|
120
126
|
}
|
121
127
|
|
@@ -129,26 +135,14 @@ export class DataEntryListPage extends connect(store)(localize(i18next)(PageView
|
|
129
135
|
.fetchHandler=${this.fetchHandler.bind(this)}
|
130
136
|
?url-params-sensitive=${this.active}
|
131
137
|
>
|
132
|
-
<div slot="headroom">
|
133
|
-
<div
|
134
|
-
<
|
138
|
+
<div slot="headroom" class="header">
|
139
|
+
<div class="title">
|
140
|
+
<mwc-icon>summarize</mwc-icon>
|
141
|
+
${i18next.t('title.data-entry list')}
|
135
142
|
</div>
|
136
143
|
|
137
|
-
<div
|
138
|
-
|
139
|
-
<mwc-icon
|
140
|
-
@click=${e => {
|
141
|
-
const target = e.currentTarget
|
142
|
-
this.sortersControl.open({
|
143
|
-
right: 0,
|
144
|
-
top: target.offsetTop + target.offsetHeight
|
145
|
-
})
|
146
|
-
}}
|
147
|
-
>expand_more</mwc-icon
|
148
|
-
>
|
149
|
-
<ox-popup id="sorter-control">
|
150
|
-
<ox-sorters-control> </ox-sorters-control>
|
151
|
-
</ox-popup>
|
144
|
+
<div class="filters">
|
145
|
+
<ox-filters-form autofocus without-search></ox-filters-form>
|
152
146
|
</div>
|
153
147
|
</div>
|
154
148
|
</ox-grist>
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import '@operato/data-grist'
|
2
|
+
import '@operato/context/ox-context-page-toolbar.js'
|
2
3
|
import '@operato/input/ox-input-select-buttons.js'
|
3
4
|
import './data-ooc-view.js'
|
4
5
|
|
@@ -38,7 +39,7 @@ import { client } from '@operato/graphql'
|
|
38
39
|
import { i18next, localize } from '@operato/i18n'
|
39
40
|
import { openPopup } from '@operato/layout'
|
40
41
|
import { PageView, store } from '@operato/shell'
|
41
|
-
import {
|
42
|
+
import { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'
|
42
43
|
import { isMobileDevice, adjustFilters } from '@operato/utils'
|
43
44
|
import { OxPopup } from '@operato/popup'
|
44
45
|
|
@@ -46,7 +47,7 @@ import { OxPopup } from '@operato/popup'
|
|
46
47
|
export class DataOocListPage extends connect(store)(localize(i18next)(PageView)) {
|
47
48
|
static styles = [
|
48
49
|
ScrollbarStyles,
|
49
|
-
|
50
|
+
CommonHeaderStyles,
|
50
51
|
css`
|
51
52
|
:host {
|
52
53
|
display: flex;
|
@@ -62,12 +63,11 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
|
|
62
63
|
`
|
63
64
|
]
|
64
65
|
|
65
|
-
@state() gristConfig: any
|
66
|
-
@state() mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'
|
67
|
-
@state() state?: string[]
|
66
|
+
@state() private gristConfig: any
|
67
|
+
@state() private mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'
|
68
|
+
@state() private state?: string[]
|
68
69
|
|
69
70
|
@query('ox-grist') private grist!: DataGrist
|
70
|
-
@query('#sorter-control') private sortersControl!: OxPopup
|
71
71
|
|
72
72
|
get context() {
|
73
73
|
return {
|
@@ -87,7 +87,8 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
|
|
87
87
|
exportable: {
|
88
88
|
name: i18next.t('title.data-ooc list'),
|
89
89
|
data: this._exportableData.bind(this)
|
90
|
-
}
|
90
|
+
},
|
91
|
+
toolbar: false
|
91
92
|
}
|
92
93
|
}
|
93
94
|
|
@@ -96,8 +97,13 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
|
|
96
97
|
|
97
98
|
return html`
|
98
99
|
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
|
99
|
-
<div slot="headroom">
|
100
|
-
<div
|
100
|
+
<div slot="headroom" class="header">
|
101
|
+
<div class="title">
|
102
|
+
<mwc-icon>summarize</mwc-icon>
|
103
|
+
${i18next.t('title.data-ooc list')}
|
104
|
+
</div>
|
105
|
+
|
106
|
+
<div class="filters">
|
101
107
|
<ox-input-select-buttons
|
102
108
|
.value=${this.state}
|
103
109
|
.options=${getOocStatus()}
|
@@ -108,28 +114,7 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
|
|
108
114
|
></ox-input-select-buttons>
|
109
115
|
</div>
|
110
116
|
|
111
|
-
<
|
112
|
-
Sort
|
113
|
-
<mwc-icon
|
114
|
-
@click=${e => {
|
115
|
-
const target = e.currentTarget
|
116
|
-
this.sortersControl.open({
|
117
|
-
right: 0,
|
118
|
-
top: target.offsetTop + target.offsetHeight
|
119
|
-
})
|
120
|
-
}}
|
121
|
-
>expand_more</mwc-icon
|
122
|
-
>
|
123
|
-
<ox-popup id="sorter-control">
|
124
|
-
<ox-sorters-control> </ox-sorters-control>
|
125
|
-
</ox-popup>
|
126
|
-
</div>
|
127
|
-
|
128
|
-
<div id="modes">
|
129
|
-
<mwc-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</mwc-icon>
|
130
|
-
<mwc-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</mwc-icon>
|
131
|
-
<mwc-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</mwc-icon>
|
132
|
-
</div>
|
117
|
+
<ox-context-page-toolbar class="actions" .context=${this.context}></ox-context-page-toolbar>
|
133
118
|
</div>
|
134
119
|
</ox-grist>
|
135
120
|
`
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import '@operato/data-grist'
|
2
|
+
import '@operato/context/ox-context-page-toolbar.js'
|
2
3
|
|
3
4
|
import gql from 'graphql-tag'
|
4
5
|
import { css, html } from 'lit'
|
@@ -10,16 +11,17 @@ import { client } from '@operato/graphql'
|
|
10
11
|
import { i18next, localize } from '@operato/i18n'
|
11
12
|
import { notify } from '@operato/layout'
|
12
13
|
import { PageView, store } from '@operato/shell'
|
13
|
-
import { CommonButtonStyles,
|
14
|
+
import { CommonButtonStyles, CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'
|
14
15
|
import { isMobileDevice } from '@operato/utils'
|
15
16
|
import { ColumnConfig, DataGrist, FetchOption, SortersControl } from '@operato/data-grist'
|
16
17
|
import { OxPopup } from '@operato/popup'
|
18
|
+
import { OxPrompt } from '@operato/popup/ox-prompt.js'
|
17
19
|
|
18
20
|
@customElement('data-sensor-list-page')
|
19
21
|
export class DataSensorListPage extends connect(store)(localize(i18next)(PageView)) {
|
20
22
|
static styles = [
|
21
23
|
ScrollbarStyles,
|
22
|
-
|
24
|
+
CommonHeaderStyles,
|
23
25
|
css`
|
24
26
|
:host {
|
25
27
|
display: flex;
|
@@ -32,14 +34,22 @@ export class DataSensorListPage extends connect(store)(localize(i18next)(PageVie
|
|
32
34
|
overflow-y: auto;
|
33
35
|
flex: 1;
|
34
36
|
}
|
37
|
+
|
38
|
+
@media (max-width: 450px) {
|
39
|
+
.header {
|
40
|
+
display: grid;
|
41
|
+
grid-template-areas:
|
42
|
+
'title actions'
|
43
|
+
'filters filters';
|
44
|
+
}
|
45
|
+
}
|
35
46
|
`
|
36
47
|
]
|
37
48
|
|
38
|
-
@state() gristConfig: any
|
39
|
-
@state() mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'
|
49
|
+
@state() private gristConfig: any
|
50
|
+
@state() private mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'
|
40
51
|
|
41
52
|
@query('ox-grist') private grist!: DataGrist
|
42
|
-
@query('#sorter-control') private sortersControl!: OxPopup
|
43
53
|
|
44
54
|
get context() {
|
45
55
|
return {
|
@@ -58,21 +68,28 @@ export class DataSensorListPage extends connect(store)(localize(i18next)(PageVie
|
|
58
68
|
help: 'dataset/data-sensor',
|
59
69
|
actions: [
|
60
70
|
{
|
71
|
+
type: 'icon',
|
72
|
+
// icon: 'copy',
|
61
73
|
title: i18next.t('button.copy'),
|
62
74
|
action: this._copyDataSensor.bind(this),
|
63
75
|
...CommonButtonStyles.copy
|
64
76
|
},
|
65
77
|
{
|
78
|
+
type: 'icon',
|
79
|
+
icon: 'save',
|
66
80
|
title: i18next.t('button.save'),
|
67
|
-
action: this._updateDataSensor.bind(this)
|
68
|
-
...CommonButtonStyles.save
|
81
|
+
action: this._updateDataSensor.bind(this)
|
82
|
+
// ...CommonButtonStyles.save
|
69
83
|
},
|
70
84
|
{
|
85
|
+
type: 'icon',
|
86
|
+
// icon: 'delete',
|
71
87
|
title: i18next.t('button.delete'),
|
72
88
|
action: this._deleteDataSensor.bind(this),
|
73
89
|
...CommonButtonStyles.delete
|
74
90
|
}
|
75
|
-
]
|
91
|
+
],
|
92
|
+
toolbar: false
|
76
93
|
}
|
77
94
|
}
|
78
95
|
|
@@ -86,33 +103,17 @@ export class DataSensorListPage extends connect(store)(localize(i18next)(PageVie
|
|
86
103
|
.fetchHandler=${this.fetchHandler.bind(this)}
|
87
104
|
?url-params-sensitive=${this.active}
|
88
105
|
>
|
89
|
-
<div slot="headroom">
|
90
|
-
<div
|
91
|
-
<
|
106
|
+
<div slot="headroom" class="header">
|
107
|
+
<div class="title">
|
108
|
+
<mwc-icon>summarize</mwc-icon>
|
109
|
+
${i18next.t('title.data-sensor list')}
|
92
110
|
</div>
|
93
111
|
|
94
|
-
<div
|
95
|
-
|
96
|
-
<mwc-icon
|
97
|
-
@click=${e => {
|
98
|
-
const target = e.currentTarget
|
99
|
-
this.sortersControl.open({
|
100
|
-
right: 0,
|
101
|
-
top: target.offsetTop + target.offsetHeight
|
102
|
-
})
|
103
|
-
}}
|
104
|
-
>expand_more</mwc-icon
|
105
|
-
>
|
106
|
-
<ox-popup id="sorter-control">
|
107
|
-
<ox-sorters-control> </ox-sorters-control>
|
108
|
-
</ox-popup>
|
112
|
+
<div class="filters">
|
113
|
+
<ox-filters-form class="filter" autofocus without-search></ox-filters-form>
|
109
114
|
</div>
|
110
115
|
|
111
|
-
<
|
112
|
-
<mwc-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</mwc-icon>
|
113
|
-
<mwc-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</mwc-icon>
|
114
|
-
<mwc-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</mwc-icon>
|
115
|
-
</div>
|
116
|
+
<ox-context-page-toolbar class="actions" .context=${this.context}></ox-context-page-toolbar>
|
116
117
|
</div>
|
117
118
|
</ox-grist>
|
118
119
|
`
|
@@ -349,7 +350,14 @@ export class DataSensorListPage extends connect(store)(localize(i18next)(PageVie
|
|
349
350
|
}
|
350
351
|
|
351
352
|
async _deleteDataSensor() {
|
352
|
-
if (
|
353
|
+
if (
|
354
|
+
await OxPrompt.open({
|
355
|
+
title: i18next.t('text.are_you_sure'),
|
356
|
+
text: i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }),
|
357
|
+
confirmButton: { text: i18next.t('button.confirm') },
|
358
|
+
cancelButton: { text: i18next.t('button.cancel') }
|
359
|
+
})
|
360
|
+
) {
|
353
361
|
const ids = this.grist.selected.map(record => record.id)
|
354
362
|
if (ids && ids.length > 0) {
|
355
363
|
const response = await client.mutate({
|
@@ -3,30 +3,22 @@ import './data-item-list.js'
|
|
3
3
|
import './data-set-importer.js'
|
4
4
|
import '../../components/data-entry-form.js'
|
5
5
|
|
6
|
-
import moment from 'moment-timezone'
|
7
6
|
import gql from 'graphql-tag'
|
8
7
|
import { css, html } from 'lit'
|
9
|
-
import { customElement,
|
8
|
+
import { customElement, query, state } from 'lit/decorators.js'
|
10
9
|
import { asyncReplace } from 'lit/directives/async-replace.js'
|
10
|
+
import moment from 'moment-timezone'
|
11
11
|
import { connect } from 'pwa-helpers/connect-mixin'
|
12
12
|
|
13
|
-
import {
|
14
|
-
getEditor,
|
15
|
-
getRenderer,
|
16
|
-
ColumnConfig,
|
17
|
-
DataGrist,
|
18
|
-
FetchOption,
|
19
|
-
SortersControl,
|
20
|
-
ImexConfig
|
21
|
-
} from '@operato/data-grist'
|
13
|
+
import { DataGrist, FetchOption, getEditor, getRenderer, ImexConfig } from '@operato/data-grist'
|
22
14
|
import { OxDataUseCase } from '@operato/dataset'
|
23
15
|
import { client } from '@operato/graphql'
|
24
16
|
import { i18next, localize } from '@operato/i18n'
|
25
17
|
import { notify, openPopup } from '@operato/layout'
|
18
|
+
import { OxPopup } from '@operato/popup'
|
26
19
|
import { PageView, store } from '@operato/shell'
|
27
20
|
import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
28
21
|
import { isMobileDevice, sleep } from '@operato/utils'
|
29
|
-
import { OxPopup } from '@operato/popup'
|
30
22
|
|
31
23
|
const MIN = 60
|
32
24
|
const HOUR = 60 * MIN
|
@@ -476,6 +468,15 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
|
|
476
468
|
},
|
477
469
|
width: 50
|
478
470
|
},
|
471
|
+
{
|
472
|
+
type: 'approval-line',
|
473
|
+
name: 'outlierApprovalLine',
|
474
|
+
header: i18next.t('field.outlier-approval-line'),
|
475
|
+
record: {
|
476
|
+
editable: true
|
477
|
+
},
|
478
|
+
width: 50
|
479
|
+
},
|
479
480
|
{
|
480
481
|
type: 'select',
|
481
482
|
name: 'entryType',
|
@@ -652,6 +653,16 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
|
|
652
653
|
controlNo
|
653
654
|
}
|
654
655
|
}
|
656
|
+
outlierApprovalLine {
|
657
|
+
type
|
658
|
+
value
|
659
|
+
approver {
|
660
|
+
id
|
661
|
+
name
|
662
|
+
description
|
663
|
+
controlNo
|
664
|
+
}
|
665
|
+
}
|
655
666
|
entryType
|
656
667
|
entryView
|
657
668
|
monitorType
|
@@ -1,10 +1,11 @@
|
|
1
1
|
import '@operato/data-grist'
|
2
|
+
import '@operato/context/ox-context-page-toolbar.js'
|
2
3
|
import './data-summary-view.js'
|
3
4
|
|
4
|
-
import {
|
5
|
+
import { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'
|
5
6
|
import { PageView, store } from '@operato/shell'
|
6
7
|
import { css, html } from 'lit'
|
7
|
-
import { customElement, property, query } from 'lit/decorators.js'
|
8
|
+
import { customElement, property, query, state } from 'lit/decorators.js'
|
8
9
|
import moment from 'moment-timezone'
|
9
10
|
import { ColumnConfig, DataGrist, GristRecord, FetchOption, SortersControl } from '@operato/data-grist'
|
10
11
|
import { client } from '@operato/graphql'
|
@@ -20,7 +21,7 @@ import gql from 'graphql-tag'
|
|
20
21
|
export class DataSummaryListPage extends connect(store)(localize(i18next)(PageView)) {
|
21
22
|
static styles = [
|
22
23
|
ScrollbarStyles,
|
23
|
-
|
24
|
+
CommonHeaderStyles,
|
24
25
|
css`
|
25
26
|
:host {
|
26
27
|
display: flex;
|
@@ -33,11 +34,10 @@ export class DataSummaryListPage extends connect(store)(localize(i18next)(PageVi
|
|
33
34
|
`
|
34
35
|
]
|
35
36
|
|
36
|
-
@
|
37
|
-
@
|
37
|
+
@state() private mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'
|
38
|
+
@state() private gristConfig: any
|
38
39
|
|
39
40
|
@query('ox-grist') private grist!: DataGrist
|
40
|
-
@query('#sorter-control') private sortersControl!: OxPopup
|
41
41
|
|
42
42
|
get context() {
|
43
43
|
return {
|
@@ -57,7 +57,8 @@ export class DataSummaryListPage extends connect(store)(localize(i18next)(PageVi
|
|
57
57
|
exportable: {
|
58
58
|
name: i18next.t('title.data-summary list'),
|
59
59
|
data: this._exportableData.bind(this)
|
60
|
-
}
|
60
|
+
},
|
61
|
+
toolbar: false
|
61
62
|
}
|
62
63
|
}
|
63
64
|
|
@@ -71,33 +72,17 @@ export class DataSummaryListPage extends connect(store)(localize(i18next)(PageVi
|
|
71
72
|
.fetchHandler=${this.fetchHandler.bind(this)}
|
72
73
|
?url-params-sensitive=${false /* this.active */}
|
73
74
|
>
|
74
|
-
<div slot="headroom">
|
75
|
-
<div
|
76
|
-
<
|
75
|
+
<div slot="headroom" class="header">
|
76
|
+
<div class="title">
|
77
|
+
<mwc-icon>summarize</mwc-icon>
|
78
|
+
${i18next.t('title.data-summary list')}
|
77
79
|
</div>
|
78
80
|
|
79
|
-
<div
|
80
|
-
|
81
|
-
<mwc-icon
|
82
|
-
@click=${e => {
|
83
|
-
const target = e.currentTarget
|
84
|
-
this.sortersControl.open({
|
85
|
-
right: 0,
|
86
|
-
top: target.offsetTop + target.offsetHeight
|
87
|
-
})
|
88
|
-
}}
|
89
|
-
>expand_more</mwc-icon
|
90
|
-
>
|
91
|
-
<ox-popup id="sorter-control">
|
92
|
-
<ox-sorters-control> </ox-sorters-control>
|
93
|
-
</ox-popup>
|
81
|
+
<div class="filters">
|
82
|
+
<ox-filters-form autofocus without-search></ox-filters-form>
|
94
83
|
</div>
|
95
84
|
|
96
|
-
<
|
97
|
-
<mwc-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</mwc-icon>
|
98
|
-
<mwc-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</mwc-icon>
|
99
|
-
<mwc-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</mwc-icon>
|
100
|
-
</div>
|
85
|
+
<ox-context-page-toolbar class="actions" .context=${this.context}></ox-context-page-toolbar>
|
101
86
|
</div>
|
102
87
|
</ox-grist>
|
103
88
|
`
|