]> source.dussan.org Git - sonarqube.git/commitdiff
[NO JIRA] Fix Code Smells
authorWouter Admiraal <wouter.admiraal@sonarsource.com>
Tue, 11 Oct 2022 15:29:13 +0000 (17:29 +0200)
committersonartech <sonartech@sonarsource.com>
Thu, 13 Oct 2022 20:03:19 +0000 (20:03 +0000)
server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityApp.tsx

index 59bb31c2d52f33566a3c1218592363d74114b64d..9d92b92c38a9050030ebf9d31fd7056790b9b8f6 100644 (file)
@@ -192,7 +192,7 @@ export class ProjectActivityApp extends React.PureComponent<Props, State> {
         metric: measure.metric,
         history: measure.history.map(analysis => ({
           date: parseDate(analysis.date),
-          value: analysis.value!
+          value: analysis.value
         }))
       }))
     );
@@ -334,26 +334,6 @@ export class ProjectActivityApp extends React.PureComponent<Props, State> {
     });
   };
 
-  shouldRedirect = () => {
-    const locationQuery = this.props.location.query;
-    if (!locationQuery) {
-      return false;
-    }
-    const filtered = Object.keys(locationQuery).some(
-      key => key !== 'id' && locationQuery[key] !== ''
-    );
-
-    const { graph, customGraphs } = getActivityGraph(
-      PROJECT_ACTIVITY_GRAPH,
-      this.props.component.key
-    );
-    const emptyCustomGraph = isCustomGraph(graph) && customGraphs.length <= 0;
-
-    // if there is no filter, but there are saved preferences in the localStorage
-    // also don't redirect to custom if there is no metrics selected for it
-    return !filtered && graph != null && graph !== DEFAULT_GRAPH && !emptyCustomGraph;
-  };
-
   render() {
     return (
       <ProjectActivityAppRenderer