mirror of
https://github.com/strapi/strapi.git
synced 2025-12-13 07:55:33 +00:00
commit
c97f33bf53
@ -20,6 +20,7 @@ const Register = ({
|
||||
formErrors,
|
||||
inputsPrefix,
|
||||
modifiedData,
|
||||
noSignin,
|
||||
onChange,
|
||||
onSubmit,
|
||||
requestError,
|
||||
@ -135,15 +136,17 @@ const Register = ({
|
||||
</Box>
|
||||
</Padded>
|
||||
</Section>
|
||||
<AuthLink label="Auth.link.signin" to="/auth/login">
|
||||
<Text fontSize="md">
|
||||
{formatMessage({ id: 'Auth.link.signin.account' })}
|
||||
|
||||
<Text fontSize="md" color="#0097f7" as="span">
|
||||
{formatMessage({ id: 'Auth.link.signin' })}
|
||||
{!noSignin && (
|
||||
<AuthLink label="Auth.link.signin" to="/auth/login">
|
||||
<Text fontSize="md">
|
||||
{formatMessage({ id: 'Auth.link.signin.account' })}
|
||||
|
||||
<Text fontSize="md" color="#0097f7" as="span">
|
||||
{formatMessage({ id: 'Auth.link.signin' })}
|
||||
</Text>
|
||||
</Text>
|
||||
</Text>
|
||||
</AuthLink>
|
||||
</AuthLink>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
@ -151,6 +154,7 @@ const Register = ({
|
||||
Register.defaultProps = {
|
||||
fieldsToDisable: [],
|
||||
inputsPrefix: '',
|
||||
noSignin: false,
|
||||
onSubmit: e => e.preventDefault(),
|
||||
requestError: null,
|
||||
};
|
||||
@ -160,6 +164,7 @@ Register.propTypes = {
|
||||
formErrors: PropTypes.object.isRequired,
|
||||
inputsPrefix: PropTypes.string,
|
||||
modifiedData: PropTypes.object.isRequired,
|
||||
noSignin: PropTypes.bool,
|
||||
onChange: PropTypes.func.isRequired,
|
||||
onSubmit: PropTypes.func,
|
||||
requestError: PropTypes.object,
|
||||
|
||||
@ -22,7 +22,7 @@ const AuthPage = ({ hasAdmin }) => {
|
||||
} = useRouteMatch('/auth/:authType');
|
||||
const query = useQuery();
|
||||
const registrationToken = query.get('registrationToken');
|
||||
const { Component, endPoint, fieldsToDisable, fieldsToOmit, inputsPrefix, schema } = get(
|
||||
const { Component, endPoint, fieldsToDisable, fieldsToOmit, inputsPrefix, schema, ...rest } = get(
|
||||
forms,
|
||||
authType,
|
||||
{}
|
||||
@ -285,6 +285,7 @@ const AuthPage = ({ hasAdmin }) => {
|
||||
</NavTopRightWrapper>
|
||||
<BaselineAlignment top size="78px">
|
||||
<Component
|
||||
{...rest}
|
||||
fieldsToDisable={fieldsToDisable}
|
||||
formErrors={formErrors}
|
||||
inputsPrefix={inputsPrefix}
|
||||
|
||||
@ -80,6 +80,7 @@ const forms = {
|
||||
'register-admin': {
|
||||
Component: Register,
|
||||
endPoint: 'register-admin',
|
||||
noSignin: true,
|
||||
fieldsToDisable: [],
|
||||
fieldsToOmit: ['confirmPassword', 'news'],
|
||||
schema: yup.object().shape({
|
||||
|
||||
@ -21,6 +21,7 @@ const CustomTable = ({ canUpdate, canDelete, data, headers, isBulkable, showLoad
|
||||
emitEvent('willEditEntryFromList');
|
||||
push({
|
||||
pathname: `${pathname}/${id}`,
|
||||
state: { from: pathname },
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@ -159,6 +159,14 @@ const EditViewDataManagerProvider = ({
|
||||
console.log(err);
|
||||
const status = get(err, 'response.status', null);
|
||||
|
||||
// The record does not exists
|
||||
// Redirect the user to the previous page
|
||||
if (id && status === 404) {
|
||||
push(from);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (id && status === 403) {
|
||||
strapi.notification.info(getTrad('permissions.not-allowed.update'));
|
||||
|
||||
|
||||
@ -53,7 +53,7 @@ const HomePageSettings = ({
|
||||
placeholder={formatMessage({ id: getTrad('search.placeholder') })}
|
||||
name="_q"
|
||||
value={searchValue}
|
||||
autoFocus="true"
|
||||
autoFocus
|
||||
/>
|
||||
{isLoading ? (
|
||||
<>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user