🐛 Fix malformed YAML in export menu (#482)

This commit is contained in:
Alicia Sykes 2022-02-09 18:27:48 +00:00
parent c4f1be2b76
commit 86837105cf
2 changed files with 8 additions and 14 deletions

View File

@ -65,7 +65,6 @@
<script> <script>
import JsonToYaml from '@/utils/JsonToYaml';
import { localStorageKeys, modalNames } from '@/utils/defaults'; import { localStorageKeys, modalNames } from '@/utils/defaults';
import { getUsersLanguage } from '@/utils/ConfigHelpers'; import { getUsersLanguage } from '@/utils/ConfigHelpers';
import StoreKeys from '@/utils/StoreMutations'; import StoreKeys from '@/utils/StoreMutations';
@ -88,7 +87,6 @@ export default {
name: 'ConfigContainer', name: 'ConfigContainer',
data() { data() {
return { return {
jsonParser: JsonToYaml,
backupId: localStorage[localStorageKeys.BACKUP_ID] || '', backupId: localStorage[localStorageKeys.BACKUP_ID] || '',
appVersion: process.env.VUE_APP_VERSION, appVersion: process.env.VUE_APP_VERSION,
latestVersion: '', latestVersion: '',
@ -101,9 +99,6 @@ export default {
sections: function getSections() { sections: function getSections() {
return this.config.sections; return this.config.sections;
}, },
yaml() {
return this.jsonParser(this.config);
},
}, },
components: { components: {
JsonEditor, JsonEditor,

View File

@ -1,9 +1,9 @@
<template> <template>
<pre><code>{{ jsonParser(config) }}</code></pre> <pre><code>{{ yamlConfig }}</code></pre>
</template> </template>
<script> <script>
import JsonToYaml from '@/utils/JsonToYaml'; import JsYaml from 'js-yaml';
export default { export default {
name: 'DownloadConfig', name: 'DownloadConfig',
@ -11,11 +11,9 @@ export default {
config() { config() {
return this.$store.state.config; return this.$store.state.config;
}, },
}, yamlConfig() {
data() { return JsYaml.dump(this.config);
return { },
jsonParser: JsonToYaml,
};
}, },
}; };
@ -23,8 +21,9 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
pre { pre {
background: var(--code-editor-background); margin: 0;
color: var(--code-editor-color);
padding: 1rem; padding: 1rem;
color: var(--code-editor-color);
background: var(--code-editor-background);
} }
</style> </style>