aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js
diff options
context:
space:
mode:
authorPhilippe Perrin <philippe.perrin@sonarsource.com>2021-11-17 16:17:38 +0100
committersonartech <sonartech@sonarsource.com>2021-11-18 20:03:33 +0000
commitb99383b16be91ad2d2dbbcf3a75b6924fdc512cb (patch)
tree230c6b9210dfb69486e7ddf99ac393ee2823c8f8 /server/sonar-web/src/main/js
parent2cc3673f24b3d745f5c7fefe9051ebd557f211bd (diff)
downloadsonarqube-b99383b16be91ad2d2dbbcf3a75b6924fdc512cb.tar.gz
sonarqube-b99383b16be91ad2d2dbbcf3a75b6924fdc512cb.zip
SONAR-15614 Drop the About page
Diffstat (limited to 'server/sonar-web/src/main/js')
-rw-r--r--server/sonar-web/src/main/js/app/components/GlobalFooter.tsx5
-rw-r--r--server/sonar-web/src/main/js/app/components/Landing.tsx35
-rw-r--r--server/sonar-web/src/main/js/app/components/__tests__/Landing-test.tsx (renamed from server/sonar-web/src/main/js/apps/about/components/__tests__/EntryIssueTypes-test.tsx)29
-rw-r--r--server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/GlobalFooter-test.tsx.snap22
-rw-r--r--server/sonar-web/src/main/js/app/components/nav/global/GlobalNavUser.tsx11
-rw-r--r--server/sonar-web/src/main/js/app/utils/startReactApp.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/about/actions.ts31
-rw-r--r--server/sonar-web/src/main/js/apps/about/components/AboutApp.tsx209
-rw-r--r--server/sonar-web/src/main/js/apps/about/components/AboutCleanCode.tsx36
-rw-r--r--server/sonar-web/src/main/js/apps/about/components/AboutLanguages.tsx69
-rw-r--r--server/sonar-web/src/main/js/apps/about/components/AboutLeakPeriod.tsx36
-rw-r--r--server/sonar-web/src/main/js/apps/about/components/AboutProjects.tsx47
-rw-r--r--server/sonar-web/src/main/js/apps/about/components/AboutQualityGates.tsx36
-rw-r--r--server/sonar-web/src/main/js/apps/about/components/AboutQualityModel.tsx78
-rw-r--r--server/sonar-web/src/main/js/apps/about/components/AboutScanners.tsx76
-rw-r--r--server/sonar-web/src/main/js/apps/about/components/AboutStandards.tsx79
-rw-r--r--server/sonar-web/src/main/js/apps/about/components/EntryIssueTypes.tsx103
-rw-r--r--server/sonar-web/src/main/js/apps/about/components/ReadMore.tsx36
-rw-r--r--server/sonar-web/src/main/js/apps/about/components/__tests__/AboutApp-test.tsx111
-rw-r--r--server/sonar-web/src/main/js/apps/about/components/__tests__/AboutScanners-test.tsx31
-rw-r--r--server/sonar-web/src/main/js/apps/about/components/__tests__/__snapshots__/AboutApp-test.tsx.snap181
-rw-r--r--server/sonar-web/src/main/js/apps/about/components/__tests__/__snapshots__/AboutScanners-test.tsx.snap108
-rw-r--r--server/sonar-web/src/main/js/apps/about/components/__tests__/__snapshots__/EntryIssueTypes-test.tsx.snap117
-rw-r--r--server/sonar-web/src/main/js/apps/about/routes.ts26
-rw-r--r--server/sonar-web/src/main/js/apps/about/styles.css177
25 files changed, 31 insertions, 1660 deletions
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 12bf494a218..bfc13b67018 100644
--- a/server/sonar-web/src/main/js/app/components/GlobalFooter.tsx
+++ b/server/sonar-web/src/main/js/app/components/GlobalFooter.tsx
@@ -95,11 +95,6 @@ export default function GlobalFooter({
<Link to="/web_api">{translate('footer.web_api')}</Link>
</li>
)}
- {!hideLoggedInInfo && (
- <li className="page-footer-menu-item">
- <Link to="/about">{translate('footer.about')}</Link>
- </li>
- )}
</ul>
</div>
);
diff --git a/server/sonar-web/src/main/js/app/components/Landing.tsx b/server/sonar-web/src/main/js/app/components/Landing.tsx
index f9bbee068dd..cf30a1dc2a2 100644
--- a/server/sonar-web/src/main/js/app/components/Landing.tsx
+++ b/server/sonar-web/src/main/js/app/components/Landing.tsx
@@ -17,34 +17,25 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { Location } from 'history';
import * as React from 'react';
-import { connect } from 'react-redux';
-import { withRouter, WithRouterProps } from 'react-router';
+import { withCurrentUser } from '../../components/hoc/withCurrentUser';
+import { Router, withRouter } from '../../components/hoc/withRouter';
import { getHomePageUrl } from '../../helpers/urls';
import { isLoggedIn } from '../../helpers/users';
-import { getCurrentUser, Store } from '../../store/rootReducer';
-interface StateProps {
- currentUser: T.CurrentUser | undefined;
+export interface LandingProps {
+ currentUser: T.CurrentUser;
+ router: Router;
}
-interface OwnProps {
- location: Location;
-}
-
-class Landing extends React.PureComponent<StateProps & OwnProps & WithRouterProps> {
+export class Landing extends React.PureComponent<LandingProps> {
componentDidMount() {
const { currentUser } = this.props;
- if (currentUser && isLoggedIn(currentUser)) {
- if (currentUser.homepage) {
- const homepage = getHomePageUrl(currentUser.homepage);
- this.props.router.replace(homepage);
- } else {
- this.props.router.replace('/projects');
- }
+ if (isLoggedIn(currentUser) && currentUser.homepage) {
+ const homepage = getHomePageUrl(currentUser.homepage);
+ this.props.router.replace(homepage);
} else {
- this.props.router.replace('/about');
+ this.props.router.replace('/projects');
}
}
@@ -53,8 +44,4 @@ class Landing extends React.PureComponent<StateProps & OwnProps & WithRouterProp
}
}
-const mapStateToProps = (state: Store) => ({
- currentUser: getCurrentUser(state)
-});
-
-export default withRouter(connect(mapStateToProps)(Landing));
+export default withRouter(withCurrentUser(Landing));
diff --git a/server/sonar-web/src/main/js/apps/about/components/__tests__/EntryIssueTypes-test.tsx b/server/sonar-web/src/main/js/app/components/__tests__/Landing-test.tsx
index e5d73754746..afb7e647292 100644
--- a/server/sonar-web/src/main/js/apps/about/components/__tests__/EntryIssueTypes-test.tsx
+++ b/server/sonar-web/src/main/js/app/components/__tests__/Landing-test.tsx
@@ -17,22 +17,27 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+
import { shallow } from 'enzyme';
import * as React from 'react';
-import EntryIssueTypes, { EntryIssueTypesProps } from '../EntryIssueTypes';
-
-it('should render correctly', () => {
- const wrapper = shallowRender();
-
- expect(wrapper).toMatchSnapshot('loading');
-
- wrapper.setProps({ loading: false });
+import { mockCurrentUser, mockLoggedInUser, mockRouter } from '../../../helpers/testMocks';
+import { Landing } from '../Landing';
- expect(wrapper).toMatchSnapshot('loading');
+it.each([
+ [mockCurrentUser(), '/projects'],
+ [mockLoggedInUser(), '/projects'],
+ [
+ mockLoggedInUser({ homepage: { type: 'ISSUES' } }),
+ expect.objectContaining({ pathname: '/issues' })
+ ]
+])('should render correctly', (currentUser: T.CurrentUser, homepageUrl: string) => {
+ const router = mockRouter();
+ shallowRender({ router, currentUser });
+ expect(router.replace).toHaveBeenCalledWith(homepageUrl);
});
-function shallowRender(props: Partial<EntryIssueTypesProps> = {}) {
- return shallow<EntryIssueTypesProps>(
- <EntryIssueTypes loading={true} bugs={10} codeSmells={100} vulnerabilities={1000} {...props} />
+function shallowRender(props: Partial<Landing['props']> = {}) {
+ return shallow<Landing>(
+ <Landing currentUser={mockCurrentUser()} router={mockRouter()} {...props} />
);
}
diff --git a/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/GlobalFooter-test.tsx.snap b/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/GlobalFooter-test.tsx.snap
index d0526336fd9..61e974fab75 100644
--- a/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/GlobalFooter-test.tsx.snap
+++ b/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/GlobalFooter-test.tsx.snap
@@ -74,17 +74,6 @@ exports[`should display the sq version 1`] = `
footer.web_api
</Link>
</li>
- <li
- className="page-footer-menu-item"
- >
- <Link
- onlyActiveOnIndex={false}
- style={Object {}}
- to="/about"
- >
- footer.about
- </Link>
- </li>
</ul>
</div>
`;
@@ -215,17 +204,6 @@ exports[`should render the only logged in information 1`] = `
footer.web_api
</Link>
</li>
- <li
- className="page-footer-menu-item"
- >
- <Link
- onlyActiveOnIndex={false}
- style={Object {}}
- to="/about"
- >
- footer.about
- </Link>
- </li>
</ul>
</div>
`;
diff --git a/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavUser.tsx b/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavUser.tsx
index 8d808a68ac4..f1a1d0a989b 100644
--- a/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavUser.tsx
+++ b/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavUser.tsx
@@ -35,14 +35,9 @@ interface Props {
export class GlobalNavUser extends React.PureComponent<Props> {
handleLogin = (event: React.SyntheticEvent<HTMLAnchorElement>) => {
event.preventDefault();
- const shouldReturnToCurrentPage = window.location.pathname !== `${getBaseUrl()}/about`;
- if (shouldReturnToCurrentPage) {
- const returnTo = encodeURIComponent(window.location.pathname + window.location.search);
- window.location.href =
- getBaseUrl() + `/sessions/new?return_to=${returnTo}${window.location.hash}`;
- } else {
- window.location.href = `${getBaseUrl()}/sessions/new`;
- }
+ const returnTo = encodeURIComponent(window.location.pathname + window.location.search);
+ window.location.href =
+ getBaseUrl() + `/sessions/new?return_to=${returnTo}${window.location.hash}`;
};
handleLogout = (event: React.SyntheticEvent<HTMLAnchorElement>) => {
diff --git a/server/sonar-web/src/main/js/app/utils/startReactApp.tsx b/server/sonar-web/src/main/js/app/utils/startReactApp.tsx
index 6a195e67229..e5eaed2b30a 100644
--- a/server/sonar-web/src/main/js/app/utils/startReactApp.tsx
+++ b/server/sonar-web/src/main/js/app/utils/startReactApp.tsx
@@ -26,7 +26,6 @@ import { HelmetProvider } from 'react-helmet-async';
import { IntlProvider } from 'react-intl';
import { Provider } from 'react-redux';
import { IndexRoute, Redirect, Route, RouteConfig, RouteProps, Router } from 'react-router';
-import aboutRoutes from '../../apps/about/routes';
import accountRoutes from '../../apps/account/routes';
import applicationConsoleRoutes from '../../apps/application-console/routes';
import applicationSettingsRoutes from '../../apps/application-settings/routes';
@@ -295,7 +294,6 @@ export default function startReactApp(
<IndexRoute component={lazyLoadComponent(() => import('../components/Landing'))} />
<Route component={GlobalContainer}>
- <RouteWithChildRoutes path="about" childRoutes={aboutRoutes} />
<RouteWithChildRoutes path="account" childRoutes={accountRoutes} />
<RouteWithChildRoutes path="coding_rules" childRoutes={codingRulesRoutes} />
<RouteWithChildRoutes path="documentation" childRoutes={documentationRoutes} />
diff --git a/server/sonar-web/src/main/js/apps/about/actions.ts b/server/sonar-web/src/main/js/apps/about/actions.ts
deleted file mode 100644
index b1cd8ec733f..00000000000
--- a/server/sonar-web/src/main/js/apps/about/actions.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2021 SonarSource SA
- * mailto:info 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 { Dispatch } from 'redux';
-import { getValues } from '../../api/settings';
-import { receiveValues } from '../settings/store/values';
-
-export function fetchAboutPageSettings() {
- return (dispatch: Dispatch) => {
- const keys = ['sonar.lf.aboutText'];
- return getValues({ keys: keys.join() }).then(values => {
- dispatch(receiveValues(keys, values));
- });
- };
-}
diff --git a/server/sonar-web/src/main/js/apps/about/components/AboutApp.tsx b/server/sonar-web/src/main/js/apps/about/components/AboutApp.tsx
deleted file mode 100644
index 56096b2673d..00000000000
--- a/server/sonar-web/src/main/js/apps/about/components/AboutApp.tsx
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2021 SonarSource SA
- * mailto:info 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 { Location } from 'history';
-import { keyBy } from 'lodash';
-import * as React from 'react';
-import { connect } from 'react-redux';
-import { Link } from 'react-router';
-import { searchProjects } from '../../../api/components';
-import { getFacet } from '../../../api/issues';
-import A11ySkipTarget from '../../../app/components/a11y/A11ySkipTarget';
-import withIndexationContext, {
- WithIndexationContextProps
-} from '../../../components/hoc/withIndexationContext';
-import { translate } from '../../../helpers/l10n';
-import { addWhitePageClass, removeWhitePageClass } from '../../../helpers/pages';
-import { sanitizeString } from '../../../helpers/sanitize';
-import {
- getAppState,
- getCurrentUser,
- getGlobalSettingValue,
- Store
-} from '../../../store/rootReducer';
-import { fetchAboutPageSettings } from '../actions';
-import '../styles.css';
-import AboutCleanCode from './AboutCleanCode';
-import AboutLanguages from './AboutLanguages';
-import AboutLeakPeriod from './AboutLeakPeriod';
-import AboutProjects from './AboutProjects';
-import AboutQualityGates from './AboutQualityGates';
-import AboutQualityModel from './AboutQualityModel';
-import AboutScanners from './AboutScanners';
-import AboutStandards from './AboutStandards';
-import EntryIssueTypes from './EntryIssueTypes';
-
-interface Props extends WithIndexationContextProps {
- currentUser: T.CurrentUser;
- customText?: string;
- fetchAboutPageSettings: () => Promise<void>;
- location: Location;
-}
-
-interface State {
- issueTypes?: T.Dict<{ count: number }>;
- loading: boolean;
- projectsCount: number;
-}
-
-export class AboutApp extends React.PureComponent<Props, State> {
- mounted = false;
-
- state: State = {
- loading: true,
- projectsCount: 0
- };
-
- componentDidMount() {
- this.mounted = true;
- this.loadData();
- addWhitePageClass();
- }
-
- componentWillUnmount() {
- this.mounted = false;
- removeWhitePageClass();
- }
-
- loadProjects() {
- return searchProjects({ ps: 1 }).then(r => r.paging.total);
- }
-
- loadIssues() {
- return getFacet({ resolved: false }, 'types');
- }
-
- loadCustomText() {
- return this.props.fetchAboutPageSettings();
- }
-
- loadData() {
- Promise.all([
- this.loadProjects(),
- this.props.indexationContext.status.isCompleted
- ? this.loadIssues().catch(() => undefined)
- : Promise.resolve(undefined),
- this.loadCustomText()
- ]).then(
- responses => {
- if (this.mounted) {
- const [projectsCount = 0, issues] = responses;
- const issueTypes = issues && keyBy(issues.facet, 'val');
- this.setState({ projectsCount, issueTypes, loading: false });
- }
- },
- () => {
- if (this.mounted) {
- this.setState({ loading: false });
- }
- }
- );
- }
-
- render() {
- const { customText } = this.props;
- const { loading, issueTypes, projectsCount } = this.state;
-
- let bugs;
- let vulnerabilities;
- let codeSmells;
- if (!loading && issueTypes) {
- bugs = issueTypes['BUG'] && issueTypes['BUG'].count;
- vulnerabilities = issueTypes['VULNERABILITY'] && issueTypes['VULNERABILITY'].count;
- codeSmells = issueTypes['CODE_SMELL'] && issueTypes['CODE_SMELL'].count;
- }
-
- return (
- <div className="page page-limited about-page" id="about-page">
- <A11ySkipTarget anchor="about_main" />
-
- <div className="about-page-entry">
- <div className="about-page-intro">
- <h1 className="big-spacer-bottom">{translate('layout.sonar.slogan')}</h1>
- {!this.props.currentUser.isLoggedIn && (
- <Link className="button button-active big-spacer-right" to="/sessions/new">
- {translate('layout.login')}
- </Link>
- )}
- <Link className="button" to="/documentation">
- {translate('about_page.read_documentation')}
- </Link>
- </div>
-
- <div className="about-page-instance">
- <AboutProjects count={projectsCount} loading={loading} />
- {issueTypes && (
- <EntryIssueTypes
- bugs={bugs}
- codeSmells={codeSmells}
- loading={loading}
- vulnerabilities={vulnerabilities}
- />
- )}
- </div>
- </div>
-
- {customText && (
- <div
- className="about-page-section"
- // eslint-disable-next-line react/no-danger
- dangerouslySetInnerHTML={{ __html: sanitizeString(customText) }}
- />
- )}
-
- <AboutLanguages />
-
- <AboutQualityModel />
-
- <div className="flex-columns">
- <div className="flex-column flex-column-half about-page-group-boxes">
- <AboutCleanCode />
- </div>
- <div className="flex-column flex-column-half about-page-group-boxes">
- <AboutLeakPeriod />
- </div>
- </div>
-
- <div className="flex-columns">
- <div className="flex-column flex-column-half about-page-group-boxes">
- <AboutQualityGates />
- </div>
- <div className="flex-column flex-column-half about-page-group-boxes">
- <AboutStandards />
- </div>
- </div>
-
- <AboutScanners />
- </div>
- );
- }
-}
-
-const mapStateToProps = (state: Store) => {
- const customText = getGlobalSettingValue(state, 'sonar.lf.aboutText');
- return {
- appState: getAppState(state),
- currentUser: getCurrentUser(state),
- customText: customText && customText.value
- };
-};
-
-const mapDispatchToProps = { fetchAboutPageSettings } as any;
-
-export default withIndexationContext(connect(mapStateToProps, mapDispatchToProps)(AboutApp));
diff --git a/server/sonar-web/src/main/js/apps/about/components/AboutCleanCode.tsx b/server/sonar-web/src/main/js/apps/about/components/AboutCleanCode.tsx
deleted file mode 100644
index 06c3895fda8..00000000000
--- a/server/sonar-web/src/main/js/apps/about/components/AboutCleanCode.tsx
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2021 SonarSource SA
- * mailto:info 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 * as React from 'react';
-import { translate } from '../../../helpers/l10n';
-import ReadMore from './ReadMore';
-
-const link = '/documentation/user-guide/issues/';
-
-export default function AboutCleanCode() {
- return (
- <div className="boxed-group">
- <h2>{translate('about_page.clean_code')}</h2>
- <div className="boxed-group-inner">
- <p className="about-page-text">{translate('about_page.clean_code.text')}</p>
- <ReadMore link={link} />
- </div>
- </div>
- );
-}
diff --git a/server/sonar-web/src/main/js/apps/about/components/AboutLanguages.tsx b/server/sonar-web/src/main/js/apps/about/components/AboutLanguages.tsx
deleted file mode 100644
index dec68ff5227..00000000000
--- a/server/sonar-web/src/main/js/apps/about/components/AboutLanguages.tsx
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2021 SonarSource SA
- * mailto:info 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 * as React from 'react';
-import { translate } from '../../../helpers/l10n';
-
-const languages = [
- { name: 'Java', url: 'https://redirect.sonarsource.com/plugins/java.html' },
- { name: 'C/C++', url: 'https://redirect.sonarsource.com/plugins/cpp.html' },
- { name: 'C#', url: 'https://redirect.sonarsource.com/plugins/csharp.html' },
- { name: 'COBOL', url: 'https://redirect.sonarsource.com/plugins/cobol.html' },
- { name: 'ABAP', url: 'https://redirect.sonarsource.com/plugins/abap.html' },
- { name: 'HTML', url: 'https://redirect.sonarsource.com/plugins/web.html' },
- { name: 'RPG', url: 'https://redirect.sonarsource.com/plugins/rpg.html' },
- { name: 'JavaScript', url: 'https://redirect.sonarsource.com/plugins/javascript.html' },
- { name: 'TypeScript', url: 'https://redirect.sonarsource.com/plugins/typescript.html' },
- { name: 'Objective C', url: 'https://redirect.sonarsource.com/plugins/objectivec.html' },
- { name: 'XML', url: 'https://redirect.sonarsource.com/plugins/xml.html' },
- { name: 'VB.NET', url: 'https://redirect.sonarsource.com/plugins/vbnet.html' },
- { name: 'PL/SQL', url: 'https://redirect.sonarsource.com/plugins/plsql.html' },
- { name: 'T-SQL', url: 'https://redirect.sonarsource.com/plugins/tsql.html' },
- { name: 'Flex', url: 'https://redirect.sonarsource.com/plugins/flex.html' },
- { name: 'Python', url: 'https://redirect.sonarsource.com/plugins/python.html' },
- { name: 'Groovy', url: 'https://redirect.sonarsource.com/plugins/groovy.html' },
- { name: 'PHP', url: 'https://redirect.sonarsource.com/plugins/php.html' },
- { name: 'Swift', url: 'https://redirect.sonarsource.com/plugins/swift.html' },
- { name: 'Visual Basic', url: 'https://redirect.sonarsource.com/plugins/vb.html' },
- { name: 'PL/I', url: 'https://redirect.sonarsource.com/plugins/pli.html' }
-];
-
-const half = (languages.length + 1) / 2;
-
-export default function AboutLanguages() {
- return (
- <div className="boxed-group">
- <h2>{translate('about_page.languages')}</h2>
- <div className="boxed-group-inner">
- <p className="about-page-text">{translate('about_page.languages.text')}</p>
- <ul className="about-page-languages">
- {languages.slice(0, half).map((language, index) => (
- <li key={index}>
- <a href={language.url}>{language.name}</a>
- <br />
- {index + half < languages.length && (
- <a href={languages[index + half].url}>{languages[index + half].name}</a>
- )}
- </li>
- ))}
- </ul>
- </div>
- </div>
- );
-}
diff --git a/server/sonar-web/src/main/js/apps/about/components/AboutLeakPeriod.tsx b/server/sonar-web/src/main/js/apps/about/components/AboutLeakPeriod.tsx
deleted file mode 100644
index 5866a83a6db..00000000000
--- a/server/sonar-web/src/main/js/apps/about/components/AboutLeakPeriod.tsx
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2021 SonarSource SA
- * mailto:info 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 * as React from 'react';
-import { translate } from '../../../helpers/l10n';
-import ReadMore from './ReadMore';
-
-const link = '/documentation/user-guide/clean-as-you-code/';
-
-export default function AboutLeakPeriod() {
- return (
- <div className="boxed-group">
- <h2>{translate('about_page.fix_the_leak')}</h2>
- <div className="boxed-group-inner">
- <p className="about-page-text">{translate('about_page.fix_the_leak_on_new_code.text')}</p>
- <ReadMore link={link} />
- </div>
- </div>
- );
-}
diff --git a/server/sonar-web/src/main/js/apps/about/components/AboutProjects.tsx b/server/sonar-web/src/main/js/apps/about/components/AboutProjects.tsx
deleted file mode 100644
index c9d745e20f1..00000000000
--- a/server/sonar-web/src/main/js/apps/about/components/AboutProjects.tsx
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2021 SonarSource SA
- * mailto:info 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 * as React from 'react';
-import { Link } from 'react-router';
-import { translate } from '../../../helpers/l10n';
-import { formatMeasure } from '../../../helpers/measures';
-
-interface Props {
- count: number;
- loading: boolean;
-}
-
-export default function AboutProjects({ count, loading }: Props) {
- return (
- <div className="about-page-projects">
- {loading ? (
- <i className="spinner" />
- ) : (
- <div>
- <div>
- <Link className="about-page-projects-link" to="/projects">
- {formatMeasure(count, 'INT')}
- </Link>
- </div>
- <div>{translate('about_page.projects_analyzed')}</div>
- </div>
- )}
- </div>
- );
-}
diff --git a/server/sonar-web/src/main/js/apps/about/components/AboutQualityGates.tsx b/server/sonar-web/src/main/js/apps/about/components/AboutQualityGates.tsx
deleted file mode 100644
index f97c42ab4b0..00000000000
--- a/server/sonar-web/src/main/js/apps/about/components/AboutQualityGates.tsx
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2021 SonarSource SA
- * mailto:info 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 * as React from 'react';
-import { translate } from '../../../helpers/l10n';
-import ReadMore from './ReadMore';
-
-const link = '/documentation/user-guide/quality-gates/';
-
-export default function AboutQualityGates() {
- return (
- <div className="boxed-group">
- <h2>{translate('about_page.quality_gates')}</h2>
- <div className="boxed-group-inner">
- <p className="about-page-text">{translate('about_page.quality_gates.text')}</p>
- <ReadMore link={link} />
- </div>
- </div>
- );
-}
diff --git a/server/sonar-web/src/main/js/apps/about/components/AboutQualityModel.tsx b/server/sonar-web/src/main/js/apps/about/components/AboutQualityModel.tsx
deleted file mode 100644
index d2a97c43087..00000000000
--- a/server/sonar-web/src/main/js/apps/about/components/AboutQualityModel.tsx
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2021 SonarSource SA
- * mailto:info 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 * as React from 'react';
-import BugIcon from '../../../components/icons/BugIcon';
-import CodeSmellIcon from '../../../components/icons/CodeSmellIcon';
-import SecurityHotspotIcon from '../../../components/icons/SecurityHotspotIcon';
-import VulnerabilityIcon from '../../../components/icons/VulnerabilityIcon';
-import { translate } from '../../../helpers/l10n';
-
-export default function AboutQualityModel() {
- return (
- <div className="boxed-group about-quality-model">
- <h2>{translate('about_page.quality_model')}</h2>
-
- <div className="boxed-group-inner clearfix">
- <div className="flex-columns">
- <div className="flex-column flex-column-third">
- <h3>{translate('metric_domain.Reliability')}</h3>
- <div className="pull-left little-spacer-right">
- <BugIcon />
- </div>
- <p className="about-page-text overflow-hidden">
- <strong>{translate('issue.type.BUG.plural')}</strong>{' '}
- {translate('about_page.quality_model.bugs')}
- </p>
- </div>
-
- <div className="flex-column flex-column-third">
- <h3>{translate('metric_domain.Security')}</h3>
- <div className="pull-left little-spacer-right">
- <VulnerabilityIcon />
- </div>
- <p className="about-page-text overflow-hidden">
- <strong>{translate('issue.type.VULNERABILITY.plural')}</strong>{' '}
- {translate('about_page.quality_model.vulnerabilities')}
- </p>
- <br />
- <div className="pull-left little-spacer-right">
- <SecurityHotspotIcon />
- </div>
- <p className="about-page-text overflow-hidden">
- <strong>{translate('issue.type.SECURITY_HOTSPOT.plural')}</strong>{' '}
- {translate('about_page.quality_model.security_hotspots')}
- </p>
- </div>
-
- <div className="flex-column flex-column-third">
- <h3>{translate('metric_domain.Maintainability')}</h3>
- <div className="pull-left little-spacer-right">
- <CodeSmellIcon />
- </div>
- <p className="about-page-text overflow-hidden">
- <strong>{translate('issue.type.CODE_SMELL.plural')}</strong>{' '}
- {translate('about_page.quality_model.code_smells')}
- </p>
- </div>
- </div>
- </div>
- </div>
- );
-}
diff --git a/server/sonar-web/src/main/js/apps/about/components/AboutScanners.tsx b/server/sonar-web/src/main/js/apps/about/components/AboutScanners.tsx
deleted file mode 100644
index f557b7966e3..00000000000
--- a/server/sonar-web/src/main/js/apps/about/components/AboutScanners.tsx
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2021 SonarSource SA
- * mailto:info 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 * as React from 'react';
-import { Link } from 'react-router';
-import { translate } from '../../../helpers/l10n';
-import { getBaseUrl } from '../../../helpers/system';
-
-const scanners = [
- {
- key: 'sonarqube',
- link: '/documentation/analysis/scan/sonarscanner/'
- },
- {
- key: 'msbuild',
- link: '/documentation/analysis/scan/sonarscanner-for-msbuild/'
- },
- {
- key: 'maven',
- link: '/documentation/analysis/scan/sonarscanner-for-maven/'
- },
- {
- key: 'gradle',
- link: '/documentation/analysis/scan/sonarscanner-for-gradle/'
- },
- {
- key: 'jenkins',
- link: '/documentation/analysis/scan/sonarscanner-for-jenkins/'
- },
- {
- key: 'ant',
- link: '/documentation/analysis/scan/sonarscanner-for-ant/'
- }
-];
-
-export default function AboutScanners() {
- return (
- <div className="boxed-group">
- <h2>{translate('about_page.scanners')}</h2>
- <div className="boxed-group-inner">
- <p className="about-page-text">{translate('about_page.scanners.text')}</p>
- <div className="about-page-analyzers">
- {scanners.map(scanner => (
- <Link
- className="about-page-analyzer-box"
- key={scanner.key}
- to={scanner.link}
- target="_blank">
- <img
- alt={translate('about_page.scanners', scanner.key)}
- height={60}
- src={`${getBaseUrl()}/images/scanner-logos/${scanner.key}.svg`}
- />
- </Link>
- ))}
- </div>
- </div>
- </div>
- );
-}
diff --git a/server/sonar-web/src/main/js/apps/about/components/AboutStandards.tsx b/server/sonar-web/src/main/js/apps/about/components/AboutStandards.tsx
deleted file mode 100644
index b756bdbf0d4..00000000000
--- a/server/sonar-web/src/main/js/apps/about/components/AboutStandards.tsx
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2021 SonarSource SA
- * mailto:info 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 * as React from 'react';
-import { Link } from 'react-router';
-import TagsIcon from '../../../components/icons/TagsIcon';
-import { translate } from '../../../helpers/l10n';
-import { getRulesUrl } from '../../../helpers/urls';
-import ReadMore from './ReadMore';
-
-const link = '/documentation/user-guide/rules/';
-
-const owaspTags =
- 'owasp-a1,owasp-a2,owasp-a3,owasp-a4,owasp-a5,owasp-a6,owasp-a7,owasp-a8,owasp-a9,owasp-a10';
-const sans25Tags = 'sans-top25-porous,sans-top25-risky,sans-top25-insecure';
-
-export default function AboutStandards() {
- return (
- <div className="boxed-group">
- <h2>{translate('about_page.standards')}</h2>
- <div className="boxed-group-inner">
- <p className="about-page-text">{translate('about_page.standards.text')}</p>
-
- <div className="spacer-top">
- <ul className="list-inline">
- <li>
- <Link className="link-with-icon" to={getRulesUrl({ tags: 'misra' })}>
- <TagsIcon />
- <span className="little-spacer-left">MISRA</span>
- </Link>
- </li>
- <li>
- <Link className="link-with-icon" to={getRulesUrl({ tags: 'cert' })}>
- <TagsIcon />
- <span className="little-spacer-left">CERT</span>
- </Link>
- </li>
- <li>
- <Link className="link-with-icon" to={getRulesUrl({ tags: 'cwe' })}>
- <TagsIcon />
- <span className="little-spacer-left">CWE</span>
- </Link>
- </li>
- <li>
- <Link className="link-with-icon" to={getRulesUrl({ tags: owaspTags })}>
- <TagsIcon />
- <span className="little-spacer-left">OWASP Top 10</span>
- </Link>
- </li>
- <li>
- <Link className="link-with-icon" to={getRulesUrl({ tags: sans25Tags })}>
- <TagsIcon />
- <span className="little-spacer-left">SANS Top 25</span>
- </Link>
- </li>
- </ul>
- </div>
-
- <ReadMore link={link} />
- </div>
- </div>
- );
-}
diff --git a/server/sonar-web/src/main/js/apps/about/components/EntryIssueTypes.tsx b/server/sonar-web/src/main/js/apps/about/components/EntryIssueTypes.tsx
deleted file mode 100644
index 7f3e3f06d03..00000000000
--- a/server/sonar-web/src/main/js/apps/about/components/EntryIssueTypes.tsx
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2021 SonarSource SA
- * mailto:info 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 * as React from 'react';
-import { Link } from 'react-router';
-import BugIcon from '../../../components/icons/BugIcon';
-import CodeSmellIcon from '../../../components/icons/CodeSmellIcon';
-import VulnerabilityIcon from '../../../components/icons/VulnerabilityIcon';
-import { translate } from '../../../helpers/l10n';
-import { formatMeasure } from '../../../helpers/measures';
-import { getIssuesUrl } from '../../../helpers/urls';
-
-export interface EntryIssueTypesProps {
- bugs?: number;
- codeSmells?: number;
- loading: boolean;
- vulnerabilities?: number;
-}
-
-export default function EntryIssueTypes({
- bugs,
- codeSmells,
- loading,
- vulnerabilities
-}: EntryIssueTypesProps) {
- return (
- <div className="about-page-projects">
- {loading ? (
- <i className="spinner" />
- ) : (
- <table className="about-page-issue-types">
- <tbody>
- <tr>
- <td className="about-page-issue-type-number">
- <Link
- className="about-page-issue-type-link"
- to={getIssuesUrl({ resolved: 'false', types: 'BUG', s: 'CREATION_DATE' })}>
- {formatMeasure(bugs, 'SHORT_INT')}
- </Link>
- </td>
- <td>
- <span className="little-spacer-right">
- <BugIcon />
- </span>
- {translate('issue.type.BUG.plural')}
- </td>
- </tr>
- <tr>
- <td className="about-page-issue-type-number">
- <Link
- className="about-page-issue-type-link"
- to={getIssuesUrl({
- resolved: 'false',
- types: 'VULNERABILITY',
- s: 'CREATION_DATE'
- })}>
- {formatMeasure(vulnerabilities, 'SHORT_INT')}
- </Link>
- </td>
- <td>
- <span className="little-spacer-right">
- <VulnerabilityIcon />
- </span>
- {translate('issue.type.VULNERABILITY.plural')}
- </td>
- </tr>
- <tr>
- <td className="about-page-issue-type-number">
- <Link
- className="about-page-issue-type-link"
- to={getIssuesUrl({ resolved: 'false', types: 'CODE_SMELL', s: 'CREATION_DATE' })}>
- {formatMeasure(codeSmells, 'SHORT_INT')}
- </Link>
- </td>
- <td>
- <span className="little-spacer-right">
- <CodeSmellIcon />
- </span>
- {translate('issue.type.CODE_SMELL.plural')}
- </td>
- </tr>
- </tbody>
- </table>
- )}
- </div>
- );
-}
diff --git a/server/sonar-web/src/main/js/apps/about/components/ReadMore.tsx b/server/sonar-web/src/main/js/apps/about/components/ReadMore.tsx
deleted file mode 100644
index 9cd05e74d7c..00000000000
--- a/server/sonar-web/src/main/js/apps/about/components/ReadMore.tsx
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2021 SonarSource SA
- * mailto:info 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 * as React from 'react';
-import { Link } from 'react-router';
-import { translate } from '../../../helpers/l10n';
-
-interface Props {
- link: string;
-}
-
-export default function ReadMore({ link }: Props) {
- return (
- <div className="big-spacer-top">
- <Link className="about-page-link-more" to={link} target="_blank">
- <span>{translate('about_page.read_more')}</span>
- </Link>
- </div>
- );
-}
diff --git a/server/sonar-web/src/main/js/apps/about/components/__tests__/AboutApp-test.tsx b/server/sonar-web/src/main/js/apps/about/components/__tests__/AboutApp-test.tsx
deleted file mode 100644
index 4d814ae0698..00000000000
--- a/server/sonar-web/src/main/js/apps/about/components/__tests__/AboutApp-test.tsx
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2021 SonarSource SA
- * mailto:info 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 { shallow } from 'enzyme';
-import * as React from 'react';
-import { searchProjects } from '../../../../api/components';
-import { getFacet } from '../../../../api/issues';
-import { addWhitePageClass, removeWhitePageClass } from '../../../../helpers/pages';
-import { mockCurrentUser, mockLocation } from '../../../../helpers/testMocks';
-import { waitAndUpdate } from '../../../../helpers/testUtils';
-import { AboutApp } from '../AboutApp';
-import EntryIssueTypes from '../EntryIssueTypes';
-
-jest.mock('../../../../helpers/pages', () => ({
- addWhitePageClass: jest.fn(),
- removeWhitePageClass: jest.fn()
-}));
-
-jest.mock('../../../../api/components', () => ({
- searchProjects: jest.fn().mockResolvedValue({ paging: { total: 5 } })
-}));
-
-jest.mock('../../../../api/issues', () => ({
- getFacet: jest.fn().mockResolvedValue({
- facet: [
- { count: 5, val: 'CODE_SMELL' },
- { count: 10, val: 'BUG' },
- { count: 0, val: 'VULNERABILITY' },
- { count: 5, val: 'SECURITY_HOTSPOT' }
- ]
- })
-}));
-
-jest.mock(
- '../../../../app/components/GlobalContainer',
- () =>
- class GlobalContainer extends React.Component {
- static displayName = 'GlobalContainer';
- render() {
- return this.props.children;
- }
- }
-);
-
-it('should render correctly', async () => {
- const wrapper = shallowRender();
- await waitAndUpdate(wrapper);
-
- expect(wrapper).toMatchSnapshot();
- expect(addWhitePageClass).toBeCalled();
-
- wrapper.unmount();
- expect(removeWhitePageClass).toBeCalled();
-
- expect(
- shallowRender({
- indexationContext: {
- status: { isCompleted: false, percentCompleted: 10, hasFailures: false }
- }
- })
- ).toMatchSnapshot('when indexation not complete');
-});
-
-it('should load issues, projects, and custom text upon shallowing', () => {
- const fetchAboutPageSettings = jest.fn();
- shallowRender({ fetchAboutPageSettings });
- expect(fetchAboutPageSettings).toBeCalled();
- expect(searchProjects).toBeCalled();
- expect(getFacet).toBeCalled();
-});
-
-it('should not display issues if the WS return an http error', async () => {
- (getFacet as jest.Mock).mockRejectedValueOnce(undefined);
-
- const wrapper = shallowRender();
-
- await waitAndUpdate(wrapper);
-
- expect(wrapper.find(EntryIssueTypes).exists()).toBe(false);
-});
-
-function shallowRender(props: Partial<AboutApp['props']> = {}) {
- return shallow(
- <AboutApp
- currentUser={mockCurrentUser()}
- customText="Lorem ipsum"
- fetchAboutPageSettings={jest.fn().mockResolvedValue('')}
- location={mockLocation()}
- indexationContext={{
- status: { isCompleted: true, percentCompleted: 100, hasFailures: false }
- }}
- {...props}
- />
- );
-}
diff --git a/server/sonar-web/src/main/js/apps/about/components/__tests__/AboutScanners-test.tsx b/server/sonar-web/src/main/js/apps/about/components/__tests__/AboutScanners-test.tsx
deleted file mode 100644
index 5f1e0e03ad4..00000000000
--- a/server/sonar-web/src/main/js/apps/about/components/__tests__/AboutScanners-test.tsx
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2021 SonarSource SA
- * mailto:info 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 { shallow } from 'enzyme';
-import * as React from 'react';
-import AboutScanners from '../AboutScanners';
-
-it('should render correctly', () => {
- const wrapper = shallowRender();
- expect(wrapper).toMatchSnapshot();
-});
-
-function shallowRender() {
- return shallow(<AboutScanners />);
-}
diff --git a/server/sonar-web/src/main/js/apps/about/components/__tests__/__snapshots__/AboutApp-test.tsx.snap b/server/sonar-web/src/main/js/apps/about/components/__tests__/__snapshots__/AboutApp-test.tsx.snap
deleted file mode 100644
index 881203c89cd..00000000000
--- a/server/sonar-web/src/main/js/apps/about/components/__tests__/__snapshots__/AboutApp-test.tsx.snap
+++ /dev/null
@@ -1,181 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly 1`] = `
-<div
- className="page page-limited about-page"
- id="about-page"
->
- <A11ySkipTarget
- anchor="about_main"
- />
- <div
- className="about-page-entry"
- >
- <div
- className="about-page-intro"
- >
- <h1
- className="big-spacer-bottom"
- >
- layout.sonar.slogan
- </h1>
- <Link
- className="button button-active big-spacer-right"
- onlyActiveOnIndex={false}
- style={Object {}}
- to="/sessions/new"
- >
- layout.login
- </Link>
- <Link
- className="button"
- onlyActiveOnIndex={false}
- style={Object {}}
- to="/documentation"
- >
- about_page.read_documentation
- </Link>
- </div>
- <div
- className="about-page-instance"
- >
- <AboutProjects
- count={5}
- loading={false}
- />
- <EntryIssueTypes
- bugs={10}
- codeSmells={5}
- loading={false}
- vulnerabilities={0}
- />
- </div>
- </div>
- <div
- className="about-page-section"
- dangerouslySetInnerHTML={
- Object {
- "__html": "Lorem ipsum",
- }
- }
- />
- <AboutLanguages />
- <AboutQualityModel />
- <div
- className="flex-columns"
- >
- <div
- className="flex-column flex-column-half about-page-group-boxes"
- >
- <AboutCleanCode />
- </div>
- <div
- className="flex-column flex-column-half about-page-group-boxes"
- >
- <AboutLeakPeriod />
- </div>
- </div>
- <div
- className="flex-columns"
- >
- <div
- className="flex-column flex-column-half about-page-group-boxes"
- >
- <AboutQualityGates />
- </div>
- <div
- className="flex-column flex-column-half about-page-group-boxes"
- >
- <AboutStandards />
- </div>
- </div>
- <AboutScanners />
-</div>
-`;
-
-exports[`should render correctly: when indexation not complete 1`] = `
-<div
- className="page page-limited about-page"
- id="about-page"
->
- <A11ySkipTarget
- anchor="about_main"
- />
- <div
- className="about-page-entry"
- >
- <div
- className="about-page-intro"
- >
- <h1
- className="big-spacer-bottom"
- >
- layout.sonar.slogan
- </h1>
- <Link
- className="button button-active big-spacer-right"
- onlyActiveOnIndex={false}
- style={Object {}}
- to="/sessions/new"
- >
- layout.login
- </Link>
- <Link
- className="button"
- onlyActiveOnIndex={false}
- style={Object {}}
- to="/documentation"
- >
- about_page.read_documentation
- </Link>
- </div>
- <div
- className="about-page-instance"
- >
- <AboutProjects
- count={0}
- loading={true}
- />
- </div>
- </div>
- <div
- className="about-page-section"
- dangerouslySetInnerHTML={
- Object {
- "__html": "Lorem ipsum",
- }
- }
- />
- <AboutLanguages />
- <AboutQualityModel />
- <div
- className="flex-columns"
- >
- <div
- className="flex-column flex-column-half about-page-group-boxes"
- >
- <AboutCleanCode />
- </div>
- <div
- className="flex-column flex-column-half about-page-group-boxes"
- >
- <AboutLeakPeriod />
- </div>
- </div>
- <div
- className="flex-columns"
- >
- <div
- className="flex-column flex-column-half about-page-group-boxes"
- >
- <AboutQualityGates />
- </div>
- <div
- className="flex-column flex-column-half about-page-group-boxes"
- >
- <AboutStandards />
- </div>
- </div>
- <AboutScanners />
-</div>
-`;
diff --git a/server/sonar-web/src/main/js/apps/about/components/__tests__/__snapshots__/AboutScanners-test.tsx.snap b/server/sonar-web/src/main/js/apps/about/components/__tests__/__snapshots__/AboutScanners-test.tsx.snap
deleted file mode 100644
index ad4dd1080e0..00000000000
--- a/server/sonar-web/src/main/js/apps/about/components/__tests__/__snapshots__/AboutScanners-test.tsx.snap
+++ /dev/null
@@ -1,108 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly 1`] = `
-<div
- className="boxed-group"
->
- <h2>
- about_page.scanners
- </h2>
- <div
- className="boxed-group-inner"
- >
- <p
- className="about-page-text"
- >
- about_page.scanners.text
- </p>
- <div
- className="about-page-analyzers"
- >
- <Link
- className="about-page-analyzer-box"
- key="sonarqube"
- onlyActiveOnIndex={false}
- style={Object {}}
- target="_blank"
- to="/documentation/analysis/scan/sonarscanner/"
- >
- <img
- alt="about_page.scanners.sonarqube"
- height={60}
- src="/images/scanner-logos/sonarqube.svg"
- />
- </Link>
- <Link
- className="about-page-analyzer-box"
- key="msbuild"
- onlyActiveOnIndex={false}
- style={Object {}}
- target="_blank"
- to="/documentation/analysis/scan/sonarscanner-for-msbuild/"
- >
- <img
- alt="about_page.scanners.msbuild"
- height={60}
- src="/images/scanner-logos/msbuild.svg"
- />
- </Link>
- <Link
- className="about-page-analyzer-box"
- key="maven"
- onlyActiveOnIndex={false}
- style={Object {}}
- target="_blank"
- to="/documentation/analysis/scan/sonarscanner-for-maven/"
- >
- <img
- alt="about_page.scanners.maven"
- height={60}
- src="/images/scanner-logos/maven.svg"
- />
- </Link>
- <Link
- className="about-page-analyzer-box"
- key="gradle"
- onlyActiveOnIndex={false}
- style={Object {}}
- target="_blank"
- to="/documentation/analysis/scan/sonarscanner-for-gradle/"
- >
- <img
- alt="about_page.scanners.gradle"
- height={60}
- src="/images/scanner-logos/gradle.svg"
- />
- </Link>
- <Link
- className="about-page-analyzer-box"
- key="jenkins"
- onlyActiveOnIndex={false}
- style={Object {}}
- target="_blank"
- to="/documentation/analysis/scan/sonarscanner-for-jenkins/"
- >
- <img
- alt="about_page.scanners.jenkins"
- height={60}
- src="/images/scanner-logos/jenkins.svg"
- />
- </Link>
- <Link
- className="about-page-analyzer-box"
- key="ant"
- onlyActiveOnIndex={false}
- style={Object {}}
- target="_blank"
- to="/documentation/analysis/scan/sonarscanner-for-ant/"
- >
- <img
- alt="about_page.scanners.ant"
- height={60}
- src="/images/scanner-logos/ant.svg"
- />
- </Link>
- </div>
- </div>
-</div>
-`;
diff --git a/server/sonar-web/src/main/js/apps/about/components/__tests__/__snapshots__/EntryIssueTypes-test.tsx.snap b/server/sonar-web/src/main/js/apps/about/components/__tests__/__snapshots__/EntryIssueTypes-test.tsx.snap
deleted file mode 100644
index fe7b11d60ce..00000000000
--- a/server/sonar-web/src/main/js/apps/about/components/__tests__/__snapshots__/EntryIssueTypes-test.tsx.snap
+++ /dev/null
@@ -1,117 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly: loading 1`] = `
-<div
- className="about-page-projects"
->
- <i
- className="spinner"
- />
-</div>
-`;
-
-exports[`should render correctly: loading 2`] = `
-<div
- className="about-page-projects"
->
- <table
- className="about-page-issue-types"
- >
- <tbody>
- <tr>
- <td
- className="about-page-issue-type-number"
- >
- <Link
- className="about-page-issue-type-link"
- onlyActiveOnIndex={false}
- style={Object {}}
- to={
- Object {
- "pathname": "/issues",
- "query": Object {
- "resolved": "false",
- "s": "CREATION_DATE",
- "types": "BUG",
- },
- }
- }
- >
- 10
- </Link>
- </td>
- <td>
- <span
- className="little-spacer-right"
- >
- <BugIcon />
- </span>
- issue.type.BUG.plural
- </td>
- </tr>
- <tr>
- <td
- className="about-page-issue-type-number"
- >
- <Link
- className="about-page-issue-type-link"
- onlyActiveOnIndex={false}
- style={Object {}}
- to={
- Object {
- "pathname": "/issues",
- "query": Object {
- "resolved": "false",
- "s": "CREATION_DATE",
- "types": "VULNERABILITY",
- },
- }
- }
- >
- 1short_number_suffix.k
- </Link>
- </td>
- <td>
- <span
- className="little-spacer-right"
- >
- <VulnerabilityIcon />
- </span>
- issue.type.VULNERABILITY.plural
- </td>
- </tr>
- <tr>
- <td
- className="about-page-issue-type-number"
- >
- <Link
- className="about-page-issue-type-link"
- onlyActiveOnIndex={false}
- style={Object {}}
- to={
- Object {
- "pathname": "/issues",
- "query": Object {
- "resolved": "false",
- "s": "CREATION_DATE",
- "types": "CODE_SMELL",
- },
- }
- }
- >
- 100
- </Link>
- </td>
- <td>
- <span
- className="little-spacer-right"
- >
- <CodeSmellIcon />
- </span>
- issue.type.CODE_SMELL.plural
- </td>
- </tr>
- </tbody>
- </table>
-</div>
-`;
diff --git a/server/sonar-web/src/main/js/apps/about/routes.ts b/server/sonar-web/src/main/js/apps/about/routes.ts
deleted file mode 100644
index 78799c787b0..00000000000
--- a/server/sonar-web/src/main/js/apps/about/routes.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2021 SonarSource SA
- * mailto:info 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 { lazyLoadComponent } from '../../components/lazyLoadComponent';
-
-const routes = [
- { indexRoute: { component: lazyLoadComponent(() => import('./components/AboutApp')) } }
-];
-
-export default routes;
diff --git a/server/sonar-web/src/main/js/apps/about/styles.css b/server/sonar-web/src/main/js/apps/about/styles.css
deleted file mode 100644
index 7b0552b1de3..00000000000
--- a/server/sonar-web/src/main/js/apps/about/styles.css
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2021 SonarSource SA
- * mailto:info 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.
- */
-.about-page {
- font-size: var(--mediumFontSize);
-}
-
-.about-page .boxed-group {
- border: none;
-}
-
-.about-page .boxed-group h2 {
- padding-left: 0;
- padding-right: 0;
- font-size: 18px;
-}
-
-.about-page .boxed-group > h2 {
- padding-top: 25px;
-}
-
-.about-page .boxed-group h3 {
- font-weight: normal;
- font-size: var(--bigFontSize);
- padding-bottom: calc(1.5 * var(--gridSize));
-}
-
-.about-page .boxed-group-inner {
- padding-left: 0;
- padding-right: 0;
- padding-bottom: 25px;
-}
-
-.about-page-entry {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 45px;
- padding: 65px 0 65px;
- border-bottom: 1px solid var(--barBorderColor);
-}
-
-.about-page-intro {
- padding-right: 65px;
- border-right: 1px solid var(--barBorderColor);
-}
-
-.about-page-intro > h1 {
- line-height: 40px;
- font-size: 26px;
- font-weight: 300;
-}
-
-.about-page-intro > .button {
- height: 32px;
- line-height: 30px;
- padding-left: 15px;
- padding-right: 15px;
- border-radius: 3px;
- font-size: var(--baseFontSize);
- font-weight: 400;
-}
-
-.about-page-instance {
- display: flex;
- align-items: center;
-}
-
-.about-page-projects {
- margin-left: 65px;
- line-height: 1.4;
- font-size: var(--bigFontSize);
- text-align: center;
- min-width: 128px;
-}
-
-.about-page-projects-link {
- display: inline-block;
- line-height: 1;
- margin-bottom: 12px;
- font-size: 32px;
-}
-
-.about-page-issue-types {
- text-align: left;
-}
-
-.about-page-issue-types tr + tr td {
- padding-top: 12px;
-}
-
-.about-page-issue-types svg {
- vertical-align: middle;
- transform: translateY(-1px);
-}
-
-.about-page-issue-type-number {
- padding-right: 16px;
- text-align: right;
-}
-
-.about-page-issue-type-link {
- font-size: var(--bigFontSize);
- font-weight: bold;
-}
-
-.about-page-section {
- padding-top: 20px;
- padding-bottom: 10px;
-}
-
-.about-page-text {
- line-height: 1.4;
-}
-
-.about-page-link-more {
- border: none;
-}
-
-.about-page-link-more > span {
- border-bottom: 1px solid var(--lightBlue);
-}
-
-.about-page-languages {
- display: flex;
- justify-content: space-between;
- margin-top: 10px;
-}
-
-.about-page-languages > li {
- line-height: 2;
-}
-
-.about-quality-model .flex-column + .flex-column {
- margin-left: 30px;
- padding-left: 30px;
- border-left: 1px solid var(--barBorderColor);
-}
-
-.about-quality-model svg {
- transform: translateY(2px);
-}
-
-.about-page-analyzers {
- display: flex;
- justify-content: space-between;
- margin-top: 15px;
-}
-
-.about-page-analyzer-box {
- border: none;
-}
-
-.about-page-group-boxes {
- display: flex;
- flex-direction: column;
-}
-
-.about-page-group-boxes > .boxed-group {
- flex-grow: 1;
-}