- await defaultGetEntities(
- items,
- // filter systems by the group name
- {
- ...config,
- filters: {
- ...config.filters,
- groupName: [groupName] // TODO: the param is not yet supported by `apiHostGetHostList`
+
+
+ await defaultGetEntities(
+ items,
+ // filter systems by the group name
+ {
+ ...config,
+ filters: {
+ ...config.filters,
+ groupName: [groupName] // TODO: the param is not yet supported by `apiHostGetHostList`
+ }
+ },
+ showTags
+ )
+ }
+ tableProps={{
+ isStickyHeader: true,
+ variant: TableVariant.compact,
+ canSelectAll: false
+ }}
+ bulkSelect={{
+ count: selected.size,
+ id: 'bulk-select-groups',
+ items: [
+ {
+ title: 'Select none (0)',
+ onClick: () => dispatch(selectEntity(-1, false)),
+ props: { isDisabled: noneSelected }
+ },
+ {
+ title: `${pageSelected ? 'Deselect' : 'Select'} page (${
+ rows.length
+ } items)`,
+ onClick: () => dispatch(selectEntity(0, !pageSelected))
}
- },
- showTags
- )
- }
- tableProps={{
- isStickyHeader: true,
- variant: TableVariant.compact,
- canSelectAll: false
- }}
- bulkSelect={{
- count: selected.size,
- id: 'bulk-select-groups',
- items: [
- {
- title: 'Select none (0)',
- onClick: () => dispatch(selectEntity(-1, false)),
- props: { isDisabled: noneSelected }
- },
- {
- title: `${pageSelected ? 'Deselect' : 'Select'} page (${
- rows.length
- } items)`,
- onClick: () => dispatch(selectEntity(0, !pageSelected))
- }
// TODO: Implement "select all"
- ],
- onSelect: (value) => {
- dispatch(selectEntity(0, value));
- },
- checked: selected.size > 0 // TODO: support partial selection (dash sign) in FEC BulkSelect
- }}
- />
+ ],
+ onSelect: (value) => {
+ dispatch(selectEntity(0, value));
+ },
+ checked: selected.size > 0 // TODO: support partial selection (dash sign) in FEC BulkSelect
+ }}
+ />
+
);
};
diff --git a/src/components/GroupsTable/GroupsTable.cy.js b/src/components/GroupsTable/GroupsTable.cy.js
index 4a0fba9a0..701461d35 100644
--- a/src/components/GroupsTable/GroupsTable.cy.js
+++ b/src/components/GroupsTable/GroupsTable.cy.js
@@ -26,30 +26,14 @@ import { Provider } from 'react-redux';
import { MemoryRouter } from 'react-router-dom';
import fixtures from '../../../cypress/fixtures/groups.json';
import { groupsInterceptors as interceptors } from '../../../cypress/support/interceptors';
+import { checkSelectedNumber, ORDER_TO_URL, selectRowN } from '../../../cypress/support/utils';
import { getStore } from '../../store';
import GroupsTable from './GroupsTable';
-const ORDER_TO_URL = {
- ascending: 'ASC',
- descending: 'DESC'
-};
-
const DEFAULT_ROW_COUNT = 50;
const TABLE_HEADERS = ['Name', 'Total systems', 'Last modified'];
const ROOT = 'div[id="groups-table"]';
-export const checkSelectedNumber = (number) => {
- if (number === 0) {
- cy.get('#toggle-checkbox-text').should('not.exist');
- } else {
- cy.get('#toggle-checkbox-text').should('have.text', `${number} selected`);
- }
-};
-
-export const selectRowN = (number) => {
- cy.get(ROW).eq(number).find('.pf-c-table__check').click();
-};
-
const mountTable = () =>
mount(
diff --git a/src/store/entities.js b/src/store/entities.js
index c90947e26..d99bea7ce 100644
--- a/src/store/entities.js
+++ b/src/store/entities.js
@@ -21,6 +21,7 @@ import InsightsDisconnected from '../Utilities/InsightsDisconnected';
import OperatingSystemFormatter from '../Utilities/OperatingSystemFormatter';
import { Tooltip } from '@patternfly/react-core';
import { verifyCulledInsightsClient } from '../Utilities/sharedFunctions';
+import { fitContent } from '@patternfly/react-table';
export const defaultState = {
loaded: false,
@@ -94,7 +95,8 @@ export const defaultColumns = (groupsEnabled = false) => ([
}
> : new Date(value).toLocaleString();
},
- props: { width: 10 }
+ props: { width: 10 },
+ transforms: [fitContent]
}
]);