1
0
mirror of https://github.com/yldio/copilot.git synced 2024-11-28 06:00:06 +02:00

fix(632) - UI Polishing for Service List Page

This commit is contained in:
Sara Vieira 2017-10-02 15:10:54 +01:00
parent 518ba27b96
commit 167cd1e9b8
8 changed files with 65 additions and 58 deletions

View File

@ -24,9 +24,7 @@ import {
Anchor Anchor
} from 'joyent-ui-toolkit'; } from 'joyent-ui-toolkit';
const StyledCardHeader = styled(CardHeader)` const StyledCardHeader = styled(CardHeader)`position: relative;`;
position: relative;
`;
const TitleInnerContainer = styled.div` const TitleInnerContainer = styled.div`
display: flex; display: flex;
@ -82,15 +80,18 @@ const GraphTitle = Small.extend`
color: #494949; color: #494949;
`; `;
const HealthyIconStyled = styled(HealthyIcon)`
/* I SAID NO PRETTIER */
display: flex;
`;
const ChildTitle = styled(CardTitle)` const ChildTitle = styled(CardTitle)`
padding: 0; padding: 0;
flex: 0 1 auto; flex: 0 1 auto;
align-self: stretch; align-self: stretch;
`; `;
const ServiceView = styled(CardView)` const ServiceView = styled(CardView)`height: ${remcalc(120)};`;
height: ${remcalc(120)};
`;
const StatusContainer = styled(CardDescription)` const StatusContainer = styled(CardDescription)`
display: flex; display: flex;
@ -170,7 +171,7 @@ const ServiceListItem = ({
if (service.instancesActive) { if (service.instancesActive) {
const { total, healthy } = service.instancesHealthy; const { total, healthy } = service.instancesHealthy;
const iconHealthy = total === healthy ? 'HEALTHY' : 'NOT HEALTHY'; const iconHealthy = total === healthy ? 'HEALTHY' : 'NOT HEALTHY';
const icon = <HealthyIcon healthy={iconHealthy} />; const icon = <HealthyIconStyled healthy={iconHealthy} />;
const label = `${healthy} of ${total} healthy`; const label = `${healthy} of ${total} healthy`;
healthyInfo = ( healthyInfo = (
@ -229,4 +230,4 @@ ServiceListItem.propTypes = {
service: PropTypes.object.isRequired // Define better service: PropTypes.object.isRequired // Define better
}; };
export default ServiceListItem; export default ServiceListItem;

View File

@ -1,4 +1,5 @@
import React from 'react'; import React from 'react';
import styled from 'styled-components';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { compose } from 'react-apollo'; import { compose } from 'react-apollo';
import { Col, Row } from 'react-styled-flexboxgrid'; import { Col, Row } from 'react-styled-flexboxgrid';
@ -12,14 +13,16 @@ import { FormGroup, Toggle, ToggleList, Legend } from 'joyent-ui-toolkit';
const StyledLegend = Legend.extend` const StyledLegend = Legend.extend`
float: left; float: left;
padding-top: ${unitcalc(2)}; margin-bottom: ${unitcalc(1.5)};
margin-right: ${unitcalc(1.5)};
`; `;
const PaddedRow = Row.extend` const PaddedRow = Row.extend`margin-bottom: ${remcalc(18)};`;
margin-bottom: ${remcalc(18)}
`;
const ToggleStyled = styled(Toggle)`
& + label {
padding: ${remcalc(16)};
}
`;
export const ServicesMenu = ({ location: { pathname }, history: { push } }) => { export const ServicesMenu = ({ location: { pathname }, history: { push } }) => {
const toggleValue = pathname.split('-').pop(); const toggleValue = pathname.split('-').pop();
@ -38,15 +41,15 @@ export const ServicesMenu = ({ location: { pathname }, history: { push } }) => {
<Title>Services</Title> <Title>Services</Title>
<PaddedRow> <PaddedRow>
<Col xs={5}> <Col xs={5}>
<StyledLegend>Show</StyledLegend>
<FormGroup name="service-view" value={toggleValue}> <FormGroup name="service-view" value={toggleValue}>
<StyledLegend>View</StyledLegend>
<ToggleList> <ToggleList>
<Toggle value="list" onChange={handleToggle}> <ToggleStyled value="list" onChange={handleToggle}>
List List
</Toggle> </ToggleStyled>
<Toggle value="topology" onChange={handleToggle}> <ToggleStyled value="topology" onChange={handleToggle}>
Topology Topology
</Toggle> </ToggleStyled>
</ToggleList> </ToggleList>
</FormGroup> </FormGroup>
</Col> </Col>

View File

@ -505,7 +505,7 @@ exports[`renders <TestEnvironmentForm /> without throwing 1`] = `
> >
<input <input
className="c13 c14" className="c13 c14"
id="chZMTz" id="bVVQYi"
placeholder="Filename including extension…" placeholder="Filename including extension…"
type="text" type="text"
value={undefined} value={undefined}

