Merge pull request #3695 from backstage/ryanv/pin-all-projects-option

Ryanv/pin all projects option
This commit is contained in:
Ryan Vazquez
2020-12-11 14:20:44 -05:00
committed by GitHub
2 changed files with 7 additions and 2 deletions
@@ -0,0 +1,5 @@
---
'@backstage/plugin-cost-insights': patch
---
pin all projects selection to the top of menu list
@@ -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 => (
<MenuItem
className={`${classes.menuItem} compact`}
key={proj.id}