diff options
Diffstat (limited to 'server/sonar-web')
7 files changed, 7 insertions, 57 deletions
diff --git a/server/sonar-web/src/main/js/api/marketplace.ts b/server/sonar-web/src/main/js/api/marketplace.ts index adbb4442343..0681931e509 100644 --- a/server/sonar-web/src/main/js/api/marketplace.ts +++ b/server/sonar-web/src/main/js/api/marketplace.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { getJSON, postJSON } from '../helpers/request'; +import { getJSON } from '../helpers/request'; import throwGlobalError from '../app/utils/throwGlobalError'; export interface License { @@ -37,14 +37,6 @@ export interface License { type: string; } -export interface EditionStatus { - currentEditionKey?: string; -} - -export function getEditionStatus(): Promise<EditionStatus> { - return getJSON('/api/editions/status'); -} - export function showLicense(): Promise<License> { return getJSON('/api/editions/show_license').catch((e: { response: Response }) => { if (e.response && e.response.status === 404) { @@ -54,19 +46,6 @@ export function showLicense(): Promise<License> { }); } -export function getLicensePreview(data: { - license: string; -}): Promise<{ - nextEditionKey: string; - previewStatus: 'NO_INSTALL' | 'AUTOMATIC_INSTALL' | 'MANUAL_INSTALL'; -}> { - return postJSON('/api/editions/preview', data).catch(throwGlobalError); -} - export function getFormData(): Promise<{ serverId: string; ncloc: number }> { return getJSON('/api/editions/form_data').catch(throwGlobalError); } - -export function applyLicense(data: { license: string }): Promise<EditionStatus> { - return postJSON('/api/editions/apply_license', data).catch(throwGlobalError); -} diff --git a/server/sonar-web/src/main/js/app/components/AdminContainer.tsx b/server/sonar-web/src/main/js/app/components/AdminContainer.tsx index 3347e3e922f..c6440c317e0 100644 --- a/server/sonar-web/src/main/js/app/components/AdminContainer.tsx +++ b/server/sonar-web/src/main/js/app/components/AdminContainer.tsx @@ -25,7 +25,7 @@ import SettingsNav from './nav/settings/SettingsNav'; import { getAppState, getMarketplacePendingPlugins } from '../../store/rootReducer'; import { getSettingsNavigation } from '../../api/nav'; import { setAdminPages } from '../../store/appState/duck'; -import { fetchCurrentEdition, fetchPendingPlugins } from '../../store/marketplace/actions'; +import { fetchPendingPlugins } from '../../store/marketplace/actions'; import { translate } from '../../helpers/l10n'; import { Extension } from '../types'; import { PluginPendingResult } from '../../api/plugins'; @@ -34,6 +34,7 @@ import handleRequiredAuthorization from '../utils/handleRequiredAuthorization'; interface StateProps { appState: { adminPages: Extension[]; + edition: string; organizationsEnabled: boolean; version: string; }; @@ -42,7 +43,6 @@ interface StateProps { interface DispatchToProps { fetchPendingPlugins: () => void; - fetchCurrentEdition: () => void; setAdminPages: (adminPages: Extension[]) => void; } @@ -62,7 +62,6 @@ class AdminContainer extends React.PureComponent<Props> { handleRequiredAuthorization(); } else { this.fetchNavigationSettings(); - this.props.fetchCurrentEdition(); } } @@ -101,7 +100,6 @@ const mapStateToProps = (state: any): StateProps => ({ }); const mapDispatchToProps: DispatchToProps = { - fetchCurrentEdition, fetchPendingPlugins, setAdminPages }; diff --git a/server/sonar-web/src/main/js/app/utils/exposeLibraries.ts b/server/sonar-web/src/main/js/app/utils/exposeLibraries.ts index ed1178b283a..2716c21be7d 100644 --- a/server/sonar-web/src/main/js/app/utils/exposeLibraries.ts +++ b/server/sonar-web/src/main/js/app/utils/exposeLibraries.ts @@ -39,6 +39,7 @@ import CoverageRating from '../../components/ui/CoverageRating'; import DuplicationsRating from '../../components/ui/DuplicationsRating'; import Level from '../../components/ui/Level'; import { EditButton, Button, SubmitButton, ResetButtonLink } from '../../components/ui/buttons'; +import Checkbox from '../../components/controls/Checkbox'; import DeferredSpinner from '../../components/common/DeferredSpinner'; import Dropdown from '../../components/controls/Dropdown'; import ReloadButton from '../../components/controls/ReloadButton'; @@ -65,6 +66,7 @@ const exposeLibraries = () => { AlertSuccessIcon, AlertWarnIcon, Button, + Checkbox, CheckIcon, ClearIcon, CoverageRating, diff --git a/server/sonar-web/src/main/js/apps/marketplace/AppContainer.tsx b/server/sonar-web/src/main/js/apps/marketplace/AppContainer.tsx index eabc536fda5..78f4496d67a 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/AppContainer.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/AppContainer.tsx @@ -22,7 +22,6 @@ import App from './App'; import { getAppState, getGlobalSettingValue, - getMarketplaceCurrentEdition, getMarketplacePendingPlugins } from '../../store/rootReducer'; import { fetchPendingPlugins } from '../../store/marketplace/actions'; @@ -46,7 +45,7 @@ interface DispatchToProps { const mapStateToProps = (state: any) => { return { - currentEdition: getMarketplaceCurrentEdition(state), + currentEdition: getAppState(state).edition, pendingPlugins: getMarketplacePendingPlugins(state), standaloneMode: getAppState(state).standalone, updateCenterActive: diff --git a/server/sonar-web/src/main/js/store/marketplace/actions.ts b/server/sonar-web/src/main/js/store/marketplace/actions.ts index 7e9b6156d9c..3f007ae52e1 100644 --- a/server/sonar-web/src/main/js/store/marketplace/actions.ts +++ b/server/sonar-web/src/main/js/store/marketplace/actions.ts @@ -18,7 +18,6 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { Dispatch } from 'react-redux'; -import { getEditionStatus } from '../../api/marketplace'; import { getPendingPlugins, PluginPendingResult } from '../../api/plugins'; interface SetPendingPluginsAction { @@ -26,28 +25,12 @@ interface SetPendingPluginsAction { pending: PluginPendingResult; } -interface SetCurrentEditionAction { - type: 'SET_CURRENT_EDITION'; - currentEdition?: string; -} - -export type Action = SetCurrentEditionAction | SetPendingPluginsAction; +export type Action = SetPendingPluginsAction; export function setPendingPlugins(pending: PluginPendingResult): SetPendingPluginsAction { return { type: 'SET_PENDING_PLUGINS', pending }; } -export const setCurrentEdition = (currentEdition?: string) => (dispatch: Dispatch<Action>) => { - dispatch({ type: 'SET_CURRENT_EDITION', currentEdition }); -}; - -export const fetchCurrentEdition = () => (dispatch: Dispatch<Action>) => { - getEditionStatus().then( - editionStatus => dispatch(setCurrentEdition(editionStatus.currentEditionKey)), - () => {} - ); -}; - export const fetchPendingPlugins = () => (dispatch: Dispatch<Action>) => { getPendingPlugins().then( pending => { diff --git a/server/sonar-web/src/main/js/store/marketplace/reducer.ts b/server/sonar-web/src/main/js/store/marketplace/reducer.ts index 55ad93d69db..3ab4d778848 100644 --- a/server/sonar-web/src/main/js/store/marketplace/reducer.ts +++ b/server/sonar-web/src/main/js/store/marketplace/reducer.ts @@ -21,7 +21,6 @@ import { Action } from './actions'; import { PluginPendingResult } from '../../api/plugins'; interface State { - currentEdition?: string; pending: PluginPendingResult; } @@ -34,14 +33,7 @@ export default function(state: State = defaultState, action: Action): State { pending: action.pending }; } - if (action.type === 'SET_CURRENT_EDITION') { - return { - ...state, - currentEdition: action.currentEdition - }; - } return state; } -export const getCurrentEdition = (state: State) => state.currentEdition; export const getPendingPlugins = (state: State) => state.pending; diff --git a/server/sonar-web/src/main/js/store/rootReducer.js b/server/sonar-web/src/main/js/store/rootReducer.js index 7581381ce28..9f724a71fc5 100644 --- a/server/sonar-web/src/main/js/store/rootReducer.js +++ b/server/sonar-web/src/main/js/store/rootReducer.js @@ -73,9 +73,6 @@ export const isFavorite = (state, componentKey) => export const getMarketplaceState = state => state.marketplace; -export const getMarketplaceCurrentEdition = state => - fromMarketplace.getCurrentEdition(state.marketplace); - export const getMarketplacePendingPlugins = state => fromMarketplace.getPendingPlugins(state.marketplace); |