{selectOptions.length === 0 ? (
-
- {isWorkspaceEnabled
- ? 'No workspaces available'
- : 'No groups available'}
-
+ No workspaces available
) : (
selectOptions.map((option, index) => (
diff --git a/src/components/filters/SearchableGroupFilter.test.js b/src/components/filters/SearchableGroupFilter.test.js
index 102c2cc6b..fc429f692 100644
--- a/src/components/filters/SearchableGroupFilter.test.js
+++ b/src/components/filters/SearchableGroupFilter.test.js
@@ -3,10 +3,6 @@ import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import React from 'react';
import SearchableGroupFilter from './SearchableGroupFilter';
-import useWorkspaceFeatureFlag from '../../Utilities/hooks/useWorkspaceFeatureFlag';
-
-jest.mock('../../Utilities/hooks/useWorkspaceFeatureFlag');
-useWorkspaceFeatureFlag.mockReturnValue(false);
const setter = jest.fn();
diff --git a/src/components/filters/useGroupFilter.js b/src/components/filters/useGroupFilter.js
index a5bbd4a00..04b658535 100644
--- a/src/components/filters/useGroupFilter.js
+++ b/src/components/filters/useGroupFilter.js
@@ -6,7 +6,6 @@ import { getGroups } from '../InventoryGroups/utils/api';
import SearchableGroupFilter from './SearchableGroupFilter';
import { GENERAL_GROUPS_READ_PERMISSION } from '../../constants';
import { usePermissionsWithContext } from '@redhat-cloud-services/frontend-components-utilities/RBACHook';
-import useWorkspaceFeatureFlag from '../../Utilities/hooks/useWorkspaceFeatureFlag';
export const groupFilterState = { hostGroupFilter: null };
export const GROUP_FILTER = 'GROUP_FILTER';
@@ -16,14 +15,11 @@ export const groupFilterReducer = (_state, { type, payload }) => ({
}),
});
-export const buildHostGroupChips = (
- selectedGroups = [],
- isWorkspaceEnabled
-) => {
+export const buildHostGroupChips = (selectedGroups = []) => {
const chips = [...selectedGroups]?.map((group) =>
group === ''
? {
- name: isWorkspaceEnabled ? 'No workspace' : 'No group',
+ name: 'No workspace',
value: '',
}
: {
@@ -34,7 +30,7 @@ export const buildHostGroupChips = (
return chips?.length > 0
? [
{
- category: isWorkspaceEnabled ? 'Workspace' : 'Group',
+ category: 'Workspace',
type: HOST_GROUP_CHIP,
chips,
},
@@ -55,8 +51,6 @@ const useGroupFilter = (showNoGroupOption = false) => {
false
);
- const isWorkspaceEnabled = useWorkspaceFeatureFlag();
-
useEffect(() => {
const fetchOptions = async () => {
if (!hasAccess) return;
@@ -93,14 +87,14 @@ const useGroupFilter = (showNoGroupOption = false) => {
}, [hasAccess]);
const chips = useMemo(
- () => buildHostGroupChips(selectedGroupNames, isWorkspaceEnabled),
+ () => buildHostGroupChips(selectedGroupNames),
[selectedGroupNames]
);
// hostGroupConfig is used in EntityTableToolbar.js
const hostGroupConfig = useMemo(
() => ({
- label: isWorkspaceEnabled ? 'Workspace' : 'Group',
+ label: 'Workspace',
value: 'group-host-filter',
type: 'custom',
filterValues: {
diff --git a/src/components/filters/useGroupFilter.test.js b/src/components/filters/useGroupFilter.test.js
index 7e4ddd968..aa12c72ca 100644
--- a/src/components/filters/useGroupFilter.test.js
+++ b/src/components/filters/useGroupFilter.test.js
@@ -2,14 +2,8 @@ import { act, renderHook, waitFor } from '@testing-library/react';
import useFetchBatched from '../../Utilities/hooks/useFetchBatched';
import useGroupFilter from './useGroupFilter';
import { usePermissionsWithContext } from '@redhat-cloud-services/frontend-components-utilities/RBACHook';
-import useWorkspaceFeatureFlag from '../../Utilities/hooks/useWorkspaceFeatureFlag';
jest.mock('../../Utilities/hooks/useFetchBatched');
-jest.mock('../../Utilities/useFeatureFlag', () => ({
- __esModule: true,
- default: () => true,
-}));
-jest.mock('../../Utilities/hooks/useWorkspaceFeatureFlag');
jest.mock('../InventoryGroups/utils/api', () => ({
__esModule: true,
getGroups: () =>
@@ -63,10 +57,6 @@ describe('groups request not yet resolved', () => {
});
describe('with some groups available', () => {
- beforeEach(() => {
- useWorkspaceFeatureFlag.mockReturnValue(false);
- });
-
const pageOffsetfetchBatched = jest.fn(
() =>
new Promise((resolve) => resolve([{ results: [{ name: 'group-1' }] }]))
diff --git a/src/constants.js b/src/constants.js
index dea3f46af..afdf44ca8 100644
--- a/src/constants.js
+++ b/src/constants.js
@@ -243,12 +243,8 @@ export const REQUIRED_PERMISSIONS_TO_READ_GROUP_HOSTS = (groupId) => [
},
];
-export const NO_MODIFY_GROUPS_TOOLTIP_MESSAGE =
- 'You do not have the necessary permissions to modify groups. Contact your organization administrator.';
export const NO_MODIFY_WORKSPACES_TOOLTIP_MESSAGE =
'You do not have the necessary permissions to modify workspaces. Contact your organization administrator.';
-export const NO_MODIFY_GROUP_TOOLTIP_MESSAGE =
- 'You do not have the necessary permissions to modify this group. Contact your organization administrator.';
export const NO_MODIFY_WORKSPACE_TOOLTIP_MESSAGE =
'You do not have the necessary permissions to modify this workspace. Contact your organization administrator.';
export const NO_MODIFY_HOSTS_TOOLTIP_MESSAGE =