@things-factory/dataset 7.0.1-alpha.26 → 7.0.1-alpha.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/components/data-entry-form.ts +6 -13
- package/client/pages/data-archive/data-archive-list-page.ts +1 -4
- package/client/pages/data-archive/data-archive-request-popup.ts +6 -9
- package/client/pages/data-entry/data-entry-list-page.ts +1 -4
- package/client/pages/data-key-set/data-key-item-list.ts +8 -22
- package/client/pages/data-key-set/data-key-set-importer.ts +4 -11
- package/client/pages/data-key-set/data-key-set-list-page.ts +5 -5
- package/client/pages/data-ooc/data-ooc-list-page.ts +1 -4
- package/client/pages/data-report/data-report-list-page.ts +1 -4
- package/client/pages/data-sample/data-sample-list-page.ts +1 -4
- package/client/pages/data-sample/data-sample-search-page.ts +1 -4
- package/client/pages/data-sensor/data-sensor-list-page.ts +5 -5
- package/client/pages/data-set/data-item-list.ts +7 -15
- package/client/pages/data-set/data-set-importer.ts +5 -17
- package/client/pages/data-set/data-set-list-page.ts +5 -5
- package/client/pages/data-summary/data-summary-list-page.ts +1 -4
- package/client/pages/data-summary/data-summary-period-page.ts +1 -4
- package/client/pages/data-summary/data-summary-search-page.ts +1 -4
- package/dist-client/components/data-entry-form.d.ts +1 -0
- package/dist-client/components/data-entry-form.js +5 -10
- package/dist-client/components/data-entry-form.js.map +1 -1
- package/dist-client/pages/data-archive/data-archive-list-page.js +1 -4
- package/dist-client/pages/data-archive/data-archive-list-page.js.map +1 -1
- package/dist-client/pages/data-archive/data-archive-request-popup.d.ts +1 -1
- package/dist-client/pages/data-archive/data-archive-request-popup.js +5 -9
- package/dist-client/pages/data-archive/data-archive-request-popup.js.map +1 -1
- package/dist-client/pages/data-entry/data-entry-list-page.js +1 -4
- package/dist-client/pages/data-entry/data-entry-list-page.js.map +1 -1
- package/dist-client/pages/data-key-set/data-key-item-list.d.ts +1 -0
- package/dist-client/pages/data-key-set/data-key-item-list.js +7 -22
- package/dist-client/pages/data-key-set/data-key-item-list.js.map +1 -1
- package/dist-client/pages/data-key-set/data-key-set-importer.d.ts +1 -0
- package/dist-client/pages/data-key-set/data-key-set-importer.js +4 -11
- package/dist-client/pages/data-key-set/data-key-set-importer.js.map +1 -1
- package/dist-client/pages/data-key-set/data-key-set-list-page.d.ts +10 -2
- package/dist-client/pages/data-key-set/data-key-set-list-page.js +5 -5
- package/dist-client/pages/data-key-set/data-key-set-list-page.js.map +1 -1
- package/dist-client/pages/data-ooc/data-ooc-list-page.js +1 -4
- package/dist-client/pages/data-ooc/data-ooc-list-page.js.map +1 -1
- package/dist-client/pages/data-report/data-report-list-page.js +1 -4
- package/dist-client/pages/data-report/data-report-list-page.js.map +1 -1
- package/dist-client/pages/data-sample/data-sample-list-page.js +1 -4
- package/dist-client/pages/data-sample/data-sample-list-page.js.map +1 -1
- package/dist-client/pages/data-sample/data-sample-search-page.js +1 -4
- package/dist-client/pages/data-sample/data-sample-search-page.js.map +1 -1
- package/dist-client/pages/data-sensor/data-sensor-list-page.d.ts +10 -2
- package/dist-client/pages/data-sensor/data-sensor-list-page.js +5 -5
- package/dist-client/pages/data-sensor/data-sensor-list-page.js.map +1 -1
- package/dist-client/pages/data-set/data-item-list.d.ts +1 -1
- package/dist-client/pages/data-set/data-item-list.js +6 -15
- package/dist-client/pages/data-set/data-item-list.js.map +1 -1
- package/dist-client/pages/data-set/data-set-importer.d.ts +1 -0
- package/dist-client/pages/data-set/data-set-importer.js +5 -16
- package/dist-client/pages/data-set/data-set-importer.js.map +1 -1
- package/dist-client/pages/data-set/data-set-list-page.d.ts +10 -2
- package/dist-client/pages/data-set/data-set-list-page.js +5 -5
- package/dist-client/pages/data-set/data-set-list-page.js.map +1 -1
- package/dist-client/pages/data-summary/data-summary-list-page.js +1 -4
- 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 +1 -4
- package/dist-client/pages/data-summary/data-summary-period-page.js.map +1 -1
- package/dist-client/pages/data-summary/data-summary-search-page.js +1 -4
- package/dist-client/pages/data-summary/data-summary-search-page.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +12 -12
@@ -1,3 +1,4 @@
|
|
1
|
+
import '@material/web/icon/icon.js'
|
1
2
|
import '@operato/dataset/ox-data-entry-form.js'
|
2
3
|
|
3
4
|
import gql from 'graphql-tag'
|
@@ -6,13 +7,14 @@ import { customElement, property, query, state } from 'lit/decorators.js'
|
|
6
7
|
|
7
8
|
import { client } from '@operato/graphql'
|
8
9
|
import { i18next, localize } from '@operato/i18n'
|
9
|
-
import { ScrollbarStyles } from '@operato/styles'
|
10
|
+
import { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles'
|
10
11
|
import { OxDataEntryForm } from '@operato/dataset/ox-data-entry-form.js'
|
11
12
|
import { DataSet } from '@operato/dataset'
|
12
13
|
|
13
14
|
@customElement('data-entry-form')
|
14
15
|
export class DataEntryForm extends localize(i18next)(LitElement) {
|
15
16
|
static styles = [
|
17
|
+
ButtonContainerStyles,
|
16
18
|
ScrollbarStyles,
|
17
19
|
css`
|
18
20
|
:host {
|
@@ -28,12 +30,6 @@ export class DataEntryForm extends localize(i18next)(LitElement) {
|
|
28
30
|
overflow: auto;
|
29
31
|
}
|
30
32
|
|
31
|
-
.button-container {
|
32
|
-
display: flex;
|
33
|
-
margin-left: auto;
|
34
|
-
padding: var(--padding-default);
|
35
|
-
}
|
36
|
-
|
37
33
|
.button-container span {
|
38
34
|
font-size: 14px;
|
39
35
|
color: #333;
|
@@ -52,11 +48,10 @@ export class DataEntryForm extends localize(i18next)(LitElement) {
|
|
52
48
|
render() {
|
53
49
|
return html`
|
54
50
|
<ox-data-entry-form .dataSet=${this.dataSet}></ox-data-entry-form>
|
51
|
+
|
55
52
|
<div class="button-container">
|
56
53
|
${!this.dataSample
|
57
|
-
? html`
|
58
|
-
<mwc-button raised @click=${this.updateDataItems.bind(this)}>${i18next.t('button.save')}</mwc-button>
|
59
|
-
`
|
54
|
+
? html` <button @click=${this.updateDataItems.bind(this)}><md-icon>save</md-icon>${i18next.t('button.save')}</button> `
|
60
55
|
: html` <span>${i18next.t('field.collected-at')}: ${this.dataSample.collectedAt.toLocaleString()}</span> `}
|
61
56
|
</div>
|
62
57
|
`
|
@@ -101,9 +96,7 @@ export class DataEntryForm extends localize(i18next)(LitElement) {
|
|
101
96
|
collectedAt: new Date(collectedAt)
|
102
97
|
}
|
103
98
|
|
104
|
-
document.dispatchEvent(
|
105
|
-
new CustomEvent('notify', { detail: { message: i18next.t('text.data sample created successfully') } })
|
106
|
-
)
|
99
|
+
document.dispatchEvent(new CustomEvent('notify', { detail: { message: i18next.t('text.data sample created successfully') } }))
|
107
100
|
}
|
108
101
|
}
|
109
102
|
}
|
@@ -80,10 +80,7 @@ export class DataArchiveListPage extends connect(store)(localize(i18next)(PageVi
|
|
80
80
|
return html`
|
81
81
|
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)} ?url-params-sensitive=${false /* this.active */}>
|
82
82
|
<div slot="headroom" class="header">
|
83
|
-
<div class="title">
|
84
|
-
<md-icon>apps</md-icon>
|
85
|
-
${i18next.t('title.data-archive list')}
|
86
|
-
</div>
|
83
|
+
<div class="title">${i18next.t('title.data-archive list')}</div>
|
87
84
|
|
88
85
|
<!-- <div class="filters">
|
89
86
|
<ox-filters-form class="filter" autofocus without-search></ox-filters-form>
|
@@ -1,10 +1,13 @@
|
|
1
|
+
import '@material/web/icon/icon.js'
|
2
|
+
|
1
3
|
import gql from 'graphql-tag'
|
2
4
|
import { css, html, LitElement } from 'lit'
|
3
5
|
import { customElement, property, query, state } from 'lit/decorators.js'
|
4
6
|
|
5
7
|
import { i18next, localize } from '@operato/i18n'
|
6
8
|
import { client } from '@operato/graphql'
|
7
|
-
import { SingleColumnFormStyles } from '@
|
9
|
+
import { SingleColumnFormStyles } from '@operato/form'
|
10
|
+
import { ButtonContainerStyles } from '@operato/styles'
|
8
11
|
|
9
12
|
import moment from 'moment-timezone'
|
10
13
|
import { CustomAlert } from '@operato/shell'
|
@@ -12,6 +15,7 @@ import { CustomAlert } from '@operato/shell'
|
|
12
15
|
@customElement('data-archive-request-popup')
|
13
16
|
class DataArchiveRequestPopup extends localize(i18next)(LitElement) {
|
14
17
|
static styles = [
|
18
|
+
ButtonContainerStyles,
|
15
19
|
SingleColumnFormStyles,
|
16
20
|
css`
|
17
21
|
:host {
|
@@ -25,13 +29,6 @@ class DataArchiveRequestPopup extends localize(i18next)(LitElement) {
|
|
25
29
|
form {
|
26
30
|
overflow: auto;
|
27
31
|
}
|
28
|
-
|
29
|
-
.button-container {
|
30
|
-
display: flex;
|
31
|
-
margin-top: auto;
|
32
|
-
margin-left: auto;
|
33
|
-
padding: var(--padding-default);
|
34
|
-
}
|
35
32
|
`
|
36
33
|
]
|
37
34
|
|
@@ -53,7 +50,7 @@ class DataArchiveRequestPopup extends localize(i18next)(LitElement) {
|
|
53
50
|
</form>
|
54
51
|
|
55
52
|
<div class="button-container">
|
56
|
-
<
|
53
|
+
<button @click=${this.requestArchive}><md-icon>archive</md-icon>${String(i18next.t('button.submit'))}</button>
|
57
54
|
</div>
|
58
55
|
`
|
59
56
|
}
|
@@ -121,10 +121,7 @@ export class DataEntryListPage extends connect(store)(localize(i18next)(PageView
|
|
121
121
|
return html`
|
122
122
|
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)} ?url-params-sensitive=${this.active}>
|
123
123
|
<div slot="headroom" class="header">
|
124
|
-
<div class="title">
|
125
|
-
<md-icon>apps</md-icon>
|
126
|
-
${i18next.t('title.data-entry list')}
|
127
|
-
</div>
|
124
|
+
<div class="title">${i18next.t('title.data-entry list')}</div>
|
128
125
|
|
129
126
|
<div class="filters">
|
130
127
|
<ox-filters-form autofocus without-search></ox-filters-form>
|
@@ -1,3 +1,5 @@
|
|
1
|
+
import '@material/web/icon/icon.js'
|
2
|
+
|
1
3
|
import gql from 'graphql-tag'
|
2
4
|
import { css, html, LitElement } from 'lit'
|
3
5
|
import { customElement, property, query, state } from 'lit/decorators.js'
|
@@ -6,10 +8,12 @@ import { client } from '@operato/graphql'
|
|
6
8
|
import { i18next, localize } from '@operato/i18n'
|
7
9
|
import { isMobileDevice } from '@operato/utils'
|
8
10
|
import { DataGrist, FetchOption } from '@operato/data-grist'
|
11
|
+
import { ButtonContainerStyles } from '@operato/styles'
|
9
12
|
|
10
13
|
@customElement('data-key-item-list')
|
11
14
|
export class DataKeyItemList extends localize(i18next)(LitElement) {
|
12
15
|
static styles = [
|
16
|
+
ButtonContainerStyles,
|
13
17
|
css`
|
14
18
|
:host {
|
15
19
|
display: flex;
|
@@ -21,19 +25,6 @@ export class DataKeyItemList extends localize(i18next)(LitElement) {
|
|
21
25
|
ox-grist {
|
22
26
|
flex: 1;
|
23
27
|
}
|
24
|
-
|
25
|
-
.button-container {
|
26
|
-
display: flex;
|
27
|
-
margin-left: auto;
|
28
|
-
padding: var(--padding-default);
|
29
|
-
}
|
30
|
-
|
31
|
-
[danger] {
|
32
|
-
--mdc-theme-primary: var(--mdc-danger-button-primary-color);
|
33
|
-
}
|
34
|
-
mwc-button {
|
35
|
-
margin-left: var(--margin-default);
|
36
|
-
}
|
37
28
|
`
|
38
29
|
]
|
39
30
|
|
@@ -43,16 +34,11 @@ export class DataKeyItemList extends localize(i18next)(LitElement) {
|
|
43
34
|
|
44
35
|
render() {
|
45
36
|
return html`
|
46
|
-
<ox-grist
|
47
|
-
|
48
|
-
.config=${this.gristConfig}
|
49
|
-
.fetchHandler=${this.fetchHandler.bind(this)}
|
50
|
-
></ox-grist>
|
37
|
+
<ox-grist .mode=${isMobileDevice() ? 'LIST' : 'GRID'} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}></ox-grist>
|
38
|
+
|
51
39
|
<div class="button-container">
|
52
|
-
<
|
53
|
-
|
54
|
-
>
|
55
|
-
<mwc-button raised @click=${this._updateDataKeyItems.bind(this)}>${i18next.t('button.save')}</mwc-button>
|
40
|
+
<button danger @click=${this._deleteDataKeyItems.bind(this)}><md-icon>delete_forever</md-icon>${i18next.t('button.delete')}</button>
|
41
|
+
<button @click=${this._updateDataKeyItems.bind(this)}><md-icon>save</md-icon>${i18next.t('button.save')}</button>
|
56
42
|
</div>
|
57
43
|
`
|
58
44
|
}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import '@material/web/icon/icon.js'
|
1
2
|
import '@operato/data-grist'
|
2
3
|
|
3
4
|
import gql from 'graphql-tag'
|
@@ -7,10 +8,12 @@ import { customElement, property, query, state } from 'lit/decorators.js'
|
|
7
8
|
import { client } from '@operato/graphql'
|
8
9
|
import { i18next } from '@operato/i18n'
|
9
10
|
import { isMobileDevice } from '@operato/utils'
|
11
|
+
import { ButtonContainerStyles } from '@operato/styles'
|
10
12
|
|
11
13
|
@customElement('data-key-set-importer')
|
12
14
|
export class DataKeySetImporter extends LitElement {
|
13
15
|
static styles = [
|
16
|
+
ButtonContainerStyles,
|
14
17
|
css`
|
15
18
|
:host {
|
16
19
|
display: flex;
|
@@ -22,16 +25,6 @@ export class DataKeySetImporter extends LitElement {
|
|
22
25
|
ox-grist {
|
23
26
|
flex: 1;
|
24
27
|
}
|
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
28
|
`
|
36
29
|
]
|
37
30
|
|
@@ -73,7 +66,7 @@ export class DataKeySetImporter extends LitElement {
|
|
73
66
|
></ox-grist>
|
74
67
|
|
75
68
|
<div class="button-container">
|
76
|
-
<
|
69
|
+
<button @click="${this.save.bind(this)}"><md-icon>save</md-icon>${i18next.t('button.save')}</button>
|
77
70
|
</div>
|
78
71
|
`
|
79
72
|
}
|
@@ -103,7 +103,10 @@ export class DataKeySetListPage extends connect(store)(localize(i18next)(PageVie
|
|
103
103
|
{
|
104
104
|
title: i18next.t('button.delete'),
|
105
105
|
action: this._deleteDataKeySet.bind(this),
|
106
|
-
icon: 'delete'
|
106
|
+
icon: 'delete',
|
107
|
+
emphasis: {
|
108
|
+
danger: true
|
109
|
+
}
|
107
110
|
}
|
108
111
|
],
|
109
112
|
exportable: {
|
@@ -123,10 +126,7 @@ export class DataKeySetListPage extends connect(store)(localize(i18next)(PageVie
|
|
123
126
|
return html`
|
124
127
|
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
|
125
128
|
<div slot="headroom" class="header">
|
126
|
-
<div class="title">
|
127
|
-
<md-icon>apps</md-icon>
|
128
|
-
${i18next.t('title.data-key-set list')}
|
129
|
-
</div>
|
129
|
+
<div class="title">${i18next.t('title.data-key-set list')}</div>
|
130
130
|
|
131
131
|
<div class="filters">
|
132
132
|
<ox-filters-form autofocus without-search></ox-filters-form>
|
@@ -101,10 +101,7 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
|
|
101
101
|
return html`
|
102
102
|
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
|
103
103
|
<div slot="headroom" class="header">
|
104
|
-
<div class="title">
|
105
|
-
<md-icon>apps</md-icon>
|
106
|
-
${i18next.t('title.data-ooc list')}
|
107
|
-
</div>
|
104
|
+
<div class="title">${i18next.t('title.data-ooc list')}</div>
|
108
105
|
|
109
106
|
<div class="filters">
|
110
107
|
<ox-input-select-buttons
|
@@ -158,10 +158,7 @@ export class DataReportListPage extends connect(store)(localize(i18next)(PageVie
|
|
158
158
|
return html`
|
159
159
|
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)} ?url-params-sensitive=${this.active}>
|
160
160
|
<div slot="headroom" class="header">
|
161
|
-
<div class="title">
|
162
|
-
<md-icon>apps</md-icon>
|
163
|
-
${i18next.t('title.data-report list')}
|
164
|
-
</div>
|
161
|
+
<div class="title">${i18next.t('title.data-report list')}</div>
|
165
162
|
|
166
163
|
<div class="filters">
|
167
164
|
<ox-filters-form class="filter" autofocus without-search></ox-filters-form>
|
@@ -81,10 +81,7 @@ export class DataSampleListPage extends connect(store)(localize(i18next)(PageVie
|
|
81
81
|
return html`
|
82
82
|
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)} ?url-params-sensitive=${false /* this.active */}>
|
83
83
|
<div slot="headroom" class="header">
|
84
|
-
<div class="title">
|
85
|
-
<md-icon>apps</md-icon>
|
86
|
-
${i18next.t('title.data-sample list')}
|
87
|
-
</div>
|
84
|
+
<div class="title">${i18next.t('title.data-sample list')}</div>
|
88
85
|
|
89
86
|
<div class="filters">
|
90
87
|
<ox-filters-form class="filter" autofocus without-search></ox-filters-form>
|
@@ -83,10 +83,7 @@ export class DataSampleSearchPage extends connect(store)(localize(i18next)(PageV
|
|
83
83
|
return html`
|
84
84
|
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
|
85
85
|
<div slot="headroom" class="header">
|
86
|
-
<div class="title">
|
87
|
-
<md-icon>apps</md-icon>
|
88
|
-
${i18next.t('title.data-sample search')}
|
89
|
-
</div>
|
86
|
+
<div class="title">${i18next.t('title.data-sample search')}</div>
|
90
87
|
|
91
88
|
<div class="filters">
|
92
89
|
<ox-filters-form class="filter" autofocus without-search></ox-filters-form>
|
@@ -80,7 +80,10 @@ export class DataSensorListPage extends connect(store)(localize(i18next)(PageVie
|
|
80
80
|
{
|
81
81
|
icon: 'delete',
|
82
82
|
title: i18next.t('button.delete'),
|
83
|
-
action: this._deleteDataSensor.bind(this)
|
83
|
+
action: this._deleteDataSensor.bind(this),
|
84
|
+
emphasis: {
|
85
|
+
danger: true
|
86
|
+
}
|
84
87
|
}
|
85
88
|
],
|
86
89
|
toolbar: false
|
@@ -93,10 +96,7 @@ export class DataSensorListPage extends connect(store)(localize(i18next)(PageVie
|
|
93
96
|
return html`
|
94
97
|
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)} ?url-params-sensitive=${this.active}>
|
95
98
|
<div slot="headroom" class="header">
|
96
|
-
<div class="title">
|
97
|
-
<md-icon>apps</md-icon>
|
98
|
-
${i18next.t('title.data-sensor list')}
|
99
|
-
</div>
|
99
|
+
<div class="title">${i18next.t('title.data-sensor list')}</div>
|
100
100
|
|
101
101
|
<div class="filters">
|
102
102
|
<ox-filters-form class="filter" autofocus without-search></ox-filters-form>
|
@@ -1,3 +1,5 @@
|
|
1
|
+
import '@material/web/icon/icon.js'
|
2
|
+
|
1
3
|
import gql from 'graphql-tag'
|
2
4
|
|
3
5
|
import { css, html, LitElement } from 'lit'
|
@@ -7,6 +9,7 @@ import { client } from '@operato/graphql'
|
|
7
9
|
import { i18next, localize } from '@operato/i18n'
|
8
10
|
import { isMobileDevice } from '@operato/utils'
|
9
11
|
import { DataGrist, FetchOption } from '@operato/data-grist'
|
12
|
+
import { ButtonContainerStyles } from '@operato/styles'
|
10
13
|
|
11
14
|
const DataItemStats = ['sum', 'mean', 'stddev', 'variance', 'min', 'max', 'range', 'median', 'mode']
|
12
15
|
|
@@ -17,6 +20,7 @@ class DataItemList extends localize(i18next)(LitElement) {
|
|
17
20
|
@state() gristConfig: any
|
18
21
|
|
19
22
|
static styles = [
|
23
|
+
ButtonContainerStyles,
|
20
24
|
css`
|
21
25
|
:host {
|
22
26
|
display: flex;
|
@@ -28,19 +32,6 @@ class DataItemList extends localize(i18next)(LitElement) {
|
|
28
32
|
ox-grist {
|
29
33
|
flex: 1;
|
30
34
|
}
|
31
|
-
|
32
|
-
.button-container {
|
33
|
-
display: flex;
|
34
|
-
margin-left: auto;
|
35
|
-
padding: var(--padding-default);
|
36
|
-
}
|
37
|
-
|
38
|
-
[danger] {
|
39
|
-
--mdc-theme-primary: var(--mdc-danger-button-primary-color);
|
40
|
-
}
|
41
|
-
mwc-button {
|
42
|
-
margin-left: var(--margin-default);
|
43
|
-
}
|
44
35
|
`
|
45
36
|
]
|
46
37
|
|
@@ -49,9 +40,10 @@ class DataItemList extends localize(i18next)(LitElement) {
|
|
49
40
|
render() {
|
50
41
|
return html`
|
51
42
|
<ox-grist .mode=${isMobileDevice() ? 'LIST' : 'GRID'} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}></ox-grist>
|
43
|
+
|
52
44
|
<div class="button-container">
|
53
|
-
<
|
54
|
-
<
|
45
|
+
<button danger @click=${this._deleteDataItems.bind(this)}><md-icon>delete_forever</md-icon>${i18next.t('button.delete')}</button>
|
46
|
+
<button @click=${this._updateDataItems.bind(this)}><md-icon>save</md-icon>${i18next.t('button.save')}</button>
|
55
47
|
</div>
|
56
48
|
`
|
57
49
|
}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import '@material/web/icon/icon.js'
|
1
2
|
import '@operato/data-grist'
|
2
3
|
|
3
4
|
import gql from 'graphql-tag'
|
@@ -8,10 +9,11 @@ import { client } from '@operato/graphql'
|
|
8
9
|
import { i18next } from '@operato/i18n'
|
9
10
|
import { isMobileDevice } from '@operato/utils'
|
10
11
|
import { DataSet } from '@operato/dataset'
|
11
|
-
|
12
|
+
import { ButtonContainerStyles } from '@operato/styles'
|
12
13
|
@customElement('data-set-importer')
|
13
14
|
export class DataSetImporter extends LitElement {
|
14
15
|
static styles = [
|
16
|
+
ButtonContainerStyles,
|
15
17
|
css`
|
16
18
|
:host {
|
17
19
|
display: flex;
|
@@ -23,16 +25,6 @@ export class DataSetImporter extends LitElement {
|
|
23
25
|
ox-grist {
|
24
26
|
flex: 1;
|
25
27
|
}
|
26
|
-
|
27
|
-
.button-container {
|
28
|
-
display: flex;
|
29
|
-
margin-left: auto;
|
30
|
-
padding: var(--padding-default);
|
31
|
-
}
|
32
|
-
|
33
|
-
mwc-button {
|
34
|
-
margin-left: var(--margin-default);
|
35
|
-
}
|
36
28
|
`
|
37
29
|
]
|
38
30
|
|
@@ -65,14 +57,10 @@ export class DataSetImporter extends LitElement {
|
|
65
57
|
|
66
58
|
render() {
|
67
59
|
return html`
|
68
|
-
<ox-grist
|
69
|
-
.mode=${isMobileDevice() ? 'LIST' : 'GRID'}
|
70
|
-
.config=${this.columns}
|
71
|
-
.data=${{ records: this.dataSets }}
|
72
|
-
></ox-grist>
|
60
|
+
<ox-grist .mode=${isMobileDevice() ? 'LIST' : 'GRID'} .config=${this.columns} .data=${{ records: this.dataSets }}></ox-grist>
|
73
61
|
|
74
62
|
<div class="button-container">
|
75
|
-
<
|
63
|
+
<button @click=${this.save.bind(this)}><md-icon>save</md-icon>${i18next.t('button.save')}</button>
|
76
64
|
</div>
|
77
65
|
`
|
78
66
|
}
|
@@ -139,7 +139,10 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
|
|
139
139
|
{
|
140
140
|
title: i18next.t('button.delete'),
|
141
141
|
action: this._deleteDataSet.bind(this),
|
142
|
-
icon: 'delete'
|
142
|
+
icon: 'delete',
|
143
|
+
emphasis: {
|
144
|
+
danger: true
|
145
|
+
}
|
143
146
|
}
|
144
147
|
],
|
145
148
|
toolbar: false
|
@@ -152,10 +155,7 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
|
|
152
155
|
return html`
|
153
156
|
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)} ?url-params-sensitive=${this.active}>
|
154
157
|
<div slot="headroom" class="header">
|
155
|
-
<div class="title">
|
156
|
-
<md-icon>apps</md-icon>
|
157
|
-
${i18next.t('title.data-set list')}
|
158
|
-
</div>
|
158
|
+
<div class="title">${i18next.t('title.data-set list')}</div>
|
159
159
|
|
160
160
|
<div class="filters">
|
161
161
|
<ox-filters-form autofocus without-search></ox-filters-form>
|
@@ -70,10 +70,7 @@ export class DataSummaryListPage extends connect(store)(localize(i18next)(PageVi
|
|
70
70
|
return html`
|
71
71
|
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)} ?url-params-sensitive=${false /* this.active */}>
|
72
72
|
<div slot="headroom" class="header">
|
73
|
-
<div class="title">
|
74
|
-
<md-icon>apps</md-icon>
|
75
|
-
${i18next.t('title.data-summary list')}
|
76
|
-
</div>
|
73
|
+
<div class="title">${i18next.t('title.data-summary list')}</div>
|
77
74
|
|
78
75
|
<div class="filters">
|
79
76
|
<ox-filters-form autofocus without-search></ox-filters-form>
|
@@ -84,10 +84,7 @@ export class DataSummaryGroupPage extends connect(store)(localize(i18next)(PageV
|
|
84
84
|
return html`
|
85
85
|
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
|
86
86
|
<div slot="headroom" class="header">
|
87
|
-
<div class="title">
|
88
|
-
<md-icon>apps</md-icon>
|
89
|
-
${i18next.t('title.data-summary period')}
|
90
|
-
</div>
|
87
|
+
<div class="title">${i18next.t('title.data-summary period')}</div>
|
91
88
|
|
92
89
|
<div
|
93
90
|
class="filters"
|
@@ -87,10 +87,7 @@ export class DataSummarySearchPage extends connect(store)(localize(i18next)(Page
|
|
87
87
|
return html`
|
88
88
|
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
|
89
89
|
<div slot="headroom" class="header">
|
90
|
-
<div class="title">
|
91
|
-
<md-icon>apps</md-icon>
|
92
|
-
${i18next.t('title.data-summary search')}
|
93
|
-
</div>
|
90
|
+
<div class="title">${i18next.t('title.data-summary search')}</div>
|
94
91
|
|
95
92
|
<div class="filters">
|
96
93
|
<ox-filters-form autofocus without-search></ox-filters-form>
|
@@ -1,21 +1,21 @@
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
2
|
+
import '@material/web/icon/icon.js';
|
2
3
|
import '@operato/dataset/ox-data-entry-form.js';
|
3
4
|
import gql from 'graphql-tag';
|
4
5
|
import { css, html, LitElement } from 'lit';
|
5
6
|
import { customElement, property, query, state } from 'lit/decorators.js';
|
6
7
|
import { client } from '@operato/graphql';
|
7
8
|
import { i18next, localize } from '@operato/i18n';
|
8
|
-
import { ScrollbarStyles } from '@operato/styles';
|
9
|
+
import { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles';
|
9
10
|
import { OxDataEntryForm } from '@operato/dataset/ox-data-entry-form.js';
|
10
11
|
let DataEntryForm = class DataEntryForm extends localize(i18next)(LitElement) {
|
11
12
|
render() {
|
12
13
|
return html `
|
13
14
|
<ox-data-entry-form .dataSet=${this.dataSet}></ox-data-entry-form>
|
15
|
+
|
14
16
|
<div class="button-container">
|
15
17
|
${!this.dataSample
|
16
|
-
? html `
|
17
|
-
<mwc-button raised @click=${this.updateDataItems.bind(this)}>${i18next.t('button.save')}</mwc-button>
|
18
|
-
`
|
18
|
+
? html ` <button @click=${this.updateDataItems.bind(this)}><md-icon>save</md-icon>${i18next.t('button.save')}</button> `
|
19
19
|
: html ` <span>${i18next.t('field.collected-at')}: ${this.dataSample.collectedAt.toLocaleString()}</span> `}
|
20
20
|
</div>
|
21
21
|
`;
|
@@ -60,6 +60,7 @@ let DataEntryForm = class DataEntryForm extends localize(i18next)(LitElement) {
|
|
60
60
|
}
|
61
61
|
};
|
62
62
|
DataEntryForm.styles = [
|
63
|
+
ButtonContainerStyles,
|
63
64
|
ScrollbarStyles,
|
64
65
|
css `
|
65
66
|
:host {
|
@@ -75,12 +76,6 @@ DataEntryForm.styles = [
|
|
75
76
|
overflow: auto;
|
76
77
|
}
|
77
78
|
|
78
|
-
.button-container {
|
79
|
-
display: flex;
|
80
|
-
margin-left: auto;
|
81
|
-
padding: var(--padding-default);
|
82
|
-
}
|
83
|
-
|
84
79
|
.button-container span {
|
85
80
|
font-size: 14px;
|
86
81
|
color: #333;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"data-entry-form.js","sourceRoot":"","sources":["../../client/components/data-entry-form.ts"],"names":[],"mappings":";AAAA,OAAO,wCAAwC,CAAA;AAE/C,OAAO,GAAG,MAAM,aAAa,CAAA;A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AAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;8CAAmC;AAE9D;IAAC,KAAK,EAAE;;iDAA+C;AAEvD;IAAC,KAAK,CAAC,oBAAoB,CAAC;8BAAa,eAAe;gDAAA;AA/B7C,aAAa;IADzB,aAAa,CAAC,iBAAiB,CAAC;GACpB,aAAa,CAuFzB;SAvFY,aAAa","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/dataset/ox-data-entry-form.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles'\nimport { OxDataEntryForm } from '@operato/dataset/ox-data-entry-form.js'\nimport { DataSet } from '@operato/dataset'\n\n@customElement('data-entry-form')\nexport class DataEntryForm extends localize(i18next)(LitElement) {\n static styles = [\n ButtonContainerStyles,\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: #fff;\n }\n\n ox-data-entry-form {\n flex: 1;\n padding: 10px;\n overflow: auto;\n }\n\n .button-container span {\n font-size: 14px;\n color: #333;\n line-height: 1.5;\n padding: 10px;\n }\n `\n ]\n\n @property({ type: Object }) dataSet?: DataSet & { id: string }\n\n @state() dataSample?: { id: string; collectedAt: Date }\n\n @query('ox-data-entry-form') entryForm!: OxDataEntryForm\n\n render() {\n return html`\n <ox-data-entry-form .dataSet=${this.dataSet}></ox-data-entry-form>\n\n <div class=\"button-container\">\n ${!this.dataSample\n ? html` <button @click=${this.updateDataItems.bind(this)}><md-icon>save</md-icon>${i18next.t('button.save')}</button> `\n : html` <span>${i18next.t('field.collected-at')}: ${this.dataSample.collectedAt.toLocaleString()}</span> `}\n </div>\n `\n }\n\n private async updateDataItems() {\n //@ts-ignore TODO replace with following line and confirm\n const data = this.entryForm.buildValue()\n\n const dataSample = {\n dataSet: {\n id: this.dataSet?.id\n },\n data\n } as any\n\n if (this.dataSample?.collectedAt) {\n dataSample.collectedAt = this.dataSample.collectedAt\n }\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($dataSample: NewDataSample!) {\n createDataSample(dataSample: $dataSample) {\n id\n collectedAt\n }\n }\n `,\n variables: {\n dataSample\n },\n context: {\n hasUpload: true\n }\n })\n\n if (!response.errors) {\n const { id, collectedAt } = response.data.createDataSample\n this.dataSample = {\n id,\n collectedAt: new Date(collectedAt)\n }\n\n document.dispatchEvent(new CustomEvent('notify', { detail: { message: i18next.t('text.data sample created successfully') } }))\n }\n }\n}\n"]}
|
@@ -54,10 +54,7 @@ let DataArchiveListPage = class DataArchiveListPage extends connect(store)(local
|
|
54
54
|
return html `
|
55
55
|
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)} ?url-params-sensitive=${false /* this.active */}>
|
56
56
|
<div slot="headroom" class="header">
|
57
|
-
<div class="title">
|
58
|
-
<md-icon>apps</md-icon>
|
59
|
-
${i18next.t('title.data-archive list')}
|
60
|
-
</div>
|
57
|
+
<div class="title">${i18next.t('title.data-archive list')}</div>
|
61
58
|
|
62
59
|
<!-- <div class="filters">
|
63
60
|
<ox-filters-form class="filter" autofocus without-search></ox-filters-form>
|