adding in eslint for trailing commas

This commit is contained in:
Alex Windett 2017-02-20 14:51:54 +00:00 committed by Sérgio Ramos
parent 27b8b2d7f8
commit 33e899b923
64 changed files with 305 additions and 134 deletions

View File

@ -118,6 +118,7 @@
"max-len": [2, 80], "max-len": [2, 80],
"no-eq-null": 2, "no-eq-null": 2,
"block-scoped-var": 2, "block-scoped-var": 2,
"no-console": 0 "no-console": 0,
"comma-dangle": ["error", "never"]
} }
} }

View File

@ -16,11 +16,11 @@ const {
} = fns; } = fns;
const { const {
colors, colors
} = constants; } = constants;
const { const {
H2, H2
} = BaseElements; } = BaseElements;
const { const {

View File

@ -14,13 +14,13 @@ const {
} = Styled; } = Styled;
const { const {
remcalc, remcalc
} = fns; } = fns;
const { const {
P, P,
H2, H2,
H3, H3
} = BaseElements; } = BaseElements;
const { const {

View File

@ -29,7 +29,7 @@ const {
} = composers; } = composers;
const { const {
colors, colors
} = constants; } = constants;
const borderSide = props => props.toggled const borderSide = props => props.toggled
@ -61,7 +61,7 @@ const StyledAvatarWrapper = styled.div`
${pseudoEl({ ${pseudoEl({
top: '50%', top: '50%',
right: remcalc(-10), right: remcalc(-10)
})} })}
} }
`; `;

View File

@ -59,7 +59,7 @@ const AddMetrics = ({
AddMetrics.propTypes = { AddMetrics.propTypes = {
datasets: React.PropTypes.arrayOf(PropTypes.dataset), datasets: React.PropTypes.arrayOf(PropTypes.dataset),
metricTypes: React.PropTypes.arrayOf(PropTypes.metric), metricTypes: React.PropTypes.arrayOf(PropTypes.metric),
onAddMetric: React.PropTypes.func.isRequired, onAddMetric: React.PropTypes.func.isRequired
}; };
module.exports = AddMetrics; module.exports = AddMetrics;

View File

@ -100,7 +100,7 @@ const OrgNavigation = ({
const navLinks = orgs.map(({ const navLinks = orgs.map(({
id, id,
name, name,
image, image
}) => { }) => {
const to = `/${id}`; const to = `/${id}`;

View File

@ -14,7 +14,7 @@ const {
} = ReactIntl; } = ReactIntl;
const { const {
H2, H2
} = BaseElements; } = BaseElements;
const { const {
@ -70,7 +70,7 @@ const NewProjectBilling = (props) => {
}], }],
handleSubmit, handleSubmit,
onSubmit, onSubmit,
onNewBilling, onNewBilling
} = props; } = props;
const _onNewBilling = (evt) => { const _onNewBilling = (evt) => {

View File

@ -54,7 +54,7 @@ const People = (props) => {
People.propTypes = { People.propTypes = {
UI: React.PropTypes.object, UI: React.PropTypes.object,
handleToggle: React.PropTypes.func, handleToggle: React.PropTypes.func,
people: React.PropTypes.array, people: React.PropTypes.array
}; };
module.exports = People; module.exports = People;

View File

@ -76,9 +76,9 @@ const Invite = React.createClass({
name: this.state.selectValue.label, name: this.state.selectValue.label,
email: this.state.selectValue.value, email: this.state.selectValue.value,
role: 'Unassigned', role: 'Unassigned',
status: 'Sent invitation', status: 'Sent invitation'
}, },
parentIndex: this.props.parentIndex, parentIndex: this.props.parentIndex
}; };
this.props.addMemember(data, () => { this.props.addMemember(data, () => {
@ -91,7 +91,7 @@ const Invite = React.createClass({
render() { render() {
const { const {
handleToggle, handleToggle
} = this.props; } = this.props;
const selectData = this.getFormattedPlatformMembers(); const selectData = this.getFormattedPlatformMembers();
@ -145,7 +145,7 @@ const Invite = React.createClass({
</Column> </Column>
</Row> </Row>
); );
}, }
}); });
module.exports = Invite; module.exports = Invite;

View File

@ -31,7 +31,7 @@ const PeopleTable = (props) => {
people = [], people = [],
parentIndex, parentIndex,
removeMember, removeMember,
UI = {}, UI = {}
} = props; } = props;
const columns = [{ const columns = [{
@ -122,7 +122,7 @@ PeopleTable.propTypes = {
handleStatusTooltip: React.PropTypes.func, handleStatusTooltip: React.PropTypes.func,
parentIndex: React.PropTypes.number, parentIndex: React.PropTypes.number,
people: React.PropTypes.array, people: React.PropTypes.array,
removeMember: React.PropTypes.func, removeMember: React.PropTypes.func
}; };
module.exports = PeopleTable; module.exports = PeopleTable;

View File

@ -37,7 +37,7 @@ const PersonDelete = (props) => {
PersonDelete.propTypes = { PersonDelete.propTypes = {
parentIndex: React.PropTypes.number, parentIndex: React.PropTypes.number,
personIndex: React.PropTypes.number, personIndex: React.PropTypes.number,
removeMember: React.PropTypes.func, removeMember: React.PropTypes.func
}; };
module.exports = PersonDelete; module.exports = PersonDelete;

View File

@ -101,7 +101,7 @@ PersonRole.propTypes = {
personIndex: React.PropTypes.number, personIndex: React.PropTypes.number,
toggledID: React.PropTypes.oneOfType([ toggledID: React.PropTypes.oneOfType([
React.PropTypes.string, React.PropTypes.string,
React.PropTypes.bool, React.PropTypes.bool
]) ])
}; };

View File

@ -101,7 +101,7 @@ PersonStatus.propTypes = {
personIndex: React.PropTypes.number, personIndex: React.PropTypes.number,
toggledID: React.PropTypes.oneOfType([ toggledID: React.PropTypes.oneOfType([
React.PropTypes.string, React.PropTypes.string,
React.PropTypes.bool, React.PropTypes.bool
]) ])
}; };

View File

@ -25,7 +25,7 @@ module.exports = ({
personAttr, personAttr,
personIndex, personIndex,
options = [], options = [],
parentIndex, parentIndex
}) => { }) => {
const _options = options.map( (option, i) => { const _options = options.map( (option, i) => {
@ -38,7 +38,7 @@ module.exports = ({
[`${personAttr}`]: option [`${personAttr}`]: option
}, },
personIndex, personIndex,
parentIndex, parentIndex
}; };
const _onClick = () => handleSelect(payload); const _onClick = () => handleSelect(payload);
@ -71,5 +71,5 @@ module.exports.propTypes = {
parentIndex: React.PropTypes.number, parentIndex: React.PropTypes.number,
person: React.PropTypes.object, person: React.PropTypes.object,
personAttr: React.PropTypes.string, personAttr: React.PropTypes.string,
personIndex: React.PropTypes.number, personIndex: React.PropTypes.number
}; };

View File

@ -19,11 +19,11 @@ const {
} = ReactIntl; } = ReactIntl;
const { const {
breakpoints, breakpoints
} = constants; } = constants;
const { const {
remcalc, remcalc
} = fns; } = fns;
const StyledHorizontalList = styled(Ul)` const StyledHorizontalList = styled(Ul)`
@ -43,7 +43,7 @@ const StyledHorizontalListItem = styled(Li)`
const Section = (props) => { const Section = (props) => {
const { const {
children, children,
links = [], links = []
} = props; } = props;
const navLinks = links.map((link) => ( const navLinks = links.map((link) => (

View File

@ -6,11 +6,11 @@ const fns = require('@ui/shared/functions');
const Styled = require('styled-components'); const Styled = require('styled-components');
const { const {
remcalc, remcalc
} = fns; } = fns;
const { const {
default: styled, default: styled
} = Styled; } = Styled;
const StyledWrapper = styled.div` const StyledWrapper = styled.div`

View File

@ -67,7 +67,7 @@ Metrics.propTypes = {
const mapStateToProps = (state) => ({ const mapStateToProps = (state) => ({
// hardcoded now, but should be dynamic // hardcoded now, but should be dynamic
// actually, the use for this prop is going to disapear // actually, the use for this prop is going to disapear
metricTypeUuid: 'dca08514-72e5-46ce-ad91-e68b3b0914d4', metricTypeUuid: 'dca08514-72e5-46ce-ad91-e68b3b0914d4'
}); });
const mapDispatchToProps = (dispatch) => ({ const mapDispatchToProps = (dispatch) => ({

View File

@ -13,7 +13,7 @@ const NewProject = require('@containers/new-project');
const SectionComponents = { const SectionComponents = {
people: require('./people'), people: require('./people'),
projects: require('./projects'), projects: require('./projects'),
settings: require('./settings'), settings: require('./settings')
}; };
const { const {

View File

@ -13,7 +13,7 @@ const {
peopleByOrgIdSelector, peopleByOrgIdSelector,
orgUISelector, orgUISelector,
orgIndexSelector, orgIndexSelector,
membersSelector, membersSelector
} = selectors; } = selectors;
const { const {
@ -22,7 +22,7 @@ const {
orgHandlePeopleRoleTooltip, orgHandlePeopleRoleTooltip,
orgHandlePeopleStatusTooltip, orgHandlePeopleStatusTooltip,
orgHandleMemberUpdate, orgHandleMemberUpdate,
orgRemoveMember, orgRemoveMember
} = actions; } = actions;
const People = (props) => { const People = (props) => {
@ -58,6 +58,7 @@ const mapDispatchToProps = (dispatch) => ({
dispatch(orgHandleMemberUpdate(updatedMember)), dispatch(orgHandleMemberUpdate(updatedMember)),
removeMember: (removeData) => removeMember: (removeData) =>
dispatch(orgRemoveMember(removeData)) dispatch(orgRemoveMember(removeData))
}); });
module.exports = connect( module.exports = connect(

View File

@ -13,7 +13,7 @@ const {
peopleByProjectIdSelector, peopleByProjectIdSelector,
projectUISelector, projectUISelector,
projectIndexByIdSelect, projectIndexByIdSelect,
membersSelector, membersSelector
} = selectors; } = selectors;
const { const {
@ -22,7 +22,7 @@ const {
projectHandlePeopleRoleTooltip, projectHandlePeopleRoleTooltip,
projectHandlePeopleStatusTooltip, projectHandlePeopleStatusTooltip,
projectHandleMemberUpdate, projectHandleMemberUpdate,
projectRemoveMember, projectRemoveMember
} = actions; } = actions;
const People = (props) => ( const People = (props) => (
@ -53,6 +53,7 @@ const mapDispatchToProps = (dispatch) => ({
dispatch(projectHandleMemberUpdate(updatedMember)), dispatch(projectHandleMemberUpdate(updatedMember)),
removeMember: (removeData) => removeMember: (removeData) =>
dispatch(projectRemoveMember(removeData)) dispatch(projectRemoveMember(removeData))
}); });
module.exports = connect( module.exports = connect(

View File

@ -22,7 +22,7 @@ const {
} = selectors; } = selectors;
const { const {
H2, H2
} = BaseELements; } = BaseELements;
const Services = ({ const Services = ({

View File

@ -19,7 +19,7 @@ const projectMemberActions = {
projectHandleMemberUpdate: projectHandleMemberUpdate:
createAction(`${APP}/PROJECT_HANDLE_MEMBER_UPDATE`), createAction(`${APP}/PROJECT_HANDLE_MEMBER_UPDATE`),
projectRemoveMember: projectRemoveMember:
createAction(`${APP}/PROJECT_REMOVE_MEMBER_FROM_ROLE`), createAction(`${APP}/PROJECT_REMOVE_MEMBER_FROM_ROLE`)
}; };
const orgMemberActions = { const orgMemberActions = {
@ -34,7 +34,7 @@ const orgMemberActions = {
orgHandleMemberUpdate: orgHandleMemberUpdate:
createAction(`${APP}/ORG_HANDLE_MEMBER_UPDATE`), createAction(`${APP}/ORG_HANDLE_MEMBER_UPDATE`),
orgRemoveMember: orgRemoveMember:
createAction(`${APP}/ORG_REMOVE_MEMBER_FROM_ROLE`), createAction(`${APP}/ORG_REMOVE_MEMBER_FROM_ROLE`)
}; };
module.exports = { module.exports = {
@ -58,5 +58,5 @@ module.exports = {
handleNewProject: handleNewProject:
createAction(`${APP}/CREATE_NEW_PROJECT`), createAction(`${APP}/CREATE_NEW_PROJECT`),
...orgMemberActions, ...orgMemberActions,
...projectMemberActions, ...projectMemberActions
}; };

View File

@ -17,6 +17,6 @@ module.exports = () => {
orgs: require('@state/reducers/orgs'), orgs: require('@state/reducers/orgs'),
projects: require('@state/reducers/projects'), projects: require('@state/reducers/projects'),
services: require('@state/reducers/services'), services: require('@state/reducers/services'),
members: require('@state/reducers/members'), members: require('@state/reducers/members')
}); });
}; };

View File

@ -12,7 +12,7 @@ const {
orgHandlePeopleRoleTooltip, orgHandlePeopleRoleTooltip,
orgHandlePeopleStatusTooltip, orgHandlePeopleStatusTooltip,
orgHandleMemberUpdate, orgHandleMemberUpdate,
orgRemoveMember, orgRemoveMember
} = actions; } = actions;
module.exports = handleActions({ module.exports = handleActions({
@ -20,7 +20,7 @@ module.exports = handleActions({
const { const {
parentIndex, parentIndex,
member, member
} = action.payload; } = action.payload;
return { return {
@ -34,7 +34,7 @@ module.exports = handleActions({
member member
] ]
}, },
...state.data.slice(parentIndex + 1), ...state.data.slice(parentIndex + 1)
] ]
}; };
}, },
@ -75,7 +75,7 @@ module.exports = handleActions({
const { const {
parentIndex, parentIndex,
person, person,
personIndex, personIndex
} = action.payload; } = action.payload;
return { return {
...state, ...state,
@ -91,19 +91,19 @@ module.exports = handleActions({
members: [ members: [
...state.data[parentIndex].members.slice(0, personIndex), ...state.data[parentIndex].members.slice(0, personIndex),
{ {
...person, ...person
}, },
...state.data[parentIndex].members.slice(personIndex + 1) ...state.data[parentIndex].members.slice(personIndex + 1)
] ]
}, },
...state.data.slice(parentIndex + 1), ...state.data.slice(parentIndex + 1)
] ]
}; };
}, },
[orgRemoveMember.toString()]: (state, action) => { [orgRemoveMember.toString()]: (state, action) => {
const { const {
parentIndex, parentIndex,
personIndex, personIndex
} = action.payload; } = action.payload;
return { return {
@ -117,8 +117,8 @@ module.exports = handleActions({
...state.data[parentIndex].members.slice(personIndex + 1) ...state.data[parentIndex].members.slice(personIndex + 1)
] ]
}, },
...state.data.slice(parentIndex + 1), ...state.data.slice(parentIndex + 1)
] ]
}; };
}, }
}, {}); }, {});

View File

@ -26,7 +26,7 @@ module.exports = handleActions({
const { const {
parentIndex, parentIndex,
member, member
} = action.payload; } = action.payload;
return { return {
@ -40,7 +40,7 @@ module.exports = handleActions({
member member
] ]
}, },
...state.data.slice(parentIndex + 1), ...state.data.slice(parentIndex + 1)
] ]
}; };
}, },
@ -81,7 +81,7 @@ module.exports = handleActions({
const { const {
parentIndex, parentIndex,
person, person,
personIndex, personIndex
} = action.payload; } = action.payload;
return { return {
...state, ...state,
@ -97,19 +97,19 @@ module.exports = handleActions({
members: [ members: [
...state.data[parentIndex].members.slice(0, personIndex), ...state.data[parentIndex].members.slice(0, personIndex),
{ {
...person, ...person
}, },
...state.data[parentIndex].members.slice(personIndex + 1) ...state.data[parentIndex].members.slice(personIndex + 1)
] ]
}, },
...state.data.slice(parentIndex + 1), ...state.data.slice(parentIndex + 1)
] ]
}; };
}, },
[projectRemoveMember.toString()]: (state, action) => { [projectRemoveMember.toString()]: (state, action) => {
const { const {
parentIndex, parentIndex,
personIndex, personIndex
} = action.payload; } = action.payload;
return { return {
@ -123,7 +123,7 @@ module.exports = handleActions({
...state.data[parentIndex].members.slice(personIndex + 1) ...state.data[parentIndex].members.slice(personIndex + 1)
] ]
}, },
...state.data.slice(parentIndex + 1), ...state.data.slice(parentIndex + 1)
] ]
}; };
}, },

