From 423fa862205a3662168b18012a03b656ea3e3270 Mon Sep 17 00:00:00 2001 From: Ryan Vazquez Date: Fri, 11 Dec 2020 13:36:32 -0500 Subject: [PATCH] pin all projects selection to top of menu list --- .../src/components/ProjectSelect/ProjectSelect.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/cost-insights/src/components/ProjectSelect/ProjectSelect.tsx b/plugins/cost-insights/src/components/ProjectSelect/ProjectSelect.tsx index ee4641a4eb..bc34eb9c8d 100644 --- a/plugins/cost-insights/src/components/ProjectSelect/ProjectSelect.tsx +++ b/plugins/cost-insights/src/components/ProjectSelect/ProjectSelect.tsx @@ -31,7 +31,7 @@ export const ProjectSelect = ({ }: ProjectSelectProps) => { const classes = useStyles(); - const projectOptions = [{ id: 'all' } as Project, ...projects] + const projectOptions = projects .filter(p => p.id) .sort((a, b) => (a.id as string).localeCompare(b.id as string)); @@ -57,7 +57,7 @@ export const ProjectSelect = ({ onChange={handleOnChange} data-testid="project-filter-select" > - {projectOptions.map(proj => ( + {[{ id: 'all' }, ...projectOptions].map(proj => (