-
Notifications
You must be signed in to change notification settings - Fork 0
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
Added Client Filtering + Extra Columns #72
Added Client Filtering + Extra Columns #72
Conversation
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.
Great Job Guys! This was a really tough task and you guys really killed it. Overall, the functionality is great, but there are pretty much only two major problems, first that filtering and search cannot work at the same time and second that dates are not being properly handled. but again great job guys!!!😃
if (searchKey) { | ||
response = await backend.get(`/clients?page=&filter=&search=${searchKey}`); | ||
response = await backend.get( | ||
`/clients?page=&filter=&search=${searchKey}` | ||
); | ||
} else if (filterQuery.length > 1) { | ||
response = await backend.get( | ||
`/clients?page=&filter=${encodeURIComponent(filterQuery.join(" "))}&search=` | ||
); |
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 we would want the search and the filter to be able to work at the same time
if (row.operator === "contains") { | ||
return `${row.selector} ${row.field} ILIKE '%${row.value}%'`; | ||
} | ||
return `${row.selector} ${row.field} ${row.operator} '${row.value}'`; |
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.
add another if for string and equals to make it case insensitive
{ name: "Entrance Date", value: "clients.entrance_date", type: "string" }, | ||
{ name: "Estimated Exit Date", value: "clients.estimated_exit_date", type: "string" }, | ||
{ name: "Exit Date", value: "clients.exit_date", type: "string" }, |
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.
these should be type date
const columns = [ | ||
{ name: "Client First Name", value: "clients.first_name", type: "string" }, | ||
{ name: "Client Last Name", value: "clients.last_name", type: "string" }, | ||
{ name: "Date of Birth", value: "clients.date_of_birth", type: "string" }, |
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.
also should be type date
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.
seems like date type columns are not being handled properly
Description
Screenshots/Media
Extra columns
Filter
One filter (AUTOMATICALLY updates and filters)
Multiple filters
Supports numbers, strings, and booleans
The filters are offset in this one but I fixed it in the latest commit but I don't wanna make another screenshot.
Issues
Closes #61