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