Skip to content
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

PIMS-1960: Allow Filter by Workflow Group in Projects #2702

Merged
merged 4 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion react-app/src/components/projects/ProjectsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,17 @@ const ProjectsTable = () => {
case 'All Projects':
ref.current.setFilterModel({ items: [] });
break;
case 'SPL Projects':
ref.current.setFilterModel({
items: [
{
value: ['Approved for SPL', 'Contract in Place', 'On Market', 'Pre-Marketing'],
field: 'Status',
operator: 'isAnyOf',
},
],
});
break;
case 'Approved for SPL':
case 'Contract in Place':
case 'On Market':
Expand Down Expand Up @@ -235,7 +246,9 @@ const ProjectsTable = () => {
<CustomMenuItem key={'All Projects'} value={'All Projects'}>
All Projects
</CustomMenuItem>,
<CustomListSubheader key={'SPL Projects'}>SPL Projects</CustomListSubheader>,
<CustomMenuItem key={'SPL Projects'} value={'SPL Projects'} sx={{ fontWeight: 'bold' }}>
SPL Projects
</CustomMenuItem>,
<CustomMenuItem key={'Approved for SPL'} value={'Approved for SPL'}>
Approved for SPL
</CustomMenuItem>,
Expand Down
5 changes: 4 additions & 1 deletion react-app/src/components/table/DataTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
MenuItem,
Select,
SxProps,
Theme,
Tooltip,
Typography,
debounce,
Expand Down Expand Up @@ -143,7 +144,9 @@ export const CustomDataGrid = (props: DataGridProps) => {
);
};

export const CustomMenuItem = (props: PropsWithChildren & { value: string }) => {
export const CustomMenuItem = (
props: PropsWithChildren & { value: string; sx?: SxProps<Theme> },
) => {
const theme = useTheme();
return (
<MenuItem
Expand Down
Loading