From 3c9e5bd3695f81ad6ead7aa8cda8c7ebf003119b Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Tue, 16 Apr 2024 16:50:06 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=20Less=20confusing=20handling=20of=20?= =?UTF-8?q?local=20config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/locales/en.json | 6 +- .../Configuration/ConfigContainer.vue | 20 ++++-- .../InteractiveEditor/ExportConfigMenu.vue | 20 ++++++ ...hortcutInfo.vue => LocalConfigWarning.vue} | 71 ++++++++++++++++--- src/store.js | 12 +++- src/utils/StoreMutations.js | 1 + src/utils/defaults.js | 2 +- src/views/Home.vue | 4 ++ 8 files changed, 116 insertions(+), 20 deletions(-) rename src/components/Settings/{KeyboardShortcutInfo.vue => LocalConfigWarning.vue} (55%) diff --git a/src/assets/locales/en.json b/src/assets/locales/en.json index 04e854ad..d6b119f9 100644 --- a/src/assets/locales/en.json +++ b/src/assets/locales/en.json @@ -171,9 +171,9 @@ "status-fail-msg": "Task Failed", "success-msg-disk": "Config file written to disk successfully", "success-msg-local": "Local changes saved successfully", - "success-note-l1": "The app should rebuild automatically.", - "success-note-l2": "This may take up to a minute.", - "success-note-l3": "You will need to refresh the page for changes to take effect.", + "success-note-l1": "You will need to refresh the page for changes to take effect.", + "success-note-l2": "", + "success-note-l3": "", "error-msg-save-mode": "Please select a Save Mode: Local or File", "error-msg-cannot-save": "An error occurred saving config", "error-msg-bad-json": "Error in JSON, possibly malformed", diff --git a/src/components/Configuration/ConfigContainer.vue b/src/components/Configuration/ConfigContainer.vue index 9b08f028..67e70c23 100644 --- a/src/components/Configuration/ConfigContainer.vue +++ b/src/components/Configuration/ConfigContainer.vue @@ -47,16 +47,17 @@

{{ getLanguage() }}

-

- Using Config From
- {{ $store.state.currentConfigInfo.confPath }} + +

+ Using config from + {{ configPath }}

{{ $t('config.disabled-note') }}

-
+
{{ $t('config.backup-note') }}
@@ -116,6 +117,11 @@ export default { enableConfig() { return this.$store.getters.permissions.allowViewConfig; }, + configPath() { + return this.$store.state.currentConfigInfo?.confPath + || process.env.VUE_APP_CONFIG_PATH + || '/conf.yml'; + }, }, components: { Button, @@ -248,8 +254,12 @@ a.hyperlink-wrapper { p.app-version, p.language, p.config-location { margin: 0.5rem auto; font-size: 1rem; - color: var(--transparent-white-50); + color: var(--config-settings-color); cursor: default; + opacity: var(--dimming-factor); + a { + color: var(--config-settings-color); + } } div.code-container { diff --git a/src/components/InteractiveEditor/ExportConfigMenu.vue b/src/components/InteractiveEditor/ExportConfigMenu.vue index 6d316e5d..239703cb 100644 --- a/src/components/InteractiveEditor/ExportConfigMenu.vue +++ b/src/components/InteractiveEditor/ExportConfigMenu.vue @@ -22,6 +22,14 @@ + +
+

Config Location

+

+ The base config file you are currently using is + {{ configPath }} +

+

{{ $t('interactive-editor.export.view-title') }}

@@ -61,6 +69,11 @@ export default { allowViewConfig() { return this.$store.getters.permissions.allowViewConfig; }, + configPath() { + return this.$store.state.currentConfigInfo?.confPath + || process.env.VUE_APP_CONFIG_PATH + || '/conf.yml'; + }, }, methods: { convertJsonToYaml() { @@ -121,6 +134,13 @@ export default { border-bottom: 1px dashed var(--interactive-editor-color); button { margin: 0 1rem; } } + .config-path-info { + p, a { + color: var(--interactive-editor-color); + font-size: 1.2rem; + } + border-bottom: 1px dashed var(--interactive-editor-color); + } .config-tree-view { padding: 0.5rem; font-family: var(--font-monospace); diff --git a/src/components/Settings/KeyboardShortcutInfo.vue b/src/components/Settings/LocalConfigWarning.vue similarity index 55% rename from src/components/Settings/KeyboardShortcutInfo.vue rename to src/components/Settings/LocalConfigWarning.vue index 6659612d..af38d150 100644 --- a/src/components/Settings/KeyboardShortcutInfo.vue +++ b/src/components/Settings/LocalConfigWarning.vue @@ -1,36 +1,70 @@