parent
e71b1e6fde
commit
900e9a4369
@ -24,8 +24,8 @@ const ServicesView = ({
|
|||||||
org = {},
|
org = {},
|
||||||
match = {},
|
match = {},
|
||||||
project = {},
|
project = {},
|
||||||
routerPush = {},
|
services = [],
|
||||||
services = []
|
router = {}
|
||||||
}) => {
|
}) => {
|
||||||
const toggle = () => {
|
const toggle = () => {
|
||||||
if(!services) {
|
if(!services) {
|
||||||
@ -37,11 +37,10 @@ const ServicesView = ({
|
|||||||
|
|
||||||
const onToggleChange = (evt) => {
|
const onToggleChange = (evt) => {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
const value = evt.target.value;
|
|
||||||
const path = `/${org.id}/projects/${project.id}/services${
|
router.push(`/${org.id}/projects/${project.id}/services${
|
||||||
value === 'list' ? '/list' : ''
|
evt.target.value === 'list' ? '/list' : ''
|
||||||
}`;
|
}`);
|
||||||
routerPush(path);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -55,8 +54,9 @@ const ServicesView = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const content = services.length ?
|
const content = services.length ? children : (
|
||||||
children : <EmptyServices />;
|
<EmptyServices />
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Row>
|
<Row>
|
||||||
@ -74,7 +74,7 @@ ServicesView.propTypes = {
|
|||||||
match: React.PropTypes.object.isRequired,
|
match: React.PropTypes.object.isRequired,
|
||||||
org: PropTypes.org,
|
org: PropTypes.org,
|
||||||
project: PropTypes.project,
|
project: PropTypes.project,
|
||||||
routerPush: React.PropTypes.func.isRequired,
|
router: React.PropTypes.object,
|
||||||
services: React.PropTypes.arrayOf(PropTypes.service)
|
services: React.PropTypes.arrayOf(PropTypes.service)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -11,7 +11,6 @@ import {
|
|||||||
} from '@state/selectors';
|
} from '@state/selectors';
|
||||||
|
|
||||||
const Services = (props) => {
|
const Services = (props) => {
|
||||||
|
|
||||||
const {
|
const {
|
||||||
services = []
|
services = []
|
||||||
} = props;
|
} = props;
|
||||||
@ -35,7 +34,6 @@ const mapStateToProps = (state, {
|
|||||||
}) => ({
|
}) => ({
|
||||||
org: orgByIdSelector(match.params.org)(state),
|
org: orgByIdSelector(match.params.org)(state),
|
||||||
project: projectByIdSelector(match.params.projectId)(state),
|
project: projectByIdSelector(match.params.projectId)(state),
|
||||||
routerPush: push,
|
|
||||||
services: servicesForTopologySelector(match.params.projectId)(state)
|
services: servicesForTopologySelector(match.params.projectId)(state)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -47,7 +47,6 @@ const mapStateToProps = (state, {
|
|||||||
}) => ({
|
}) => ({
|
||||||
org: orgByIdSelector(match.params.org)(state),
|
org: orgByIdSelector(match.params.org)(state),
|
||||||
project: projectByIdSelector(match.params.projectId)(state),
|
project: projectByIdSelector(match.params.projectId)(state),
|
||||||
routerPush: push,
|
|
||||||
services: servicesByProjectIdSelector(match.params.projectId)(state)
|
services: servicesByProjectIdSelector(match.params.projectId)(state)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user