mirror of
https://github.com/ansible/awx.git
synced 2026-02-26 23:46:05 -03:30
Don't reload template when navigating to edit form
This commit is contained in:
committed by
Shane McDonald
parent
f0a6567cd8
commit
487d78cc72
@@ -10,7 +10,7 @@ import JobTemplateForm from '../shared/JobTemplateForm';
|
|||||||
import ContentLoading from '../../../components/ContentLoading';
|
import ContentLoading from '../../../components/ContentLoading';
|
||||||
import { CardBody } from '../../../components/Card';
|
import { CardBody } from '../../../components/Card';
|
||||||
|
|
||||||
function JobTemplateEdit({ template }) {
|
function JobTemplateEdit({ template, reloadTemplate }) {
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
const [formSubmitError, setFormSubmitError] = useState(null);
|
const [formSubmitError, setFormSubmitError] = useState(null);
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
@@ -64,6 +64,7 @@ function JobTemplateEdit({ template }) {
|
|||||||
submitInstanceGroups(instanceGroups, initialInstanceGroups),
|
submitInstanceGroups(instanceGroups, initialInstanceGroups),
|
||||||
submitCredentials(credentials),
|
submitCredentials(credentials),
|
||||||
]);
|
]);
|
||||||
|
reloadTemplate();
|
||||||
history.push(detailsUrl);
|
history.push(detailsUrl);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setFormSubmitError(error);
|
setFormSubmitError(error);
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ function Template({ setBreadcrumb }) {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
loadTemplateAndRoles();
|
loadTemplateAndRoles();
|
||||||
}, [loadTemplateAndRoles, location.pathname]);
|
}, [loadTemplateAndRoles]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (template) {
|
if (template) {
|
||||||
@@ -205,7 +205,10 @@ function Template({ setBreadcrumb }) {
|
|||||||
/>
|
/>
|
||||||
</Route>
|
</Route>
|
||||||
<Route key="edit" path="/templates/:templateType/:id/edit">
|
<Route key="edit" path="/templates/:templateType/:id/edit">
|
||||||
<JobTemplateEdit template={template} />
|
<JobTemplateEdit
|
||||||
|
template={template}
|
||||||
|
reloadTemplate={loadTemplateAndRoles}
|
||||||
|
/>
|
||||||
</Route>
|
</Route>
|
||||||
<Route key="access" path="/templates/:templateType/:id/access">
|
<Route key="access" path="/templates/:templateType/:id/access">
|
||||||
<ResourceAccessList
|
<ResourceAccessList
|
||||||
|
|||||||
Reference in New Issue
Block a user