Skip to content

Commit 8683710

Browse files
committed
🐛 Fix malformed YAML in export menu (gchq#482)
1 parent c4f1be2 commit 8683710

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

src/components/Configuration/ConfigContainer.vue

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565

6666
<script>
6767
68-
import JsonToYaml from '@/utils/JsonToYaml';
6968
import { localStorageKeys, modalNames } from '@/utils/defaults';
7069
import { getUsersLanguage } from '@/utils/ConfigHelpers';
7170
import StoreKeys from '@/utils/StoreMutations';
@@ -88,7 +87,6 @@ export default {
8887
name: 'ConfigContainer',
8988
data() {
9089
return {
91-
jsonParser: JsonToYaml,
9290
backupId: localStorage[localStorageKeys.BACKUP_ID] || '',
9391
appVersion: process.env.VUE_APP_VERSION,
9492
latestVersion: '',
@@ -101,9 +99,6 @@ export default {
10199
sections: function getSections() {
102100
return this.config.sections;
103101
},
104-
yaml() {
105-
return this.jsonParser(this.config);
106-
},
107102
},
108103
components: {
109104
JsonEditor,

src/views/DownloadConfig.vue

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,29 @@
11
<template>
2-
<pre><code>{{ jsonParser(config) }}</code></pre>
2+
<pre><code>{{ yamlConfig }}</code></pre>
33
</template>
44

55
<script>
6-
import JsonToYaml from '@/utils/JsonToYaml';
6+
import JsYaml from 'js-yaml';
77
88
export default {
99
name: 'DownloadConfig',
1010
computed: {
1111
config() {
1212
return this.$store.state.config;
1313
},
14-
},
15-
data() {
16-
return {
17-
jsonParser: JsonToYaml,
18-
};
14+
yamlConfig() {
15+
return JsYaml.dump(this.config);
16+
},
1917
},
2018
};
2119
2220
</script>
2321

2422
<style scoped lang="scss">
2523
pre {
26-
background: var(--code-editor-background);
27-
color: var(--code-editor-color);
24+
margin: 0;
2825
padding: 1rem;
26+
color: var(--code-editor-color);
27+
background: var(--code-editor-background);
2928
}
3029
</style>

0 commit comments

Comments
 (0)