From 047ea4447a62a621120195619b15261a280230b4 Mon Sep 17 00:00:00 2001 From: sveisvei Date: Mon, 24 Oct 2016 18:48:24 +0200 Subject: [PATCH] minor feature cleanup --- .../component/feature/AddFeatureToggleUI.jsx | 133 ++++++++++-------- .../component/feature/EditFeatureToggle.jsx | 33 +++-- .../src/component/feature/Feature.jsx | 62 ++++---- .../src/component/feature/FeatureList.jsx | 42 +++--- .../feature/FeatureListContainer.jsx | 1 - .../src/component/feature/feature.scss | 8 ++ .../src/component/feature/table.scss | 12 -- .../src/page/features/create.js | 20 ++- .../src/page/features/edit.js | 6 +- .../src/page/features/index.js | 23 +-- .../src/page/history/index.js | 2 +- 11 files changed, 166 insertions(+), 176 deletions(-) create mode 100644 packages/unleash-frontend-next/src/component/feature/feature.scss delete mode 100644 packages/unleash-frontend-next/src/component/feature/table.scss diff --git a/packages/unleash-frontend-next/src/component/feature/AddFeatureToggleUI.jsx b/packages/unleash-frontend-next/src/component/feature/AddFeatureToggleUI.jsx index 88239b25c2..1aff600bd3 100644 --- a/packages/unleash-frontend-next/src/component/feature/AddFeatureToggleUI.jsx +++ b/packages/unleash-frontend-next/src/component/feature/AddFeatureToggleUI.jsx @@ -3,72 +3,81 @@ import { Input, Switch, Button } from 'react-toolbox'; import AddFeatureToggleStrategy from './AddFeatureToggleStrategy'; import ConfiguredStrategies from './ConfiguredStrategies'; -class AddFeatureToggleUI extends React.Component { - static propTypes () { - return { - strategies: PropTypes.array.required, - featureToggle: PropTypes.object, - updateField: PropTypes.func.required, - addStrategy: PropTypes.func.required, - removeStrategy: PropTypes.func.required, - onSubmit: PropTypes.func.required, - onCancel: PropTypes.func.required, - editmode: PropTypes.bool, - }; - } +const AddFeatureToggleUI = ({ + strategies, + featureToggle, + updateField, + addStrategy, + removeStrategy, + onSubmit, + onCancel, + editmode, +}) => { + const { + name, // eslint-disable-line + description, + enabled, + } = featureToggle; + const configuredStrategies = featureToggle.strategies; - render () { - const configuredStrategies = this.props.featureToggle.strategies; - - return ( -
-
- - - -
- - - -
-
- -
- Activation strategies - -
- -
- -
+ return ( + +
+ +
+ -
+ +
+ Activation strategies + +
+ +
+ +
+ +
+ + +