mirror of
https://github.com/ansible/awx.git
synced 2026-05-20 07:17:40 -02:30
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
This commit is contained in:
@@ -113,7 +113,6 @@ function ExecutionEnvironmentDetails({ executionEnvironment }) {
|
|||||||
dataCy="execution-environment-modified"
|
dataCy="execution-environment-modified"
|
||||||
/>
|
/>
|
||||||
</DetailList>
|
</DetailList>
|
||||||
{!managedByTower && (
|
|
||||||
<CardActionsRow>
|
<CardActionsRow>
|
||||||
{summary_fields.user_capabilities?.edit && (
|
{summary_fields.user_capabilities?.edit && (
|
||||||
<Button
|
<Button
|
||||||
@@ -139,7 +138,6 @@ function ExecutionEnvironmentDetails({ executionEnvironment }) {
|
|||||||
</DeleteButton>
|
</DeleteButton>
|
||||||
)}
|
)}
|
||||||
</CardActionsRow>
|
</CardActionsRow>
|
||||||
)}
|
|
||||||
|
|
||||||
{error && (
|
{error && (
|
||||||
<AlertModal
|
<AlertModal
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ describe('<ExecutionEnvironmentDetails/>', () => {
|
|||||||
expect(history.location.pathname).toBe('/execution_environments');
|
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 () => {
|
await act(async () => {
|
||||||
wrapper = mountWithContexts(
|
wrapper = mountWithContexts(
|
||||||
<ExecutionEnvironmentDetails
|
<ExecutionEnvironmentDetails
|
||||||
@@ -185,9 +185,9 @@ describe('<ExecutionEnvironmentDetails/>', () => {
|
|||||||
expect(dates).toHaveLength(2);
|
expect(dates).toHaveLength(2);
|
||||||
expect(dates.at(0).prop('date')).toEqual(executionEnvironment.created);
|
expect(dates.at(0).prop('date')).toEqual(executionEnvironment.created);
|
||||||
expect(dates.at(1).prop('date')).toEqual(executionEnvironment.modified);
|
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 () => {
|
test('should have proper number of delete detail requests', async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user