diff --git a/frontend/src/component/app.jsx b/frontend/src/component/app.jsx index 85cedb0147..920174c590 100644 --- a/frontend/src/component/app.jsx +++ b/frontend/src/component/app.jsx @@ -145,8 +145,8 @@ export default class App extends Component { - - + + {this.props.children} diff --git a/frontend/src/component/application/application-edit-component.js b/frontend/src/component/application/application-edit-component.js index b502d72786..220daddd51 100644 --- a/frontend/src/component/application/application-edit-component.js +++ b/frontend/src/component/application/application-edit-component.js @@ -152,18 +152,20 @@ class ClientApplications extends PureComponent { return ( -
- {appName}} subtitle={description} - actions={url && Visit site} - /> + + + {appName}} subtitle={description} + actions={url && Visit site} + /> - this.setState({ activeTab: tabId })} ripple> - Details - Edit - + this.setState({ activeTab: tabId })} ripple> + Details + Edit + - {content} -
+ {content} +
+
); } } diff --git a/frontend/src/component/application/application-list-component.js b/frontend/src/component/application/application-list-component.js index 2c472cb596..a5d8570d6a 100644 --- a/frontend/src/component/application/application-list-component.js +++ b/frontend/src/component/application/application-list-component.js @@ -1,5 +1,5 @@ import React, { Component } from 'react'; -import { ProgressBar } from 'react-mdl'; +import { ProgressBar, Grid, Cell } from 'react-mdl'; import { AppsLinkList, HeaderTitle } from '../common'; class ClientStrategies extends Component { @@ -17,10 +17,12 @@ class ClientStrategies extends Component { return ; } return ( -
- - -
+ + + + + + ); } } diff --git a/frontend/src/component/archive/archive-list-component.jsx b/frontend/src/component/archive/archive-list-component.jsx index 27ddec6ee3..61379f99ee 100644 --- a/frontend/src/component/archive/archive-list-component.jsx +++ b/frontend/src/component/archive/archive-list-component.jsx @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import { Link } from 'react-router'; -import { DataTable, TableHeader, IconButton, Icon } from 'react-mdl'; +import { DataTable, TableHeader, IconButton, Icon, Grid, Cell } from 'react-mdl'; import { HeaderTitle } from '../common'; class ArchiveList extends Component { @@ -14,26 +14,31 @@ class ArchiveList extends Component { e.reviveName = e.name; }); return ( -
- - { - archive.length > 0 ? - - ( - revive(reviveName)} /> - )}>Revive - (v ? 'Yes' : '-')}>Enabled - Toggle name - Created - : -
-
- No archived feature toggles, go see active toggles here + + + +
+ { + archive.length > 0 ? + + ( + revive(reviveName)} /> + )}>Revive + (v ? 'Yes' : '-')}> + Enabled + Toggle name + Created + : +
+
+ No archived feature toggles, go see active toggles here +
+ }
- } -
+ + ); } } diff --git a/frontend/src/component/common/common.scss b/frontend/src/component/common/common.scss index 58a3e74330..276cfc3800 100644 --- a/frontend/src/component/common/common.scss +++ b/frontend/src/component/common/common.scss @@ -4,13 +4,21 @@ text-overflow: ellipsis; } +.fullwidth { + width: 100%; +} + .divider { margin: 0; border-color: rgba(0,0,0,.12); } -@media (max-width: 960px) { - .hideLt960 { +.list { + margin: 0; +} + +@media (max-width: 920px) { + .hideLt920 { display: none; } } diff --git a/frontend/src/component/feature/feature-list-item-component.jsx b/frontend/src/component/feature/feature-list-item-component.jsx index 03cd1d946b..f8d351ef30 100644 --- a/frontend/src/component/feature/feature-list-item-component.jsx +++ b/frontend/src/component/feature/feature-list-item-component.jsx @@ -55,7 +55,7 @@ const Feature = ({ {description} - + {strategyChips} {summaryChip} diff --git a/frontend/src/component/feature/feature.scss b/frontend/src/component/feature/feature.scss index c27ea33db6..fe9c4b8554 100644 --- a/frontend/src/component/feature/feature.scss +++ b/frontend/src/component/feature/feature.scss @@ -39,7 +39,7 @@ .topList { display: flex; - margin: 10px 10px 10px 10px; + margin: 8px; } .topListItem0 { diff --git a/frontend/src/component/feature/form/index.jsx b/frontend/src/component/feature/form/index.jsx index 36c63d0b69..acb006a7e7 100644 --- a/frontend/src/component/feature/form/index.jsx +++ b/frontend/src/component/feature/form/index.jsx @@ -1,5 +1,5 @@ import React, { Component, PropTypes } from 'react'; -import { Textfield, Switch } from 'react-mdl'; +import { Textfield, Switch, Grid, Cell } from 'react-mdl'; import StrategiesSection from './strategies-section-container'; import { FormButtons, HeaderTitle } from '../../common'; @@ -45,53 +45,57 @@ class AddFeatureToggleComponent extends Component { const configuredStrategies = input.strategies || []; return ( -
- {title && } -
- validateName(v.target.value)} - onChange={(v) => setValue('name', trim(v.target.value))} /> -
- setValue('description', v.target.value)} /> + + + + {title && } +
+ validateName(v.target.value)} + onChange={(v) => setValue('name', trim(v.target.value))} /> +
+ setValue('description', v.target.value)} /> + + {!editmode &&
+
+ { + setValue('enabled', !enabled); + }}>Enabled +
+
} +
+ + - {!editmode &&

- { - setValue('enabled', !enabled); - }}>Enabled -
-
} -
- - - -
- - + + + + ); } diff --git a/frontend/src/component/feature/list-component.jsx b/frontend/src/component/feature/list-component.jsx index c7d923db9f..d9f62d66ee 100644 --- a/frontend/src/component/feature/list-component.jsx +++ b/frontend/src/component/feature/list-component.jsx @@ -1,8 +1,9 @@ import React, { PropTypes } from 'react'; import Feature from './feature-list-item-component'; import { Link } from 'react-router'; -import { Icon, Chip, ChipContact, IconButton, FABButton, Textfield, Menu, MenuItem } from 'react-mdl'; +import { Icon, Chip, ChipContact, IconButton, FABButton, Textfield, Menu, MenuItem, Grid, Cell } from 'react-mdl'; +import { styles as commonStyles } from '../common'; import styles from './feature.scss'; export default class FeatureListComponent extends React.PureComponent { @@ -49,70 +50,72 @@ export default class FeatureListComponent extends React.PureComponent { const { features, toggleFeature, featureMetrics, settings } = this.props; return ( -
-
- this.toggleMetrics()} className={styles.topListItem0}> - { settings.showLastHour && - - - } - { '1 hour' } - -   - this.toggleMetrics()} className={styles.topListItem0}> - { !settings.showLastHour && - - - } - { '1 minute' } - + + +
+ this.toggleMetrics()} className={styles.topListItem0}> + { settings.showLastHour && + + + } + { '1 hour' } + +   + this.toggleMetrics()} className={styles.topListItem0}> + { !settings.showLastHour && + + + } + { '1 minute' } + -
- { this.setFilter(e.target.value); }} - label="Filter toggles" - style={{ width: '100%' }} - /> +
+ { this.setFilter(e.target.value); }} + label="Filter toggles" + style={{ width: '100%' }} + /> +
+ +
+ + this.setSort(e.target.getAttribute('data-target'))}> + Filter by: + Default + Name + Enabled + Application name + Created + Strategies + Metrics + +
+ + +
-
- - this.setSort(e.target.getAttribute('data-target'))}> - Filter by: - Default - Name - Enabled - Application name - Created - Strategies - Metrics - -
+
    + {features.map((feature, i) => + + )} +
