Skip to content

Commit

Permalink
Add configurable asset url
Browse files Browse the repository at this point in the history
  • Loading branch information
frostyfan109 committed May 17, 2024
1 parent ecc9133 commit 01205a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion bin/populate_env
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ brand_name="${REACT_APP_UI_BRAND_NAME}"
tranql_url="${REACT_APP_TRANQL_URL:-\/tranql}"
hidden_result_tabs="${REACT_APP_HIDDEN_RESULT_TABS}"
deployment_namespace="${REACT_APP_DEPLOYMENT_NAMESPACE}"
appstore_asset_branch="${REACT_APP_APPSTORE_ASSET_BRANCH}"
appstore_asset_base_url="${REACT_APP_APPSTORE_ASSET_BASE_URL:-https:\/\/raw.githubusercontent.com\/helxplatform\/appstore}"
appstore_asset_branch="${REACT_APP_APPSTORE_ASSET_BRANCH:-master}"
analytics_enabled="${REACT_APP_ANALYTICS_ENABLED:-false}"
analytics_platform="${REACT_APP_ANALYTICS_PLATFORM}"
analytics_token="${REACT_APP_ANALYTICS_TOKEN}"
Expand All @@ -40,6 +41,7 @@ template='{
},
"hidden_result_tabs": "%HIDDEN_RESULT_TABS%",
"deployment_namespace": "%DEPLOYMENT_NAMESPACE%",
"appstore_asset_base_url": "%APPSTORE_ASSET_BASE_URL%",
"appstore_asset_branch": "%APPSTORE_ASSET_BRANCH%",
"meta": {
"title": "%META_TITLE%",
Expand All @@ -62,6 +64,7 @@ echo "$template" | sed \
-e "s/%HIDDEN_RESULT_TABS%/$hidden_result_tabs/" \
-e "s/%TRANQL_URL%/$tranql_url/" \
-e "s/%DEPLOYMENT_NAMESPACE%/$deployment_namespace/" \
-e "s/%APPSTORE_ASSET_BASE_URL%/$appstore_asset_base_url/" \
-e "s/%APPSTORE_ASSET_BRANCH%/$appstore_asset_branch/" \
-e "s/%ANALYTICS_ENABLED%/$analytics_enabled/" \
-e "s/%ANALYTICS_PLATFORM%/$analytics_platform/" \
Expand Down
2 changes: 1 addition & 1 deletion src/contexts/environment-context.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export const EnvironmentProvider = ({ children }) => {
let brandAssetFolder = context.brand
// `catalyst` is the supported name, but support `cat` and `bdc` as well.
if (brandAssetFolder === "cat" || brandAssetFolder === "bdc") brandAssetFolder = "bdc"
context.logo_url = `https://raw.githubusercontent.com/helxplatform/appstore/${ context.appstore_asset_branch }/appstore/core/static/images/${ brandAssetFolder }/logo.png`
context.logo_url = `${ context.appstore_asset_base_url }/${ context.appstore_asset_branch }/appstore/core/static/images/${ brandAssetFolder }/logo.png`
setContext(context);
setIsLoadingContext(false);
}
Expand Down

0 comments on commit 01205a4

Please sign in to comment.