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

filters component #33

Merged
merged 5 commits into from
Feb 27, 2024
Merged

filters component #33

merged 5 commits into from
Feb 27, 2024

Conversation

mluena
Copy link
Collaborator

@mluena mluena commented Feb 26, 2024

Projects filtering

Overview

Implementaton of filtering functionality, with the following key features and behaviors:

  • Accumulative Filters: Users can apply multiple filters across various categories to refine their search results. These filters are accumulative.

  • Handling of Fully Selected Categories: When all available filters within a specific category are selected, the system does not display these selections as individual badges (which are used to visually represent active filters). This design choice is made under the assumption that selecting all filters within a category essentially results in no filtering action, as it would include all possible options.

  • Display of Active Filters as Badges: The interface uses badges to visually indicate which filters are currently active. To maintain a clean and user-friendly display, a maximum of three badges are shown at any given time. If more than three filters are selected, the interface indicates the presence of additional active filters with a notation such as "+X more".

  • Placeholder for Project Count Button: The interface includes a button designed to display the number of projects (or items) that match the currently selected filters. However, this functionality is not yet implemented due to the backend API, which is responsible for calculating the count based on selected filters, not being ready.

  • When filters are deselected, the URL should update to include only the active filters.

Designs

Link to the related design prototypes (if applicable)

Testing instructions

Go to /projects and play with filters to make sure all conditions above are ccompllished.

Feature relevant tickets

Link to the related task manager tickets


Checklist before submitting

  • Meaningful commits and code rebased on develop.
  • Update CHANGELOG
  • If this PR adds feature that should be tested for regressions when
    deploying to staging/production, please add brief testing instructions
    to the deploy checklist

Copy link

vercel bot commented Feb 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
afoco ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 27, 2024 3:27pm

} else {
const updatedFilters = filtersToUpdate?.includes(e.currentTarget.id)
? filtersToUpdate.length &&
Array.isArray(filtersToUpdate) &&
Copy link
Collaborator

Choose a reason for hiding this comment

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

It could be more readable if we put it in an if condition than in ternaries

@@ -0,0 +1,12 @@
export type FiltersType =
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we move all types to general types folder?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we should reorganize them definitely

@@ -46,6 +46,7 @@ module.exports = {
foreground: 'hsl(var(--accent-foreground))',
},
gray: {
100: '#F3F4F6',
Copy link
Collaborator

@anamontiaga anamontiaga Feb 27, 2024

Choose a reason for hiding this comment

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

Filters design has a gray-700 #374151 for filter labels


<DialogContent>
<DialogHeader className="text-xl font-semibold leading-7">
<DialogTitle>Filters</DialogTitle>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Filters label is a green-900 #041310

@anamontiaga
Copy link
Collaborator

Close dialog icon is a little bit misaligned

@mluena mluena merged commit b46f17e into develop Feb 27, 2024
2 of 3 checks passed
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.

2 participants