+
- + + + -
- -
    - {features.map((feature, i) => - - )} -
-
- - - - - -
+ + ); } } diff --git a/frontend/src/component/feature/view-component.jsx b/frontend/src/component/feature/view-component.jsx index f4cf481c4d..040552d96d 100644 --- a/frontend/src/component/feature/view-component.jsx +++ b/frontend/src/component/feature/view-component.jsx @@ -1,5 +1,5 @@ import React, { PropTypes } from 'react'; -import { Tabs, Tab, ProgressBar, IconButton } from 'react-mdl'; +import { Tabs, Tab, ProgressBar, IconButton, Grid, Cell } from 'react-mdl'; import { hashHistory, Link } from 'react-router'; import HistoryComponent from '../history/history-list-toggle-container'; @@ -90,25 +90,27 @@ export default class ViewFeatureToggleComponent extends React.Component { }; return ( -
-

- toggleFeature(featureToggle.name)} /> - {featureToggle.name} {featureToggle.enabled ? 'is enabled' : 'is disabled'} + + +

+ toggleFeature(featureToggle.name)} /> + {featureToggle.name} {featureToggle.enabled ? 'is enabled' : 'is disabled'} - - - Created {formatFullDateTime(featureToggle.createdAt)} - -

-
{featureToggle.description}
- - this.goToTab('view', featureToggleName)}>Metrics - this.goToTab('edit', featureToggleName)}>Edit - this.goToTab('history', featureToggleName)}>History - + + + Created {formatFullDateTime(featureToggle.createdAt)} + +

