diff --git a/awx/ui_next/src/screens/Template/WorkflowJobTemplate.jsx b/awx/ui_next/src/screens/Template/WorkflowJobTemplate.jsx index 1a71bb644f..22d1dcd187 100644 --- a/awx/ui_next/src/screens/Template/WorkflowJobTemplate.jsx +++ b/awx/ui_next/src/screens/Template/WorkflowJobTemplate.jsx @@ -47,7 +47,7 @@ class WorkflowJobTemplate extends Component { const { setBreadcrumb, match } = this.props; const { id } = match.params; - this.setState({ contentError: null, hasContentLoading: true }); + this.setState({ contentError: null }); try { const { data } = await WorkflowJobTemplatesAPI.readDetail(id); if (data?.related?.webhook_key) { @@ -113,22 +113,17 @@ class WorkflowJobTemplate extends Component { tab.id = n; }); - let cardHeader = hasContentLoading ? null : ( - - - - - - - ); - - if (location.pathname.endsWith('edit')) { - cardHeader = null; - } if (hasContentLoading) { - return ; + return ( + + + + + + ); } - if (!hasContentLoading && contentError) { + + if (contentError) { return ( @@ -145,10 +140,19 @@ class WorkflowJobTemplate extends Component { ); } + const cardHeader = ( + + + + + + + ); + return ( - {cardHeader} + {location.pathname.endsWith('edit') ? null : cardHeader} )} - {template.id && ( + {template?.id && ( ( @@ -215,19 +219,17 @@ class WorkflowJobTemplate extends Component { - !hasContentLoading && ( - - {match.params.id && ( - - {i18n._(`View Template Details`)} - - )} - - ) - } + render={() => ( + + {match.params.id && ( + + {i18n._(`View Template Details`)} + + )} + + )} />