@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
@@ -4,17 +4,26 @@ import './data-key-item-list'
|
|
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'
|
7
8
|
import { connect } from 'pwa-helpers/connect-mixin'
|
8
9
|
|
10
|
+
import {
|
11
|
+
getEditor,
|
12
|
+
getRenderer,
|
13
|
+
ColumnConfig,
|
14
|
+
DataGrist,
|
15
|
+
FetchOption,
|
16
|
+
SortersControl,
|
17
|
+
GristData,
|
18
|
+
GristRecord
|
19
|
+
} from '@operato/data-grist'
|
9
20
|
import { client } from '@operato/graphql'
|
10
21
|
import { i18next, localize } from '@operato/i18n'
|
11
22
|
import { notify, openPopup } from '@operato/layout'
|
12
23
|
import { navigate, PageView, store } from '@operato/shell'
|
13
24
|
import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
14
|
-
import { isMobileDevice } from '@operato/utils'
|
15
|
-
import {
|
16
|
-
|
17
|
-
import { getEditor, getRenderer } from '@operato/data-grist'
|
25
|
+
import { isMobileDevice, encodeUrlParams } from '@operato/utils'
|
26
|
+
import { OxPopup } from '@operato/popup'
|
18
27
|
|
19
28
|
const REPORT_TYPES = [
|
20
29
|
{
|
@@ -29,6 +38,10 @@ const REPORT_TYPES = [
|
|
29
38
|
display: 'Embed',
|
30
39
|
value: 'embed'
|
31
40
|
},
|
41
|
+
{
|
42
|
+
display: 'CustomElement',
|
43
|
+
value: 'custom-element'
|
44
|
+
},
|
32
45
|
{
|
33
46
|
display: 'Page',
|
34
47
|
value: 'page'
|
@@ -46,34 +59,44 @@ const REPORT_TYPES = [
|
|
46
59
|
value: 'shiny'
|
47
60
|
}
|
48
61
|
]
|
62
|
+
|
63
|
+
@customElement('data-key-set-list-page')
|
49
64
|
export class DataKeySetListPage extends connect(store)(localize(i18next)(PageView)) {
|
50
|
-
static
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
65
|
+
static styles = [
|
66
|
+
ScrollbarStyles,
|
67
|
+
CommonGristStyles,
|
68
|
+
css`
|
69
|
+
:host {
|
70
|
+
display: flex;
|
56
71
|
|
57
|
-
|
58
|
-
return [
|
59
|
-
ScrollbarStyles,
|
60
|
-
CommonGristStyles,
|
61
|
-
css`
|
62
|
-
:host {
|
63
|
-
display: flex;
|
72
|
+
width: 100%;
|
64
73
|
|
65
|
-
|
74
|
+
--grid-record-emphasized-background-color: red;
|
75
|
+
--grid-record-emphasized-color: yellow;
|
76
|
+
}
|
77
|
+
`
|
78
|
+
]
|
66
79
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
}
|
80
|
+
@state() gristConfig: any
|
81
|
+
@state() mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'
|
82
|
+
|
83
|
+
@query('ox-grist') private grist!: DataGrist
|
84
|
+
@query('#sorter-control') private sortersControl!: OxPopup
|
73
85
|
|
74
86
|
get context() {
|
75
87
|
return {
|
76
|
-
|
88
|
+
search: {
|
89
|
+
handler: (search: string) => {
|
90
|
+
this.grist.searchText = search
|
91
|
+
},
|
92
|
+
placeholder: i18next.t('title.data-key-set list'),
|
93
|
+
value: this.grist.searchText
|
94
|
+
},
|
95
|
+
filter: {
|
96
|
+
handler: () => {
|
97
|
+
this.grist.toggleHeadroom()
|
98
|
+
}
|
99
|
+
},
|
77
100
|
help: 'dataset/data-key-set',
|
78
101
|
actions: [
|
79
102
|
{
|
@@ -104,7 +127,7 @@ export class DataKeySetListPage extends connect(store)(localize(i18next)(PageVie
|
|
104
127
|
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
|
105
128
|
<div slot="headroom">
|
106
129
|
<div id="filters">
|
107
|
-
<ox-filters-form autofocus></ox-filters-form>
|
130
|
+
<ox-filters-form autofocus without-search></ox-filters-form>
|
108
131
|
</div>
|
109
132
|
|
110
133
|
<div id="sorters">
|
@@ -112,7 +135,7 @@ export class DataKeySetListPage extends connect(store)(localize(i18next)(PageVie
|
|
112
135
|
<mwc-icon
|
113
136
|
@click=${e => {
|
114
137
|
const target = e.currentTarget
|
115
|
-
this.
|
138
|
+
this.sortersControl.open({
|
116
139
|
right: 0,
|
117
140
|
top: target.offsetTop + target.offsetHeight
|
118
141
|
})
|
@@ -134,10 +157,6 @@ export class DataKeySetListPage extends connect(store)(localize(i18next)(PageVie
|
|
134
157
|
`
|
135
158
|
}
|
136
159
|
|
137
|
-
get grist() {
|
138
|
-
return this.renderRoot.querySelector('ox-grist')
|
139
|
-
}
|
140
|
-
|
141
160
|
async pageInitialized(lifecycle) {
|
142
161
|
this.gristConfig = {
|
143
162
|
list: {
|
@@ -190,6 +209,8 @@ export class DataKeySetListPage extends connect(store)(localize(i18next)(PageVie
|
|
190
209
|
switch (reportType) {
|
191
210
|
case 'generated':
|
192
211
|
break
|
212
|
+
case 'custom-element':
|
213
|
+
break
|
193
214
|
case 'page':
|
194
215
|
break
|
195
216
|
case 'embed':
|
@@ -312,7 +333,7 @@ export class DataKeySetListPage extends connect(store)(localize(i18next)(PageVie
|
|
312
333
|
}
|
313
334
|
}
|
314
335
|
|
315
|
-
async fetchHandler({ page, limit, sortings = [], filters = [] }) {
|
336
|
+
async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {
|
316
337
|
const response = await client.query({
|
317
338
|
query: gql`
|
318
339
|
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
@@ -382,7 +403,7 @@ export class DataKeySetListPage extends connect(store)(localize(i18next)(PageVie
|
|
382
403
|
let patches = this.grist.dirtyRecords
|
383
404
|
if (patches && patches.length) {
|
384
405
|
patches = patches.map(patch => {
|
385
|
-
let patchField = patch.id ? { id: patch.id } : {}
|
406
|
+
let patchField: any = patch.id ? { id: patch.id } : {}
|
386
407
|
const dirtyFields = patch.__dirtyfields__
|
387
408
|
for (let key in dirtyFields) {
|
388
409
|
patchField[key] = dirtyFields[key].after
|
@@ -448,5 +469,3 @@ export class DataKeySetListPage extends connect(store)(localize(i18next)(PageVie
|
|
448
469
|
}
|
449
470
|
}
|
450
471
|
}
|
451
|
-
|
452
|
-
window.customElements.define('data-key-set-list-page', DataKeySetListPage)
|
@@ -3,47 +3,67 @@ import './data-ooc-view.js'
|
|
3
3
|
|
4
4
|
import gql from 'graphql-tag'
|
5
5
|
import { css, html } from 'lit'
|
6
|
+
import { customElement, property, query, state } from 'lit/decorators.js'
|
6
7
|
import { connect } from 'pwa-helpers/connect-mixin'
|
7
8
|
|
9
|
+
import {
|
10
|
+
getEditor,
|
11
|
+
getRenderer,
|
12
|
+
ColumnConfig,
|
13
|
+
DataGrist,
|
14
|
+
FetchOption,
|
15
|
+
SortersControl,
|
16
|
+
GristData,
|
17
|
+
GristRecord
|
18
|
+
} from '@operato/data-grist'
|
8
19
|
import { client } from '@operato/graphql'
|
9
20
|
import { i18next, localize } from '@operato/i18n'
|
10
21
|
import { openPopup } from '@operato/layout'
|
11
22
|
import { PageView, store } from '@operato/shell'
|
12
23
|
import { CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
13
24
|
import { isMobileDevice } from '@operato/utils'
|
25
|
+
import { OxPopup } from '@operato/popup'
|
14
26
|
|
27
|
+
@customElement('data-ooc-list-page')
|
15
28
|
export class DataOocListPage extends connect(store)(localize(i18next)(PageView)) {
|
16
|
-
static
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
29
|
+
static styles = [
|
30
|
+
ScrollbarStyles,
|
31
|
+
CommonGristStyles,
|
32
|
+
css`
|
33
|
+
:host {
|
34
|
+
display: flex;
|
35
|
+
flex-direction: column;
|
23
36
|
|
24
|
-
|
25
|
-
|
26
|
-
ScrollbarStyles,
|
27
|
-
CommonGristStyles,
|
28
|
-
css`
|
29
|
-
:host {
|
30
|
-
display: flex;
|
31
|
-
flex-direction: column;
|
37
|
+
overflow: hidden;
|
38
|
+
}
|
32
39
|
|
33
|
-
|
34
|
-
|
40
|
+
ox-grist {
|
41
|
+
overflow-y: auto;
|
42
|
+
flex: 1;
|
43
|
+
}
|
44
|
+
`
|
45
|
+
]
|
35
46
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
]
|
42
|
-
}
|
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
|
43
52
|
|
44
53
|
get context() {
|
45
54
|
return {
|
46
|
-
|
55
|
+
search: {
|
56
|
+
handler: (search: string) => {
|
57
|
+
this.grist.searchText = search
|
58
|
+
},
|
59
|
+
placeholder: i18next.t('title.data-ooc list'),
|
60
|
+
value: this.grist.searchText
|
61
|
+
},
|
62
|
+
filter: {
|
63
|
+
handler: () => {
|
64
|
+
this.grist.toggleHeadroom()
|
65
|
+
}
|
66
|
+
},
|
47
67
|
help: 'dataset/data-ooc',
|
48
68
|
actions: [
|
49
69
|
// {
|
@@ -71,7 +91,7 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
|
|
71
91
|
>
|
72
92
|
<div slot="headroom">
|
73
93
|
<div id="filters">
|
74
|
-
<ox-filters-form autofocus></ox-filters-form>
|
94
|
+
<ox-filters-form autofocus without-search></ox-filters-form>
|
75
95
|
</div>
|
76
96
|
|
77
97
|
<div id="sorters">
|
@@ -79,7 +99,7 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
|
|
79
99
|
<mwc-icon
|
80
100
|
@click=${e => {
|
81
101
|
const target = e.currentTarget
|
82
|
-
this.
|
102
|
+
this.sortersControl.open({
|
83
103
|
right: 0,
|
84
104
|
top: target.offsetTop + target.offsetHeight
|
85
105
|
})
|
@@ -101,10 +121,6 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
|
|
101
121
|
`
|
102
122
|
}
|
103
123
|
|
104
|
-
get grist() {
|
105
|
-
return this.renderRoot.querySelector('ox-grist')
|
106
|
-
}
|
107
|
-
|
108
124
|
async pageInitialized(lifecycle) {
|
109
125
|
this.gristConfig = {
|
110
126
|
list: {
|
@@ -360,7 +376,7 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
|
|
360
376
|
this.grist.fetch()
|
361
377
|
}
|
362
378
|
|
363
|
-
async fetchHandler({ page, limit, sortings = [], filters = [] }) {
|
379
|
+
async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {
|
364
380
|
const response = await client.query({
|
365
381
|
query: gql`
|
366
382
|
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
@@ -396,7 +412,13 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
|
|
396
412
|
history
|
397
413
|
workDate
|
398
414
|
workShift
|
415
|
+
correctiveInstruction
|
399
416
|
correctiveAction
|
417
|
+
reviewedAt
|
418
|
+
reviewer {
|
419
|
+
id
|
420
|
+
name
|
421
|
+
}
|
400
422
|
correctedAt
|
401
423
|
corrector {
|
402
424
|
id
|
@@ -427,7 +449,7 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
|
|
427
449
|
}
|
428
450
|
|
429
451
|
_exportableData() {
|
430
|
-
let records = []
|
452
|
+
let records = [] as GristRecord
|
431
453
|
if (this.grist.selected && this.grist.selected.length > 0) {
|
432
454
|
records = this.grist.selected
|
433
455
|
} else {
|
@@ -439,7 +461,7 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
|
|
439
461
|
.map(column => {
|
440
462
|
return column.imex === true
|
441
463
|
? {
|
442
|
-
header: column.header.renderer(),
|
464
|
+
header: column.header.renderer(column),
|
443
465
|
key: column.name,
|
444
466
|
width: column.width,
|
445
467
|
type: column.type
|
@@ -465,5 +487,3 @@ export class DataOocListPage extends connect(store)(localize(i18next)(PageView))
|
|
465
487
|
return { header: headerSetting, data: data }
|
466
488
|
}
|
467
489
|
}
|
468
|
-
|
469
|
-
window.customElements.define('data-ooc-list-page', DataOocListPage)
|
@@ -0,0 +1,115 @@
|
|
1
|
+
import gql from 'graphql-tag'
|
2
|
+
|
3
|
+
import { PropertyValues, html, css } from 'lit'
|
4
|
+
import { customElement, property } from 'lit/decorators.js'
|
5
|
+
import { PageView } from '@operato/shell'
|
6
|
+
import { i18next, localize } from '@operato/i18n'
|
7
|
+
import { client } from '@operato/graphql'
|
8
|
+
|
9
|
+
import './data-ooc-view.js'
|
10
|
+
|
11
|
+
@customElement('data-ooc-view-page')
|
12
|
+
export class DataOocViewPage extends localize(i18next)(PageView) {
|
13
|
+
static styles = [
|
14
|
+
css`
|
15
|
+
:host {
|
16
|
+
display: flex;
|
17
|
+
}
|
18
|
+
|
19
|
+
data-ooc-view {
|
20
|
+
flex: 1;
|
21
|
+
}
|
22
|
+
`
|
23
|
+
]
|
24
|
+
|
25
|
+
@property({ type: Object }) dataOoc?: any
|
26
|
+
|
27
|
+
get context() {
|
28
|
+
return {
|
29
|
+
title: i18next.t('title.data-ooc list'),
|
30
|
+
help: 'dataset/data-ooc',
|
31
|
+
actions: []
|
32
|
+
}
|
33
|
+
}
|
34
|
+
|
35
|
+
render() {
|
36
|
+
return html` <data-ooc-view .dataOoc=${this.dataOoc}></data-ooc-view> `
|
37
|
+
}
|
38
|
+
|
39
|
+
updated(changes: PropertyValues<this>) {}
|
40
|
+
|
41
|
+
pageUpdated(changes: any, lifecycle: any, before: any) {
|
42
|
+
if (this.active) {
|
43
|
+
/*
|
44
|
+
* this page is activated
|
45
|
+
*/
|
46
|
+
this.fetchOoc(lifecycle.resourceId)
|
47
|
+
} else {
|
48
|
+
/* this page is deactivated */
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
async fetchOoc(id: string) {
|
53
|
+
const response = await client.query({
|
54
|
+
query: gql`
|
55
|
+
query ($id: String!) {
|
56
|
+
dataOoc(id: $id) {
|
57
|
+
id
|
58
|
+
name
|
59
|
+
description
|
60
|
+
useCase
|
61
|
+
dataSet {
|
62
|
+
id
|
63
|
+
name
|
64
|
+
}
|
65
|
+
key01
|
66
|
+
key02
|
67
|
+
key03
|
68
|
+
key04
|
69
|
+
key05
|
70
|
+
partitionKeys
|
71
|
+
dataItems {
|
72
|
+
name
|
73
|
+
description
|
74
|
+
tag
|
75
|
+
unit
|
76
|
+
spec
|
77
|
+
}
|
78
|
+
data
|
79
|
+
rawData
|
80
|
+
judgment
|
81
|
+
ooc
|
82
|
+
oos
|
83
|
+
state
|
84
|
+
history
|
85
|
+
workDate
|
86
|
+
workShift
|
87
|
+
correctiveInstruction
|
88
|
+
correctiveAction
|
89
|
+
reviewedAt
|
90
|
+
reviewer {
|
91
|
+
id
|
92
|
+
name
|
93
|
+
}
|
94
|
+
correctedAt
|
95
|
+
corrector {
|
96
|
+
id
|
97
|
+
name
|
98
|
+
}
|
99
|
+
updater {
|
100
|
+
id
|
101
|
+
name
|
102
|
+
}
|
103
|
+
updatedAt
|
104
|
+
collectedAt
|
105
|
+
}
|
106
|
+
}
|
107
|
+
`,
|
108
|
+
variables: {
|
109
|
+
id
|
110
|
+
}
|
111
|
+
})
|
112
|
+
|
113
|
+
this.dataOoc = response.data.dataOoc
|
114
|
+
}
|
115
|
+
}
|
@@ -0,0 +1,124 @@
|
|
1
|
+
import '@operato/dataset/ox-data-ooc-brief-view.js'
|
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, localize } from '@operato/i18n'
|
9
|
+
import { ScrollbarStyles } from '@operato/styles'
|
10
|
+
import { DataSet } from '@operato/dataset'
|
11
|
+
|
12
|
+
@customElement('data-ooc-view')
|
13
|
+
export class DataOocView extends localize(i18next)(LitElement) {
|
14
|
+
static styles = [
|
15
|
+
ScrollbarStyles,
|
16
|
+
css`
|
17
|
+
:host {
|
18
|
+
display: flex;
|
19
|
+
flex-direction: column;
|
20
|
+
|
21
|
+
background-color: #fff;
|
22
|
+
}
|
23
|
+
|
24
|
+
div[content] {
|
25
|
+
flex: 1;
|
26
|
+
|
27
|
+
display: flex;
|
28
|
+
overflow: auto;
|
29
|
+
}
|
30
|
+
|
31
|
+
ox-data-ooc-brief-view {
|
32
|
+
flex: 1;
|
33
|
+
padding: var(--padding-wide);
|
34
|
+
overflow: auto;
|
35
|
+
}
|
36
|
+
|
37
|
+
label[comment] {
|
38
|
+
display: flex;
|
39
|
+
flex-direction: column;
|
40
|
+
|
41
|
+
padding: var(--padding-wide);
|
42
|
+
}
|
43
|
+
|
44
|
+
label[comment] div {
|
45
|
+
display: flex;
|
46
|
+
}
|
47
|
+
|
48
|
+
mwc-icon {
|
49
|
+
color: var(--status-danger-color);
|
50
|
+
}
|
51
|
+
|
52
|
+
textarea {
|
53
|
+
border: var(--input-field-border);
|
54
|
+
border-radius: var(--input-border-radius);
|
55
|
+
padding: var(--input-field-padding);
|
56
|
+
font: var(--input-field-font);
|
57
|
+
}
|
58
|
+
|
59
|
+
.button-container {
|
60
|
+
display: flex;
|
61
|
+
margin-left: auto;
|
62
|
+
padding: var(--padding-default);
|
63
|
+
}
|
64
|
+
`
|
65
|
+
]
|
66
|
+
|
67
|
+
@property({ type: Object }) dataOoc?: any
|
68
|
+
|
69
|
+
@state() dataSet?: DataSet
|
70
|
+
|
71
|
+
@query('textarea') commentTextArea!: HTMLTextAreaElement
|
72
|
+
@query('ox-data-ooc-brief-view') sampleView!: HTMLTextAreaElement
|
73
|
+
|
74
|
+
render() {
|
75
|
+
const state = this.dataOoc?.state
|
76
|
+
|
77
|
+
return html`
|
78
|
+
<div content>
|
79
|
+
<ox-data-ooc-brief-view .dataSet=${this.dataSet} .dataOoc=${this.dataOoc}></ox-data-ooc-brief-view>
|
80
|
+
</div>
|
81
|
+
`
|
82
|
+
}
|
83
|
+
|
84
|
+
updated(changes) {
|
85
|
+
if (changes.has('dataOoc')) {
|
86
|
+
this.fetchDataSet()
|
87
|
+
}
|
88
|
+
}
|
89
|
+
|
90
|
+
async fetchDataSet() {
|
91
|
+
const id = this.dataOoc?.dataSet?.id
|
92
|
+
|
93
|
+
if (id) {
|
94
|
+
const response = await client.query({
|
95
|
+
query: gql`
|
96
|
+
query ($id: String!) {
|
97
|
+
dataSet(id: $id) {
|
98
|
+
id
|
99
|
+
name
|
100
|
+
description
|
101
|
+
useCase
|
102
|
+
dataItems {
|
103
|
+
name
|
104
|
+
description
|
105
|
+
active
|
106
|
+
tag
|
107
|
+
type
|
108
|
+
unit
|
109
|
+
options
|
110
|
+
quota
|
111
|
+
spec
|
112
|
+
}
|
113
|
+
}
|
114
|
+
}
|
115
|
+
`,
|
116
|
+
variables: {
|
117
|
+
id: this.dataOoc?.dataSet?.id
|
118
|
+
}
|
119
|
+
})
|
120
|
+
|
121
|
+
this.dataSet = response.data.dataSet
|
122
|
+
}
|
123
|
+
}
|
124
|
+
}
|
@@ -6,41 +6,34 @@ import '@operato/data-grist'
|
|
6
6
|
import '@things-factory/form-ui'
|
7
7
|
|
8
8
|
import { css, html } from 'lit'
|
9
|
+
import { customElement, property, query, state } from 'lit/decorators.js'
|
9
10
|
|
11
|
+
import { PageView } from '@operato/shell'
|
10
12
|
import { i18next, localize } from '@operato/i18n'
|
11
13
|
import { CommonButtonStyles, ScrollbarStyles } from '@operato/styles'
|
12
|
-
import {
|
13
|
-
import { encodeUrlParams, getCookie } from '@things-factory/utils'
|
14
|
+
import { encodeUrlParams } from '@operato/utils'
|
14
15
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
16
|
+
@customElement('data-report-embed-page')
|
17
|
+
export class DataReportEmbedPage extends localize(i18next)(PageView) {
|
18
|
+
static styles = [
|
19
|
+
ScrollbarStyles,
|
20
|
+
css`
|
21
|
+
:host {
|
22
|
+
display: flex;
|
23
|
+
flex-direction: column;
|
24
|
+
padding: 0;
|
25
|
+
}
|
24
26
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
:
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
}
|
27
|
+
#container {
|
28
|
+
flex: 1;
|
29
|
+
padding: 0;
|
30
|
+
margin: 0;
|
31
|
+
border: 0;
|
32
|
+
}
|
33
|
+
`
|
34
|
+
]
|
34
35
|
|
35
|
-
|
36
|
-
flex: 1;
|
37
|
-
padding: 0;
|
38
|
-
margin: 0;
|
39
|
-
border: 0;
|
40
|
-
}
|
41
|
-
`
|
42
|
-
]
|
43
|
-
}
|
36
|
+
@query('iframe') iframe!: HTMLIFrameElement
|
44
37
|
|
45
38
|
get context() {
|
46
39
|
const filters = [
|
@@ -55,7 +48,7 @@ class DataReportEmbedPage extends localize(i18next)(PageView) {
|
|
55
48
|
{
|
56
49
|
title: i18next.t('button.print'),
|
57
50
|
action: () => {
|
58
|
-
this.
|
51
|
+
this.iframe.contentWindow?.print()
|
59
52
|
},
|
60
53
|
...CommonButtonStyles.print
|
61
54
|
}
|
@@ -76,7 +69,7 @@ class DataReportEmbedPage extends localize(i18next)(PageView) {
|
|
76
69
|
}}
|
77
70
|
?url-params-sensitive=${this.active}
|
78
71
|
></ox-filters-form-base>
|
79
|
-
<iframe
|
72
|
+
<iframe frameborder="0" style="border:0"></iframe>
|
80
73
|
`
|
81
74
|
}
|
82
75
|
|
@@ -110,8 +103,6 @@ class DataReportEmbedPage extends localize(i18next)(PageView) {
|
|
110
103
|
|
111
104
|
const encodedUrlParams = encodeUrlParams(urlParams)
|
112
105
|
|
113
|
-
this.
|
106
|
+
this.iframe.src = `/data-report/${reportType}/?${encodedUrlParams}`
|
114
107
|
}
|
115
108
|
}
|
116
|
-
|
117
|
-
window.customElements.define('data-report-embed-page', DataReportEmbedPage)
|