Merge pull request #9863 from strapi/i18n/fix-rbac-ui

Fix RBAC UI
This commit is contained in:
cyril lopez 2021-03-30 10:22:39 +02:00 committed by GitHub
commit c7852fb5e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 22 additions and 15 deletions

View File

@ -5,6 +5,7 @@ const Tab = styled.div`
flex: 1; flex: 1;
padding: 1rem; padding: 1rem;
text-align: center; text-align: center;
${({ isActive, theme }) => ${({ isActive, theme }) =>
isActive isActive
? { ? {

View File

@ -1,9 +1,17 @@
import styled from 'styled-components'; import styled from 'styled-components';
import Tab from './Tab';
const TabsWrapper = styled.div` const TabsWrapper = styled.div`
display: block; display: block;
border-radius: ${({ theme }) => theme.main.sizes.borderRadius}; border-radius: ${({ theme }) => theme.main.sizes.borderRadius};
box-shadow: ${({ theme }) => `0px 2px 4px 0px ${theme.main.colors.darkGrey}`}; box-shadow: ${({ theme }) => `0px 2px 4px 0px ${theme.main.colors.darkGrey}`};
${Tab}:first-of-type {
border-top-left-radius: ${({ theme }) => theme.main.sizes.borderRadius};
}
${Tab}:last-of-type {
border-top-right-radius: ${({ theme }) => theme.main.sizes.borderRadius};
}
`; `;
export default TabsWrapper; export default TabsWrapper;

View File

@ -7,6 +7,7 @@ import PropTypes from 'prop-types';
const Wrapper = styled(Flex)` const Wrapper = styled(Flex)`
height: 100%; height: 100%;
width: 32px; width: 32px;
justify-content: space-around;
background: #fafafb; background: #fafafb;
> svg { > svg {
align-self: center; align-self: center;

View File

@ -1,20 +1,10 @@
import React from 'react'; import React from 'react';
import ReactSelect, { components } from 'react-select'; import ReactSelect from 'react-select';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import Carret from '../Carret';
import { useTheme } from 'styled-components'; import { useTheme } from 'styled-components';
import DropdownIndicator from './DropdownIndicator';
import getStyles from './styles'; import getStyles from './styles';
export const DropdownIndicator = props => {
const theme = useTheme();
return (
<components.DropdownIndicator {...props}>
<Carret fill={theme.main.colors.grey} />
</components.DropdownIndicator>
);
};
export const Select = ({ children, onChange, selectedValue, ...props }) => { export const Select = ({ children, onChange, selectedValue, ...props }) => {
const theme = useTheme(); const theme = useTheme();
const selectStyles = getStyles(theme); const selectStyles = getStyles(theme);

View File

@ -28,6 +28,8 @@ export { default as InputAddon } from './components/InputAddon';
export { default as EmptyState } from './components/EmptyState'; export { default as EmptyState } from './components/EmptyState';
export * from './components/Tabs'; export * from './components/Tabs';
export * from './components/Select'; export * from './components/Select';
export { default as DropdownIndicator } from './components/Select/DropdownIndicator';
export * from './components/InjectionZone'; export * from './components/InjectionZone';
export { default as InputAddonWithErrors } from './components/InputAddonWithErrors'; export { default as InputAddonWithErrors } from './components/InputAddonWithErrors';

View File

@ -56,6 +56,11 @@
"@buffetjs/icons": "3.3.5-next.1", "@buffetjs/icons": "3.3.5-next.1",
"@buffetjs/styles": "3.3.5-next.1", "@buffetjs/styles": "3.3.5-next.1",
"@buffetjs/utils": "3.3.5-next.1", "@buffetjs/utils": "3.3.5-next.1",
"@fortawesome/fontawesome-free": "^5.15.2",
"@fortawesome/fontawesome-svg-core": "^1.2.35",
"@fortawesome/free-brands-svg-icons": "^5.15.2",
"@fortawesome/free-solid-svg-icons": "^5.15.3",
"@fortawesome/react-fontawesome": "^0.1.14",
"bootstrap": "^4.6.0", "bootstrap": "^4.6.0",
"classnames": "^2.2.5", "classnames": "^2.2.5",
"immutable": "^3.8.2", "immutable": "^3.8.2",

View File

@ -4,6 +4,7 @@ import { FormattedMessage, useIntl } from 'react-intl';
import { Link, useLocation } from 'react-router-dom'; import { Link, useLocation } from 'react-router-dom';
import { findIndex, get, isArray, isEmpty, set } from 'lodash'; import { findIndex, get, isArray, isEmpty, set } from 'lodash';
import { import {
DropdownIndicator,
LabelIconWrapper, LabelIconWrapper,
NotAllowedInput, NotAllowedInput,
request, request,
@ -16,7 +17,6 @@ import pluginId from '../../pluginId';
import SelectOne from '../SelectOne'; import SelectOne from '../SelectOne';
import SelectMany from '../SelectMany'; import SelectMany from '../SelectMany';
import ClearIndicator from './ClearIndicator'; import ClearIndicator from './ClearIndicator';
import DropdownIndicator from './DropdownIndicator';
import IndicatorSeparator from './IndicatorSeparator'; import IndicatorSeparator from './IndicatorSeparator';
import Option from './Option'; import Option from './Option';
import { A, BaselineAlignment } from './components'; import { A, BaselineAlignment } from './components';

View File

@ -8,9 +8,9 @@ import { useTheme } from 'styled-components';
import { useIntl } from 'react-intl'; import { useIntl } from 'react-intl';
import { import {
BaselineAlignment, BaselineAlignment,
DropdownIndicator,
ModalConfirm, ModalConfirm,
selectStyles, selectStyles,
DropdownIndicator,
useContentManagerEditViewDataManager, useContentManagerEditViewDataManager,
request, request,
} from 'strapi-helper-plugin'; } from 'strapi-helper-plugin';

View File

@ -5,7 +5,7 @@ import get from 'lodash/get';
import Select, { components } from 'react-select'; import Select, { components } from 'react-select';
import { useIntl } from 'react-intl'; import { useIntl } from 'react-intl';
import { useTheme } from 'styled-components'; import { useTheme } from 'styled-components';
import { BaselineAlignment, selectStyles, DropdownIndicator } from 'strapi-helper-plugin'; import { DropdownIndicator, BaselineAlignment, selectStyles } from 'strapi-helper-plugin';
import { useHistory } from 'react-router-dom'; import { useHistory } from 'react-router-dom';
import { stringify } from 'qs'; import { stringify } from 'qs';
import { getTrad } from '../../utils'; import { getTrad } from '../../utils';