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

Improve navigation and filters in proposals #13004

Merged
merged 21 commits into from
Jun 27, 2024

Conversation

entantoencuanto
Copy link
Contributor

@entantoencuanto entantoencuanto commented Jun 13, 2024

🎩 What? Why?

This PR:

  • Adds a system for admins to store in session their filters choices which are recovered whenever they enter in the admin index of a resource with filters without filters options in the query string part of the URL. If there are filters specified the admin is redirected to the path which includes the filters in the query. This redirection is made calling a check_admin_session_filters method defined in the filterable concern which has been added only to proposals index, but it can be used in other indexes with filters of the admin panel to keep the filters choices
  • Adds an option to the filters query string which allows admins to reset their filter configuration on each specific index with filters
  • Provides in the tags of filters a specific link to reset all the filters and return to the index without filters options in the query string
  • When an admin opens the show view of a proposal from a filtered selection on the index of proposals the filter is stored and used to generate the links of previous and next proposal on the filtered list if any. If the admin returns to the index the filter is recovered (
  • This previous and next adjacent items feature can be used in other parts of the application combined with the storage of the filters state. The only requirement is that the controller uses the filterable concern

📌 Related Issues

Link your PR to an issue

Testing

As admin:

♥️ Thank you!

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This pull request does not contain a valid label. Please add one of the following labels: ['type: feature', 'type: change', 'type: fix', 'type: removal', 'target: developer-experience', 'type: internal']

@entantoencuanto entantoencuanto changed the title Feature/proposals admins filters and navigation Improve navigation and filters in proposals Jun 13, 2024
@entantoencuanto entantoencuanto added the type: feature PRs or issues that implement a new feature label Jun 13, 2024
github-actions[bot]
github-actions bot previously approved these changes Jun 13, 2024
github-actions[bot]
github-actions bot previously approved these changes Jun 13, 2024
github-actions[bot]
github-actions bot previously approved these changes Jun 13, 2024
@furilo furilo requested a review from ferblape June 13, 2024 21:14
@furilo
Copy link

furilo commented Jun 14, 2024

@NilHomedes we are fixing the button separation, but meanwhile you can test the rest.

github-actions[bot]
github-actions bot previously approved these changes Jun 14, 2024
github-actions[bot]
github-actions bot previously approved these changes Jun 14, 2024
Copy link
Member

@NilHomedes NilHomedes left a comment

Choose a reason for hiding this comment

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

Hi @furilo

First of all, please ask me for a review once you have finished all the job.
If not, I'm wasting time reviewing something that suddenly changes, as just happened. I'm saying that for the red colour of the button.

Anyway, just two small changes we should make:

  • Change the text to "Remove all"
  • Add bold to the "Remove all" text

Screenshot 2024-06-14 at 13-49-02 Proposals - Admin - Test Site for Lot2

github-actions[bot]
github-actions bot previously approved these changes Jun 14, 2024
github-actions[bot]
github-actions bot previously approved these changes Jun 14, 2024
@entantoencuanto
Copy link
Contributor Author

Changes added and updated screenshots

github-actions[bot]
github-actions bot previously approved these changes Jun 14, 2024
@entantoencuanto entantoencuanto force-pushed the feature/proposals-admins-filters-and-navigation branch from a4bb05b to 9ab95a0 Compare June 26, 2024 13:52
@entantoencuanto
Copy link
Contributor Author

@entantoencuanto can you merge with latest develop to fix the flaky? I rerun multiple times but the flaky is still happening :/

Done

@andreslucena andreslucena merged commit 49bd028 into develop Jun 27, 2024
84 checks passed
@andreslucena andreslucena deleted the feature/proposals-admins-filters-and-navigation branch June 27, 2024 05:57
entantoencuanto added a commit that referenced this pull request Jun 27, 2024
* feature/admin-filters-registry:
  Add test for admin filterable concern using AdminFilter configuration
  Define an admim filters registry and an AdminFilter class to manage filters in admin and use it in proposals
  New Crowdin updates (#12921)
  Improve navigation and filters in proposals (#13004)
davidbeig pushed a commit to AjuntamentdeBarcelona/decidim that referenced this pull request Oct 16, 2024
* Store filters selections in session and allow removing all filters

* Implement next and prev links from proposal show

* Inspect session

* Use with_indifferent_access with session admin_filters

* Revert "Inspect session"

This reverts commit 495a33b.

* Refactor adjacents navigation links

* Use spans and adjust margins

* Fix wrong spelling

* Fix spelling

* Ensure the session filtered collection query returns an id

* style filters bar

* better space handling for containers

* Add tests

* Change remove all filters text

* Remove font-normal class remove all filters tag

* Fix expected text in tests

* Add comment to adjacent_items method

* Move method call to before_action filter

* Define index method explicitly in controller

* Change translation

Co-authored-by: Andrés Pereira de Lucena <[email protected]>

* Remove unnecessary method call

Co-authored-by: Andrés Pereira de Lucena <[email protected]>

---------

Co-authored-by: Hugoren Martinako <[email protected]>
Co-authored-by: Andrés Pereira de Lucena <[email protected]>
(cherry picked from commit 49bd028)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contract: 2024-developments Barcelona City Council contract module: admin module: proposals type: feature PRs or issues that implement a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve navigation through proposals
6 participants