From 13383d9f7cefac0f9322b254a641f453d599086f Mon Sep 17 00:00:00 2001 From: cyril lopez Date: Wed, 13 Dec 2017 13:43:36 +0100 Subject: [PATCH] Open the application s permissions section if there are APIs --- .../admin/src/components/Plugin/index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/strapi-plugin-users-permissions/admin/src/components/Plugin/index.js b/packages/strapi-plugin-users-permissions/admin/src/components/Plugin/index.js index 3af5444edd..310cb4125a 100644 --- a/packages/strapi-plugin-users-permissions/admin/src/components/Plugin/index.js +++ b/packages/strapi-plugin-users-permissions/admin/src/components/Plugin/index.js @@ -17,6 +17,14 @@ import styles from './styles.scss'; class Plugin extends React.Component { // eslint-disable-line react/prefer-stateless-function state = { collapse: false }; + componentDidMount() { + // Open the application's permissions section if there are APIs + if (this.props.name === 'application' && !isEmpty(get(this.props.plugin, 'controllers'))) { + this.props.changePluginSelected('application'); + this.setState({ collapse: !this.state.collapse }); + } + } + componentWillReceiveProps(nextProps) { if (nextProps.pluginSelected !== this.props.pluginSelected && nextProps.pluginSelected !== this.props.name) { this.context.resetShouldDisplayPoliciesHint();