mirror of
https://github.com/strapi/strapi.git
synced 2025-11-11 07:39:16 +00:00
Add page title to settings
Signed-off-by: soupette <cyril.lpz@gmail.com>
This commit is contained in:
parent
51756426a8
commit
5391bad7aa
@ -10,6 +10,7 @@ import { useHistory } from 'react-router-dom';
|
|||||||
import adminPermissions from '../../../../src/permissions';
|
import adminPermissions from '../../../../src/permissions';
|
||||||
import { useFetchPermissionsLayout } from '../../../../src/hooks';
|
import { useFetchPermissionsLayout } from '../../../../src/hooks';
|
||||||
import BaselineAlignement from '../../../../src/components/BaselineAlignement';
|
import BaselineAlignement from '../../../../src/components/BaselineAlignement';
|
||||||
|
import PageTitle from '../../../../src/components/SettingsPageTitle';
|
||||||
import ContainerFluid from '../../../../src/components/ContainerFluid';
|
import ContainerFluid from '../../../../src/components/ContainerFluid';
|
||||||
import FormCard from '../../../../src/components/FormBloc';
|
import FormCard from '../../../../src/components/FormBloc';
|
||||||
import { ButtonWithNumber, Permissions } from '../../../../src/components/Roles';
|
import { ButtonWithNumber, Permissions } from '../../../../src/components/Roles';
|
||||||
@ -93,6 +94,8 @@ const CreatePage = () => {
|
|||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<>
|
||||||
|
<PageTitle name="Roles" />
|
||||||
<Formik
|
<Formik
|
||||||
initialValues={{ name: '', description: '' }}
|
initialValues={{ name: '', description: '' }}
|
||||||
onSubmit={handleCreateRoleSubmit}
|
onSubmit={handleCreateRoleSubmit}
|
||||||
@ -164,6 +167,7 @@ const CreatePage = () => {
|
|||||||
</form>
|
</form>
|
||||||
)}
|
)}
|
||||||
</Formik>
|
</Formik>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -15,6 +15,7 @@ import {
|
|||||||
} from 'strapi-helper-plugin';
|
} from 'strapi-helper-plugin';
|
||||||
import { useIntl } from 'react-intl';
|
import { useIntl } from 'react-intl';
|
||||||
import adminPermissions from '../../../../src/permissions';
|
import adminPermissions from '../../../../src/permissions';
|
||||||
|
import PageTitle from '../../../../src/components/SettingsPageTitle';
|
||||||
import useSettingsHeaderSearchContext from '../../../../src/hooks/useSettingsHeaderSearchContext';
|
import useSettingsHeaderSearchContext from '../../../../src/hooks/useSettingsHeaderSearchContext';
|
||||||
import { EmptyRole, RoleListWrapper } from '../../../../src/components/Roles';
|
import { EmptyRole, RoleListWrapper } from '../../../../src/components/Roles';
|
||||||
import { useRolesList } from '../../../../src/hooks';
|
import { useRolesList } from '../../../../src/hooks';
|
||||||
@ -158,6 +159,7 @@ const RoleListPage = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<PageTitle name="Roles" />
|
||||||
<Header
|
<Header
|
||||||
title={{
|
title={{
|
||||||
label: formatMessage({
|
label: formatMessage({
|
||||||
|
|||||||
@ -0,0 +1,17 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { useIntl } from 'react-intl';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import PageTitle from '../PageTitle';
|
||||||
|
|
||||||
|
const SettingsPageTitle = ({ name }) => {
|
||||||
|
const { formatMessage } = useIntl();
|
||||||
|
const text = formatMessage({ id: 'Settings.PageTitle' }, { name });
|
||||||
|
|
||||||
|
return <PageTitle title={text} />;
|
||||||
|
};
|
||||||
|
|
||||||
|
SettingsPageTitle.propTypes = {
|
||||||
|
name: PropTypes.string.isRequired,
|
||||||
|
};
|
||||||
|
|
||||||
|
export default SettingsPageTitle;
|
||||||
@ -6,8 +6,8 @@ import { Header } from '@buffetjs/custom';
|
|||||||
import { Padded } from '@buffetjs/core';
|
import { Padded } from '@buffetjs/core';
|
||||||
import { Formik } from 'formik';
|
import { Formik } from 'formik';
|
||||||
import { useIntl } from 'react-intl';
|
import { useIntl } from 'react-intl';
|
||||||
|
|
||||||
import BaselineAlignement from '../../../components/BaselineAlignement';
|
import BaselineAlignement from '../../../components/BaselineAlignement';
|
||||||
|
import PageTitle from '../../../components/SettingsPageTitle';
|
||||||
import ContainerFluid from '../../../components/ContainerFluid';
|
import ContainerFluid from '../../../components/ContainerFluid';
|
||||||
import { Permissions, RoleForm } from '../../../components/Roles';
|
import { Permissions, RoleForm } from '../../../components/Roles';
|
||||||
import { useFetchRole, useFetchPermissionsLayout } from '../../../hooks';
|
import { useFetchRole, useFetchPermissionsLayout } from '../../../hooks';
|
||||||
@ -88,6 +88,8 @@ const EditPage = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<>
|
||||||
|
<PageTitle name="Roles" />
|
||||||
<Formik
|
<Formik
|
||||||
enableReinitialize
|
enableReinitialize
|
||||||
initialValues={{
|
initialValues={{
|
||||||
@ -129,6 +131,7 @@ const EditPage = () => {
|
|||||||
<Permissions
|
<Permissions
|
||||||
permissionsLayout={permissionsLayout}
|
permissionsLayout={permissionsLayout}
|
||||||
rolePermissions={rolePermissions}
|
rolePermissions={rolePermissions}
|
||||||
|
role={role}
|
||||||
ref={permissionsRef}
|
ref={permissionsRef}
|
||||||
/>
|
/>
|
||||||
</Padded>
|
</Padded>
|
||||||
@ -137,6 +140,7 @@ const EditPage = () => {
|
|||||||
</form>
|
</form>
|
||||||
)}
|
)}
|
||||||
</Formik>
|
</Formik>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import { useIntl } from 'react-intl';
|
|||||||
import { useHistory } from 'react-router-dom';
|
import { useHistory } from 'react-router-dom';
|
||||||
import { useGlobalContext, useQuery, useUserPermissions } from 'strapi-helper-plugin';
|
import { useGlobalContext, useQuery, useUserPermissions } from 'strapi-helper-plugin';
|
||||||
import adminPermissions from '../../../permissions';
|
import adminPermissions from '../../../permissions';
|
||||||
|
import PageTitle from '../../../components/SettingsPageTitle';
|
||||||
import { EmptyRole, RoleListWrapper, RoleRow } from '../../../components/Roles';
|
import { EmptyRole, RoleListWrapper, RoleRow } from '../../../components/Roles';
|
||||||
import { useRolesList, useSettingsHeaderSearchContext } from '../../../hooks';
|
import { useRolesList, useSettingsHeaderSearchContext } from '../../../hooks';
|
||||||
import BaselineAlignment from './BaselineAlignment';
|
import BaselineAlignment from './BaselineAlignment';
|
||||||
@ -36,6 +37,7 @@ const RoleListPage = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<PageTitle name="Roles" />
|
||||||
<Header
|
<Header
|
||||||
icon
|
icon
|
||||||
title={{
|
title={{
|
||||||
|
|||||||
@ -2,10 +2,12 @@ import React, { memo } from 'react';
|
|||||||
import { useGlobalContext } from 'strapi-helper-plugin';
|
import { useGlobalContext } from 'strapi-helper-plugin';
|
||||||
import { get } from 'lodash';
|
import { get } from 'lodash';
|
||||||
import { useParams } from 'react-router-dom';
|
import { useParams } from 'react-router-dom';
|
||||||
|
import PageTitle from '../../components/SettingsPageTitle';
|
||||||
|
|
||||||
const SettingDispatcher = () => {
|
const SettingDispatcher = () => {
|
||||||
const { plugins } = useGlobalContext();
|
const { plugins } = useGlobalContext();
|
||||||
const { pluginId } = useParams();
|
const { pluginId } = useParams();
|
||||||
|
console.log({ pluginId });
|
||||||
|
|
||||||
const pluginToRender = get(plugins, [pluginId, 'settings', 'mainComponent'], null);
|
const pluginToRender = get(plugins, [pluginId, 'settings', 'mainComponent'], null);
|
||||||
|
|
||||||
@ -15,7 +17,12 @@ const SettingDispatcher = () => {
|
|||||||
|
|
||||||
const Compo = pluginToRender;
|
const Compo = pluginToRender;
|
||||||
|
|
||||||
return <Compo settingsBaseURL="/settings" />;
|
return (
|
||||||
|
<>
|
||||||
|
<PageTitle name={pluginId} />
|
||||||
|
<Compo settingsBaseURL="/settings" />
|
||||||
|
</>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default memo(SettingDispatcher);
|
export default memo(SettingDispatcher);
|
||||||
|
|||||||
@ -17,12 +17,13 @@ import {
|
|||||||
LoadingIndicatorPage,
|
LoadingIndicatorPage,
|
||||||
} from 'strapi-helper-plugin';
|
} from 'strapi-helper-plugin';
|
||||||
import { Switch, Redirect, Route, useParams, useHistory } from 'react-router-dom';
|
import { Switch, Redirect, Route, useParams, useHistory } from 'react-router-dom';
|
||||||
|
import { useIntl } from 'react-intl';
|
||||||
import RolesCreatePage from 'ee_else_ce/containers/Roles/CreatePage';
|
import RolesCreatePage from 'ee_else_ce/containers/Roles/CreatePage';
|
||||||
import ProtectedRolesListPage from 'ee_else_ce/containers/Roles/ProtectedListPage';
|
import ProtectedRolesListPage from 'ee_else_ce/containers/Roles/ProtectedListPage';
|
||||||
// TODO remove this line when feature finished
|
// TODO remove this line when feature finished
|
||||||
// import ProtectedRolesListPage from '../Roles/ProtectedListPage';
|
// import ProtectedRolesListPage from '../Roles/ProtectedListPage';
|
||||||
import HeaderSearch from '../../components/HeaderSearch';
|
import HeaderSearch from '../../components/HeaderSearch';
|
||||||
|
import PageTitle from '../../components/PageTitle';
|
||||||
import { useSettingsMenu } from '../../hooks';
|
import { useSettingsMenu } from '../../hooks';
|
||||||
import { retrieveGlobalLinks } from '../../utils';
|
import { retrieveGlobalLinks } from '../../utils';
|
||||||
import SettingsSearchHeaderProvider from '../SettingsHeaderSearchContextProvider';
|
import SettingsSearchHeaderProvider from '../SettingsHeaderSearchContextProvider';
|
||||||
@ -49,6 +50,7 @@ function SettingsPage() {
|
|||||||
const { settingsBaseURL, plugins } = useGlobalContext();
|
const { settingsBaseURL, plugins } = useGlobalContext();
|
||||||
const [headerSearchState, setShowHeaderSearchState] = useState({ show: false, label: '' });
|
const [headerSearchState, setShowHeaderSearchState] = useState({ show: false, label: '' });
|
||||||
const { isLoading, menu } = useSettingsMenu();
|
const { isLoading, menu } = useSettingsMenu();
|
||||||
|
const { formatMessage } = useIntl();
|
||||||
const pluginsGlobalLinks = useMemo(() => retrieveGlobalLinks(plugins), [plugins]);
|
const pluginsGlobalLinks = useMemo(() => retrieveGlobalLinks(plugins), [plugins]);
|
||||||
const firstAvailableEndpoint = useMemo(() => {
|
const firstAvailableEndpoint = useMemo(() => {
|
||||||
// Don't need to compute while permissions are being checked
|
// Don't need to compute while permissions are being checked
|
||||||
@ -99,8 +101,11 @@ function SettingsPage() {
|
|||||||
return <Redirect to={firstAvailableEndpoint} />;
|
return <Redirect to={firstAvailableEndpoint} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const settingTitle = formatMessage({ id: 'app.components.LeftMenuLinkContainer.settings' });
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SettingsSearchHeaderProvider value={{ toggleHeaderSearch }}>
|
<SettingsSearchHeaderProvider value={{ toggleHeaderSearch }}>
|
||||||
|
<PageTitle title={settingTitle} />
|
||||||
<Wrapper>
|
<Wrapper>
|
||||||
<BackHeader onClick={goBack} />
|
<BackHeader onClick={goBack} />
|
||||||
|
|
||||||
|
|||||||
@ -5,8 +5,8 @@ import { get, isEmpty } from 'lodash';
|
|||||||
import { useGlobalContext, auth } from 'strapi-helper-plugin';
|
import { useGlobalContext, auth } from 'strapi-helper-plugin';
|
||||||
import { Col } from 'reactstrap';
|
import { Col } from 'reactstrap';
|
||||||
import { Padded } from '@buffetjs/core';
|
import { Padded } from '@buffetjs/core';
|
||||||
|
|
||||||
import BaselineAlignement from '../../../components/BaselineAlignement';
|
import BaselineAlignement from '../../../components/BaselineAlignement';
|
||||||
|
import PageTitle from '../../../components/SettingsPageTitle';
|
||||||
import ContainerFluid from '../../../components/ContainerFluid';
|
import ContainerFluid from '../../../components/ContainerFluid';
|
||||||
import FormBloc from '../../../components/FormBloc';
|
import FormBloc from '../../../components/FormBloc';
|
||||||
import SizedInput from '../../../components/SizedInput';
|
import SizedInput from '../../../components/SizedInput';
|
||||||
@ -59,6 +59,7 @@ const EditPage = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<PageTitle name="Users" />
|
||||||
<form onSubmit={handleSubmit}>
|
<form onSubmit={handleSubmit}>
|
||||||
<ContainerFluid padding="0">
|
<ContainerFluid padding="0">
|
||||||
<Header
|
<Header
|
||||||
|
|||||||
@ -11,6 +11,7 @@ import { get } from 'lodash';
|
|||||||
import { useHistory, useLocation } from 'react-router-dom';
|
import { useHistory, useLocation } from 'react-router-dom';
|
||||||
import { Flex, Padded } from '@buffetjs/core';
|
import { Flex, Padded } from '@buffetjs/core';
|
||||||
import BaselineAlignement from '../../../components/BaselineAlignement';
|
import BaselineAlignement from '../../../components/BaselineAlignement';
|
||||||
|
import PageTitle from '../../../components/SettingsPageTitle';
|
||||||
import { useSettingsHeaderSearchContext } from '../../../hooks';
|
import { useSettingsHeaderSearchContext } from '../../../hooks';
|
||||||
import { Footer, List, Filter, FilterPicker, SortPicker } from '../../../components/Users';
|
import { Footer, List, Filter, FilterPicker, SortPicker } from '../../../components/Users';
|
||||||
import adminPermissions from '../../../permissions';
|
import adminPermissions from '../../../permissions';
|
||||||
@ -243,6 +244,7 @@ const ListPage = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
<PageTitle name="Users" />
|
||||||
<Header
|
<Header
|
||||||
canCreate={canCreate}
|
canCreate={canCreate}
|
||||||
canDelete={canDelete}
|
canDelete={canDelete}
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import { get, isEmpty, isEqual, omit } from 'lodash';
|
|||||||
import { Header, Inputs as InputsIndex } from '@buffetjs/custom';
|
import { Header, Inputs as InputsIndex } from '@buffetjs/custom';
|
||||||
import { Play } from '@buffetjs/icons';
|
import { Play } from '@buffetjs/icons';
|
||||||
import { request, useGlobalContext, getYupInnerErrors, BackHeader } from 'strapi-helper-plugin';
|
import { request, useGlobalContext, getYupInnerErrors, BackHeader } from 'strapi-helper-plugin';
|
||||||
|
import PageTitle from '../../../components/SettingsPageTitle';
|
||||||
import { Inputs, TriggerContainer } from '../../../components/Webhooks';
|
import { Inputs, TriggerContainer } from '../../../components/Webhooks';
|
||||||
import reducer, { initialState } from './reducer';
|
import reducer, { initialState } from './reducer';
|
||||||
import { cleanData, form, schema } from './utils';
|
import { cleanData, form, schema } from './utils';
|
||||||
@ -346,6 +347,7 @@ function EditView() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Wrapper>
|
<Wrapper>
|
||||||
|
<PageTitle name="Webhooks" />
|
||||||
<BackHeader onClick={goBack} />
|
<BackHeader onClick={goBack} />
|
||||||
<form onSubmit={handleSubmit}>
|
<form onSubmit={handleSubmit}>
|
||||||
<Header {...headerProps} />
|
<Header {...headerProps} />
|
||||||
|
|||||||
@ -10,15 +10,16 @@ import { Header, List } from '@buffetjs/custom';
|
|||||||
import { Button } from '@buffetjs/core';
|
import { Button } from '@buffetjs/core';
|
||||||
import { Plus } from '@buffetjs/icons';
|
import { Plus } from '@buffetjs/icons';
|
||||||
import { omit } from 'lodash';
|
import { omit } from 'lodash';
|
||||||
|
import { useIntl } from 'react-intl';
|
||||||
import {
|
import {
|
||||||
request,
|
request,
|
||||||
useGlobalContext,
|
|
||||||
ListButton,
|
ListButton,
|
||||||
PopUpWarning,
|
PopUpWarning,
|
||||||
useUserPermissions,
|
useUserPermissions,
|
||||||
LoadingIndicatorPage,
|
LoadingIndicatorPage,
|
||||||
} from 'strapi-helper-plugin';
|
} from 'strapi-helper-plugin';
|
||||||
import adminPermissions from '../../../permissions';
|
import adminPermissions from '../../../permissions';
|
||||||
|
import PageTitle from '../../../components/SettingsPageTitle';
|
||||||
import { EmptyList, ListRow } from '../../../components/Webhooks';
|
import { EmptyList, ListRow } from '../../../components/Webhooks';
|
||||||
import Wrapper from './Wrapper';
|
import Wrapper from './Wrapper';
|
||||||
import reducer, { initialState } from './reducer';
|
import reducer, { initialState } from './reducer';
|
||||||
@ -30,7 +31,7 @@ function ListView() {
|
|||||||
} = useUserPermissions(adminPermissions.settings.webhooks);
|
} = useUserPermissions(adminPermissions.settings.webhooks);
|
||||||
|
|
||||||
const isMounted = useRef(true);
|
const isMounted = useRef(true);
|
||||||
const { formatMessage } = useGlobalContext();
|
const { formatMessage } = useIntl();
|
||||||
const [showModal, setShowModal] = useState(false);
|
const [showModal, setShowModal] = useState(false);
|
||||||
const [reducerState, dispatch] = useReducer(reducer, initialState);
|
const [reducerState, dispatch] = useReducer(reducer, initialState);
|
||||||
const { push } = useHistory();
|
const { push } = useHistory();
|
||||||
@ -260,6 +261,7 @@ function ListView() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Wrapper>
|
<Wrapper>
|
||||||
|
<PageTitle name="Webhooks" />
|
||||||
<Header {...headerProps} />
|
<Header {...headerProps} />
|
||||||
{canRead && (
|
{canRead && (
|
||||||
<div className="list-wrapper">
|
<div className="list-wrapper">
|
||||||
|
|||||||
@ -354,5 +354,6 @@
|
|||||||
"Roles.ListPage.notification.delete-all-not-allowed": "Some roles could not be deleted since they are associated with users",
|
"Roles.ListPage.notification.delete-all-not-allowed": "Some roles could not be deleted since they are associated with users",
|
||||||
"Roles.RoleRow.user-count.plural": "{number} users",
|
"Roles.RoleRow.user-count.plural": "{number} users",
|
||||||
"Roles.RoleRow.user-count.singular": "{number} user",
|
"Roles.RoleRow.user-count.singular": "{number} user",
|
||||||
"Roles.components.List.empty.withSearch": "There is no role corresponding to the search ({search})..."
|
"Roles.components.List.empty.withSearch": "There is no role corresponding to the search ({search})...",
|
||||||
|
"Settings.PageTitle": "Settings - {name}"
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user