mirror of
https://github.com/penpot/penpot.git
synced 2025-01-08 16:00:19 -05:00
🔧 Minor changes on frontend build config.
This commit is contained in:
parent
70108a0aa7
commit
aa57083afc
3 changed files with 25 additions and 26 deletions
|
@ -101,13 +101,18 @@ function readLocales() {
|
|||
}
|
||||
|
||||
function readConfig() {
|
||||
const apiUrl = process.env.UXBOX_API_URL;
|
||||
const backendURL = process.env.UXBOX_BACKEND_URL;
|
||||
const demoWarn = process.env.UXBOX_DEMO_WARNING;
|
||||
|
||||
return JSON.stringify({
|
||||
apiUrl: (apiUrl === undefined ? "http://localhost:6060" : apiUrl.trim()),
|
||||
demoWarning: demoWarn === "true",
|
||||
});
|
||||
let cfg = {
|
||||
demoWarning: demoWarn === "true"
|
||||
};
|
||||
|
||||
if (backendURL !== undefined) {
|
||||
cfg.backendURL = backendURL;
|
||||
}
|
||||
|
||||
return JSON.stringify(cfg);
|
||||
}
|
||||
|
||||
function templatePipeline(options) {
|
||||
|
|
|
@ -10,7 +10,19 @@
|
|||
(ns uxbox.config
|
||||
(:require [goog.object :as gobj]))
|
||||
|
||||
(let [config (gobj/get goog.global "uxboxConfig")]
|
||||
(defn- get-current-origin
|
||||
[]
|
||||
(let [location (gobj/get goog.global "location")]
|
||||
(gobj/get location "origin")))
|
||||
|
||||
(let [config (gobj/get goog.global "uxboxConfig")
|
||||
backend-url (gobj/get config "backendURL" "http://localhost:6060")]
|
||||
|
||||
(def default-language "en")
|
||||
(def url (gobj/get config "apiUrl" "http://localhost:6060/"))
|
||||
(def demo-warning (gobj/get config "demoWarning" true)))
|
||||
(def demo-warning (gobj/get config "demoWarning" true))
|
||||
|
||||
(def url
|
||||
(if (= backend-url "samesite")
|
||||
(get-current-origin)
|
||||
backend-url)))
|
||||
|
||||
|
|
|
@ -64,24 +64,6 @@
|
|||
|
||||
["/workspace/:file-id" :workspace]])
|
||||
|
||||
(defn- parse-team-id
|
||||
[route profile]
|
||||
(let [team-id (get-in route [:params :path :team-id])]
|
||||
(cond
|
||||
(uuid-str? team-id) (uuid team-id)
|
||||
(= "self" team-id) (:default-team-id profile)
|
||||
:else (ex/raise :type :validation
|
||||
:code :invalid-team-id))))
|
||||
|
||||
(defn- parse-project-id
|
||||
[route profile]
|
||||
(let [project-id (get-in route [:params :path :project-id])]
|
||||
(cond
|
||||
(uuid-str? project-id) (uuid project-id)
|
||||
(= "drafts" project-id) (:default-project-id profile)
|
||||
:else (ex/raise :type :validation
|
||||
:code :invalid-project-id))))
|
||||
|
||||
|
||||
(mf/defc app
|
||||
[props]
|
||||
|
|
Loading…
Reference in a new issue