timeoverflow icon indicating copy to clipboard operation
timeoverflow copied to clipboard

Organization-based filtering for posts

Open gmartincor opened this issue 8 months ago • 2 comments

Context

https://github.com/user-attachments/assets/f00b4a63-7407-4f41-8e8a-b1094f5587aa

This functionality complements the existing category filtering and allows filtering offers by organizations and categories at the same time .

Changes implemented

I have added an organization filtering system in the post listing interface (both offers and inquiries) that:

  1. Uses the existing application design pattern based on has_scope to maintain consistency and follow Rails best practices
  2. Integrates seamlessly with the existing filtering system, allowing combinations with other filters (category, text search)
  3. Correctly persists filtering parameters between requests
  4. Improves the UX by keeping the button for creating new posts visible regardless of applied filters

At the technical level, the implementation follows the MVC architecture:

  • Model: Addition of the by_organization scope in the Post model (base class for Offer and Inquiry)
  • Controller: Integration of the new scope in PostsController, preserving existing filtering logic
  • View: Modification of filtering partials to include the organization selector, with behavior consistent with the category selector

Benefits for users

  • Users can filter content by specific organization, allowing faster access to relevant posts
  • Administrators of multiple time banks can visualize and manage posts by organization
  • Users can combine filters (e.g., category + organization) for more precise searches

Next steps

This implementation lays the groundwork for future related improvements:

  • Saving filtering preferences per user
  • Evolving towards an advanced filtering system with more options

gmartincor avatar Apr 15 '25 18:04 gmartincor

@sseerrggii @gmartincor @franpb14 Are we sure we want this feature? 🤔 Not sure if I get the use-case.

markets avatar Apr 17 '25 08:04 markets

Hi @markets yes! @gmartincor is working on #789
In order to facilitate exchanges between organizations we need the ability to filter ofers/demands by organization

sseerrggii avatar Apr 20 '25 16:04 sseerrggii