Skip to content

First attempt at admin logging#4

Open
PierreMesure wants to merge 1 commit into
masterfrom
add-admin-logs
Open

First attempt at admin logging#4
PierreMesure wants to merge 1 commit into
masterfrom
add-admin-logs

Conversation

@PierreMesure
Copy link
Copy Markdown
Contributor

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! 💪🏼

super
end
end

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor

@eliegaboriau eliegaboriau left a comment

Choose a reason for hiding this comment

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

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 !

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