Addresses needed styling changes to Card and Page Section

These changes were necessary to remove an additional page section
to ProjectJobTemplateList.
This commit is contained in:
Alex Corey
2020-01-29 12:31:22 -05:00
parent 5790aa9780
commit bbea43b1fe
5 changed files with 183 additions and 180 deletions

View File

@@ -1,6 +1,6 @@
import React, { useState } from 'react';
import { useHistory } from 'react-router-dom';
import { Card, PageSection } from '@patternfly/react-core';
import { Card } from '@patternfly/react-core';
import { CardBody } from '@components/Card';
import JobTemplateForm from '../shared/JobTemplateForm';
import { JobTemplatesAPI } from '@api';
@@ -61,7 +61,6 @@ function JobTemplateAdd() {
}
return (
<PageSection>
<Card>
<CardBody>
<JobTemplateForm
@@ -71,7 +70,6 @@ function JobTemplateAdd() {
</CardBody>
{formSubmitError ? <div>formSubmitError</div> : ''}
</Card>
</PageSection>
);
}

View File

@@ -150,7 +150,6 @@ class Template extends Component {
}
return (
<PageSection>
<Card className="awx-c-card">
{cardHeader}
<Switch>
@@ -221,7 +220,6 @@ class Template extends Component {
/>
</Switch>
</Card>
</PageSection>
);
}
}

View File

@@ -2,7 +2,7 @@ import React, { Component } from 'react';
import { withRouter } from 'react-router-dom';
import { withI18n } from '@lingui/react';
import { t } from '@lingui/macro';
import { Card, PageSection } from '@patternfly/react-core';
import { Card } from '@patternfly/react-core';
import {
JobTemplatesAPI,
@@ -109,7 +109,13 @@ class TemplatesList extends Component {
}
async loadTemplates() {
const { location, match } = this.props;
const {
location,
match: {
params: { id: projectId },
url,
},
} = this.props;
const {
jtActions: cachedJTActions,
wfjtActions: cachedWFJTActions,
@@ -135,8 +141,8 @@ class TemplatesList extends Component {
} else {
wfjtOptionsPromise = WorkflowJobTemplatesAPI.readOptions();
}
if (match.url.startsWith('/projects') && match.params.id) {
params.jobtemplate__project = match.params.id;
if (url.startsWith('/projects') && projectId) {
params.jobtemplate__project = projectId;
}
const promises = Promise.all([

View File

@@ -1,7 +1,8 @@
import React, { Component, Fragment } from 'react';
import React, { Component } from 'react';
import { withI18n } from '@lingui/react';
import { t } from '@lingui/macro';
import { Route, withRouter, Switch } from 'react-router-dom';
import { PageSection } from '@patternfly/react-core';
import { Config } from '@contexts/Config';
import Breadcrumbs from '@components/Breadcrumbs/Breadcrumbs';
@@ -50,8 +51,9 @@ class Templates extends Component {
const { match, history, location } = this.props;
const { breadcrumbConfig } = this.state;
return (
<Fragment>
<>
<Breadcrumbs breadcrumbConfig={breadcrumbConfig} />
<PageSection>
<Switch>
<Route
path={`${match.path}/job_template/add`}
@@ -91,7 +93,8 @@ class Templates extends Component {
/>
<Route path={`${match.path}`} render={() => <TemplateList />} />
</Switch>
</Fragment>
</PageSection>
</>
);
}
}

View File

@@ -94,7 +94,6 @@ class WorkflowJobTemplate extends Component {
}
return (
<PageSection>
<Card className="awx-c-card">
{cardHeader}
<Switch>
@@ -147,7 +146,6 @@ class WorkflowJobTemplate extends Component {
/>
</Switch>
</Card>
</PageSection>
);
}
}