mirror of
https://github.com/strapi/strapi.git
synced 2025-11-03 11:25:17 +00:00
feedback fixes: conditional logo, refactor Stack, canSubmit, test naming
This commit is contained in:
parent
c335d3d1ee
commit
4e52ca13a3
@ -11,7 +11,7 @@ const Logo = () => {
|
|||||||
logos: { auth },
|
logos: { auth },
|
||||||
} = useConfigurations();
|
} = useConfigurations();
|
||||||
|
|
||||||
return <Img src={auth.custom} aria-hidden alt="" />;
|
return <Img src={auth?.custom ?? auth.default} aria-hidden alt="" />;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Logo;
|
export default Logo;
|
||||||
|
|||||||
@ -14,7 +14,7 @@ const render = (props) =>
|
|||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
);
|
);
|
||||||
|
|
||||||
describe('ApplicationInfosPage', () => {
|
describe('ApplicationInfosPage | AddLogoDialog', () => {
|
||||||
it('shoud render from computer tab and match snapshot', () => {
|
it('shoud render from computer tab and match snapshot', () => {
|
||||||
const { container, getByText } = render();
|
const { container, getByText } = render();
|
||||||
|
|
||||||
|
|||||||
@ -39,6 +39,7 @@ const ApplicationInfosPage = () => {
|
|||||||
const {
|
const {
|
||||||
allowedActions: { canRead, canUpdate },
|
allowedActions: { canRead, canUpdate },
|
||||||
} = useRBAC(adminPermissions.settings['project-settings']);
|
} = useRBAC(adminPermissions.settings['project-settings']);
|
||||||
|
const canSubmit = canRead && canUpdate;
|
||||||
|
|
||||||
const { data } = useQuery('project-settings', fetchProjectSettings);
|
const { data } = useQuery('project-settings', fetchProjectSettings);
|
||||||
|
|
||||||
@ -92,7 +93,7 @@ const ApplicationInfosPage = () => {
|
|||||||
<Layout>
|
<Layout>
|
||||||
<SettingsPageTitle name="Application" />
|
<SettingsPageTitle name="Application" />
|
||||||
<Main>
|
<Main>
|
||||||
<form onSubmit={handleSubmit}>
|
<form onSubmit={canSubmit && handleSubmit}>
|
||||||
<HeaderLayout
|
<HeaderLayout
|
||||||
title={formatMessage({ id: 'Settings.application.title', defaultMessage: 'Overview' })}
|
title={formatMessage({ id: 'Settings.application.title', defaultMessage: 'Overview' })}
|
||||||
subtitle={formatMessage({
|
subtitle={formatMessage({
|
||||||
@ -100,16 +101,17 @@ const ApplicationInfosPage = () => {
|
|||||||
defaultMessage: 'Administration panel’s global information',
|
defaultMessage: 'Administration panel’s global information',
|
||||||
})}
|
})}
|
||||||
primaryAction={
|
primaryAction={
|
||||||
canRead && canUpdate ? (
|
canSubmit && (
|
||||||
<Button type="submit" startIcon={<Check />}>
|
<Button type="submit" startIcon={<Check />}>
|
||||||
{formatMessage({ id: 'global.save', defaultMessage: 'Save' })}
|
{formatMessage({ id: 'global.save', defaultMessage: 'Save' })}
|
||||||
</Button>
|
</Button>
|
||||||
) : null
|
)
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<ContentLayout>
|
<ContentLayout>
|
||||||
<Stack spacing={6}>
|
<Stack spacing={6}>
|
||||||
<Box
|
<Stack
|
||||||
|
spacing={5}
|
||||||
hasRadius
|
hasRadius
|
||||||
background="neutral0"
|
background="neutral0"
|
||||||
shadow="tableShadow"
|
shadow="tableShadow"
|
||||||
@ -118,7 +120,6 @@ const ApplicationInfosPage = () => {
|
|||||||
paddingRight={7}
|
paddingRight={7}
|
||||||
paddingLeft={7}
|
paddingLeft={7}
|
||||||
>
|
>
|
||||||
<Stack spacing={5}>
|
|
||||||
<Typography variant="delta" as="h3">
|
<Typography variant="delta" as="h3">
|
||||||
{formatMessage({
|
{formatMessage({
|
||||||
id: 'global.details',
|
id: 'global.details',
|
||||||
@ -207,7 +208,6 @@ const ApplicationInfosPage = () => {
|
|||||||
<Typography as="p">{appInfos.nodeVersion}</Typography>
|
<Typography as="p">{appInfos.nodeVersion}</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Box>
|
|
||||||
{canRead && data && (
|
{canRead && data && (
|
||||||
<Form canUpdate={canUpdate} ref={inputsRef} projectSettingsStored={data} />
|
<Form canUpdate={canUpdate} ref={inputsRef} projectSettingsStored={data} />
|
||||||
)}
|
)}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user