From ceafafa155ce8efb0229d0d60838177c3caeb45a Mon Sep 17 00:00:00 2001 From: kkaris Date: Fri, 30 Aug 2024 16:09:52 -0700 Subject: [PATCH 1/3] Make Vue url configurable --- src/indra_cogex/apps/constants.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/indra_cogex/apps/constants.py b/src/indra_cogex/apps/constants.py index 851d8ed5e..5137f2c3a 100644 --- a/src/indra_cogex/apps/constants.py +++ b/src/indra_cogex/apps/constants.py @@ -76,16 +76,15 @@ LOCAL_VUE: Union[str, bool] = get_config("LOCAL_VUE") or False # Set up indralab-vue Vue components, either from local build or from S3 -VUE_DEPLOYMENT = get_config("VUE_DEPLOYMENT") or "latest" -VUE_BASE = f"https://bigmech.s3.amazonaws.com/indra-db/indralabvue-{VUE_DEPLOYMENT}/" +VUE_URL_ROOT = get_config("VUE_URL_ROOT").rstrip("/") VUE_JS = "IndralabVue.umd.min.js" VUE_CSS = "IndralabVue.css" if LOCAL_VUE: VUE_SRC_JS: Union[bool, str] = False VUE_SRC_CSS: Union[bool, str] = False else: - VUE_SRC_JS = f"{VUE_BASE}{VUE_JS}" - VUE_SRC_CSS = f"{VUE_BASE}{VUE_CSS}" + VUE_SRC_JS = f"{VUE_URL_ROOT}/{VUE_JS}" + VUE_SRC_CSS = f"{VUE_URL_ROOT}/{VUE_CSS}" # Pusher parameters pusher_app_id = get_config("CLARE_PUSHER_APP_ID") From 2ffad0186041afb33c47ab5ccf57f9c03c62f0ef Mon Sep 17 00:00:00 2001 From: kkaris Date: Fri, 30 Aug 2024 16:39:23 -0700 Subject: [PATCH 2/3] Catch no variable set --- src/indra_cogex/apps/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/indra_cogex/apps/constants.py b/src/indra_cogex/apps/constants.py index 5137f2c3a..95af2e456 100644 --- a/src/indra_cogex/apps/constants.py +++ b/src/indra_cogex/apps/constants.py @@ -76,7 +76,7 @@ LOCAL_VUE: Union[str, bool] = get_config("LOCAL_VUE") or False # Set up indralab-vue Vue components, either from local build or from S3 -VUE_URL_ROOT = get_config("VUE_URL_ROOT").rstrip("/") +VUE_URL_ROOT = (get_config("VUE_URL_ROOT") or "").rstrip("/") VUE_JS = "IndralabVue.umd.min.js" VUE_CSS = "IndralabVue.css" if LOCAL_VUE: From 893e25e930c3fe96b40bfc2a45b3bf0fcd58e474 Mon Sep 17 00:00:00 2001 From: kkaris Date: Fri, 30 Aug 2024 16:39:37 -0700 Subject: [PATCH 3/3] Warn for no Vue package set --- src/indra_cogex/apps/constants.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/indra_cogex/apps/constants.py b/src/indra_cogex/apps/constants.py index 95af2e456..c88bdf419 100644 --- a/src/indra_cogex/apps/constants.py +++ b/src/indra_cogex/apps/constants.py @@ -83,8 +83,16 @@ VUE_SRC_JS: Union[bool, str] = False VUE_SRC_CSS: Union[bool, str] = False else: - VUE_SRC_JS = f"{VUE_URL_ROOT}/{VUE_JS}" - VUE_SRC_CSS = f"{VUE_URL_ROOT}/{VUE_CSS}" + if not VUE_URL_ROOT: + logger.warning( + "VUE_URL_ROOT not set in environment. Statement Vue components will " + "not be available in the web app." + ) + VUE_SRC_JS = False + VUE_SRC_CSS = False + else: + VUE_SRC_JS = f"{VUE_URL_ROOT}/{VUE_JS}" + VUE_SRC_CSS = f"{VUE_URL_ROOT}/{VUE_CSS}" # Pusher parameters pusher_app_id = get_config("CLARE_PUSHER_APP_ID")