@things-factory/dataset 6.0.0-alpha.7 → 6.0.0-alpha.9
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.
@@ -1,5 +1,4 @@
|
|
1
1
|
import { SingleColumnFormStyles } from '@things-factory/form-ui'
|
2
|
-
import '@things-factory/grist-ui'
|
3
2
|
import { i18next, localize } from '@things-factory/i18n-base'
|
4
3
|
import { client, CustomAlert } from '@things-factory/shell'
|
5
4
|
import gql from 'graphql-tag'
|
@@ -40,15 +39,13 @@ class DataArchiveRequestPopup extends localize(i18next)(LitElement) {
|
|
40
39
|
<form id="input-form" name="generation" class="single-column-form" @submit=${e => this.onSubmit(e)}>
|
41
40
|
<fieldset>
|
42
41
|
<label>${i18next.t('label.start-date')}</label>
|
43
|
-
<input type="month" name="startDate" required/>
|
42
|
+
<input type="month" name="startDate" required />
|
44
43
|
<label>${i18next.t('label.end-date')}</label>
|
45
|
-
<input type="month" name="endDate" .value=${moment().format('YYYY-MM')}/>
|
44
|
+
<input type="month" name="endDate" .value=${moment().format('YYYY-MM')} />
|
46
45
|
<label>${i18next.t('label.data-set-type')}</label>
|
47
46
|
<select name="type" required>
|
48
|
-
${(this.dataSetTypes || []).map(
|
49
|
-
|
50
|
-
)}
|
51
|
-
</select>
|
47
|
+
${(this.dataSetTypes || []).map(t => html`<option value="${t && t.value}">${t && t.display}</option>`)}
|
48
|
+
</select>
|
52
49
|
</fieldset>
|
53
50
|
</form>
|
54
51
|
|
@@ -58,19 +55,16 @@ class DataArchiveRequestPopup extends localize(i18next)(LitElement) {
|
|
58
55
|
`
|
59
56
|
}
|
60
57
|
|
61
|
-
async firstUpdated() {
|
62
|
-
|
63
|
-
}
|
58
|
+
async firstUpdated() {}
|
64
59
|
|
65
60
|
async onSubmit(e) {
|
66
61
|
e.preventDefault()
|
67
62
|
this.requestArchive()
|
68
63
|
}
|
69
64
|
|
70
|
-
|
71
65
|
serializeFormData() {
|
72
66
|
const obj = {}
|
73
|
-
|
67
|
+
|
74
68
|
Array.from(this.shadowRoot.querySelectorAll('form#input-form input, select')).forEach(field => {
|
75
69
|
if (!field.hasAttribute('hidden') && field.value) {
|
76
70
|
obj[field.name] = field.type === 'checkbox' ? field.checked : field.value
|
@@ -115,7 +109,9 @@ class DataArchiveRequestPopup extends localize(i18next)(LitElement) {
|
|
115
109
|
if (!response.errors) {
|
116
110
|
this.dispatchEvent(new CustomEvent('requested', {}))
|
117
111
|
|
118
|
-
const {
|
112
|
+
const {
|
113
|
+
createDataArchive: { id }
|
114
|
+
} = response.data
|
119
115
|
dataArchive['id'] = id
|
120
116
|
|
121
117
|
this._generateArchiveAndDownloadUrl(dataArchive)
|
@@ -126,7 +122,6 @@ class DataArchiveRequestPopup extends localize(i18next)(LitElement) {
|
|
126
122
|
text: i18next.t('text.data-archive waits'),
|
127
123
|
confirmButton: { text: i18next.t('button.confirm') }
|
128
124
|
})
|
129
|
-
|
130
125
|
} else {
|
131
126
|
console.error(response.errors)
|
132
127
|
this.showToast(i18next.t('text.failed'))
|
@@ -147,7 +142,7 @@ class DataArchiveRequestPopup extends localize(i18next)(LitElement) {
|
|
147
142
|
variables: { patch: dataArchive }
|
148
143
|
})
|
149
144
|
|
150
|
-
if (!response.errors) {
|
145
|
+
if (!response.errors) {
|
151
146
|
this.showToast(i18next.t('title.data-archive downloads ready'))
|
152
147
|
this.dispatchEvent(new CustomEvent('created', {}))
|
153
148
|
} else {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@things-factory/dataset",
|
3
|
-
"version": "6.0.0-alpha.
|
3
|
+
"version": "6.0.0-alpha.9",
|
4
4
|
"main": "dist-server/index.js",
|
5
5
|
"browser": "client/index.js",
|
6
6
|
"things-factory": true,
|
@@ -34,14 +34,14 @@
|
|
34
34
|
"@operato/shell": "^1.0.1",
|
35
35
|
"@operato/styles": "^1.0.0",
|
36
36
|
"@operato/utils": "^1.0.1",
|
37
|
-
"@things-factory/auth-base": "^6.0.0-alpha.
|
38
|
-
"@things-factory/aws-base": "^6.0.0-alpha.
|
39
|
-
"@things-factory/board-service": "^6.0.0-alpha.
|
40
|
-
"@things-factory/env": "^6.0.0-alpha.
|
41
|
-
"@things-factory/shell": "^6.0.0-alpha.
|
42
|
-
"@things-factory/work-shift": "^6.0.0-alpha.
|
37
|
+
"@things-factory/auth-base": "^6.0.0-alpha.8",
|
38
|
+
"@things-factory/aws-base": "^6.0.0-alpha.8",
|
39
|
+
"@things-factory/board-service": "^6.0.0-alpha.9",
|
40
|
+
"@things-factory/env": "^6.0.0-alpha.8",
|
41
|
+
"@things-factory/shell": "^6.0.0-alpha.8",
|
42
|
+
"@things-factory/work-shift": "^6.0.0-alpha.8",
|
43
43
|
"cron-parser": "^4.3.0",
|
44
44
|
"moment-timezone": "^0.5.34"
|
45
45
|
},
|
46
|
-
"gitHead": "
|
46
|
+
"gitHead": "3b34aa7eb3bd773e57a29fb1ff8a258074b10ad5"
|
47
47
|
}
|