2017-11-15 17:35:32 +01:00
|
|
|
/**
|
2019-06-19 11:51:44 +02:00
|
|
|
*
|
|
|
|
* Plugins
|
|
|
|
*
|
|
|
|
*/
|
2017-11-15 17:35:32 +01:00
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
import { FormattedMessage } from 'react-intl';
|
2018-01-25 17:53:49 +01:00
|
|
|
import { has, map } from 'lodash';
|
2017-11-15 17:35:32 +01:00
|
|
|
import PropTypes from 'prop-types';
|
2019-02-22 11:16:42 +01:00
|
|
|
|
|
|
|
import Plugin from '../Plugin';
|
2017-11-15 17:35:32 +01:00
|
|
|
|
2019-09-16 19:18:35 +02:00
|
|
|
import { Header, PluginsContainer, Wrapper } from './Components';
|
2017-11-15 17:35:32 +01:00
|
|
|
|
2017-11-16 15:13:46 +01:00
|
|
|
class Plugins extends React.Component {
|
|
|
|
state = { pluginSelected: '' };
|
|
|
|
|
2019-06-19 11:51:44 +02:00
|
|
|
changePluginSelected = name => this.setState({ pluginSelected: name });
|
2017-11-16 15:13:46 +01:00
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
2019-09-16 19:18:35 +02:00
|
|
|
<Wrapper className="col-md-7">
|
|
|
|
<div className="plugins-wrapper">
|
|
|
|
<Header>
|
2017-11-16 15:13:46 +01:00
|
|
|
<div>
|
|
|
|
<FormattedMessage id="users-permissions.Plugins.header.title" />
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<FormattedMessage id="users-permissions.Plugins.header.description" />
|
|
|
|
</div>
|
2019-09-16 19:18:35 +02:00
|
|
|
</Header>
|
|
|
|
<PluginsContainer
|
|
|
|
className={
|
|
|
|
!has(this.props.plugins, 'application') && 'pluginsGradient'
|
|
|
|
}
|
2019-06-19 11:51:44 +02: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}
|
|
|
|
/>
|
|
|
|
))}
|
2019-09-16 19:18:35 +02:00
|
|
|
</PluginsContainer>
|
2017-11-15 17:35:32 +01:00
|
|
|
</div>
|
2019-09-16 19:18:35 +02:00
|
|
|
</Wrapper>
|
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;
|