-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Extend SDG managment section to allow content reviews #4294
Conversation
984fc71
to
41ca34d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's an initial review.
Since changing the controller to use has_filters
and the views to use the filter_subnav
partial (as done in many places) would require a few changes, I'll continue after we've decided what to do here.
f9a6faa
to
047c5f2
Compare
app/components/sdg_management/relations/subnavigation_component.html.erb
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Senen For some reasons I don't find the option to reply to your comments 🤔.
Inheritance is fine with me, and having a different flash message is also fine with me.
and its relation with relatables Note about sdg_review factory: Cannot use the constantize method on the relatable_type as long as the relatable classes will be loaded and this will throw an exception because the database is not available at factiry definition time.
So we can override it when using inheritance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like Columbo used to say: "just one more thing, sir" 😉.
So we can use it from components too.
We have three filters: "pending", "all" and "reviewed". Where "pending" is the default one. Now we are rendering the `shared/_filter_subnav` partial we need to stub helper methods defined at the controller and the helper methods that rely on the request parameters to test the component.
Show a notice only once when the user updates the relatable.
This was a false positive in Rubocop, but we can avoid it by using the attribute reader method we've just added.
References
Extends #4269.
Objectives
Extend the SDG content management section to allow users to review user-provided content. Polls and Legislation Processes are marked as reviewed during creation as administrators users always create them.
Only an administrator or an SDG manager user can mark the SDG content as reviewed.
Split index into three sections:
The search form works within the three sections.
When a user with permission updates the relatable, it is marked as reviewed and a notice is shown to the user "Debate updated successfully and marked as reviewed". The users are always redirected to the "Pending" tab to continue reviewing of others relatables.
Visual Changes