[ARVADOS-WORKBENCH2] updated: 1.1.4-601-ge5ecd84

Git user git at public.curoverse.com
Tue Aug 14 05:26:59 EDT 2018


Summary of changes:
 src/common/config.ts | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

       via  e5ecd847e0a5d64f78ab45194f3b4f2e7fbd199a (commit)
       via  b9d9f71443a149cb99e9dfdbe8a293e52cc6d498 (commit)
      from  f0d519637c997df11d5b1a1b32b3d9e4a2872325 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit e5ecd847e0a5d64f78ab45194f3b4f2e7fbd199a
Merge: f0d5196 b9d9f71
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date:   Tue Aug 14 11:26:38 2018 +0200

    Merge branch '14024-undefined-config-variables'
    
    refs #14024
    
    Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>


commit b9d9f71443a149cb99e9dfdbe8a293e52cc6d498
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date:   Tue Aug 14 11:19:29 2018 +0200

    Fix config file parsing regression
    
    Feature #14024
    
    Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>

diff --git a/src/common/config.ts b/src/common/config.ts
index 492328d..759a201 100644
--- a/src/common/config.ts
+++ b/src/common/config.ts
@@ -13,21 +13,25 @@ export interface Config {
 
 export const fetchConfig = () => {
     return Axios
-        .get<Config>(CONFIG_URL + "?nocache=" + (new Date()).getTime())
+        .get<ConfigJSON>(CONFIG_URL + "?nocache=" + (new Date()).getTime())
         .then(response => response.data)
         .catch(() => Promise.resolve(getDefaultConfig()))
         .then(mapConfig);
 };
 
-const mapConfig = (config: Config): Config => ({
-    ...config,
-    apiHost: addProtocol(config.apiHost),
-    keepWebHost: addProtocol(config.keepWebHost)
+interface ConfigJSON {
+    API_HOST: string;
+    KEEP_WEB_HOST: string;
+}
+
+const mapConfig = (config: ConfigJSON): Config => ({
+    apiHost: addProtocol(config.API_HOST),
+    keepWebHost: addProtocol(config.KEEP_WEB_HOST)
 });
 
-const getDefaultConfig = (): Config => ({
-    apiHost: process.env.REACT_APP_ARVADOS_API_HOST || "",
-    keepWebHost: process.env.REACT_APP_ARVADOS_KEEP_WEB_HOST || ""
+const getDefaultConfig = (): ConfigJSON => ({
+    API_HOST: process.env.REACT_APP_ARVADOS_API_HOST || "",
+    KEEP_WEB_HOST: process.env.REACT_APP_ARVADOS_KEEP_WEB_HOST || ""
 });
 
 const addProtocol = (url: string) => `${window.location.protocol}//${url}`;

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list