From ea47883815cac596a341f267b42e2efc556f776e Mon Sep 17 00:00:00 2001 From: sveisvei Date: Sun, 1 Jan 2017 17:34:06 +0100 Subject: [PATCH 1/5] change link target --- frontend/src/component/common/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/component/common/index.js b/frontend/src/component/common/index.js index bd2c5e5082..7500669472 100644 --- a/frontend/src/component/common/index.js +++ b/frontend/src/component/common/index.js @@ -64,7 +64,7 @@ export const TogglesLinkList = ({ toggles }) => ( {toggles.length > 0 && toggles.map(({ name, description = '-', icon = 'toggle' }) => ( - + {name} From 539645d4ef46b460a50ffce04a8e828cc4ac03b6 Mon Sep 17 00:00:00 2001 From: sveisvei Date: Sun, 1 Jan 2017 20:44:02 +0100 Subject: [PATCH 2/5] add strategies to metric view, add OR text between strategies --- .../feature/form/strategy-configure.jsx | 41 ++++--------- .../src/component/feature/form/strategy.scss | 58 +++++++++++++++++++ .../component/feature/metric-component.jsx | 30 +++++++--- frontend/src/component/feature/metrics.scss | 37 ++++++++++++ 4 files changed, 130 insertions(+), 36 deletions(-) create mode 100644 frontend/src/component/feature/form/strategy.scss create mode 100644 frontend/src/component/feature/metrics.scss diff --git a/frontend/src/component/feature/form/strategy-configure.jsx b/frontend/src/component/feature/form/strategy-configure.jsx index d484169fe4..b481983774 100644 --- a/frontend/src/component/feature/form/strategy-configure.jsx +++ b/frontend/src/component/feature/form/strategy-configure.jsx @@ -8,20 +8,7 @@ import { DragSource, DropTarget } from 'react-dnd'; import { Link } from 'react-router'; import StrategyInputPercentage from './strategy-input-percentage'; import StrategyInputList from './strategy-input-list'; - -const style = { - flex: '1', - minWidth: '300px', - maxWidth: '100%', - margin: '5px 20px 15px 0px', -}; - -const helpText = { - color: 'rgba(0,0,0, 0.54)', - fontSize: '12px', - lineHeight: '14px', -}; - +import styles from './strategy.scss'; const dragSource = { beginDrag (props) { @@ -105,7 +92,7 @@ class StrategyConfigure extends React.Component { name={name} onChange={this.handleConfigChange.bind(this, name)} value={1 * value} /> - {description &&

{description}

} + {description &&

{description}

} ); } else if (type === 'list') { @@ -119,7 +106,7 @@ class StrategyConfigure extends React.Component { return (
- {description &&

{description}

} + {description &&

{description}

}
); } else if (type === 'number') { @@ -136,7 +123,7 @@ class StrategyConfigure extends React.Component { onChange={this.handleConfigChange.bind(this, name)} value={value} /> - {description &&

{description}

} + {description &&

{description}

} ); } else { @@ -152,7 +139,7 @@ class StrategyConfigure extends React.Component { onChange={this.handleConfigChange.bind(this, name)} value={value} /> - {description &&

{description}

} + {description &&

{description}

} ); } @@ -169,8 +156,8 @@ class StrategyConfigure extends React.Component { const inputFields = this.renderInputFields(this.props.strategyDefinition); const { name } = this.props.strategy; item = ( - - + +  {name} @@ -182,27 +169,23 @@ class StrategyConfigure extends React.Component { } - + + className={styles.editLink}> {connectDragSource( - )} + )} ); } else { const { name } = this.props.strategy; item = ( - + "{name}" deleted? The strategy "{name}" does not exist on this server. @@ -217,7 +200,7 @@ class StrategyConfigure extends React.Component { } return (connectDropTarget(connectDragPreview( -
{item}
+
{item}
))); } } diff --git a/frontend/src/component/feature/form/strategy.scss b/frontend/src/component/feature/form/strategy.scss new file mode 100644 index 0000000000..30026e8560 --- /dev/null +++ b/frontend/src/component/feature/form/strategy.scss @@ -0,0 +1,58 @@ +.item { + flex: 1; + min-width: 300px; + max-width: 100%; + margin: 5px 0px 15px 35px; + position: relative; + z-index: 1; +}; + +.card { + width: 100%; + display: block; + background-color: #f2f9fc; +} + +.item:first-child { + margin-left: 0; +} + +.item:not(:first-child):after { + content: " OR "; + position: absolute; + left: -30px; + top: 50%; + color: #ccc; + width: 25px; + line-height: 32px; + font-size: 14px; + text-align: center; + height: 100%; + z-index: 2; +} + +.cardTitle { + color: #fff; + height: 65px; + background-color: #607d8b !important; +} + +.helpText { + color: rgba(0,0,0, 0.54); + font-size: 12px; + line-height: 14px; +}; + + +.editLink { + color: #fff; + display: inline-block; + vertical-align: bottom; + margin-right: 5px; +} + +.reorderIcon { + cursor: pointer; + display: inline-block; + vertical-align: bottom; +} diff --git a/frontend/src/component/feature/metric-component.jsx b/frontend/src/component/feature/metric-component.jsx index a47e889e1e..727c36c092 100644 --- a/frontend/src/component/feature/metric-component.jsx +++ b/frontend/src/component/feature/metric-component.jsx @@ -1,8 +1,25 @@ import React, { PropTypes } from 'react'; -import { Grid, Cell, Icon } from 'react-mdl'; +import { Grid, Cell, Icon, Chip, ChipContact } from 'react-mdl'; import Progress from './progress'; +import { Link } from 'react-router'; import { AppsLinkList, SwitchWithLabel, calc } from '../common'; +import styles from './metrics.scss'; +const StrategyChipItem = ({ strategy }) => ( + + + + + {strategy.name} + +); + +// TODO what about "missing" strategies here? +const StrategiesList = ({ strategies }) => ( +
With {strategies.length > 1 ? 'strategies' : 'strategy'} { + strategies.map((strategy, i) => ) + }
+); export default class MetricComponent extends React.Component { static propTypes () { @@ -47,8 +64,7 @@ export default class MetricComponent extends React.Component { { lastMinute.isFallback ? - : + :
@@ -58,8 +74,7 @@ export default class MetricComponent extends React.Component { { lastHour.isFallback ? - : + :
@@ -70,8 +85,7 @@ export default class MetricComponent extends React.Component { {seenApps.length > 0 ? (
Seen in applications:
) :
- +
Not used in a app in the last hour. This might be due to your client implementation is not reporting usage.
@@ -79,6 +93,8 @@ export default class MetricComponent extends React.Component {
+
+ ); } } diff --git a/frontend/src/component/feature/metrics.scss b/frontend/src/component/feature/metrics.scss new file mode 100644 index 0000000000..0bbe832def --- /dev/null +++ b/frontend/src/component/feature/metrics.scss @@ -0,0 +1,37 @@ +.chip { + display: inline-block; + vertical-align: middle; + margin-left: 30px; + position: relative; + z-index: 1; + overflow: visible; +} + +.chip:first-child { + margin-left: 0; +} + +.chip:not(:first-child):after { + content: " OR "; + position: absolute; + left: -27px; + top: 0; + color: #ccc; + width: 25px; + line-height: 32px; + font-size: 14px; + text-align: center; + height: 100%; + z-index: 2; +} + +.chip:first-child:before { + content: '' +} + +.problemIcon { + width: 100px; + height: 100px; + font-size: 100px; + color: #ccc; +} From bb767c1ca5f15cc818851ad966d85b9fc213c6a0 Mon Sep 17 00:00:00 2001 From: sveisvei Date: Sun, 1 Jan 2017 20:47:37 +0100 Subject: [PATCH 3/5] add important --- frontend/src/component/feature/metrics.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/component/feature/metrics.scss b/frontend/src/component/feature/metrics.scss index 0bbe832def..c57c3af7e4 100644 --- a/frontend/src/component/feature/metrics.scss +++ b/frontend/src/component/feature/metrics.scss @@ -32,6 +32,6 @@ .problemIcon { width: 100px; height: 100px; - font-size: 100px; + font-size: 100px !important; color: #ccc; } From 6c701989eee7471400ef29197afd76ae17a24cb7 Mon Sep 17 00:00:00 2001 From: sveisvei Date: Mon, 2 Jan 2017 09:26:36 +0100 Subject: [PATCH 4/5] left align and color tweaks --- .../src/component/feature/metric-component.jsx | 14 ++++++++------ frontend/src/component/feature/view-component.jsx | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/frontend/src/component/feature/metric-component.jsx b/frontend/src/component/feature/metric-component.jsx index 727c36c092..9923136a1a 100644 --- a/frontend/src/component/feature/metric-component.jsx +++ b/frontend/src/component/feature/metric-component.jsx @@ -16,7 +16,7 @@ const StrategyChipItem = ({ strategy }) => ( // TODO what about "missing" strategies here? const StrategiesList = ({ strategies }) => ( -
With {strategies.length > 1 ? 'strategies' : 'strategy'} { +
With {strategies.length > 1 ? 'strategies' : 'strategy'} { strategies.map((strategy, i) => ) }
); @@ -56,10 +56,12 @@ export default class MetricComponent extends React.Component { const lastMinutePercent = 1 * calc(lastMinute.yes, lastMinute.yes + lastMinute.no, 0); return (
- toggleFeature(featureToggle)}>Toggle {featureToggle.name} -
+
+ toggleFeature(featureToggle)}>Toggle {featureToggle.name} +
+
{ @@ -93,7 +95,7 @@ export default class MetricComponent extends React.Component { -
+
); } diff --git a/frontend/src/component/feature/view-component.jsx b/frontend/src/component/feature/view-component.jsx index 0ed75f4cd1..a645941fc1 100644 --- a/frontend/src/component/feature/view-component.jsx +++ b/frontend/src/component/feature/view-component.jsx @@ -83,7 +83,7 @@ export default class ViewFeatureToggleComponent extends React.Component { Created {(new Date(featureToggle.createdAt)).toLocaleString('nb-NO')} -
{featureToggle.description}
+
{featureToggle.description}
this.goToTab('view', featureToggleName)}>Metrics this.goToTab('edit', featureToggleName)}>Edit From ecc230bed7e141fd65ec617e7b7ebb3be58e9ad5 Mon Sep 17 00:00:00 2001 From: sveisvei Date: Mon, 2 Jan 2017 09:29:13 +0100 Subject: [PATCH 5/5] align higher --- frontend/src/component/feature/form/strategy.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/component/feature/form/strategy.scss b/frontend/src/component/feature/form/strategy.scss index 30026e8560..49e5e56c85 100644 --- a/frontend/src/component/feature/form/strategy.scss +++ b/frontend/src/component/feature/form/strategy.scss @@ -21,7 +21,7 @@ content: " OR "; position: absolute; left: -30px; - top: 50%; + top: 45%; color: #ccc; width: 25px; line-height: 32px;