Merge configs and create global config file if not present

- Cleanup repo and global config with system components
- test merging
- fix edge cases
This commit is contained in:
Gabriel Horner
2022-09-02 22:43:41 -04:00
committed by Andelf
parent cbcc19309d
commit b1d210d26b
22 changed files with 415 additions and 267 deletions

View File

@@ -15,6 +15,7 @@
[frontend.handler.user :as user-handler]
[frontend.handler.plugin :as plugin-handler]
[frontend.handler.file-sync :as file-sync-handler]
[frontend.handler.global-config :as global-config-handler]
[frontend.modules.instrumentation.core :as instrument]
[frontend.modules.shortcut.data-helper :as shortcut-helper]
[frontend.state :as state]
@@ -140,7 +141,7 @@
(row-with-button-action
{:left-label (t :settings-page/custom-configuration)
:button-label (t :settings-page/edit-config-edn)
:href (rfe/href :file {:path (config/get-config-path)})
:href (rfe/href :file {:path (config/get-repo-config-path)})
:on-click #(js/setTimeout (fn [] (ui-handler/toggle-settings-modal!)))
:-for "config_edn"}))
@@ -148,7 +149,7 @@
(row-with-button-action
{:left-label (t :settings-page/custom-global-configuration)
:button-label (t :settings-page/edit-global-config-edn)
:href (rfe/href :file {:path (config/get-global-config-path)})
:href (rfe/href :file {:path (global-config-handler/global-config-path)})
:on-click #(js/setTimeout (fn [] (ui-handler/toggle-settings-modal!)))
:-for "global_config_edn"}))
@@ -546,7 +547,7 @@
(version-row t version)
(language-row t preferred-language)
(theme-modes-row t switch-theme system-theme? dark?)
(when (util/electron?) (edit-global-config-edn))
(when (config/global-config-enabled?) (edit-global-config-edn))
(when current-repo (edit-config-edn))
(when current-repo (edit-custom-css))
(when current-repo (edit-export-css))