X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/8df73e82d637d7b2e81952fdc96a12a1011be99e..36c18f380e2a31b532fbdd94208b559bef8d900f:/src/common/config.ts diff --git a/src/common/config.ts b/src/common/config.ts index 7a98fd4722..574445df09 100644 --- a/src/common/config.ts +++ b/src/common/config.ts @@ -13,6 +13,9 @@ interface WorkbenchConfig { } export interface ClusterConfigJSON { + API: { + UnfreezeProjectRequiresAdmin: boolean + }, ClusterID: string; RemoteClusters: { [key: string]: { @@ -50,8 +53,8 @@ export interface ClusterConfigJSON { } }; Workbench: { + DisableSharingURLsUI: boolean; ArvadosDocsite: string; - VocabularyURL: string; FileViewersConfigURL: string; WelcomePageHTML: string; InactivePageHTML: string; @@ -89,7 +92,8 @@ export interface ClusterConfigJSON { Value: string, Protected?: boolean, } - } + }, + TrustAllContent: boolean }; Volumes: { [key: string]: { @@ -138,7 +142,7 @@ export const buildConfig = (clusterConfig: ClusterConfigJSON): Config => { }; export const getStorageClasses = (config: Config): string[] => { - const classes: Set = new Set(); + const classes: Set = new Set(['default']); const volumes = config.clusterConfig.Volumes; Object.keys(volumes).forEach(v => { Object.keys(volumes[v].StorageClasses || {}).forEach(sc => { @@ -203,15 +207,10 @@ remove the entire ${varName} entry from ${WORKBENCH_CONFIG_URL}`); } config.fileViewersConfigUrl = fileViewerConfigUrl; - let vocabularyUrl; if (workbenchConfig.VOCABULARY_URL !== undefined) { - warnLocalConfig("VOCABULARY_URL"); - vocabularyUrl = workbenchConfig.VOCABULARY_URL; + console.warn(`A value for VOCABULARY_URL was found in ${WORKBENCH_CONFIG_URL}. It will be ignored as the cluster already provides its own endpoint, you can safely remove it.`) } - else { - vocabularyUrl = config.clusterConfig.Workbench.VocabularyURL || "/vocabulary-example.json"; - } - config.vocabularyUrl = vocabularyUrl; + config.vocabularyUrl = getVocabularyURL(workbenchConfig.API_HOST); return { config, apiHost: workbenchConfig.API_HOST }; }); @@ -226,6 +225,9 @@ export const mapRemoteHosts = (clusterConfigJSON: ClusterConfigJSON, config: Con }; export const mockClusterConfigJSON = (config: Partial): ClusterConfigJSON => ({ + API: { + UnfreezeProjectRequiresAdmin: false, + }, ClusterID: "", RemoteClusters: {}, Services: { @@ -238,8 +240,8 @@ export const mockClusterConfigJSON = (config: Partial): Clust WebShell: { ExternalURL: "" }, }, Workbench: { + DisableSharingURLsUI: false, ArvadosDocsite: "", - VocabularyURL: "", FileViewersConfigURL: "", WelcomePageHTML: "", InactivePageHTML: "", @@ -271,6 +273,7 @@ export const mockClusterConfigJSON = (config: Partial): Clust }, Collections: { ForwardSlashNameSubstitution: "", + TrustAllContent: false, }, Volumes: {}, ...config @@ -313,5 +316,7 @@ const getDefaultConfig = (): WorkbenchConfig => { export const ARVADOS_API_PATH = "arvados/v1"; export const CLUSTER_CONFIG_PATH = "arvados/v1/config"; +export const VOCABULARY_PATH = "arvados/v1/vocabulary"; export const DISCOVERY_DOC_PATH = "discovery/v1/apis/arvados/v1/rest"; -export const getClusterConfigURL = (apiHost: string) => `${window.location.protocol}//${apiHost}/${CLUSTER_CONFIG_PATH}?nocache=${(new Date()).getTime()}`; +export const getClusterConfigURL = (apiHost: string) => `https://${apiHost}/${CLUSTER_CONFIG_PATH}?nocache=${(new Date()).getTime()}`; +export const getVocabularyURL = (apiHost: string) => `https://${apiHost}/${VOCABULARY_PATH}?nocache=${(new Date()).getTime()}`;