File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed
bundles/org.openhab.ui/web/src/pages/developer Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 101
101
</style >
102
102
103
103
<script >
104
- import YAML , { Schema } from ' yaml'
104
+ import YAML from ' yaml'
105
105
106
106
import BlocklyEditor from ' @/components/config/controls/blockly-editor.vue'
107
107
import BlockPreview from ' ./block-preview.vue'
108
108
import DirtyMixin from ' @/pages/settings/dirty-mixin'
109
109
110
- Schema . toStringDefaults . lineWidth = 0
110
+ const toStringOptions = { toStringDefaults : { lineWidth : 0 } }
111
111
112
112
export default {
113
113
mixins: [DirtyMixin],
@@ -138,7 +138,7 @@ export default {
138
138
blocks () {
139
139
try {
140
140
if (! this .blocksDefinition ) return {}
141
- return YAML .parse (this .blocksDefinition , { prettyErrors: true })
141
+ return YAML .parse (this .blocksDefinition , { prettyErrors: true , toStringOptions })
142
142
} catch (e) {
143
143
return { component: ' Error' , config: { error: e .message } }
144
144
}
@@ -281,14 +281,14 @@ export default {
281
281
}
282
282
]
283
283
}
284
- })
284
+ }, { toStringOptions } )
285
285
this .$nextTick (() => {
286
286
this .loading = false
287
287
this .ready = true
288
288
})
289
289
} else {
290
290
this .$oh .api .get (' /rest/ui/components/ui:blocks/' + this .uid ).then ((data ) => {
291
- this .$set (this , ' blocksDefinition' , YAML .stringify (data))
291
+ this .$set (this , ' blocksDefinition' , YAML .stringify (data, { toStringOptions } ))
292
292
this .$nextTick (() => {
293
293
this .loading = false
294
294
this .ready = true
Original file line number Diff line number Diff line change 100
100
</style >
101
101
102
102
<script >
103
- import YAML , { Schema } from ' yaml'
103
+ import YAML from ' yaml'
104
104
105
105
import ConfigSheet from ' @/components/config/config-sheet.vue'
106
106
import DirtyMixin from ' @/pages/settings/dirty-mixin'
107
107
108
108
import * as StandardListWidgets from ' @/components/widgets/standard/list'
109
109
110
- Schema . toStringDefaults . lineWidth = 0
110
+ const toStringOptions = { toStringDefaults : { lineWidth : 0 } }
111
111
112
112
export default {
113
113
mixins: [DirtyMixin],
@@ -152,7 +152,7 @@ export default {
152
152
widget () {
153
153
try {
154
154
if (! this .widgetDefinition ) return {}
155
- return YAML .parse (this .widgetDefinition , { prettyErrors: true })
155
+ return YAML .parse (this .widgetDefinition , { prettyErrors: true , toStringOptions })
156
156
} catch (e) {
157
157
return { component: ' Error' , config: { error: e .message } }
158
158
}
@@ -235,14 +235,14 @@ export default {
235
235
footer: ' =props.prop1' ,
236
236
content: ' =items[props.item].displayState || items[props.item].state'
237
237
}
238
- })
238
+ }, { toStringOptions } )
239
239
this .$nextTick (() => {
240
240
this .loading = false
241
241
this .ready = true
242
242
})
243
243
} else {
244
244
this .$oh .api .get (' /rest/ui/components/ui:widget/' + this .uid ).then ((data ) => {
245
- this .$set (this , ' widgetDefinition' , YAML .stringify (data))
245
+ this .$set (this , ' widgetDefinition' , YAML .stringify (data, { toStringOptions } ))
246
246
this .$nextTick (() => {
247
247
this .loading = false
248
248
this .ready = true
You can’t perform that action at this time.
0 commit comments