mirror of
https://github.com/strapi/strapi.git
synced 2025-09-21 14:31:16 +00:00
Fix Role edit alignment (Permission's list)
Signed-off-by: HichamELBSI <elabbassih@gmail.com>
This commit is contained in:
parent
9480a906be
commit
a2a31ce8df
@ -1,12 +1,12 @@
|
|||||||
import React, { useMemo } from 'react';
|
import React, { useMemo } from 'react';
|
||||||
import { Flex, Text } from '@buffetjs/core';
|
import { Flex, Text } from '@buffetjs/core';
|
||||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||||
|
import { PermissionsWrapper, RowContainer } from 'strapi-helper-plugin';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useIntl } from 'react-intl';
|
import { useIntl } from 'react-intl';
|
||||||
import SubCategory from 'ee_else_ce/components/Roles/Permissions/PluginsAndSettingsPermissions/PermissionRow/SubCategory';
|
import SubCategory from 'ee_else_ce/components/Roles/Permissions/PluginsAndSettingsPermissions/PermissionRow/SubCategory';
|
||||||
|
|
||||||
import RowStyle from './RowStyle';
|
import RowStyle from './RowStyle';
|
||||||
import PermissionsWrapper from './PermissionsWrapper';
|
|
||||||
|
|
||||||
const PermissionRow = ({
|
const PermissionRow = ({
|
||||||
openedCategory,
|
openedCategory,
|
||||||
@ -24,7 +24,7 @@ const PermissionRow = ({
|
|||||||
}, [permissions]);
|
}, [permissions]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<RowContainer isWhite={isWhite}>
|
||||||
<RowStyle
|
<RowStyle
|
||||||
isWhite={isWhite}
|
isWhite={isWhite}
|
||||||
isActive={openedCategory === permissions.category}
|
isActive={openedCategory === permissions.category}
|
||||||
@ -47,13 +47,13 @@ const PermissionRow = ({
|
|||||||
</Flex>
|
</Flex>
|
||||||
</RowStyle>
|
</RowStyle>
|
||||||
{openedCategory === permissions.category && (
|
{openedCategory === permissions.category && (
|
||||||
<PermissionsWrapper>
|
<PermissionsWrapper isWhite={isWhite}>
|
||||||
{permissions.subCategories.map(subCategory => (
|
{permissions.subCategories.map(subCategory => (
|
||||||
<SubCategory key={subCategory.subCategory} subCategory={subCategory} />
|
<SubCategory key={subCategory.subCategory} subCategory={subCategory} />
|
||||||
))}
|
))}
|
||||||
</PermissionsWrapper>
|
</PermissionsWrapper>
|
||||||
)}
|
)}
|
||||||
</>
|
</RowContainer>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
|
|
||||||
|
// TODO : @HichamELBSI This need to be updated when lists are standardized
|
||||||
const PermissionsWrapper = styled.div`
|
const PermissionsWrapper = styled.div`
|
||||||
padding: 2.5rem 3rem 1rem 3rem;
|
padding: ${({ isWhite }) => (isWhite ? '1.6rem 3rem 1rem 3rem' : '2.5rem 3rem 1rem 3rem')};
|
||||||
border: 1px solid ${({ theme }) => theme.main.colors.darkBlue};
|
border: 1px solid ${({ theme }) => theme.main.colors.darkBlue};
|
||||||
border-top: none;
|
border-top: none;
|
||||||
background-color: ${({ theme }) => theme.main.colors.white};
|
background-color: ${({ theme }) => theme.main.colors.white};
|
@ -0,0 +1,8 @@
|
|||||||
|
import styled from 'styled-components';
|
||||||
|
|
||||||
|
// TODO : @HichamELBSI This need to be updated when lists are standardized
|
||||||
|
const RowContainer = styled.div`
|
||||||
|
margin: ${({ isWhite }) => isWhite && '9px 0px'};
|
||||||
|
`;
|
||||||
|
|
||||||
|
export default RowContainer;
|
@ -0,0 +1,2 @@
|
|||||||
|
export { default as RowContainer } from './RowContainer';
|
||||||
|
export { default as PermissionsWrapper } from './PermissionsWrapper';
|
@ -85,6 +85,7 @@ export { default as SettingsPageTitle } from './components/SettingsPageTitle';
|
|||||||
export { default as FormBloc } from './components/FormBloc';
|
export { default as FormBloc } from './components/FormBloc';
|
||||||
export { default as IntlInput } from './components/IntlInput';
|
export { default as IntlInput } from './components/IntlInput';
|
||||||
export { default as SizedInput } from './components/SizedInput';
|
export { default as SizedInput } from './components/SizedInput';
|
||||||
|
export * from './components/Permissions';
|
||||||
|
|
||||||
// PopUpWarning
|
// PopUpWarning
|
||||||
export { default as PopUpWarningBody } from './components/PopUpWarning/Body';
|
export { default as PopUpWarningBody } from './components/PopUpWarning/Body';
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
import styled from 'styled-components';
|
|
||||||
|
|
||||||
const PermissionsWrapper = styled.div`
|
|
||||||
padding: 2.5rem 3rem 1rem 3rem;
|
|
||||||
border: 1px solid ${({ theme }) => theme.main.colors.darkBlue};
|
|
||||||
border-top: none;
|
|
||||||
background-color: ${({ theme }) => theme.main.colors.white};
|
|
||||||
`;
|
|
||||||
|
|
||||||
export default PermissionsWrapper;
|
|
@ -4,10 +4,11 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useIntl } from 'react-intl';
|
import { useIntl } from 'react-intl';
|
||||||
import { sortBy } from 'lodash';
|
import { sortBy } from 'lodash';
|
||||||
|
import { PermissionsWrapper, RowContainer } from 'strapi-helper-plugin';
|
||||||
|
|
||||||
import getTrad from '../../../utils/getTrad';
|
import getTrad from '../../../utils/getTrad';
|
||||||
import SubCategory from './SubCategory';
|
import SubCategory from './SubCategory';
|
||||||
import RowStyle from './RowStyle';
|
import RowStyle from './RowStyle';
|
||||||
import PermissionsWrapper from './PermissionsWrapper';
|
|
||||||
|
|
||||||
const PermissionRow = ({ isOpen, isWhite, name, onOpenPlugin, permissions }) => {
|
const PermissionRow = ({ isOpen, isWhite, name, onOpenPlugin, permissions }) => {
|
||||||
const { formatMessage } = useIntl();
|
const { formatMessage } = useIntl();
|
||||||
@ -49,7 +50,7 @@ const PermissionRow = ({ isOpen, isWhite, name, onOpenPlugin, permissions }) =>
|
|||||||
}, [isOpen, name, permissions]);
|
}, [isOpen, name, permissions]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<RowContainer isWhite={isWhite}>
|
||||||
<RowStyle isActive={isOpen} isWhite={isWhite} onClick={onOpenPlugin}>
|
<RowStyle isActive={isOpen} isWhite={isWhite} onClick={onOpenPlugin}>
|
||||||
<Flex alignItems="center" justifyContent="space-between">
|
<Flex alignItems="center" justifyContent="space-between">
|
||||||
<div>
|
<div>
|
||||||
@ -70,13 +71,13 @@ const PermissionRow = ({ isOpen, isWhite, name, onOpenPlugin, permissions }) =>
|
|||||||
</Flex>
|
</Flex>
|
||||||
</RowStyle>
|
</RowStyle>
|
||||||
{isOpen && (
|
{isOpen && (
|
||||||
<PermissionsWrapper>
|
<PermissionsWrapper isWhite={isWhite}>
|
||||||
{subCategories.map(subCategory => (
|
{subCategories.map(subCategory => (
|
||||||
<SubCategory key={subCategory.name} subCategory={subCategory} />
|
<SubCategory key={subCategory.name} subCategory={subCategory} />
|
||||||
))}
|
))}
|
||||||
</PermissionsWrapper>
|
</PermissionsWrapper>
|
||||||
)}
|
)}
|
||||||
</>
|
</RowContainer>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user