mirror of
https://github.com/strapi/strapi.git
synced 2025-12-27 15:13:21 +00:00
Fix admin helmet
Signed-off-by: soupette <cyril@strapi.io>
This commit is contained in:
parent
f957ddd933
commit
e091680e98
@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import { Helmet } from 'react-helmet';
|
||||
import { Switch, Route, useRouteMatch, Redirect, useLocation } from 'react-router-dom';
|
||||
import { CheckPagePermissions, LoadingIndicatorPage, NotFound } from '@strapi/helper-plugin';
|
||||
import { Layout, HeaderLayout } from '@strapi/design-system/Layout';
|
||||
@ -90,4 +91,17 @@ const App = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export default App;
|
||||
export { App };
|
||||
|
||||
export default () => {
|
||||
const { formatMessage } = useIntl();
|
||||
|
||||
return (
|
||||
<>
|
||||
<Helmet
|
||||
title={formatMessage({ id: getTrad('plugin.name'), defaultMessage: 'Content Manager' })}
|
||||
/>
|
||||
<App />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
@ -9,7 +9,7 @@ import { HTML5Backend } from 'react-dnd-html5-backend';
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { IntlProvider } from 'react-intl';
|
||||
import Theme from '../../../../components/Theme';
|
||||
import ContentManagerApp from '..';
|
||||
import { App as ContentManagerApp } from '..';
|
||||
import cmReducers from '../../../../reducers';
|
||||
import useModels from '../useModels';
|
||||
|
||||
|
||||
@ -23,7 +23,6 @@ import { Stack } from '@strapi/design-system/Stack';
|
||||
import { Divider } from '@strapi/design-system/Divider';
|
||||
import ArrowLeft from '@strapi/icons/ArrowLeft';
|
||||
import Check from '@strapi/icons/Check';
|
||||
import { Helmet } from 'react-helmet';
|
||||
import { getTrad } from '../../utils';
|
||||
import reducer, { initialState } from './reducer';
|
||||
import init from './init';
|
||||
@ -220,15 +219,6 @@ const EditSettingsView = ({ mainLayout, components, isContentTypeView, slug, upd
|
||||
setIsDraggingSibling={setIsDraggingSibling}
|
||||
>
|
||||
<Main>
|
||||
<Helmet
|
||||
title={formatMessage(
|
||||
{
|
||||
id: getTrad('components.SettingsViewWrapper.pluginHeader.title'),
|
||||
defaultMessage: `Configure the view - ${upperFirst(modelName)}`,
|
||||
},
|
||||
{ name: upperFirst(modelName) }
|
||||
)}
|
||||
/>
|
||||
<form onSubmit={handleSubmit}>
|
||||
<HeaderLayout
|
||||
title={formatMessage(
|
||||
|
||||
@ -1,12 +1,20 @@
|
||||
import React from 'react';
|
||||
import { CheckPagePermissions } from '@strapi/helper-plugin';
|
||||
|
||||
import { Helmet } from 'react-helmet';
|
||||
import { useIntl } from 'react-intl';
|
||||
import adminPermissions from '../../permissions';
|
||||
import Plugins from './Plugins';
|
||||
|
||||
const InstalledPluginsPage = () => {
|
||||
const { formatMessage } = useIntl();
|
||||
const title = formatMessage({
|
||||
id: 'app.components.ListPluginsPage.title',
|
||||
defaultMessage: 'Plugins',
|
||||
});
|
||||
|
||||
return (
|
||||
<CheckPagePermissions permissions={adminPermissions.marketplace.main}>
|
||||
<Helmet title={title} />
|
||||
<Plugins />
|
||||
</CheckPagePermissions>
|
||||
);
|
||||
|
||||
@ -6,6 +6,8 @@
|
||||
|
||||
import React, { Suspense, lazy } from 'react';
|
||||
import { Switch, Route } from 'react-router-dom';
|
||||
import { Helmet } from 'react-helmet';
|
||||
import { useIntl } from 'react-intl';
|
||||
import { LoadingIndicatorPage, CheckPagePermissions } from '@strapi/helper-plugin';
|
||||
import { Layout } from '@strapi/design-system/Layout';
|
||||
import pluginPermissions from '../../permissions';
|
||||
@ -19,8 +21,15 @@ import ContentTypeBuilderNav from '../../components/ContentTypeBuilderNav';
|
||||
const ListView = lazy(() => import('../ListView'));
|
||||
|
||||
const App = () => {
|
||||
const { formatMessage } = useIntl();
|
||||
const title = formatMessage({
|
||||
id: `${pluginId}.plugin.name`,
|
||||
defaultMessage: 'Content Types Builder',
|
||||
});
|
||||
|
||||
return (
|
||||
<CheckPagePermissions permissions={pluginPermissions.main}>
|
||||
<Helmet title={title} />
|
||||
<FormModalNavigationProvider>
|
||||
<DataManagerProvider allIcons={icons}>
|
||||
<Layout sideNav={<ContentTypeBuilderNav />}>
|
||||
|
||||
@ -1,9 +1,14 @@
|
||||
import React, { useEffect } from 'react';
|
||||
import { Helmet } from 'react-helmet';
|
||||
import { useIntl } from 'react-intl';
|
||||
import { useQueryParams } from '@strapi/helper-plugin';
|
||||
import { getTrad } from '../../utils';
|
||||
import { MediaLibrary } from './MediaLibrary';
|
||||
|
||||
const App = () => {
|
||||
const [{ rawQuery }, setQuery] = useQueryParams();
|
||||
const { formatMessage } = useIntl();
|
||||
const title = formatMessage({ id: getTrad('plugin.name'), defaultMessage: 'Media Library' });
|
||||
|
||||
useEffect(() => {
|
||||
if (!rawQuery) {
|
||||
@ -11,7 +16,16 @@ const App = () => {
|
||||
}
|
||||
}, [rawQuery, setQuery]);
|
||||
|
||||
return rawQuery ? <MediaLibrary /> : null;
|
||||
if (rawQuery) {
|
||||
return (
|
||||
<>
|
||||
<Helmet title={title} />
|
||||
<MediaLibrary />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
export default App;
|
||||
|
||||
@ -15,6 +15,7 @@ import {
|
||||
EmptyStateLayout,
|
||||
useFocusWhenNavigate,
|
||||
} from '@strapi/helper-plugin';
|
||||
import { Helmet } from 'react-helmet';
|
||||
import { Button } from '@strapi/design-system/Button';
|
||||
import { Layout, HeaderLayout, ContentLayout } from '@strapi/design-system/Layout';
|
||||
import { Main } from '@strapi/design-system/Main';
|
||||
@ -68,14 +69,17 @@ const PluginPage = () => {
|
||||
setShowConfirmDelete(!showConfirmDelete);
|
||||
};
|
||||
|
||||
const title = formatMessage({
|
||||
id: getTrad('plugin.name'),
|
||||
defaultMessage: 'Documentation',
|
||||
});
|
||||
|
||||
return (
|
||||
<Layout>
|
||||
<Main>
|
||||
<Helmet title={title} />
|
||||
<Main aria-busy={isLoading}>
|
||||
<HeaderLayout
|
||||
title={formatMessage({
|
||||
id: getTrad('plugin.name'),
|
||||
defaultMessage: 'Documentation',
|
||||
})}
|
||||
title={title}
|
||||
subtitle={formatMessage({
|
||||
id: getTrad('pages.PluginPage.header.description'),
|
||||
defaultMessage: 'Configure the documentation plugin',
|
||||
|
||||
@ -525,6 +525,7 @@ describe('Plugin | Documentation | PluginPage', () => {
|
||||
class="c1 c2"
|
||||
>
|
||||
<main
|
||||
aria-busy="false"
|
||||
aria-labelledby="main-content-title"
|
||||
class="c3"
|
||||
id="main-content"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user