View File

@ -188,5 +188,5 @@ module.exports = {
membersSelector: members, membersSelector: members,
peopleByProjectIdSelector: peopleByProjectId, peopleByProjectIdSelector: peopleByProjectId,
projectUISelector: projectsUI, projectUISelector: projectsUI,
projectIndexByIdSelect: projectIndexById, projectIndexByIdSelect: projectIndexById
}; };

View File

@ -91,7 +91,7 @@ module.exports = {
test: /\.svg/, test: /\.svg/,
exclude: [ exclude: [
/node_modules/, /node_modules/,
path.join(UI, 'shared', 'fonts'), path.join(UI, 'shared', 'fonts')
], ],
include: [ include: [
FRONTEND, FRONTEND,
@ -109,7 +109,7 @@ module.exports = {
// exclude: /node_modules/, // exclude: /node_modules/,
include: [ include: [
path.join(UI, 'shared', 'fonts') path.join(UI, 'shared', 'fonts')
], ]
}, { }, {
test: /\.css$/, test: /\.css$/,
loader: 'style-loader!css-loader' loader: 'style-loader!css-loader'

View File

@ -6,7 +6,7 @@ module.exports = {
resolve: base.resolve, resolve: base.resolve,
resolveLoader: base.resolveLoader, resolveLoader: base.resolveLoader,
output: Object.assign(base.output, { output: Object.assign(base.output, {
libraryTarget: 'commonjs2', libraryTarget: 'commonjs2'
}), }),
plugins: [ plugins: [
plugins['named-modules'](), plugins['named-modules'](),

View File

@ -121,6 +121,7 @@
"tabWidth": 2 "tabWidth": 2
}], }],
"no-eq-null": 2, "no-eq-null": 2,
"block-scoped-var": 2 "block-scoped-var": 2,
"comma-dangle": ["error", "never"]
} }
} }

