Skip to content

Commit e2f0b76

Browse files
committed
feat: add GetAppListFiltersParams interface and refactor getAppListFilters to use it
1 parent 5aeb7d1 commit e2f0b76

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

src/components/app/list-new/AppListType.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,3 +214,12 @@ export interface AskToClearFiltersProps extends Pick<DevtronAppListProps, 'clear
214214

215215
export type AppListFilterMenuItemType =
216216
GroupedFilterSelectPickerProps<AppListUrlFilters>['options'][number]['items'][number]
217+
218+
export interface GetAppListFiltersParams {
219+
clusterIdsCsv: string
220+
isExternalArgo: boolean
221+
isExternalFlux: boolean
222+
isArgoInstalled: boolean
223+
serverMode: SERVER_MODE
224+
selectedEnvironments: { label: string; value: string }[]
225+
}

src/components/app/list-new/list.utils.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import {
3939
AppListUrlFiltersType,
4040
AppStatuses,
4141
AppStatusesDTO,
42+
GetAppListFiltersParams,
4243
useFilterOptionsProps,
4344
} from './AppListType'
4445
import { APPS_WITH_NO_PROJECT_OPTION, SELECT_CLUSTER_TIPPY } from './Constants'
@@ -228,14 +229,7 @@ export const getAppListFilters = ({
228229
isArgoInstalled,
229230
serverMode,
230231
selectedEnvironments,
231-
}: {
232-
clusterIdsCsv: string
233-
isExternalArgo: boolean
234-
isExternalFlux: boolean
235-
isArgoInstalled: boolean
236-
serverMode: SERVER_MODE
237-
selectedEnvironments: { label: string; value: string }[]
238-
}): GroupedFilterSelectPickerProps<AppListUrlFilters>['options'] => [
232+
}: GetAppListFiltersParams): GroupedFilterSelectPickerProps<AppListUrlFilters>['options'] => [
239233
{
240234
items: [
241235
...((!(isExternalArgo || isExternalFlux)

0 commit comments

Comments
 (0)