2017-11-15 17:35:32 +01:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* Plugins
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
import { FormattedMessage } from 'react-intl';
|
|
|
|
import { map } from 'lodash';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import cn from 'classnames';
|
|
|
|
import Plugin from 'components/Plugin';
|
|
|
|
|
|
|
|
import styles from './styles.scss';
|
|
|
|
|
2017-11-16 15:13:46 +01:00
|
|
|
class Plugins extends React.Component {
|
|
|
|
state = { pluginSelected: '' };
|
|
|
|
|
|
|
|
changePluginSelected = (name) => this.setState({ pluginSelected: name });
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<div className={cn('col-md-7', styles.wrapper)}>
|
|
|
|
<div className={styles.plugins}>
|
|
|
|
<div className={styles.headerContainer}>
|
|
|
|
<div>
|
|
|
|
<FormattedMessage id="users-permissions.Plugins.header.title" />
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<FormattedMessage id="users-permissions.Plugins.header.description" />
|
|
|
|
</div>
|
2017-11-15 17:35:32 +01:00
|
|
|
</div>
|
2017-11-16 15:13:46 +01:00
|
|
|
<div className={styles.pluginsContainer}>
|
2017-11-27 17:50:51 +01:00
|
|
|
{map(Object.keys(this.props.plugins).sort(), (plugin) => (
|
2017-11-16 15:13:46 +01:00
|
|
|
<Plugin
|
|
|
|
changePluginSelected={this.changePluginSelected}
|
2017-11-27 17:50:51 +01:00
|
|
|
key={plugin}
|
|
|
|
name={plugin}
|
|
|
|
plugin={this.props.plugins[plugin]}
|
2017-11-16 15:13:46 +01:00
|
|
|
pluginSelected={this.state.pluginSelected}
|
|
|
|
/>
|
|
|
|
))}
|
2017-11-15 17:35:32 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-11-16 15:13:46 +01:00
|
|
|
);
|
|
|
|
}
|
2017-11-15 17:35:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
Plugins.defaultProps = {
|
|
|
|
plugins: {},
|
|
|
|
};
|
|
|
|
|
|
|
|
Plugins.propTypes = {
|
|
|
|
plugins: PropTypes.object,
|
|
|
|
};
|
|
|
|
|
|
|
|
export default Plugins;
|