@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
@@ -0,0 +1,96 @@
|
|
1
|
+
import '@operato/data-grist'
|
2
|
+
|
3
|
+
import gql from 'graphql-tag'
|
4
|
+
import { css, html, LitElement } from 'lit'
|
5
|
+
import { customElement, property, 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
|
+
import { DataSet } from '@operato/dataset'
|
11
|
+
|
12
|
+
@customElement('data-set-importer')
|
13
|
+
export class DataSetImporter extends LitElement {
|
14
|
+
static styles = [
|
15
|
+
css`
|
16
|
+
:host {
|
17
|
+
display: flex;
|
18
|
+
flex-direction: column;
|
19
|
+
|
20
|
+
background-color: #fff;
|
21
|
+
}
|
22
|
+
|
23
|
+
ox-grist {
|
24
|
+
flex: 1;
|
25
|
+
}
|
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
|
+
`
|
37
|
+
]
|
38
|
+
|
39
|
+
@property({ type: Array }) dataSets: DataSet[] = []
|
40
|
+
|
41
|
+
@state() columns: any = {
|
42
|
+
list: { fields: ['name', 'description'] },
|
43
|
+
pagination: { infinite: true },
|
44
|
+
columns: [
|
45
|
+
{
|
46
|
+
type: 'string',
|
47
|
+
name: 'name',
|
48
|
+
header: i18next.t('field.name'),
|
49
|
+
width: 150
|
50
|
+
},
|
51
|
+
{
|
52
|
+
type: 'string',
|
53
|
+
name: 'description',
|
54
|
+
header: i18next.t('field.description'),
|
55
|
+
width: 200
|
56
|
+
},
|
57
|
+
{
|
58
|
+
type: 'checkbox',
|
59
|
+
name: 'active',
|
60
|
+
header: i18next.t('field.active'),
|
61
|
+
width: 60
|
62
|
+
}
|
63
|
+
]
|
64
|
+
}
|
65
|
+
|
66
|
+
render() {
|
67
|
+
return html`
|
68
|
+
<ox-grist
|
69
|
+
.mode=${isMobileDevice() ? 'LIST' : 'GRID'}
|
70
|
+
.config=${this.columns}
|
71
|
+
.data=${{ records: this.dataSets }}
|
72
|
+
></ox-grist>
|
73
|
+
|
74
|
+
<div class="button-container">
|
75
|
+
<mwc-button raised @click=${this.save.bind(this)}>${i18next.t('button.save')}</mwc-button>
|
76
|
+
</div>
|
77
|
+
`
|
78
|
+
}
|
79
|
+
|
80
|
+
async save() {
|
81
|
+
const response = await client.mutate({
|
82
|
+
mutation: gql`
|
83
|
+
mutation importDataSets($dataSets: [DataSetPatch!]!) {
|
84
|
+
importDataSets(dataSets: $dataSets)
|
85
|
+
}
|
86
|
+
`,
|
87
|
+
variables: { dataSets: this.dataSets }
|
88
|
+
})
|
89
|
+
|
90
|
+
if (response.errors?.length) {
|
91
|
+
return
|
92
|
+
}
|
93
|
+
|
94
|
+
this.dispatchEvent(new CustomEvent('imported'))
|
95
|
+
}
|
96
|
+
}
|
@@ -3,12 +3,21 @@ import './data-item-list.js'
|
|
3
3
|
import './data-set-importer.js'
|
4
4
|
import '../../components/data-entry-form.js'
|
5
5
|
|
6
|
+
import moment from 'moment-timezone'
|
6
7
|
import gql from 'graphql-tag'
|
7
8
|
import { css, html } from 'lit'
|
8
|
-
import
|
9
|
+
import { customElement, property, query, state } from 'lit/decorators.js'
|
9
10
|
import { connect } from 'pwa-helpers/connect-mixin'
|
10
11
|
|
11
|
-
import {
|
12
|
+
import {
|
13
|
+
getEditor,
|
14
|
+
getRenderer,
|
15
|
+
ColumnConfig,
|
16
|
+
DataGrist,
|
17
|
+
FetchOption,
|
18
|
+
SortersControl,
|
19
|
+
ImexConfig
|
20
|
+
} from '@operato/data-grist'
|
12
21
|
import { OxDataUseCase } from '@operato/dataset'
|
13
22
|
import { client } from '@operato/graphql'
|
14
23
|
import { i18next, localize } from '@operato/i18n'
|
@@ -16,6 +25,7 @@ import { notify, openPopup } from '@operato/layout'
|
|
16
25
|
import { PageView, store } from '@operato/shell'
|
17
26
|
import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'
|
18
27
|
import { isMobileDevice } from '@operato/utils'
|
28
|
+
import { OxPopup } from '@operato/popup'
|
19
29
|
|
20
30
|
const DEFAULT_TZ = Intl.DateTimeFormat().resolvedOptions().timeZone
|
21
31
|
const TIMEZONE_OPTIONS = ['', DEFAULT_TZ, ...moment.tz.names().filter(tz => tz !== DEFAULT_TZ)]
|
@@ -33,6 +43,10 @@ const ENTRY_TYPES = [
|
|
33
43
|
display: 'Board',
|
34
44
|
value: 'board'
|
35
45
|
},
|
46
|
+
{
|
47
|
+
display: 'CustomElement',
|
48
|
+
value: 'custom-element'
|
49
|
+
},
|
36
50
|
{
|
37
51
|
display: 'Page',
|
38
52
|
value: 'page'
|
@@ -56,6 +70,10 @@ const MONITOR_TYPES = [
|
|
56
70
|
display: 'Board',
|
57
71
|
value: 'board'
|
58
72
|
},
|
73
|
+
{
|
74
|
+
display: 'CustomElement',
|
75
|
+
value: 'custom-element'
|
76
|
+
},
|
59
77
|
{
|
60
78
|
display: 'Page',
|
61
79
|
value: 'page'
|
@@ -79,6 +97,10 @@ const REPORT_TYPES = [
|
|
79
97
|
display: 'Embed',
|
80
98
|
value: 'embed'
|
81
99
|
},
|
100
|
+
{
|
101
|
+
display: 'CustomElement',
|
102
|
+
value: 'custom-element'
|
103
|
+
},
|
82
104
|
{
|
83
105
|
display: 'Page',
|
84
106
|
value: 'page'
|
@@ -105,34 +127,44 @@ const USECASE_OPTIONS = () => {
|
|
105
127
|
}
|
106
128
|
})
|
107
129
|
}
|
130
|
+
|
131
|
+
@customElement('data-set-list-page')
|
108
132
|
export class DataSetListPage extends connect(store)(localize(i18next)(PageView)) {
|
109
|
-
static
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
133
|
+
static styles = [
|
134
|
+
ScrollbarStyles,
|
135
|
+
CommonGristStyles,
|
136
|
+
css`
|
137
|
+
:host {
|
138
|
+
display: flex;
|
139
|
+
|
140
|
+
width: 100%;
|
115
141
|
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
:host {
|
122
|
-
display: flex;
|
142
|
+
--grid-record-emphasized-background-color: red;
|
143
|
+
--grid-record-emphasized-color: yellow;
|
144
|
+
}
|
145
|
+
`
|
146
|
+
]
|
123
147
|
|
124
|
-
|
148
|
+
@state() gristConfig: any
|
149
|
+
@state() mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'
|
125
150
|
|
126
|
-
|
127
|
-
|
128
|
-
}
|
129
|
-
`
|
130
|
-
]
|
131
|
-
}
|
151
|
+
@query('ox-grist') private grist!: DataGrist
|
152
|
+
@query('#sorter-control') private sortersControl!: OxPopup
|
132
153
|
|
133
154
|
get context() {
|
134
155
|
return {
|
135
|
-
|
156
|
+
search: {
|
157
|
+
handler: (search: string) => {
|
158
|
+
this.grist.searchText = search
|
159
|
+
},
|
160
|
+
placeholder: i18next.t('title.data-set list'),
|
161
|
+
value: this.grist.searchText
|
162
|
+
},
|
163
|
+
filter: {
|
164
|
+
handler: () => {
|
165
|
+
this.grist.toggleHeadroom()
|
166
|
+
}
|
167
|
+
},
|
136
168
|
help: 'dataset/data-set',
|
137
169
|
actions: [
|
138
170
|
{
|
@@ -162,7 +194,7 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
|
|
162
194
|
}
|
163
195
|
|
164
196
|
render() {
|
165
|
-
const mode = this.mode || (isMobileDevice() ? '
|
197
|
+
const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID')
|
166
198
|
|
167
199
|
return html`
|
168
200
|
<ox-grist
|
@@ -173,7 +205,7 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
|
|
173
205
|
>
|
174
206
|
<div slot="headroom">
|
175
207
|
<div id="filters">
|
176
|
-
<ox-filters-form autofocus></ox-filters-form>
|
208
|
+
<ox-filters-form autofocus without-search></ox-filters-form>
|
177
209
|
</div>
|
178
210
|
|
179
211
|
<div id="sorters">
|
@@ -181,7 +213,7 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
|
|
181
213
|
<mwc-icon
|
182
214
|
@click=${e => {
|
183
215
|
const target = e.currentTarget
|
184
|
-
this.
|
216
|
+
this.sortersControl.open({
|
185
217
|
right: 0,
|
186
218
|
top: target.offsetTop + target.offsetHeight
|
187
219
|
})
|
@@ -203,10 +235,6 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
|
|
203
235
|
`
|
204
236
|
}
|
205
237
|
|
206
|
-
get grist() {
|
207
|
-
return this.renderRoot.querySelector('ox-grist')
|
208
|
-
}
|
209
|
-
|
210
238
|
async pageInitialized(lifecycle) {
|
211
239
|
this.gristConfig = {
|
212
240
|
list: {
|
@@ -216,6 +244,24 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
|
|
216
244
|
columns: [
|
217
245
|
{ type: 'gutter', gutterName: 'sequence' },
|
218
246
|
{ type: 'gutter', gutterName: 'row-selector', multiple: true },
|
247
|
+
{
|
248
|
+
type: 'gutter',
|
249
|
+
gutterName: 'button',
|
250
|
+
icon: record => (!record || !record.name ? '' : record.schedulerHandle ? 'pause' : 'play_arrow'),
|
251
|
+
handlers: {
|
252
|
+
click: (columns, data, column, record, rowIndex) => {
|
253
|
+
if (!record || !record.name) {
|
254
|
+
/* TODO record가 새로 추가된 것이면 리턴하도록 한다. */
|
255
|
+
return
|
256
|
+
}
|
257
|
+
if (record.schedulerHandle) {
|
258
|
+
this.stopDataCollectionSchedule(record)
|
259
|
+
} else {
|
260
|
+
this.startDataCollectionSchedule(record)
|
261
|
+
}
|
262
|
+
}
|
263
|
+
}
|
264
|
+
},
|
219
265
|
{
|
220
266
|
type: 'gutter',
|
221
267
|
gutterName: 'button',
|
@@ -355,7 +401,6 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
|
|
355
401
|
queryName: 'dataKeySets'
|
356
402
|
}
|
357
403
|
},
|
358
|
-
sortable: true,
|
359
404
|
filter: false,
|
360
405
|
width: 120
|
361
406
|
},
|
@@ -383,7 +428,6 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
|
|
383
428
|
}
|
384
429
|
},
|
385
430
|
width: 80,
|
386
|
-
label: true,
|
387
431
|
imex: {
|
388
432
|
width: 13,
|
389
433
|
header: i18next.t('field.schedule'),
|
@@ -419,7 +463,6 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
|
|
419
463
|
queryName: 'roles'
|
420
464
|
}
|
421
465
|
},
|
422
|
-
sortable: true,
|
423
466
|
filter: false,
|
424
467
|
width: 120
|
425
468
|
},
|
@@ -434,7 +477,24 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
|
|
434
477
|
queryName: 'roles'
|
435
478
|
}
|
436
479
|
},
|
437
|
-
|
480
|
+
width: 120
|
481
|
+
},
|
482
|
+
{
|
483
|
+
type: 'assignees',
|
484
|
+
name: 'assignees',
|
485
|
+
header: i18next.t('field.assignees'),
|
486
|
+
record: {
|
487
|
+
editable: true
|
488
|
+
},
|
489
|
+
width: 120
|
490
|
+
},
|
491
|
+
{
|
492
|
+
type: 'approval-line',
|
493
|
+
name: 'approvalLine',
|
494
|
+
header: i18next.t('field.approval-line'),
|
495
|
+
record: {
|
496
|
+
editable: true
|
497
|
+
},
|
438
498
|
width: 120
|
439
499
|
},
|
440
500
|
{
|
@@ -537,7 +597,6 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
|
|
537
597
|
record: {
|
538
598
|
editable: false
|
539
599
|
},
|
540
|
-
sortable: true,
|
541
600
|
width: 120
|
542
601
|
},
|
543
602
|
{
|
@@ -564,7 +623,7 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
|
|
564
623
|
}
|
565
624
|
}
|
566
625
|
|
567
|
-
async fetchHandler({ page, limit, sortings = [], filters = [] }) {
|
626
|
+
async fetchHandler({ page, limit, sortings = [], filters = [] }: FetchOption) {
|
568
627
|
const response = await client.query({
|
569
628
|
query: gql`
|
570
629
|
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
@@ -579,6 +638,7 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
|
|
579
638
|
useCase
|
580
639
|
schedule
|
581
640
|
timezone
|
641
|
+
schedulerHandle
|
582
642
|
dataKeySet {
|
583
643
|
id
|
584
644
|
name
|
@@ -591,6 +651,26 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
|
|
591
651
|
id
|
592
652
|
name
|
593
653
|
}
|
654
|
+
assignees {
|
655
|
+
type
|
656
|
+
value
|
657
|
+
assignee {
|
658
|
+
id
|
659
|
+
name
|
660
|
+
description
|
661
|
+
controlNo
|
662
|
+
}
|
663
|
+
}
|
664
|
+
approvalLine {
|
665
|
+
type
|
666
|
+
value
|
667
|
+
approver {
|
668
|
+
id
|
669
|
+
name
|
670
|
+
description
|
671
|
+
controlNo
|
672
|
+
}
|
673
|
+
}
|
594
674
|
entryType
|
595
675
|
entryView
|
596
676
|
monitorType
|
@@ -685,7 +765,7 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
|
|
685
765
|
let patches = this.grist.dirtyRecords
|
686
766
|
if (patches && patches.length) {
|
687
767
|
patches = patches.map(patch => {
|
688
|
-
let patchField = patch.id ? { id: patch.id } : {}
|
768
|
+
let patchField: any = patch.id ? { id: patch.id } : {}
|
689
769
|
const dirtyFields = patch.__dirtyfields__
|
690
770
|
for (let key in dirtyFields) {
|
691
771
|
patchField[key] = dirtyFields[key].after
|
@@ -720,6 +800,60 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
|
|
720
800
|
}
|
721
801
|
}
|
722
802
|
|
803
|
+
async startDataCollectionSchedule(record) {
|
804
|
+
var response = await client.mutate({
|
805
|
+
mutation: gql`
|
806
|
+
mutation ($dataSetId: String!) {
|
807
|
+
startDataCollectionSchedule(dataSetId: $dataSetId) {
|
808
|
+
schedulerHandle
|
809
|
+
}
|
810
|
+
}
|
811
|
+
`,
|
812
|
+
variables: {
|
813
|
+
dataSetId: record.id
|
814
|
+
}
|
815
|
+
})
|
816
|
+
|
817
|
+
const schedulerHandle = response.data.startDataCollectionSchedule.schedulerHandle
|
818
|
+
record.schedulerHandle = schedulerHandle
|
819
|
+
|
820
|
+
notify({
|
821
|
+
level: 'info',
|
822
|
+
message: `${record.schedulerHandle ? 'success' : 'fail'} to start data collection schedule : ${record.name}`
|
823
|
+
})
|
824
|
+
|
825
|
+
this.grist.fetch()
|
826
|
+
}
|
827
|
+
|
828
|
+
async stopDataCollectionSchedule(record) {
|
829
|
+
var response = await client.mutate({
|
830
|
+
mutation: gql`
|
831
|
+
mutation ($dataSetId: String!) {
|
832
|
+
stopDataCollectionSchedule(dataSetId: $dataSetId) {
|
833
|
+
schedulerHandle
|
834
|
+
}
|
835
|
+
}
|
836
|
+
`,
|
837
|
+
variables: {
|
838
|
+
dataSetId: record.id
|
839
|
+
}
|
840
|
+
})
|
841
|
+
|
842
|
+
if (!response.errors) {
|
843
|
+
notify({
|
844
|
+
level: 'info',
|
845
|
+
message: `success to stop data collection schedule : ${record.name}`
|
846
|
+
})
|
847
|
+
} else {
|
848
|
+
notify({
|
849
|
+
level: 'error',
|
850
|
+
message: `${response.errors.map(error => error.message).join('\n')}`
|
851
|
+
})
|
852
|
+
}
|
853
|
+
|
854
|
+
this.grist.fetch()
|
855
|
+
}
|
856
|
+
|
723
857
|
async exportHandler() {
|
724
858
|
var headerSetting = this.grist._config.columns
|
725
859
|
.filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)
|
@@ -735,7 +869,8 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
|
|
735
869
|
...this.grist._config.columns
|
736
870
|
.filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)
|
737
871
|
.reduce((record, column) => {
|
738
|
-
|
872
|
+
var imexKey = (column.imex as ImexConfig)!.key
|
873
|
+
record[imexKey] = imexKey
|
739
874
|
.split('.')
|
740
875
|
.reduce((obj, key) => (obj && obj[key] !== 'undefined' ? obj[key] : undefined), item)
|
741
876
|
return record
|
@@ -764,5 +899,3 @@ export class DataSetListPage extends connect(store)(localize(i18next)(PageView))
|
|
764
899
|
)
|
765
900
|
}
|
766
901
|
}
|
767
|
-
|
768
|
-
window.customElements.define('data-set-list-page', DataSetListPage)
|
@@ -20,6 +20,10 @@ export default function route(page) {
|
|
20
20
|
import('./pages/data-report/data-report-samples-page.js')
|
21
21
|
return page
|
22
22
|
|
23
|
+
case 'data-ooc':
|
24
|
+
import('./pages/data-ooc/data-ooc-view-page.js')
|
25
|
+
return page
|
26
|
+
|
23
27
|
case 'data-ooc-list':
|
24
28
|
import('./pages/data-ooc/data-ooc-list-page.js')
|
25
29
|
return page
|
@@ -31,7 +35,7 @@ export default function route(page) {
|
|
31
35
|
case 'data-report-list':
|
32
36
|
import('./pages/data-report/data-report-list-page.js')
|
33
37
|
return page
|
34
|
-
|
38
|
+
|
35
39
|
case 'data-archive-list':
|
36
40
|
import('./pages/data-archive/data-archive-list-page.js')
|
37
41
|
return page
|
@@ -1,34 +1,34 @@
|
|
1
1
|
module.exports = {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
2
|
+
dataArchive: {
|
3
|
+
dataset: {
|
4
|
+
endpoint: {
|
5
|
+
host: 'localhost',
|
6
|
+
port: 80
|
7
|
+
},
|
8
|
+
datasource: {
|
9
|
+
database: ''
|
10
|
+
}
|
11
|
+
}
|
12
|
+
},
|
13
|
+
dataReport: {
|
14
|
+
jasper: {
|
15
|
+
endpoint: {
|
16
|
+
host: 'localhost',
|
17
|
+
port: 8090
|
18
|
+
},
|
19
|
+
datasource: {
|
20
|
+
database: ''
|
21
|
+
},
|
22
|
+
method: 'POST'
|
12
23
|
},
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
},
|
22
|
-
method: 'POST'
|
23
|
-
},
|
24
|
-
shiny: {
|
25
|
-
endpoint: {
|
26
|
-
host: 'localhost',
|
27
|
-
port: 3838
|
28
|
-
},
|
29
|
-
datasource: {
|
30
|
-
database: ''
|
31
|
-
}
|
32
|
-
}
|
24
|
+
shiny: {
|
25
|
+
endpoint: {
|
26
|
+
host: 'localhost',
|
27
|
+
port: 3838
|
28
|
+
},
|
29
|
+
datasource: {
|
30
|
+
database: ''
|
31
|
+
}
|
33
32
|
}
|
33
|
+
}
|
34
34
|
}
|
@@ -1,34 +1,34 @@
|
|
1
1
|
module.exports = {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
2
|
+
dataArchive: {
|
3
|
+
dataset: {
|
4
|
+
endpoint: {
|
5
|
+
host: 'localhost',
|
6
|
+
port: 80
|
7
|
+
},
|
8
|
+
datasource: {
|
9
|
+
database: ''
|
10
|
+
}
|
11
|
+
}
|
12
|
+
},
|
13
|
+
dataReport: {
|
14
|
+
jasper: {
|
15
|
+
endpoint: {
|
16
|
+
host: 'localhost',
|
17
|
+
port: 8090
|
18
|
+
},
|
19
|
+
datasource: {
|
20
|
+
database: ''
|
21
|
+
},
|
22
|
+
method: 'POST'
|
12
23
|
},
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
},
|
22
|
-
method: 'POST'
|
23
|
-
},
|
24
|
-
shiny: {
|
25
|
-
endpoint: {
|
26
|
-
host: 'localhost',
|
27
|
-
port: 3838
|
28
|
-
},
|
29
|
-
datasource: {
|
30
|
-
database: ''
|
31
|
-
}
|
32
|
-
}
|
24
|
+
shiny: {
|
25
|
+
endpoint: {
|
26
|
+
host: 'localhost',
|
27
|
+
port: 3838
|
28
|
+
},
|
29
|
+
datasource: {
|
30
|
+
database: ''
|
31
|
+
}
|
33
32
|
}
|
34
|
-
}
|
33
|
+
}
|
34
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import './components/data-collect-activity-view'; /* refered by the activity template (activity-data-collect) on server */
|
2
|
+
import './components/ooc-review-activity-view'; /* refered by the activity template (activity-ooc-review) on server */
|
3
|
+
import './components/ooc-resolve-activity-view'; /* refered by the activity template (activity-ooc-resolve) on server */
|
4
|
+
import '@operato/app/filter-renderer.js'; /* register resource-object filter renderer */
|
5
|
+
import { OxGristEditorCode } from '@operato/app/grist-editor/ox-grist-editor-code.js';
|
6
|
+
import { OxGristRendererJson5, registerEditor as registerGristEditor, registerRenderer as registerGristRenderer } from '@operato/data-grist';
|
7
|
+
import { OxGristEditorDataItemSpec } from '@operato/dataset/grist-editor/ox-grist-editor-data-item-spec.js';
|
8
|
+
import { OxGristEditorPartitionKeys } from '@operato/grist-editor/ox-grist-editor-partition-keys.js';
|
9
|
+
export default function bootstrap() {
|
10
|
+
registerGristEditor('data-item-spec', OxGristEditorDataItemSpec);
|
11
|
+
registerGristRenderer('data-item-spec', OxGristRendererJson5);
|
12
|
+
registerGristEditor('script', OxGristEditorCode);
|
13
|
+
registerGristEditor('partition-keys', OxGristEditorPartitionKeys);
|
14
|
+
registerGristRenderer('partition-keys', OxGristRendererJson5);
|
15
|
+
}
|
16
|
+
//# sourceMappingURL=bootstrap.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../client/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,yCAAyC,CAAA,CAAC,wEAAwE;AACzH,OAAO,uCAAuC,CAAA,CAAC,sEAAsE;AACrH,OAAO,wCAAwC,CAAA,CAAC,uEAAuE;AAEvH,OAAO,iCAAiC,CAAA,CAAC,8CAA8C;AAEvF,OAAO,EAAE,iBAAiB,EAAE,MAAM,mDAAmD,CAAA;AACrF,OAAO,EACL,oBAAoB,EACpB,cAAc,IAAI,mBAAmB,EACrC,gBAAgB,IAAI,qBAAqB,EAC1C,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,yBAAyB,EAAE,MAAM,iEAAiE,CAAA;AAC3G,OAAO,EAAE,0BAA0B,EAAE,MAAM,yDAAyD,CAAA;AAEpG,MAAM,CAAC,OAAO,UAAU,SAAS;IAC/B,mBAAmB,CAAC,gBAAgB,EAAE,yBAAyB,CAAC,CAAA;IAChE,qBAAqB,CAAC,gBAAgB,EAAE,oBAAoB,CAAC,CAAA;IAE7D,mBAAmB,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAA;IAEhD,mBAAmB,CAAC,gBAAgB,EAAE,0BAA0B,CAAC,CAAA;IACjE,qBAAqB,CAAC,gBAAgB,EAAE,oBAAoB,CAAC,CAAA;AAC/D,CAAC","sourcesContent":["import './components/data-collect-activity-view' /* refered by the activity template (activity-data-collect) on server */\nimport './components/ooc-review-activity-view' /* refered by the activity template (activity-ooc-review) on server */\nimport './components/ooc-resolve-activity-view' /* refered by the activity template (activity-ooc-resolve) on server */\n\nimport '@operato/app/filter-renderer.js' /* register resource-object filter renderer */\n\nimport { OxGristEditorCode } from '@operato/app/grist-editor/ox-grist-editor-code.js'\nimport {\n OxGristRendererJson5,\n registerEditor as registerGristEditor,\n registerRenderer as registerGristRenderer\n} from '@operato/data-grist'\nimport { OxGristEditorDataItemSpec } from '@operato/dataset/grist-editor/ox-grist-editor-data-item-spec.js'\nimport { OxGristEditorPartitionKeys } from '@operato/grist-editor/ox-grist-editor-partition-keys.js'\n\nexport default function bootstrap() {\n registerGristEditor('data-item-spec', OxGristEditorDataItemSpec)\n registerGristRenderer('data-item-spec', OxGristRendererJson5)\n\n registerGristEditor('script', OxGristEditorCode)\n\n registerGristEditor('partition-keys', OxGristEditorPartitionKeys)\n registerGristRenderer('partition-keys', OxGristRendererJson5)\n}\n"]}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import '@operato/dataset/ox-data-entry-form.js';
|
2
|
+
import { LitElement } from 'lit';
|
3
|
+
import { OxDataEntryForm } from '@operato/dataset/ox-data-entry-form.js';
|
4
|
+
import { DataSet } from '@operato/dataset';
|
5
|
+
declare const DataCollectActivityView_base: (new (...args: any[]) => LitElement) & typeof LitElement;
|
6
|
+
export declare class DataCollectActivityView extends DataCollectActivityView_base {
|
7
|
+
static styles: import("lit").CSSResult[];
|
8
|
+
input?: any;
|
9
|
+
output?: any;
|
10
|
+
dataSet?: DataSet & {
|
11
|
+
id: string;
|
12
|
+
};
|
13
|
+
entryForm: OxDataEntryForm;
|
14
|
+
render(): import("lit-html").TemplateResult<1>;
|
15
|
+
_updateDataItems(): Promise<void>;
|
16
|
+
updated(changes: any): void;
|
17
|
+
fetchDataSet(): Promise<void>;
|
18
|
+
}
|
19
|
+
export {};
|