diff --git a/awx/ui_next/src/screens/Template/JobTemplateAdd/JobTemplateAdd.jsx b/awx/ui_next/src/screens/Template/JobTemplateAdd/JobTemplateAdd.jsx index f55d25bbdd..7aecba1eb2 100644 --- a/awx/ui_next/src/screens/Template/JobTemplateAdd/JobTemplateAdd.jsx +++ b/awx/ui_next/src/screens/Template/JobTemplateAdd/JobTemplateAdd.jsx @@ -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,17 +61,15 @@ function JobTemplateAdd() { } return ( - - - - - - {formSubmitError ?
formSubmitError
: ''} -
-
+ + + + + {formSubmitError ?
formSubmitError
: ''} +
); } diff --git a/awx/ui_next/src/screens/Template/Template.jsx b/awx/ui_next/src/screens/Template/Template.jsx index 00e052e101..8e22494524 100644 --- a/awx/ui_next/src/screens/Template/Template.jsx +++ b/awx/ui_next/src/screens/Template/Template.jsx @@ -150,78 +150,76 @@ class Template extends Component { } return ( - - - {cardHeader} - - - {template && ( - ( - - )} - /> - )} - {template && ( - } - /> - )} - {template && ( - ( - - )} - /> - )} - {canSeeNotificationsTab && ( - ( - - )} - /> - )} + + {cardHeader} + + + {template && ( - !hasContentLoading && ( - - {match.params.id && ( - - {i18n._(`View Template Details`)} - - )} - - ) - } + key="details" + path="/templates/:templateType/:id/details" + render={() => ( + + )} /> - - - + )} + {template && ( + } + /> + )} + {template && ( + ( + + )} + /> + )} + {canSeeNotificationsTab && ( + ( + + )} + /> + )} + + !hasContentLoading && ( + + {match.params.id && ( + + {i18n._(`View Template Details`)} + + )} + + ) + } + /> + + ); } } diff --git a/awx/ui_next/src/screens/Template/TemplateList/TemplateList.jsx b/awx/ui_next/src/screens/Template/TemplateList/TemplateList.jsx index 9406866468..0543587ceb 100644 --- a/awx/ui_next/src/screens/Template/TemplateList/TemplateList.jsx +++ b/awx/ui_next/src/screens/Template/TemplateList/TemplateList.jsx @@ -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([ diff --git a/awx/ui_next/src/screens/Template/Templates.jsx b/awx/ui_next/src/screens/Template/Templates.jsx index 904c7cbc3b..6b93604667 100644 --- a/awx/ui_next/src/screens/Template/Templates.jsx +++ b/awx/ui_next/src/screens/Template/Templates.jsx @@ -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,48 +51,50 @@ class Templates extends Component { const { match, history, location } = this.props; const { breadcrumbConfig } = this.state; return ( - + <> - - } - /> - ( - - {({ me }) => ( -