View File

@ -192,7 +192,7 @@ exports[`renders <Files /> without throwing 1`] = `
> >
<input <input
className="c4 c5" className="c4 c5"
id="ugaHI" id="SlzVp"
placeholder="Filename including extension…" placeholder="Filename including extension…"
type="text" type="text"
value={undefined} value={undefined}

View File

@ -339,7 +339,7 @@ exports[`renders <Name /> without throwing 1`] = `
> >
<label <label
className="c4" className="c4"
htmlFor="cDwPbP" htmlFor="bRpkHS"
> >
Name the new deployment group Name the new deployment group
</label> </label>
@ -351,7 +351,7 @@ exports[`renders <Name /> without throwing 1`] = `
</label> </label>
<input <input
className="c6" className="c6"
id="cDwPbP" id="bRpkHS"
name="name" name="name"
onBlur={[Function]} onBlur={[Function]}
onChange={[Function]} onChange={[Function]}
@ -725,7 +725,7 @@ exports[`renders <Name /> without throwing 2`] = `
> >
<label <label
className="c4" className="c4"
htmlFor="hPlHB" htmlFor="cfPoqo"
> >
Name the new deployment group Name the new deployment group
</label> </label>
@ -737,7 +737,7 @@ exports[`renders <Name /> without throwing 2`] = `
</label> </label>
<input <input
className="c6" className="c6"
id="hPlHB" id="cfPoqo"
name="name" name="name"
onBlur={[Function]} onBlur={[Function]}
onChange={[Function]} onChange={[Function]}

View File

@ -358,7 +358,7 @@ exports[`renders <Scale /> without throwing 1`] = `
> >
<input <input
className="c7 c8" className="c7 c8"
id="cDfjvW" id="bZKUCn"
name="replicas" name="replicas"
onBlur={[Function]} onBlur={[Function]}
onChange={[Function]} onChange={[Function]}

View File

