'project-admin': './src/main/js/apps/project-admin/app.js',
'project-permissions': './src/main/js/apps/permissions/project/app.js',
'projects-admin': './src/main/js/apps/projects-admin/app.js',
- 'quality-gates': './src/main/js/apps/quality-gates/app.js',
- 'quality-profiles': './src/main/js/apps/quality-profiles/app.js',
'settings': './src/main/js/apps/settings/app.js',
'source-viewer': './src/main/js/apps/source-viewer/app.js',
'system': './src/main/js/apps/system/app.js',
import { Provider } from 'react-redux';
import App from './components/App';
import accountRoutes from '../apps/account/routes';
-import projectsRouters from '../apps/projects/routes';
+import projectsRoutes from '../apps/projects/routes';
+import qualityGatesRoutes from '../apps/quality-gates/routes';
+import qualityProfilesRoutes from '../apps/quality-profiles/routes';
import configureStore from '../components/store/configureStore';
import rootReducer from './store/rootReducer';
import './styles/index';
<Router history={history}>
<Route path="/" component={App}>
{accountRoutes}
- {projectsRouters}
+ {projectsRoutes}
+ {qualityGatesRoutes}
+ {qualityProfilesRoutes}
</Route>
</Router>
</Provider>
import issuesActivity, * as fromIssuesActivity from '../../apps/account/home/store/reducer';
import projectsApp, * as fromProjectsApp from '../../apps/projects/store/reducer';
+import qualityGatesApp from '../../apps/quality-gates/store/rootReducer';
export default combineReducers({
components,
// apps
issuesActivity,
- projectsApp
+ projectsApp,
+ qualityGatesApp
});
export const getComponent = (state, key) => (
export const getProjectsAppMaxFacetValue = state => (
fromProjectsApp.getMaxFacetValue(state.projectsApp)
);
+
+export const getQualityGatesAppState = state => (
+ state.qualityGatesApp
+);
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2016 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-import React from 'react';
-import { render } from 'react-dom';
-import { Router, Route, IndexRoute, Redirect, useRouterHistory } from 'react-router';
-import { createHistory } from 'history';
-import { combineReducers } from 'redux';
-import { Provider } from 'react-redux';
-import { syncHistoryWithStore, routerReducer } from 'react-router-redux';
-
-import QualityGatesAppContainer from './containers/QualityGatesAppContainer';
-import Intro from './components/Intro';
-import DetailsContainer from './containers/DetailsContainer';
-import rootReducer from './store/reducers';
-import configureStore from '../../components/store/configureStore';
-
-window.sonarqube.appStarted.then(options => {
- const el = document.querySelector(options.el);
-
- const history = useRouterHistory(createHistory)({
- basename: window.baseUrl + '/quality_gates'
- });
-
- const finalReducer = combineReducers({
- rootReducer,
- routing: routerReducer
- });
-
- const store = configureStore(finalReducer);
-
- const finalHistory = syncHistoryWithStore(history, store);
-
- render((
- <Provider store={store}>
- <Router history={finalHistory}>
- <Route path="/" component={QualityGatesAppContainer}>
- <IndexRoute component={Intro}/>
- <Route path="show/:id" component={DetailsContainer}/>
- <Redirect from="/index" to="/"/>
- </Route>
- </Router>
- </Provider>
- ), el);
-});
qualityGate,
onCopy: (newQualityGate) => {
onCopy(newQualityGate);
- router.push(`/show/${newQualityGate.id}`);
+ router.push(`/quality_gates/show/${newQualityGate.id}`);
}
}).render();
}
qualityGate,
onDelete: (qualityGate) => {
onDelete(qualityGate);
- router.replace('/');
+ router.replace('/quality_gates');
}
}).render();
}
{qualityGates.map(qualityGate => (
<Link
key={qualityGate.id}
- to={`/show/${qualityGate.id}`}
+ to={`/quality_gates/show/${qualityGate.id}`}
activeClassName="active"
className="list-group-item"
data-id={qualityGate.id}>
const { router } = this.context;
addQualityGate(qualityGate);
- router.push(`/show/${qualityGate.id}`);
+ router.push(`/quality_gates/show/${qualityGate.id}`);
}
render () {
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { connect } from 'react-redux';
-
import {
- deleteQualityGate,
- showQualityGate,
- renameQualityGate,
- copyQualityGate,
- setQualityGateAsDefault,
- unsetQualityGateAsDefault,
- addCondition,
- deleteCondition,
- saveCondition
+ deleteQualityGate,
+ showQualityGate,
+ renameQualityGate,
+ copyQualityGate,
+ setQualityGateAsDefault,
+ unsetQualityGateAsDefault,
+ addCondition,
+ deleteCondition,
+ saveCondition
} from '../store/actions';
import Details from '../components/Details';
+import { getQualityGatesAppState } from '../../../app/store/rootReducer';
-function mapStateToProps (state) {
- return state.rootReducer;
-}
+const mapStateToProps = state => (
+ getQualityGatesAppState(state)
+);
-function mapDispatchToProps (dispatch) {
- return {
- onShow: qualityGate => dispatch(showQualityGate(qualityGate)),
- onDelete: qualityGate => dispatch(deleteQualityGate(qualityGate)),
- onRename: (qualityGate, newName) => dispatch(renameQualityGate(qualityGate, newName)),
- onCopy: qualityGate => dispatch(copyQualityGate(qualityGate)),
- onSetAsDefault: qualityGate => dispatch(setQualityGateAsDefault(qualityGate)),
- onUnsetAsDefault: qualityGate => dispatch(unsetQualityGateAsDefault(qualityGate)),
- onAddCondition: metric => dispatch(addCondition(metric)),
- onSaveCondition: (oldCondition, newCondition) => dispatch(saveCondition(oldCondition, newCondition)),
- onDeleteCondition: condition => dispatch(deleteCondition(condition))
- };
-}
+const mapDispatchToProps = dispatch => ({
+ onShow: qualityGate => dispatch(showQualityGate(qualityGate)),
+ onDelete: qualityGate => dispatch(deleteQualityGate(qualityGate)),
+ onRename: (qualityGate, newName) => dispatch(renameQualityGate(qualityGate, newName)),
+ onCopy: qualityGate => dispatch(copyQualityGate(qualityGate)),
+ onSetAsDefault: qualityGate => dispatch(setQualityGateAsDefault(qualityGate)),
+ onUnsetAsDefault: qualityGate => dispatch(unsetQualityGateAsDefault(qualityGate)),
+ onAddCondition: metric => dispatch(addCondition(metric)),
+ onSaveCondition: (oldCondition, newCondition) => dispatch(saveCondition(oldCondition, newCondition)),
+ onDeleteCondition: condition => dispatch(deleteCondition(condition))
+});
export default connect(
mapStateToProps,
import { setState, addQualityGate, deleteQualityGate } from '../store/actions';
import QualityGateApp from '../components/QualityGatesApp';
+import { getQualityGatesAppState } from '../../../app/store/rootReducer';
-function mapStateToProps (state) {
- return state.rootReducer;
-}
+const mapStateToProps = state => (
+ getQualityGatesAppState(state)
+);
-function mapDispatchToProps (dispatch) {
- return {
- updateStore: nextState => dispatch(setState(nextState)),
- addQualityGate: qualityGate => dispatch(addQualityGate(qualityGate)),
- deleteQualityGate: qualityGate => dispatch(deleteQualityGate(qualityGate))
- };
-}
+const mapDispatchToProps = dispatch => ({
+ updateStore: nextState => dispatch(setState(nextState)),
+ addQualityGate: qualityGate => dispatch(addQualityGate(qualityGate)),
+ deleteQualityGate: qualityGate => dispatch(deleteQualityGate(qualityGate))
+});
export default connect(
mapStateToProps,
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2016 SonarSource SA
+ * mailto:contact AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import React from 'react';
+import { Route, IndexRoute, Redirect } from 'react-router';
+import QualityGatesAppContainer from './containers/QualityGatesAppContainer';
+import Intro from './components/Intro';
+import DetailsContainer from './containers/DetailsContainer';
+
+export default (
+ <Route path="quality_gates" component={QualityGatesAppContainer}>
+ <Redirect from="/quality_gates/index" to="/quality_gates/"/>
+
+ <IndexRoute component={Intro}/>
+ <Route path="show/:id" component={DetailsContainer}/>
+ </Route>
+);
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-export const SET_STATE = 'SET_STATE';
+export const SET_STATE = 'qualityGates/SET_STATE';
export function setState (nextState) {
return {
type: SET_STATE,
};
}
-export const ADD = 'ADD';
+export const ADD = 'qualityGates/ADD';
export function addQualityGate (qualityGate) {
return {
- type: 'ADD',
+ type: ADD,
qualityGate
};
}
-export const DELETE = 'DELETE';
+export const DELETE = 'qualityGates/DELETE';
export function deleteQualityGate (qualityGate) {
return {
- type: 'DELETE',
+ type: DELETE,
qualityGate
};
}
-export const SHOW = 'SHOW';
+export const SHOW = 'qualityGates/SHOW';
export function showQualityGate (qualityGate) {
return {
- type: 'SHOW',
+ type: SHOW,
qualityGate
};
}
-export const RENAME = 'RENAME';
+export const RENAME = 'qualityGates/RENAME';
export function renameQualityGate (qualityGate, newName) {
return {
- type: 'RENAME',
+ type: RENAME,
qualityGate,
newName
};
}
-export const COPY = 'COPY';
+export const COPY = 'qualityGates/COPY';
export function copyQualityGate (qualityGate) {
return {
type: COPY,
};
}
-export const UNSET_AS_DEFAULT = 'UNSET_AS_DEFAULT';
+export const UNSET_AS_DEFAULT = 'qualityGates/UNSET_AS_DEFAULT';
export function unsetQualityGateAsDefault (qualityGate) {
return {
type: UNSET_AS_DEFAULT,
};
}
-export const ADD_CONDITION = 'ADD_CONDITION';
+export const ADD_CONDITION = 'qualityGates/ADD_CONDITION';
export function addCondition (metric) {
return {
type: ADD_CONDITION,
};
}
-export const SAVE_CONDITION = 'SAVE_CONDITION';
+export const SAVE_CONDITION = 'qualityGates/SAVE_CONDITION';
export function saveCondition (oldCondition, newCondition) {
return {
type: SAVE_CONDITION,
};
}
-export const DELETE_CONDITION = 'DELETE_CONDITION';
+export const DELETE_CONDITION = 'qualityGates/DELETE_CONDITION';
export function deleteCondition (condition) {
return {
type: DELETE_CONDITION,
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2016 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-import {
- SET_STATE,
- ADD,
- DELETE,
- SHOW,
- RENAME,
- COPY,
- SET_AS_DEFAULT,
- UNSET_AS_DEFAULT,
- ADD_CONDITION,
- DELETE_CONDITION,
- SAVE_CONDITION
-} from './actions';
-import { checkIfDefault, addCondition, deleteCondition, replaceCondition } from './utils';
-
-const initialState = {};
-
-export default function rootReducer (state = initialState, action = {}) {
- switch (action.type) {
- case SET_STATE:
- return { ...state, ...action.nextState };
- case ADD:
- case COPY:
- return { ...state, qualityGates: [...state.qualityGates, action.qualityGate] };
- case DELETE:
- return { ...state, qualityGates: state.qualityGates.filter(candidate => candidate.id !== action.qualityGate.id) };
- case SHOW:
- return {
- ...state,
- qualityGate: { ...action.qualityGate, isDefault: checkIfDefault(action.qualityGate, state.qualityGates) }
- };
- case RENAME:
- return {
- ...state,
- qualityGates: state.qualityGates.map(candidate => {
- return candidate.id === action.qualityGate.id ? { ...candidate, name: action.newName } : candidate;
- }),
- qualityGate: { ...state.qualityGate, name: action.newName }
- };
- case SET_AS_DEFAULT:
- return {
- ...state,
- qualityGates: state.qualityGates.map(candidate => {
- return { ...candidate, isDefault: candidate.id === action.qualityGate.id };
- }),
- qualityGate: { ...state.qualityGate, isDefault: state.qualityGate.id === action.qualityGate.id }
- };
- case UNSET_AS_DEFAULT:
- return {
- ...state,
- qualityGates: state.qualityGates.map(candidate => {
- return candidate.id === action.qualityGate.id ? { ...candidate, isDefault: false } : candidate;
- }),
- qualityGate: { ...state.qualityGate, isDefault: false }
- };
- case ADD_CONDITION:
- return {
- ...state,
- qualityGate: addCondition(state.qualityGate, action.metric)
- };
- case DELETE_CONDITION:
- return {
- ...state,
- qualityGate: deleteCondition(state.qualityGate, action.condition)
- };
- case SAVE_CONDITION:
- return {
- ...state,
- qualityGate: replaceCondition(state.qualityGate, action.oldCondition, action.newCondition)
- };
- default:
- return state;
- }
-}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2016 SonarSource SA
+ * mailto:contact AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import {
+ SET_STATE,
+ ADD,
+ DELETE,
+ SHOW,
+ RENAME,
+ COPY,
+ SET_AS_DEFAULT,
+ UNSET_AS_DEFAULT,
+ ADD_CONDITION,
+ DELETE_CONDITION,
+ SAVE_CONDITION
+} from './actions';
+import { checkIfDefault, addCondition, deleteCondition, replaceCondition } from './utils';
+
+const initialState = {};
+
+export default function rootReducer (state = initialState, action = {}) {
+ switch (action.type) {
+ case SET_STATE:
+ return { ...state, ...action.nextState };
+ case ADD:
+ case COPY:
+ return { ...state, qualityGates: [...state.qualityGates, action.qualityGate] };
+ case DELETE:
+ return { ...state, qualityGates: state.qualityGates.filter(candidate => candidate.id !== action.qualityGate.id) };
+ case SHOW:
+ return {
+ ...state,
+ qualityGate: { ...action.qualityGate, isDefault: checkIfDefault(action.qualityGate, state.qualityGates) }
+ };
+ case RENAME:
+ return {
+ ...state,
+ qualityGates: state.qualityGates.map(candidate => {
+ return candidate.id === action.qualityGate.id ? { ...candidate, name: action.newName } : candidate;
+ }),
+ qualityGate: { ...state.qualityGate, name: action.newName }
+ };
+ case SET_AS_DEFAULT:
+ return {
+ ...state,
+ qualityGates: state.qualityGates.map(candidate => {
+ return { ...candidate, isDefault: candidate.id === action.qualityGate.id };
+ }),
+ qualityGate: { ...state.qualityGate, isDefault: state.qualityGate.id === action.qualityGate.id }
+ };
+ case UNSET_AS_DEFAULT:
+ return {
+ ...state,
+ qualityGates: state.qualityGates.map(candidate => {
+ return candidate.id === action.qualityGate.id ? { ...candidate, isDefault: false } : candidate;
+ }),
+ qualityGate: { ...state.qualityGate, isDefault: false }
+ };
+ case ADD_CONDITION:
+ return {
+ ...state,
+ qualityGate: addCondition(state.qualityGate, action.metric)
+ };
+ case DELETE_CONDITION:
+ return {
+ ...state,
+ qualityGate: deleteCondition(state.qualityGate, action.condition)
+ };
+ case SAVE_CONDITION:
+ return {
+ ...state,
+ qualityGate: replaceCondition(state.qualityGate, action.oldCondition, action.newCondition)
+ };
+ default:
+ return state;
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2016 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-import React from 'react';
-import { render } from 'react-dom';
-import {
- Router,
- Route,
- IndexRoute,
- Redirect,
- useRouterHistory
-} from 'react-router';
-import { createHistory } from 'history';
-import App from './components/App';
-import ProfileContainer from './components/ProfileContainer';
-import HomeContainer from './home/HomeContainer';
-import ProfileDetails from './details/ProfileDetails';
-import ChangelogContainer from './changelog/ChangelogContainer';
-import ComparisonContainer from './compare/ComparisonContainer';
-
-window.sonarqube.appStarted.then(options => {
- const el = document.querySelector(options.el);
-
- const history = useRouterHistory(createHistory)({
- basename: window.baseUrl + '/profiles'
- });
-
- render((
- <Router history={history}>
- <Route path="/" component={App}>
- <Redirect from="/index" to="/"/>
-
- <IndexRoute component={HomeContainer}/>
-
- <Route component={ProfileContainer}>
- <Route path="show" component={ProfileDetails}/>
- <Route path="changelog" component={ChangelogContainer}/>
- <Route path="compare" component={ComparisonContainer}/>
- </Route>
- </Route>
- </Router>
- ), el);
-});
handleFromDateChange (fromDate) {
const query = { ...this.props.location.query, since: fromDate };
- this.context.router.push({ pathname: '/changelog', query });
+ this.context.router.push({ pathname: '/profiles/changelog', query });
}
handleToDateChange (toDate) {
const query = { ...this.props.location.query, to: toDate };
- this.context.router.push({ pathname: '/changelog', query });
+ this.context.router.push({ pathname: '/profiles/changelog', query });
}
handleReset () {
const query = { key: this.props.profile.key };
- this.context.router.push({ pathname: '/changelog', query });
+ this.context.router.push({ pathname: '/profiles/changelog', query });
}
render () {
handleCompare (withKey) {
this.context.router.push({
- pathname: '/compare',
+ pathname: '/profiles/compare',
query: {
key: this.props.profile.key,
withKey
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-import { getLanguages } from '../../../api/languages';
-import {
- getQualityProfiles,
- getExporters
-} from '../../../api/quality-profiles';
+import { getQualityProfiles, getExporters } from '../../../api/quality-profiles';
import { getCurrentUser } from '../../../api/users';
import '../styles.css';
import { sortProfiles } from '../utils';
this.setState({ loading: true });
Promise.all([
getCurrentUser(),
- getLanguages(),
getExporters(),
getQualityProfiles()
]).then(responses => {
if (this.mounted) {
- const [user, languages, exporters, profiles] = responses;
+ const [user, exporters, profiles] = responses;
const canAdmin = user.permissions.global.includes('profileadmin');
this.setState({
- languages,
exporters,
canAdmin,
profiles: sortProfiles(profiles),
}
renderChild () {
- if (this.state.loading) {
+ const areLanguagesLoading = Object.keys(this.props.languages).length === 0;
+ if (this.state.loading || areLanguagesLoading) {
return <i className="spinner"/>;
}
+ const finalLanguages = Object.values(this.props.languages);
+
return React.cloneElement(this.props.children, {
profiles: this.state.profiles,
- languages: this.state.languages,
+ languages: finalLanguages,
exporters: this.state.exporters,
canAdmin: this.state.canAdmin,
updateProfiles: this.updateProfiles
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2016 SonarSource SA
+ * mailto:contact AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import { connect } from 'react-redux';
+import App from './App';
+import { getLanguages } from '../../../app/store/rootReducer';
+
+export default connect(
+ state => ({
+ languages: getLanguages(state)
+ })
+)(App);
}).on('done', profile => {
this.props.updateProfiles().then(() => {
this.context.router.push({
- pathname: '/show',
+ pathname: '/profiles/show',
query: { key: profile.key }
});
});
new DeleteProfileView({
profile: this.props.profile
}).on('done', () => {
- this.context.router.replace('/');
+ this.context.router.replace('/profiles');
this.props.updateProfiles();
}).render();
}
const query = { key: profileKey };
return (
<Link
- to={{ pathname: '/show', query }}
+ to={{ pathname: '/profiles/show', query }}
activeClassName="link-no-underline"
{...other}>
{children}
return (
<div className="quality-profile-not-found">
<div className="note spacer-bottom">
- <IndexLink to="/" className="text-muted">
+ <IndexLink to="/profiles/" className="text-muted">
{translate('quality_profiles.page')}
</IndexLink>
</div>
return (
<header className="page-header quality-profile-header">
<div className="note spacer-bottom">
- <IndexLink to="/" className="text-muted">
+ <IndexLink to="/profiles/" className="text-muted">
{translate('quality_profiles.page')}
</IndexLink>
{' / '}
<Link
- to={{ pathname: '/', query: { language: profile.language } }}
+ to={{ pathname: '/profiles/', query: { language: profile.language } }}
className="text-muted">
{profile.languageName}
</Link>
{this.renderUsageDate()}
<li>
<Link
- to={{ pathname: '/changelog', query: { key: profile.key } }}
+ to={{ pathname: '/profiles/changelog', query: { key: profile.key } }}
className="button">
{translate('changelog')}
</Link>
}).on('done', profile => {
this.props.updateProfiles().then(() => {
this.context.router.push({
- pathname: '/show',
+ pathname: '/profiles/show',
query: { key: profile.key }
});
});
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import React from 'react';
-import { PropTypes as RouterPropTypes } from 'react-router';
import groupBy from 'lodash/groupBy';
import pick from 'lodash/pick';
import sortBy from 'lodash/sortBy';
static propTypes = {
profiles: ProfilesListType,
languages: LanguagesListType,
- location: RouterPropTypes.location,
+ location: React.PropTypes.object,
canAdmin: React.PropTypes.bool.isRequired,
updateProfiles: React.PropTypes.func.isRequired
};
return (
<ul className="dropdown-menu">
<li>
- <IndexLink to="/">
+ <IndexLink to="/profiles/">
{translate('quality_profiles.all_profiles')}
</IndexLink>
</li>
{this.props.languages.map(language => (
<li key={language.key}>
<IndexLink
- to={{ pathname: '/', query: { language: language.key } }}
+ to={{ pathname: '/profiles/', query: { language: language.key } }}
className="js-language-filter-option"
data-language={language.key}>
{language.name}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2016 SonarSource SA
+ * mailto:contact AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import React from 'react';
+import { Route, IndexRoute, Redirect } from 'react-router';
+import AppContainer from './components/AppContainer';
+import ProfileContainer from './components/ProfileContainer';
+import HomeContainer from './home/HomeContainer';
+import ProfileDetails from './details/ProfileDetails';
+import ChangelogContainer from './changelog/ChangelogContainer';
+import ComparisonContainer from './compare/ComparisonContainer';
+
+export default (
+ <Route path="profiles" component={AppContainer}>
+ <Redirect from="/profiles/index" to="/profiles/"/>
+
+ <IndexRoute component={HomeContainer}/>
+
+ <Route component={ProfileContainer}>
+ <Route path="show" component={ProfileDetails}/>
+ <Route path="changelog" component={ChangelogContainer}/>
+ <Route path="compare" component={ComparisonContainer}/>
+ </Route>
+ </Route>
+);
<% content_for :extra_script do %>
- <script>
- window.sonarqube.urlRoot = window.baseUrl + '/profiles';
- </script>
- <script src="<%= ApplicationController.root_context -%>/js/bundles/quality-profiles.js?v=<%= sonar_version -%>"></script>
+ <script src="<%= ApplicationController.root_context -%>/js/bundles/app.js?v=<%= sonar_version -%>"></script>
<% end %>
<% content_for :extra_script do %>
- <script>
- window.sonarqube.urlRoot = window.baseUrl + '/quality_gates';
- </script>
- <script src="<%= ApplicationController.root_context -%>/js/bundles/quality-gates.js?v=<%= sonar_version -%>"></script>
+ <script src="<%= ApplicationController.root_context -%>/js/bundles/app.js?v=<%= sonar_version -%>"></script>
<% end %>