Skip to content

Admin log filters#9460

Merged
andreslucena merged 20 commits intodecidim:developfrom
mainio:feature/admin-log-filters
Jul 13, 2022
Merged

Admin log filters#9460
andreslucena merged 20 commits intodecidim:developfrom
mainio:feature/admin-log-filters

Conversation

@ahukkanen
Copy link
Copy Markdown
Contributor

@ahukkanen ahukkanen commented Jun 22, 2022

🎩 What? Why?

Implements filters to the admin logs view as described at #9180.

WIP This is still partly work in progress as in the sprint review meeting we discussed today that the participatory space dropdown may be problematic in instances that have many spaces, such as Barcelona. We decided that we are going to implement an autocomplete field for the participatory space selection to tackle this problem.

📌 Related Issues

Testing

  • Login as an admin
  • Go to the admin panel
  • Visit the admin logs view
  • See the filter inputs at the top of the view

📋 Checklist

  • CONSIDER adding a unit test if your PR resolves an issue.
  • ✔️ DO check open PR's to avoid duplicates.
  • ✔️ DO keep pull requests small so they can be easily reviewed.
  • ✔️ DO build locally before pushing.
  • ✔️ DO make sure tests pass.
  • ✔️ DO make sure any new changes are documented in docs/.
  • ✔️ DO add and modify seeds if necessary.
  • ✔️ DO add CHANGELOG upgrade notes if required.
  • ✔️ DO add to GraphQL API if there are new public fields.
  • ✔️ DO add link to MetaDecidim if it's a new feature.
  • AVOID breaking the continuous integration build.
  • AVOID making significant changes to the overall architecture.

📷 Screenshots

Admin log filters

@ahukkanen ahukkanen changed the title Feature/admin log filters Admin log filters Jun 22, 2022
Otherwise the user experience can be a bit weird as the user
wouldn't find records matching the participatory space by
searching with that.
@ahukkanen ahukkanen added project: GDPR Barcelona City Council contract status: WIP labels Jun 22, 2022
@ahukkanen ahukkanen marked this pull request as ready for review July 7, 2022 16:44
@ahukkanen ahukkanen requested a review from andreslucena July 7, 2022 16:44
@ahukkanen
Copy link
Copy Markdown
Contributor Author

@andreslucena This is ready to be reviewed now. The autocomplete is implemented for the participatory space selection.

@andreslucena
Copy link
Copy Markdown
Member

@ahukkanen nice job! This is what I had in mind when I've made the original issue, awesome!

We've reviewed the changes with @carolromero, and found a couple of things to change:

  1. The date time picker should be the same as we use on other places (for consistency)

This is what's now in the PR (it seems like it's the default one in my browser)

image

And this is what I expected to see (taken from Meetings form)

Selection_274

  1. Can we change the message when there are no results found? Now it's showing "There are no logs yet". We were thinking in "There are no logs with those filters. Try to change them and retry"

Selection_275

  1. Can we add a bit of a margin next to the search button? As it's now, it seems like the search action only applies to the user input text.

image

Copy link
Copy Markdown
Member

@andreslucena andreslucena left a comment

Choose a reason for hiding this comment

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

Code wise I only found a typo here, the rest is great code as usual 😄

@ahukkanen
Copy link
Copy Markdown
Contributor Author

@andreslucena All changes done.

  1. The date time picker should be the same as we use on other places (for consistency)

Fixed this issue. It turned out that when using search_form_for, Ransack defaults to its own form builder. I overrode that method and added some hacks to get around that but I still decided to use search_form_for and port some relevant code from Ransack to FoundationRailsHelper in order to translate the form labels correctly (as Ransack handles that).

This way we are also losing some other functionality that the Ransack form builder provides but that's not used today in Decidim admin, so I guess that's fine. In case we need more stuff in the future, we can gradually add what we need to the Decidim's own SearchFormBuilder that I introduced to fix this issue. This class is an integration layer between Ransack and the Decidim form builders (based on FoundationRailsHelper).

  1. Can we change the message when there are no results found? Now it's showing "There are no logs yet". We were thinking in "There are no logs with those filters. Try to change them and retry"

Added this message with slight modification.

  1. Can we add a bit of a margin next to the search button? As it's now, it seems like the search action only applies to the user input text.

Added margin. It's probably not exactly as you imagined but I did not want to introduce any custom CSS just for this, so I solved it with the Foundation grid system which adds a bit more space than you probably thought with some resolutions.

@ahukkanen ahukkanen requested a review from andreslucena July 12, 2022 16:58
Copy link
Copy Markdown
Member

@andreslucena andreslucena left a comment

Choose a reason for hiding this comment

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

LGTM 👍🏽

@andreslucena andreslucena merged commit 21f3917 into decidim:develop Jul 13, 2022
@ahukkanen ahukkanen deleted the feature/admin-log-filters branch July 13, 2022 09:20
entantoencuanto added a commit that referenced this pull request Jul 15, 2022
…ging

* feature/redesign-main-footer:
  Reorder elements in main links of footer and define links and texts
  Define a cell for static_pages and topics configured to appear in footer
  Fix translation call
  Set fixed links in redesigned_main_legal partial
  Add FooterMenuPresenter to display menu items in footer
  Fix budgets seeds on non development apps (#9585)
  Return 404 when there isn't a valid component in program (#9576)
  Add missing queue close_meeting_reminder to sidekiq configuration (#9568)
  Make the HERE Map display in the currently selected language (#9552)
  Add help text for proposals' 'publish answers immediately' setting  (#9549)
  Fix admin language selector with more than 4 locales (#9519)
  Fix publish event on official proposals (#9421)
  Prevent missing ActionLog entries to break the application (#9502)
  Add boilerplate structure to CHANGELOG (#9501)
  Add step-by-step instructions of the Crowdin releases process (#9555)
  Fix translated attributes field type change (#9547)
  Add `modifyList` option to the autocomplete element (#9548)
  Admin log filters (#9460)
  Improve the default gitignore files created by the generators (#9507)
eliegaboriau pushed a commit to eliegaboriau/decidim that referenced this pull request Oct 25, 2022
* Implement admin log filters initial

* Add system specs for the admin log filters

* Also match the participatory space filter against the resource

Otherwise the user experience can be a bit weird as the user
wouldn't find records matching the participatory space by
searching with that.

* Fix the ransack predicates unused i18n keys

* Add participatory space information to the API

* Show all participatory spaces visible for a user through the API

* Add specs covering the new API functionality regarding spaces

* Implement participatory space search autocomplete for admin logs

* Fix the admin logs system spec after changing the space filter

* Fix typo in code comment

Co-authored-by: Andrés Pereira de Lucena <andreslucena@users.noreply.github.com>

* Make the admin log filters use the Decidim datetime picker

* Fix the admin checks logs system specs

* Add specs for the search form builder

* Add spacing for the logs search button

* Implement different message when search returns an empty list

* Add specs for the empty logs list situation in both cases

Co-authored-by: Andrés Pereira de Lucena <andreslucena@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: admin project: GDPR Barcelona City Council contract status: WIP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Filters on Admin Log for improving auditing

2 participants