X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/95716b93cba4651180021c9a5b752fa10cf5a301..f9dde5c781766b8be71d43d0f031c201a0edcfbb:/src/common/config.ts diff --git a/src/common/config.ts b/src/common/config.ts index d801c5fa..3961d5aa 100644 --- a/src/common/config.ts +++ b/src/common/config.ts @@ -52,7 +52,7 @@ export interface Config { websocketUrl: string; workbenchUrl: string; vocabularyUrl: string; - origin: string; + fileViewersConfigUrl: string; } export const fetchConfig = () => { @@ -64,7 +64,12 @@ export const fetchConfig = () => { .get(getDiscoveryURL(config.API_HOST)) .then(response => ({ // TODO: After tests delete `|| '/vocabulary-example.json'` - config: {...response.data, vocabularyUrl: config.VOCABULARY_URL || '/vocabulary-example.json' }, + // TODO: After tests delete `|| '/file-viewers-example.json'` + config: { + ...response.data, + vocabularyUrl: config.VOCABULARY_URL || '/vocabulary-example.json', + fileViewersConfigUrl: config.FILE_VIEWERS_CONFIG_URL || '/file-viewers-example.json' + }, apiHost: config.API_HOST, }))); @@ -114,18 +119,20 @@ export const mockConfig = (config: Partial): Config => ({ websocketUrl: '', workbenchUrl: '', vocabularyUrl: '', - origin: '', + fileViewersConfigUrl: '', ...config }); interface ConfigJSON { API_HOST: string; VOCABULARY_URL: string; + FILE_VIEWERS_CONFIG_URL: string; } const getDefaultConfig = (): ConfigJSON => ({ API_HOST: process.env.REACT_APP_ARVADOS_API_HOST || "", VOCABULARY_URL: "", + FILE_VIEWERS_CONFIG_URL: "", }); export const DISCOVERY_URL = 'discovery/v1/apis/arvados/v1/rest';