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