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

Added Client Filtering + Extra Columns #72

Merged
merged 6 commits into from
Feb 10, 2025

Conversation

IsaacNguyen
Copy link
Contributor

@IsaacNguyen IsaacNguyen commented Feb 5, 2025

Description

  • Added extra columns
  • Added dynamic content filter

Screenshots/Media

image
Extra columns

image
Filter

image
One filter (AUTOMATICALLY updates and filters)

image
Multiple filters

image
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

Copy link
Collaborator

@srukelman srukelman left a 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!!!😃

Comment on lines 83 to 90
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=`
);
Copy link
Collaborator

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

Comment on lines 95 to 98
if (row.operator === "contains") {
return `${row.selector} ${row.field} ILIKE '%${row.value}%'`;
}
return `${row.selector} ${row.field} ${row.operator} '${row.value}'`;
Copy link
Collaborator

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

Comment on lines 51 to 53
{ 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" },
Copy link
Collaborator

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" },
Copy link
Collaborator

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

Copy link
Collaborator

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

@benson-fm benson-fm merged commit 9682d89 into main Feb 10, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Client Specifics Querying Functionality + More Cols
4 participants