From 33bc9e63c4115bb0d5ac2852bc36fbcedb54de25 Mon Sep 17 00:00:00 2001 From: Alex Corey Date: Fri, 10 Jan 2020 09:17:00 -0500 Subject: [PATCH] Addresses Console Errors related to functions and test data Also Adds speecificity to link URLs by add /details for urls that should redireect to details pages instead of them ending in /:id --- .../src/screens/Host/HostDetail/HostDetail.jsx | 14 ++------------ awx/ui_next/src/screens/Host/HostList/HostList.jsx | 2 +- .../Inventory/InventoryGroup/InventoryGroup.jsx | 1 - .../InventoryGroup/InventoryGroup.test.jsx | 2 -- .../JobTemplateDetail/JobTemplateDetail.test.jsx | 2 -- 5 files changed, 3 insertions(+), 18 deletions(-) diff --git a/awx/ui_next/src/screens/Host/HostDetail/HostDetail.jsx b/awx/ui_next/src/screens/Host/HostDetail/HostDetail.jsx index 282edbc471..2ca4fe86ab 100644 --- a/awx/ui_next/src/screens/Host/HostDetail/HostDetail.jsx +++ b/awx/ui_next/src/screens/Host/HostDetail/HostDetail.jsx @@ -14,16 +14,6 @@ import DeleteButton from '@components/DeleteButton'; import Switch from '@components/Switch'; import { HostsAPI } from '@api'; -function HostDetail({ host, i18n }) { -const ActionButtonWrapper = styled.div` - display: flex; - justify-content: flex-end; - margin-top: 20px; - & > :not(:first-child) { - margin-left: 20px; - } -`; - function HostDetail({ host, history, match, i18n, onUpdateHost }) { const { created, description, id, modified, name, summary_fields } = host; @@ -150,7 +140,6 @@ function HostDetail({ host, history, match, i18n, onUpdateHost }) { {i18n._(t`Edit`)} )} - {summary_fields.user_capabilities && summary_fields.user_capabilities.delete && ( )} + ); } @@ -167,4 +157,4 @@ HostDetail.propTypes = { host: Host.isRequired, }; -export default withI18n()(HostDetail); +export default withI18n()(withRouter(HostDetail)); diff --git a/awx/ui_next/src/screens/Host/HostList/HostList.jsx b/awx/ui_next/src/screens/Host/HostList/HostList.jsx index 978ff2ba59..026714728f 100644 --- a/awx/ui_next/src/screens/Host/HostList/HostList.jsx +++ b/awx/ui_next/src/screens/Host/HostList/HostList.jsx @@ -235,7 +235,7 @@ class HostsList extends Component { row.id === o.id)} onSelect={() => this.handleSelect(o)} onToggleHost={this.handleHostToggle} diff --git a/awx/ui_next/src/screens/Inventory/InventoryGroup/InventoryGroup.jsx b/awx/ui_next/src/screens/Inventory/InventoryGroup/InventoryGroup.jsx index eed60f4254..f23455558a 100644 --- a/awx/ui_next/src/screens/Inventory/InventoryGroup/InventoryGroup.jsx +++ b/awx/ui_next/src/screens/Inventory/InventoryGroup/InventoryGroup.jsx @@ -49,7 +49,6 @@ function InventoryGroups({ i18n, match, setBreadcrumb, inventory, history }) { ), link: `/inventories/inventory/${inventory.id}/groups`, id: 99, - isNestedTab: true, }, { name: i18n._(t`Details`), diff --git a/awx/ui_next/src/screens/Inventory/InventoryGroup/InventoryGroup.test.jsx b/awx/ui_next/src/screens/Inventory/InventoryGroup/InventoryGroup.test.jsx index b7eb395a64..9b5afe74bd 100644 --- a/awx/ui_next/src/screens/Inventory/InventoryGroup/InventoryGroup.test.jsx +++ b/awx/ui_next/src/screens/Inventory/InventoryGroup/InventoryGroup.test.jsx @@ -14,8 +14,6 @@ GroupsAPI.readDetail.mockResolvedValue({ name: 'Foo', description: 'Bar', variables: 'bizz: buzz', - created: '1/12/2019', - modified: '1/13/2019', summary_fields: { inventory: { id: 1 }, created_by: { id: 1, username: 'Athena' }, diff --git a/awx/ui_next/src/screens/Template/JobTemplateDetail/JobTemplateDetail.test.jsx b/awx/ui_next/src/screens/Template/JobTemplateDetail/JobTemplateDetail.test.jsx index 033da2b338..a06d1e8db5 100644 --- a/awx/ui_next/src/screens/Template/JobTemplateDetail/JobTemplateDetail.test.jsx +++ b/awx/ui_next/src/screens/Template/JobTemplateDetail/JobTemplateDetail.test.jsx @@ -17,8 +17,6 @@ describe('', () => { playbook: '', id: 1, verbosity: 1, - created: '1/12/2019', - modified: '1/13/2019', summary_fields: { user_capabilities: { edit: true }, created_by: { id: 1, username: 'Joe' },