@things-factory/integration-ui 5.0.0-zeta.8 → 5.0.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.
@@ -2,15 +2,15 @@ import '@material/mwc-icon'
2
2
  import './editors/entity-editor'
3
3
  import './editors/property-editor'
4
4
 
5
+ import { OxGristEditorJson } from '@operato/app/grist-editor/ox-grist-editor-json.js'
6
+ import { OxGristRendererCrontab } from '@operato/app/grist-editor/ox-grist-renderer-crontab.js'
5
7
  import { registerEditor as registerGristEditor, registerRenderer as registerGristRenderer } from '@operato/data-grist'
8
+ import { OxGristEditorCrontab } from '@operato/grist-editor/ox-grist-editor-crontab.js'
9
+ import { OxGristEditorParameters } from '@operato/grist-editor/ox-grist-editor-parameters.js'
10
+ import { OxPropertyEditor } from '@operato/property-editor'
6
11
 
7
12
  import { ConnectionSelector } from './grist/connection-selector'
8
13
  import { ConnectorSelector } from './grist/connector-selector'
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'
13
- import { OxPropertyEditor } from '@operato/property-editor'
14
14
  import { TaskTypeSelector } from './grist/task-type-selector'
15
15
 
16
16
  export default function bootstrap() {
@@ -14,12 +14,12 @@ export class PropertyEditorEntitySelector extends OxPropertyEditor {
14
14
  return [...OxPropertyEditor.styles]
15
15
  }
16
16
 
17
- editorTemplate(props) {
17
+ editorTemplate(value, spec) {
18
18
  return html`
19
19
  <things-editor-entity-selector
20
20
  id="editor"
21
- .value=${props.value}
22
- .properties=${props.property}
21
+ .value=${value}
22
+ .properties=${spec.property}
23
23
  ></things-editor-entity-selector>
24
24
  `
25
25
  }
@@ -14,13 +14,13 @@ export class PropertyEditorScenarioStepInput extends OxPropertyEditor {
14
14
  return [...OxPropertyEditor.styles]
15
15
  }
16
16
 
17
- editorTemplate(props) {
17
+ editorTemplate(value, spec) {
18
18
  /* context must be a datagrid(grist) instance, and host must be a record */
19
- const { context: grid, host: record } = props
19
+ const { context: grid, host: record } = spec
20
20
  const steps = grid?.dirtyData.records.filter(rec => rec.name !== record.name).map(rec => rec.name) || []
21
21
 
22
22
  return html`
23
- <input id="editor" .value=${props.value || ''} list="step-list" />
23
+ <input id="editor" .value=${value || ''} list="step-list" />
24
24
  <datalist id="step-list">${steps.map(id => html` <option value=${id}></option> `)}</datalist>
25
25
  `
26
26
  }
@@ -33,13 +33,9 @@ export class PropertyEditorHttpHeaders extends OxPropertyEditor {
33
33
  return [...OxPropertyEditor.styles]
34
34
  }
35
35
 
36
- editorTemplate(props) {
36
+ editorTemplate(value, spec) {
37
37
  return html`
38
- <things-editor-http-headers
39
- id="editor"
40
- .value=${props.value}
41
- .properties=${props.property}
42
- ></things-editor-http-headers>
38
+ <things-editor-http-headers id="editor" .value=${value} .properties=${spec.property}></things-editor-http-headers>
43
39
  `
44
40
  }
45
41
  }
@@ -51,12 +47,12 @@ export class PropertyEditorHttpParameters extends OxPropertyEditor {
51
47
  return [...OxPropertyEditor.styles]
52
48
  }
53
49
 
54
- editorTemplate(props) {
50
+ editorTemplate(value, spec) {
55
51
  return html`
56
52
  <things-editor-http-parameters
57
53
  id="editor"
58
- .value=${props.value}
59
- .properties=${props.property}
54
+ .value=${value}
55
+ .properties=${spec.property}
60
56
  ></things-editor-http-parameters>
61
57
  `
62
58
  }
@@ -69,13 +65,9 @@ export class PropertyEditorHttpBody extends OxPropertyEditor {
69
65
  return [...OxPropertyEditor.styles]
70
66
  }
71
67
 
72
- editorTemplate(props) {
68
+ editorTemplate(value, spec) {
73
69
  return html`
74
- <things-editor-http-body
75
- id="editor"
76
- .value=${props.value}
77
- .properties=${props.property}
78
- ></things-editor-http-body>
70
+ <things-editor-http-body id="editor" .value=${value} .properties=${spec.property}></things-editor-http-body>
79
71
  `
80
72
  }
81
73
  }
@@ -78,7 +78,7 @@ export class Connection extends connect(store)(localize(i18next)(PageView)) {
78
78
  .fetchHandler=${this.fetchHandler.bind(this)}
79
79
  >
80
80
  <div slot="headroom" id="filters">
81
- <ox-filters-form></ox-filters-form>
81
+ <ox-filters-form autofocus></ox-filters-form>
82
82
  </div>
83
83
  </ox-grist>
84
84
  `
@@ -195,21 +195,21 @@ export class IntegrationMonitor extends localize(i18next)(PageView) {
195
195
 
196
196
  this.scenarioInstanceStateSubscription = await subscribe(
197
197
  {
198
- query: `
199
- subscription {
200
- scenarioInstanceState {
201
- instanceName
202
- scenarioName
203
- state
204
- progress {
205
- rate
206
- steps
207
- step
208
- rounds
209
- }
198
+ query: gql`
199
+ subscription {
200
+ scenarioInstanceState {
201
+ instanceName
202
+ scenarioName
203
+ state
204
+ progress {
205
+ rate
206
+ steps
207
+ step
208
+ rounds
210
209
  }
211
210
  }
212
- `
211
+ }
212
+ `
213
213
  },
214
214
  {
215
215
  next: async ({ data }) => {
@@ -246,24 +246,33 @@ export class IntegrationMonitor extends localize(i18next)(PageView) {
246
246
  this.scenarios.splice(this.scenarios.indexOf(scenario), 1, { ...scenario })
247
247
  this.scenarios = [...this.scenarios]
248
248
  }
249
+ },
250
+ start: subscription => {
251
+ console.log(subscription)
252
+ },
253
+ error: error => {
254
+ console.log(error)
255
+ },
256
+ complete: () => {
257
+ console.log('complete')
249
258
  }
250
259
  }
251
260
  )
252
261
 
253
262
  this.scenarioQueueStateSubscription = await subscribe(
254
263
  {
255
- query: `
256
- subscription {
257
- scenarioQueueState {
258
- queue {
259
- stuff
260
- due
261
- priority
262
- tag
263
- }
264
+ query: gql`
265
+ subscription {
266
+ scenarioQueueState {
267
+ queue {
268
+ stuff
269
+ due
270
+ priority
271
+ tag
264
272
  }
265
273
  }
266
- `
274
+ }
275
+ `
267
276
  },
268
277
  {
269
278
  next: ({ data }) => {
@@ -276,17 +285,17 @@ export class IntegrationMonitor extends localize(i18next)(PageView) {
276
285
 
277
286
  this.connectionStateSubscription = await subscribe(
278
287
  {
279
- query: `
280
- subscription {
281
- connectionState {
282
- id,
283
- name,
284
- description,
285
- type,
286
- state
287
- }
288
+ query: gql`
289
+ subscription {
290
+ connectionState {
291
+ id
292
+ name
293
+ description
294
+ type
295
+ state
288
296
  }
289
- `
297
+ }
298
+ `
290
299
  },
291
300
  {
292
301
  next: async ({ data }) => {
@@ -104,7 +104,7 @@ export class Scenario extends connect(store)(localize(i18next)(PageView)) {
104
104
  .fetchHandler=${this.fetchHandler.bind(this)}
105
105
  >
106
106
  <div slot="headroom" id="filters">
107
- <ox-filters-form></ox-filters-form>
107
+ <ox-filters-form autofocus></ox-filters-form>
108
108
  </div>
109
109
  </ox-grist>
110
110
  `
@@ -276,11 +276,11 @@ export class Scenario extends connect(store)(localize(i18next)(PageView)) {
276
276
  }
277
277
  }
278
278
 
279
- // async pageUpdated(changes, lifecycle) {
280
- // if (this.active) {
281
- // this.grist.fetch()
282
- // }
283
- // }
279
+ async pageUpdated(changes, lifecycle) {
280
+ if (this.active) {
281
+ this.grist.fetch()
282
+ }
283
+ }
284
284
 
285
285
  async fetchHandler({ page, limit, sortings = [], filters = [] }) {
286
286
  const response = await client.query({
@@ -418,7 +418,6 @@ export class Scenario extends connect(store)(localize(i18next)(PageView)) {
418
418
  patchField[key] = dirtyFields[key].after
419
419
  }
420
420
  }
421
- this._setDefaultFieldsValue(patchField)
422
421
  patchField.cuFlag = patch.__dirty__
423
422
 
424
423
  return patchField
@@ -459,12 +458,12 @@ export class Scenario extends connect(store)(localize(i18next)(PageView)) {
459
458
  const state = response.data.startScenario.state
460
459
  record.state = state
461
460
 
462
- this.grist.refresh()
463
-
464
461
  notify({
465
462
  level: 'info',
466
463
  message: `${IS_SCENARIO_RUNNING(state) ? 'success' : 'fail'} to start scenario : ${record.name}`
467
464
  })
465
+
466
+ this.grist.fetch()
468
467
  }
469
468
 
470
469
  async stopScenario(record) {
@@ -481,15 +480,19 @@ export class Scenario extends connect(store)(localize(i18next)(PageView)) {
481
480
  }
482
481
  })
483
482
 
484
- const state = response.data.stopScenario.state
485
- record.state = state
486
-
487
- this.grist.refresh()
483
+ if (!response.errors) {
484
+ notify({
485
+ level: 'info',
486
+ message: `success to stop scenario : ${record.name}`
487
+ })
488
+ } else {
489
+ notify({
490
+ level: 'error',
491
+ message: `${response.errors.map(error => error.message).join('\n')}`
492
+ })
493
+ }
488
494
 
489
- notify({
490
- level: 'info',
491
- message: `${IS_SCENARIO_RUNNING(state) ? 'fail' : 'success'} to stop scenario : ${record.name}`
492
- })
495
+ this.grist.fetch()
493
496
  }
494
497
 
495
498
  async exportHandler() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/integration-ui",
3
- "version": "5.0.0-zeta.8",
3
+ "version": "5.0.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-beta.39",
28
- "@operato/data-grist": "^1.0.0-beta.39",
29
- "@operato/graphql": "^1.0.0-beta.39",
30
- "@operato/help": "^1.0.0-beta.39",
31
- "@operato/i18n": "^1.0.0-beta.39",
32
- "@operato/layout": "^1.0.0-beta.39",
33
- "@operato/property-editor": "^1.0.0-beta.39",
34
- "@operato/styles": "^1.0.0-beta.39",
35
- "@operato/utils": "^1.0.0-beta.39",
36
- "@things-factory/export-base": "^5.0.0-zeta.8",
37
- "@things-factory/import-base": "^5.0.0-zeta.8",
38
- "@things-factory/integration-base": "^5.0.0-zeta.8",
39
- "moment-timezone": "^0.5.27",
40
- "subscriptions-transport-ws": "^0.11.0"
27
+ "@operato/app": "^1.0.1",
28
+ "@operato/data-grist": "^1.0.1",
29
+ "@operato/graphql": "^1.0.0",
30
+ "@operato/grist-editor": "^1.0.0",
31
+ "@operato/help": "^1.0.1",
32
+ "@operato/i18n": "^1.0.0",
33
+ "@operato/layout": "^1.0.1",
34
+ "@operato/property-editor": "^1.0.0",
35
+ "@operato/styles": "^1.0.0",
36
+ "@operato/utils": "^1.0.1",
37
+ "@things-factory/export-base": "^5.0.1",
38
+ "@things-factory/import-base": "^5.0.1",
39
+ "@things-factory/integration-base": "^5.0.1",
40
+ "moment-timezone": "^0.5.27"
41
41
  },
42
- "gitHead": "486693b3774b872157c83b623579ac63da1ed53c"
42
+ "gitHead": "47225f76058999bb8bb075ac960cfb24f058093f"
43
43
  }