aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/projects/visualizations/Visualizations.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-web/src/main/js/apps/projects/visualizations/Visualizations.tsx')
-rw-r--r--server/sonar-web/src/main/js/apps/projects/visualizations/Visualizations.tsx89
1 files changed, 0 insertions, 89 deletions
diff --git a/server/sonar-web/src/main/js/apps/projects/visualizations/Visualizations.tsx b/server/sonar-web/src/main/js/apps/projects/visualizations/Visualizations.tsx
deleted file mode 100644
index f25ce4fb271..00000000000
--- a/server/sonar-web/src/main/js/apps/projects/visualizations/Visualizations.tsx
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2022 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, translateWithParameters } from '../../../helpers/l10n';
-import { Dict } from '../../../types/types';
-import { Project } from '../types';
-import { localizeSorting } from '../utils';
-import Coverage from './Coverage';
-import Duplications from './Duplications';
-import Maintainability from './Maintainability';
-import Reliability from './Reliability';
-import Risk from './Risk';
-import Security from './Security';
-
-interface Props {
- projects: Project[];
- sort?: string;
- total?: number;
- visualization: string;
-}
-
-export default class Visualizations extends React.PureComponent<Props> {
- renderVisualization(projects: Project[]) {
- const visualizationToComponent: Dict<any> = {
- risk: Risk,
- reliability: Reliability,
- security: Security,
- maintainability: Maintainability,
- coverage: Coverage,
- duplications: Duplications
- };
- const Component = visualizationToComponent[this.props.visualization];
-
- return Component ? (
- <Component
- helpText={translate('projects.visualization', this.props.visualization, 'description')}
- projects={projects}
- />
- ) : null;
- }
-
- renderFooter() {
- const { projects, total, sort } = this.props;
-
- const limitReached = projects != null && total != null && projects.length < total;
-
- return limitReached ? (
- <footer className="projects-visualizations-footer">
- <p className="note spacer-top">
- {translateWithParameters(
- 'projects.limited_set_of_projects',
- projects!.length,
- localizeSorting(sort)
- )}
- </p>
- </footer>
- ) : null;
- }
-
- render() {
- const { projects } = this.props;
-
- return (
- <div className="boxed-group projects-visualizations">
- <main className="projects-visualization">
- {projects != null && this.renderVisualization(projects)}
- </main>
- {this.renderFooter()}
- </div>
- );
- }
-}