Skip to content
Snippets Groups Projects
Unverified Commit bed5bfc6 authored by Alexander Polyankin's avatar Alexander Polyankin Committed by GitHub
Browse files

Migrate whitelabel settings that were dependent on custom colors (#23890)

parent 7caca2ec
No related branches found
No related tags found
No related merge requests found
......@@ -89,6 +89,7 @@ if (hasPremiumFeature("whitelabel")) {
key: "show-lighthouse-illustration",
display_name: t`Lighthouse illustration`,
type: "boolean",
defaultValue: true,
},
],
},
......
......@@ -289,13 +289,6 @@
:type :keyword
:default :doing-science)
(defsetting show-metabot
(deferred-tru "Enables Metabot character on the home page")
:visibility :public
:type :boolean
:enabled? premium-features/enable-whitelabeling?
:default true)
(defsetting application-colors-migrated
"Stores whether the `application-colors` setting has been migrated to 0.44 expectations"
:visibility :internal
......@@ -366,6 +359,36 @@
:enabled? premium-features/enable-whitelabeling?
:default "app/assets/img/favicon.ico")
(defn has-custom-branding?
"Whether this instance has custom colors or logo set."
[]
(or (not-empty (application-colors))
(not= (application-logo-url) "app/assets/img/logo.svg")))
(defsetting show-metabot
(deferred-tru "Enables Metabot character on the home page")
:visibility :public
:type :boolean
:enabled? premium-features/enable-whitelabeling?
:getter (fn []
(if-some [value (setting/get-value-of-type :boolean :show-metabot)]
value
(let [new-value (not (has-custom-branding?))]
(setting/set-value-of-type! :boolean :show-metabot new-value)
new-value))))
(defsetting show-lighthouse-illustration
(deferred-tru "Display the lighthouse illustration on the home and login pages.")
:visibility :public
:type :boolean
:enabled? premium-features/enable-whitelabeling?
:getter (fn []
(if-some [value (setting/get-value-of-type :boolean :show-lighthouse-illustration)]
value
(let [new-value (not (has-custom-branding?))]
(setting/set-value-of-type! :boolean :show-lighthouse-illustration new-value)
new-value))))
(defsetting enable-password-login
(deferred-tru "Allow logging in by email and password.")
:visibility :public
......@@ -430,13 +453,6 @@
:default true
:visibility :authenticated)
(defsetting show-lighthouse-illustration
(deferred-tru "Display the lighthouse illustration on the home and login pages.")
:visibility :public
:type :boolean
:enabled? premium-features/enable-whitelabeling?
:default true)
(defsetting source-address-header
(deferred-tru "Identify the source of HTTP requests by this header's value, instead of its remote address.")
:default "X-Forwarded-For"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment