From 3049d9176376e1907980a692c318c9d0299b8bd8 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Wed, 6 Apr 2016 14:59:52 +0200 Subject: [PATCH] SONAR-7402 add ability to drilldown with developer selected --- .../details/drilldown/ComponentCell.js | 2 +- .../details/drilldown/ListView.js | 11 +++++++- .../details/drilldown/MeasureDrilldown.js | 18 +++++++------ .../store/treeViewActions.js | 27 ++++++++++++------- 4 files changed, 38 insertions(+), 20 deletions(-) diff --git a/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ComponentCell.js b/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ComponentCell.js index e5e5a3cbb17..856c79cbe56 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ComponentCell.js +++ b/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ComponentCell.js @@ -55,7 +55,7 @@ const ComponentCell = ({ component, isSelected, onClick }) => { return (
- {component.refId == null ? ( + {(component.refId == null || component.qualifier === 'DEV_PRJ') ? (
    -
  • - - - {translate('component_measures.tab.list')} - -
  • + {component.qualifier !== 'DEV' && ( +
  • + + + {translate('component_measures.tab.list')} + +
  • + )}
  • { + return makeRequest(rootComponent, baseComponent, metric, options, periodIndex).then(r => { const nextComponents = filterOutEmptyMeasures(enhanceWithMeasure(r.components, metric.key, periodIndex)); return { @@ -108,10 +115,10 @@ function fetchComponents (baseComponent, metric, pageIndex = 1, periodIndex = 1) */ function fetchList (baseComponent) { return (dispatch, getState) => { - const { metric, periodIndex } = getState().tree; + const { metric, periodIndex, rootComponent } = getState().tree; dispatch(startFetching()); - return fetchComponents(baseComponent, metric, 1, periodIndex).then(r => { + return fetchComponents(rootComponent, baseComponent, metric, 1, periodIndex).then(r => { dispatch(updateStore({ ...r, baseComponent, @@ -148,9 +155,9 @@ export function start (rootComponent, metric, periodIndex = 1) { */ export function drilldown (component) { return (dispatch, getState) => { - const { metric, breadcrumbs, periodIndex } = getState().tree; + const { metric, rootComponent, breadcrumbs, periodIndex } = getState().tree; dispatch(startFetching()); - return fetchComponents(component, metric, 1, periodIndex).then(r => { + return fetchComponents(rootComponent, component, metric, 1, periodIndex).then(r => { dispatch(updateStore({ ...r, breadcrumbs: [...breadcrumbs, component], @@ -167,10 +174,10 @@ export function drilldown (component) { */ export function useBreadcrumbs (component) { return (dispatch, getState) => { - const { metric, breadcrumbs, periodIndex } = getState().tree; + const { metric, rootComponent, breadcrumbs, periodIndex } = getState().tree; const index = breadcrumbs.indexOf(component); dispatch(startFetching()); - return fetchComponents(component, metric, 1, periodIndex).then(r => { + return fetchComponents(rootComponent, component, metric, 1, periodIndex).then(r => { dispatch(updateStore({ ...r, breadcrumbs: breadcrumbs.slice(0, index + 1), -- 2.39.5