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