@things-factory/integration-ui 5.0.0-zeta.20 → 5.0.0-zeta.21

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.
@@ -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 }) => {
@@ -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({
@@ -458,12 +458,12 @@ export class Scenario extends connect(store)(localize(i18next)(PageView)) {
458
458
  const state = response.data.startScenario.state
459
459
  record.state = state
460
460
 
461
- this.grist.refresh()
462
-
463
461
  notify({
464
462
  level: 'info',
465
463
  message: `${IS_SCENARIO_RUNNING(state) ? 'success' : 'fail'} to start scenario : ${record.name}`
466
464
  })
465
+
466
+ this.grist.fetch()
467
467
  }
468
468
 
469
469
  async stopScenario(record) {
@@ -480,15 +480,19 @@ export class Scenario extends connect(store)(localize(i18next)(PageView)) {
480
480
  }
481
481
  })
482
482
 
483
- const state = response.data.stopScenario.state
484
- record.state = state
485
-
486
- 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
+ }
487
494
 
488
- notify({
489
- level: 'info',
490
- message: `${IS_SCENARIO_RUNNING(state) ? 'fail' : 'success'} to stop scenario : ${record.name}`
491
- })
495
+ this.grist.fetch()
492
496
  }
493
497
 
494
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.20",
3
+ "version": "5.0.0-zeta.21",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -24,21 +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.47",
28
- "@operato/data-grist": "^1.0.0-beta.47",
29
- "@operato/graphql": "^1.0.0-beta.47",
30
- "@operato/grist-editor": "^1.0.0-beta.47",
31
- "@operato/help": "^1.0.0-beta.47",
32
- "@operato/i18n": "^1.0.0-beta.47",
33
- "@operato/layout": "^1.0.0-beta.47",
34
- "@operato/property-editor": "^1.0.0-beta.47",
35
- "@operato/styles": "^1.0.0-beta.47",
36
- "@operato/utils": "^1.0.0-beta.47",
37
- "@things-factory/export-base": "^5.0.0-zeta.20",
38
- "@things-factory/import-base": "^5.0.0-zeta.20",
39
- "@things-factory/integration-base": "^5.0.0-zeta.20",
40
- "moment-timezone": "^0.5.27",
41
- "subscriptions-transport-ws": "^0.11.0"
27
+ "@operato/app": "^1.0.0-beta.48",
28
+ "@operato/data-grist": "^1.0.0-beta.48",
29
+ "@operato/graphql": "^1.0.0-beta.48",
30
+ "@operato/grist-editor": "^1.0.0-beta.48",
31
+ "@operato/help": "^1.0.0-beta.48",
32
+ "@operato/i18n": "^1.0.0-beta.48",
33
+ "@operato/layout": "^1.0.0-beta.48",
34
+ "@operato/property-editor": "^1.0.0-beta.48",
35
+ "@operato/styles": "^1.0.0-beta.48",
36
+ "@operato/utils": "^1.0.0-beta.48",
37
+ "@things-factory/export-base": "^5.0.0-zeta.21",
38
+ "@things-factory/import-base": "^5.0.0-zeta.21",
39
+ "@things-factory/integration-base": "^5.0.0-zeta.21",
40
+ "moment-timezone": "^0.5.27"
42
41
  },
43
- "gitHead": "34981af408c52ca2472fdbd70ea3b5fbe0ab4073"
42
+ "gitHead": "a63dd238090dc87e77ea07dac34e818d31a277f2"
44
43
  }