+
{featureToggle.description}
+ + this.goToTab('view', featureToggleName)}>Metrics + this.goToTab('edit', featureToggleName)}>Edit + this.goToTab('history', featureToggleName)}>History + - {tabContent} -
+ {tabContent} + + ); } } diff --git a/frontend/src/component/history/history-component.jsx b/frontend/src/component/history/history-component.jsx index 485654e1bc..a622b11ba3 100644 --- a/frontend/src/component/history/history-component.jsx +++ b/frontend/src/component/history/history-component.jsx @@ -1,6 +1,6 @@ import React, { PureComponent } from 'react'; +import { Grid, Cell } from 'react-mdl'; import HistoryList from './history-list-container'; - class History extends PureComponent { componentDidMount () { @@ -18,7 +18,11 @@ class History extends PureComponent { } return ( - + + + + + ); } } diff --git a/frontend/src/component/history/history-item-diff.jsx b/frontend/src/component/history/history-item-diff.jsx index 78284cb624..3e921c94ac 100644 --- a/frontend/src/component/history/history-item-diff.jsx +++ b/frontend/src/component/history/history-item-diff.jsx @@ -77,7 +77,7 @@ class HistoryItem extends PureComponent { changes =
{JSON.stringify(entry.data, null, 2)}
; } - return (
+        return (
             {changes.length === 0 ? '(no changes)' : changes}
         
); } diff --git a/frontend/src/component/history/history-list-component.jsx b/frontend/src/component/history/history-list-component.jsx index a39b70b69a..e259902ef2 100644 --- a/frontend/src/component/history/history-list-component.jsx +++ b/frontend/src/component/history/history-list-component.jsx @@ -2,10 +2,10 @@ import React, { Component } from 'react'; import HistoryItemDiff from './history-item-diff'; import HistoryItemJson from './history-item-json'; import { Table, TableHeader } from 'react-mdl'; -import { HeaderTitle, SwitchWithLabel } from '../common'; +import { HeaderTitle, SwitchWithLabel, styles as commonStyles } from '../common'; import { formatFullDateTime } from '../common/util'; -import style from './history.scss'; +import styles from './history.scss'; class HistoryList extends Component { @@ -32,7 +32,8 @@ class HistoryList extends Component { diff: (), }, entry)) } - style={{ width: '100%' }} + className={commonStyles.fullwidth} + style={{ border: 0 }} > Type User @@ -42,11 +43,13 @@ class HistoryList extends Component { } return ( -
+
Show full events }/> - {entries} +
+ {entries} +
); } diff --git a/frontend/src/component/strategies/add-strategy.jsx b/frontend/src/component/strategies/add-strategy.jsx index 3d65ebcae6..27c8621192 100644 --- a/frontend/src/component/strategies/add-strategy.jsx +++ b/frontend/src/component/strategies/add-strategy.jsx @@ -1,6 +1,6 @@ import React, { PropTypes, Component } from 'react'; -import { Textfield, IconButton, Menu, MenuItem, Checkbox } from 'react-mdl'; +import { Textfield, IconButton, Menu, MenuItem, Checkbox, Grid, Cell } from 'react-mdl'; import { FormButtons } from '../common'; @@ -64,7 +64,7 @@ const Parameter = ({ set, input = {}, index }) => ( const EditHeader = () => (
-

Edit strategy

+

Edit strategy

Be carefull! Changing a strategy definition might also require changes to the implementation in the clients. @@ -74,7 +74,7 @@ const EditHeader = () => ( const CreateHeader = () => (

-

Create a new Strategy definition

+

Create a new Strategy definition

); @@ -130,44 +130,48 @@ class AddStrategy extends Component { } = this.props; return ( -
- {editmode ? : } - setValue('name', trim(target.value))} - value={input.name} - /> -
- setValue('description', target.value)} - value={input.description} - /> + + + + {editmode ? : } + setValue('name', trim(target.value))} + value={input.name} + /> +
+ setValue('description', target.value)} + value={input.description} + /> - - { - e.preventDefault(); - incValue('_params'); - }}/>  Add parameter + + { + e.preventDefault(); + incValue('_params'); + }}/>  Add parameter -
-
+
+
- - + + +
+
); } } diff --git a/frontend/src/component/strategies/list-component.jsx b/frontend/src/component/strategies/list-component.jsx index 7805ba44eb..6932a5cf07 100644 --- a/frontend/src/component/strategies/list-component.jsx +++ b/frontend/src/component/strategies/list-component.jsx @@ -1,8 +1,8 @@ import React, { Component } from 'react'; import { Link } from 'react-router'; -import { List, ListItem, ListItemContent, IconButton } from 'react-mdl'; -import { HeaderTitle } from '../common'; +import { List, ListItem, ListItemContent, IconButton, Grid, Cell } from 'react-mdl'; +import { HeaderTitle, styles as commonStyles } from '../common'; class StrategiesListComponent extends Component { @@ -18,26 +18,28 @@ class StrategiesListComponent extends Component { const { strategies, removeStrategy } = this.props; return ( -
- this.context.router.push('/strategies/create')} - title="Add new strategy" />} /> - - {strategies.length > 0 ? strategies.map((strategy, i) => ( - - - - {strategy.name} - - - removeStrategy(strategy)} /> - - )) : No entries} - -
+ + + this.context.router.push('/strategies/create')} + title="Add new strategy" />} /> + + {strategies.length > 0 ? strategies.map((strategy, i) => ( + + + + {strategy.name} + + + removeStrategy(strategy)} /> + + )) : No entries} + + + ); } } diff --git a/frontend/src/component/strategies/strategy-details-component.jsx b/frontend/src/component/strategies/strategy-details-component.jsx index dc5dba66a6..6a879e5b7b 100644 --- a/frontend/src/component/strategies/strategy-details-component.jsx +++ b/frontend/src/component/strategies/strategy-details-component.jsx @@ -1,6 +1,6 @@ import React, { PropTypes, Component } from 'react'; import { hashHistory } from 'react-router'; -import { Tabs, Tab, ProgressBar } from 'react-mdl'; +import { Tabs, Tab, ProgressBar, Grid, Cell } from 'react-mdl'; import ShowStrategy from './show-strategy-component'; import EditStrategy from './edit-container'; import { HeaderTitle } from '../common'; @@ -61,18 +61,20 @@ export default class StrategyDetails extends Component { const tabContent = this.getTabContent(activeTabId); return ( -
- - - this.goToTab('view')}>Details - this.goToTab('edit')}>Edit - -
-
- {tabContent} -
-
-
+ + + + + this.goToTab('view')}>Details + this.goToTab('edit')}>Edit + +
+
+ {tabContent} +
+
+
+
); } } diff --git a/frontend/src/component/styles.scss b/frontend/src/component/styles.scss index e3e8c4c734..3f4a6a77d3 100644 --- a/frontend/src/component/styles.scss +++ b/frontend/src/component/styles.scss @@ -1,3 +1,34 @@ +.content { + width: 1200px; + margin-left: auto; + margin-right: auto; + margin-top: 16px; + margin-bottom: 16px; +} +@media (max-width: 1800px) { + .content { + width: 66.66%; + } +} +@media (max-width: 1260px) { + .content { + width: 840px; + } +} +@media (max-width: 920px) { + .content { + width: auto; + margin-left: 40px; + margin-right: 40px; + } +} +@media (max-width: 600px) { + .content { + margin-left: 0; + margin-right: 0; + } +} + .headerTitleLink { text-decoration: none; }