@things-factory/dataset 8.0.0-beta.0 → 8.0.0-beta.2
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/package.json +13 -13
- package/client/activities/activity-data-collect-edit.ts +0 -105
- package/client/activities/activity-data-collect-view.ts +0 -91
- package/client/activities/activity-data-review-edit.ts +0 -133
- package/client/activities/activity-data-review-view.ts +0 -145
- package/client/activities/activity-ooc-resolve-edit.ts +0 -195
- package/client/activities/activity-ooc-resolve-view.ts +0 -143
- package/client/activities/activity-ooc-review-edit.ts +0 -173
- package/client/activities/activity-ooc-review-view.ts +0 -129
- package/client/bootstrap.ts +0 -35
- package/client/components/data-entry-form.ts +0 -109
- package/client/index.ts +0 -1
- package/client/pages/data-archive/data-archive-list-page.ts +0 -277
- package/client/pages/data-archive/data-archive-request-popup.ts +0 -177
- package/client/pages/data-entry/data-entry-list-page.ts +0 -464
- package/client/pages/data-key-set/data-key-item-list.ts +0 -183
- package/client/pages/data-key-set/data-key-set-importer.ts +0 -89
- package/client/pages/data-key-set/data-key-set-list-page.ts +0 -413
- package/client/pages/data-ooc/data-ooc-list-page.ts +0 -549
- package/client/pages/data-ooc/data-ooc-page.ts +0 -164
- package/client/pages/data-ooc/data-ooc-view.ts +0 -236
- package/client/pages/data-ooc/data-oocs-page.ts +0 -200
- package/client/pages/data-report/data-report-embed-page.ts +0 -108
- package/client/pages/data-report/data-report-list-page.ts +0 -454
- package/client/pages/data-report/data-report-samples-page.ts +0 -174
- package/client/pages/data-report/jasper-report-oocs-page.ts +0 -110
- package/client/pages/data-report/jasper-report-samples-crosstab-page.ts +0 -110
- package/client/pages/data-report/jasper-report-samples-page.ts +0 -110
- package/client/pages/data-sample/data-sample-list-page.ts +0 -442
- package/client/pages/data-sample/data-sample-page.ts +0 -55
- package/client/pages/data-sample/data-sample-search-page.ts +0 -424
- package/client/pages/data-sample/data-sample-view.ts +0 -292
- package/client/pages/data-sample/data-samples-page.ts +0 -249
- package/client/pages/data-sensor/data-sensor-list-page.ts +0 -456
- package/client/pages/data-set/data-item-list.ts +0 -304
- package/client/pages/data-set/data-set-importer.ts +0 -89
- package/client/pages/data-set/data-set-list-page.ts +0 -1078
- package/client/pages/data-summary/data-summary-list-page.ts +0 -363
- package/client/pages/data-summary/data-summary-period-page.ts +0 -439
- package/client/pages/data-summary/data-summary-search-page.ts +0 -426
- package/client/pages/data-summary/data-summary-view.ts +0 -133
- package/client/route.ts +0 -91
- package/client/tsconfig.json +0 -13
- package/server/activities/activity-data-collect.ts +0 -100
- package/server/activities/activity-data-review.ts +0 -82
- package/server/activities/activity-ooc-resolve.ts +0 -123
- package/server/activities/activity-ooc-review.ts +0 -144
- package/server/activities/index.ts +0 -11
- package/server/controllers/create-data-sample.ts +0 -426
- package/server/controllers/data-use-case.ts +0 -98
- package/server/controllers/finalize-data-collection.ts +0 -388
- package/server/controllers/index.ts +0 -3
- package/server/controllers/issue-data-collection-task.ts +0 -70
- package/server/controllers/jasper-report.ts +0 -186
- package/server/controllers/query-data-summary-by-period.ts +0 -178
- package/server/controllers/shiny-report.ts +0 -54
- package/server/engine/index.ts +0 -1
- package/server/engine/task/create-data-sample.ts +0 -100
- package/server/engine/task/index.ts +0 -2
- package/server/engine/task/issue-collect-data.ts +0 -45
- package/server/index.ts +0 -8
- package/server/routes.ts +0 -188
- package/server/service/data-archive/data-archive-mutation.ts +0 -273
- package/server/service/data-archive/data-archive-query.ts +0 -58
- package/server/service/data-archive/data-archive-type.ts +0 -48
- package/server/service/data-archive/data-archive.ts +0 -69
- package/server/service/data-archive/index.ts +0 -6
- package/server/service/data-key-set/data-key-item-type.ts +0 -31
- package/server/service/data-key-set/data-key-set-mutation.ts +0 -201
- package/server/service/data-key-set/data-key-set-query.ts +0 -68
- package/server/service/data-key-set/data-key-set-type.ts +0 -70
- package/server/service/data-key-set/data-key-set.ts +0 -86
- package/server/service/data-key-set/index.ts +0 -6
- package/server/service/data-ooc/data-ooc-mutation.ts +0 -154
- package/server/service/data-ooc/data-ooc-query.ts +0 -106
- package/server/service/data-ooc/data-ooc-subscription.ts +0 -48
- package/server/service/data-ooc/data-ooc-type.ts +0 -71
- package/server/service/data-ooc/data-ooc.ts +0 -259
- package/server/service/data-ooc/index.ts +0 -7
- package/server/service/data-sample/data-sample-mutation.ts +0 -18
- package/server/service/data-sample/data-sample-query.ts +0 -215
- package/server/service/data-sample/data-sample-type.ts +0 -47
- package/server/service/data-sample/data-sample.ts +0 -193
- package/server/service/data-sample/index.ts +0 -6
- package/server/service/data-sensor/data-sensor-mutation.ts +0 -116
- package/server/service/data-sensor/data-sensor-query.ts +0 -76
- package/server/service/data-sensor/data-sensor-type.ts +0 -104
- package/server/service/data-sensor/data-sensor.ts +0 -126
- package/server/service/data-sensor/index.ts +0 -6
- package/server/service/data-set/data-item-type.ts +0 -155
- package/server/service/data-set/data-set-mutation.ts +0 -552
- package/server/service/data-set/data-set-query.ts +0 -461
- package/server/service/data-set/data-set-type.ts +0 -204
- package/server/service/data-set/data-set.ts +0 -326
- package/server/service/data-set/index.ts +0 -6
- package/server/service/data-set-history/data-set-history-query.ts +0 -126
- package/server/service/data-set-history/data-set-history-type.ts +0 -12
- package/server/service/data-set-history/data-set-history.ts +0 -217
- package/server/service/data-set-history/event-subscriber.ts +0 -17
- package/server/service/data-set-history/index.ts +0 -7
- package/server/service/data-spec/data-spec-manager.ts +0 -21
- package/server/service/data-spec/data-spec-query.ts +0 -21
- package/server/service/data-spec/data-spec.ts +0 -45
- package/server/service/data-spec/index.ts +0 -5
- package/server/service/data-summary/data-summary-mutation.ts +0 -45
- package/server/service/data-summary/data-summary-query.ts +0 -179
- package/server/service/data-summary/data-summary-type.ts +0 -86
- package/server/service/data-summary/data-summary.ts +0 -170
- package/server/service/data-summary/index.ts +0 -7
- package/server/service/index.ts +0 -57
- package/server/tsconfig.json +0 -10
- package/server/utils/config-resolver.ts +0 -29
- package/server/utils/index.ts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/dataset",
|
|
3
|
-
"version": "8.0.0-beta.
|
|
3
|
+
"version": "8.0.0-beta.2",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "dist-client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -40,21 +40,21 @@
|
|
|
40
40
|
"@operato/shell": "^8.0.0-beta",
|
|
41
41
|
"@operato/styles": "^8.0.0-beta",
|
|
42
42
|
"@operato/utils": "^8.0.0-beta",
|
|
43
|
-
"@things-factory/auth-base": "^8.0.0-beta.
|
|
44
|
-
"@things-factory/aws-base": "^8.0.0-beta.
|
|
45
|
-
"@things-factory/board-service": "^8.0.0-beta.
|
|
46
|
-
"@things-factory/env": "^8.0.0-beta.
|
|
47
|
-
"@things-factory/integration-base": "^8.0.0-beta.
|
|
48
|
-
"@things-factory/organization": "^8.0.0-beta.
|
|
49
|
-
"@things-factory/personalization": "^8.0.0-beta.
|
|
50
|
-
"@things-factory/scheduler-client": "^8.0.0-beta.
|
|
51
|
-
"@things-factory/shell": "^8.0.0-beta.
|
|
52
|
-
"@things-factory/work-shift": "^8.0.0-beta.
|
|
53
|
-
"@things-factory/worklist": "^8.0.0-beta.
|
|
43
|
+
"@things-factory/auth-base": "^8.0.0-beta.2",
|
|
44
|
+
"@things-factory/aws-base": "^8.0.0-beta.2",
|
|
45
|
+
"@things-factory/board-service": "^8.0.0-beta.2",
|
|
46
|
+
"@things-factory/env": "^8.0.0-beta.2",
|
|
47
|
+
"@things-factory/integration-base": "^8.0.0-beta.2",
|
|
48
|
+
"@things-factory/organization": "^8.0.0-beta.2",
|
|
49
|
+
"@things-factory/personalization": "^8.0.0-beta.2",
|
|
50
|
+
"@things-factory/scheduler-client": "^8.0.0-beta.2",
|
|
51
|
+
"@things-factory/shell": "^8.0.0-beta.2",
|
|
52
|
+
"@things-factory/work-shift": "^8.0.0-beta.2",
|
|
53
|
+
"@things-factory/worklist": "^8.0.0-beta.2",
|
|
54
54
|
"cron-parser": "^4.3.0",
|
|
55
55
|
"moment-timezone": "^0.5.45",
|
|
56
56
|
"simple-statistics": "^7.8.3",
|
|
57
57
|
"statistics": "^3.3.0"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "f03431a09435511b2595515658f9cb8f78ba4ebb"
|
|
60
60
|
}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import '@operato/dataset/ox-data-entry-form.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 { OxDataEntryForm } from '@operato/dataset/ox-data-entry-form.js'
|
|
11
|
-
import { DataSet } from '@operato/dataset'
|
|
12
|
-
|
|
13
|
-
@customElement('activity-data-collect-edit')
|
|
14
|
-
export class DataCollectActivityEdit extends localize(i18next)(LitElement) {
|
|
15
|
-
static styles = [
|
|
16
|
-
ScrollbarStyles,
|
|
17
|
-
css`
|
|
18
|
-
:host {
|
|
19
|
-
display: flex;
|
|
20
|
-
flex-direction: column;
|
|
21
|
-
|
|
22
|
-
background-color: var(--md-sys-color-surface);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
ox-data-entry-form {
|
|
26
|
-
flex: 1;
|
|
27
|
-
padding: 10px;
|
|
28
|
-
overflow: auto;
|
|
29
|
-
}
|
|
30
|
-
`
|
|
31
|
-
]
|
|
32
|
-
|
|
33
|
-
@property({ type: Object }) input?: any
|
|
34
|
-
@property({ type: Object }) output?: any
|
|
35
|
-
|
|
36
|
-
@state() dataSet?: DataSet & { id: string }
|
|
37
|
-
|
|
38
|
-
@query('ox-data-entry-form') entryForm!: OxDataEntryForm
|
|
39
|
-
|
|
40
|
-
render() {
|
|
41
|
-
return html`
|
|
42
|
-
<ox-data-entry-form
|
|
43
|
-
.dataSet=${this.dataSet}
|
|
44
|
-
.value=${this.output}
|
|
45
|
-
@change=${this._updateDataItems}
|
|
46
|
-
></ox-data-entry-form>
|
|
47
|
-
`
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
async _updateDataItems(e: CustomEvent) {
|
|
51
|
-
e.stopPropagation()
|
|
52
|
-
|
|
53
|
-
this.output = this.entryForm.value
|
|
54
|
-
|
|
55
|
-
this.dispatchEvent(
|
|
56
|
-
new CustomEvent('change', {
|
|
57
|
-
detail: this.output
|
|
58
|
-
})
|
|
59
|
-
)
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
updated(changes) {
|
|
63
|
-
if (changes.has('input')) {
|
|
64
|
-
this.fetchDataSet()
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
async fetchDataSet() {
|
|
69
|
-
const id = this.input.dataSetId
|
|
70
|
-
|
|
71
|
-
if (id) {
|
|
72
|
-
const response = await client.query({
|
|
73
|
-
query: gql`
|
|
74
|
-
query ($id: String!) {
|
|
75
|
-
dataSet(id: $id) {
|
|
76
|
-
id
|
|
77
|
-
name
|
|
78
|
-
description
|
|
79
|
-
useCase
|
|
80
|
-
dataItems {
|
|
81
|
-
name
|
|
82
|
-
description
|
|
83
|
-
active
|
|
84
|
-
hidden
|
|
85
|
-
tag
|
|
86
|
-
group
|
|
87
|
-
type
|
|
88
|
-
unit
|
|
89
|
-
options
|
|
90
|
-
quota
|
|
91
|
-
spec
|
|
92
|
-
stat
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
`,
|
|
97
|
-
variables: {
|
|
98
|
-
id
|
|
99
|
-
}
|
|
100
|
-
})
|
|
101
|
-
|
|
102
|
-
this.dataSet = response.data.dataSet
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import '@operato/dataset/ox-data-entry-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('activity-data-collect-view')
|
|
13
|
-
export class DataCollectActivityView extends localize(i18next)(LitElement) {
|
|
14
|
-
static styles = [
|
|
15
|
-
ScrollbarStyles,
|
|
16
|
-
css`
|
|
17
|
-
:host {
|
|
18
|
-
display: flex;
|
|
19
|
-
flex-direction: column;
|
|
20
|
-
|
|
21
|
-
background-color: var(--md-sys-color-surface);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
ox-data-entry-view {
|
|
25
|
-
flex: 1;
|
|
26
|
-
padding: 10px;
|
|
27
|
-
overflow: auto;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
@media print {
|
|
31
|
-
:host {
|
|
32
|
-
display: block;
|
|
33
|
-
overflow: visible;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
`
|
|
37
|
-
]
|
|
38
|
-
|
|
39
|
-
@property({ type: Object }) input?: any
|
|
40
|
-
@property({ type: Object }) output?: any
|
|
41
|
-
|
|
42
|
-
@state() dataSet?: DataSet & { id: string }
|
|
43
|
-
|
|
44
|
-
render() {
|
|
45
|
-
return html` <ox-data-entry-view .dataSet=${this.dataSet} .value=${this.output}></ox-data-entry-view>`
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
updated(changes) {
|
|
49
|
-
if (changes.has('input')) {
|
|
50
|
-
this.fetchDataSet()
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
async fetchDataSet() {
|
|
55
|
-
const id = this.input.dataSetId
|
|
56
|
-
|
|
57
|
-
if (id) {
|
|
58
|
-
const response = await client.query({
|
|
59
|
-
query: gql`
|
|
60
|
-
query ($id: String!) {
|
|
61
|
-
dataSet(id: $id) {
|
|
62
|
-
id
|
|
63
|
-
name
|
|
64
|
-
description
|
|
65
|
-
useCase
|
|
66
|
-
dataItems {
|
|
67
|
-
name
|
|
68
|
-
description
|
|
69
|
-
active
|
|
70
|
-
hidden
|
|
71
|
-
tag
|
|
72
|
-
group
|
|
73
|
-
type
|
|
74
|
-
unit
|
|
75
|
-
options
|
|
76
|
-
quota
|
|
77
|
-
spec
|
|
78
|
-
stat
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
`,
|
|
83
|
-
variables: {
|
|
84
|
-
id
|
|
85
|
-
}
|
|
86
|
-
})
|
|
87
|
-
|
|
88
|
-
this.dataSet = response.data.dataSet
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import '@operato/dataset/ox-data-entry-form.js'
|
|
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 { i18next, localize } from '@operato/i18n'
|
|
8
|
-
import { ScrollbarStyles } from '@operato/styles'
|
|
9
|
-
import { client } from '@operato/graphql'
|
|
10
|
-
|
|
11
|
-
@customElement('activity-data-review-edit')
|
|
12
|
-
export class DataReviewActivityEdit extends localize(i18next)(LitElement) {
|
|
13
|
-
static styles = [
|
|
14
|
-
ScrollbarStyles,
|
|
15
|
-
css`
|
|
16
|
-
:host {
|
|
17
|
-
display: flex;
|
|
18
|
-
flex-direction: column;
|
|
19
|
-
|
|
20
|
-
background-color: var(--md-sys-color-surface);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
div[content] {
|
|
24
|
-
flex: 1;
|
|
25
|
-
flex-direction: column;
|
|
26
|
-
|
|
27
|
-
display: flex;
|
|
28
|
-
overflow: auto;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
ox-data-sample-view {
|
|
32
|
-
flex: 1;
|
|
33
|
-
padding: var(--spacing-large);
|
|
34
|
-
overflow: auto;
|
|
35
|
-
}
|
|
36
|
-
`
|
|
37
|
-
]
|
|
38
|
-
|
|
39
|
-
@property({ type: Object }) input?: any
|
|
40
|
-
@property({ type: Object }) output?: any
|
|
41
|
-
|
|
42
|
-
@state() dataSample?: any
|
|
43
|
-
|
|
44
|
-
render() {
|
|
45
|
-
return html`
|
|
46
|
-
<div content>
|
|
47
|
-
<ox-data-sample-view .dataSample=${this.dataSample}></ox-data-sample-view>
|
|
48
|
-
</div>
|
|
49
|
-
`
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
onChangeInstruction(e: Event) {
|
|
53
|
-
this.output ||= {}
|
|
54
|
-
this.output.instruction = (e.target as HTMLTextAreaElement).value
|
|
55
|
-
|
|
56
|
-
this.dispatchEvent(
|
|
57
|
-
new CustomEvent('change', {
|
|
58
|
-
detail: this.output
|
|
59
|
-
})
|
|
60
|
-
)
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
updated(changes) {
|
|
64
|
-
if (changes.has('input')) {
|
|
65
|
-
this.fetchDataAssign()
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
async fetchDataAssign() {
|
|
70
|
-
const { dataSampleId, dataSample } = this.input || {}
|
|
71
|
-
|
|
72
|
-
if (dataSample) {
|
|
73
|
-
/* only for backwards compatibility - should be deleted later */
|
|
74
|
-
this.dataSample = dataSample
|
|
75
|
-
} else if (dataSampleId) {
|
|
76
|
-
const response = await client.query({
|
|
77
|
-
query: gql`
|
|
78
|
-
query ($id: String!) {
|
|
79
|
-
dataSample(id: $id) {
|
|
80
|
-
id
|
|
81
|
-
name
|
|
82
|
-
description
|
|
83
|
-
useCase
|
|
84
|
-
key01
|
|
85
|
-
key02
|
|
86
|
-
key03
|
|
87
|
-
key04
|
|
88
|
-
key05
|
|
89
|
-
data
|
|
90
|
-
ooc
|
|
91
|
-
oos
|
|
92
|
-
dataSet {
|
|
93
|
-
id
|
|
94
|
-
name
|
|
95
|
-
description
|
|
96
|
-
}
|
|
97
|
-
dataItems {
|
|
98
|
-
name
|
|
99
|
-
description
|
|
100
|
-
active
|
|
101
|
-
hidden
|
|
102
|
-
tag
|
|
103
|
-
group
|
|
104
|
-
type
|
|
105
|
-
unit
|
|
106
|
-
options
|
|
107
|
-
quota
|
|
108
|
-
spec
|
|
109
|
-
stat
|
|
110
|
-
}
|
|
111
|
-
judgment
|
|
112
|
-
workDate
|
|
113
|
-
workShift
|
|
114
|
-
updater {
|
|
115
|
-
id
|
|
116
|
-
name
|
|
117
|
-
}
|
|
118
|
-
updatedAt
|
|
119
|
-
collectedAt
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
`,
|
|
123
|
-
variables: {
|
|
124
|
-
id: dataSampleId
|
|
125
|
-
}
|
|
126
|
-
})
|
|
127
|
-
|
|
128
|
-
this.dataSample = {
|
|
129
|
-
...response.data.dataSample
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import '@operato/dataset/ox-data-entry-form.js'
|
|
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 { i18next, localize } from '@operato/i18n'
|
|
8
|
-
import { ScrollbarStyles } from '@operato/styles'
|
|
9
|
-
import { client } from '@operato/graphql'
|
|
10
|
-
|
|
11
|
-
@customElement('activity-data-review-view')
|
|
12
|
-
export class DataReviewActivityView extends localize(i18next)(LitElement) {
|
|
13
|
-
static styles = [
|
|
14
|
-
ScrollbarStyles,
|
|
15
|
-
css`
|
|
16
|
-
:host {
|
|
17
|
-
display: flex;
|
|
18
|
-
flex-direction: column;
|
|
19
|
-
|
|
20
|
-
background-color: var(--md-sys-color-surface);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
div[content] {
|
|
24
|
-
flex: 1;
|
|
25
|
-
flex-direction: column;
|
|
26
|
-
|
|
27
|
-
display: flex;
|
|
28
|
-
overflow: auto;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
ox-data-sample-view {
|
|
32
|
-
flex: 1;
|
|
33
|
-
padding: var(--spacing-large);
|
|
34
|
-
overflow: auto;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
@media print {
|
|
38
|
-
:host {
|
|
39
|
-
display: block;
|
|
40
|
-
overflow: visible;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
div[content] {
|
|
44
|
-
display: block;
|
|
45
|
-
overflow: visible;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
`
|
|
49
|
-
]
|
|
50
|
-
|
|
51
|
-
@property({ type: Object }) input?: any
|
|
52
|
-
@property({ type: Object }) output?: any
|
|
53
|
-
|
|
54
|
-
@state() dataSample?: any
|
|
55
|
-
|
|
56
|
-
render() {
|
|
57
|
-
return html`
|
|
58
|
-
<div content>
|
|
59
|
-
<ox-data-sample-view .dataSample=${this.dataSample}></ox-data-sample-view>
|
|
60
|
-
</div>
|
|
61
|
-
`
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
onChangeInstruction(e: Event) {
|
|
65
|
-
this.output ||= {}
|
|
66
|
-
this.output.instruction = (e.target as HTMLTextAreaElement).value
|
|
67
|
-
|
|
68
|
-
this.dispatchEvent(
|
|
69
|
-
new CustomEvent('change', {
|
|
70
|
-
detail: this.output
|
|
71
|
-
})
|
|
72
|
-
)
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
updated(changes) {
|
|
76
|
-
if (changes.has('input')) {
|
|
77
|
-
this.fetchDataAssign()
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
async fetchDataAssign() {
|
|
82
|
-
const { dataSampleId, dataSample } = this.input || {}
|
|
83
|
-
|
|
84
|
-
if (dataSample) {
|
|
85
|
-
/* only for backwards compatibility - should be deleted later */
|
|
86
|
-
this.dataSample = dataSample
|
|
87
|
-
} else if (dataSampleId) {
|
|
88
|
-
const response = await client.query({
|
|
89
|
-
query: gql`
|
|
90
|
-
query ($id: String!) {
|
|
91
|
-
dataSample(id: $id) {
|
|
92
|
-
id
|
|
93
|
-
name
|
|
94
|
-
description
|
|
95
|
-
useCase
|
|
96
|
-
key01
|
|
97
|
-
key02
|
|
98
|
-
key03
|
|
99
|
-
key04
|
|
100
|
-
key05
|
|
101
|
-
data
|
|
102
|
-
ooc
|
|
103
|
-
oos
|
|
104
|
-
dataSet {
|
|
105
|
-
id
|
|
106
|
-
name
|
|
107
|
-
description
|
|
108
|
-
}
|
|
109
|
-
dataItems {
|
|
110
|
-
name
|
|
111
|
-
description
|
|
112
|
-
active
|
|
113
|
-
hidden
|
|
114
|
-
tag
|
|
115
|
-
group
|
|
116
|
-
type
|
|
117
|
-
unit
|
|
118
|
-
options
|
|
119
|
-
quota
|
|
120
|
-
spec
|
|
121
|
-
stat
|
|
122
|
-
}
|
|
123
|
-
judgment
|
|
124
|
-
workDate
|
|
125
|
-
workShift
|
|
126
|
-
updater {
|
|
127
|
-
id
|
|
128
|
-
name
|
|
129
|
-
}
|
|
130
|
-
updatedAt
|
|
131
|
-
collectedAt
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
`,
|
|
135
|
-
variables: {
|
|
136
|
-
id: dataSampleId
|
|
137
|
-
}
|
|
138
|
-
})
|
|
139
|
-
|
|
140
|
-
this.dataSample = {
|
|
141
|
-
...response.data.dataSample
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
import '@material/web/icon/icon.js'
|
|
2
|
-
import '@operato/dataset/ox-data-ooc-brief-view.js'
|
|
3
|
-
|
|
4
|
-
import gql from 'graphql-tag'
|
|
5
|
-
import { css, html, LitElement, nothing } from 'lit'
|
|
6
|
-
import { customElement, property, query, state } from 'lit/decorators.js'
|
|
7
|
-
|
|
8
|
-
import { client } from '@operato/graphql'
|
|
9
|
-
import { i18next, localize } from '@operato/i18n'
|
|
10
|
-
import { ScrollbarStyles } from '@operato/styles'
|
|
11
|
-
|
|
12
|
-
@customElement('activity-ooc-resolve-edit')
|
|
13
|
-
class OocResolveActivityEdit extends localize(i18next)(LitElement) {
|
|
14
|
-
static styles = [
|
|
15
|
-
ScrollbarStyles,
|
|
16
|
-
css`
|
|
17
|
-
:host {
|
|
18
|
-
display: flex;
|
|
19
|
-
flex-direction: column;
|
|
20
|
-
|
|
21
|
-
background-color: var(--md-sys-color-surface);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
div[content] {
|
|
25
|
-
flex: 1;
|
|
26
|
-
flex-direction: column;
|
|
27
|
-
|
|
28
|
-
display: flex;
|
|
29
|
-
overflow: auto;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
ox-data-ooc-brief-view {
|
|
33
|
-
flex: 1;
|
|
34
|
-
padding: var(--spacing-large);
|
|
35
|
-
overflow: auto;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
label[action] {
|
|
39
|
-
display: flex;
|
|
40
|
-
flex-direction: column;
|
|
41
|
-
|
|
42
|
-
padding: var(--spacing-large);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
label[action] h2 {
|
|
46
|
-
display: flex;
|
|
47
|
-
|
|
48
|
-
color: var(--title-text-color);
|
|
49
|
-
text-transform: capitalize;
|
|
50
|
-
margin: var(--title-margin);
|
|
51
|
-
align-items: center;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
md-icon {
|
|
55
|
-
color: var(--status-danger-color);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
textarea {
|
|
59
|
-
border: var(--input-field-border);
|
|
60
|
-
border-radius: var(--spacing-small);
|
|
61
|
-
margin: var(--spacing-medium);
|
|
62
|
-
padding: var(--spacing-medium);
|
|
63
|
-
font: var(--input-field-font);
|
|
64
|
-
color: var(--md-sys-color-on-surface);
|
|
65
|
-
background: var(--md-sys-color-surface-variant);
|
|
66
|
-
|
|
67
|
-
resize: none;
|
|
68
|
-
outline: none;
|
|
69
|
-
min-height: 200px;
|
|
70
|
-
}
|
|
71
|
-
`
|
|
72
|
-
]
|
|
73
|
-
|
|
74
|
-
@property({ type: Object }) input?: any
|
|
75
|
-
@property({ type: Object }) output?: any
|
|
76
|
-
@property({ type: Object }) activityThread?: any
|
|
77
|
-
|
|
78
|
-
@state() dataOoc?: any
|
|
79
|
-
|
|
80
|
-
@query('textarea') actionTextArea!: HTMLTextAreaElement
|
|
81
|
-
|
|
82
|
-
render() {
|
|
83
|
-
const action = this.output?.action
|
|
84
|
-
const state = this.activityThread?.state
|
|
85
|
-
const editable = state == 'unassigned' || state == 'assigned' || state == 'started'
|
|
86
|
-
|
|
87
|
-
return html`
|
|
88
|
-
<div content>
|
|
89
|
-
<ox-data-ooc-brief-view .dataOoc=${this.dataOoc}></ox-data-ooc-brief-view>
|
|
90
|
-
</div>
|
|
91
|
-
|
|
92
|
-
<!-- <ox-data-ooc-correction-part .dataOoc=${this.dataOoc}></ox-data-ooc-correction-part> -->
|
|
93
|
-
|
|
94
|
-
${editable
|
|
95
|
-
? html`
|
|
96
|
-
<label action>
|
|
97
|
-
<h2><md-icon>build_circle</md-icon> <span>${i18next.t('label.corrective action')}</span></h2>
|
|
98
|
-
<textarea
|
|
99
|
-
placeholder=${String(i18next.t('text.corrective action placeholder'))}
|
|
100
|
-
.value=${action || ''}
|
|
101
|
-
@change=${this.onChangeAction}
|
|
102
|
-
></textarea>
|
|
103
|
-
</label>
|
|
104
|
-
`
|
|
105
|
-
: nothing}
|
|
106
|
-
`
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
onChangeAction(e: Event) {
|
|
110
|
-
this.output ||= {}
|
|
111
|
-
this.output.action = (e.target as HTMLTextAreaElement).value
|
|
112
|
-
|
|
113
|
-
this.dispatchEvent(
|
|
114
|
-
new CustomEvent('change', {
|
|
115
|
-
detail: this.output
|
|
116
|
-
})
|
|
117
|
-
)
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
updated(changes) {
|
|
121
|
-
if (changes.has('input')) {
|
|
122
|
-
this.fetchDataOoc()
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
async fetchDataOoc() {
|
|
127
|
-
const id = this.input.dataOocId
|
|
128
|
-
|
|
129
|
-
if (id) {
|
|
130
|
-
const response = await client.query({
|
|
131
|
-
query: gql`
|
|
132
|
-
query ($id: String!) {
|
|
133
|
-
dataOoc(id: $id) {
|
|
134
|
-
id
|
|
135
|
-
name
|
|
136
|
-
description
|
|
137
|
-
ooc
|
|
138
|
-
oos
|
|
139
|
-
state
|
|
140
|
-
type
|
|
141
|
-
useCase
|
|
142
|
-
data
|
|
143
|
-
judgment
|
|
144
|
-
history
|
|
145
|
-
correctiveAction
|
|
146
|
-
correctiveInstruction
|
|
147
|
-
dataItems {
|
|
148
|
-
name
|
|
149
|
-
description
|
|
150
|
-
active
|
|
151
|
-
hidden
|
|
152
|
-
tag
|
|
153
|
-
group
|
|
154
|
-
type
|
|
155
|
-
unit
|
|
156
|
-
options
|
|
157
|
-
quota
|
|
158
|
-
spec
|
|
159
|
-
stat
|
|
160
|
-
}
|
|
161
|
-
workDate
|
|
162
|
-
workShift
|
|
163
|
-
reviewer {
|
|
164
|
-
id
|
|
165
|
-
name
|
|
166
|
-
}
|
|
167
|
-
corrector {
|
|
168
|
-
id
|
|
169
|
-
name
|
|
170
|
-
}
|
|
171
|
-
collectedAt
|
|
172
|
-
reviewedAt
|
|
173
|
-
correctedAt
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
`,
|
|
177
|
-
variables: {
|
|
178
|
-
id
|
|
179
|
-
}
|
|
180
|
-
})
|
|
181
|
-
|
|
182
|
-
const dataOoc = {
|
|
183
|
-
...response.data.dataOoc
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
if (this.activityThread?.output) {
|
|
187
|
-
dataOoc.correctiveAction = this.activityThread.output.action
|
|
188
|
-
dataOoc.correctedAt = this.activityThread.updatedAt
|
|
189
|
-
dataOoc.corrector = this.activityThread.assignee
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
this.dataOoc = dataOoc
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
}
|