From: Wouter Admiraal Date: Fri, 9 Aug 2019 08:23:50 +0000 (+0200) Subject: Improve Edition handling X-Git-Tag: 8.1.0.31237~152 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=24963a443c4459d03baab2b583e3690250d056aa;p=sonarqube.git Improve Edition handling --- diff --git a/server/sonar-web/src/main/js/api/system.ts b/server/sonar-web/src/main/js/api/system.ts index 57e3210f165..3936416d805 100644 --- a/server/sonar-web/src/main/js/api/system.ts +++ b/server/sonar-web/src/main/js/api/system.ts @@ -19,6 +19,7 @@ */ import { getJSON, post, postJSON, requestTryAndRepeatUntil } from 'sonar-ui-common/helpers/request'; import throwGlobalError from '../app/utils/throwGlobalError'; +import { SystemUpgrade } from '../types/system'; export function setLogLevel(level: string): Promise { return post('/api/system/change_log_level', { level }).catch(throwGlobalError); @@ -33,7 +34,7 @@ export function getSystemStatus(): Promise<{ id: string; version: string; status } export function getSystemUpgrades(): Promise<{ - upgrades: T.SystemUpgrade[]; + upgrades: SystemUpgrade[]; updateCenterRefresh: string; }> { return getJSON('/api/system/upgrades'); diff --git a/server/sonar-web/src/main/js/app/components/GlobalFooter.tsx b/server/sonar-web/src/main/js/app/components/GlobalFooter.tsx index 49b5609512a..5ffecb7d0ce 100644 --- a/server/sonar-web/src/main/js/app/components/GlobalFooter.tsx +++ b/server/sonar-web/src/main/js/app/components/GlobalFooter.tsx @@ -21,16 +21,17 @@ import * as React from 'react'; import { Link } from 'react-router'; import { Alert } from 'sonar-ui-common/components/ui/Alert'; import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n'; -import { EDITIONS } from '../../apps/marketplace/utils'; import InstanceMessage from '../../components/common/InstanceMessage'; +import { getEdition } from '../../helpers/editions'; import { isSonarCloud } from '../../helpers/system'; +import { EditionKey } from '../../types/editions'; import GlobalFooterBranding from './GlobalFooterBranding'; import GlobalFooterSonarCloud from './GlobalFooterSonarCloud'; interface Props { hideLoggedInInfo?: boolean; productionDatabase: boolean; - sonarqubeEdition?: T.EditionKey; + sonarqubeEdition?: EditionKey; sonarqubeVersion?: string; } @@ -44,7 +45,7 @@ export default function GlobalFooter({ return ; } - const currentEdition = EDITIONS.find(edition => edition.key === sonarqubeEdition); + const currentEdition = sonarqubeEdition && getEdition(sonarqubeEdition); return (