mirror of
https://github.com/strapi/strapi.git
synced 2025-11-15 17:49:57 +00:00
Fixe baseline
Signed-off-by: soupette <cyril.lpz@gmail.com>
This commit is contained in:
parent
9bc700370c
commit
ac9e3a60d2
@ -22,8 +22,8 @@
|
|||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"categories": {
|
"categories": {
|
||||||
"collection": "category",
|
|
||||||
"via": "addresses",
|
"via": "addresses",
|
||||||
|
"collection": "category",
|
||||||
"dominant": true
|
"dominant": true
|
||||||
},
|
},
|
||||||
"cover": {
|
"cover": {
|
||||||
|
|||||||
@ -12,11 +12,11 @@
|
|||||||
},
|
},
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"name": {
|
"name": {
|
||||||
"type": "string"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"addresses": {
|
"addresses": {
|
||||||
"via": "categories",
|
"collection": "address",
|
||||||
"collection": "address"
|
"via": "categories"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
packages/strapi-admin/admin/src/assets/images/oops.png
Normal file
BIN
packages/strapi-admin/admin/src/assets/images/oops.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 42 KiB |
@ -1,11 +1,11 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Padded, Text } from '@buffetjs/core';
|
import { Flex, Padded, Text } from '@buffetjs/core';
|
||||||
import { LoadingIndicator, Row } from 'strapi-helper-plugin';
|
import { LoadingIndicator, Row } from 'strapi-helper-plugin';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import BaselineAlignement from '../BaselineAlignement';
|
import BaselineAlignement from '../BaselineAlignement';
|
||||||
import Bloc from '../Bloc';
|
import Bloc from '../Bloc';
|
||||||
|
|
||||||
const FormBloc = ({ children, isLoading, title }) => (
|
const FormBloc = ({ children, cta, isLoading, title, subtitle }) => (
|
||||||
<Bloc>
|
<Bloc>
|
||||||
<BaselineAlignement top size={title ? '18px' : '22px'} />
|
<BaselineAlignement top size={title ? '18px' : '22px'} />
|
||||||
<Padded left right size="sm">
|
<Padded left right size="sm">
|
||||||
@ -19,11 +19,19 @@ const FormBloc = ({ children, isLoading, title }) => (
|
|||||||
{title && (
|
{title && (
|
||||||
<>
|
<>
|
||||||
<Padded left right size="xs">
|
<Padded left right size="xs">
|
||||||
|
<Flex justifyContent="space-between">
|
||||||
<Padded left right size="sm">
|
<Padded left right size="sm">
|
||||||
<Text fontSize="lg" fontWeight="bold">
|
<Text fontSize="lg" fontWeight="bold">
|
||||||
{title}
|
{title}
|
||||||
</Text>
|
</Text>
|
||||||
|
{subtitle && (
|
||||||
|
<Text color="grey" lineHeight="1.8rem">
|
||||||
|
{subtitle}
|
||||||
|
</Text>
|
||||||
|
)}
|
||||||
</Padded>
|
</Padded>
|
||||||
|
{cta}
|
||||||
|
</Flex>
|
||||||
</Padded>
|
</Padded>
|
||||||
<BaselineAlignement top size="18px" />
|
<BaselineAlignement top size="18px" />
|
||||||
</>
|
</>
|
||||||
@ -36,13 +44,17 @@ const FormBloc = ({ children, isLoading, title }) => (
|
|||||||
);
|
);
|
||||||
|
|
||||||
FormBloc.defaultProps = {
|
FormBloc.defaultProps = {
|
||||||
|
cta: null,
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
|
subtitle: null,
|
||||||
title: null,
|
title: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
FormBloc.propTypes = {
|
FormBloc.propTypes = {
|
||||||
children: PropTypes.node.isRequired,
|
children: PropTypes.node.isRequired,
|
||||||
|
cta: PropTypes.any,
|
||||||
isLoading: PropTypes.bool,
|
isLoading: PropTypes.bool,
|
||||||
|
subtitle: PropTypes.string,
|
||||||
title: PropTypes.string,
|
title: PropTypes.string,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -1,17 +1,14 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { Text } from '@buffetjs/core';
|
import { Text } from '@buffetjs/core';
|
||||||
import BaselineAlignment from '../../../../components/BaselineAlignement';
|
|
||||||
import Wrapper from './Wrapper';
|
import Wrapper from './Wrapper';
|
||||||
|
|
||||||
const Box = ({ children, errorMessage }) => (
|
const Box = ({ children, errorMessage }) => (
|
||||||
<Wrapper>
|
<Wrapper>
|
||||||
<Text fontSize="md" color="#f64d0a" style={{ textAlign: 'center' }}>
|
<Text fontSize="md" color="#f64d0a" style={{ textAlign: 'center' }} lineHeight="18px">
|
||||||
{errorMessage}
|
{errorMessage}
|
||||||
</Text>
|
</Text>
|
||||||
<BaselineAlignment top size="2px">
|
|
||||||
{children}
|
{children}
|
||||||
</BaselineAlignment>
|
|
||||||
</Wrapper>
|
</Wrapper>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,7 @@ const Login = ({ formErrors, modifiedData, onChange, onSubmit, requestError }) =
|
|||||||
<Logo />
|
<Logo />
|
||||||
</Section>
|
</Section>
|
||||||
<Section withBackground>
|
<Section withBackground>
|
||||||
<BaselineAlignment top size="24px">
|
<BaselineAlignment top size="25px">
|
||||||
<Box errorMessage={get(requestError, 'errorMessage', null)}>
|
<Box errorMessage={get(requestError, 'errorMessage', null)}>
|
||||||
<form onSubmit={onSubmit}>
|
<form onSubmit={onSubmit}>
|
||||||
<Input
|
<Input
|
||||||
|
|||||||
@ -0,0 +1,7 @@
|
|||||||
|
import styled from 'styled-components';
|
||||||
|
|
||||||
|
const Img = styled.img`
|
||||||
|
max-height: 77px;
|
||||||
|
`;
|
||||||
|
|
||||||
|
export default Img;
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
import styled from 'styled-components';
|
||||||
|
import { Text as Base } from '@buffetjs/core';
|
||||||
|
|
||||||
|
const Text = styled(Base)`
|
||||||
|
font-size: 24px;
|
||||||
|
`;
|
||||||
|
|
||||||
|
export default Text;
|
||||||
@ -4,8 +4,11 @@ import { useHistory } from 'react-router-dom';
|
|||||||
import { useIntl } from 'react-intl';
|
import { useIntl } from 'react-intl';
|
||||||
import { useQuery } from 'strapi-helper-plugin';
|
import { useQuery } from 'strapi-helper-plugin';
|
||||||
import BaselineAlignment from '../../../../components/BaselineAlignement';
|
import BaselineAlignment from '../../../../components/BaselineAlignement';
|
||||||
|
import OopsLogo from '../../../../assets/images/oops.png';
|
||||||
import Logo from '../Logo';
|
import Logo from '../Logo';
|
||||||
import Section from '../Section';
|
import Section from '../Section';
|
||||||
|
import Img from './Img';
|
||||||
|
import CustomText from './Text';
|
||||||
|
|
||||||
const Oops = () => {
|
const Oops = () => {
|
||||||
const { push } = useHistory();
|
const { push } = useHistory();
|
||||||
@ -15,11 +18,7 @@ const Oops = () => {
|
|||||||
push('/auth/login');
|
push('/auth/login');
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: I am not sure about this login
|
|
||||||
// @alexandrebodin @JAB
|
|
||||||
const message = query.get('info') || formatMessage({ id: 'Auth.components.Oops.text' });
|
const message = query.get('info') || formatMessage({ id: 'Auth.components.Oops.text' });
|
||||||
// TODO add logo when available
|
|
||||||
// This component is temporary
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@ -27,15 +26,16 @@ const Oops = () => {
|
|||||||
<Logo />
|
<Logo />
|
||||||
</Section>
|
</Section>
|
||||||
<Section withBackground textAlign="center">
|
<Section withBackground textAlign="center">
|
||||||
<BaselineAlignment top size="168px">
|
<BaselineAlignment top size="60px">
|
||||||
<Text fontSize="lg" fontWeight="bold">
|
<Img src={OopsLogo} />
|
||||||
Oops...
|
<BaselineAlignment top size="26px">
|
||||||
</Text>
|
<CustomText fontWeight="bold">Oops...</CustomText>
|
||||||
</BaselineAlignment>
|
</BaselineAlignment>
|
||||||
<BaselineAlignment top size="18px">
|
|
||||||
<Text fontSize="md">{message}</Text>
|
|
||||||
</BaselineAlignment>
|
</BaselineAlignment>
|
||||||
<BaselineAlignment top size="50px">
|
<BaselineAlignment top size="14px">
|
||||||
|
<Text fontSize="lg">{message}</Text>
|
||||||
|
</BaselineAlignment>
|
||||||
|
<BaselineAlignment top size="48px">
|
||||||
<Button onClick={handleClick} type="button">
|
<Button onClick={handleClick} type="button">
|
||||||
{formatMessage({ id: 'Auth.form.button.go-home' })}
|
{formatMessage({ id: 'Auth.form.button.go-home' })}
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@ -51,7 +51,7 @@ const Register = ({
|
|||||||
<Logo />
|
<Logo />
|
||||||
</Section>
|
</Section>
|
||||||
<Section withBackground>
|
<Section withBackground>
|
||||||
<Padded top size="23px">
|
<Padded top size="25px">
|
||||||
<Box errorMessage={get(requestError, 'errorMessage', null)}>
|
<Box errorMessage={get(requestError, 'errorMessage', null)}>
|
||||||
<form onSubmit={onSubmit}>
|
<form onSubmit={onSubmit}>
|
||||||
<InputWrapper>
|
<InputWrapper>
|
||||||
|
|||||||
@ -204,6 +204,11 @@ const AuthPage = ({ hasAdmin }) => {
|
|||||||
return <Redirect to="/" />;
|
return <Redirect to="/" />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Redirect the user to the login page if there is already an admin user
|
||||||
|
if (hasAdmin && authType === 'register-admin') {
|
||||||
|
return <Redirect to="/" />;
|
||||||
|
}
|
||||||
|
|
||||||
// Redirect the user to the register-admin if it is the first user
|
// Redirect the user to the register-admin if it is the first user
|
||||||
if (!hasAdmin && authType !== 'register-admin') {
|
if (!hasAdmin && authType !== 'register-admin') {
|
||||||
return <Redirect to="/auth/register-admin" />;
|
return <Redirect to="/auth/register-admin" />;
|
||||||
@ -220,7 +225,7 @@ const AuthPage = ({ hasAdmin }) => {
|
|||||||
<NavTopRightWrapper>
|
<NavTopRightWrapper>
|
||||||
<LocaleToggle isLogged className="localeDropdownMenuNotLogged" />
|
<LocaleToggle isLogged className="localeDropdownMenuNotLogged" />
|
||||||
</NavTopRightWrapper>
|
</NavTopRightWrapper>
|
||||||
<BaselineAlignment top size="80px">
|
<BaselineAlignment top size="78px">
|
||||||
<Component
|
<Component
|
||||||
fieldsToDisable={fieldsToDisable}
|
fieldsToDisable={fieldsToDisable}
|
||||||
formErrors={formErrors}
|
formErrors={formErrors}
|
||||||
|
|||||||
@ -10,7 +10,9 @@ const ButtonWithNumber = ({ number, onClick }) => (
|
|||||||
<Flex justifyContent="space-between" alignItems="center">
|
<Flex justifyContent="space-between" alignItems="center">
|
||||||
<FontAwesomeIcon icon="users" />
|
<FontAwesomeIcon icon="users" />
|
||||||
<Padded left size="xs" />
|
<Padded left size="xs" />
|
||||||
<Text color="white">Users with this role</Text>
|
<Text color="white" fontWeight="semiBold">
|
||||||
|
Users with this role
|
||||||
|
</Text>
|
||||||
<Padded left size="xs" />
|
<Padded left size="xs" />
|
||||||
<NumberCard>
|
<NumberCard>
|
||||||
<Text fontSize="xs" fontWeight="bold" color="mediumBlue">
|
<Text fontSize="xs" fontWeight="bold" color="mediumBlue">
|
||||||
|
|||||||
@ -1,10 +0,0 @@
|
|||||||
import styled from 'styled-components';
|
|
||||||
|
|
||||||
const FormCard = styled.div`
|
|
||||||
padding: 2.5rem;
|
|
||||||
background-color: ${({ theme }) => theme.main.colors.white};
|
|
||||||
border-radius: ${({ theme }) => theme.main.sizes.borderRadius};
|
|
||||||
box-shadow: ${({ theme }) => `0 2px 4px 0 ${theme.main.colors.darkGrey}`};
|
|
||||||
`;
|
|
||||||
|
|
||||||
export default FormCard;
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
import styled from 'styled-components';
|
|
||||||
|
|
||||||
const InputWrapper = styled.div`
|
|
||||||
width: 100%;
|
|
||||||
`;
|
|
||||||
|
|
||||||
export default InputWrapper;
|
|
||||||
@ -1,13 +1,10 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Header, Inputs } from '@buffetjs/custom';
|
import { Header } from '@buffetjs/custom';
|
||||||
import { Text, Flex, Padded } from '@buffetjs/core';
|
|
||||||
import { Formik } from 'formik';
|
import { Formik } from 'formik';
|
||||||
import { useIntl } from 'react-intl';
|
import { useIntl } from 'react-intl';
|
||||||
|
import BaselineAlignement from '../../../components/BaselineAlignement';
|
||||||
import FormCard from './FormCard';
|
import ContainerFluid from '../../../components/ContainerFluid';
|
||||||
import ButtonWithNumber from './ButtonWithNumber';
|
import FormCard from '../../../components/FormBloc';
|
||||||
import InputWrapper from './InputWrapper';
|
|
||||||
import schema from './utils/schema';
|
|
||||||
import {
|
import {
|
||||||
Tabs,
|
Tabs,
|
||||||
CollectionTypesPermissions,
|
CollectionTypesPermissions,
|
||||||
@ -15,6 +12,9 @@ import {
|
|||||||
PluginsPermissions,
|
PluginsPermissions,
|
||||||
SettingsPermissions,
|
SettingsPermissions,
|
||||||
} from '../../../components/Roles';
|
} from '../../../components/Roles';
|
||||||
|
import SizedInput from '../../../components/SizedInput';
|
||||||
|
import ButtonWithNumber from './ButtonWithNumber';
|
||||||
|
import schema from './utils/schema';
|
||||||
|
|
||||||
const CreatePage = () => {
|
const CreatePage = () => {
|
||||||
const { formatMessage } = useIntl();
|
const { formatMessage } = useIntl();
|
||||||
@ -34,7 +34,7 @@ const CreatePage = () => {
|
|||||||
}),
|
}),
|
||||||
onClick: handleSubmit,
|
onClick: handleSubmit,
|
||||||
color: 'success',
|
color: 'success',
|
||||||
type: 'button',
|
type: 'submit',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -46,6 +46,14 @@ const CreatePage = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const cta = (
|
||||||
|
<ButtonWithNumber number={0} onClick={() => console.log('Open user modal')}>
|
||||||
|
{formatMessage({
|
||||||
|
id: 'Settings.roles.form.button.users-with-role',
|
||||||
|
})}
|
||||||
|
</ButtonWithNumber>
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Formik
|
<Formik
|
||||||
initialValues={{ name: '', description: '' }}
|
initialValues={{ name: '', description: '' }}
|
||||||
@ -53,7 +61,8 @@ const CreatePage = () => {
|
|||||||
validationSchema={schema}
|
validationSchema={schema}
|
||||||
>
|
>
|
||||||
{({ handleSubmit, values, errors, handleReset, handleChange, handleBlur }) => (
|
{({ handleSubmit, values, errors, handleReset, handleChange, handleBlur }) => (
|
||||||
<>
|
<form onSubmit={handleSubmit}>
|
||||||
|
<ContainerFluid padding="0">
|
||||||
<Header
|
<Header
|
||||||
title={{
|
title={{
|
||||||
label: formatMessage({
|
label: formatMessage({
|
||||||
@ -65,64 +74,48 @@ const CreatePage = () => {
|
|||||||
})}
|
})}
|
||||||
actions={headerActions(handleSubmit, handleReset)}
|
actions={headerActions(handleSubmit, handleReset)}
|
||||||
/>
|
/>
|
||||||
<FormCard>
|
<BaselineAlignement top size="3px" />
|
||||||
<Padded bottom size="sm">
|
<FormCard
|
||||||
<Flex justifyContent="space-between">
|
title={formatMessage({
|
||||||
<div>
|
|
||||||
<Text fontSize="lg" fontWeight="bold" lineHeight="1.8rem">
|
|
||||||
{formatMessage({
|
|
||||||
id: 'Settings.roles.form.title',
|
id: 'Settings.roles.form.title',
|
||||||
})}
|
})}
|
||||||
</Text>
|
subtitle={formatMessage({
|
||||||
<Text color="grey">
|
|
||||||
{formatMessage({
|
|
||||||
id: 'Settings.roles.form.description',
|
id: 'Settings.roles.form.description',
|
||||||
})}
|
})}
|
||||||
</Text>
|
cta={cta}
|
||||||
</div>
|
>
|
||||||
<ButtonWithNumber number={0} onClick={() => console.log('Open user modal')}>
|
<SizedInput
|
||||||
{formatMessage({
|
|
||||||
id: 'Settings.roles.form.button.users-with-role',
|
|
||||||
})}
|
|
||||||
</ButtonWithNumber>
|
|
||||||
</Flex>
|
|
||||||
</Padded>
|
|
||||||
<Padded top size="sm" />
|
|
||||||
<Flex justifyContent="space-between">
|
|
||||||
<InputWrapper>
|
|
||||||
<Inputs
|
|
||||||
label="Name"
|
label="Name"
|
||||||
name="name"
|
name="name"
|
||||||
type="text"
|
type="text"
|
||||||
error={errors.name ? formatMessage({ id: errors.name }) : null}
|
error={errors.name ? { id: errors.name } : null}
|
||||||
onBlur={handleBlur}
|
onBlur={handleBlur}
|
||||||
value={values.name}
|
value={values.name}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
/>
|
/>
|
||||||
</InputWrapper>
|
|
||||||
<Padded left size="md" />
|
<SizedInput
|
||||||
<InputWrapper>
|
|
||||||
<Inputs
|
|
||||||
label="Description"
|
label="Description"
|
||||||
name="description"
|
name="description"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
onBlur={handleBlur}
|
onBlur={handleBlur}
|
||||||
value={values.description}
|
value={values.description}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
|
// Override the default height of the textarea
|
||||||
|
style={{ height: 115 }}
|
||||||
/>
|
/>
|
||||||
</InputWrapper>
|
|
||||||
</Flex>
|
|
||||||
</FormCard>
|
</FormCard>
|
||||||
<Padded top size="md" />
|
|
||||||
<Padded top size="xs">
|
<BaselineAlignement top size="30px">
|
||||||
<Tabs tabsLabel={['Collection Types', 'Single Types', 'Plugins', 'Settings']}>
|
<Tabs tabsLabel={['Collection Types', 'Single Types', 'Plugins', 'Settings']}>
|
||||||
<CollectionTypesPermissions />
|
<CollectionTypesPermissions />
|
||||||
<SingleTypesPermissions />
|
<SingleTypesPermissions />
|
||||||
<PluginsPermissions />
|
<PluginsPermissions />
|
||||||
<SettingsPermissions />
|
<SettingsPermissions />
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</Padded>
|
</BaselineAlignement>
|
||||||
</>
|
</ContainerFluid>
|
||||||
|
</form>
|
||||||
)}
|
)}
|
||||||
</Formik>
|
</Formik>
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user