View File

@ -4,7 +4,7 @@
const React = require('react'); const React = require('react');
const { const {
Base, Base
} = require('@ui'); } = require('@ui');
module.exports = () => { module.exports = () => {

View File

@ -58,7 +58,7 @@ AddMetricButton.propTypes = {
children: React.PropTypes.node, children: React.PropTypes.node,
disabled: React.PropTypes.bool, disabled: React.PropTypes.bool,
metric: React.PropTypes.string, metric: React.PropTypes.string,
onClick: React.PropTypes.func, onClick: React.PropTypes.func
}; };
module.exports = Baseline( module.exports = Baseline(

View File

@ -3,5 +3,5 @@ module.exports = {
AddMetricDescription: require('./description'), AddMetricDescription: require('./description'),
AddMetricLink: require('./link'), AddMetricLink: require('./link'),
AddMetricTile: require('./tile'), AddMetricTile: require('./tile'),
AddMetricTitle: require('./title'), AddMetricTitle: require('./title')
}; };

View File

@ -55,13 +55,13 @@ const Avatar = ({
src, src,
srcset, srcset,
style, style,
width = remcalc(42), width = remcalc(42)
}) => { }) => {
const _style = { const _style = {
...style, ...style,
background: color, background: color,
width, width,
height, height
}; };
const letter = name[0]; const letter = name[0];
@ -99,7 +99,7 @@ Avatar.propTypes = {
src: React.PropTypes.string, src: React.PropTypes.string,
srcset: React.PropTypes.string, srcset: React.PropTypes.string,
style: React.PropTypes.object, style: React.PropTypes.object,
width: React.PropTypes.string, width: React.PropTypes.string
}; };
module.exports = Baseline( module.exports = Baseline(

View File

@ -89,7 +89,7 @@ const BaseElements = elements.reduce((acc, {
// TODO: Fix proptype validation and remove eslint ignore line 1 // TODO: Fix proptype validation and remove eslint ignore line 1
Component.propTypes = { Component.propTypes = {
children: React.PropTypes.node, children: React.PropTypes.node,
style: React.PropTypes.object, style: React.PropTypes.object
}; };
return { return {

View File

@ -20,7 +20,7 @@ const {
H2, H2,
H3, H3,
P, P,
Small, Small
} = BaseElements; } = BaseElements;
storiesOf('Base Elements', module) storiesOf('Base Elements', module)

View File

@ -27,7 +27,7 @@ const fonts = [
filename: 'librefranklin-bold-webfont', filename: 'librefranklin-bold-webfont',
weight: '700', weight: '700',
style: 'normal' style: 'normal'
}, }
]; ];
module.exports = css` module.exports = css`

View File

@ -8,7 +8,7 @@ const {
} = constants; } = constants;
const { const {
default: styled, default: styled
} = Styled; } = Styled;
module.exports = styled.div` module.exports = styled.div`

View File

@ -9,7 +9,7 @@ const ReactRouter = require('react-router-dom');
const { const {
base, base,
inactive, inactive
} = constants.colors; } = constants.colors;
const { const {

View File

@ -0,0 +1,127 @@
const composers = require('../../shared/composers');
const constants = require('../../shared/constants');
const fns = require('../../shared/functions');
const React = require('react');
const Styled = require('styled-components');
const {
boxes
} = constants;
const {
Baseline
} = composers;
const {
remcalc
} = fns;
const {
default: styled
} = Styled;
const StyledInput = styled.input`
visibility: hidden;
&:checked + label::after {
opacity: 1;
}
&:disabled + label {
background-color: rgb(249, 249, 249);
}
&:disabled + label::after {
opacity: 0.3;
}
`;
const StyledLabel = styled.label`
color: rgb(100, 100, 100);
position: absolute;
width: ${remcalc(24)};
height: ${remcalc(24)};
top: 0;
border-radius: ${boxes.borderRadius};
background-color: rgb(255, 255, 255);
box-shadow: ${boxes.insetShaddow};
border: ${boxes.border.unchecked};
&::after {
opacity: 0;
content: '';
position: absolute;
width: ${remcalc(9)};
height: ${remcalc(4)};
background: transparent;
top: ${remcalc(7)};
left: ${remcalc(7)};
border: ${remcalc(3)} solid #333;
border-top: none;
border-right: none;
transform: rotate(-45deg);
}
&:hover {
&::after {
opacity: 0.3;
}
}
`;
const StyledDiv = styled.div`
width: ${remcalc(24)};
height: ${remcalc(24)};
position: relative;
`;
const Checkbox = ({
checked = false,
children,
className,
disabled = false,
form,
id,
name,
onChange,
readOnly,
required,
selectionDirection,
style,
tabIndex
}) => (
<StyledDiv>
<StyledInput
checked={checked}
disabled={disabled}
form={form}
name={name}
onChange={onChange}
readOnly={readOnly}
required={required}
style={style}
tabIndex={tabIndex}
type='checkbox'
/>
<StyledLabel>
<span>{children}</span>
</StyledLabel>
</StyledDiv>
);
Checkbox.propTypes = {
checked: React.PropTypes.bool,
children: React.PropTypes.node,
className: React.PropTypes.string,
disabled: React.PropTypes.bool,
form: React.PropTypes.string,
id: React.PropTypes.string,
name: React.PropTypes.string,
onChange: React.PropTypes.func,
readOnly: React.PropTypes.bool,
required: React.PropTypes.bool,
selectionDirection: React.PropTypes.string,
style: React.PropTypes.object,
tabIndex: React.PropTypes.string
};
module.exports = Baseline(
Checkbox
);

View File

@ -0,0 +1,38 @@
const composers = require('../../shared/composers');
const constants = require('../../shared/constants');
const Label = require('./label');
const match = require('../../shared/match');
const Styled = require('styled-components');
const {
breakpoints,
colors
} = constants;
const {
Baseline
} = composers;
const {
default: styled
} = Styled;
const color = match.prop({
warning: colors.inputWarning,
error: colors.inputError
//disabled: colors.brandInactiveColor
})('type');
const Msg = styled(Label)`
color: ${color};
${breakpoints.medium`
float: right;
text-align: right;
`}
`;
module.exports = Baseline(
Msg
);

View File

@ -21,7 +21,7 @@ const {
} = fns; } = fns;
const { const {
default: styled, default: styled
} = Styled; } = Styled;
const Input = styled.input` const Input = styled.input`

View File

@ -1,3 +1,5 @@
/*eslint-disable */
module.exports = [{ module.exports = [{
firstQuartile: 15, firstQuartile: 15,
thirdQuartile: 15, thirdQuartile: 15,

View File

@ -57,7 +57,7 @@ const AddMetricButton = ({
}; };
AddMetricButton.propTypes = { AddMetricButton.propTypes = {
onClick: React.PropTypes.func, onClick: React.PropTypes.func
}; };
module.exports = Baseline( module.exports = Baseline(

View File

@ -70,7 +70,7 @@ class Graph extends React.Component {
displayFormats: { displayFormats: {
hour: 'MMM D, hA' hour: 'MMM D, hA'
} }
}, }
}], }],
yAxes: [{ yAxes: [{
display: true, display: true,
@ -88,7 +88,7 @@ class Graph extends React.Component {
legend: { legend: {
display: false display: false
} }
}, }
}); });
} }

View File

@ -1,3 +1,5 @@
/*eslint-disable */
module.exports = [{ module.exports = [{
firstQuartile: 15, firstQuartile: 15,
thirdQuartile: 15, thirdQuartile: 15,

View File

@ -74,7 +74,7 @@ const AddMetricButton = ({
AddMetricButton.propTypes = { AddMetricButton.propTypes = {
children: React.PropTypes.node, children: React.PropTypes.node,
metric: React.PropTypes.string, metric: React.PropTypes.string,
onClick: React.PropTypes.func, onClick: React.PropTypes.func
}; };
module.exports = Baseline( module.exports = Baseline(

View File

@ -48,7 +48,7 @@ const kbMetricData = MetricData.map(m => {
thirdQuartile: withinRange(m.thirdQuartile, 1.55, 2.0), thirdQuartile: withinRange(m.thirdQuartile, 1.55, 2.0),
median: withinRange(m.median, 1.55, 2.0), median: withinRange(m.median, 1.55, 2.0),
max: withinRange(m.max, 1.55, 2.0), max: withinRange(m.max, 1.55, 2.0),
min: withinRange(m.min, 1.55, 2.0), min: withinRange(m.min, 1.55, 2.0)
}; };
}); });

View File

@ -4,9 +4,7 @@ const Row = require('../row');
const Column = require('../column'); const Column = require('../column');
const { const {
storiesOf, storiesOf
// action,
// linkTo
} = require('@kadira/storybook'); } = require('@kadira/storybook');
const { const {

View File

@ -9,7 +9,7 @@ const Select = require('react-select');
require('react-select/dist/react-select.css'); require('react-select/dist/react-select.css');
const { const {
rndId, rndId
} = fns; } = fns;
const { const {

View File

@ -44,7 +44,7 @@ Table.propTypes = {
columns: React.PropTypes.array, columns: React.PropTypes.array,
data: React.PropTypes.array, data: React.PropTypes.array,
style: React.PropTypes.object, style: React.PropTypes.object,
title: React.PropTypes.string, title: React.PropTypes.string
}; };
module.exports = Baseline( module.exports = Baseline(

View File

@ -35,7 +35,7 @@ TableContent.propTypes = {
data: React.PropTypes.array, data: React.PropTypes.array,
hasBody: React.PropTypes.bool, hasBody: React.PropTypes.bool,
hasHeader: React.PropTypes.bool, hasHeader: React.PropTypes.bool,
width: React.PropTypes.string, width: React.PropTypes.string
}; };
module.exports = Baseline( module.exports = Baseline(

View File

@ -3,5 +3,5 @@ module.exports = {
TableHead: require('./table-head'), TableHead: require('./table-head'),
TableBody: require('./table-body'), TableBody: require('./table-body'),
TableRow: require('./table-row'), TableRow: require('./table-row'),
TableItem: require('./table-item'), TableItem: require('./table-item')
}; };

View File

@ -4,7 +4,7 @@ const React = require('react');
const Styled = require('styled-components'); const Styled = require('styled-components');
const { const {
default: styled, default: styled
} = Styled; } = Styled;
const { const {

View File

@ -149,7 +149,7 @@ class TopologyGraph extends React.Component {
const { const {
width, width,
height, height
} = props; } = props;
this.simulation = d3.forceSimulation() this.simulation = d3.forceSimulation()
@ -168,7 +168,7 @@ class TopologyGraph extends React.Component {
const component = this; const component = this;
const { const {
simulation, simulation
} = this; } = this;
const svg = d3.select(this._refs.svg); const svg = d3.select(this._refs.svg);
@ -178,7 +178,7 @@ class TopologyGraph extends React.Component {
graph = { graph = {
nodes: [], nodes: [],
links: [] links: []
}, }
} = this.props; } = this.props;
// Drawing the links between nodes // Drawing the links between nodes
@ -337,7 +337,7 @@ class TopologyGraph extends React.Component {
const { const {
dragged, dragged,
dragstarted, dragstarted,
dragended, dragended
} = this; } = this;
const width = 170; const width = 170;
@ -423,7 +423,7 @@ class TopologyGraph extends React.Component {
TopologyGraph.propTypes = { TopologyGraph.propTypes = {
graph: React.PropTypes.object, graph: React.PropTypes.object,
height: React.PropTypes.number, height: React.PropTypes.number,
width: React.PropTypes.number, width: React.PropTypes.number
}; };
module.exports = Baseline( module.exports = Baseline(

View File

@ -14,21 +14,21 @@ const services = {
attrs: { attrs: {
dcs: 1, dcs: 1,
instances: 2, instances: 2,
healthy: true, healthy: true
}, },
metrics: [ metrics: [
{ {
name: 'CPU', name: 'CPU',
stat: '50%', stat: '50%'
}, },
{ {
name: 'Memory', name: 'Memory',
stat: '20%', stat: '20%'
}, },
{ {
name: 'Network', name: 'Network',
stat: '5.9KB/sec', stat: '5.9KB/sec'
}, }
] ]
}, },
{ {
@ -36,21 +36,21 @@ const services = {
attrs: { attrs: {
dcs: 1, dcs: 1,
instances: 2, instances: 2,
healthy: true, healthy: true
}, },
metrics: [ metrics: [
{ {
name: 'CPU', name: 'CPU',
stat: '50%', stat: '50%'
}, },
{ {
name: 'Memory', name: 'Memory',
stat: '20%', stat: '20%'
}, },
{ {
name: 'Network', name: 'Network',
stat: '5.9KB/sec', stat: '5.9KB/sec'
}, }
] ]
}, },
{ {
@ -58,21 +58,21 @@ const services = {
attrs: { attrs: {
dcs: 1, dcs: 1,
instances: 2, instances: 2,
healthy: true, healthy: true
}, },
metrics: [ metrics: [
{ {
name: 'CPU', name: 'CPU',
stat: '50%', stat: '50%'
}, },
{ {
name: 'Memory', name: 'Memory',
stat: '20%', stat: '20%'
}, },
{ {
name: 'Network', name: 'Network',
stat: '5.9KB/sec', stat: '5.9KB/sec'
}, }
] ]
}, },
{ {
@ -80,21 +80,21 @@ const services = {
attrs: { attrs: {
dcs: 1, dcs: 1,
instances: 2, instances: 2,
healthy: true, healthy: true
}, },
metrics: [ metrics: [
{ {
name: 'CPU', name: 'CPU',
stat: '50%', stat: '50%'
}, },
{ {
name: 'Memory', name: 'Memory',
stat: '20%', stat: '20%'
}, },
{ {
name: 'Network', name: 'Network',
stat: '5.9KB/sec', stat: '5.9KB/sec'
}, }
] ]
}, },
{ {
@ -102,40 +102,40 @@ const services = {
attrs: { attrs: {
dcs: 1, dcs: 1,
instances: 2, instances: 2,
healthy: true, healthy: true
}, },
metrics: [ metrics: [
{ {
name: 'CPU', name: 'CPU',
stat: '50%', stat: '50%'
}, },
{ {
name: 'Memory', name: 'Memory',
stat: '20%', stat: '20%'
}, },
{ {
name: 'Network', name: 'Network',
stat: '5.9KB/sec', stat: '5.9KB/sec'
}, }
] ]
} }
], ],
links: [ links: [
{ {
source: 'Nginx', source: 'Nginx',
target: 'WordPress', target: 'WordPress'
}, },
{ {
source: 'WordPress', source: 'WordPress',
target: 'Memcached', target: 'Memcached'
}, },
{ {
source: 'WordPress', source: 'WordPress',
target: 'NFS', target: 'NFS'
}, },
{ {
source: 'WordPress', source: 'WordPress',
target: 'Percona', target: 'Percona'
} }
] ]
}; };

View File

@ -32,7 +32,7 @@ const Topology = (props) => (
); );
Topology.propTypes = { Topology.propTypes = {
children: React.PropTypes.node, children: React.PropTypes.node
}; };
module.exports = Baseline( module.exports = Baseline(

View File

@ -1,3 +1,5 @@
/*eslint-disable */
module.exports = { module.exports = {
nodes: [ nodes: [
{ {

View File

@ -77,7 +77,7 @@ const GraphNode = ({
const paddingLeft = 18-halfWidth; const paddingLeft = 18-halfWidth;
const infoPosition = { const infoPosition = {
x: paddingLeft, x: paddingLeft,
y: 59 - halfHeight, y: 59 - halfHeight
}; };
const metricsPosition = { const metricsPosition = {
x: paddingLeft, x: paddingLeft,

View File

@ -3,5 +3,5 @@ module.exports = {
TopologyGraphNode: require('./graph-node'), TopologyGraphNode: require('./graph-node'),
TopologyGraphLink: require('./graph-link'), TopologyGraphLink: require('./graph-link'),
TopologyGraphNodeButton: require('./graph-node-button'), TopologyGraphNodeButton: require('./graph-node-button'),
TopologyGraphNodeMetrics: require('./graph-node-metrics'), TopologyGraphNodeMetrics: require('./graph-node-metrics')
}; };

View File

@ -188,7 +188,7 @@ class TopologyGraph extends React.Component {
return ({ return ({
...simNode, ...simNode,
x: simNode.x + offset.x, x: simNode.x + offset.x,
y: simNode.y + offset.y, y: simNode.y + offset.y
}); });
} }
return ({ return ({

View File

@ -18,7 +18,7 @@ const {
} = fns; } = fns;
const { const {
default: styled, default: styled
} = Styled; } = Styled;
const classNames = { const classNames = {

View File

@ -18,6 +18,6 @@ module.exports = {
checked: `${remcalc(1)} solid ${base.primary}`, checked: `${remcalc(1)} solid ${base.primary}`,
unchecked: `${remcalc(1)} solid ${base.grey}`, unchecked: `${remcalc(1)} solid ${base.grey}`,
confirmed: `${remcalc(1)} solid ${base.grey}`, confirmed: `${remcalc(1)} solid ${base.grey}`,
error: `${remcalc(1)} solid ${base.red}`, error: `${remcalc(1)} solid ${base.red}`
} }
}; };

View File

@ -11,16 +11,16 @@ const small = {
const medium = { const medium = {
upper: '64rem', upper: '64rem',
lower: '48.1rem', lower: '48.1rem'
}; };
const large = { const large = {
upper: '75rem', upper: '75rem',
lower: '64.1rem', lower: '64.1rem'
}; };
const xlarge = { const xlarge = {
lower: '75.1rem', lower: '75.1rem'
}; };
const screen = 'only screen'; const screen = 'only screen';
@ -42,7 +42,7 @@ const screens = {
'xlarge': `${screen} and (min-width: ${xlarge.lower}) 'xlarge': `${screen} and (min-width: ${xlarge.lower})
and (max-width: ${xlarge.upper})`, and (max-width: ${xlarge.upper})`,
'xlargeUp': `${screen} and (min-width: ${xlarge.lower})`, 'xlargeUp': `${screen} and (min-width: ${xlarge.lower})`
}; };
const breakpoints = Object.keys(screens).reduce((acc, label) => { const breakpoints = Object.keys(screens).reduce((acc, label) => {

View File

@ -1,8 +1,6 @@
const React = require('react'); const React = require('react');
const { const {
storiesOf, storiesOf
// action,
// linkTo
} = require('@kadira/storybook'); } = require('@kadira/storybook');
const { const {
@ -16,7 +14,7 @@ const {
MiniMetricSubtitle, MiniMetricSubtitle,
MiniMetricView MiniMetricView
}, },
Row, Row
} = require('../src/'); } = require('../src/');
const MiniMetricData = require('../src/components/list/mini-metric-data'); const MiniMetricData = require('../src/components/list/mini-metric-data');