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

Implement bulk actions for global moderations #13678

Merged
merged 55 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
c81157c
add action button and checkbox to index
ElviaBth Nov 19, 2024
69c2d97
add actions list
ElviaBth Nov 19, 2024
a44b158
add JS file
ElviaBth Nov 20, 2024
3cd5c1e
add bulk-actions files
ElviaBth Nov 20, 2024
a55cc35
Merge branch 'develop' into feature/implement_bulk_actions_moderations
ElviaBth Nov 20, 2024
b85b88e
add bulk_action method to controller
ElviaBth Nov 21, 2024
1ba30b4
add moderated users bulk actions
ElviaBth Nov 21, 2024
d207c3e
add moderated_users JS file
ElviaBth Nov 21, 2024
4e98231
add bulk_actions command and routes
ElviaBth Nov 21, 2024
00b1235
refactor ko
ElviaBth Nov 22, 2024
8f2eae9
refactor bulk action method on command
ElviaBth Nov 22, 2024
9747beb
add conditions for dropdown
ElviaBth Nov 24, 2024
820a0f1
refactor index view
ElviaBth Nov 25, 2024
3b1ab30
fix specs error
ElviaBth Nov 25, 2024
884dcbd
fix iniciatives spec
ElviaBth Nov 26, 2024
12da3ef
add more checks to admin_manages_global_moderations spec
ElviaBth Nov 26, 2024
e54ac18
add bulk_action to moderated_users controller
ElviaBth Nov 26, 2024
009fc3b
hide and show dropdown actions
ElviaBth Nov 27, 2024
ce0e015
add bulk_unreported
ElviaBth Nov 27, 2024
84cc468
add bulk_new, bulk_create and bulk_destroy
ElviaBth Nov 27, 2024
b8d919b
fix spec error
ElviaBth Nov 28, 2024
f91c4fc
fix user_id bug
ElviaBth Nov 28, 2024
647467e
add bulk_unblock command
ElviaBth Nov 28, 2024
3f8f732
refactor bulk_block command
ElviaBth Nov 28, 2024
45b3c38
refactor bulk_unblock
ElviaBth Nov 29, 2024
413784d
refactor bulk_unreport_user
ElviaBth Nov 29, 2024
657e4a1
refacrot bulk_unreport_user
ElviaBth Nov 29, 2024
5fe1eee
refactor bulk_unhide_content and bulk_unreport_content
ElviaBth Nov 29, 2024
95c770f
update presenter
Nov 29, 2024
56d7def
add admin logs action info
ElviaBth Nov 29, 2024
b62172f
refactor changeset method in UserPresenter
ElviaBth Dec 2, 2024
394fcdf
fix spelling error
ElviaBth Dec 2, 2024
3089f83
add bulk_hide_content
ElviaBth Dec 2, 2024
3ca8977
Update decidim-admin/app/commands/decidim/admin/bulk_action.rb
ElviaBth Dec 3, 2024
90e97ab
apply feedback suggestions
ElviaBth Dec 3, 2024
4230138
refactor bulk_action file
ElviaBth Dec 3, 2024
c2e45d0
refactor bulk actions
ElviaBth Dec 4, 2024
7d20185
add changeset_config method to moderations_presenter
ElviaBth Dec 4, 2024
3030241
ignore unused locales
ElviaBth Dec 4, 2024
66eb8a8
refactor changeset method
ElviaBth Dec 4, 2024
bdb6665
add more checks to admin_log_presenter
ElviaBth Dec 5, 2024
5cc9c87
Merge branch 'develop' into feature/implement_bulk_actions_moderations
ElviaBth Dec 5, 2024
640cd0a
fix spec
ElviaBth Dec 5, 2024
3e024e0
add more checks to moderation spec
ElviaBth Dec 5, 2024
67bf2d4
fix date_picker spec
ElviaBth Dec 5, 2024
999429d
apply feedback changes
ElviaBth Dec 12, 2024
86b15d0
add new class base_user_presenter
ElviaBth Dec 13, 2024
131f395
add perform_action_without_log method
ElviaBth Dec 13, 2024
b9c40d8
fix unreport_resource and unhide_resource specs
ElviaBth Dec 13, 2024
e29030c
Merge branch 'develop' into feature/implement_bulk_actions_moderations
ElviaBth Dec 16, 2024
6b00294
apply feedback suggestions
ElviaBth Dec 17, 2024
22eb588
Update decidim-admin/app/commands/decidim/admin/bulk_unblock_users.rb
ElviaBth Dec 17, 2024
a45dc47
Update decidim-admin/app/commands/decidim/admin/bulk_block_users.rb
ElviaBth Dec 17, 2024
599acb3
fix lint errors
ElviaBth Dec 17, 2024
6424648
remove trailing whitespace
ElviaBth Dec 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div class="flex align-middle gap-x-4 ml-auto" id="js-other-moderations-actions-wrapper">
<%= render partial: "decidim/admin/moderations/bulk_actions/dropdown" %>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<div id="js-global-moderations-bulk-actions-wrapper">
<button
id="js-global-moderations-bulk-actions-button"
class="button button__sm button__secondary"
type="button"
data-toggle="js-global-moderations-bulk-actions-dropdown">
<%= t("decidim.moderations.index.actions") %>
<%= icon "arrow-down-s-line", class: "dropdown-filter-icon" %>
</button>

<div
id="js-global-moderations-bulk-actions-dropdown"
class="dropdown-pane"
data-position="bottom"
data-alignment="right"
data-dropdown="dropdown"
data-auto-focus="false"
data-events="resize">
<ul>
<li></li>
<li></li>
</ul>
</div>
</div>
13 changes: 9 additions & 4 deletions decidim-admin/app/views/decidim/admin/moderations/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
<h1 class="item_show__header-title">
<%= t(".title") %>

<div class="card__filter">
<%= link_to t("actions.not_hidden", scope: "decidim.moderations"), moderations_path %>
|
<%= link_to t("actions.hidden", scope: "decidim.moderations"), moderations_path(hidden: true) %>
<div class="flex items-center gap-x-4">
<%= render partial: "bulk-actions" %>
<div class="card__filter">
<%= link_to t("actions.not_hidden", scope: "decidim.moderations"), moderations_path %>
|
<%= link_to t("actions.hidden", scope: "decidim.moderations"), moderations_path(hidden: true) %>
</div>
</div>
</h1>
</div>
Expand All @@ -15,6 +18,7 @@
<table class="table-list">
<thead>
<tr>
<th><%= check_box_tag "global_moderations_bulk", "all", false, class: "js-check-all" %></th>
<th><%= t("models.moderation.fields.reportable_id", scope: "decidim.moderations") %></th>
<th><%= t("models.moderation.fields.reportable_type", scope: "decidim.moderations") %></th>
<% if !respond_to?(:current_participatory_space) %>
Expand All @@ -34,6 +38,7 @@
<% moderations.each do |moderation| %>
<% next unless moderation.reportable %>
<tr data-id="<%= moderation.id %>">
<td><%= check_box_tag "moderation_ids_s[]", moderation.id, false, class: "js-check-all-moderation js-moderation-list-check js-moderation-id-#{moderation.id}" %><br></td>
<td><%= moderation.reportable.id %></td>
<td>
<%= moderation.reportable.class.model_name.human %>
Expand Down
2 changes: 2 additions & 0 deletions decidim-admin/config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1274,6 +1274,8 @@ en:
unreport:
invalid: There was a problem unreporting the resource.
success: Resource successfully unreported.
index:
actions: Actions
models:
moderation:
fields:
Expand Down
Loading