-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: filtering of recipe table #74
Changes from 5 commits
dca4de4
9d8d556
0424823
bc05ce6
a931a48
e28fbd9
86336db
d802ab3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import React from 'react'; | ||
import { Table, TableColumn } from '@backstage/core-components'; | ||
import { Table, TableColumn, TableFilter } from '@backstage/core-components'; | ||
import { EnvironmentProperties, Resource } from '../../resources'; | ||
|
||
interface DisplayRecipe { | ||
|
@@ -41,12 +41,32 @@ export const RecipeTable = ({ | |
{ title: 'Template Path', field: 'templatePath' }, | ||
]; | ||
|
||
const filters: TableFilter[] = [ | ||
{ | ||
column: 'Name', | ||
type: 'select', | ||
}, | ||
{ | ||
column: 'Type', | ||
type: 'multiple-select', | ||
}, | ||
{ | ||
column: 'Kind', | ||
type: 'multiple-select', | ||
}, | ||
{ | ||
column: 'Template Path', | ||
type: 'multiple-select', | ||
}, | ||
]; | ||
|
||
return ( | ||
<Table | ||
title={title || 'Recipes'} | ||
options={{ search: false, paging: false }} | ||
options={{ search: true, paging: false, sorting: true }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. since we have the TableFilter, we can turn of the search so that the toolbar disappears. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I removed the search. I changed the filtering option for Name to multi-select to be consistent with the other options |
||
columns={columns} | ||
data={recipes} | ||
filters={filters} | ||
/> | ||
); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The title is redundant since we have the page title set already. Therefore we can remove this. I will make sure to remove the redundant title from a couple of other pages too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done