mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-28 17:55:15 +02:00
Refactor: page container (#967)
* refactor: page container * refactor: table page header
This commit is contained in:
parent
cd37624de4
commit
44c579f7a8
@ -15,7 +15,7 @@ import { IAddon, IAddonProvider } from 'interfaces/addons';
|
|||||||
import { AddonParameters } from './AddonParameters/AddonParameters';
|
import { AddonParameters } from './AddonParameters/AddonParameters';
|
||||||
import { AddonEvents } from './AddonEvents/AddonEvents';
|
import { AddonEvents } from './AddonEvents/AddonEvents';
|
||||||
import cloneDeep from 'lodash.clonedeep';
|
import cloneDeep from 'lodash.clonedeep';
|
||||||
import PageContent from 'component/common/PageContent/PageContent';
|
import { PageContent } from 'component/common/PageContent/PageContent';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
import useAddonsApi from 'hooks/api/actions/useAddonsApi/useAddonsApi';
|
import useAddonsApi from 'hooks/api/actions/useAddonsApi/useAddonsApi';
|
||||||
import useToast from 'hooks/useToast';
|
import useToast from 'hooks/useToast';
|
||||||
@ -184,7 +184,7 @@ export const AddonForm: VFC<IAddonFormProps> = ({
|
|||||||
} = provider ? provider : ({} as Partial<IAddonProvider>);
|
} = provider ? provider : ({} as Partial<IAddonProvider>);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PageContent headerContent={`Configure ${name} addon`}>
|
<PageContent header={`Configure ${name} addon`}>
|
||||||
<section className={styles.formSection}>
|
<section className={styles.formSection}>
|
||||||
{description}
|
{description}
|
||||||
<a href={documentationUrl} target="_blank" rel="noreferrer">
|
<a href={documentationUrl} target="_blank" rel="noreferrer">
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { ReactElement } from 'react';
|
import { ReactElement } from 'react';
|
||||||
import PageContent from 'component/common/PageContent/PageContent';
|
import { PageContent } from 'component/common/PageContent/PageContent';
|
||||||
import {
|
import {
|
||||||
List,
|
List,
|
||||||
ListItem,
|
ListItem,
|
||||||
@ -49,7 +49,7 @@ export const AvailableAddons = ({
|
|||||||
</ListItem>
|
</ListItem>
|
||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
<PageContent headerContent="Available addons">
|
<PageContent header="Available addons">
|
||||||
<List>
|
<List>
|
||||||
{providers.map((provider: IProvider) =>
|
{providers.map((provider: IProvider) =>
|
||||||
renderProvider(provider)
|
renderProvider(provider)
|
||||||
|
@ -12,7 +12,7 @@ import {
|
|||||||
UPDATE_ADDON,
|
UPDATE_ADDON,
|
||||||
} from 'component/providers/AccessProvider/permissions';
|
} from 'component/providers/AccessProvider/permissions';
|
||||||
import { Link, useNavigate } from 'react-router-dom';
|
import { Link, useNavigate } from 'react-router-dom';
|
||||||
import PageContent from 'component/common/PageContent/PageContent';
|
import { PageContent } from 'component/common/PageContent/PageContent';
|
||||||
import useAddons from 'hooks/api/getters/useAddons/useAddons';
|
import useAddons from 'hooks/api/getters/useAddons/useAddons';
|
||||||
import useToast from 'hooks/useToast';
|
import useToast from 'hooks/useToast';
|
||||||
import useAddonsApi from 'hooks/api/actions/useAddonsApi/useAddonsApi';
|
import useAddonsApi from 'hooks/api/actions/useAddonsApi/useAddonsApi';
|
||||||
@ -142,7 +142,7 @@ export const ConfiguredAddons = ({ getAddonIcon }: IConfigureAddonsProps) => {
|
|||||||
</ListItem>
|
</ListItem>
|
||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
<PageContent headerContent="Configured addons">
|
<PageContent header="Configured addons">
|
||||||
<List>
|
<List>
|
||||||
{sortAddons(addons).map((addon: IAddon) => renderAddon(addon))}
|
{sortAddons(addons).map((addon: IAddon) => renderAddon(addon))}
|
||||||
</List>
|
</List>
|
||||||
|
@ -3,8 +3,8 @@ import { useNavigate } from 'react-router-dom';
|
|||||||
import { Button } from '@mui/material';
|
import { Button } from '@mui/material';
|
||||||
import AccessContext from 'contexts/AccessContext';
|
import AccessContext from 'contexts/AccessContext';
|
||||||
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
|
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
|
||||||
import PageContent from 'component/common/PageContent';
|
import { PageContent } from 'component/common/PageContent/PageContent';
|
||||||
import { HeaderTitle } from 'component/common/HeaderTitle/HeaderTitle';
|
import { PageHeader } from 'component/common/PageHeader/PageHeader';
|
||||||
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
||||||
import {
|
import {
|
||||||
CREATE_API_TOKEN,
|
CREATE_API_TOKEN,
|
||||||
@ -24,8 +24,8 @@ export const ApiTokenPage = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<PageContent
|
<PageContent
|
||||||
headerContent={
|
header={
|
||||||
<HeaderTitle
|
<PageHeader
|
||||||
title="API Access"
|
title="API Access"
|
||||||
actions={
|
actions={
|
||||||
<ConditionallyRender
|
<ConditionallyRender
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import AdminMenu from '../menu/AdminMenu';
|
import AdminMenu from '../menu/AdminMenu';
|
||||||
import { Alert } from '@mui/material';
|
import { Alert } from '@mui/material';
|
||||||
import PageContent from 'component/common/PageContent/PageContent';
|
import { PageContent } from 'component/common/PageContent/PageContent';
|
||||||
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
||||||
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
|
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
|
||||||
import { OidcAuth } from './OidcAuth/OidcAuth';
|
import { OidcAuth } from './OidcAuth/OidcAuth';
|
||||||
@ -35,7 +35,7 @@ export const AuthSettings = () => {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<AdminMenu />
|
<AdminMenu />
|
||||||
<PageContent headerContent="Single Sign-On">
|
<PageContent header="Single Sign-On">
|
||||||
<ConditionallyRender
|
<ConditionallyRender
|
||||||
condition={authenticationType === 'enterprise'}
|
condition={authenticationType === 'enterprise'}
|
||||||
show={<TabNav tabData={tabs} />}
|
show={<TabNav tabData={tabs} />}
|
||||||
|
@ -7,7 +7,7 @@ import {
|
|||||||
TextField,
|
TextField,
|
||||||
} from '@mui/material';
|
} from '@mui/material';
|
||||||
import { Alert } from '@mui/material';
|
import { Alert } from '@mui/material';
|
||||||
import PageContent from 'component/common/PageContent/PageContent';
|
import { PageContent } from 'component/common/PageContent/PageContent';
|
||||||
import AccessContext from 'contexts/AccessContext';
|
import AccessContext from 'contexts/AccessContext';
|
||||||
import { ADMIN } from 'component/providers/AccessProvider/permissions';
|
import { ADMIN } from 'component/providers/AccessProvider/permissions';
|
||||||
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
|
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
|
||||||
@ -74,7 +74,7 @@ export const GoogleAuth = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PageContent headerContent="">
|
<PageContent>
|
||||||
<Grid container style={{ marginBottom: '1rem' }}>
|
<Grid container style={{ marginBottom: '1rem' }}>
|
||||||
<Grid item xs={12}>
|
<Grid item xs={12}>
|
||||||
<Alert severity="info">
|
<Alert severity="info">
|
||||||
|
@ -7,7 +7,7 @@ import {
|
|||||||
TextField,
|
TextField,
|
||||||
} from '@mui/material';
|
} from '@mui/material';
|
||||||
import { Alert } from '@mui/material';
|
import { Alert } from '@mui/material';
|
||||||
import PageContent from 'component/common/PageContent/PageContent';
|
import { PageContent } from 'component/common/PageContent/PageContent';
|
||||||
import AccessContext from 'contexts/AccessContext';
|
import AccessContext from 'contexts/AccessContext';
|
||||||
import { ADMIN } from 'component/providers/AccessProvider/permissions';
|
import { ADMIN } from 'component/providers/AccessProvider/permissions';
|
||||||
import { AutoCreateForm } from '../AutoCreateForm/AutoCreateForm';
|
import { AutoCreateForm } from '../AutoCreateForm/AutoCreateForm';
|
||||||
@ -85,7 +85,7 @@ export const OidcAuth = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PageContent headerContent="">
|
<PageContent>
|
||||||
<Grid container style={{ marginBottom: '1rem' }}>
|
<Grid container style={{ marginBottom: '1rem' }}>
|
||||||
<Grid item md={12}>
|
<Grid item md={12}>
|
||||||
<Alert severity="info">
|
<Alert severity="info">
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React, { useContext, useEffect, useState } from 'react';
|
import React, { useContext, useEffect, useState } from 'react';
|
||||||
import { Button, FormControlLabel, Grid, Switch } from '@mui/material';
|
import { Button, FormControlLabel, Grid, Switch } from '@mui/material';
|
||||||
import { Alert } from '@mui/material';
|
import { Alert } from '@mui/material';
|
||||||
import PageContent from 'component/common/PageContent/PageContent';
|
import { PageContent } from 'component/common/PageContent/PageContent';
|
||||||
import AccessContext from 'contexts/AccessContext';
|
import AccessContext from 'contexts/AccessContext';
|
||||||
import { ADMIN } from 'component/providers/AccessProvider/permissions';
|
import { ADMIN } from 'component/providers/AccessProvider/permissions';
|
||||||
import useAuthSettings from 'hooks/api/getters/useAuthSettings/useAuthSettings';
|
import useAuthSettings from 'hooks/api/getters/useAuthSettings/useAuthSettings';
|
||||||
@ -57,7 +57,7 @@ export const PasswordAuth = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<PageContent headerContent="">
|
<PageContent>
|
||||||
<form onSubmit={onSubmit}>
|
<form onSubmit={onSubmit}>
|
||||||
<Grid container spacing={3} mb={2}>
|
<Grid container spacing={3} mb={2}>
|
||||||
<Grid item md={5}>
|
<Grid item md={5}>
|
||||||
|
@ -7,7 +7,7 @@ import {
|
|||||||
TextField,
|
TextField,
|
||||||
} from '@mui/material';
|
} from '@mui/material';
|
||||||
import { Alert } from '@mui/material';
|
import { Alert } from '@mui/material';
|
||||||
import PageContent from 'component/common/PageContent/PageContent';
|
import { PageContent } from 'component/common/PageContent/PageContent';
|
||||||
import AccessContext from 'contexts/AccessContext';
|
import AccessContext from 'contexts/AccessContext';
|
||||||
import { ADMIN } from 'component/providers/AccessProvider/permissions';
|
import { ADMIN } from 'component/providers/AccessProvider/permissions';
|
||||||
import { AutoCreateForm } from '../AutoCreateForm/AutoCreateForm';
|
import { AutoCreateForm } from '../AutoCreateForm/AutoCreateForm';
|
||||||
@ -81,7 +81,7 @@ export const SamlAuth = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PageContent headerContent="">
|
<PageContent>
|
||||||
<Grid container style={{ marginBottom: '1rem' }}>
|
<Grid container style={{ marginBottom: '1rem' }}>
|
||||||
<Grid item md={12}>
|
<Grid item md={12}>
|
||||||
<Alert severity="info">
|
<Alert severity="info">
|
||||||
|
@ -8,8 +8,8 @@ import {
|
|||||||
Button,
|
Button,
|
||||||
} from '@mui/material';
|
} from '@mui/material';
|
||||||
import OpenInNew from '@mui/icons-material/OpenInNew';
|
import OpenInNew from '@mui/icons-material/OpenInNew';
|
||||||
import PageContent from 'component/common/PageContent';
|
import { PageContent } from 'component/common/PageContent/PageContent';
|
||||||
import { HeaderTitle } from 'component/common/HeaderTitle/HeaderTitle';
|
import { PageHeader } from 'component/common/PageHeader/PageHeader';
|
||||||
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
||||||
import { formatApiPath } from 'utils/formatPath';
|
import { formatApiPath } from 'utils/formatPath';
|
||||||
import useInvoices from 'hooks/api/getters/useInvoices/useInvoices';
|
import useInvoices from 'hooks/api/getters/useInvoices/useInvoices';
|
||||||
@ -35,8 +35,8 @@ const InvoiceList = () => {
|
|||||||
condition={invoices.length > 0}
|
condition={invoices.length > 0}
|
||||||
show={
|
show={
|
||||||
<PageContent
|
<PageContent
|
||||||
headerContent={
|
header={
|
||||||
<HeaderTitle
|
<PageHeader
|
||||||
title="Invoices"
|
title="Invoices"
|
||||||
actions={
|
actions={
|
||||||
<Button
|
<Button
|
||||||
|
@ -3,8 +3,8 @@ import { useContext } from 'react';
|
|||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
import AccessContext from 'contexts/AccessContext';
|
import AccessContext from 'contexts/AccessContext';
|
||||||
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
||||||
import { HeaderTitle } from 'component/common/HeaderTitle/HeaderTitle';
|
import { PageHeader } from 'component/common/PageHeader/PageHeader';
|
||||||
import PageContent from 'component/common/PageContent';
|
import { PageContent } from 'component/common/PageContent/PageContent';
|
||||||
import { ADMIN } from 'component/providers/AccessProvider/permissions';
|
import { ADMIN } from 'component/providers/AccessProvider/permissions';
|
||||||
import AdminMenu from 'component/admin/menu/AdminMenu';
|
import AdminMenu from 'component/admin/menu/AdminMenu';
|
||||||
import { useStyles } from './ProjectRoles.styles';
|
import { useStyles } from './ProjectRoles.styles';
|
||||||
@ -21,8 +21,8 @@ const ProjectRoles = () => {
|
|||||||
<AdminMenu />
|
<AdminMenu />
|
||||||
<PageContent
|
<PageContent
|
||||||
bodyClass={styles.rolesListBody}
|
bodyClass={styles.rolesListBody}
|
||||||
headerContent={
|
header={
|
||||||
<HeaderTitle
|
<PageHeader
|
||||||
title="Project Roles"
|
title="Project Roles"
|
||||||
actions={
|
actions={
|
||||||
<ConditionallyRender
|
<ConditionallyRender
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import { useContext, useState } from 'react';
|
import { useContext, useState } from 'react';
|
||||||
import UsersList from './UsersList/UsersList';
|
import UsersList from './UsersList/UsersList';
|
||||||
import AdminMenu from '../menu/AdminMenu';
|
import AdminMenu from '../menu/AdminMenu';
|
||||||
import PageContent from 'component/common/PageContent/PageContent';
|
import { PageContent } from 'component/common/PageContent/PageContent';
|
||||||
import AccessContext from 'contexts/AccessContext';
|
import AccessContext from 'contexts/AccessContext';
|
||||||
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
||||||
import { ADMIN } from 'component/providers/AccessProvider/permissions';
|
import { ADMIN } from 'component/providers/AccessProvider/permissions';
|
||||||
import { Button } from '@mui/material';
|
import { Button } from '@mui/material';
|
||||||
import { TableActions } from 'component/common/Table/TableActions/TableActions';
|
import { TableActions } from 'component/common/Table/TableActions/TableActions';
|
||||||
import { HeaderTitle } from 'component/common/HeaderTitle/HeaderTitle';
|
import { PageHeader } from 'component/common/PageHeader/PageHeader';
|
||||||
import { useStyles } from './UserAdmin.styles';
|
import { useStyles } from './UserAdmin.styles';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
import { AdminAlert } from 'component/common/AdminAlert/AdminAlert';
|
import { AdminAlert } from 'component/common/AdminAlert/AdminAlert';
|
||||||
@ -23,8 +23,8 @@ const UsersAdmin = () => {
|
|||||||
<AdminMenu />
|
<AdminMenu />
|
||||||
<PageContent
|
<PageContent
|
||||||
bodyClass={styles.userListBody}
|
bodyClass={styles.userListBody}
|
||||||
headerContent={
|
header={
|
||||||
<HeaderTitle
|
<PageHeader
|
||||||
title="Users"
|
title="Users"
|
||||||
actions={
|
actions={
|
||||||
<ConditionallyRender
|
<ConditionallyRender
|
||||||
|
@ -15,8 +15,8 @@ import { ApplicationView } from '../ApplicationView/ApplicationView';
|
|||||||
import { ApplicationUpdate } from '../ApplicationUpdate/ApplicationUpdate';
|
import { ApplicationUpdate } from '../ApplicationUpdate/ApplicationUpdate';
|
||||||
import { TabNav } from 'component/common/TabNav/TabNav/TabNav';
|
import { TabNav } from 'component/common/TabNav/TabNav/TabNav';
|
||||||
import { Dialogue } from 'component/common/Dialogue/Dialogue';
|
import { Dialogue } from 'component/common/Dialogue/Dialogue';
|
||||||
import PageContent from 'component/common/PageContent';
|
import { PageContent } from 'component/common/PageContent/PageContent';
|
||||||
import { HeaderTitle } from 'component/common/HeaderTitle/HeaderTitle';
|
import { PageHeader } from 'component/common/PageHeader/PageHeader';
|
||||||
import AccessContext from 'contexts/AccessContext';
|
import AccessContext from 'contexts/AccessContext';
|
||||||
import useApplicationsApi from 'hooks/api/actions/useApplicationsApi/useApplicationsApi';
|
import useApplicationsApi from 'hooks/api/actions/useApplicationsApi/useApplicationsApi';
|
||||||
import useApplication from 'hooks/api/getters/useApplication/useApplication';
|
import useApplication from 'hooks/api/getters/useApplication/useApplication';
|
||||||
@ -92,8 +92,8 @@ export const ApplicationEdit = () => {
|
|||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<PageContent
|
<PageContent
|
||||||
headerContent={
|
header={
|
||||||
<HeaderTitle
|
<PageHeader
|
||||||
titleElement={
|
titleElement={
|
||||||
<span
|
<span
|
||||||
style={{
|
style={{
|
||||||
|
@ -3,8 +3,8 @@ import { CircularProgress } from '@mui/material';
|
|||||||
import { Warning } from '@mui/icons-material';
|
import { Warning } from '@mui/icons-material';
|
||||||
import { AppsLinkList, styles as themeStyles } from 'component/common';
|
import { AppsLinkList, styles as themeStyles } from 'component/common';
|
||||||
import { SearchField } from 'component/common/SearchField/SearchField';
|
import { SearchField } from 'component/common/SearchField/SearchField';
|
||||||
import PageContent from 'component/common/PageContent/PageContent';
|
import { PageContent } from 'component/common/PageContent/PageContent';
|
||||||
import { HeaderTitle } from 'component/common/HeaderTitle/HeaderTitle';
|
import { PageHeader } from 'component/common/PageHeader/PageHeader';
|
||||||
import useApplications from 'hooks/api/getters/useApplications/useApplications';
|
import useApplications from 'hooks/api/getters/useApplications/useApplications';
|
||||||
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
||||||
|
|
||||||
@ -47,7 +47,7 @@ export const ApplicationList = () => {
|
|||||||
<div className={themeStyles.searchField}>
|
<div className={themeStyles.searchField}>
|
||||||
<SearchField initialValue={filter} updateValue={setFilter} />
|
<SearchField initialValue={filter} updateValue={setFilter} />
|
||||||
</div>
|
</div>
|
||||||
<PageContent headerContent={<HeaderTitle title="Applications" />}>
|
<PageContent header={<PageHeader title="Applications" />}>
|
||||||
<div className={themeStyles.fullwidth}>
|
<div className={themeStyles.fullwidth}>
|
||||||
<ConditionallyRender
|
<ConditionallyRender
|
||||||
condition={filteredApplications.length > 0}
|
condition={filteredApplications.length > 0}
|
||||||
|
@ -1,52 +0,0 @@
|
|||||||
import { ReactNode, VFC } from 'react';
|
|
||||||
import classnames from 'classnames';
|
|
||||||
|
|
||||||
import { Typography, TypographyProps } from '@mui/material';
|
|
||||||
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
|
||||||
|
|
||||||
import { useStyles } from './styles';
|
|
||||||
import { usePageTitle } from 'hooks/usePageTitle';
|
|
||||||
|
|
||||||
interface IHeaderTitleProps {
|
|
||||||
title: string;
|
|
||||||
titleElement?: ReactNode;
|
|
||||||
subtitle?: string;
|
|
||||||
variant?: TypographyProps['variant'];
|
|
||||||
loading?: boolean;
|
|
||||||
actions?: ReactNode;
|
|
||||||
className?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const HeaderTitle: VFC<IHeaderTitleProps> = ({
|
|
||||||
title,
|
|
||||||
titleElement,
|
|
||||||
actions,
|
|
||||||
subtitle,
|
|
||||||
variant,
|
|
||||||
loading,
|
|
||||||
className = '',
|
|
||||||
}) => {
|
|
||||||
const { classes: styles } = useStyles();
|
|
||||||
const headerClasses = classnames({ skeleton: loading });
|
|
||||||
|
|
||||||
usePageTitle(title);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className={styles.headerTitleContainer}>
|
|
||||||
<div className={headerClasses} data-loading>
|
|
||||||
<Typography
|
|
||||||
variant={variant || 'h1'}
|
|
||||||
className={classnames(styles.headerTitle, className)}
|
|
||||||
>
|
|
||||||
{titleElement || title}
|
|
||||||
</Typography>
|
|
||||||
{subtitle && <small>{subtitle}</small>}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<ConditionallyRender
|
|
||||||
condition={Boolean(actions)}
|
|
||||||
show={<div className={styles.headerActions}>{actions}</div>}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
@ -1,18 +0,0 @@
|
|||||||
import { makeStyles } from 'tss-react/mui';
|
|
||||||
|
|
||||||
export const useStyles = makeStyles()(theme => ({
|
|
||||||
headerTitleContainer: {
|
|
||||||
display: 'flex',
|
|
||||||
justifyContent: 'space-between',
|
|
||||||
alignItems: 'center',
|
|
||||||
position: 'relative',
|
|
||||||
},
|
|
||||||
headerTitle: {
|
|
||||||
fontSize: theme.fontSizes.mainHeader,
|
|
||||||
fontWeight: 'normal',
|
|
||||||
},
|
|
||||||
headerActions: {
|
|
||||||
position: 'absolute',
|
|
||||||
right: 0,
|
|
||||||
},
|
|
||||||
}));
|
|
@ -1,63 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
|
|
||||||
import classnames from 'classnames';
|
|
||||||
import { HeaderTitle } from 'component/common/HeaderTitle/HeaderTitle';
|
|
||||||
import { Paper } from '@mui/material';
|
|
||||||
import { useStyles } from './styles';
|
|
||||||
|
|
||||||
const PageContent = ({
|
|
||||||
children,
|
|
||||||
headerContent,
|
|
||||||
disablePadding = false,
|
|
||||||
disableBorder = false,
|
|
||||||
bodyClass = '',
|
|
||||||
...rest
|
|
||||||
}) => {
|
|
||||||
const { classes: styles } = useStyles();
|
|
||||||
|
|
||||||
const headerClasses = classnames(styles.headerContainer, {
|
|
||||||
[styles.paddingDisabled]: disablePadding,
|
|
||||||
[styles.borderDisabled]: disableBorder,
|
|
||||||
});
|
|
||||||
|
|
||||||
const bodyClasses = classnames(styles.bodyContainer, {
|
|
||||||
[styles.paddingDisabled]: disablePadding,
|
|
||||||
[styles.borderDisabled]: disableBorder,
|
|
||||||
[bodyClass]: bodyClass,
|
|
||||||
});
|
|
||||||
|
|
||||||
let header = null;
|
|
||||||
if (headerContent) {
|
|
||||||
if (typeof headerContent === 'string') {
|
|
||||||
header = (
|
|
||||||
<div className={headerClasses}>
|
|
||||||
<HeaderTitle title={headerContent} />
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
header = <div className={headerClasses}>{headerContent}</div>;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const paperProps = disableBorder ? { elevation: 0 } : {};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Paper
|
|
||||||
{...rest}
|
|
||||||
{...paperProps}
|
|
||||||
style={{ borderRadius: '10px', boxShadow: 'none' }}
|
|
||||||
>
|
|
||||||
{header}
|
|
||||||
<div className={bodyClasses}>{children}</div>
|
|
||||||
</Paper>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default PageContent;
|
|
||||||
|
|
||||||
PageContent.propTypes = {
|
|
||||||
headerContent: PropTypes.oneOfType([PropTypes.element, PropTypes.string]),
|
|
||||||
disablePadding: PropTypes.bool,
|
|
||||||
disableBorder: PropTypes.bool,
|
|
||||||
};
|
|
@ -1,9 +1,15 @@
|
|||||||
import { makeStyles } from 'tss-react/mui';
|
import { makeStyles } from 'tss-react/mui';
|
||||||
|
|
||||||
export const useStyles = makeStyles()(theme => ({
|
export const useStyles = makeStyles()(theme => ({
|
||||||
|
container: {
|
||||||
|
borderRadius: theme.shape.borderRadiusLarge,
|
||||||
|
boxShadow: 'none',
|
||||||
|
},
|
||||||
headerContainer: {
|
headerContainer: {
|
||||||
padding: theme.spacing(2, 4),
|
padding: theme.spacing(2, 4),
|
||||||
borderBottom: `1px solid ${theme.palette.grey[100]}`,
|
borderBottomStyle: 'solid',
|
||||||
|
borderBottomWidth: 1,
|
||||||
|
borderBottomColor: theme.palette.divider,
|
||||||
[theme.breakpoints.down('md')]: {
|
[theme.breakpoints.down('md')]: {
|
||||||
padding: '1.5rem 1rem',
|
padding: '1.5rem 1rem',
|
||||||
},
|
},
|
72
frontend/src/component/common/PageContent/PageContent.tsx
Normal file
72
frontend/src/component/common/PageContent/PageContent.tsx
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
import React, { FC, ReactNode } from 'react';
|
||||||
|
import classnames from 'classnames';
|
||||||
|
import { PageHeader } from 'component/common/PageHeader/PageHeader';
|
||||||
|
import { Paper, PaperProps } from '@mui/material';
|
||||||
|
import { useStyles } from './PageContent.styles';
|
||||||
|
import useLoading from 'hooks/useLoading';
|
||||||
|
import { ConditionallyRender } from '../ConditionallyRender/ConditionallyRender';
|
||||||
|
|
||||||
|
interface IPageContentProps extends PaperProps {
|
||||||
|
header?: ReactNode;
|
||||||
|
isLoading?: boolean;
|
||||||
|
/**
|
||||||
|
* @deprecated fix feature event log and remove
|
||||||
|
*/
|
||||||
|
disablePadding?: boolean;
|
||||||
|
/**
|
||||||
|
* @deprecated fix feature event log and remove
|
||||||
|
*/
|
||||||
|
disableBorder?: boolean;
|
||||||
|
bodyClass?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const PageContent: FC<IPageContentProps> = ({
|
||||||
|
children,
|
||||||
|
header,
|
||||||
|
disablePadding = false,
|
||||||
|
disableBorder = false,
|
||||||
|
bodyClass = '',
|
||||||
|
isLoading = false,
|
||||||
|
className,
|
||||||
|
...rest
|
||||||
|
}) => {
|
||||||
|
const { classes: styles } = useStyles();
|
||||||
|
const ref = useLoading(isLoading);
|
||||||
|
|
||||||
|
const headerClasses = classnames(styles.headerContainer, {
|
||||||
|
[styles.paddingDisabled]: disablePadding,
|
||||||
|
[styles.borderDisabled]: disableBorder,
|
||||||
|
});
|
||||||
|
|
||||||
|
const bodyClasses = classnames(styles.bodyContainer, {
|
||||||
|
[styles.paddingDisabled]: disablePadding,
|
||||||
|
[styles.borderDisabled]: disableBorder,
|
||||||
|
[bodyClass]: bodyClass,
|
||||||
|
});
|
||||||
|
|
||||||
|
const paperProps = disableBorder ? { elevation: 0 } : {};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div ref={ref}>
|
||||||
|
<Paper
|
||||||
|
{...rest}
|
||||||
|
{...paperProps}
|
||||||
|
className={classnames(styles.container, className)}
|
||||||
|
>
|
||||||
|
<ConditionallyRender
|
||||||
|
condition={Boolean(header)}
|
||||||
|
show={
|
||||||
|
<div className={headerClasses}>
|
||||||
|
<ConditionallyRender
|
||||||
|
condition={typeof header === 'string'}
|
||||||
|
show={<PageHeader title={header as string} />}
|
||||||
|
elseShow={header}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<div className={bodyClasses}>{children}</div>
|
||||||
|
</Paper>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
@ -1,3 +0,0 @@
|
|||||||
import PageContent from './PageContent';
|
|
||||||
|
|
||||||
export default PageContent;
|
|
@ -1,25 +1,30 @@
|
|||||||
import { makeStyles } from 'tss-react/mui';
|
import { makeStyles } from 'tss-react/mui';
|
||||||
|
|
||||||
export const useStyles = makeStyles()(theme => ({
|
export const useStyles = makeStyles()(theme => ({
|
||||||
toolbar: {
|
headerContainer: {
|
||||||
paddingLeft: theme.spacing(4),
|
|
||||||
paddingRight: theme.spacing(4),
|
|
||||||
paddingTop: theme.spacing(2),
|
|
||||||
paddingBottom: theme.spacing(2),
|
|
||||||
borderBottom: `1px solid ${theme.palette.divider}`,
|
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
flexWrap: 'wrap',
|
flexDirection: 'column',
|
||||||
alignItems: 'center',
|
|
||||||
},
|
},
|
||||||
actions: {
|
topContainer: {
|
||||||
flex: 1,
|
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
alignItems: 'center',
|
||||||
|
position: 'relative',
|
||||||
|
flexWrap: 'wrap',
|
||||||
|
},
|
||||||
|
headerTitle: {
|
||||||
|
fontSize: theme.fontSizes.mainHeader,
|
||||||
|
fontWeight: 'normal',
|
||||||
|
},
|
||||||
|
headerActions: {
|
||||||
|
display: 'flex',
|
||||||
|
flexGrow: 1,
|
||||||
justifyContent: 'flex-end',
|
justifyContent: 'flex-end',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
},
|
},
|
||||||
verticalSeparator: {
|
verticalSeparator: {
|
||||||
height: '100%',
|
height: '100%',
|
||||||
borderColor: theme.palette.grey[500],
|
borderColor: theme.palette.dividerAlternative,
|
||||||
width: '1px',
|
width: '1px',
|
||||||
display: 'inline-block',
|
display: 'inline-block',
|
||||||
marginLeft: theme.spacing(2),
|
marginLeft: theme.spacing(2),
|
71
frontend/src/component/common/PageHeader/PageHeader.tsx
Normal file
71
frontend/src/component/common/PageHeader/PageHeader.tsx
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
import { ReactNode, FC, VFC } from 'react';
|
||||||
|
import classnames from 'classnames';
|
||||||
|
|
||||||
|
import { Divider, Typography, TypographyProps } from '@mui/material';
|
||||||
|
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
||||||
|
|
||||||
|
import { useStyles } from './PageHeader.styles';
|
||||||
|
import { usePageTitle } from 'hooks/usePageTitle';
|
||||||
|
|
||||||
|
interface IPageHeaderProps {
|
||||||
|
title: string;
|
||||||
|
titleElement?: ReactNode;
|
||||||
|
subtitle?: string;
|
||||||
|
variant?: TypographyProps['variant'];
|
||||||
|
loading?: boolean;
|
||||||
|
actions?: ReactNode;
|
||||||
|
className?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const PageHeaderComponent: FC<IPageHeaderProps> & { Divider: VFC } = ({
|
||||||
|
title,
|
||||||
|
titleElement,
|
||||||
|
actions,
|
||||||
|
subtitle,
|
||||||
|
variant,
|
||||||
|
loading,
|
||||||
|
className = '',
|
||||||
|
children,
|
||||||
|
}) => {
|
||||||
|
const { classes: styles } = useStyles();
|
||||||
|
const headerClasses = classnames({ skeleton: loading });
|
||||||
|
|
||||||
|
usePageTitle(title);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={styles.headerContainer}>
|
||||||
|
<div className={styles.topContainer}>
|
||||||
|
<div className={headerClasses} data-loading>
|
||||||
|
<Typography
|
||||||
|
variant={variant || 'h1'}
|
||||||
|
className={classnames(styles.headerTitle, className)}
|
||||||
|
>
|
||||||
|
{titleElement || title}
|
||||||
|
</Typography>
|
||||||
|
{subtitle && <small>{subtitle}</small>}
|
||||||
|
</div>
|
||||||
|
<ConditionallyRender
|
||||||
|
condition={Boolean(actions)}
|
||||||
|
show={<div className={styles.headerActions}>{actions}</div>}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
{children}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const PageHeaderDivider: VFC = () => {
|
||||||
|
const { classes: styles } = useStyles();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Divider
|
||||||
|
orientation="vertical"
|
||||||
|
variant="middle"
|
||||||
|
className={styles.verticalSeparator}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
PageHeaderComponent.Divider = PageHeaderDivider;
|
||||||
|
|
||||||
|
export const PageHeader = PageHeaderComponent;
|
@ -1,8 +0,0 @@
|
|||||||
import { FC } from 'react';
|
|
||||||
import { Box, Table as MUITable } from '@mui/material';
|
|
||||||
|
|
||||||
export const Table: FC = ({ children }) => (
|
|
||||||
<Box sx={{ p: 4, pb: 0 }}>
|
|
||||||
<MUITable>{children}</MUITable>
|
|
||||||
</Box>
|
|
||||||
);
|
|
@ -2,6 +2,9 @@ import { forwardRef } from 'react';
|
|||||||
import { Paper, PaperProps } from '@mui/material';
|
import { Paper, PaperProps } from '@mui/material';
|
||||||
import { useStyles } from './TableContainer.styles';
|
import { useStyles } from './TableContainer.styles';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated
|
||||||
|
*/
|
||||||
export const TableContainer = forwardRef<HTMLDivElement, PaperProps>(
|
export const TableContainer = forwardRef<HTMLDivElement, PaperProps>(
|
||||||
({ children, ...props }, ref) => {
|
({ children, ...props }, ref) => {
|
||||||
const { classes } = useStyles();
|
const { classes } = useStyles();
|
||||||
|
@ -1,37 +0,0 @@
|
|||||||
import { FC, VFC } from 'react';
|
|
||||||
import { Divider, Box, Toolbar } from '@mui/material';
|
|
||||||
import { useStyles } from './TableToolbar.styles';
|
|
||||||
import { HeaderTitle } from 'component/common/HeaderTitle/HeaderTitle';
|
|
||||||
|
|
||||||
interface ITableToolbarProps {
|
|
||||||
title: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const TableToolbarComponent: FC<ITableToolbarProps> & {
|
|
||||||
Divider: VFC;
|
|
||||||
} = ({ title, children }) => {
|
|
||||||
const { classes: styles } = useStyles();
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Toolbar className={styles.toolbar}>
|
|
||||||
<HeaderTitle title={title} data-loading />
|
|
||||||
<Box className={styles.actions}>{children}</Box>
|
|
||||||
</Toolbar>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const ToolbarDivider: VFC = () => {
|
|
||||||
const { classes: styles } = useStyles();
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Divider
|
|
||||||
orientation="vertical"
|
|
||||||
variant="middle"
|
|
||||||
className={styles.verticalSeparator}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
TableToolbarComponent.Divider = ToolbarDivider;
|
|
||||||
|
|
||||||
export const TableToolbar = TableToolbarComponent;
|
|
@ -1,8 +1,5 @@
|
|||||||
export { TableContainer } from './TableContainer/TableContainer';
|
|
||||||
export { TableToolbar } from './TableToolbar/TableToolbar';
|
|
||||||
export { TableSearch } from './TableSearch/TableSearch';
|
export { TableSearch } from './TableSearch/TableSearch';
|
||||||
export { Table } from './Table';
|
|
||||||
export { SortableTableHeader } from './SortableTableHeader/SortableTableHeader';
|
export { SortableTableHeader } from './SortableTableHeader/SortableTableHeader';
|
||||||
export { TableBody, TableRow } from '@mui/material';
|
export { Table, TableBody, TableRow } from '@mui/material';
|
||||||
export { TableCell } from './TableCell/TableCell';
|
export { TableCell } from './TableCell/TableCell';
|
||||||
export { TablePlaceholder } from './TablePlaceholder/TablePlaceholder';
|
export { TablePlaceholder } from './TablePlaceholder/TablePlaceholder';
|
||||||
|
@ -11,8 +11,8 @@ import {
|
|||||||
Tooltip,
|
Tooltip,
|
||||||
useMediaQuery,
|
useMediaQuery,
|
||||||
} from '@mui/material';
|
} from '@mui/material';
|
||||||
import PageContent from 'component/common/PageContent/PageContent';
|
import { PageContent } from 'component/common/PageContent/PageContent';
|
||||||
import { HeaderTitle } from 'component/common/HeaderTitle/HeaderTitle';
|
import { PageHeader } from 'component/common/PageHeader/PageHeader';
|
||||||
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
||||||
import {
|
import {
|
||||||
CREATE_CONTEXT_FIELD,
|
CREATE_CONTEXT_FIELD,
|
||||||
@ -143,11 +143,8 @@ const ContextList: VFC = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<PageContent
|
<PageContent
|
||||||
headerContent={
|
header={
|
||||||
<HeaderTitle
|
<PageHeader actions={headerButton()} title={'Context fields'} />
|
||||||
actions={headerButton()}
|
|
||||||
title={'Context fields'}
|
|
||||||
/>
|
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<List>
|
<List>
|
||||||
|
@ -11,9 +11,9 @@ import useToast from 'hooks/useToast';
|
|||||||
import { useEnvironments } from 'hooks/api/getters/useEnvironments/useEnvironments';
|
import { useEnvironments } from 'hooks/api/getters/useEnvironments/useEnvironments';
|
||||||
import useProjectRolePermissions from 'hooks/api/getters/useProjectRolePermissions/useProjectRolePermissions';
|
import useProjectRolePermissions from 'hooks/api/getters/useProjectRolePermissions/useProjectRolePermissions';
|
||||||
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
||||||
import PageContent from 'component/common/PageContent/PageContent';
|
import { PageContent } from 'component/common/PageContent/PageContent';
|
||||||
import { ADMIN } from 'component/providers/AccessProvider/permissions';
|
import { ADMIN } from 'component/providers/AccessProvider/permissions';
|
||||||
import { HeaderTitle } from 'component/common/HeaderTitle/HeaderTitle';
|
import { PageHeader } from 'component/common/PageHeader/PageHeader';
|
||||||
import { formatUnknownError } from 'utils/formatUnknownError';
|
import { formatUnknownError } from 'utils/formatUnknownError';
|
||||||
|
|
||||||
const CreateEnvironment = () => {
|
const CreateEnvironment = () => {
|
||||||
@ -109,9 +109,7 @@ const CreateEnvironment = () => {
|
|||||||
elseShow={
|
elseShow={
|
||||||
<>
|
<>
|
||||||
<PageContent
|
<PageContent
|
||||||
headerContent={
|
header={<PageHeader title="Create environment" />}
|
||||||
<HeaderTitle title="Create environment" />
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
<Alert severity="error">
|
<Alert severity="error">
|
||||||
<p>
|
<p>
|
||||||
|
@ -4,9 +4,9 @@ import { List } from '@mui/material';
|
|||||||
import { Add } from '@mui/icons-material';
|
import { Add } from '@mui/icons-material';
|
||||||
import useToast from 'hooks/useToast';
|
import useToast from 'hooks/useToast';
|
||||||
import { IEnvironment, ISortOrderPayload } from 'interfaces/environments';
|
import { IEnvironment, ISortOrderPayload } from 'interfaces/environments';
|
||||||
import { HeaderTitle } from 'component/common/HeaderTitle/HeaderTitle';
|
import { PageHeader } from 'component/common/PageHeader/PageHeader';
|
||||||
import ResponsiveButton from 'component/common/ResponsiveButton/ResponsiveButton';
|
import ResponsiveButton from 'component/common/ResponsiveButton/ResponsiveButton';
|
||||||
import PageContent from 'component/common/PageContent';
|
import { PageContent } from 'component/common/PageContent/PageContent';
|
||||||
import { useEnvironments } from 'hooks/api/getters/useEnvironments/useEnvironments';
|
import { useEnvironments } from 'hooks/api/getters/useEnvironments/useEnvironments';
|
||||||
import useEnvironmentApi from 'hooks/api/actions/useEnvironmentApi/useEnvironmentApi';
|
import useEnvironmentApi from 'hooks/api/actions/useEnvironmentApi/useEnvironmentApi';
|
||||||
import useProjectRolePermissions from 'hooks/api/getters/useProjectRolePermissions/useProjectRolePermissions';
|
import useProjectRolePermissions from 'hooks/api/getters/useProjectRolePermissions/useProjectRolePermissions';
|
||||||
@ -159,8 +159,8 @@ const EnvironmentList = () => {
|
|||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<PageContent
|
<PageContent
|
||||||
headerContent={
|
header={
|
||||||
<HeaderTitle
|
<PageHeader
|
||||||
title="Environments"
|
title="Environments"
|
||||||
actions={
|
actions={
|
||||||
<>
|
<>
|
||||||
|
@ -6,8 +6,8 @@ import useMediaQuery from '@mui/material/useMediaQuery';
|
|||||||
import { IFlags } from 'interfaces/uiConfig';
|
import { IFlags } from 'interfaces/uiConfig';
|
||||||
import { SearchField } from 'component/common/SearchField/SearchField';
|
import { SearchField } from 'component/common/SearchField/SearchField';
|
||||||
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
||||||
import PageContent from 'component/common/PageContent/PageContent';
|
import { PageContent } from 'component/common/PageContent/PageContent';
|
||||||
import { HeaderTitle } from 'component/common/HeaderTitle/HeaderTitle';
|
import { PageHeader } from 'component/common/PageHeader/PageHeader';
|
||||||
import AccessContext from 'contexts/AccessContext';
|
import AccessContext from 'contexts/AccessContext';
|
||||||
import { IFeaturesFilter } from 'hooks/useFeaturesFilter';
|
import { IFeaturesFilter } from 'hooks/useFeaturesFilter';
|
||||||
import { FeatureToggleListItem } from './FeatureToggleListItem/FeatureToggleListItem';
|
import { FeatureToggleListItem } from './FeatureToggleListItem/FeatureToggleListItem';
|
||||||
@ -138,8 +138,8 @@ export const FeatureToggleList: VFC<IFeatureToggleListProps> = ({
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<PageContent
|
<PageContent
|
||||||
headerContent={
|
header={
|
||||||
<HeaderTitle
|
<PageHeader
|
||||||
loading={loading}
|
loading={loading}
|
||||||
title={headerTitle}
|
title={headerTitle}
|
||||||
actions={
|
actions={
|
||||||
|
@ -4,8 +4,6 @@ import { Link as RouterLink } from 'react-router-dom';
|
|||||||
import { useGlobalFilter, useSortBy, useTable } from 'react-table';
|
import { useGlobalFilter, useSortBy, useTable } from 'react-table';
|
||||||
import useLoading from 'hooks/useLoading';
|
import useLoading from 'hooks/useLoading';
|
||||||
import {
|
import {
|
||||||
TableContainer,
|
|
||||||
TableToolbar,
|
|
||||||
Table,
|
Table,
|
||||||
SortableTableHeader,
|
SortableTableHeader,
|
||||||
TableBody,
|
TableBody,
|
||||||
@ -22,6 +20,8 @@ import { FeatureStaleCell } from './FeatureStaleCell/FeatureStaleCell';
|
|||||||
import { FeatureTypeCell } from './FeatureTypeCell/FeatureTypeCell';
|
import { FeatureTypeCell } from './FeatureTypeCell/FeatureTypeCell';
|
||||||
import { CreateFeatureButton } from '../../CreateFeatureButton/CreateFeatureButton';
|
import { CreateFeatureButton } from '../../CreateFeatureButton/CreateFeatureButton';
|
||||||
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
||||||
|
import { PageContent } from 'component/common/PageContent/PageContent';
|
||||||
|
import { PageHeader } from 'component/common/PageHeader/PageHeader';
|
||||||
|
|
||||||
interface IExperimentProps {
|
interface IExperimentProps {
|
||||||
data: Record<string, any>[];
|
data: Record<string, any>[];
|
||||||
@ -106,7 +106,6 @@ export const FeatureToggleListTable: VFC<IExperimentProps> = ({
|
|||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const isSmallScreen = useMediaQuery(theme.breakpoints.down('md'));
|
const isSmallScreen = useMediaQuery(theme.breakpoints.down('md'));
|
||||||
const isMediumScreen = useMediaQuery(theme.breakpoints.down('lg'));
|
const isMediumScreen = useMediaQuery(theme.breakpoints.down('lg'));
|
||||||
const ref = useLoading(isLoading);
|
|
||||||
|
|
||||||
const initialState = useMemo(
|
const initialState = useMemo(
|
||||||
() => ({
|
() => ({
|
||||||
@ -155,13 +154,18 @@ export const FeatureToggleListTable: VFC<IExperimentProps> = ({
|
|||||||
}, [setHiddenColumns, isSmallScreen, isMediumScreen]);
|
}, [setHiddenColumns, isSmallScreen, isMediumScreen]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TableContainer ref={ref}>
|
<PageContent
|
||||||
<TableToolbar title={`Feature toggles (${data.length})`}>
|
isLoading={isLoading}
|
||||||
|
header={
|
||||||
|
<PageHeader
|
||||||
|
title={`Feature toggles (${data.length})`}
|
||||||
|
actions={
|
||||||
|
<>
|
||||||
<TableSearch
|
<TableSearch
|
||||||
initialValue={globalFilter}
|
initialValue={globalFilter}
|
||||||
onChange={setGlobalFilter}
|
onChange={setGlobalFilter}
|
||||||
/>
|
/>
|
||||||
<TableToolbar.Divider />
|
<PageHeader.Divider />
|
||||||
<Link
|
<Link
|
||||||
component={RouterLink}
|
component={RouterLink}
|
||||||
to="/archive"
|
to="/archive"
|
||||||
@ -174,7 +178,11 @@ export const FeatureToggleListTable: VFC<IExperimentProps> = ({
|
|||||||
loading={false}
|
loading={false}
|
||||||
filter={{ query: '', project: 'default' }}
|
filter={{ query: '', project: 'default' }}
|
||||||
/>
|
/>
|
||||||
</TableToolbar>
|
</>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
>
|
||||||
<SearchHighlightProvider value={globalFilter}>
|
<SearchHighlightProvider value={globalFilter}>
|
||||||
<Table {...getTableProps()}>
|
<Table {...getTableProps()}>
|
||||||
<SortableTableHeader headerGroups={headerGroups} />
|
<SortableTableHeader headerGroups={headerGroups} />
|
||||||
@ -215,6 +223,6 @@ export const FeatureToggleListTable: VFC<IExperimentProps> = ({
|
|||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</TableContainer>
|
</PageContent>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { useFeatureMetricsRaw } from 'hooks/api/getters/useFeatureMetricsRaw/useFeatureMetricsRaw';
|
import { useFeatureMetricsRaw } from 'hooks/api/getters/useFeatureMetricsRaw/useFeatureMetricsRaw';
|
||||||
import PageContent from 'component/common/PageContent';
|
import { PageContent } from 'component/common/PageContent/PageContent';
|
||||||
import { useEffect, useMemo, useState } from 'react';
|
import { useEffect, useMemo, useState } from 'react';
|
||||||
import {
|
import {
|
||||||
FEATURE_METRIC_HOURS_BACK_MAX,
|
FEATURE_METRIC_HOURS_BACK_MAX,
|
||||||
@ -57,7 +57,7 @@ export const FeatureMetrics = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PageContent headerContent="">
|
<PageContent>
|
||||||
<Grid
|
<Grid
|
||||||
container
|
container
|
||||||
component="header"
|
component="header"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import PageContent from 'component/common/PageContent';
|
import { PageContent } from 'component/common/PageContent/PageContent';
|
||||||
import { useStyles } from './FeatureSettings.styles';
|
import { useStyles } from './FeatureSettings.styles';
|
||||||
import { List, ListItem } from '@mui/material';
|
import { List, ListItem } from '@mui/material';
|
||||||
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
||||||
@ -17,7 +17,7 @@ export const FeatureSettings = () => {
|
|||||||
const [settings, setSettings] = useState(METADATA);
|
const [settings, setSettings] = useState(METADATA);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PageContent headerContent="Settings" bodyClass={styles.bodyContainer}>
|
<PageContent header="Settings" bodyClass={styles.bodyContainer}>
|
||||||
<div className={styles.innerContainer}>
|
<div className={styles.innerContainer}>
|
||||||
<div className={styles.listContainer}>
|
<div className={styles.listContainer}>
|
||||||
<List>
|
<List>
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { List, Switch, FormControlLabel } from '@mui/material';
|
import { List, Switch, FormControlLabel } from '@mui/material';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import EventJson from './EventJson/EventJson';
|
import EventJson from './EventJson/EventJson';
|
||||||
import PageContent from 'component/common/PageContent/PageContent';
|
import { PageContent } from 'component/common/PageContent/PageContent';
|
||||||
import { HeaderTitle } from 'component/common/HeaderTitle/HeaderTitle';
|
import { PageHeader } from 'component/common/PageHeader/PageHeader';
|
||||||
import EventCard from './EventCard/EventCard';
|
import EventCard from './EventCard/EventCard';
|
||||||
import { useStyles } from './EventLog.styles';
|
import { useStyles } from './EventLog.styles';
|
||||||
import { formatDateYMDHMS } from 'utils/formatDate';
|
import { formatDateYMDHMS } from 'utils/formatDate';
|
||||||
@ -50,8 +50,8 @@ const EventLog = ({
|
|||||||
<PageContent
|
<PageContent
|
||||||
disablePadding={displayInline}
|
disablePadding={displayInline}
|
||||||
disableBorder={displayInline}
|
disableBorder={displayInline}
|
||||||
headerContent={
|
header={
|
||||||
<HeaderTitle
|
<PageHeader
|
||||||
title={title}
|
title={title}
|
||||||
actions={
|
actions={
|
||||||
<FormControlLabel
|
<FormControlLabel
|
||||||
|
@ -20,8 +20,6 @@ export const useStyles = makeStyles()(theme => ({
|
|||||||
padding: '1rem',
|
padding: '1rem',
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
fontSize: '1rem',
|
|
||||||
fontWeight: 'normal',
|
|
||||||
display: 'unset',
|
display: 'unset',
|
||||||
[theme.breakpoints.down(600)]: {
|
[theme.breakpoints.down(600)]: {
|
||||||
display: 'none',
|
display: 'none',
|
||||||
|
@ -7,8 +7,8 @@ import AccessContext from 'contexts/AccessContext';
|
|||||||
import { SearchField } from 'component/common/SearchField/SearchField';
|
import { SearchField } from 'component/common/SearchField/SearchField';
|
||||||
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
||||||
import { PROJECTFILTERING } from 'component/common/flags';
|
import { PROJECTFILTERING } from 'component/common/flags';
|
||||||
import { HeaderTitle } from 'component/common/HeaderTitle/HeaderTitle';
|
import { PageHeader } from 'component/common/PageHeader/PageHeader';
|
||||||
import PageContent from 'component/common/PageContent';
|
import { PageContent } from 'component/common/PageContent/PageContent';
|
||||||
import ResponsiveButton from 'component/common/ResponsiveButton/ResponsiveButton';
|
import ResponsiveButton from 'component/common/ResponsiveButton/ResponsiveButton';
|
||||||
import FeatureToggleListNew from 'component/feature/FeatureToggleListNew/FeatureToggleListNew';
|
import FeatureToggleListNew from 'component/feature/FeatureToggleListNew/FeatureToggleListNew';
|
||||||
import { IFeatureToggleListItem } from 'interfaces/featureToggle';
|
import { IFeatureToggleListItem } from 'interfaces/featureToggle';
|
||||||
@ -46,8 +46,8 @@ export const ProjectFeatureToggles = ({
|
|||||||
<PageContent
|
<PageContent
|
||||||
className={styles.container}
|
className={styles.container}
|
||||||
bodyClass={styles.bodyClass}
|
bodyClass={styles.bodyClass}
|
||||||
headerContent={
|
header={
|
||||||
<HeaderTitle
|
<PageHeader
|
||||||
className={styles.title}
|
className={styles.title}
|
||||||
title={`Project feature toggles (${filteredFeatures.length})`}
|
title={`Project feature toggles (${filteredFeatures.length})`}
|
||||||
actions={
|
actions={
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { Alert, SelectChangeEvent } from '@mui/material';
|
import { Alert, SelectChangeEvent } from '@mui/material';
|
||||||
import { ProjectAccessAddUser } from './ProjectAccessAddUser/ProjectAccessAddUser';
|
import { ProjectAccessAddUser } from './ProjectAccessAddUser/ProjectAccessAddUser';
|
||||||
import PageContent from 'component/common/PageContent';
|
import { PageContent } from 'component/common/PageContent/PageContent';
|
||||||
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
|
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
|
||||||
import { useStyles } from './ProjectAccess.styles';
|
import { useStyles } from './ProjectAccess.styles';
|
||||||
import usePagination from 'hooks/usePagination';
|
import usePagination from 'hooks/usePagination';
|
||||||
@ -13,7 +13,7 @@ import useProjectAccess, {
|
|||||||
IProjectAccessUser,
|
IProjectAccessUser,
|
||||||
} from 'hooks/api/getters/useProjectAccess/useProjectAccess';
|
} from 'hooks/api/getters/useProjectAccess/useProjectAccess';
|
||||||
import useProjectApi from 'hooks/api/actions/useProjectApi/useProjectApi';
|
import useProjectApi from 'hooks/api/actions/useProjectApi/useProjectApi';
|
||||||
import { HeaderTitle } from 'component/common/HeaderTitle/HeaderTitle';
|
import { PageHeader } from 'component/common/PageHeader/PageHeader';
|
||||||
import { ProjectAccessList } from './ProjectAccessList/ProjectAccessList';
|
import { ProjectAccessList } from './ProjectAccessList/ProjectAccessList';
|
||||||
import { useRequiredPathParam } from 'hooks/useRequiredPathParam';
|
import { useRequiredPathParam } from 'hooks/useRequiredPathParam';
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ export const ProjectAccess = () => {
|
|||||||
|
|
||||||
if (isOss()) {
|
if (isOss()) {
|
||||||
return (
|
return (
|
||||||
<PageContent headerContent={<HeaderTitle title="Project Access" />}>
|
<PageContent header={<PageHeader title="Project Access" />}>
|
||||||
<Alert severity="error">
|
<Alert severity="error">
|
||||||
Controlling access to projects requires a paid version of
|
Controlling access to projects requires a paid version of
|
||||||
Unleash. Check out{' '}
|
Unleash. Check out{' '}
|
||||||
@ -90,7 +90,7 @@ export const ProjectAccess = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<PageContent
|
<PageContent
|
||||||
headerContent={<HeaderTitle title="Project Roles"></HeaderTitle>}
|
header={<PageHeader title="Project Roles"></PageHeader>}
|
||||||
className={styles.pageContent}
|
className={styles.pageContent}
|
||||||
>
|
>
|
||||||
<ProjectAccessAddUser roles={access?.roles} />
|
<ProjectAccessAddUser roles={access?.roles} />
|
||||||
|
@ -3,8 +3,8 @@ import { ConditionallyRender } from 'component/common/ConditionallyRender/Condit
|
|||||||
import { useStyles } from './ProjectEnvironment.styles';
|
import { useStyles } from './ProjectEnvironment.styles';
|
||||||
|
|
||||||
import useLoading from 'hooks/useLoading';
|
import useLoading from 'hooks/useLoading';
|
||||||
import PageContent from 'component/common/PageContent';
|
import { PageContent } from 'component/common/PageContent/PageContent';
|
||||||
import { HeaderTitle } from 'component/common/HeaderTitle/HeaderTitle';
|
import { PageHeader } from 'component/common/PageHeader/PageHeader';
|
||||||
import { UPDATE_PROJECT } from 'component/providers/AccessProvider/permissions';
|
import { UPDATE_PROJECT } from 'component/providers/AccessProvider/permissions';
|
||||||
|
|
||||||
import ApiError from 'component/common/ApiError/ApiError';
|
import ApiError from 'component/common/ApiError/ApiError';
|
||||||
@ -174,8 +174,8 @@ const ProjectEnvironmentList = ({
|
|||||||
return (
|
return (
|
||||||
<div ref={ref}>
|
<div ref={ref}>
|
||||||
<PageContent
|
<PageContent
|
||||||
headerContent={
|
header={
|
||||||
<HeaderTitle
|
<PageHeader
|
||||||
title={`Configure environments for "${project?.name}" project`}
|
title={`Configure environments for "${project?.name}" project`}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
@ -9,9 +9,9 @@ import { useStyles } from './ProjectList.styles';
|
|||||||
import { IProjectCard } from 'interfaces/project';
|
import { IProjectCard } from 'interfaces/project';
|
||||||
import loadingData from './loadingData';
|
import loadingData from './loadingData';
|
||||||
import useLoading from 'hooks/useLoading';
|
import useLoading from 'hooks/useLoading';
|
||||||
import PageContent from 'component/common/PageContent';
|
import { PageContent } from 'component/common/PageContent/PageContent';
|
||||||
import AccessContext from 'contexts/AccessContext';
|
import AccessContext from 'contexts/AccessContext';
|
||||||
import { HeaderTitle } from 'component/common/HeaderTitle/HeaderTitle';
|
import { PageHeader } from 'component/common/PageHeader/PageHeader';
|
||||||
import ResponsiveButton from 'component/common/ResponsiveButton/ResponsiveButton';
|
import ResponsiveButton from 'component/common/ResponsiveButton/ResponsiveButton';
|
||||||
import { CREATE_PROJECT } from 'component/providers/AccessProvider/permissions';
|
import { CREATE_PROJECT } from 'component/providers/AccessProvider/permissions';
|
||||||
import { Add } from '@mui/icons-material';
|
import { Add } from '@mui/icons-material';
|
||||||
@ -140,8 +140,8 @@ export const ProjectListNew = () => {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<PageContent
|
<PageContent
|
||||||
headerContent={
|
header={
|
||||||
<HeaderTitle
|
<PageHeader
|
||||||
title="Projects"
|
title="Projects"
|
||||||
actions={
|
actions={
|
||||||
<ResponsiveButton
|
<ResponsiveButton
|
||||||
|
@ -19,8 +19,8 @@ import useToast from 'hooks/useToast';
|
|||||||
import { formatUnknownError } from 'utils/formatUnknownError';
|
import { formatUnknownError } from 'utils/formatUnknownError';
|
||||||
import { Link, useNavigate } from 'react-router-dom';
|
import { Link, useNavigate } from 'react-router-dom';
|
||||||
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
||||||
import { HeaderTitle } from 'component/common/HeaderTitle/HeaderTitle';
|
import { PageHeader } from 'component/common/PageHeader/PageHeader';
|
||||||
import PageContent from 'component/common/PageContent';
|
import { PageContent } from 'component/common/PageContent/PageContent';
|
||||||
import PermissionButton from 'component/common/PermissionButton/PermissionButton';
|
import PermissionButton from 'component/common/PermissionButton/PermissionButton';
|
||||||
import { SegmentDelete } from '../SegmentDelete/SegmentDelete';
|
import { SegmentDelete } from '../SegmentDelete/SegmentDelete';
|
||||||
import { SegmentDocsWarning } from 'component/segments/SegmentDocs/SegmentDocs';
|
import { SegmentDocsWarning } from 'component/segments/SegmentDocs/SegmentDocs';
|
||||||
@ -90,8 +90,8 @@ export const SegmentsList = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<PageContent
|
<PageContent
|
||||||
headerContent={
|
header={
|
||||||
<HeaderTitle
|
<PageHeader
|
||||||
title="Segments"
|
title="Segments"
|
||||||
actions={
|
actions={
|
||||||
<PermissionButton
|
<PermissionButton
|
||||||
|
@ -23,8 +23,8 @@ import {
|
|||||||
UPDATE_STRATEGY,
|
UPDATE_STRATEGY,
|
||||||
} from 'component/providers/AccessProvider/permissions';
|
} from 'component/providers/AccessProvider/permissions';
|
||||||
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
||||||
import PageContent from 'component/common/PageContent/PageContent';
|
import { PageContent } from 'component/common/PageContent/PageContent';
|
||||||
import { HeaderTitle } from 'component/common/HeaderTitle/HeaderTitle';
|
import { PageHeader } from 'component/common/PageHeader/PageHeader';
|
||||||
import { useStyles } from './StrategiesList.styles';
|
import { useStyles } from './StrategiesList.styles';
|
||||||
import AccessContext from 'contexts/AccessContext';
|
import AccessContext from 'contexts/AccessContext';
|
||||||
import { Dialogue } from 'component/common/Dialogue/Dialogue';
|
import { Dialogue } from 'component/common/Dialogue/Dialogue';
|
||||||
@ -281,9 +281,7 @@ export const StrategiesList = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<PageContent
|
<PageContent
|
||||||
headerContent={
|
header={<PageHeader title="Strategies" actions={headerButton()} />}
|
||||||
<HeaderTitle title="Strategies" actions={headerButton()} />
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
<Dialogue
|
<Dialogue
|
||||||
open={dialogueMetaData.show}
|
open={dialogueMetaData.show}
|
||||||
|
@ -2,20 +2,18 @@
|
|||||||
|
|
||||||
exports[`renders correctly 1`] = `
|
exports[`renders correctly 1`] = `
|
||||||
[
|
[
|
||||||
|
<div>
|
||||||
<div
|
<div
|
||||||
className="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation1 mui-45jkiv-MuiPaper-root"
|
className="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation1 tss-15amf7-container mui-45jkiv-MuiPaper-root"
|
||||||
style={
|
|
||||||
{
|
|
||||||
"borderRadius": "10px",
|
|
||||||
"boxShadow": "none",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className="tss-ee3n06-headerContainer"
|
className="tss-1yjkq3l-headerContainer"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className="tss-14s7qul-headerTitleContainer"
|
className="tss-1ylehva-headerContainer"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="tss-1dw2af8-topContainer"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className=""
|
className=""
|
||||||
@ -28,7 +26,7 @@ exports[`renders correctly 1`] = `
|
|||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className="tss-ap2nhp-headerActions"
|
className="tss-1u1bjy8-headerActions"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
id="useId-0"
|
id="useId-0"
|
||||||
@ -66,6 +64,7 @@ exports[`renders correctly 1`] = `
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<div
|
<div
|
||||||
className="tss-kiw3z8-bodyContainer"
|
className="tss-kiw3z8-bodyContainer"
|
||||||
>
|
>
|
||||||
@ -263,6 +262,7 @@ exports[`renders correctly 1`] = `
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</div>,
|
</div>,
|
||||||
<div
|
<div
|
||||||
aria-atomic={true}
|
aria-atomic={true}
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import { Grid } from '@mui/material';
|
import { Grid } from '@mui/material';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
import { UPDATE_STRATEGY } from 'component/providers/AccessProvider/permissions';
|
import { UPDATE_STRATEGY } from 'component/providers/AccessProvider/permissions';
|
||||||
import PageContent from 'component/common/PageContent/PageContent';
|
import { PageContent } from 'component/common/PageContent/PageContent';
|
||||||
import { useStrategies } from 'hooks/api/getters/useStrategies/useStrategies';
|
import { useStrategies } from 'hooks/api/getters/useStrategies/useStrategies';
|
||||||
import { useFeatures } from 'hooks/api/getters/useFeatures/useFeatures';
|
import { useFeatures } from 'hooks/api/getters/useFeatures/useFeatures';
|
||||||
import useApplications from 'hooks/api/getters/useApplications/useApplications';
|
import useApplications from 'hooks/api/getters/useApplications/useApplications';
|
||||||
import { StrategyDetails } from './StrategyDetails/StrategyDetails';
|
import { StrategyDetails } from './StrategyDetails/StrategyDetails';
|
||||||
import { HeaderTitle } from 'component/common/HeaderTitle/HeaderTitle';
|
import { PageHeader } from 'component/common/PageHeader/PageHeader';
|
||||||
import PermissionIconButton from 'component/common/PermissionIconButton/PermissionIconButton';
|
import PermissionIconButton from 'component/common/PermissionIconButton/PermissionIconButton';
|
||||||
import { Edit } from '@mui/icons-material';
|
import { Edit } from '@mui/icons-material';
|
||||||
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
||||||
@ -32,8 +32,8 @@ export const StrategyView = () => {
|
|||||||
if (!strategy) return null;
|
if (!strategy) return null;
|
||||||
return (
|
return (
|
||||||
<PageContent
|
<PageContent
|
||||||
headerContent={
|
header={
|
||||||
<HeaderTitle
|
<PageHeader
|
||||||
title={strategy?.name}
|
title={strategy?.name}
|
||||||
subtitle={strategy?.description}
|
subtitle={strategy?.description}
|
||||||
actions={
|
actions={
|
||||||
|
@ -10,8 +10,8 @@ import {
|
|||||||
Tooltip,
|
Tooltip,
|
||||||
} from '@mui/material';
|
} from '@mui/material';
|
||||||
import { Add, Delete, Edit, Label } from '@mui/icons-material';
|
import { Add, Delete, Edit, Label } from '@mui/icons-material';
|
||||||
import { HeaderTitle } from 'component/common/HeaderTitle/HeaderTitle';
|
import { PageHeader } from 'component/common/PageHeader/PageHeader';
|
||||||
import PageContent from 'component/common/PageContent/PageContent';
|
import { PageContent } from 'component/common/PageContent/PageContent';
|
||||||
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
||||||
import {
|
import {
|
||||||
DELETE_TAG_TYPE,
|
DELETE_TAG_TYPE,
|
||||||
@ -58,7 +58,7 @@ export const TagTypeList = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let header = (
|
let header = (
|
||||||
<HeaderTitle
|
<PageHeader
|
||||||
title="Tag Types"
|
title="Tag Types"
|
||||||
actions={
|
actions={
|
||||||
<ConditionallyRender
|
<ConditionallyRender
|
||||||
@ -143,7 +143,7 @@ export const TagTypeList = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<PageContent headerContent={header}>
|
<PageContent header={header}>
|
||||||
<List>
|
<List>
|
||||||
<ConditionallyRender
|
<ConditionallyRender
|
||||||
condition={tagTypes.length > 0}
|
condition={tagTypes.length > 0}
|
||||||
|
@ -2,20 +2,18 @@
|
|||||||
|
|
||||||
exports[`renders an empty list correctly 1`] = `
|
exports[`renders an empty list correctly 1`] = `
|
||||||
[
|
[
|
||||||
|
<div>
|
||||||
<div
|
<div
|
||||||
className="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation1 mui-45jkiv-MuiPaper-root"
|
className="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation1 tss-15amf7-container mui-45jkiv-MuiPaper-root"
|
||||||
style={
|
|
||||||
{
|
|
||||||
"borderRadius": "10px",
|
|
||||||
"boxShadow": "none",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className="tss-ee3n06-headerContainer"
|
className="tss-1yjkq3l-headerContainer"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className="tss-14s7qul-headerTitleContainer"
|
className="tss-1ylehva-headerContainer"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="tss-1dw2af8-topContainer"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className=""
|
className=""
|
||||||
@ -28,7 +26,7 @@ exports[`renders an empty list correctly 1`] = `
|
|||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className="tss-ap2nhp-headerActions"
|
className="tss-1u1bjy8-headerActions"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
className="MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButtonBase-root mui-1lmzhxi-MuiButtonBase-root-MuiButton-root"
|
className="MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButtonBase-root mui-1lmzhxi-MuiButtonBase-root-MuiButton-root"
|
||||||
@ -54,6 +52,7 @@ exports[`renders an empty list correctly 1`] = `
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<div
|
<div
|
||||||
className="tss-kiw3z8-bodyContainer"
|
className="tss-kiw3z8-bodyContainer"
|
||||||
>
|
>
|
||||||
@ -68,6 +67,7 @@ exports[`renders an empty list correctly 1`] = `
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</div>,
|
</div>,
|
||||||
<div
|
<div
|
||||||
aria-atomic={true}
|
aria-atomic={true}
|
||||||
|
@ -89,13 +89,6 @@ export default createTheme({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
MuiTableHead: {
|
|
||||||
styleOverrides: {
|
|
||||||
root: {
|
|
||||||
background: colors.grey[200],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
MuiLink: {
|
MuiLink: {
|
||||||
styleOverrides: {
|
styleOverrides: {
|
||||||
root: {
|
root: {
|
||||||
@ -112,6 +105,13 @@ export default createTheme({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
MuiTableHead: {
|
||||||
|
styleOverrides: {
|
||||||
|
root: {
|
||||||
|
background: colors.grey[200],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
MuiTableRow: {
|
MuiTableRow: {
|
||||||
styleOverrides: {
|
styleOverrides: {
|
||||||
root: {
|
root: {
|
||||||
@ -121,5 +121,12 @@ export default createTheme({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
MuiTableCell: {
|
||||||
|
styleOverrides: {
|
||||||
|
root: {
|
||||||
|
borderBottomColor: colors.grey[300],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user