diff --git a/packages/strapi-helper-plugin/lib/src/components/InputSelectWithErrors/index.js b/packages/strapi-helper-plugin/lib/src/components/InputSelectWithErrors/index.js
index e4ad11c580..cd5ba4d506 100644
--- a/packages/strapi-helper-plugin/lib/src/components/InputSelectWithErrors/index.js
+++ b/packages/strapi-helper-plugin/lib/src/components/InputSelectWithErrors/index.js
@@ -14,6 +14,7 @@ import Label from '../Label';
import InputDescription from '../InputDescription';
import InputErrors from '../InputErrors';
import InputSelect from '../InputSelect';
+import InputSpacer from '../InputSpacer';
import styles from './styles.scss';
@@ -72,6 +73,7 @@ class InputSelectWithErrors extends React.Component {
labelClassName,
labelStyle,
name,
+ noErrorsDescription,
onBlur,
onChange,
onFocus,
@@ -82,6 +84,12 @@ class InputSelectWithErrors extends React.Component {
withOptionPlaceholder,
} = this.props;
+ let spacer = !isEmpty(inputDescription) ? :
;
+
+ if (!noErrorsDescription && !isEmpty(this.state.errors)) {
+ spacer = ;
+ }
+
return (
+ {spacer}
);
}
@@ -148,6 +157,7 @@ InputSelectWithErrors.defaultProps = {
labelClassName: '',
labelStyle: {},
onBlur: false,
+ noErrorsDescription: false,
onFocus: () => {},
selectOptions: [],
style: {},
@@ -189,6 +199,7 @@ InputSelectWithErrors.propTypes = {
labelClassName: PropTypes.string,
labelStyle: PropTypes.object,
name: PropTypes.string.isRequired,
+ noErrorsDescription: PropTypes.bool,
onBlur: PropTypes.oneOfType([PropTypes.bool, PropTypes.func]),
onChange: PropTypes.func.isRequired,
onFocus: PropTypes.func,
diff --git a/packages/strapi-plugin-users-permissions/admin/src/components/EditForm/index.js b/packages/strapi-plugin-users-permissions/admin/src/components/EditForm/index.js
index 6fd57d2cc7..a6ba733d83 100644
--- a/packages/strapi-plugin-users-permissions/admin/src/components/EditForm/index.js
+++ b/packages/strapi-plugin-users-permissions/admin/src/components/EditForm/index.js
@@ -10,7 +10,7 @@ import { get } from 'lodash';
import { InputsIndex as Input, LoadingIndicator } from 'strapi-helper-plugin';
-import { Separator, Wrapper } from './Components';
+import { Wrapper } from './Components';
function EditForm({ onChange, showLoaders, values }) {
const { roles, settings } = values;
@@ -45,9 +45,7 @@ function EditForm({ onChange, showLoaders, values }) {
type="select"
value={get(settings, 'default_role')}
/>
-
-
-
-
-
-
-
-
+
+ <>
- {form.length > 1 &&
}
-
{map(tail(form), (value, key) => (
)}
-
+ >
);
}
@@ -222,7 +226,7 @@ class PopUpForm extends React.Component {
};
return (
-
+ <>
{map(take(form, 3), (value, key) => (
))}
-
+ >
);
};
@@ -296,39 +300,43 @@ class PopUpForm extends React.Component {
);
}
- if (display && en[display]) {
- header =
;
- }
+ let subHeader =
+ display && en[display] ? (
+
+ ) : (
+
{capitalize(dataToEdit)}
+ );
return (
-
-
-
-
-
-
+
+
+
+
+
+
);
}
diff --git a/packages/strapi-plugin-users-permissions/admin/src/containers/HomePage/index.js b/packages/strapi-plugin-users-permissions/admin/src/containers/HomePage/index.js
index 80b87ea0fb..b3f7c258ff 100644
--- a/packages/strapi-plugin-users-permissions/admin/src/containers/HomePage/index.js
+++ b/packages/strapi-plugin-users-permissions/admin/src/containers/HomePage/index.js
@@ -169,6 +169,10 @@ export class HomePage extends React.Component {
},
];
+ isAdvanded = () => {
+ return this.getEndPoint() === 'advanced';
+ };
+
pluginHeaderActions = [
{
label: 'users-permissions.EditPage.cancel',
@@ -186,14 +190,13 @@ export class HomePage extends React.Component {
showLoaders = () => {
const { data, isLoading, modifiedData } = this.props;
- const isAdvanded = this.getEndPoint() === 'advanced';
return (
(isLoading &&
get(data, this.getEndPoint()) === undefined &&
- !isAdvanded) ||
+ !this.isAdvanded()) ||
(isLoading &&
- isAdvanded &&
+ this.isAdvanded() &&
get(modifiedData, this.getEndPoint()) === undefined)
);
};
@@ -216,24 +219,7 @@ export class HomePage extends React.Component {
const noButtonList =
match.params.settingType === 'email-templates' ||
match.params.settingType === 'providers';
- const component =
- match.params.settingType === 'advanced' ? (
-
- ) : (
-
- );
+ const values = get(modifiedData, this.getEndPoint(), {});
return (
- {component}
+ {!this.isAdvanded() ? (
+
+ ) : (
+
+ )}