Merge pull request #134 from uxbox/other/dynamic-config

🎉 Make the build to be config independent.
This commit is contained in:
Alonso Torres 2020-03-11 09:30:22 +01:00 committed by GitHub
commit 4ee138f71e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 38 additions and 21 deletions

View file

@ -2,10 +2,15 @@
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; Copyright (c) 2016 Andrey Antukh <niwi@niwi.nz>
;; This Source Code Form is "Incompatible With Secondary Licenses", as
;; defined by the Mozilla Public License, v. 2.0.
;;
;; Copyright (c) 2016-2020 Andrey Antukh <niwi@niwi.nz>
(ns uxbox.config)
(ns uxbox.config
(:require [goog.object :as gobj]))
(goog-define url "")
(goog-define demo-warning false)
(goog-define default-language "en")
(let [config (gobj/get goog.global "uxboxConfig")]
(def default-language "en")
(def url (gobj/get config "apiUrl" "http://localhost:6060/"))
(def demo-warning (gobj/get config "demoWarning" true)))

View file

@ -11,6 +11,7 @@
(:require
[cljs.spec.alpha :as s]
[beicon.core :as rx]
[goog.object :as gobj]
[rumext.alpha :as mf]
[uxbox.main.data.auth :refer [logout]]
[uxbox.main.data.users :as udu]
@ -66,11 +67,12 @@
(def app-sym (.for js/Symbol "uxbox.app"))
(defn ^:export init
[translations]
(i18n/init! (js/JSON.parse translations))
(unchecked-set js/window app-sym "main")
(st/init)
(init-ui))
[]
(let [translations (gobj/get goog.global "uxboxTranslations")]
(i18n/init! translations)
(unchecked-set js/window app-sym "main")
(st/init)
(init-ui)))
(defn reinit
[]

View file

@ -2,6 +2,9 @@
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; This Source Code Form is "Incompatible With Secondary Licenses", as
;; defined by the Mozilla Public License, v. 2.0.
;;
;; Copyright (c) 2015-2019 Andrey Antukh <niwi@niwi.nz>
(ns uxbox.main.data.workspace