aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/component-measures/hooks.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-web/src/main/js/apps/component-measures/hooks.js')
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/hooks.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/server/sonar-web/src/main/js/apps/component-measures/hooks.js b/server/sonar-web/src/main/js/apps/component-measures/hooks.js
index d9d58658fc4..03653fa3067 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/hooks.js
+++ b/server/sonar-web/src/main/js/apps/component-measures/hooks.js
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { hasHistory } from './utils';
+import { hasHistory, hasBubbleChart } from './utils';
export function checkHistoryExistence (nextState, replace) {
const { metricKey } = nextState.params;
@@ -29,3 +29,14 @@ export function checkHistoryExistence (nextState, replace) {
});
}
}
+
+export function checkBubbleChartExistence (nextState, replace) {
+ const { metricKey } = nextState.params;
+
+ if (!hasBubbleChart(metricKey)) {
+ replace({
+ pathname: metricKey,
+ query: nextState.location.query
+ });
+ }
+}