diff --git a/frontend/src/component/feature/form/__tests__/strategy-input-list-test.jsx b/frontend/src/component/feature/form/__tests__/strategy-input-list-test.jsx
index ad49344c7c..5be4471733 100644
--- a/frontend/src/component/feature/form/__tests__/strategy-input-list-test.jsx
+++ b/frontend/src/component/feature/form/__tests__/strategy-input-list-test.jsx
@@ -79,3 +79,11 @@ it('spy onClose', () => {
wrapper.find('react-mdl-Chip').simulate('close', closeMock);
expect(onClose).toHaveBeenCalled();
});
+
+it('renders correctly when disabled', () => {
+ const list = ['item1', 'item2'];
+ const name = 'featureName';
+ const tree = renderer.create();
+
+ expect(tree).toMatchSnapshot();
+});
diff --git a/frontend/src/component/feature/form/strategy-configure.jsx b/frontend/src/component/feature/form/strategy-configure.jsx
index b18e5e850a..a15e217a61 100644
--- a/frontend/src/component/feature/form/strategy-configure.jsx
+++ b/frontend/src/component/feature/form/strategy-configure.jsx
@@ -104,7 +104,12 @@ class StrategyConfigure extends React.Component {
}
return (
-
+
{description &&
{description}
}
);
diff --git a/frontend/src/component/feature/form/strategy-input-list.jsx b/frontend/src/component/feature/form/strategy-input-list.jsx
index 102b61eb6e..cdfd9610f2 100644
--- a/frontend/src/component/feature/form/strategy-input-list.jsx
+++ b/frontend/src/component/feature/form/strategy-input-list.jsx
@@ -7,6 +7,7 @@ export default class InputList extends Component {
name: PropTypes.string.isRequired,
list: PropTypes.array.isRequired,
setConfig: PropTypes.func.isRequired,
+ disabled: PropTypes.bool,
};
onBlur(e) {
@@ -49,35 +50,43 @@ export default class InputList extends Component {
}
render() {
- const { name, list } = this.props;
+ const { name, list, disabled } = this.props;
return (
{name}
{list.map((entryValue, index) => (
-
this.onClose(index)}>
+ this.onClose(index)}
+ >
{entryValue}
))}
-
- {
- this.textInput = input;
- }}
- />
-
-
+ {disabled ? (
+ ''
+ ) : (
+
+ {
+ this.textInput = input;
+ }}
+ />
+
+
+ )}
);
}
diff --git a/frontend/src/component/feature/list-component.jsx b/frontend/src/component/feature/list-component.jsx
index 294941f8e5..aef75559f5 100644
--- a/frontend/src/component/feature/list-component.jsx
+++ b/frontend/src/component/feature/list-component.jsx
@@ -6,7 +6,6 @@ import { Icon, FABButton, Textfield, Menu, MenuItem, Card, CardActions, List } f
import { MenuItemWithIcon, DropdownButton, styles as commonStyles } from '../common';
import styles from './feature.scss';
import { CREATE_FEATURE } from '../../permissions';
-import PermissionComponent from '../common/permission-container';
export default class FeatureListComponent extends React.Component {
static propTypes = {
@@ -21,6 +20,7 @@ export default class FeatureListComponent extends React.Component {
toggleFeature: PropTypes.func,
settings: PropTypes.object,
history: PropTypes.object.isRequired,
+ hasPermission: PropTypes.func.isRequired,
};
componentDidMount() {
@@ -48,7 +48,7 @@ export default class FeatureListComponent extends React.Component {
}
render() {
- const { features, toggleFeature, featureMetrics, settings, revive } = this.props;
+ const { features, toggleFeature, featureMetrics, settings, revive, hasPermission } = this.props;
features.forEach(e => {
e.reviveName = e.name;
});
@@ -64,16 +64,15 @@ export default class FeatureListComponent extends React.Component {
label="Search"
style={{ width: '100%' }}
/>
-
-
-
-
-
- }
- />
+ {hasPermission(CREATE_FEATURE) ? (
+
+
+
+
+
+ ) : (
+ ''
+ )}