*/
export const DISPLAY_HOME = 'app/DISPLAY_HOME';
-export const DISPLAY_DOMAIN = 'app/DISPLAY_DOMAIN';
export const RECEIVE_METRICS = 'app/RECEIVE_METRICS';
return { type: DISPLAY_HOME };
}
-export function displayDomain (domainName) {
- return { type: DISPLAY_DOMAIN, domainName };
-}
-
function receiveMetrics (metrics) {
return { type: RECEIVE_METRICS, metrics };
}
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { DISPLAY_DOMAIN, RECEIVE_METRICS } from './actions';
+import { RECEIVE_METRICS } from './actions';
const initialState = {
- metrics: undefined,
- lastDisplayedDomain: undefined
+ metrics: undefined
};
export default function appReducer (state = initialState, action = {}) {
switch (action.type) {
- case DISPLAY_DOMAIN:
- return { ...state, lastDisplayedDomain: action.domainName };
case RECEIVE_METRICS:
return { ...state, metrics: action.metrics };
default:
}
render () {
- const { component, metric, secondaryMeasure, measure, periods, lastDisplayedDomain, children } = this.props;
+ const { component, metric, secondaryMeasure, measure, periods, children } = this.props;
if (measure == null) {
return <Spinner/>;
return (
<section id="component-measures-details" className="page page-container page-limited">
- {lastDisplayedDomain ? (
- <Link
- to={{ pathname: `domain/${lastDisplayedDomain}`, query: { id: component.key } }}
- className="small text-muted">
- {translateWithParameters('component_measures.back_to_domain_measures', lastDisplayedDomain)}
- </Link>
- ) : (
- <IndexLink
- to={{ pathname: '/', query: { id: component.key } }}
- id="component-measures-back-to-all-measures"
- className="small text-muted">
- {translate('component_measures.back_to_all_measures')}
- </IndexLink>
- )}
+ <div className="note">
+ <IndexLink
+ to={{ pathname: '/', query: { id: component.key } }}
+ id="component-measures-back-to-all-measures"
+ className="text-muted">
+ {translate('component_measures.all_measures')}
+ </IndexLink>
+ {' / '}
+ <Link
+ to={{ pathname: `domain/${metric.domain}`, query: { id: component.key } }}
+ className="text-muted">
+ {translateWithParameters('component_measures.domain_measures', metric.domain)}
+ </Link>
+ </div>
<MeasureDetailsHeader
measure={measure}
const mapStateToProps = state => {
return {
component: state.app.component,
- lastDisplayedDomain: state.app.lastDisplayedDomain,
metrics: state.app.metrics,
metric: state.details.metric,
measure: state.details.measure,
import { getLeakPeriodLabel } from '../../../helpers/periods';
export default class AllMeasures extends React.Component {
- componentDidMount () {
- this.props.onDisplay();
- }
-
- componentDidUpdate () {
- this.props.onDisplay();
- }
-
render () {
const { component, domains, periods } = this.props;
const leakPeriodLabel = getLeakPeriodLabel(periods);
import { connect } from 'react-redux';
import AllMeasures from './AllMeasures';
-import { displayDomain } from '../app/actions';
const mapStateToProps = state => {
return {
};
};
-const mapDispatchToProps = dispatch => {
- return {
- onDisplay: () => dispatch(displayDomain(undefined))
- };
-};
-
export default connect(
- mapStateToProps,
- mapDispatchToProps
+ mapStateToProps
)(AllMeasures);
};
export default class DomainMeasures extends React.Component {
- componentDidMount () {
- this.props.onDisplay(this.props.params.domainName);
- }
-
- componentDidUpdate () {
- this.props.onDisplay(this.props.params.domainName);
- }
-
render () {
const { component, domains, periods } = this.props;
const { domainName } = this.props.params;
import { connect } from 'react-redux';
import DomainMeasures from './DomainMeasures';
-import { displayDomain } from '../app/actions';
const mapStateToProps = state => {
return {
};
};
-const mapDispatchToProps = dispatch => {
- return {
- onDisplay: domainName => dispatch(displayDomain(domainName))
- };
-};
-
export default connect(
- mapStateToProps,
- mapDispatchToProps
+ mapStateToProps
)(DomainMeasures);
# COMPONENT MEASURES
#
#------------------------------------------------------------------------------
-component_measures.back_to_all_measures=Back to All Measures
-component_measures.back_to_domain_measures=Back to {0} Measures
+component_measures.all_measures=All Measures
+component_measures.domain_measures={0} Measures
component_measures.back_to_list=Back to List
component_measures.tab.tree=Tree
component_measures.tab.list=List