-
Notifications
You must be signed in to change notification settings - Fork 2
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: filter live services from drop-down menu in admin dashboard #4344
base: main
Are you sure you want to change the base?
Conversation
} | ||
return getDoubleFilterFn(filterItem); | ||
}, | ||
InputComponent: filteringOne ? SingleInputFilter : DoubleInputFilter, |
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.
Ideally, it seems like this would/should be select-one or select-many (rather than select-two). Out of curiousity, have you tried passing in our existing SelectMultiple
component here?
@@ -38,7 +38,7 @@ export const mockTeams: AdminPanelData[] = [ | |||
liveFlows: [ | |||
"Notify completion of planning application", | |||
"Find out if you need planning permission", | |||
"Apply for prior approval", | |||
"apply for prior approval ", |
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.
To test the whitespace and casing processes
getRowHeight={() => "auto"} | ||
getRowClassName={(params) => | ||
params.indexRelativeToCurrentPage % 2 === 0 ? "even" : "odd" | ||
} | ||
slots={{ | ||
toolbar: GridToolbar, |
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.
Adds the additional toolbar at the top of the table
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.
Decided to make a separate component from the SelectMultiple
since a lot of the props were superfluous, and the styling a bit different!
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.
Some of these moved across from DataTable.tsx
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.
Took a quick pass through the code - only a few very minor comments, otherwise looking great !
Happy to do final review & approval today once pizza is up 👍
Agree that if this is "working" now, then best way to test current re-useability-ness and spot any further prop tweaking is to just implement it again soon for another case 🙂
} | ||
: { | ||
...baseColDef, | ||
width: column.width || baseColDef.width, |
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.
nit: it looks like width
could be part of shared baseColDef
? Otherwise this feels clear considering level of complexity ➕
|
||
const containsItem = (item: string, value: Pick<GridFilterItem, "value">) => { | ||
if (typeof value === "string") { | ||
return item.toLowerCase().includes((value as string).toLowerCase()); |
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.
nit: do we actually need (value as string)
casting still if we're within this conditional if (typeof value === "string")
block?
No worries if so, understand MUI types can be fiddly sometimes - but this looks like might be leftover from another iteration?
options: columnValueOptions, | ||
}, | ||
}, | ||
]; |
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.
Super clear, easy to revisit 💯
))} | ||
</Box> | ||
), | ||
}; |
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.
nit: took me a minute to unpack what componentRegistry
meant here - is something like cellValueRegistry
or valueOptionsRegistry
more specific maybe?
In this PR
utils
filePlease thoroughly test the filtering of all the columns and check it behaves as expected (note the Article 4s column is an outstanding issue to come back to).
Mild concerns
There are a few types I need to come back to - substituted a lot ofany
s while I was hacking/prototyping.I think I've got a bit too down in the weeds with this to properly see if it remains readable/easy to use the generic component. Hopefully fresh eyes/time will help, and implementing it in the next few features!