add checkbox to service item

fixes #283
This commit is contained in:
Sérgio Ramos 2017-03-01 15:48:33 +00:00 committed by Judit Greskovits
parent 0f42f8021b
commit a8c4ca642c

View File

@ -1,9 +1,10 @@
import React from 'react'; import styled from 'styled-components';
import forceArray from 'force-array';
import { Link } from '@ui/components/anchor'; import { Link } from '@ui/components/anchor';
import MetricsOutlet from '@components/metrics-outlet'; import MetricsOutlet from '@components/metrics-outlet';
import { Checkbox, FormGroup } from '@ui/components/form';
import PropTypes from '@root/prop-types'; import PropTypes from '@root/prop-types';
import forceArray from 'force-array';
import React from 'react';
import { import {
ListItem, ListItem,
@ -17,6 +18,17 @@ import {
ListItemHeader ListItemHeader
} from '@ui/components/list'; } from '@ui/components/list';
const StyledFormGroup = styled(FormGroup)`
width: auto;
`;
const TitleInnerContainer = styled.div`
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
`;
const ServiceItem = ({ const ServiceItem = ({
org = '', org = '',
project = '', project = '',
@ -36,12 +48,19 @@ const ServiceItem = ({
const to = `/${org}/projects/${project}/services/${service.id}`; const to = `/${org}/projects/${project}/services/${service.id}`;
const title = isChild ? ( const title = isChild ? (
<ListItemTitle>{service.name}</ListItemTitle> <ListItemTitle>
{service.name}
</ListItemTitle>
) : ( ) : (
<ListItemTitle> <ListItemTitle>
<Link secondary to={to}> <TitleInnerContainer>
{service.name} <StyledFormGroup>
</Link> <Checkbox />
</StyledFormGroup>
<Link secondary to={to}>
{service.name}
</Link>
</TitleInnerContainer>
</ListItemTitle> </ListItemTitle>
); );