fix: several UI issues a typos

This commit is contained in:
Alexandre Bodin 2024-06-24 19:49:08 +02:00
parent 105cdbf182
commit 6529e2bd50
6 changed files with 36 additions and 38 deletions

View File

@ -286,6 +286,7 @@ const EventsRow = ({
{events.map((event) => { {events.map((event) => {
return ( return (
<Td key={event} textAlign="center"> <Td key={event} textAlign="center">
<Flex width="100%" justifyContent="center">
<Checkbox <Checkbox
disabled={disabledEvents.includes(event)} disabled={disabledEvents.includes(event)}
aria-label={event} aria-label={event}
@ -293,6 +294,7 @@ const EventsRow = ({
checked={inputValue.includes(event)} checked={inputValue.includes(event)}
onCheckedChange={(value) => handleSelect(event, !!value)} onCheckedChange={(value) => handleSelect(event, !!value)}
/> />
</Flex>
</Td> </Td>
); );
})} })}

View File

@ -13,10 +13,15 @@ import {
} from '@strapi/design-system'; } from '@strapi/design-system';
import { Minus, Plus } from '@strapi/icons'; import { Minus, Plus } from '@strapi/icons';
import { useIntl } from 'react-intl'; import { useIntl } from 'react-intl';
import { styled } from 'styled-components';
import { useField, useForm } from '../../../../../components/Form'; import { useField, useForm } from '../../../../../components/Form';
import { StringInput } from '../../../../../components/FormInputs/String'; import { StringInput } from '../../../../../components/FormInputs/String';
const AddHeaderButton = styled(TextButton)`
cursor: pointer;
`;
/* ------------------------------------------------------------------------------------------------- /* -------------------------------------------------------------------------------------------------
* HeadersInput * HeadersInput
* -----------------------------------------------------------------------------------------------*/ * -----------------------------------------------------------------------------------------------*/
@ -44,7 +49,7 @@ const HeadersInput = () => {
<Box padding={8} background="neutral100" hasRadius> <Box padding={8} background="neutral100" hasRadius>
{value.map((_, index) => { {value.map((_, index) => {
return ( return (
<Grid.Root key={index} gap={4}> <Grid.Root key={index} gap={4} padding={2}>
<Grid.Item col={6}> <Grid.Item col={6}>
<HeaderCombobox <HeaderCombobox
name={`headers.${index}.key`} name={`headers.${index}.key`}
@ -92,8 +97,11 @@ const HeadersInput = () => {
</Flex> </Flex>
</Flex> </Flex>
</Grid.Item> </Grid.Item>
<Grid.Item col={12}> </Grid.Root>
<TextButton );
})}
<Box paddingTop={4}>
<AddHeaderButton
type="button" type="button"
onClick={() => { onClick={() => {
addFieldRow('headers', { key: '', value: '' }); addFieldRow('headers', { key: '', value: '' });
@ -104,11 +112,8 @@ const HeadersInput = () => {
id: 'Settings.webhooks.create.header', id: 'Settings.webhooks.create.header',
defaultMessage: 'Create new header', defaultMessage: 'Create new header',
})} })}
</TextButton> </AddHeaderButton>
</Grid.Item> </Box>
</Grid.Root>
);
})}
</Box> </Box>
</Flex> </Flex>
); );

View File

@ -72,14 +72,6 @@ const ListPage = () => {
// In this case, the passed parameter cannot and shouldn't be something else than User // In this case, the passed parameter cannot and shouldn't be something else than User
cellFormatter: ({ user }) => (user ? user.displayName : ''), cellFormatter: ({ user }) => (user ? user.displayName : ''),
}, },
{
name: 'actions',
label: formatMessage({
id: 'Settings.permissions.auditLogs.actions',
defaultMessage: 'Actions',
}),
sortable: false,
},
]; ];
if (hasError) { if (hasError) {
@ -170,8 +162,6 @@ const ListPage = () => {
</Typography> </Typography>
</Table.Cell> </Table.Cell>
); );
case 'actions':
return null;
default: default:
return ( return (
<Table.Cell key={name}> <Table.Cell key={name}>
@ -202,8 +192,9 @@ const ListPage = () => {
</Table.Body> </Table.Body>
</Table.Content> </Table.Content>
</Table.Root> </Table.Root>
<Pagination.Root {...auditLogs?.pagination} defaultPageSize={24}>
<Pagination.PageSize options={['12', '24', '50', '100']} /> <Pagination.Root {...auditLogs?.pagination}>
<Pagination.PageSize />
<Pagination.Links /> <Pagination.Links />
</Pagination.Root> </Pagination.Root>
</Layouts.Content> </Layouts.Content>

View File

@ -1,7 +1,7 @@
import React, { useCallback, useMemo } from 'react'; import React, { useCallback, useMemo } from 'react';
import { Box, Checkbox, Flex, Typography, Grid, VisuallyHidden } from '@strapi/design-system'; import { Box, Checkbox, Flex, Typography, Grid, VisuallyHidden } from '@strapi/design-system';
import { Cog as CogIcon } from '@strapi/icons'; import { Cog } from '@strapi/icons';
import get from 'lodash/get'; import get from 'lodash/get';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { useIntl } from 'react-intl'; import { useIntl } from 'react-intl';
@ -103,7 +103,7 @@ const SubCategory = ({ subCategory }) => {
} }
)} )}
</VisuallyHidden> </VisuallyHidden>
<CogIcon id="cog" /> <Cog id="cog" />
</button> </button>
</CheckboxWrapper> </CheckboxWrapper>
</Grid.Item> </Grid.Item>

View File

@ -63,7 +63,7 @@ export const ProvidersPage = () => {
const submitMutation = useMutation((body) => put('/users-permissions/providers', body), { const submitMutation = useMutation((body) => put('/users-permissions/providers', body), {
async onSuccess() { async onSuccess() {
await queryClient.invalidateQueries(['users-permissions', 'providers']); await queryClient.invalidateQueries(['users-permissions', 'get-providers']);
toggleNotification({ toggleNotification({
type: 'success', type: 'success',

View File

@ -13,7 +13,7 @@ const EditLink = styled(Link)`
width: 3.2rem; width: 3.2rem;
display: flex; display: flex;
justify-content: center; justify-content: center;
padding: ${({ theme }) => `${theme.spaces[2]}}`}; padding: ${({ theme }) => `${theme.spaces[2]}`};
svg { svg {
height: 1.6rem; height: 1.6rem;