Skip to content

Commit

Permalink
feat: filtering of recipe table (#74)
Browse files Browse the repository at this point in the history
* feat: filtering of recipe table

Signed-off-by: Christian Lechner <[email protected]>

* fix: linting

Signed-off-by: Christian Lechner <[email protected]>

* feat: adjust toolbar for filtering

Signed-off-by: Christian Lechner <[email protected]>

* fix: remove obsoletetitle parameter

Signed-off-by: Christian Lechner <[email protected]>

* fix: format

Signed-off-by: Christian Lechner <[email protected]>

---------

Signed-off-by: Christian Lechner <[email protected]>
Co-authored-by: Will <[email protected]>
  • Loading branch information
lechnerc77 and willtsai authored Apr 26, 2024
1 parent 7d601c5 commit fa87fda
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
26 changes: 22 additions & 4 deletions plugins/plugin-radius/src/components/recipes/RecipeTable.tsx
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 {
Expand All @@ -11,7 +11,6 @@ interface DisplayRecipe {

export const RecipeTable = ({
environment,
title,
}: {
environment: Resource<EnvironmentProperties>;
title?: string;
Expand Down Expand Up @@ -41,12 +40,31 @@ export const RecipeTable = ({
{ title: 'Template Path', field: 'templatePath' },
];

const filters: TableFilter[] = [
{
column: 'Name',
type: 'multiple-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: false, paging: false, sorting: true }}
columns={columns}
data={recipes}
filters={filters}
/>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,5 @@ export const RecipesTab = ({
}: {
resource: Resource<EnvironmentProperties>;
}) => {
return (
<RecipeTable
environment={resource}
title={`Recipes for ${resource.name}`}
/>
);
return <RecipeTable environment={resource} />;
};

0 comments on commit fa87fda

Please sign in to comment.