@things-factory/integration-ui 5.0.0-alpha.2 → 5.0.0-alpha.5

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.
@@ -104,7 +104,7 @@ export class ParametersEditorPopup extends LitElement {
104
104
  }
105
105
 
106
106
  onconfirm(e) {
107
- this.confirmCallback && this.confirmCallback(this.value ? JSON.stringify(this.value) : '')
107
+ this.confirmCallback && this.confirmCallback(this.value)
108
108
  history.back()
109
109
  }
110
110
  }
@@ -35,7 +35,8 @@ export class ParametersEditor extends LitElement {
35
35
  }
36
36
 
37
37
  render() {
38
- return html` ${this.value || ''} `
38
+ const value = typeof this.value === 'object' ? JSON.stringify(this.value) : this.value
39
+ return html` ${value || ''} `
39
40
  }
40
41
 
41
42
  async firstUpdated() {
@@ -55,6 +56,14 @@ export class ParametersEditor extends LitElement {
55
56
  delete this.popup
56
57
  }
57
58
 
59
+ var { options } = this.column.record
60
+
61
+ if (typeof options === 'function') {
62
+ options = await options.call(this, this.value, this.column, this.record, this.row, this.field)
63
+ }
64
+
65
+ const { name, help, spec, context, objectified = false } = options
66
+
58
67
  const confirmCallback = newval => {
59
68
  this.dispatchEvent(
60
69
  new CustomEvent('field-change', {
@@ -62,7 +71,7 @@ export class ParametersEditor extends LitElement {
62
71
  composed: true,
63
72
  detail: {
64
73
  before: this.value,
65
- after: newval,
74
+ after: !objectified ? JSON.stringify(newval) : newval,
66
75
  record: this.record,
67
76
  column: this.column,
68
77
  row: this.row
@@ -71,19 +80,12 @@ export class ParametersEditor extends LitElement {
71
80
  )
72
81
  }
73
82
 
74
- var { options } = this.column.record
75
- if (typeof options === 'function') {
76
- options = await options.call(this, this.value, this.column, this.record, this.row, this.field)
77
- }
78
-
79
83
  try {
80
- var value = JSON.parse(this.value)
84
+ var value = !objectified && typeof this.value === 'string' ? JSON.parse(this.value) : this.value
81
85
  } catch (e) {
82
86
  var value = {}
83
87
  }
84
88
 
85
- const { name, help, spec, context } = options
86
-
87
89
  /*
88
90
  주의 : 이 팝업 템플릿은 layout 모듈에 의해서 render 되므로,
89
91
  layout의 구성에 변화가 발생하면, 다시 render된다.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/integration-ui",
3
- "version": "5.0.0-alpha.2",
3
+ "version": "5.0.0-alpha.5",
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/data-grist": "^0.4.3",
28
- "@operato/graphql": "^0.4.3",
29
- "@operato/help": "^0.4.3",
30
- "@operato/i18n": "^0.4.3",
31
- "@operato/layout": "^0.4.3",
32
- "@operato/property-editor": "^0.4.3",
33
- "@operato/styles": "^0.4.3",
34
- "@operato/utils": "^0.4.3",
35
- "@things-factory/export-base": "^5.0.0-alpha.2",
36
- "@things-factory/import-base": "^5.0.0-alpha.2",
37
- "@things-factory/integration-base": "^5.0.0-alpha.2",
38
- "@things-factory/modeller-ui": "^5.0.0-alpha.2",
27
+ "@operato/data-grist": "1.0.0-alpha.4",
28
+ "@operato/graphql": "1.0.0-alpha.4",
29
+ "@operato/help": "1.0.0-alpha.4",
30
+ "@operato/i18n": "1.0.0-alpha.4",
31
+ "@operato/layout": "1.0.0-alpha.4",
32
+ "@operato/property-editor": "1.0.0-alpha.4",
33
+ "@operato/styles": "1.0.0-alpha.4",
34
+ "@operato/utils": "1.0.0-alpha.4",
35
+ "@things-factory/export-base": "^5.0.0-alpha.5",
36
+ "@things-factory/import-base": "^5.0.0-alpha.5",
37
+ "@things-factory/integration-base": "^5.0.0-alpha.5",
38
+ "@things-factory/modeller-ui": "^5.0.0-alpha.5",
39
39
  "moment-timezone": "^0.5.27",
40
40
  "subscriptions-transport-ws": "^0.11.0"
41
41
  },
42
- "gitHead": "055536f981d229d51ae63f46585036b35fa86602"
42
+ "gitHead": "379449b7be7b3d8220f1cac9ab684b812117edfd"
43
43
  }