From 44cd8819f4494f0828da1ed64bd631a68e6501ec Mon Sep 17 00:00:00 2001 From: mabashian Date: Thu, 18 Mar 2021 17:07:18 -0400 Subject: [PATCH] Remove CollapsibleSection as it's no longer used in the app. Adds ouiaId's to various buttons. --- .../AdHocCommands/AdHocCommands.jsx | 1 + .../AssociateModal/AssociateModal.jsx | 2 + .../ClipboardCopyButton.jsx | 2 + .../CollapsibleSection/CollapsibleSection.jsx | 58 ------------------- .../CollapsibleSection.test.jsx | 26 --------- .../CollapsibleSection/ExpandingContainer.jsx | 44 -------------- .../components/CollapsibleSection/index.js | 1 - .../components/DeleteButton/DeleteButton.jsx | 2 + .../DisassociateButton/DisassociateButton.jsx | 3 + .../ExpandCollapse/ExpandCollapse.jsx | 2 + .../FormActionGroup/FormActionGroup.jsx | 4 +- .../components/FormField/PasswordInput.jsx | 1 + .../JobList/JobListCancelButton.jsx | 3 + .../src/components/JobList/JobListItem.jsx | 1 + .../LaunchButton/ReLaunchDropDown.jsx | 3 +- .../components/Lookup/HostFilterLookup.jsx | 9 ++- .../DeleteRoleConfirmationModal.jsx | 8 ++- .../DeleteRoleConfirmationModal.test.jsx.snap | 18 ++++-- .../ScheduleDetail/ScheduleDetail.jsx | 1 + .../ScheduleList/ScheduleListItem.jsx | 1 + .../Schedule/shared/ScheduleForm.jsx | 3 + .../components/ScreenHeader/ScreenHeader.jsx | 1 + .../TemplateList/TemplateListItem.jsx | 3 + .../UserAndTeamAccessAdd.jsx | 1 + .../src/components/Workflow/WorkflowTools.jsx | 13 ++++- .../ActivityStreamDetailButton.jsx | 1 + .../ApplicationDetails/ApplicationDetails.jsx | 1 + .../ApplicationsList/ApplicationListItem.jsx | 1 + .../CredentialDetail/CredentialDetail.jsx | 6 +- .../CredentialList/CredentialListItem.jsx | 1 + .../Credential/shared/CredentialForm.jsx | 3 + .../CredentialPluginField.jsx | 2 + .../CredentialPluginPrompt.jsx | 4 ++ .../CredentialPluginSelected.jsx | 2 + .../Credential/shared/ExternalTestModal.jsx | 2 + .../CredentialTypeDetails.jsx | 1 + .../CredentialTypeListItem.jsx | 1 + .../ExecutionEnvironmentDetails.jsx | 2 +- .../ExecutionEnvironmentListItem.jsx | 2 +- .../screens/Host/HostDetail/HostDetail.jsx | 1 + .../screens/Host/HostGroups/HostGroupItem.jsx | 7 ++- .../screens/Host/HostList/HostListItem.jsx | 1 + .../Host/HostList/SmartInventoryButton.jsx | 1 + .../ContainerGroupDetails.jsx | 1 + .../InstanceGroupDetails.jsx | 1 + .../InstanceGroupListItem.jsx | 1 + .../InventoryDetail/InventoryDetail.jsx | 1 + .../InventoryGroupDetail.jsx | 1 + .../InventoryGroupHostListItem.jsx | 1 + .../InventoryGroups/InventoryGroupItem.jsx | 1 + .../InventoryHostDetail.jsx | 1 + .../InventoryHostGroupItem.jsx | 7 ++- .../InventoryHosts/InventoryHostItem.jsx | 7 ++- .../InventoryList/InventoryListItem.jsx | 1 + .../InventoryRelatedGroupListItem.jsx | 1 + .../InventorySourceDetail.jsx | 1 + .../InventorySources/InventorySourceList.jsx | 1 + .../InventorySourceListItem.jsx | 1 + .../SmartInventoryDetail.jsx | 1 + .../shared/InventorySourceSyncButton.jsx | 2 + .../src/screens/Job/JobDetail/JobDetail.jsx | 12 +++- .../ManagementJobListItem.jsx | 1 + .../NotificationTemplateDetail.jsx | 1 + .../OrganizationDetail/OrganizationDetail.jsx | 1 + .../OrganizationList/OrganizationListItem.jsx | 1 + .../OrganizationTeamListItem.jsx | 1 + .../Project/ProjectDetail/ProjectDetail.jsx | 1 + .../ProjectJobTemplatesListItem.jsx | 2 + .../Project/ProjectList/ProjectListItem.jsx | 2 + .../Project/shared/ProjectSyncButton.jsx | 1 + .../ActivityStreamDetail.jsx | 2 +- .../AzureAD/AzureADDetail/AzureADDetail.jsx | 2 +- .../GitHub/GitHubDetail/GitHubDetail.jsx | 2 +- .../GoogleOAuth2Detail/GoogleOAuth2Detail.jsx | 2 +- .../Setting/Jobs/JobsDetail/JobsDetail.jsx | 2 +- .../Setting/LDAP/LDAPDetail/LDAPDetail.jsx | 2 +- .../License/LicenseDetail/LicenseDetail.jsx | 2 +- .../Logging/LoggingDetail/LoggingDetail.jsx | 2 +- .../MiscSystemDetail/MiscSystemDetail.jsx | 2 +- .../RADIUS/RADIUSDetail/RADIUSDetail.jsx | 2 +- .../Setting/SAML/SAMLDetail/SAMLDetail.jsx | 2 +- .../TACACS/TACACSDetail/TACACSDetail.jsx | 2 +- .../screens/Setting/UI/UIDetail/UIDetail.jsx | 2 +- .../screens/Setting/shared/RevertAllAlert.jsx | 4 +- .../screens/Team/TeamDetail/TeamDetail.jsx | 1 + .../screens/Team/TeamList/TeamListItem.jsx | 1 + .../screens/Team/TeamRoles/TeamRolesList.jsx | 2 + .../JobTemplateDetail/JobTemplateDetail.jsx | 8 ++- .../screens/Template/Survey/SurveyList.jsx | 2 + .../Template/Survey/SurveyListItem.jsx | 2 + .../screens/Template/Survey/SurveyToolbar.jsx | 1 + .../WorkflowJobTemplateDetail.jsx | 8 ++- .../Modals/DeleteAllNodesModal.jsx | 2 + .../Modals/LinkModals/LinkDeleteModal.jsx | 2 + .../Modals/LinkModals/LinkModal.jsx | 2 + .../Modals/NodeModals/NodeDeleteModal.jsx | 2 + .../Modals/NodeModals/NodeModal.jsx | 2 + .../Modals/NodeModals/NodeNextButton.jsx | 1 + .../Modals/NodeModals/NodeViewModal.jsx | 1 + .../Modals/UnsavedChangesModal.jsx | 2 + .../VisualizerStartScreen.jsx | 1 + .../VisualizerToolbar.jsx | 2 + .../Template/shared/WebhookSubForm.jsx | 1 + .../screens/User/UserDetail/UserDetail.jsx | 1 + .../screens/User/UserList/UserListItem.jsx | 1 + .../screens/User/UserRoles/UserRolesList.jsx | 2 + .../WorkflowApprovalDetail.jsx | 2 + .../WorkflowApprovalListApproveButton.jsx | 1 + .../WorkflowApprovalListDenyButton.jsx | 1 + 109 files changed, 220 insertions(+), 164 deletions(-) delete mode 100644 awx/ui_next/src/components/CollapsibleSection/CollapsibleSection.jsx delete mode 100644 awx/ui_next/src/components/CollapsibleSection/CollapsibleSection.test.jsx delete mode 100644 awx/ui_next/src/components/CollapsibleSection/ExpandingContainer.jsx delete mode 100644 awx/ui_next/src/components/CollapsibleSection/index.js diff --git a/awx/ui_next/src/components/AdHocCommands/AdHocCommands.jsx b/awx/ui_next/src/components/AdHocCommands/AdHocCommands.jsx index 89387b9e8b..b4523b4bdd 100644 --- a/awx/ui_next/src/components/AdHocCommands/AdHocCommands.jsx +++ b/awx/ui_next/src/components/AdHocCommands/AdHocCommands.jsx @@ -128,6 +128,7 @@ function AdHocCommands({ adHocItems, i18n, hasListItems }) { ) : ( -
- - - {children} - - - ); -} -CollapsibleSection.propTypes = { - label: string.isRequired, - startExpanded: bool, -}; -CollapsibleSection.defaultProps = { - startExpanded: false, -}; - -export default CollapsibleSection; diff --git a/awx/ui_next/src/components/CollapsibleSection/CollapsibleSection.test.jsx b/awx/ui_next/src/components/CollapsibleSection/CollapsibleSection.test.jsx deleted file mode 100644 index d3b5d09930..0000000000 --- a/awx/ui_next/src/components/CollapsibleSection/CollapsibleSection.test.jsx +++ /dev/null @@ -1,26 +0,0 @@ -import React from 'react'; -import { shallow } from 'enzyme'; -import CollapsibleSection from './CollapsibleSection'; - -describe('', () => { - it('should render contents', () => { - const wrapper = shallow( - foo - ); - expect(wrapper.find('Button > *').prop('isExpanded')).toEqual(false); - expect(wrapper.find('ExpandingContainer').prop('isExpanded')).toEqual( - false - ); - expect(wrapper.find('ExpandingContainer').prop('children')).toEqual('foo'); - }); - - it('should toggle when clicked', () => { - const wrapper = shallow( - foo - ); - expect(wrapper.find('Button > *').prop('isExpanded')).toEqual(false); - wrapper.find('Button').simulate('click'); - expect(wrapper.find('Button > *').prop('isExpanded')).toEqual(true); - expect(wrapper.find('ExpandingContainer').prop('isExpanded')).toEqual(true); - }); -}); diff --git a/awx/ui_next/src/components/CollapsibleSection/ExpandingContainer.jsx b/awx/ui_next/src/components/CollapsibleSection/ExpandingContainer.jsx deleted file mode 100644 index 346297c94a..0000000000 --- a/awx/ui_next/src/components/CollapsibleSection/ExpandingContainer.jsx +++ /dev/null @@ -1,44 +0,0 @@ -import 'styled-components/macro'; -import React, { useState, useEffect, useRef } from 'react'; -import { bool } from 'prop-types'; -import styled from 'styled-components'; - -const Container = styled.div` - margin: 15px 0; - transition: height 0.2s ease-out; - ${props => props.hideOverflow && `overflow: hidden;`} -`; - -function ExpandingContainer({ isExpanded, children }) { - const [contentHeight, setContentHeight] = useState(0); - const [hideOverflow, setHideOverflow] = useState(!isExpanded); - const ref = useRef(null); - useEffect(() => { - ref.current.addEventListener('transitionend', () => { - setHideOverflow(!isExpanded); - }); - }); - useEffect(() => { - setContentHeight(ref.current.scrollHeight); - }, [setContentHeight, children]); - const height = isExpanded ? contentHeight : '0'; - return ( - - {children} - - ); -} -ExpandingContainer.propTypes = { - isExpanded: bool, -}; -ExpandingContainer.defaultProps = { - isExpanded: false, -}; - -export default ExpandingContainer; diff --git a/awx/ui_next/src/components/CollapsibleSection/index.js b/awx/ui_next/src/components/CollapsibleSection/index.js deleted file mode 100644 index a4623e90ed..0000000000 --- a/awx/ui_next/src/components/CollapsibleSection/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './CollapsibleSection'; diff --git a/awx/ui_next/src/components/DeleteButton/DeleteButton.jsx b/awx/ui_next/src/components/DeleteButton/DeleteButton.jsx index f17bd9ca95..68963bcf12 100644 --- a/awx/ui_next/src/components/DeleteButton/DeleteButton.jsx +++ b/awx/ui_next/src/components/DeleteButton/DeleteButton.jsx @@ -35,6 +35,7 @@ function DeleteButton({ onClose={() => setIsOpen(false)} actions={[ , - , ]} diff --git a/awx/ui_next/src/components/ResourceAccessList/DeleteRoleConfirmationModal.jsx b/awx/ui_next/src/components/ResourceAccessList/DeleteRoleConfirmationModal.jsx index 7e5777c627..d06c75b36d 100644 --- a/awx/ui_next/src/components/ResourceAccessList/DeleteRoleConfirmationModal.jsx +++ b/awx/ui_next/src/components/ResourceAccessList/DeleteRoleConfirmationModal.jsx @@ -29,6 +29,7 @@ function DeleteRoleConfirmationModal({ onClose={onCancel} actions={[ , - , ]} diff --git a/awx/ui_next/src/components/ResourceAccessList/__snapshots__/DeleteRoleConfirmationModal.test.jsx.snap b/awx/ui_next/src/components/ResourceAccessList/__snapshots__/DeleteRoleConfirmationModal.test.jsx.snap index 820035723e..a1dd54a0a3 100644 --- a/awx/ui_next/src/components/ResourceAccessList/__snapshots__/DeleteRoleConfirmationModal.test.jsx.snap +++ b/awx/ui_next/src/components/ResourceAccessList/__snapshots__/DeleteRoleConfirmationModal.test.jsx.snap @@ -23,12 +23,14 @@ exports[` should render initially 1`] = ` , , , , )} diff --git a/awx/ui_next/src/screens/Credential/CredentialList/CredentialListItem.jsx b/awx/ui_next/src/screens/Credential/CredentialList/CredentialListItem.jsx index 34662e5ed2..78bc9b74e4 100644 --- a/awx/ui_next/src/screens/Credential/CredentialList/CredentialListItem.jsx +++ b/awx/ui_next/src/screens/Credential/CredentialList/CredentialListItem.jsx @@ -63,6 +63,7 @@ function CredentialListItem({ diff --git a/awx/ui_next/src/screens/ExecutionEnvironment/ExecutionEnvironmentList/ExecutionEnvironmentListItem.jsx b/awx/ui_next/src/screens/ExecutionEnvironment/ExecutionEnvironmentList/ExecutionEnvironmentListItem.jsx index 07816ff5fc..ab38b3e00a 100644 --- a/awx/ui_next/src/screens/ExecutionEnvironment/ExecutionEnvironmentList/ExecutionEnvironmentListItem.jsx +++ b/awx/ui_next/src/screens/ExecutionEnvironment/ExecutionEnvironmentList/ExecutionEnvironmentListItem.jsx @@ -81,7 +81,7 @@ function ExecutionEnvironmentListItem({ tooltip={i18n._(t`Edit Execution Environment`)} > diff --git a/awx/ui_next/src/screens/Host/HostList/HostListItem.jsx b/awx/ui_next/src/screens/Host/HostList/HostListItem.jsx index 87c4d4eff6..efcd070427 100644 --- a/awx/ui_next/src/screens/Host/HostList/HostListItem.jsx +++ b/awx/ui_next/src/screens/Host/HostList/HostListItem.jsx @@ -52,6 +52,7 @@ function HostListItem({ tooltip={i18n._(t`Edit Host`)} > diff --git a/awx/ui_next/src/screens/Inventory/InventoryHosts/InventoryHostItem.jsx b/awx/ui_next/src/screens/Inventory/InventoryHosts/InventoryHostItem.jsx index 2fa80ede52..61b9242a0b 100644 --- a/awx/ui_next/src/screens/Inventory/InventoryHosts/InventoryHostItem.jsx +++ b/awx/ui_next/src/screens/Inventory/InventoryHosts/InventoryHostItem.jsx @@ -66,7 +66,12 @@ function InventoryHostItem(props) { {host.summary_fields.user_capabilities?.edit && ( - diff --git a/awx/ui_next/src/screens/Inventory/InventoryList/InventoryListItem.jsx b/awx/ui_next/src/screens/Inventory/InventoryList/InventoryListItem.jsx index 2b2f660efd..5d3275b6e8 100644 --- a/awx/ui_next/src/screens/Inventory/InventoryList/InventoryListItem.jsx +++ b/awx/ui_next/src/screens/Inventory/InventoryList/InventoryListItem.jsx @@ -115,6 +115,7 @@ function InventoryListItem({ tooltip={i18n._(t`Edit Inventory`)} > )} diff --git a/awx/ui_next/src/screens/ManagementJob/ManagementJobList/ManagementJobListItem.jsx b/awx/ui_next/src/screens/ManagementJob/ManagementJobList/ManagementJobListItem.jsx index 06ca1b8dc4..0347cfa47a 100644 --- a/awx/ui_next/src/screens/ManagementJob/ManagementJobList/ManagementJobListItem.jsx +++ b/awx/ui_next/src/screens/ManagementJob/ManagementJobList/ManagementJobListItem.jsx @@ -95,6 +95,7 @@ function ManagementJobListItem({ position="top" > diff --git a/awx/ui_next/src/screens/Setting/UI/UIDetail/UIDetail.jsx b/awx/ui_next/src/screens/Setting/UI/UIDetail/UIDetail.jsx index e65f176b83..02e4873f59 100644 --- a/awx/ui_next/src/screens/Setting/UI/UIDetail/UIDetail.jsx +++ b/awx/ui_next/src/screens/Setting/UI/UIDetail/UIDetail.jsx @@ -94,7 +94,7 @@ function UIDetail({ i18n }) { aria-label={i18n._(t`Edit`)} component={Link} to="/settings/ui/edit" - ouiaId="edit-button" + ouiaId="ui-detail-edit-button" > {i18n._(t`Edit`)} diff --git a/awx/ui_next/src/screens/Setting/shared/RevertAllAlert.jsx b/awx/ui_next/src/screens/Setting/shared/RevertAllAlert.jsx index 96983f02e0..3622e0afd2 100644 --- a/awx/ui_next/src/screens/Setting/shared/RevertAllAlert.jsx +++ b/awx/ui_next/src/screens/Setting/shared/RevertAllAlert.jsx @@ -14,20 +14,20 @@ function RevertAllAlert({ i18n, onClose, onRevertAll }) { ouiaId="revert-all-modal" actions={[ , , diff --git a/awx/ui_next/src/screens/Team/TeamDetail/TeamDetail.jsx b/awx/ui_next/src/screens/Team/TeamDetail/TeamDetail.jsx index 8347c1c735..b624d995e2 100644 --- a/awx/ui_next/src/screens/Team/TeamDetail/TeamDetail.jsx +++ b/awx/ui_next/src/screens/Team/TeamDetail/TeamDetail.jsx @@ -54,6 +54,7 @@ function TeamDetail({ team, i18n }) { {summary_fields.user_capabilities && summary_fields.user_capabilities.edit && ( )} diff --git a/awx/ui_next/src/screens/Template/Survey/SurveyList.jsx b/awx/ui_next/src/screens/Template/Survey/SurveyList.jsx index 45ff07dd79..939b08e0ce 100644 --- a/awx/ui_next/src/screens/Template/Survey/SurveyList.jsx +++ b/awx/ui_next/src/screens/Template/Survey/SurveyList.jsx @@ -98,6 +98,7 @@ function SurveyList({ }} actions={[ )} diff --git a/awx/ui_next/src/screens/Template/WorkflowJobTemplateVisualizer/Modals/DeleteAllNodesModal.jsx b/awx/ui_next/src/screens/Template/WorkflowJobTemplateVisualizer/Modals/DeleteAllNodesModal.jsx index bae18f2011..99fc39810f 100644 --- a/awx/ui_next/src/screens/Template/WorkflowJobTemplateVisualizer/Modals/DeleteAllNodesModal.jsx +++ b/awx/ui_next/src/screens/Template/WorkflowJobTemplateVisualizer/Modals/DeleteAllNodesModal.jsx @@ -11,6 +11,7 @@ function DeleteAllNodesModal({ i18n }) { ,