Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: Add filter on Users page #2653

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

Merged
merged 6 commits into from
Jun 28, 2022
Merged

Conversation

AbhineetJain
Copy link
Contributor

@AbhineetJain AbhineetJain commented Jun 25, 2022

This PR adds a new filter to the Users page.

Subtasks

  • add filter to the API call and users machine.
  • add filter to Users page view.
  • add error handling in the filter component, users page and machine.
  • default to blank table on error.
  • refactor common code for workspace filter.
  • add unit tests and stories.

Fixes #595

Screenshots

Screen Shot 2022-06-25 at 5 25 45 PM
Screen Shot 2022-06-25 at 5 25 54 PM
Screen Shot 2022-06-25 at 5 26 07 PM
Screen Shot 2022-06-25 at 5 26 20 PM

Screen Shot 2022-06-25 at 5 25 25 PM

@AbhineetJain AbhineetJain requested a review from a team as a code owner June 25, 2022 21:51
@AbhineetJain AbhineetJain force-pushed the abhineetjain/users-filter-ui branch from db1ab2e to b94dba8 Compare June 25, 2022 21:51
@AbhineetJain AbhineetJain requested review from Emyrk and f0ssel June 25, 2022 21:51
@AbhineetJain AbhineetJain force-pushed the abhineetjain/users-filter-ui branch 3 times, most recently from 81dc68b to 63e35c2 Compare June 27, 2022 15:18
@Emyrk Emyrk requested a review from presleyp June 27, 2022 15:31
@Emyrk
Copy link
Member

Emyrk commented Jun 27, 2022

Pumped on this

])(`query=%p, filter=%p`, (query, filter) => {
expect(queryToFilter(query)).toEqual(filter)
})
})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

Copy link
Contributor

@presleyp presleyp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kira raises great questions but don't consider me a blocker on this. Excited to have this feature!

@AbhineetJain AbhineetJain force-pushed the abhineetjain/users-filter-ui branch from 63e35c2 to 4717f84 Compare June 28, 2022 07:43
@AbhineetJain AbhineetJain force-pushed the abhineetjain/users-filter-ui branch from 1031696 to bfbf729 Compare June 28, 2022 15:32
users: [],
roles: MockSiteRoles,
isLoading: true,
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this story since it tests a particular behavior of the component, but I am not sure if it is a good UI snapshot since the loader is spinning and the snapshot may change across different builds. 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good thought. I haven't read through this in detail, but could we pause the animation for the loader? Or introduce a slight delay? https://www.chromatic.com/docs/animations

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing to this, I used

Loading.parameters = {
  chromatic: { pauseAnimationAtEnd: true },
}

and it seems to be constant for at least 3 builds.

canEditUsers,
isLoading,
}) => {
const styles = useStyles()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is so much clearer!!!!!!!!!!!! thank you!!!

Copy link
Member

@Kira-Pilot Kira-Pilot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is so well done!

@AbhineetJain
Copy link
Contributor Author

Merging this now. If there are more concerns, we can handle them in a separate PR! 🎉

@AbhineetJain AbhineetJain merged commit 0d25e17 into main Jun 28, 2022
@AbhineetJain AbhineetJain deleted the abhineetjain/users-filter-ui branch June 28, 2022 23:12
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.

Allow for searching Users
4 participants