Skip to content

Commit 1c2c2ee

Browse files
authored
[CORE-550] Remove Cloud Platform Filter from Workspaces List Page (#5351)
1 parent 660e5d2 commit 1c2c2ee

File tree

3 files changed

+2
-47
lines changed

3 files changed

+2
-47
lines changed

src/workspaces/list/WorkspaceFilters.test.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,6 @@ describe('WorkspaceFilters', () => {
4545
eventData: { filter: 'billingProject', option: defaultGoogleWorkspace.workspace.namespace },
4646
filterParam: { projectsFilter: defaultGoogleWorkspace.workspace.namespace },
4747
},
48-
{
49-
label: 'Filter by cloud platform',
50-
item: 'Microsoft Azure',
51-
eventData: { filter: 'cloudPlatform', option: 'AZURE' },
52-
filterParam: { cloudPlatform: 'AZURE' },
53-
},
5448
] as { label: string; item: string; eventData: object; filterParam: object }[])(
5549
'can update the filter for "$label" and emit an event',
5650
async ({ label, item, eventData, filterParam }) => {

src/workspaces/list/WorkspaceFilters.ts

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,7 @@ import { useInstance } from 'src/libs/react-utils';
1111
import * as Utils from 'src/libs/utils';
1212
import { WorkspaceTagSelect } from 'src/workspaces/common/WorkspaceTagSelect';
1313
import { CategorizedWorkspaces } from 'src/workspaces/list/CategorizedWorkspaces';
14-
import {
15-
cloudProviderLabels,
16-
cloudProviderTypes,
17-
workspaceAccessLevels,
18-
WorkspaceWrapper as Workspace,
19-
} from 'src/workspaces/utils';
14+
import { workspaceAccessLevels, WorkspaceWrapper as Workspace } from 'src/workspaces/utils';
2015

2116
const styles = {
2217
filter: { marginRight: '1rem', flex: '1 1 0', minWidth: 'max-content' },
@@ -103,23 +98,6 @@ export const WorkspaceFilters = (props: WorkspaceFiltersProps): ReactNode => {
10398
options: _.flow(_.map('workspace.namespace'), _.uniq, _.sortBy(_.identity))(workspaces),
10499
}),
105100
]),
106-
div({ style: { ...styles.filter, marginRight: 0 } }, [
107-
h(Select<string | undefined>, {
108-
isClearable: true,
109-
isMulti: false,
110-
placeholder: 'Cloud platform',
111-
'aria-label': 'Filter by cloud platform',
112-
value: filters.cloudPlatform,
113-
hideSelectedOptions: true,
114-
onChange: (data) => {
115-
const option = data?.value || undefined;
116-
void Metrics().captureEvent(Events.workspaceListFilter, { filter: 'cloudPlatform', option });
117-
Nav.updateSearch({ ...query, cloudPlatform: option });
118-
},
119-
options: _.sortBy((cloudProvider) => cloudProviderLabels[cloudProvider], _.keys(cloudProviderTypes)),
120-
getOptionLabel: ({ value }) => (value ? cloudProviderLabels[value] : undefined),
121-
}),
122-
]),
123101
]);
124102
};
125103

@@ -136,7 +114,6 @@ export const getWorkspaceFiltersFromQuery = (query: any): WorkspaceFilterValues
136114
keywordFilter: query.filter || '',
137115
accessLevels: query.accessLevelsFilter || EMPTY_LIST,
138116
projects: query.projectsFilter || undefined,
139-
cloudPlatform: query.cloudPlatform || undefined,
140117
tab: query.tab || 'myWorkspaces',
141118
tags: query.tagsFilter || EMPTY_LIST,
142119
});

src/workspaces/list/WorkspacesListTabs.test.ts

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
import { CategorizedWorkspaces } from 'src/workspaces/list/CategorizedWorkspaces';
1414
import { getWorkspaceFiltersFromQuery } from 'src/workspaces/list/WorkspaceFilters';
1515
import { filterWorkspaces, WorkspacesListTabs } from 'src/workspaces/list/WorkspacesListTabs';
16-
import { AzureWorkspace, cloudProviderTypes } from 'src/workspaces/utils';
16+
import { AzureWorkspace } from 'src/workspaces/utils';
1717

1818
// the FlexTable uses react-virtualized's AutoSizer to size the table.
1919
// This makes the virtualized window large enough for all rows/columns to be rendered in tests.
@@ -166,22 +166,6 @@ describe('The filterWorkspaces method', () => {
166166
expect(filteredWorkspaces.myWorkspaces).toEqual([defaultGoogleWorkspace, defaultInitializedGoogleWorkspace]);
167167
});
168168

169-
it('should filter based on cloudPlatform', () => {
170-
// Arrange
171-
const workspaces: CategorizedWorkspaces = {
172-
myWorkspaces: [defaultAzureWorkspace, defaultGoogleWorkspace],
173-
public: [],
174-
featured: [],
175-
};
176-
const filters = getWorkspaceFiltersFromQuery({ cloudPlatform: cloudProviderTypes.GCP });
177-
178-
// Act
179-
const filteredWorkspaces = filterWorkspaces(workspaces, filters);
180-
181-
// Assert
182-
expect(filteredWorkspaces.myWorkspaces).toEqual([defaultGoogleWorkspace]);
183-
});
184-
185169
it('should filter based on access level', () => {
186170
// Arrange
187171
const readerWorkspace: AzureWorkspace = {

0 commit comments

Comments
 (0)