@things-factory/dataset 6.0.25 → 6.0.28
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/README.md +26 -11
- package/assets/images/data-collect.png +0 -0
- package/assets/images/ooc.png +0 -0
- package/assets/images/oos.png +0 -0
- package/client/{bootstrap.js → bootstrap.ts} +5 -1
- package/client/components/data-collect-activity-view.ts +100 -0
- package/client/components/{data-entry-form.js → data-entry-form.ts} +30 -33
- package/client/components/ooc-resolve-activity-view.ts +174 -0
- package/client/components/ooc-review-activity-view.ts +153 -0
- package/client/pages/data-archive/{data-archive-list-page.js → data-archive-list-page.ts} +67 -53
- package/client/pages/data-archive/{data-archive-request-popup.js → data-archive-request-popup.ts} +41 -39
- package/client/pages/data-entry/{data-entry-list-page.js → data-entry-list-page.ts} +41 -38
- package/client/pages/data-key-set/{data-key-item-list.js → data-key-item-list.ts} +31 -39
- package/client/pages/data-key-set/data-key-set-importer.ts +95 -0
- package/client/pages/data-key-set/{data-key-set-list-page.js → data-key-set-list-page.ts} +54 -35
- package/client/pages/data-ooc/{data-ooc-list-page.js → data-ooc-list-page.ts} +56 -36
- package/client/pages/data-ooc/data-ooc-view-page.ts +115 -0
- package/client/pages/data-ooc/data-ooc-view.ts +124 -0
- package/client/pages/data-report/{data-report-embed-page.js → data-report-embed-page.ts} +25 -34
- package/client/pages/data-report/{data-report-list-page.js → data-report-list-page.ts} +49 -43
- package/client/pages/data-report/{data-report-samples-page.js → data-report-samples-page.ts} +29 -43
- package/client/pages/data-report/{jasper-report-oocs-page.js → jasper-report-oocs-page.ts} +22 -34
- package/client/pages/data-report/{jasper-report-samples-crosstab-page.js → jasper-report-samples-crosstab-page.ts} +22 -34
- package/client/pages/data-report/{jasper-report-samples-page.js → jasper-report-samples-page.ts} +22 -34
- package/client/pages/data-sample/{data-sample-list-page.js → data-sample-list-page.ts} +49 -36
- package/client/pages/data-sample/{data-sample-search-page.js → data-sample-search-page.ts} +53 -39
- package/client/pages/data-sample/{data-sample-view.js → data-sample-view.ts} +29 -33
- package/client/pages/data-sensor/{data-sensor-list-page.js → data-sensor-list-page.ts} +41 -35
- package/client/pages/data-set/{data-item-list.js → data-item-list.ts} +31 -37
- package/client/pages/data-set/data-set-importer.ts +96 -0
- package/client/pages/data-set/{data-set-list-page.js → data-set-list-page.ts} +173 -40
- package/client/{route.js → route.ts} +5 -1
- package/client/tsconfig.json +11 -0
- package/config/config.development.js +30 -30
- package/config/config.production.js +31 -31
- package/dist-client/bootstrap.d.ts +5 -0
- package/dist-client/bootstrap.js +16 -0
- package/dist-client/bootstrap.js.map +1 -0
- package/dist-client/components/data-collect-activity-view.d.ts +19 -0
- package/dist-client/components/data-collect-activity-view.js +101 -0
- package/dist-client/components/data-collect-activity-view.js.map +1 -0
- package/dist-client/components/data-entry-form.d.ts +15 -0
- package/dist-client/components/data-entry-form.js +83 -0
- package/dist-client/components/data-entry-form.js.map +1 -0
- package/dist-client/components/data-ooc-activity-view.d.ts +1 -0
- package/dist-client/components/data-ooc-activity-view.js +154 -0
- package/dist-client/components/data-ooc-activity-view.js.map +1 -0
- package/dist-client/components/ooc-resolve-activity-view.d.ts +1 -0
- package/dist-client/components/ooc-resolve-activity-view.js +175 -0
- package/dist-client/components/ooc-resolve-activity-view.js.map +1 -0
- package/dist-client/components/ooc-review-activity-view.d.ts +1 -0
- package/dist-client/components/ooc-review-activity-view.js +155 -0
- package/dist-client/components/ooc-review-activity-view.js.map +1 -0
- package/dist-client/index.d.ts +1 -0
- package/dist-client/index.js +2 -0
- package/dist-client/index.js.map +1 -0
- package/dist-client/pages/data-archive/data-archive-list-page.d.ts +71 -0
- package/dist-client/pages/data-archive/data-archive-list-page.js +287 -0
- package/dist-client/pages/data-archive/data-archive-list-page.js.map +1 -0
- package/dist-client/pages/data-archive/data-archive-request-popup.d.ts +1 -0
- package/dist-client/pages/data-archive/data-archive-request-popup.js +161 -0
- package/dist-client/pages/data-archive/data-archive-request-popup.js.map +1 -0
- package/dist-client/pages/data-entry/data-entry-list-page.d.ts +36 -0
- package/dist-client/pages/data-entry/data-entry-list-page.js +383 -0
- package/dist-client/pages/data-entry/data-entry-list-page.js.map +1 -0
- package/dist-client/pages/data-key-set/data-key-item-list.d.ts +18 -0
- package/dist-client/pages/data-key-set/data-key-item-list.js +188 -0
- package/dist-client/pages/data-key-set/data-key-item-list.js.map +1 -0
- package/dist-client/pages/data-key-set/data-key-set-importer.d.ts +9 -0
- package/dist-client/pages/data-key-set/data-key-set-importer.js +100 -0
- package/dist-client/pages/data-key-set/data-key-set-importer.js.map +1 -0
- package/dist-client/pages/data-key-set/data-key-set-list-page.d.ts +60 -0
- package/dist-client/pages/data-key-set/data-key-set-list-page.js +450 -0
- package/dist-client/pages/data-key-set/data-key-set-list-page.js.map +1 -0
- package/dist-client/pages/data-ooc/data-ooc-list-page.d.ts +58 -0
- package/dist-client/pages/data-ooc/data-ooc-list-page.js +479 -0
- package/dist-client/pages/data-ooc/data-ooc-list-page.js.map +1 -0
- package/dist-client/pages/data-ooc/data-ooc-view-page.d.ts +18 -0
- package/dist-client/pages/data-ooc/data-ooc-view-page.js +114 -0
- package/dist-client/pages/data-ooc/data-ooc-view-page.js.map +1 -0
- package/dist-client/pages/data-ooc/data-ooc-view.d.ts +15 -0
- package/dist-client/pages/data-ooc/data-ooc-view.js +130 -0
- package/dist-client/pages/data-ooc/data-ooc-view.js.map +1 -0
- package/dist-client/pages/data-report/data-report-embed-page.d.ts +36 -0
- package/dist-client/pages/data-report/data-report-embed-page.js +101 -0
- package/dist-client/pages/data-report/data-report-embed-page.js.map +1 -0
- package/dist-client/pages/data-report/data-report-list-page.d.ts +36 -0
- package/dist-client/pages/data-report/data-report-list-page.js +431 -0
- package/dist-client/pages/data-report/data-report-list-page.js.map +1 -0
- package/dist-client/pages/data-report/data-report-samples-page.d.ts +32 -0
- package/dist-client/pages/data-report/data-report-samples-page.js +164 -0
- package/dist-client/pages/data-report/data-report-samples-page.js.map +1 -0
- package/dist-client/pages/data-report/jasper-report-oocs-page.d.ts +2 -0
- package/dist-client/pages/data-report/jasper-report-oocs-page.js +101 -0
- package/dist-client/pages/data-report/jasper-report-oocs-page.js.map +1 -0
- package/dist-client/pages/data-report/jasper-report-samples-crosstab-page.d.ts +2 -0
- package/dist-client/pages/data-report/jasper-report-samples-crosstab-page.js +101 -0
- package/dist-client/pages/data-report/jasper-report-samples-crosstab-page.js.map +1 -0
- package/dist-client/pages/data-report/jasper-report-samples-page.d.ts +2 -0
- package/dist-client/pages/data-report/jasper-report-samples-page.js +101 -0
- package/dist-client/pages/data-report/jasper-report-samples-page.js.map +1 -0
- package/dist-client/pages/data-sample/data-sample-list-page.d.ts +58 -0
- package/dist-client/pages/data-sample/data-sample-list-page.js +412 -0
- package/dist-client/pages/data-sample/data-sample-list-page.js.map +1 -0
- package/dist-client/pages/data-sample/data-sample-search-page.d.ts +63 -0
- package/dist-client/pages/data-sample/data-sample-search-page.js +413 -0
- package/dist-client/pages/data-sample/data-sample-search-page.js.map +1 -0
- package/dist-client/pages/data-sample/data-sample-view.d.ts +1 -0
- package/dist-client/pages/data-sample/data-sample-view.js +109 -0
- package/dist-client/pages/data-sample/data-sample-view.js.map +1 -0
- package/dist-client/pages/data-sensor/data-sensor-list-page.d.ts +49 -0
- package/dist-client/pages/data-sensor/data-sensor-list-page.js +419 -0
- package/dist-client/pages/data-sensor/data-sensor-list-page.js.map +1 -0
- package/dist-client/pages/data-set/data-item-list.d.ts +1 -0
- package/dist-client/pages/data-set/data-item-list.js +267 -0
- package/dist-client/pages/data-set/data-item-list.js.map +1 -0
- package/dist-client/pages/data-set/data-set-importer.d.ts +10 -0
- package/dist-client/pages/data-set/data-set-importer.js +103 -0
- package/dist-client/pages/data-set/data-set-importer.js.map +1 -0
- package/dist-client/pages/data-set/data-set-list-page.d.ts +73 -0
- package/dist-client/pages/data-set/data-set-list-page.js +861 -0
- package/dist-client/pages/data-set/data-set-list-page.js.map +1 -0
- package/dist-client/route.d.ts +1 -0
- package/dist-client/route.js +50 -0
- package/dist-client/route.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -0
- package/dist-server/controllers/activity-template/activity-data-collect.js +82 -0
- package/dist-server/controllers/activity-template/activity-data-collect.js.map +1 -0
- package/dist-server/controllers/activity-template/activity-ooc-resolve.js +100 -0
- package/dist-server/controllers/activity-template/activity-ooc-resolve.js.map +1 -0
- package/dist-server/controllers/activity-template/activity-ooc-review.js +107 -0
- package/dist-server/controllers/activity-template/activity-ooc-review.js.map +1 -0
- package/dist-server/controllers/activity-template/activity-ooc.js +59 -0
- package/dist-server/controllers/activity-template/activity-ooc.js.map +1 -0
- package/dist-server/controllers/create-data-sample.js +53 -14
- package/dist-server/controllers/create-data-sample.js.map +1 -1
- package/dist-server/controllers/data-use-case.js +1 -1
- package/dist-server/controllers/data-use-case.js.map +1 -1
- package/dist-server/controllers/index.js +7 -0
- package/dist-server/controllers/index.js.map +1 -1
- package/dist-server/index.js +1 -2
- package/dist-server/index.js.map +1 -1
- package/dist-server/routes.js +47 -3
- package/dist-server/routes.js.map +1 -1
- package/dist-server/service/data-ooc/data-ooc-query.js +22 -2
- package/dist-server/service/data-ooc/data-ooc-query.js.map +1 -1
- package/dist-server/service/data-ooc/data-ooc.js +26 -0
- package/dist-server/service/data-ooc/data-ooc.js.map +1 -1
- package/dist-server/service/data-set/data-set-mutation.js +88 -0
- package/dist-server/service/data-set/data-set-mutation.js.map +1 -1
- package/dist-server/service/data-set/data-set-query.js +38 -4
- package/dist-server/service/data-set/data-set-query.js.map +1 -1
- package/dist-server/service/data-set/data-set-type.js +16 -0
- package/dist-server/service/data-set/data-set-type.js.map +1 -1
- package/dist-server/service/data-set/data-set.js +55 -3
- package/dist-server/service/data-set/data-set.js.map +1 -1
- package/dist-server/service/data-set-history/data-set-history-query.js +4 -3
- package/dist-server/service/data-set-history/data-set-history-query.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/helps/dataset/data-ooc.md +5 -4
- package/package.json +17 -12
- package/server/controllers/activity-template/activity-data-collect.ts +84 -0
- package/server/controllers/activity-template/activity-ooc-resolve.ts +114 -0
- package/server/controllers/activity-template/activity-ooc-review.ts +118 -0
- package/server/controllers/create-data-sample.ts +61 -21
- package/server/controllers/data-use-case.ts +1 -1
- package/server/controllers/index.ts +11 -0
- package/server/index.ts +1 -2
- package/server/routes.ts +62 -5
- package/server/service/data-ooc/data-ooc-query.ts +12 -2
- package/server/service/data-ooc/data-ooc.ts +23 -0
- package/server/service/data-set/data-set-mutation.ts +99 -0
- package/server/service/data-set/data-set-query.ts +39 -5
- package/server/service/data-set/data-set-type.ts +14 -0
- package/server/service/data-set/data-set.ts +43 -2
- package/server/service/data-set-history/data-set-history-query.ts +4 -3
- package/server/tsconfig.json +10 -0
- package/things-factory.config.js +6 -2
- package/translations/en.json +3 -1
- package/translations/ko.json +3 -1
- package/translations/ms.json +3 -0
- package/translations/zh.json +3 -0
- package/client/pages/data-key-set/data-key-set-importer.js +0 -105
- package/client/pages/data-ooc/data-ooc-view.js +0 -188
- package/client/pages/data-set/data-set-importer.js +0 -103
- package/server/middlewares/index.ts +0 -3
- package/server/migrations/index.ts +0 -9
- package/tsconfig.json +0 -9
- /package/assets/{data-report.jpg → images/data-report.jpg} +0 -0
- /package/assets/{data-samples.jpg → images/data-samples.jpg} +0 -0
- /package/assets/{diagram.jpg → images/dataset-diagram.jpg} +0 -0
- /package/assets/{glue-table-indices.png → images/glue-table-indices-for-dataset.png} +0 -0
- /package/client/{index.js → index.ts} +0 -0
@@ -2,51 +2,79 @@ import '@operato/data-grist'
|
|
2
2
|
|
3
3
|
import gql from 'graphql-tag'
|
4
4
|
import { css, html } from 'lit'
|
5
|
+
import { customElement, property, query, state } from 'lit/decorators.js'
|
5
6
|
import { connect } from 'pwa-helpers/connect-mixin'
|
6
7
|
|
8
|
+
import {
|
9
|
+
getEditor,
|
10
|
+
getRenderer,
|
11
|
+
ColumnConfig,
|
12
|
+
DataGrist,
|
13
|
+
FetchOption,
|
14
|
+
SortersControl,
|
15
|
+
GristRecord
|
16
|
+
} from '@operato/data-grist'
|
7
17
|
import { client } from '@operato/graphql'
|
8
18
|
import { i18next, localize } from '@operato/i18n'
|
9
19
|
import { openPopup } from '@operato/layout'
|
10
20
|
import { PageView, store } from '@operato/shell'
|
11
|
-
import { CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
21
|
+
import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
12
22
|
import { isMobileDevice } from '@operato/utils'
|
23
|
+
import { OxPopup, PopupHandle } from '@operato/popup'
|
13
24
|
|
14
25
|
import './data-archive-request-popup'
|
15
26
|
|
27
|
+
@customElement('data-archive-list-page')
|
16
28
|
export class DataArchiveListPage extends connect(store)(localize(i18next)(PageView)) {
|
17
|
-
static
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
29
|
+
static styles = [
|
30
|
+
ScrollbarStyles,
|
31
|
+
CommonGristStyles,
|
32
|
+
css`
|
33
|
+
:host {
|
34
|
+
display: flex;
|
35
|
+
flex-direction: column;
|
24
36
|
|
25
|
-
|
26
|
-
|
27
|
-
ScrollbarStyles,
|
28
|
-
CommonGristStyles,
|
29
|
-
css`
|
30
|
-
:host {
|
31
|
-
display: flex;
|
32
|
-
flex-direction: column;
|
37
|
+
overflow: hidden;
|
38
|
+
}
|
33
39
|
|
34
|
-
|
35
|
-
|
40
|
+
ox-grist {
|
41
|
+
overflow-y: auto;
|
42
|
+
flex: 1;
|
43
|
+
}
|
44
|
+
`
|
45
|
+
]
|
36
46
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
47
|
+
@state() gristConfig: any
|
48
|
+
@state() mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'
|
49
|
+
|
50
|
+
@query('ox-grist') private grist!: DataGrist
|
51
|
+
@query('#sorter-control') private sortersControl!: OxPopup
|
52
|
+
|
53
|
+
private popup?: PopupHandle
|
44
54
|
|
45
55
|
get context() {
|
46
56
|
return {
|
47
|
-
|
57
|
+
search: {
|
58
|
+
handler: (search: string) => {
|
59
|
+
this.grist.searchText = search
|
60
|
+
},
|
61
|
+
placeholder: i18next.t('title.data-archive list'),
|
62
|
+
value: this.grist.searchText
|
63
|
+
},
|
64
|
+
filter: {
|
65
|
+
handler: () => {
|
66
|
+
this.grist.toggleHeadroom()
|
67
|
+
}
|
68
|
+
},
|
48
69
|
help: 'dataset/data-archive',
|
49
|
-
actions: [
|
70
|
+
actions: [
|
71
|
+
{
|
72
|
+
...CommonButtonStyles.save,
|
73
|
+
title: i18next.t('button.request-archive'),
|
74
|
+
action: this.openArchivePopup.bind(this),
|
75
|
+
icon: 'archive'
|
76
|
+
}
|
77
|
+
],
|
50
78
|
exportable: {
|
51
79
|
name: i18next.t('title.data-archive list'),
|
52
80
|
data: this._exportableData.bind(this)
|
@@ -66,7 +94,7 @@ export class DataArchiveListPage extends connect(store)(localize(i18next)(PageVi
|
|
66
94
|
>
|
67
95
|
<div slot="headroom">
|
68
96
|
<div id="filters">
|
69
|
-
<ox-filters-form autofocus></ox-filters-form>
|
97
|
+
<ox-filters-form autofocus without-search></ox-filters-form>
|
70
98
|
</div>
|
71
99
|
|
72
100
|
<div id="sorters">
|
@@ -74,7 +102,7 @@ export class DataArchiveListPage extends connect(store)(localize(i18next)(PageVi
|
|
74
102
|
<mwc-icon
|
75
103
|
@click=${e => {
|
76
104
|
const target = e.currentTarget
|
77
|
-
this.
|
105
|
+
this.sortersControl.open({
|
78
106
|
right: 0,
|
79
107
|
top: target.offsetTop + target.offsetHeight
|
80
108
|
})
|
@@ -91,23 +119,11 @@ export class DataArchiveListPage extends connect(store)(localize(i18next)(PageVi
|
|
91
119
|
<mwc-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</mwc-icon>
|
92
120
|
<mwc-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</mwc-icon>
|
93
121
|
</div>
|
94
|
-
|
95
|
-
<mwc-button
|
96
|
-
dense
|
97
|
-
raised
|
98
|
-
label=${i18next.t('button.request')}
|
99
|
-
@click=${this.openArchivePopup.bind(this)}
|
100
|
-
icon="archive"
|
101
|
-
></mwc-button>
|
102
122
|
</div>
|
103
123
|
</ox-grist>
|
104
124
|
`
|
105
125
|
}
|
106
126
|
|
107
|
-
get grist() {
|
108
|
-
return this.renderRoot.querySelector('ox-grist')
|
109
|
-
}
|
110
|
-
|
111
127
|
async pageInitialized(lifecycle) {
|
112
128
|
const today = new Date().toISOString().split('T')[0]
|
113
129
|
|
@@ -190,25 +206,25 @@ export class DataArchiveListPage extends connect(store)(localize(i18next)(PageVi
|
|
190
206
|
}
|
191
207
|
|
192
208
|
closePopupAndRefesh() {
|
193
|
-
this.popup
|
209
|
+
this.popup?.close()
|
194
210
|
this.grist.fetch()
|
195
211
|
}
|
196
212
|
|
197
213
|
async openArchivePopup() {
|
198
214
|
this.popup = openPopup(
|
199
|
-
html`
|
200
|
-
|
201
|
-
@
|
202
|
-
|
203
|
-
></data-archive-request-popup>`,
|
215
|
+
html` <data-archive-request-popup
|
216
|
+
@requested=${this.closePopupAndRefesh.bind(this)}
|
217
|
+
@created=${this.closePopupAndRefesh.bind(this)}
|
218
|
+
></data-archive-request-popup>`,
|
204
219
|
{
|
205
220
|
backdrop: true,
|
206
221
|
size: 'small',
|
207
222
|
title: i18next.t('title.data-archive request popup')
|
208
|
-
}
|
223
|
+
}
|
224
|
+
)
|
209
225
|
}
|
210
226
|
|
211
|
-
async fetchHandler({ page, limit, sortings = [], filters = [] }) {
|
227
|
+
async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {
|
212
228
|
const response = await client.query({
|
213
229
|
query: gql`
|
214
230
|
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
@@ -248,7 +264,7 @@ export class DataArchiveListPage extends connect(store)(localize(i18next)(PageVi
|
|
248
264
|
}
|
249
265
|
|
250
266
|
_exportableData() {
|
251
|
-
let records = []
|
267
|
+
let records = [] as GristRecord[]
|
252
268
|
if (this.grist.selected && this.grist.selected.length > 0) {
|
253
269
|
records = this.grist.selected
|
254
270
|
} else {
|
@@ -260,7 +276,7 @@ export class DataArchiveListPage extends connect(store)(localize(i18next)(PageVi
|
|
260
276
|
.map(column => {
|
261
277
|
return column.imex === true
|
262
278
|
? {
|
263
|
-
header: column.header.renderer(),
|
279
|
+
header: column.header.renderer(column),
|
264
280
|
key: column.name,
|
265
281
|
width: column.width,
|
266
282
|
type: column.type
|
@@ -286,5 +302,3 @@ export class DataArchiveListPage extends connect(store)(localize(i18next)(PageVi
|
|
286
302
|
return { header: headerSetting, data: data }
|
287
303
|
}
|
288
304
|
}
|
289
|
-
|
290
|
-
window.customElements.define('data-archive-list-page', DataArchiveListPage)
|
package/client/pages/data-archive/{data-archive-request-popup.js → data-archive-request-popup.ts}
RENAMED
@@ -1,38 +1,41 @@
|
|
1
|
-
import { SingleColumnFormStyles } from '@things-factory/form-ui'
|
2
|
-
import { i18next, localize } from '@things-factory/i18n-base'
|
3
|
-
import { client, CustomAlert } from '@things-factory/shell'
|
4
1
|
import gql from 'graphql-tag'
|
5
|
-
import { css, html, LitElement } from 'lit
|
2
|
+
import { css, html, LitElement } from 'lit'
|
3
|
+
import { customElement, property, query, state } from 'lit/decorators.js'
|
4
|
+
|
5
|
+
import { i18next, localize } from '@operato/i18n'
|
6
|
+
import { client } from '@operato/graphql'
|
7
|
+
import { SingleColumnFormStyles } from '@things-factory/form-ui'
|
8
|
+
|
6
9
|
import moment from 'moment-timezone'
|
10
|
+
import Swal from 'sweetalert2'
|
7
11
|
|
12
|
+
@customElement('data-archive-request-popup')
|
8
13
|
class DataArchiveRequestPopup extends localize(i18next)(LitElement) {
|
9
|
-
static
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
+
static styles = [
|
15
|
+
SingleColumnFormStyles,
|
16
|
+
css`
|
17
|
+
:host {
|
18
|
+
padding: 10px;
|
19
|
+
display: flex;
|
20
|
+
flex-direction: column;
|
21
|
+
overflow-x: overlay;
|
22
|
+
background-color: var(--main-section-background-color);
|
23
|
+
}
|
14
24
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
text-align: var(--button-container-align);
|
30
|
-
background-color: var(--button-container-background);
|
31
|
-
height: var(--button-container-height);
|
32
|
-
}
|
33
|
-
`
|
34
|
-
]
|
35
|
-
}
|
25
|
+
form {
|
26
|
+
overflow: auto;
|
27
|
+
}
|
28
|
+
|
29
|
+
.button-container {
|
30
|
+
display: flex;
|
31
|
+
margin-top: auto;
|
32
|
+
margin-left: auto;
|
33
|
+
padding: var(--padding-default);
|
34
|
+
}
|
35
|
+
`
|
36
|
+
]
|
37
|
+
|
38
|
+
@state() dataSetTypes: any
|
36
39
|
|
37
40
|
render() {
|
38
41
|
return html`
|
@@ -44,13 +47,13 @@ class DataArchiveRequestPopup extends localize(i18next)(LitElement) {
|
|
44
47
|
<input type="month" name="endDate" .value=${moment().format('YYYY-MM')} />
|
45
48
|
<label>${i18next.t('label.data-set-type')}</label>
|
46
49
|
<select name="type" required>
|
47
|
-
${(this.dataSetTypes || []).map(t => html`<option value
|
50
|
+
${(this.dataSetTypes || []).map(t => html`<option value=${t && t.value}>${t && t.display}</option>`)}
|
48
51
|
</select>
|
49
52
|
</fieldset>
|
50
53
|
</form>
|
51
54
|
|
52
55
|
<div class="button-container">
|
53
|
-
<mwc-button raised @click
|
56
|
+
<mwc-button raised @click=${this.requestArchive} label=${String(i18next.t('button.submit'))}></mwc-button>
|
54
57
|
</div>
|
55
58
|
`
|
56
59
|
}
|
@@ -65,9 +68,10 @@ class DataArchiveRequestPopup extends localize(i18next)(LitElement) {
|
|
65
68
|
serializeFormData() {
|
66
69
|
const obj = {}
|
67
70
|
|
68
|
-
Array.from(this.shadowRoot
|
69
|
-
|
70
|
-
|
71
|
+
Array.from(this.shadowRoot!.querySelectorAll('form#input-form input, select')).forEach((field: Element) => {
|
72
|
+
const input = field as HTMLInputElement
|
73
|
+
if (!input.hasAttribute('hidden') && input.value) {
|
74
|
+
obj[input.name] = input.type === 'checkbox' ? input.checked : input.value
|
71
75
|
}
|
72
76
|
})
|
73
77
|
|
@@ -116,12 +120,12 @@ class DataArchiveRequestPopup extends localize(i18next)(LitElement) {
|
|
116
120
|
|
117
121
|
this._generateArchiveAndDownloadUrl(dataArchive)
|
118
122
|
|
119
|
-
await
|
123
|
+
await Swal.fire({
|
120
124
|
type: 'info',
|
121
125
|
title: i18next.t('title.ready'),
|
122
126
|
text: i18next.t('text.data-archive waits'),
|
123
127
|
confirmButton: { text: i18next.t('button.confirm') }
|
124
|
-
})
|
128
|
+
} as any)
|
125
129
|
} else {
|
126
130
|
console.error(response.errors)
|
127
131
|
this.showToast(i18next.t('text.failed'))
|
@@ -171,5 +175,3 @@ class DataArchiveRequestPopup extends localize(i18next)(LitElement) {
|
|
171
175
|
]
|
172
176
|
}
|
173
177
|
}
|
174
|
-
|
175
|
-
window.customElements.define('data-archive-request-popup', DataArchiveRequestPopup)
|
@@ -4,9 +4,11 @@ import '../../components/data-entry-form.js'
|
|
4
4
|
|
5
5
|
import gql from 'graphql-tag'
|
6
6
|
import { css, html } from 'lit'
|
7
|
+
import { customElement, property, query, state } from 'lit/decorators.js'
|
8
|
+
|
7
9
|
import { connect } from 'pwa-helpers/connect-mixin'
|
8
10
|
|
9
|
-
import { getRenderer } from '@operato/data-grist'
|
11
|
+
import { ColumnConfig, DataGrist, FetchOption, SortersControl, getRenderer } from '@operato/data-grist'
|
10
12
|
import { OxDataUseCase } from '@operato/dataset'
|
11
13
|
import { client } from '@operato/graphql'
|
12
14
|
import { i18next, localize } from '@operato/i18n'
|
@@ -14,6 +16,7 @@ import { openPopup } from '@operato/layout'
|
|
14
16
|
import { navigate, PageView, store } from '@operato/shell'
|
15
17
|
import { CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
16
18
|
import { provider } from '@things-factory/board-ui'
|
19
|
+
import { OxPopup } from '@operato/popup'
|
17
20
|
|
18
21
|
const USECASE_OPTIONS = () => {
|
19
22
|
return ['', ...OxDataUseCase.getUseCaseNames()].map(name => {
|
@@ -63,6 +66,9 @@ const showEntryView = async (columns, data, column, record, rowIndex) => {
|
|
63
66
|
// navigate(`board-viewer/${entryView}?interactive=true&title=${title}`)
|
64
67
|
break
|
65
68
|
|
69
|
+
case 'custom-element':
|
70
|
+
break
|
71
|
+
|
66
72
|
case 'page':
|
67
73
|
navigate(entryView)
|
68
74
|
break
|
@@ -73,37 +79,42 @@ const showEntryView = async (columns, data, column, record, rowIndex) => {
|
|
73
79
|
}
|
74
80
|
}
|
75
81
|
|
82
|
+
@customElement('data-entry-list-page')
|
76
83
|
export class DataEntryListPage extends connect(store)(localize(i18next)(PageView)) {
|
77
|
-
static
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
mode: String
|
84
|
-
}
|
85
|
-
}
|
84
|
+
static styles = [
|
85
|
+
ScrollbarStyles,
|
86
|
+
CommonGristStyles,
|
87
|
+
css`
|
88
|
+
:host {
|
89
|
+
display: flex;
|
86
90
|
|
87
|
-
|
88
|
-
return [
|
89
|
-
ScrollbarStyles,
|
90
|
-
CommonGristStyles,
|
91
|
-
css`
|
92
|
-
:host {
|
93
|
-
display: flex;
|
91
|
+
width: 100%;
|
94
92
|
|
95
|
-
|
93
|
+
--grid-record-emphasized-background-color: red;
|
94
|
+
--grid-record-emphasized-color: yellow;
|
95
|
+
}
|
96
|
+
`
|
97
|
+
]
|
96
98
|
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
]
|
102
|
-
}
|
99
|
+
@state() gristConfig: any
|
100
|
+
|
101
|
+
@query('ox-grist') private grist!: DataGrist
|
102
|
+
@query('#sorter-control') private sortersControl!: OxPopup
|
103
103
|
|
104
104
|
get context() {
|
105
105
|
return {
|
106
|
-
|
106
|
+
search: {
|
107
|
+
handler: (search: string) => {
|
108
|
+
this.grist.searchText = search
|
109
|
+
},
|
110
|
+
placeholder: i18next.t('title.data-entry list'),
|
111
|
+
value: this.grist.searchText
|
112
|
+
},
|
113
|
+
filter: {
|
114
|
+
handler: () => {
|
115
|
+
this.grist.toggleHeadroom()
|
116
|
+
}
|
117
|
+
},
|
107
118
|
help: 'dataset/data-entry-list'
|
108
119
|
}
|
109
120
|
}
|
@@ -115,13 +126,12 @@ export class DataEntryListPage extends connect(store)(localize(i18next)(PageView
|
|
115
126
|
<ox-grist
|
116
127
|
.mode=${mode}
|
117
128
|
.config=${this.gristConfig}
|
118
|
-
.filters=${this.filters}
|
119
|
-
.orders=${this.orders}
|
120
129
|
.fetchHandler=${this.fetchHandler.bind(this)}
|
130
|
+
?url-params-sensitive=${this.active}
|
121
131
|
>
|
122
132
|
<div slot="headroom">
|
123
133
|
<div id="filters">
|
124
|
-
<ox-filters-form autofocus></ox-filters-form>
|
134
|
+
<ox-filters-form autofocus without-search></ox-filters-form>
|
125
135
|
</div>
|
126
136
|
|
127
137
|
<div id="sorters">
|
@@ -129,7 +139,7 @@ export class DataEntryListPage extends connect(store)(localize(i18next)(PageView
|
|
129
139
|
<mwc-icon
|
130
140
|
@click=${e => {
|
131
141
|
const target = e.currentTarget
|
132
|
-
this.
|
142
|
+
this.sortersControl.open({
|
133
143
|
right: 0,
|
134
144
|
top: target.offsetTop + target.offsetHeight
|
135
145
|
})
|
@@ -145,10 +155,6 @@ export class DataEntryListPage extends connect(store)(localize(i18next)(PageView
|
|
145
155
|
`
|
146
156
|
}
|
147
157
|
|
148
|
-
get grist() {
|
149
|
-
return this.renderRoot.querySelector('ox-grist')
|
150
|
-
}
|
151
|
-
|
152
158
|
async pageInitialized(lifecycle) {
|
153
159
|
this.gristConfig = {
|
154
160
|
list: {
|
@@ -233,8 +239,7 @@ export class DataEntryListPage extends connect(store)(localize(i18next)(PageView
|
|
233
239
|
record: {
|
234
240
|
editable: false
|
235
241
|
},
|
236
|
-
width: 80
|
237
|
-
label: true
|
242
|
+
width: 80
|
238
243
|
},
|
239
244
|
{
|
240
245
|
type: 'resource-object',
|
@@ -316,7 +321,7 @@ export class DataEntryListPage extends connect(store)(localize(i18next)(PageView
|
|
316
321
|
}
|
317
322
|
}
|
318
323
|
|
319
|
-
async fetchHandler({ page, limit, sortings = [], filters = [] }) {
|
324
|
+
async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {
|
320
325
|
const response = await client.query({
|
321
326
|
query: gql`
|
322
327
|
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
@@ -385,5 +390,3 @@ export class DataEntryListPage extends connect(store)(localize(i18next)(PageView
|
|
385
390
|
}
|
386
391
|
}
|
387
392
|
}
|
388
|
-
|
389
|
-
window.customElements.define('data-entry-list-page', DataEntryListPage)
|
@@ -1,51 +1,45 @@
|
|
1
1
|
import gql from 'graphql-tag'
|
2
2
|
import { css, html, LitElement } from 'lit'
|
3
|
+
import { customElement, property, query, state } from 'lit/decorators.js'
|
3
4
|
|
4
5
|
import { client } from '@operato/graphql'
|
5
6
|
import { i18next, localize } from '@operato/i18n'
|
6
7
|
import { isMobileDevice } from '@operato/utils'
|
8
|
+
import { getEditor, getRenderer, ColumnConfig, DataGrist, FetchOption, SortersControl } from '@operato/data-grist'
|
7
9
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
10
|
+
@customElement('data-key-item-list')
|
11
|
+
export class DataKeyItemList extends localize(i18next)(LitElement) {
|
12
|
+
static styles = [
|
13
|
+
css`
|
14
|
+
:host {
|
15
|
+
display: flex;
|
16
|
+
flex-direction: column;
|
15
17
|
|
16
|
-
|
17
|
-
|
18
|
-
css`
|
19
|
-
:host {
|
20
|
-
display: flex;
|
21
|
-
flex-direction: column;
|
22
|
-
|
23
|
-
background-color: #fff;
|
24
|
-
}
|
18
|
+
background-color: #fff;
|
19
|
+
}
|
25
20
|
|
26
|
-
|
27
|
-
|
28
|
-
|
21
|
+
ox-grist {
|
22
|
+
flex: 1;
|
23
|
+
}
|
29
24
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
25
|
+
.button-container {
|
26
|
+
display: flex;
|
27
|
+
margin-left: auto;
|
28
|
+
padding: var(--padding-default);
|
29
|
+
}
|
35
30
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
}
|
31
|
+
[danger] {
|
32
|
+
--mdc-theme-primary: var(--mdc-danger-button-primary-color);
|
33
|
+
}
|
34
|
+
mwc-button {
|
35
|
+
margin-left: var(--margin-default);
|
36
|
+
}
|
37
|
+
`
|
38
|
+
]
|
45
39
|
|
46
|
-
|
47
|
-
|
48
|
-
|
40
|
+
@property({ type: Object }) dataKeySet: any
|
41
|
+
@state() gristConfig: any
|
42
|
+
@query('ox-grist') private grist!: DataGrist
|
49
43
|
|
50
44
|
render() {
|
51
45
|
return html`
|
@@ -142,7 +136,7 @@ class DataKeyItemList extends localize(i18next)(LitElement) {
|
|
142
136
|
}
|
143
137
|
}
|
144
138
|
|
145
|
-
async fetchHandler({ filters, page, limit, sortings = [] }) {
|
139
|
+
async fetchHandler({ filters, page, limit, sortings = [] }: FetchOption) {
|
146
140
|
const dataKeyItems = this.dataKeySet.dataKeyItems || []
|
147
141
|
|
148
142
|
return {
|
@@ -192,5 +186,3 @@ class DataKeyItemList extends localize(i18next)(LitElement) {
|
|
192
186
|
this.grist.deleteSelectedRecords(false)
|
193
187
|
}
|
194
188
|
}
|
195
|
-
|
196
|
-
window.customElements.define('data-key-item-list', DataKeyItemList)
|
@@ -0,0 +1,95 @@
|
|
1
|
+
import '@operato/data-grist'
|
2
|
+
|
3
|
+
import gql from 'graphql-tag'
|
4
|
+
import { css, html, LitElement } from 'lit'
|
5
|
+
import { customElement, property, query, state } from 'lit/decorators.js'
|
6
|
+
|
7
|
+
import { client } from '@operato/graphql'
|
8
|
+
import { i18next } from '@operato/i18n'
|
9
|
+
import { isMobileDevice } from '@operato/utils'
|
10
|
+
|
11
|
+
@customElement('data-key-set-importer')
|
12
|
+
export class DataKeySetImporter extends LitElement {
|
13
|
+
static styles = [
|
14
|
+
css`
|
15
|
+
:host {
|
16
|
+
display: flex;
|
17
|
+
flex-direction: column;
|
18
|
+
|
19
|
+
background-color: #fff;
|
20
|
+
}
|
21
|
+
|
22
|
+
ox-grist {
|
23
|
+
flex: 1;
|
24
|
+
}
|
25
|
+
|
26
|
+
.button-container {
|
27
|
+
display: flex;
|
28
|
+
margin-left: auto;
|
29
|
+
padding: var(--padding-default);
|
30
|
+
}
|
31
|
+
|
32
|
+
mwc-button {
|
33
|
+
margin-left: var(--margin-default);
|
34
|
+
}
|
35
|
+
`
|
36
|
+
]
|
37
|
+
|
38
|
+
@property({ type: Array }) dataKeySets: any[] = []
|
39
|
+
|
40
|
+
private columns = {
|
41
|
+
list: { fields: ['name', 'description'] },
|
42
|
+
pagination: { infinite: true },
|
43
|
+
columns: [
|
44
|
+
{
|
45
|
+
type: 'string',
|
46
|
+
name: 'name',
|
47
|
+
header: i18next.t('field.name'),
|
48
|
+
width: 150
|
49
|
+
},
|
50
|
+
{
|
51
|
+
type: 'string',
|
52
|
+
name: 'description',
|
53
|
+
header: i18next.t('field.description'),
|
54
|
+
width: 200
|
55
|
+
},
|
56
|
+
{
|
57
|
+
type: 'checkbox',
|
58
|
+
name: 'active',
|
59
|
+
header: i18next.t('field.active'),
|
60
|
+
width: 60
|
61
|
+
}
|
62
|
+
]
|
63
|
+
}
|
64
|
+
|
65
|
+
render() {
|
66
|
+
return html`
|
67
|
+
<ox-grist
|
68
|
+
.mode=${isMobileDevice() ? 'LIST' : 'GRID'}
|
69
|
+
.config=${this.columns}
|
70
|
+
.data=${{
|
71
|
+
records: this.dataKeySets
|
72
|
+
}}
|
73
|
+
></ox-grist>
|
74
|
+
|
75
|
+
<div class="button-container">
|
76
|
+
<mwc-button raised @click="${this.save.bind(this)}">${i18next.t('button.save')}</mwc-button>
|
77
|
+
</div>
|
78
|
+
`
|
79
|
+
}
|
80
|
+
|
81
|
+
async save() {
|
82
|
+
const response = await client.mutate({
|
83
|
+
mutation: gql`
|
84
|
+
mutation importDataKeySets($dataKeySets: [DataKeySetPatch!]!) {
|
85
|
+
importDataKeySets(dataKeySets: $dataKeySets)
|
86
|
+
}
|
87
|
+
`,
|
88
|
+
variables: { dataKeySets: this.dataKeySets }
|
89
|
+
})
|
90
|
+
|
91
|
+
if (response.errors?.length) return
|
92
|
+
|
93
|
+
this.dispatchEvent(new CustomEvent('imported'))
|
94
|
+
}
|
95
|
+
}
|