@things-factory/integration-ui 5.0.0-alpha.9 → 5.0.0-zeta.1
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/client/bootstrap.js +11 -8
- package/client/grist/dynamic-selector.js +2 -3
- package/client/grist/task-type-selector.js +3 -4
- package/client/pages/connection.js +2 -20
- package/client/pages/scenario-detail.js +9 -7
- package/client/pages/scenario.js +5 -43
- package/package.json +14 -14
- package/client/grist/crontab-editor-popup.js +0 -610
- package/client/grist/crontab-editor.js +0 -65
- package/client/grist/json-editor.js +0 -120
- package/client/grist/json-grist-editor.js +0 -108
- package/client/grist/parameters-editor-builder.js +0 -133
- package/client/grist/parameters-editor-popup.js +0 -112
- package/client/grist/parameters-editor.js +0 -117
package/client/bootstrap.js
CHANGED
|
@@ -2,23 +2,26 @@ import '@material/mwc-icon'
|
|
|
2
2
|
import './editors/entity-editor'
|
|
3
3
|
import './editors/property-editor'
|
|
4
4
|
|
|
5
|
+
import { registerEditor as registerGristEditor, registerRenderer as registerGristRenderer } from '@operato/data-grist'
|
|
6
|
+
|
|
5
7
|
import { ConnectionSelector } from './grist/connection-selector'
|
|
6
8
|
import { ConnectorSelector } from './grist/connector-selector'
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
+
import { OxGristEditorCrontab } from '@operato/app/grist-editor/ox-grist-editor-crontab.js'
|
|
10
|
+
import { OxGristEditorJson } from '@operato/app/grist-editor/ox-grist-editor-json.js'
|
|
11
|
+
import { OxGristEditorParameters } from '@operato/app/grist-editor/ox-grist-editor-parameters.js'
|
|
12
|
+
import { OxGristRendererCrontab } from '@operato/app/grist-editor/ox-grist-renderer-crontab.js'
|
|
9
13
|
import { OxPropertyEditor } from '@operato/property-editor'
|
|
10
|
-
// import { ParametersEditor } from './grist/parameters-editor'
|
|
11
14
|
import { TaskTypeSelector } from './grist/task-type-selector'
|
|
12
|
-
import { ParametersEditor } from '@operato/app/grist/parameters-editor.js'
|
|
13
|
-
import { registerEditor as registerGristEditor } from '@operato/data-grist'
|
|
14
15
|
|
|
15
16
|
export default function bootstrap() {
|
|
16
17
|
registerGristEditor('task-type', TaskTypeSelector)
|
|
17
18
|
registerGristEditor('connector', ConnectorSelector)
|
|
18
19
|
registerGristEditor('connection', ConnectionSelector)
|
|
19
|
-
registerGristEditor('json',
|
|
20
|
-
registerGristEditor('parameters',
|
|
21
|
-
registerGristEditor('crontab',
|
|
20
|
+
registerGristEditor('json', OxGristEditorJson)
|
|
21
|
+
registerGristEditor('parameters', OxGristEditorParameters)
|
|
22
|
+
registerGristEditor('crontab', OxGristEditorCrontab)
|
|
23
|
+
|
|
24
|
+
registerGristRenderer('crontab', OxGristRendererCrontab)
|
|
22
25
|
|
|
23
26
|
OxPropertyEditor.register({
|
|
24
27
|
'http-headers': 'property-editor-http-headers',
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import '@material/mwc-icon'
|
|
2
2
|
|
|
3
|
+
import { OxGristEditor } from '@operato/data-grist'
|
|
3
4
|
import { html } from 'lit'
|
|
4
5
|
|
|
5
|
-
import { InputEditor } from '@operato/data-grist'
|
|
6
|
-
|
|
7
6
|
const EMPTY_OPTION = { name: '', value: '' }
|
|
8
7
|
|
|
9
|
-
export class DynamicSelector extends
|
|
8
|
+
export class DynamicSelector extends OxGristEditor {
|
|
10
9
|
getOptions() {
|
|
11
10
|
return []
|
|
12
11
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
+
import { OxGristEditor } from '@operato/data-grist'
|
|
2
|
+
import { client } from '@operato/graphql'
|
|
1
3
|
import gql from 'graphql-tag'
|
|
2
4
|
import { html } from 'lit'
|
|
3
5
|
|
|
4
|
-
import { InputEditor } from '@operato/data-grist'
|
|
5
|
-
import { client } from '@operato/graphql'
|
|
6
|
-
|
|
7
6
|
const FETCH_TASK_TYPES_GQL = gql`
|
|
8
7
|
query ($connectionName: String!) {
|
|
9
8
|
taskTypesByConnection(connectionName: $connectionName) {
|
|
@@ -16,7 +15,7 @@ const FETCH_TASK_TYPES_GQL = gql`
|
|
|
16
15
|
|
|
17
16
|
const EMPTY_OPTION = { name: '', value: '' }
|
|
18
17
|
|
|
19
|
-
export class TaskTypeSelector extends
|
|
18
|
+
export class TaskTypeSelector extends OxGristEditor {
|
|
20
19
|
async getOptions() {
|
|
21
20
|
var { connectionName = '' } = this.column.record
|
|
22
21
|
if (typeof connectionName === 'function') {
|
|
@@ -203,7 +203,8 @@ export class Connection extends connect(store)(localize(i18next)(PageView)) {
|
|
|
203
203
|
const { name, help, parameterSpec: spec } = record.type ? this.connectors?.[record.type] : {}
|
|
204
204
|
const context = this.grist
|
|
205
205
|
return { name, help, spec, context }
|
|
206
|
-
}
|
|
206
|
+
},
|
|
207
|
+
renderer: 'json5'
|
|
207
208
|
},
|
|
208
209
|
width: 100
|
|
209
210
|
},
|
|
@@ -239,18 +240,6 @@ export class Connection extends connect(store)(localize(i18next)(PageView)) {
|
|
|
239
240
|
}
|
|
240
241
|
]
|
|
241
242
|
}
|
|
242
|
-
|
|
243
|
-
await this.updateComplete
|
|
244
|
-
|
|
245
|
-
this.grist.fetch()
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
async pageUpdated(changes, lifecycle) {
|
|
249
|
-
if (this.active) {
|
|
250
|
-
await this.updateComplete
|
|
251
|
-
|
|
252
|
-
this.grist.fetch()
|
|
253
|
-
}
|
|
254
243
|
}
|
|
255
244
|
|
|
256
245
|
async fetchHandler({ page, limit, sortings = [], filters = [] }) {
|
|
@@ -364,13 +353,6 @@ export class Connection extends connect(store)(localize(i18next)(PageView)) {
|
|
|
364
353
|
}
|
|
365
354
|
}
|
|
366
355
|
|
|
367
|
-
async stateChanged(state) {
|
|
368
|
-
if (this.active && this._currentPopupName && !state.layout.viewparts[this._currentPopupName]) {
|
|
369
|
-
this.grist.fetch()
|
|
370
|
-
this._currentPopupName = null
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
|
|
374
356
|
async _updateConnectionManager() {
|
|
375
357
|
let patches = this.grist.dirtyRecords
|
|
376
358
|
if (patches && patches.length) {
|
|
@@ -66,8 +66,6 @@ class ScenarioDetail extends localize(i18next)(LitElement) {
|
|
|
66
66
|
`
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
async updated(changedProps) {}
|
|
70
|
-
|
|
71
69
|
async firstUpdated() {
|
|
72
70
|
this.select = ['name', 'description', 'sequence', 'task', 'connection', 'params', 'skip', 'log']
|
|
73
71
|
this.gristConfig = {
|
|
@@ -179,7 +177,8 @@ class ScenarioDetail extends localize(i18next)(LitElement) {
|
|
|
179
177
|
var { name, parameterSpec: spec, help } = record.task ? this.taskTypes?.[record.task] : {}
|
|
180
178
|
const context = this.dataGrist
|
|
181
179
|
return { name, spec, help, context }
|
|
182
|
-
}
|
|
180
|
+
},
|
|
181
|
+
renderer: 'json5'
|
|
183
182
|
},
|
|
184
183
|
width: 200
|
|
185
184
|
}
|
|
@@ -206,7 +205,7 @@ class ScenarioDetail extends localize(i18next)(LitElement) {
|
|
|
206
205
|
query {
|
|
207
206
|
steps (
|
|
208
207
|
filters: {
|
|
209
|
-
name: "
|
|
208
|
+
name: "scenarioId",
|
|
210
209
|
value: "${this.scenario.id}",
|
|
211
210
|
operator: "eq"
|
|
212
211
|
},
|
|
@@ -222,8 +221,6 @@ class ScenarioDetail extends localize(i18next)(LitElement) {
|
|
|
222
221
|
`
|
|
223
222
|
})
|
|
224
223
|
|
|
225
|
-
this.requestRefresh()
|
|
226
|
-
|
|
227
224
|
return {
|
|
228
225
|
total: response.data.steps.total || 0,
|
|
229
226
|
records: response.data.steps.items || []
|
|
@@ -283,7 +280,10 @@ class ScenarioDetail extends localize(i18next)(LitElement) {
|
|
|
283
280
|
}
|
|
284
281
|
})
|
|
285
282
|
|
|
286
|
-
if (!response.errors)
|
|
283
|
+
if (!response.errors) {
|
|
284
|
+
this.dataGrist.fetch()
|
|
285
|
+
this.requestRefresh()
|
|
286
|
+
}
|
|
287
287
|
}
|
|
288
288
|
}
|
|
289
289
|
|
|
@@ -307,6 +307,8 @@ class ScenarioDetail extends localize(i18next)(LitElement) {
|
|
|
307
307
|
if (response.errors) return
|
|
308
308
|
|
|
309
309
|
this.dataGrist.fetch()
|
|
310
|
+
this.requestRefresh()
|
|
311
|
+
|
|
310
312
|
await document.dispatchEvent(
|
|
311
313
|
new CustomEvent('notify', {
|
|
312
314
|
detail: {
|
package/client/pages/scenario.js
CHANGED
|
@@ -114,32 +114,9 @@ export class Scenario extends connect(store)(localize(i18next)(PageView)) {
|
|
|
114
114
|
return this.renderRoot.querySelector('ox-grist')
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
// update with url params value
|
|
118
|
-
_updateSearchConfig(lifecycle) {
|
|
119
|
-
// this.searchConfig = this.searchConfig.map(conf => {
|
|
120
|
-
// if (conf.name in lifecycle.params) {
|
|
121
|
-
// conf.value = lifecycle.params[conf.name]
|
|
122
|
-
// } else {
|
|
123
|
-
// delete conf.value
|
|
124
|
-
// }
|
|
125
|
-
// return conf
|
|
126
|
-
// })
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
// set default field value to record with searchConfig
|
|
130
|
-
_setDefaultFieldsValue(fields) {
|
|
131
|
-
// this.searchConfig.forEach(conf => {
|
|
132
|
-
// if (!fields[conf.name] && conf.value) {
|
|
133
|
-
// fields[conf.name] = conf.value
|
|
134
|
-
// }
|
|
135
|
-
// })
|
|
136
|
-
}
|
|
137
|
-
|
|
138
117
|
async pageInitialized(lifecycle) {
|
|
139
118
|
this.fetchTaskTypes()
|
|
140
119
|
|
|
141
|
-
this._updateSearchConfig(lifecycle)
|
|
142
|
-
|
|
143
120
|
this.gristConfig = {
|
|
144
121
|
list: { fields: ['name', 'description', 'schedule', 'active'] },
|
|
145
122
|
columns: [
|
|
@@ -297,21 +274,13 @@ export class Scenario extends connect(store)(localize(i18next)(PageView)) {
|
|
|
297
274
|
}
|
|
298
275
|
]
|
|
299
276
|
}
|
|
300
|
-
|
|
301
|
-
await this.updateComplete
|
|
302
|
-
|
|
303
|
-
this.grist.fetch()
|
|
304
277
|
}
|
|
305
278
|
|
|
306
|
-
async pageUpdated(changes, lifecycle) {
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
this.grist.fetch()
|
|
313
|
-
}
|
|
314
|
-
}
|
|
279
|
+
// async pageUpdated(changes, lifecycle) {
|
|
280
|
+
// if (this.active) {
|
|
281
|
+
// this.grist.fetch()
|
|
282
|
+
// }
|
|
283
|
+
// }
|
|
315
284
|
|
|
316
285
|
async fetchHandler({ page, limit, sortings = [], filters = [] }) {
|
|
317
286
|
const response = await client.query({
|
|
@@ -417,13 +386,6 @@ export class Scenario extends connect(store)(localize(i18next)(PageView)) {
|
|
|
417
386
|
}
|
|
418
387
|
}
|
|
419
388
|
|
|
420
|
-
async stateChanged(state) {
|
|
421
|
-
if (this.active && this._currentPopupName && !state.layout.viewparts[this._currentPopupName]) {
|
|
422
|
-
this.grist.fetch()
|
|
423
|
-
this._currentPopupName = null
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
|
|
427
389
|
async _copyScenario() {
|
|
428
390
|
var selected = this.grist.selected
|
|
429
391
|
if (selected.length == 0) return
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/integration-ui",
|
|
3
|
-
"version": "5.0.0-
|
|
3
|
+
"version": "5.0.0-zeta.1",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -24,20 +24,20 @@
|
|
|
24
24
|
"migration:create": "node ../../node_modules/typeorm/cli.js migration:create -d ./server/migrations"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@operato/app": "^1.0.0-
|
|
28
|
-
"@operato/data-grist": "1.0.0-
|
|
29
|
-
"@operato/graphql": "1.0.0-
|
|
30
|
-
"@operato/help": "1.0.0-
|
|
31
|
-
"@operato/i18n": "1.0.0-
|
|
32
|
-
"@operato/layout": "1.0.0-
|
|
33
|
-
"@operato/property-editor": "1.0.0-
|
|
34
|
-
"@operato/styles": "1.0.0-
|
|
35
|
-
"@operato/utils": "1.0.0-
|
|
36
|
-
"@things-factory/export-base": "^5.0.0-
|
|
37
|
-
"@things-factory/import-base": "^5.0.0-
|
|
38
|
-
"@things-factory/integration-base": "^5.0.0-
|
|
27
|
+
"@operato/app": "^1.0.0-beta.30",
|
|
28
|
+
"@operato/data-grist": "1.0.0-beta.30",
|
|
29
|
+
"@operato/graphql": "1.0.0-beta.30",
|
|
30
|
+
"@operato/help": "1.0.0-beta.30",
|
|
31
|
+
"@operato/i18n": "1.0.0-beta.30",
|
|
32
|
+
"@operato/layout": "1.0.0-beta.30",
|
|
33
|
+
"@operato/property-editor": "1.0.0-beta.30",
|
|
34
|
+
"@operato/styles": "1.0.0-beta.30",
|
|
35
|
+
"@operato/utils": "1.0.0-beta.30",
|
|
36
|
+
"@things-factory/export-base": "^5.0.0-zeta.1",
|
|
37
|
+
"@things-factory/import-base": "^5.0.0-zeta.1",
|
|
38
|
+
"@things-factory/integration-base": "^5.0.0-zeta.1",
|
|
39
39
|
"moment-timezone": "^0.5.27",
|
|
40
40
|
"subscriptions-transport-ws": "^0.11.0"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "7b69e48d7a0441c5dda884cc895914a6ae3b1c27"
|
|
43
43
|
}
|