Fix inconsistent screen title bars

This commit is contained in:
Jake McDermott
2020-10-28 15:41:29 -04:00
parent 10664d1931
commit d30dd97c96
3 changed files with 8 additions and 29 deletions

View File

@@ -8,18 +8,17 @@ import {
CardActions, CardActions,
CardBody, CardBody,
PageSection, PageSection,
PageSectionVariants,
Select, Select,
SelectVariant, SelectVariant,
SelectOption, SelectOption,
Tabs, Tabs,
Tab, Tab,
TabTitleText, TabTitleText,
Title,
} from '@patternfly/react-core'; } from '@patternfly/react-core';
import useRequest from '../../util/useRequest'; import useRequest from '../../util/useRequest';
import { DashboardAPI } from '../../api'; import { DashboardAPI } from '../../api';
import Breadcrumbs from '../../components/Breadcrumbs';
import JobList from '../../components/JobList'; import JobList from '../../components/JobList';
import LineChart from './shared/LineChart'; import LineChart from './shared/LineChart';
@@ -56,8 +55,6 @@ const GraphCardActions = styled(CardActions)`
`; `;
function Dashboard({ i18n }) { function Dashboard({ i18n }) {
const { light } = PageSectionVariants;
const [isPeriodDropdownOpen, setIsPeriodDropdownOpen] = useState(false); const [isPeriodDropdownOpen, setIsPeriodDropdownOpen] = useState(false);
const [isJobTypeDropdownOpen, setIsJobTypeDropdownOpen] = useState(false); const [isJobTypeDropdownOpen, setIsJobTypeDropdownOpen] = useState(false);
const [periodSelection, setPeriodSelection] = useState('month'); const [periodSelection, setPeriodSelection] = useState('month');
@@ -111,11 +108,7 @@ function Dashboard({ i18n }) {
return ( return (
<Fragment> <Fragment>
<PageSection variant={light} className="pf-m-condensed"> <Breadcrumbs breadcrumbConfig={{ '/home': i18n._(t`Dashboard`) }} />
<Title size="2xl" headingLevel="h2">
{i18n._(t`Dashboard`)}
</Title>
</PageSection>
<PageSection> <PageSection>
<Counts> <Counts>
<Count <Count

View File

@@ -1,25 +1,18 @@
import React, { Component, Fragment } from 'react'; import React, { Component, Fragment } from 'react';
import { withI18n } from '@lingui/react'; import { withI18n } from '@lingui/react';
import { t } from '@lingui/macro'; import { t } from '@lingui/macro';
import {
PageSection, import Breadcrumbs from '../../components/Breadcrumbs';
PageSectionVariants,
Title,
} from '@patternfly/react-core';
class ManagementJobs extends Component { class ManagementJobs extends Component {
render() { render() {
const { i18n } = this.props; const { i18n } = this.props;
const { light } = PageSectionVariants;
return ( return (
<Fragment> <Fragment>
<PageSection variant={light} className="pf-m-condensed"> <Breadcrumbs
<Title size="2xl" headingLevel="h2"> breadcrumbConfig={{ '/management_jobs': i18n._(t`Management Jobs`) }}
{i18n._(t`Management Jobs`)} />
</Title>
</PageSection>
<PageSection />
</Fragment> </Fragment>
); );
} }

View File

@@ -6,13 +6,9 @@ import ManagementJobs from './ManagementJobs';
describe('<ManagementJobs />', () => { describe('<ManagementJobs />', () => {
let pageWrapper; let pageWrapper;
let pageSections;
let title;
beforeEach(() => { beforeEach(() => {
pageWrapper = mountWithContexts(<ManagementJobs />); pageWrapper = mountWithContexts(<ManagementJobs />);
pageSections = pageWrapper.find('PageSection');
title = pageWrapper.find('Title');
}); });
afterEach(() => { afterEach(() => {
@@ -21,9 +17,6 @@ describe('<ManagementJobs />', () => {
test('initially renders without crashing', () => { test('initially renders without crashing', () => {
expect(pageWrapper.length).toBe(1); expect(pageWrapper.length).toBe(1);
expect(pageSections.length).toBe(2); expect(pageWrapper.find('Breadcrumbs').length).toBe(1);
expect(title.length).toBe(1);
expect(title.props().size).toBe('2xl');
expect(pageSections.first().props().variant).toBe('light');
}); });
}); });