@ -516,7 +516,7 @@ exports[`renders <ServiceScale /> without throwing 1`] = `
> >
<input <input
className="c12 c13" className="c12 c13"
id="cDbIHU" id="bIxZkW"
name="replicas" name="replicas"
onBlur={[Function]} onBlur={[Function]}
onChange={[Function]} onChange={[Function]}

View File

@ -16,7 +16,7 @@ exports[`renders <ServicesMenu /> without throwing 1`] = `
padding-top: 1.1875rem; padding-top: 1.1875rem;
} }
.c4 { .c5 {
padding: 0.35em 0.75em 0.625em; padding: 0.35em 0.75em 0.625em;
display: inline-block; display: inline-block;
margin: 0; margin: 0;
@ -33,7 +33,7 @@ exports[`renders <ServicesMenu /> without throwing 1`] = `
-webkit-padding-after: 0; -webkit-padding-after: 0;
} }
.c9 { .c10 {
font-family: sans-serif; font-family: sans-serif;
font-size: 100%; font-size: 100%;
line-height: 1.15; line-height: 1.15;
@ -42,49 +42,49 @@ exports[`renders <ServicesMenu /> without throwing 1`] = `
display: none; display: none;
} }
.c9[type='checkbox'], .c10[type='checkbox'],
.c9[type='radio'] { .c10[type='radio'] {
box-sizing: border-box; box-sizing: border-box;
padding: 0; padding: 0;
} }
.c9[type='number']::-webkit-inner-spin-button, .c10[type='number']::-webkit-inner-spin-button,
.c9[type='number']::-webkit-outer-spin-button { .c10[type='number']::-webkit-outer-spin-button {
height: auto; height: auto;
} }
.c9[type='search'] { .c10[type='search'] {
-webkit-appearance: textfield; -webkit-appearance: textfield;
-moz-appearance: textfield; -moz-appearance: textfield;
appearance: textfield; appearance: textfield;
outline-offset: -0.125rem; outline-offset: -0.125rem;
} }
.c9[type='search']::-webkit-search-cancel-button, .c10[type='search']::-webkit-search-cancel-button,
.c9[type='search']::-webkit-search-decoration { .c10[type='search']::-webkit-search-decoration {
-webkit-appearance: none; -webkit-appearance: none;
-moz-appearance: none; -moz-appearance: none;
appearance: none; appearance: none;
} }
.c9::-webkit-file-upload-button { .c10::-webkit-file-upload-button {
-webkit-appearance: button; -webkit-appearance: button;
-moz-appearance: button; -moz-appearance: button;
appearance: button; appearance: button;
font: inherit; font: inherit;
} }
.c9:checked + label { .c10:checked + label {
border-radius: 0.25rem; border-radius: 0.25rem;
box-shadow: 0 0.125rem 0 0 rgba(0,0,0,0.05); box-shadow: 0 0.125rem 0 0 rgba(0,0,0,0.05);
} }
.c9:selected + label { .c10:selected + label {
border-radius: 0.25rem; border-radius: 0.25rem;
box-shadow: 0 0.125rem 0 0 rgba(0,0,0,0.05); box-shadow: 0 0.125rem 0 0 rgba(0,0,0,0.05);
} }
.c10 { .c11 {
font-family: "Libre Franklin",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica,sans-serif; font-family: "Libre Franklin",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica,sans-serif;
font-weight: 400; font-weight: 400;
position: absolute; position: absolute;
@ -142,7 +142,7 @@ exports[`renders <ServicesMenu /> without throwing 1`] = `
align-self: stretch; align-self: stretch;
} }
.c5 { .c4 {
box-sizing: border-box; box-sizing: border-box;
color: inherit; color: inherit;
display: table; display: table;
@ -152,8 +152,7 @@ exports[`renders <ServicesMenu /> without throwing 1`] = `
font-family: "Libre Franklin",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica,sans-serif; font-family: "Libre Franklin",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica,sans-serif;
font-weight: 600; font-weight: 600;
float: left; float: left;
padding-top: 0.75rem; margin-bottom: 0.5625rem;
margin-right: 0.5625rem;
} }
.c2 { .c2 {
@ -176,6 +175,10 @@ exports[`renders <ServicesMenu /> without throwing 1`] = `
margin-bottom: 1.125rem; margin-bottom: 1.125rem;
} }
.c9 + label {
padding: 1rem;
}
@media only screen and (min-width:0em) { @media only screen and (min-width:0em) {
.c3 { .c3 {
-webkit-flex-basis: 41.66666666666667%; -webkit-flex-basis: 41.66666666666667%;
@ -218,38 +221,38 @@ exports[`renders <ServicesMenu /> without throwing 1`] = `
<div <div
className="c3" className="c3"
> >
<fieldset <legend
className="c4" className="c4"
>
Show
</legend>
<fieldset
className="c5"
style={undefined} style={undefined}
> >
<div> <div>
<legend
className="c5"
>
View
</legend>
<ul <ul
className="c6" className="c6"
> >
<li <li
className="c7" className="c7"
id="bQvEpy" id="bqlWiO"
> >
<div <div
className="c8" className="c8"
> >
<input <input
checked={false} checked={false}
className="c9" className="c9 c10"
id="RSkeG" id="bYNDQU"
name="service-view" name="service-view"
onChange={[Function]} onChange={[Function]}
type="radio" type="radio"
value="list" value="list"
/> />
<label <label
className="c10" className="c11"
htmlFor="RSkeG" htmlFor="bYNDQU"
> >
List List
</label> </label>
@ -257,23 +260,23 @@ exports[`renders <ServicesMenu /> without throwing 1`] = `
</li> </li>
<li <li
className="c7" className="c7"
id="bQvEpy" id="bqlWiO"
> >
<div <div
className="c8" className="c8"
> >
<input <input
checked={false} checked={false}
className="c9" className="c9 c10"
id="mtxuf" id="cpsYND"
name="service-view" name="service-view"
onChange={[Function]} onChange={[Function]}
type="radio" type="radio"
value="topology" value="topology"
/> />
<label <label
className="c10" className="c11"
htmlFor="mtxuf" htmlFor="cpsYND"
> >
Topology Topology
</label> </label>