From fb897891c91697cfb38c809b0530fb7560673820 Mon Sep 17 00:00:00 2001 From: "Keith J. Grant" Date: Mon, 14 Jun 2021 11:49:34 -0700 Subject: [PATCH] delete PaginatedDataList, move toolbar buttons to PaginatedTable dir --- .../AddDropDownButton/AddDropDownButton.jsx | 2 +- .../src/components/JobList/JobList.jsx | 7 +- .../PaginatedDataList/PaginatedDataList.jsx | 213 ------------------ .../PaginatedDataList.test.jsx | 93 -------- .../PaginatedDataListItem.jsx | 42 ---- .../src/components/PaginatedDataList/index.js | 4 - .../ToolbarAddButton.jsx | 0 .../ToolbarAddButton.test.jsx | 0 .../ToolbarDeleteButton.jsx | 0 .../ToolbarDeleteButton.test.jsx | 0 .../src/components/PaginatedTable/index.js | 2 + .../ResourceAccessList/ResourceAccessList.jsx | 7 +- .../Schedule/ScheduleList/ScheduleList.jsx | 8 +- .../components/TemplateList/TemplateList.jsx | 7 +- .../ApplicationTokenList.jsx | 2 +- .../ApplicationsList/ApplicationsList.jsx | 4 +- .../CredentialList/CredentialList.jsx | 6 +- .../CredentialTypeList/CredentialTypeList.jsx | 6 +- .../ExecutionEnvironmentList.jsx | 6 +- .../Host/HostGroups/HostGroupsList.jsx | 2 +- .../src/screens/Host/HostList/HostList.jsx | 6 +- .../InstanceGroupList/InstanceGroupList.jsx | 2 +- .../InstanceGroup/Instances/InstanceList.jsx | 2 +- .../InventoryGroups/InventoryGroupsList.jsx | 4 +- .../InventoryHostGroupsList.jsx | 2 +- .../InventoryHosts/InventoryHostList.jsx | 4 +- .../Inventory/InventoryList/InventoryList.jsx | 2 +- .../InventorySources/InventorySourceList.jsx | 4 +- .../NotificationTemplateList.jsx | 4 +- .../OrganizationList/OrganizationList.jsx | 6 +- .../ProjectJobTemplatesList.jsx | 4 +- .../Project/ProjectList/ProjectList.jsx | 6 +- .../src/screens/Team/TeamList/TeamList.jsx | 4 +- .../screens/Team/TeamRoles/TeamRolesList.jsx | 2 +- .../screens/Template/Survey/SurveyList.jsx | 2 +- .../screens/Template/Survey/SurveyToolbar.jsx | 2 +- .../src/screens/User/UserList/UserList.jsx | 4 +- .../screens/User/UserRoles/UserRolesList.jsx | 2 +- .../screens/User/UserTeams/UserTeamList.jsx | 2 +- .../User/UserTokenList/UserTokenList.jsx | 4 +- .../WorkflowApprovalList.jsx | 2 +- 41 files changed, 57 insertions(+), 424 deletions(-) delete mode 100644 awx/ui_next/src/components/PaginatedDataList/PaginatedDataList.jsx delete mode 100644 awx/ui_next/src/components/PaginatedDataList/PaginatedDataList.test.jsx delete mode 100644 awx/ui_next/src/components/PaginatedDataList/PaginatedDataListItem.jsx delete mode 100644 awx/ui_next/src/components/PaginatedDataList/index.js rename awx/ui_next/src/components/{PaginatedDataList => PaginatedTable}/ToolbarAddButton.jsx (100%) rename awx/ui_next/src/components/{PaginatedDataList => PaginatedTable}/ToolbarAddButton.test.jsx (100%) rename awx/ui_next/src/components/{PaginatedDataList => PaginatedTable}/ToolbarDeleteButton.jsx (100%) rename awx/ui_next/src/components/{PaginatedDataList => PaginatedTable}/ToolbarDeleteButton.test.jsx (100%) diff --git a/awx/ui_next/src/components/AddDropDownButton/AddDropDownButton.jsx b/awx/ui_next/src/components/AddDropDownButton/AddDropDownButton.jsx index 58d16923ea..8f5b97ae19 100644 --- a/awx/ui_next/src/components/AddDropDownButton/AddDropDownButton.jsx +++ b/awx/ui_next/src/components/AddDropDownButton/AddDropDownButton.jsx @@ -2,7 +2,7 @@ import React, { useState, useRef, useEffect, Fragment } from 'react'; import { t } from '@lingui/macro'; import PropTypes from 'prop-types'; import { Dropdown, DropdownPosition } from '@patternfly/react-core'; -import { ToolbarAddButton } from '../PaginatedDataList'; +import { ToolbarAddButton } from '../PaginatedTable'; import { useKebabifiedMenu } from '../../contexts/Kebabified'; function AddDropDownButton({ dropdownItems, ouiaId }) { diff --git a/awx/ui_next/src/components/JobList/JobList.jsx b/awx/ui_next/src/components/JobList/JobList.jsx index c2d113b829..ad4f094204 100644 --- a/awx/ui_next/src/components/JobList/JobList.jsx +++ b/awx/ui_next/src/components/JobList/JobList.jsx @@ -6,8 +6,11 @@ import { Card } from '@patternfly/react-core'; import AlertModal from '../AlertModal'; import DatalistToolbar from '../DataListToolbar'; import ErrorDetail from '../ErrorDetail'; -import { ToolbarDeleteButton } from '../PaginatedDataList'; -import PaginatedTable, { HeaderRow, HeaderCell } from '../PaginatedTable'; +import PaginatedTable, { + HeaderRow, + HeaderCell, + ToolbarDeleteButton, +} from '../PaginatedTable'; import useRequest, { useDeleteItems, useDismissableError, diff --git a/awx/ui_next/src/components/PaginatedDataList/PaginatedDataList.jsx b/awx/ui_next/src/components/PaginatedDataList/PaginatedDataList.jsx deleted file mode 100644 index 74a0596de1..0000000000 --- a/awx/ui_next/src/components/PaginatedDataList/PaginatedDataList.jsx +++ /dev/null @@ -1,213 +0,0 @@ -import React, { Fragment } from 'react'; - -import PropTypes from 'prop-types'; -import { DataList } from '@patternfly/react-core'; - -import { t } from '@lingui/macro'; -import { withRouter, useHistory, useLocation } from 'react-router-dom'; - -import ListHeader from '../ListHeader'; -import ContentEmpty from '../ContentEmpty'; -import ContentError from '../ContentError'; -import ContentLoading from '../ContentLoading'; -import Pagination from '../Pagination'; -import DataListToolbar from '../DataListToolbar'; - -import { parseQueryString, updateQueryString } from '../../util/qs'; - -import { QSConfig, SearchColumns, SortColumns } from '../../types'; - -import PaginatedDataListItem from './PaginatedDataListItem'; -import LoadingSpinner from '../LoadingSpinner'; - -function PaginatedDataList({ - items, - onRowClick, - contentError, - hasContentLoading, - emptyStateControls, - itemCount, - qsConfig, - renderItem, - toolbarSearchColumns, - toolbarSearchableKeys, - toolbarRelatedSearchableKeys, - toolbarSortColumns, - pluralizedItemName, - showPageSizeOptions, - location, - renderToolbar, -}) { - const { search, pathname } = useLocation(); - const history = useHistory(); - const handleListItemSelect = (id = 0) => { - const match = items.find(item => item.id === Number(id)); - onRowClick(match); - }; - - const handleSetPage = (event, pageNumber) => { - const qs = updateQueryString(qsConfig, search, { - page: pageNumber, - }); - pushHistoryState(qs); - }; - - const handleSetPageSize = (event, pageSize, page) => { - const qs = updateQueryString(qsConfig, search, { - page_size: pageSize, - page, - }); - pushHistoryState(qs); - }; - - const pushHistoryState = qs => { - history.push(qs ? `${pathname}?${qs}` : pathname); - }; - - const searchColumns = toolbarSearchColumns.length - ? toolbarSearchColumns - : [ - { - name: t`Name`, - key: 'name', - isDefault: true, - }, - ]; - const sortColumns = toolbarSortColumns.length - ? toolbarSortColumns - : [ - { - name: t`Name`, - key: 'name', - }, - ]; - const queryParams = parseQueryString(qsConfig, location.search); - - const dataListLabel = t`${pluralizedItemName} List`; - const emptyContentMessage = t`Please add ${pluralizedItemName} to populate this list `; - const emptyContentTitle = t`No ${pluralizedItemName} Found `; - - let Content; - if (hasContentLoading && items.length <= 0) { - Content = ; - } else if (contentError) { - Content = ; - } else if (items.length <= 0) { - Content = ( - - ); - } else { - Content = ( - <> - {hasContentLoading && } - handleListItemSelect(id)} - > - {items.map(renderItem)} - - - ); - } - - const ToolbarPagination = ( - - ); - - return ( - - - {Content} - {items.length ? ( - - ) : null} - - ); -} - -const Item = PropTypes.shape({ - id: PropTypes.number.isRequired, - url: PropTypes.string.isRequired, - name: PropTypes.string, -}); - -PaginatedDataList.propTypes = { - items: PropTypes.arrayOf(Item).isRequired, - itemCount: PropTypes.number.isRequired, - pluralizedItemName: PropTypes.string, - qsConfig: QSConfig.isRequired, - renderItem: PropTypes.func, - toolbarSearchColumns: SearchColumns, - toolbarSearchableKeys: PropTypes.arrayOf(PropTypes.string), - toolbarRelatedSearchableKeys: PropTypes.arrayOf(PropTypes.string), - toolbarSortColumns: SortColumns, - showPageSizeOptions: PropTypes.bool, - renderToolbar: PropTypes.func, - hasContentLoading: PropTypes.bool, - contentError: PropTypes.shape(), - onRowClick: PropTypes.func, -}; - -PaginatedDataList.defaultProps = { - hasContentLoading: false, - contentError: null, - toolbarSearchColumns: [], - toolbarSearchableKeys: [], - toolbarRelatedSearchableKeys: [], - toolbarSortColumns: [], - pluralizedItemName: 'Items', - showPageSizeOptions: true, - renderItem: ({ id, ...rest }) => ( - - ), - renderToolbar: props => , - onRowClick: () => null, -}; - -export { PaginatedDataList as _PaginatedDataList }; -export default withRouter(PaginatedDataList); diff --git a/awx/ui_next/src/components/PaginatedDataList/PaginatedDataList.test.jsx b/awx/ui_next/src/components/PaginatedDataList/PaginatedDataList.test.jsx deleted file mode 100644 index fe4b85b0b0..0000000000 --- a/awx/ui_next/src/components/PaginatedDataList/PaginatedDataList.test.jsx +++ /dev/null @@ -1,93 +0,0 @@ -import React from 'react'; -import { createMemoryHistory } from 'history'; -import { mountWithContexts } from '../../../testUtils/enzymeHelpers'; -import PaginatedDataList from './PaginatedDataList'; - -const mockData = [ - { id: 1, name: 'one', url: '/org/team/1' }, - { id: 2, name: 'two', url: '/org/team/2' }, - { id: 3, name: 'three', url: '/org/team/3' }, - { id: 4, name: 'four', url: '/org/team/4' }, - { id: 5, name: 'five', url: '/org/team/5' }, -]; - -const qsConfig = { - namespace: 'item', - defaultParams: { page: 1, page_size: 5, order_by: 'name' }, - integerFields: ['page', 'page_size'], -}; - -describe('', () => { - afterEach(() => { - jest.restoreAllMocks(); - }); - - test('initially renders successfully', () => { - mountWithContexts( - - ); - }); - - test('should navigate to page when Pagination calls onSetPage prop', () => { - const history = createMemoryHistory({ - initialEntries: ['/organizations/1/teams'], - }); - const wrapper = mountWithContexts( - , - { context: { router: { history } } } - ); - - const pagination = wrapper.find('Pagination').at(1); - pagination.prop('onSetPage')(null, 2); - expect(history.location.search).toEqual('?item.page=2'); - wrapper.update(); - pagination.prop('onSetPage')(null, 1); - // since page = 1 is the default, that should be strip out of the search - expect(history.location.search).toEqual(''); - }); - - test('should navigate to page when Pagination calls onPerPageSelect prop', () => { - const history = createMemoryHistory({ - initialEntries: ['/organizations/1/teams'], - }); - const wrapper = mountWithContexts( - , - { context: { router: { history } } } - ); - - const pagination = wrapper.find('Pagination').at(1); - pagination.prop('onPerPageSelect')(null, 25, 2); - expect(history.location.search).toEqual('?item.page=2&item.page_size=25'); - wrapper.update(); - // since page_size = 5 is the default, that should be strip out of the search - pagination.prop('onPerPageSelect')(null, 5, 2); - expect(history.location.search).toEqual('?item.page=2'); - }); -}); diff --git a/awx/ui_next/src/components/PaginatedDataList/PaginatedDataListItem.jsx b/awx/ui_next/src/components/PaginatedDataList/PaginatedDataListItem.jsx deleted file mode 100644 index 6db53493cb..0000000000 --- a/awx/ui_next/src/components/PaginatedDataList/PaginatedDataListItem.jsx +++ /dev/null @@ -1,42 +0,0 @@ -import React from 'react'; -import { Link } from 'react-router-dom'; -import { - DataListItem, - DataListItemRow, - DataListItemCells, - TextContent, -} from '@patternfly/react-core'; -import styled from 'styled-components'; -import DataListCell from '../DataListCell'; - -const DetailWrapper = styled(TextContent)` - display: grid; - grid-template-columns: - minmax(70px, max-content) - repeat(auto-fit, minmax(60px, max-content)); - grid-gap: 10px; -`; - -export default function PaginatedDataListItem({ item }) { - return ( - - - - - - {item.name} - - - , - ]} - /> - - - ); -} diff --git a/awx/ui_next/src/components/PaginatedDataList/index.js b/awx/ui_next/src/components/PaginatedDataList/index.js deleted file mode 100644 index 1a14967a71..0000000000 --- a/awx/ui_next/src/components/PaginatedDataList/index.js +++ /dev/null @@ -1,4 +0,0 @@ -export { default } from './PaginatedDataList'; -export { default as PaginatedDataListItem } from './PaginatedDataListItem'; -export { default as ToolbarDeleteButton } from './ToolbarDeleteButton'; -export { default as ToolbarAddButton } from './ToolbarAddButton'; diff --git a/awx/ui_next/src/components/PaginatedDataList/ToolbarAddButton.jsx b/awx/ui_next/src/components/PaginatedTable/ToolbarAddButton.jsx similarity index 100% rename from awx/ui_next/src/components/PaginatedDataList/ToolbarAddButton.jsx rename to awx/ui_next/src/components/PaginatedTable/ToolbarAddButton.jsx diff --git a/awx/ui_next/src/components/PaginatedDataList/ToolbarAddButton.test.jsx b/awx/ui_next/src/components/PaginatedTable/ToolbarAddButton.test.jsx similarity index 100% rename from awx/ui_next/src/components/PaginatedDataList/ToolbarAddButton.test.jsx rename to awx/ui_next/src/components/PaginatedTable/ToolbarAddButton.test.jsx diff --git a/awx/ui_next/src/components/PaginatedDataList/ToolbarDeleteButton.jsx b/awx/ui_next/src/components/PaginatedTable/ToolbarDeleteButton.jsx similarity index 100% rename from awx/ui_next/src/components/PaginatedDataList/ToolbarDeleteButton.jsx rename to awx/ui_next/src/components/PaginatedTable/ToolbarDeleteButton.jsx diff --git a/awx/ui_next/src/components/PaginatedDataList/ToolbarDeleteButton.test.jsx b/awx/ui_next/src/components/PaginatedTable/ToolbarDeleteButton.test.jsx similarity index 100% rename from awx/ui_next/src/components/PaginatedDataList/ToolbarDeleteButton.test.jsx rename to awx/ui_next/src/components/PaginatedTable/ToolbarDeleteButton.test.jsx diff --git a/awx/ui_next/src/components/PaginatedTable/index.js b/awx/ui_next/src/components/PaginatedTable/index.js index f4b1804d9a..93a5529090 100644 --- a/awx/ui_next/src/components/PaginatedTable/index.js +++ b/awx/ui_next/src/components/PaginatedTable/index.js @@ -2,3 +2,5 @@ export { default } from './PaginatedTable'; export { default as ActionsTd } from './ActionsTd'; export { default as HeaderRow, HeaderCell } from './HeaderRow'; export { default as ActionItem } from './ActionItem'; +export { default as ToolbarDeleteButton } from './ToolbarDeleteButton'; +export { default as ToolbarAddButton } from './ToolbarAddButton'; diff --git a/awx/ui_next/src/components/ResourceAccessList/ResourceAccessList.jsx b/awx/ui_next/src/components/ResourceAccessList/ResourceAccessList.jsx index 50cf3a2cf4..df8060aff1 100644 --- a/awx/ui_next/src/components/ResourceAccessList/ResourceAccessList.jsx +++ b/awx/ui_next/src/components/ResourceAccessList/ResourceAccessList.jsx @@ -5,8 +5,11 @@ import { RolesAPI, TeamsAPI, UsersAPI } from '../../api'; import AddResourceRole from '../AddRole/AddResourceRole'; import AlertModal from '../AlertModal'; import DataListToolbar from '../DataListToolbar'; -import PaginatedTable, { HeaderRow, HeaderCell } from '../PaginatedTable'; -import { ToolbarAddButton } from '../PaginatedDataList'; +import PaginatedTable, { + HeaderRow, + HeaderCell, + ToolbarAddButton, +} from '../PaginatedTable'; import { getQSConfig, parseQueryString } from '../../util/qs'; import useRequest, { useDeleteItems } from '../../util/useRequest'; import DeleteRoleConfirmationModal from './DeleteRoleConfirmationModal'; diff --git a/awx/ui_next/src/components/Schedule/ScheduleList/ScheduleList.jsx b/awx/ui_next/src/components/Schedule/ScheduleList/ScheduleList.jsx index 4a1a28e509..3ed3db2a44 100644 --- a/awx/ui_next/src/components/Schedule/ScheduleList/ScheduleList.jsx +++ b/awx/ui_next/src/components/Schedule/ScheduleList/ScheduleList.jsx @@ -6,9 +6,13 @@ import { t } from '@lingui/macro'; import { SchedulesAPI } from '../../../api'; import AlertModal from '../../AlertModal'; import ErrorDetail from '../../ErrorDetail'; -import PaginatedTable, { HeaderRow, HeaderCell } from '../../PaginatedTable'; +import PaginatedTable, { + HeaderRow, + HeaderCell, + ToolbarAddButton, + ToolbarDeleteButton, +} from '../../PaginatedTable'; import DataListToolbar from '../../DataListToolbar'; -import { ToolbarAddButton, ToolbarDeleteButton } from '../../PaginatedDataList'; import useRequest, { useDeleteItems } from '../../../util/useRequest'; import useSelected from '../../../util/useSelected'; import { getQSConfig, parseQueryString } from '../../../util/qs'; diff --git a/awx/ui_next/src/components/TemplateList/TemplateList.jsx b/awx/ui_next/src/components/TemplateList/TemplateList.jsx index 69a0e6b7f6..51bfcfd065 100644 --- a/awx/ui_next/src/components/TemplateList/TemplateList.jsx +++ b/awx/ui_next/src/components/TemplateList/TemplateList.jsx @@ -10,8 +10,11 @@ import { import AlertModal from '../AlertModal'; import DatalistToolbar from '../DataListToolbar'; import ErrorDetail from '../ErrorDetail'; -import { ToolbarDeleteButton } from '../PaginatedDataList'; -import PaginatedTable, { HeaderRow, HeaderCell } from '../PaginatedTable'; +import PaginatedTable, { + HeaderRow, + HeaderCell, + ToolbarDeleteButton, +} from '../PaginatedTable'; import useRequest, { useDeleteItems } from '../../util/useRequest'; import useSelected from '../../util/useSelected'; import { getQSConfig, parseQueryString } from '../../util/qs'; diff --git a/awx/ui_next/src/screens/Application/ApplicationTokens/ApplicationTokenList.jsx b/awx/ui_next/src/screens/Application/ApplicationTokens/ApplicationTokenList.jsx index b7066e4c39..1fb14ba6c5 100644 --- a/awx/ui_next/src/screens/Application/ApplicationTokens/ApplicationTokenList.jsx +++ b/awx/ui_next/src/screens/Application/ApplicationTokens/ApplicationTokenList.jsx @@ -5,8 +5,8 @@ import { t } from '@lingui/macro'; import PaginatedTable, { HeaderCell, HeaderRow, + ToolbarDeleteButton, } from '../../../components/PaginatedTable'; -import { ToolbarDeleteButton } from '../../../components/PaginatedDataList'; import { getQSConfig, parseQueryString } from '../../../util/qs'; import { TokensAPI, ApplicationsAPI } from '../../../api'; import ErrorDetail from '../../../components/ErrorDetail'; diff --git a/awx/ui_next/src/screens/Application/ApplicationsList/ApplicationsList.jsx b/awx/ui_next/src/screens/Application/ApplicationsList/ApplicationsList.jsx index e9cb51e8f7..6b65664f9f 100644 --- a/awx/ui_next/src/screens/Application/ApplicationsList/ApplicationsList.jsx +++ b/awx/ui_next/src/screens/Application/ApplicationsList/ApplicationsList.jsx @@ -14,11 +14,9 @@ import { ApplicationsAPI } from '../../../api'; import PaginatedTable, { HeaderRow, HeaderCell, -} from '../../../components/PaginatedTable'; -import { ToolbarDeleteButton, ToolbarAddButton, -} from '../../../components/PaginatedDataList'; +} from '../../../components/PaginatedTable'; import useSelected from '../../../util/useSelected'; import ApplicationListItem from './ApplicationListItem'; diff --git a/awx/ui_next/src/screens/Credential/CredentialList/CredentialList.jsx b/awx/ui_next/src/screens/Credential/CredentialList/CredentialList.jsx index bd78478cdd..758aad3f21 100644 --- a/awx/ui_next/src/screens/Credential/CredentialList/CredentialList.jsx +++ b/awx/ui_next/src/screens/Credential/CredentialList/CredentialList.jsx @@ -7,13 +7,11 @@ import useSelected from '../../../util/useSelected'; import AlertModal from '../../../components/AlertModal'; import ErrorDetail from '../../../components/ErrorDetail'; import DataListToolbar from '../../../components/DataListToolbar'; -import { - ToolbarAddButton, - ToolbarDeleteButton, -} from '../../../components/PaginatedDataList'; import PaginatedTable, { HeaderRow, HeaderCell, + ToolbarAddButton, + ToolbarDeleteButton, } from '../../../components/PaginatedTable'; import useRequest, { useDeleteItems } from '../../../util/useRequest'; import { getQSConfig, parseQueryString } from '../../../util/qs'; diff --git a/awx/ui_next/src/screens/CredentialType/CredentialTypeList/CredentialTypeList.jsx b/awx/ui_next/src/screens/CredentialType/CredentialTypeList/CredentialTypeList.jsx index 4b93b28438..ed0242e158 100644 --- a/awx/ui_next/src/screens/CredentialType/CredentialTypeList/CredentialTypeList.jsx +++ b/awx/ui_next/src/screens/CredentialType/CredentialTypeList/CredentialTypeList.jsx @@ -8,13 +8,11 @@ import { CredentialTypesAPI } from '../../../api'; import { getQSConfig, parseQueryString } from '../../../util/qs'; import useRequest, { useDeleteItems } from '../../../util/useRequest'; import useSelected from '../../../util/useSelected'; -import { - ToolbarDeleteButton, - ToolbarAddButton, -} from '../../../components/PaginatedDataList'; import PaginatedTable, { HeaderRow, HeaderCell, + ToolbarDeleteButton, + ToolbarAddButton, } from '../../../components/PaginatedTable'; import ErrorDetail from '../../../components/ErrorDetail'; import AlertModal from '../../../components/AlertModal'; diff --git a/awx/ui_next/src/screens/ExecutionEnvironment/ExecutionEnvironmentList/ExecutionEnvironmentList.jsx b/awx/ui_next/src/screens/ExecutionEnvironment/ExecutionEnvironmentList/ExecutionEnvironmentList.jsx index 6db687b031..04753bbe0c 100644 --- a/awx/ui_next/src/screens/ExecutionEnvironment/ExecutionEnvironmentList/ExecutionEnvironmentList.jsx +++ b/awx/ui_next/src/screens/ExecutionEnvironment/ExecutionEnvironmentList/ExecutionEnvironmentList.jsx @@ -7,13 +7,11 @@ import { ExecutionEnvironmentsAPI } from '../../../api'; import { getQSConfig, parseQueryString } from '../../../util/qs'; import useRequest, { useDeleteItems } from '../../../util/useRequest'; import useSelected from '../../../util/useSelected'; -import { - ToolbarDeleteButton, - ToolbarAddButton, -} from '../../../components/PaginatedDataList'; import PaginatedTable, { HeaderRow, HeaderCell, + ToolbarDeleteButton, + ToolbarAddButton, } from '../../../components/PaginatedTable'; import ErrorDetail from '../../../components/ErrorDetail'; import AlertModal from '../../../components/AlertModal'; diff --git a/awx/ui_next/src/screens/Host/HostGroups/HostGroupsList.jsx b/awx/ui_next/src/screens/Host/HostGroups/HostGroupsList.jsx index 8367f74e07..4d32c9a212 100644 --- a/awx/ui_next/src/screens/Host/HostGroups/HostGroupsList.jsx +++ b/awx/ui_next/src/screens/Host/HostGroups/HostGroupsList.jsx @@ -14,8 +14,8 @@ import ErrorDetail from '../../../components/ErrorDetail'; import PaginatedTable, { HeaderCell, HeaderRow, + ToolbarAddButton, } from '../../../components/PaginatedTable'; -import { ToolbarAddButton } from '../../../components/PaginatedDataList'; import AssociateModal from '../../../components/AssociateModal'; import DisassociateButton from '../../../components/DisassociateButton'; import DataListToolbar from '../../../components/DataListToolbar'; diff --git a/awx/ui_next/src/screens/Host/HostList/HostList.jsx b/awx/ui_next/src/screens/Host/HostList/HostList.jsx index d5e6cda2c7..1f69792a3b 100644 --- a/awx/ui_next/src/screens/Host/HostList/HostList.jsx +++ b/awx/ui_next/src/screens/Host/HostList/HostList.jsx @@ -6,13 +6,11 @@ import { HostsAPI } from '../../../api'; import AlertModal from '../../../components/AlertModal'; import DataListToolbar from '../../../components/DataListToolbar'; import ErrorDetail from '../../../components/ErrorDetail'; -import { - ToolbarAddButton, - ToolbarDeleteButton, -} from '../../../components/PaginatedDataList'; import PaginatedTable, { HeaderRow, HeaderCell, + ToolbarAddButton, + ToolbarDeleteButton, } from '../../../components/PaginatedTable'; import useRequest, { useDeleteItems } from '../../../util/useRequest'; import useSelected from '../../../util/useSelected'; diff --git a/awx/ui_next/src/screens/InstanceGroup/InstanceGroupList/InstanceGroupList.jsx b/awx/ui_next/src/screens/InstanceGroup/InstanceGroupList/InstanceGroupList.jsx index 776a9e9afb..352a725c85 100644 --- a/awx/ui_next/src/screens/InstanceGroup/InstanceGroupList/InstanceGroupList.jsx +++ b/awx/ui_next/src/screens/InstanceGroup/InstanceGroupList/InstanceGroupList.jsx @@ -11,8 +11,8 @@ import useSelected from '../../../util/useSelected'; import PaginatedTable, { HeaderRow, HeaderCell, + ToolbarDeleteButton, } from '../../../components/PaginatedTable'; -import { ToolbarDeleteButton } from '../../../components/PaginatedDataList'; import ErrorDetail from '../../../components/ErrorDetail'; import AlertModal from '../../../components/AlertModal'; import DatalistToolbar from '../../../components/DataListToolbar'; diff --git a/awx/ui_next/src/screens/InstanceGroup/Instances/InstanceList.jsx b/awx/ui_next/src/screens/InstanceGroup/Instances/InstanceList.jsx index 6caa945f25..14a719d917 100644 --- a/awx/ui_next/src/screens/InstanceGroup/Instances/InstanceList.jsx +++ b/awx/ui_next/src/screens/InstanceGroup/Instances/InstanceList.jsx @@ -8,8 +8,8 @@ import DataListToolbar from '../../../components/DataListToolbar'; import PaginatedTable, { HeaderRow, HeaderCell, + ToolbarAddButton, } from '../../../components/PaginatedTable'; -import { ToolbarAddButton } from '../../../components/PaginatedDataList'; import DisassociateButton from '../../../components/DisassociateButton'; import AssociateModal from '../../../components/AssociateModal'; import AlertModal from '../../../components/AlertModal'; diff --git a/awx/ui_next/src/screens/Inventory/InventoryGroups/InventoryGroupsList.jsx b/awx/ui_next/src/screens/Inventory/InventoryGroups/InventoryGroupsList.jsx index 1c680f9050..28981c9be9 100644 --- a/awx/ui_next/src/screens/Inventory/InventoryGroups/InventoryGroupsList.jsx +++ b/awx/ui_next/src/screens/Inventory/InventoryGroups/InventoryGroupsList.jsx @@ -10,12 +10,10 @@ import DataListToolbar from '../../../components/DataListToolbar'; import PaginatedTable, { HeaderRow, HeaderCell, + ToolbarAddButton, } from '../../../components/PaginatedTable'; -import { ToolbarAddButton } from '../../../components/PaginatedDataList'; - import InventoryGroupItem from './InventoryGroupItem'; import InventoryGroupsDeleteModal from '../shared/InventoryGroupsDeleteModal'; - import AdHocCommands from '../../../components/AdHocCommands/AdHocCommands'; const QS_CONFIG = getQSConfig('group', { diff --git a/awx/ui_next/src/screens/Inventory/InventoryHostGroups/InventoryHostGroupsList.jsx b/awx/ui_next/src/screens/Inventory/InventoryHostGroups/InventoryHostGroupsList.jsx index e493fb2197..5ef6625ae5 100644 --- a/awx/ui_next/src/screens/Inventory/InventoryHostGroups/InventoryHostGroupsList.jsx +++ b/awx/ui_next/src/screens/Inventory/InventoryHostGroups/InventoryHostGroupsList.jsx @@ -15,8 +15,8 @@ import ErrorDetail from '../../../components/ErrorDetail'; import PaginatedTable, { HeaderRow, HeaderCell, + ToolbarAddButton, } from '../../../components/PaginatedTable'; -import { ToolbarAddButton } from '../../../components/PaginatedDataList'; import AssociateModal from '../../../components/AssociateModal'; import DisassociateButton from '../../../components/DisassociateButton'; import AdHocCommands from '../../../components/AdHocCommands/AdHocCommands'; diff --git a/awx/ui_next/src/screens/Inventory/InventoryHosts/InventoryHostList.jsx b/awx/ui_next/src/screens/Inventory/InventoryHosts/InventoryHostList.jsx index 80c614f27c..536b4d01e8 100644 --- a/awx/ui_next/src/screens/Inventory/InventoryHosts/InventoryHostList.jsx +++ b/awx/ui_next/src/screens/Inventory/InventoryHosts/InventoryHostList.jsx @@ -10,11 +10,9 @@ import ErrorDetail from '../../../components/ErrorDetail'; import PaginatedTable, { HeaderRow, HeaderCell, -} from '../../../components/PaginatedTable'; -import { ToolbarAddButton, ToolbarDeleteButton, -} from '../../../components/PaginatedDataList'; +} from '../../../components/PaginatedTable'; import useSelected from '../../../util/useSelected'; import AdHocCommands from '../../../components/AdHocCommands/AdHocCommands'; import InventoryHostItem from './InventoryHostItem'; diff --git a/awx/ui_next/src/screens/Inventory/InventoryList/InventoryList.jsx b/awx/ui_next/src/screens/Inventory/InventoryList/InventoryList.jsx index 1ca1b7511a..b31f32e097 100644 --- a/awx/ui_next/src/screens/Inventory/InventoryList/InventoryList.jsx +++ b/awx/ui_next/src/screens/Inventory/InventoryList/InventoryList.jsx @@ -8,10 +8,10 @@ import useSelected from '../../../util/useSelected'; import AlertModal from '../../../components/AlertModal'; import DatalistToolbar from '../../../components/DataListToolbar'; import ErrorDetail from '../../../components/ErrorDetail'; -import { ToolbarDeleteButton } from '../../../components/PaginatedDataList'; import PaginatedTable, { HeaderRow, HeaderCell, + ToolbarDeleteButton, } from '../../../components/PaginatedTable'; import { getQSConfig, parseQueryString } from '../../../util/qs'; import useWsInventories from './useWsInventories'; diff --git a/awx/ui_next/src/screens/Inventory/InventorySources/InventorySourceList.jsx b/awx/ui_next/src/screens/Inventory/InventorySources/InventorySourceList.jsx index ee05909ba4..14787eb602 100644 --- a/awx/ui_next/src/screens/Inventory/InventorySources/InventorySourceList.jsx +++ b/awx/ui_next/src/screens/Inventory/InventorySources/InventorySourceList.jsx @@ -12,11 +12,9 @@ import { InventoriesAPI, InventorySourcesAPI } from '../../../api'; import PaginatedTable, { HeaderRow, HeaderCell, -} from '../../../components/PaginatedTable'; -import { ToolbarAddButton, ToolbarDeleteButton, -} from '../../../components/PaginatedDataList'; +} from '../../../components/PaginatedTable'; import useSelected from '../../../util/useSelected'; import DatalistToolbar from '../../../components/DataListToolbar'; import AlertModal from '../../../components/AlertModal/AlertModal'; diff --git a/awx/ui_next/src/screens/NotificationTemplate/NotificationTemplateList/NotificationTemplateList.jsx b/awx/ui_next/src/screens/NotificationTemplate/NotificationTemplateList/NotificationTemplateList.jsx index a927ab77ca..b3abf09f1e 100644 --- a/awx/ui_next/src/screens/NotificationTemplate/NotificationTemplateList/NotificationTemplateList.jsx +++ b/awx/ui_next/src/screens/NotificationTemplate/NotificationTemplateList/NotificationTemplateList.jsx @@ -13,11 +13,9 @@ import { NotificationTemplatesAPI } from '../../../api'; import PaginatedTable, { HeaderRow, HeaderCell, -} from '../../../components/PaginatedTable'; -import { ToolbarAddButton, ToolbarDeleteButton, -} from '../../../components/PaginatedDataList'; +} from '../../../components/PaginatedTable'; import AlertModal from '../../../components/AlertModal'; import ErrorDetail from '../../../components/ErrorDetail'; import DataListToolbar from '../../../components/DataListToolbar'; diff --git a/awx/ui_next/src/screens/Organization/OrganizationList/OrganizationList.jsx b/awx/ui_next/src/screens/Organization/OrganizationList/OrganizationList.jsx index 1217c6e0b7..de51ce2fe6 100644 --- a/awx/ui_next/src/screens/Organization/OrganizationList/OrganizationList.jsx +++ b/awx/ui_next/src/screens/Organization/OrganizationList/OrganizationList.jsx @@ -8,13 +8,11 @@ import useRequest, { useDeleteItems } from '../../../util/useRequest'; import AlertModal from '../../../components/AlertModal'; import DataListToolbar from '../../../components/DataListToolbar'; import ErrorDetail from '../../../components/ErrorDetail'; -import { - ToolbarAddButton, - ToolbarDeleteButton, -} from '../../../components/PaginatedDataList'; import PaginatedTable, { HeaderRow, HeaderCell, + ToolbarAddButton, + ToolbarDeleteButton, } from '../../../components/PaginatedTable'; import { getQSConfig, parseQueryString } from '../../../util/qs'; import useSelected from '../../../util/useSelected'; diff --git a/awx/ui_next/src/screens/Project/ProjectJobTemplatesList/ProjectJobTemplatesList.jsx b/awx/ui_next/src/screens/Project/ProjectJobTemplatesList/ProjectJobTemplatesList.jsx index d08a1b01a2..438bb07949 100644 --- a/awx/ui_next/src/screens/Project/ProjectJobTemplatesList/ProjectJobTemplatesList.jsx +++ b/awx/ui_next/src/screens/Project/ProjectJobTemplatesList/ProjectJobTemplatesList.jsx @@ -10,11 +10,9 @@ import ErrorDetail from '../../../components/ErrorDetail'; import PaginatedTable, { HeaderRow, HeaderCell, -} from '../../../components/PaginatedTable'; -import { ToolbarAddButton, ToolbarDeleteButton, -} from '../../../components/PaginatedDataList'; +} from '../../../components/PaginatedTable'; import { getQSConfig, parseQueryString } from '../../../util/qs'; import useSelected from '../../../util/useSelected'; import useRequest, { useDeleteItems } from '../../../util/useRequest'; diff --git a/awx/ui_next/src/screens/Project/ProjectList/ProjectList.jsx b/awx/ui_next/src/screens/Project/ProjectList/ProjectList.jsx index eb6e799d40..4170ba2933 100644 --- a/awx/ui_next/src/screens/Project/ProjectList/ProjectList.jsx +++ b/awx/ui_next/src/screens/Project/ProjectList/ProjectList.jsx @@ -10,13 +10,11 @@ import useRequest, { import AlertModal from '../../../components/AlertModal'; import DataListToolbar from '../../../components/DataListToolbar'; import ErrorDetail from '../../../components/ErrorDetail'; -import { - ToolbarAddButton, - ToolbarDeleteButton, -} from '../../../components/PaginatedDataList'; import PaginatedTable, { HeaderRow, HeaderCell, + ToolbarAddButton, + ToolbarDeleteButton, } from '../../../components/PaginatedTable'; import useWsProjects from './useWsProjects'; import useSelected from '../../../util/useSelected'; diff --git a/awx/ui_next/src/screens/Team/TeamList/TeamList.jsx b/awx/ui_next/src/screens/Team/TeamList/TeamList.jsx index 36c43a1525..ba6b20b43b 100644 --- a/awx/ui_next/src/screens/Team/TeamList/TeamList.jsx +++ b/awx/ui_next/src/screens/Team/TeamList/TeamList.jsx @@ -12,11 +12,9 @@ import ErrorDetail from '../../../components/ErrorDetail'; import PaginatedTable, { HeaderRow, HeaderCell, -} from '../../../components/PaginatedTable'; -import { ToolbarAddButton, ToolbarDeleteButton, -} from '../../../components/PaginatedDataList'; +} from '../../../components/PaginatedTable'; import useSelected from '../../../util/useSelected'; import { getQSConfig, parseQueryString } from '../../../util/qs'; diff --git a/awx/ui_next/src/screens/Team/TeamRoles/TeamRolesList.jsx b/awx/ui_next/src/screens/Team/TeamRoles/TeamRolesList.jsx index 809ec843ae..8531faa22e 100644 --- a/awx/ui_next/src/screens/Team/TeamRoles/TeamRolesList.jsx +++ b/awx/ui_next/src/screens/Team/TeamRoles/TeamRolesList.jsx @@ -15,12 +15,12 @@ import DataListToolbar from '../../../components/DataListToolbar'; import PaginatedTable, { HeaderCell, HeaderRow, + ToolbarAddButton, } from '../../../components/PaginatedTable'; import { getQSConfig, parseQueryString } from '../../../util/qs'; import ErrorDetail from '../../../components/ErrorDetail'; import AlertModal from '../../../components/AlertModal'; import TeamRoleListItem from './TeamRoleListItem'; -import { ToolbarAddButton } from '../../../components/PaginatedDataList'; import UserAndTeamAccessAdd from '../../../components/UserAndTeamAccessAdd/UserAndTeamAccessAdd'; const QS_CONFIG = getQSConfig('roles', { diff --git a/awx/ui_next/src/screens/Template/Survey/SurveyList.jsx b/awx/ui_next/src/screens/Template/Survey/SurveyList.jsx index ff86fa7b7d..5eca719652 100644 --- a/awx/ui_next/src/screens/Template/Survey/SurveyList.jsx +++ b/awx/ui_next/src/screens/Template/Survey/SurveyList.jsx @@ -14,7 +14,7 @@ import { CubesIcon } from '@patternfly/react-icons'; import styled from 'styled-components'; import ContentLoading from '../../../components/ContentLoading'; import AlertModal from '../../../components/AlertModal'; -import { ToolbarAddButton } from '../../../components/PaginatedDataList'; +import { ToolbarAddButton } from '../../../components/PaginatedTable'; import SurveyListItem from './SurveyListItem'; import SurveyToolbar from './SurveyToolbar'; diff --git a/awx/ui_next/src/screens/Template/Survey/SurveyToolbar.jsx b/awx/ui_next/src/screens/Template/Survey/SurveyToolbar.jsx index ae4d47bc0f..5dc2a97797 100644 --- a/awx/ui_next/src/screens/Template/Survey/SurveyToolbar.jsx +++ b/awx/ui_next/src/screens/Template/Survey/SurveyToolbar.jsx @@ -13,7 +13,7 @@ import { ToolbarGroup, ToolbarItem, } from '@patternfly/react-core'; -import { ToolbarAddButton } from '../../../components/PaginatedDataList'; +import { ToolbarAddButton } from '../../../components/PaginatedTable'; const Toolbar = styled(_Toolbar)` margin-left: 52px; diff --git a/awx/ui_next/src/screens/User/UserList/UserList.jsx b/awx/ui_next/src/screens/User/UserList/UserList.jsx index b1ee126edd..8f6f99d5c8 100644 --- a/awx/ui_next/src/screens/User/UserList/UserList.jsx +++ b/awx/ui_next/src/screens/User/UserList/UserList.jsx @@ -10,11 +10,9 @@ import ErrorDetail from '../../../components/ErrorDetail'; import PaginatedTable, { HeaderRow, HeaderCell, -} from '../../../components/PaginatedTable'; -import { ToolbarAddButton, ToolbarDeleteButton, -} from '../../../components/PaginatedDataList'; +} from '../../../components/PaginatedTable'; import useRequest, { useDeleteItems } from '../../../util/useRequest'; import useSelected from '../../../util/useSelected'; import { getQSConfig, parseQueryString } from '../../../util/qs'; diff --git a/awx/ui_next/src/screens/User/UserRoles/UserRolesList.jsx b/awx/ui_next/src/screens/User/UserRoles/UserRolesList.jsx index ec0b748cb9..ad13ca6568 100644 --- a/awx/ui_next/src/screens/User/UserRoles/UserRolesList.jsx +++ b/awx/ui_next/src/screens/User/UserRoles/UserRolesList.jsx @@ -15,10 +15,10 @@ import useRequest, { useDeleteItems } from '../../../util/useRequest'; import PaginatedTable, { HeaderRow, HeaderCell, + ToolbarAddButton, } from '../../../components/PaginatedTable'; import ErrorDetail from '../../../components/ErrorDetail'; import AlertModal from '../../../components/AlertModal'; -import { ToolbarAddButton } from '../../../components/PaginatedDataList'; import DatalistToolbar from '../../../components/DataListToolbar'; import UserRolesListItem from './UserRolesListItem'; import UserAndTeamAccessAdd from '../../../components/UserAndTeamAccessAdd/UserAndTeamAccessAdd'; diff --git a/awx/ui_next/src/screens/User/UserTeams/UserTeamList.jsx b/awx/ui_next/src/screens/User/UserTeams/UserTeamList.jsx index d65c0383c5..7328d64c6a 100644 --- a/awx/ui_next/src/screens/User/UserTeams/UserTeamList.jsx +++ b/awx/ui_next/src/screens/User/UserTeams/UserTeamList.jsx @@ -5,8 +5,8 @@ import { t } from '@lingui/macro'; import PaginatedTable, { HeaderRow, HeaderCell, + ToolbarAddButton, } from '../../../components/PaginatedTable'; -import { ToolbarAddButton } from '../../../components/PaginatedDataList'; import DataListToolbar from '../../../components/DataListToolbar'; import DisassociateButton from '../../../components/DisassociateButton'; import AssociateModal from '../../../components/AssociateModal'; diff --git a/awx/ui_next/src/screens/User/UserTokenList/UserTokenList.jsx b/awx/ui_next/src/screens/User/UserTokenList/UserTokenList.jsx index 034d52d4cb..8bdd5db015 100644 --- a/awx/ui_next/src/screens/User/UserTokenList/UserTokenList.jsx +++ b/awx/ui_next/src/screens/User/UserTokenList/UserTokenList.jsx @@ -6,11 +6,9 @@ import { getQSConfig, parseQueryString } from '../../../util/qs'; import PaginatedTable, { HeaderRow, HeaderCell, -} from '../../../components/PaginatedTable'; -import { ToolbarAddButton, ToolbarDeleteButton, -} from '../../../components/PaginatedDataList'; +} from '../../../components/PaginatedTable'; import useSelected from '../../../util/useSelected'; import useRequest, { useDeleteItems } from '../../../util/useRequest'; import { UsersAPI, TokensAPI } from '../../../api'; diff --git a/awx/ui_next/src/screens/WorkflowApproval/WorkflowApprovalList/WorkflowApprovalList.jsx b/awx/ui_next/src/screens/WorkflowApproval/WorkflowApprovalList/WorkflowApprovalList.jsx index 8a1e9fd70d..030d32253e 100644 --- a/awx/ui_next/src/screens/WorkflowApproval/WorkflowApprovalList/WorkflowApprovalList.jsx +++ b/awx/ui_next/src/screens/WorkflowApproval/WorkflowApprovalList/WorkflowApprovalList.jsx @@ -6,8 +6,8 @@ import { WorkflowApprovalsAPI } from '../../../api'; import PaginatedTable, { HeaderRow, HeaderCell, + ToolbarDeleteButton, } from '../../../components/PaginatedTable'; -import { ToolbarDeleteButton } from '../../../components/PaginatedDataList'; import AlertModal from '../../../components/AlertModal'; import ErrorDetail from '../../../components/ErrorDetail'; import DataListToolbar from '../../../components/DataListToolbar';