First attempt at admin logging#4
Open
PierreMesure wants to merge 1 commit into
Open
Conversation
| super | ||
| end | ||
| end | ||
|
|
Contributor
There was a problem hiding this comment.
Suggested change
| def i18n_params | |
| { | |
| user_name: user_presenter.present, | |
| space_name: space_presenter.present, | |
| votes: action_log.resource.votes, | |
| project_name: action_log.resource.project.title["en"] | |
| } | |
| end | |
| def space_presenter | |
| @space_presenter ||= Decidim::Log::SpacePresenter.new( | |
| action_log.resource.project.budget.participatory_space, | |
| h, | |
| action_log.resource.project.budget.participatory_space | |
| ) | |
| end |
Contributor
eliegaboriau
left a comment
There was a problem hiding this comment.
Hi,
Firstly, I think you should rewrite the params sent to the locales, and giving them any information you want (you can access every info you need with your resource object i think).
Secondly, you should rewrite every presenter you need :
- the space one cause you're not getting you're participatory_space from the usual path
- probably add a presenter here for the project if you want it to be colored
I'll be glad to review it at the end !
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I won't have any time to work on this until the end of August but I thought I'd push my code so others can look at it and give input.
I managed to get a log entry per project that gets new votes through an import (can be many lines if the PB has a lot of projects) but I've until now had an issue to pass the participatory process name in the entry as well as the project ID and the number of imported votes.
Not sure what I'm doing wrong but I'll have a look at it again in August. In the meantime, would love to get your quick feedback @eliegaboriau as you're now the GOAT of Decidim admin logs! 💪🏼