From 8f54627ea6877a9550c4f7cf36e7d1e30c98b923 Mon Sep 17 00:00:00 2001 From: nixocio Date: Tue, 11 May 2021 13:39:07 -0400 Subject: [PATCH] Display Edit/Delete on EE details page as per last API changes Display Edit/Delete buttons on details page for EE managed by tower. See: https://github.com/ansible/awx/issues/10078 --- .../ExecutionEnvironmentDetails.jsx | 52 +++++++++---------- .../ExecutionEnvironmentDetails.test.jsx | 6 +-- 2 files changed, 28 insertions(+), 30 deletions(-) diff --git a/awx/ui_next/src/screens/ExecutionEnvironment/ExecutionEnvironmentDetails/ExecutionEnvironmentDetails.jsx b/awx/ui_next/src/screens/ExecutionEnvironment/ExecutionEnvironmentDetails/ExecutionEnvironmentDetails.jsx index 91089240f5..56792f56a7 100644 --- a/awx/ui_next/src/screens/ExecutionEnvironment/ExecutionEnvironmentDetails/ExecutionEnvironmentDetails.jsx +++ b/awx/ui_next/src/screens/ExecutionEnvironment/ExecutionEnvironmentDetails/ExecutionEnvironmentDetails.jsx @@ -113,33 +113,31 @@ function ExecutionEnvironmentDetails({ executionEnvironment }) { dataCy="execution-environment-modified" /> - {!managedByTower && ( - - {summary_fields.user_capabilities?.edit && ( - - )} - {summary_fields.user_capabilities?.delete && ( - - {t`Delete`} - - )} - - )} + + {summary_fields.user_capabilities?.edit && ( + + )} + {summary_fields.user_capabilities?.delete && ( + + {t`Delete`} + + )} + {error && ( ', () => { expect(history.location.pathname).toBe('/execution_environments'); }); - test('should not render action buttons to ee managed by tower', async () => { + test('should render action buttons to ee managed by tower', async () => { await act(async () => { wrapper = mountWithContexts( ', () => { expect(dates).toHaveLength(2); expect(dates.at(0).prop('date')).toEqual(executionEnvironment.created); expect(dates.at(1).prop('date')).toEqual(executionEnvironment.modified); - expect(wrapper.find('Button[aria-label="edit"]')).toHaveLength(0); + expect(wrapper.find('Button[aria-label="edit"]')).toHaveLength(1); - expect(wrapper.find('Button[aria-label="Delete"]')).toHaveLength(0); + expect(wrapper.find('Button[aria-label="Delete"]')).toHaveLength(1); }); test('should have proper number of delete detail requests', async () => {