mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-03 03:28:11 +08:00
Collect all env vars in one, easy-to-find place (#1149)
* Collect all env vars in one, easy-to-find place Past state: * Default environement variables were stored in both client/package.json and client/__tests__/e2e/config.js * Constants that should have been linked--like the cellxgene server port during testing--were repeated. With this commit: * All environment variables are parameterized * All environment variables are packaged in default env files * Move npm scripts to client Makefile * Respond to feedback from @seve and @bkmartinjr
This commit is contained in:
+19
-8
@@ -1,4 +1,5 @@
|
||||
import { Colors } from "@blueprintjs/core";
|
||||
import { dispatchNetworkErrorMessageToUser } from "./util/actionHelpers";
|
||||
|
||||
/* if a categorical metadata field has more options than this, truncate */
|
||||
export const maxCategoricalOptionsToDisplay = 100;
|
||||
@@ -77,13 +78,23 @@ export const categoryLabelDisplayStringShortLength = 11;
|
||||
export const tooltipHoverOpenDelay = 1000; /* ms delay before a tooltip displays */
|
||||
export const tooltipHoverOpenDelayQuick = 500;
|
||||
|
||||
let _API = {
|
||||
// prefix: "http://api.clustering.czi.technology/api/",
|
||||
// prefix: "http://tabulamuris.cxg.czi.technology/api/",
|
||||
// prefix: "http://api-staging.clustering.czi.technology/api/",
|
||||
prefix: "http://localhost:5005/api/",
|
||||
version: "v0.2/"
|
||||
};
|
||||
let _API;
|
||||
|
||||
if (window.CELLXGENE && window.CELLXGENE.API) {
|
||||
_API = window.CELLXGENE.API;
|
||||
} else {
|
||||
if (process.env.CXG_SERVER_PORT === undefined) {
|
||||
const errorMessage = "Please set the CXG_SERVER_PORT environment variable.";
|
||||
dispatchNetworkErrorMessageToUser(errorMessage);
|
||||
throw new Error(errorMessage);
|
||||
}
|
||||
_API = {
|
||||
// prefix: "http://api.clustering.czi.technology/api/",
|
||||
// prefix: "http://tabulamuris.cxg.czi.technology/api/",
|
||||
// prefix: "http://api-staging.clustering.czi.technology/api/",
|
||||
prefix: `http://localhost:${process.env.CXG_SERVER_PORT}/api/`,
|
||||
version: "v0.2/"
|
||||
};
|
||||
}
|
||||
|
||||
if (window.CELLXGENE && window.CELLXGENE.API) _API = window.CELLXGENE.API;
|
||||
export const API = _API;
|
||||
|
||||
Reference in New Issue
Block a user