decidim-admin 0.31.5 → 0.32.0.rc2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -12
- data/app/cells/decidim/admin/attachments_privacy_warning/show.erb +1 -1
- data/app/cells/decidim/admin/attachments_privacy_warning_cell.rb +2 -6
- data/app/commands/decidim/admin/content_blocks/reorder_content_blocks.rb +1 -1
- data/app/commands/decidim/admin/participatory_space/create_member.rb +99 -0
- data/app/commands/decidim/admin/participatory_space/destroy_member.rb +30 -0
- data/app/commands/decidim/admin/participatory_space/import_member_csv.rb +46 -0
- data/app/commands/decidim/admin/participatory_space/publish_all_members.rb +52 -0
- data/app/commands/decidim/admin/participatory_space/unpublish_all_members.rb +52 -0
- data/app/commands/decidim/admin/participatory_space/update_member.rb +13 -0
- data/app/commands/decidim/admin/reorder_components.rb +1 -1
- data/app/commands/decidim/admin/reorder_taxonomies.rb +1 -1
- data/app/commands/decidim/admin/update_organization.rb +1 -1
- data/app/controllers/concerns/decidim/admin/content_blocks/landing_page.rb +1 -0
- data/app/controllers/concerns/decidim/admin/content_blocks/landing_page_content_blocks.rb +3 -2
- data/app/controllers/concerns/decidim/admin/filterable.rb +4 -4
- data/app/controllers/concerns/decidim/admin/participatory_space_admin_context.rb +1 -0
- data/app/controllers/concerns/decidim/admin/participatory_space_export.rb +1 -1
- data/app/controllers/decidim/admin/area_types_controller.rb +2 -2
- data/app/controllers/decidim/admin/areas_controller.rb +3 -2
- data/app/controllers/decidim/admin/block_user_controller.rb +2 -2
- data/app/controllers/decidim/admin/component_permissions_controller.rb +1 -1
- data/app/controllers/decidim/admin/components/base_controller.rb +13 -9
- data/app/controllers/decidim/admin/components_controller.rb +3 -2
- data/app/controllers/decidim/admin/concerns/has_attachment_collections.rb +2 -2
- data/app/controllers/decidim/admin/concerns/has_attachments.rb +2 -2
- data/app/controllers/decidim/admin/conflicts_controller.rb +1 -1
- data/app/controllers/decidim/admin/exports_controller.rb +1 -1
- data/app/controllers/decidim/admin/impersonations_controller.rb +1 -1
- data/app/controllers/decidim/admin/imports_controller.rb +2 -1
- data/app/controllers/decidim/admin/managed_users/promotions_controller.rb +1 -1
- data/app/controllers/decidim/admin/newsletters_controller.rb +9 -8
- data/app/controllers/decidim/admin/organization_appearance_controller.rb +1 -1
- data/app/controllers/decidim/admin/organization_controller.rb +1 -1
- data/app/controllers/decidim/admin/organization_external_domain_allowlist_controller.rb +1 -1
- data/app/controllers/decidim/admin/participatory_space/concerns/has_members.rb +166 -0
- data/app/controllers/decidim/admin/participatory_space/concerns/has_members_csv_import.rb +67 -0
- data/app/controllers/decidim/admin/participatory_space/concerns/members_filterable.rb +36 -0
- data/app/controllers/decidim/admin/participatory_space/user_role_controller.rb +2 -2
- data/app/controllers/decidim/admin/reminders_controller.rb +1 -1
- data/app/controllers/decidim/admin/resource_permissions_controller.rb +1 -1
- data/app/controllers/decidim/admin/scope_types_controller.rb +2 -2
- data/app/controllers/decidim/admin/scopes_controller.rb +3 -2
- data/app/controllers/decidim/admin/share_tokens_controller.rb +2 -2
- data/app/controllers/decidim/admin/space_publications_controller.rb +2 -2
- data/app/controllers/decidim/admin/static_page_topics_controller.rb +2 -2
- data/app/controllers/decidim/admin/static_pages_controller.rb +2 -2
- data/app/controllers/decidim/admin/taxonomies_controller.rb +3 -3
- data/app/controllers/decidim/admin/taxonomy_filters_controller.rb +3 -3
- data/app/controllers/decidim/admin/taxonomy_items_controller.rb +3 -3
- data/app/controllers/decidim/admin/users_controller.rb +1 -1
- data/app/forms/decidim/admin/content_block_form.rb +28 -1
- data/app/forms/decidim/admin/organization_form.rb +0 -1
- data/app/forms/decidim/admin/participatory_space/member_csv_import_form.rb +33 -0
- data/app/forms/decidim/admin/participatory_space/member_form.rb +26 -0
- data/app/forms/decidim/admin/participatory_space_admin_user_form.rb +1 -1
- data/app/forms/decidim/admin/selective_newsletter_form.rb +7 -7
- data/app/forms/decidim/admin/taxonomy_filter_form.rb +1 -0
- data/app/helpers/decidim/admin/newsletters_helper.rb +8 -5
- data/app/helpers/decidim/admin/search_form_helper.rb +17 -0
- data/app/helpers/decidim/admin/settings_helper.rb +2 -0
- data/app/jobs/decidim/admin/newsletter_job.rb +2 -2
- data/app/jobs/decidim/admin/participatory_space/destroy_members_follows_job.rb +36 -0
- data/app/jobs/decidim/admin/participatory_space/import_member_csv_job.rb +29 -0
- data/app/packs/src/decidim/admin/controllers/access_mode/access_mode.test.js +68 -0
- data/app/packs/src/decidim/admin/controllers/access_mode/controller.js +52 -0
- data/app/packs/src/decidim/admin/newsletters.js +2 -2
- data/app/packs/stylesheets/decidim/admin/_datepicker.scss +0 -4
- data/app/queries/decidim/admin/newsletter_recipients.rb +8 -8
- data/app/views/decidim/admin/admin_terms/show.html.erb +3 -1
- data/app/views/decidim/admin/area_types/index.html.erb +3 -2
- data/app/views/decidim/admin/areas/index.html.erb +3 -2
- data/app/views/decidim/admin/attachment_collections/edit.html.erb +2 -2
- data/app/views/decidim/admin/attachment_collections/index.html.erb +2 -2
- data/app/views/decidim/admin/attachment_collections/new.html.erb +2 -2
- data/app/views/decidim/admin/attachments/index.html.erb +3 -2
- data/app/views/decidim/admin/authorization_workflows/index.html.erb +2 -2
- data/app/views/decidim/admin/block_user/new.html.erb +1 -0
- data/app/views/decidim/admin/components/index.html.erb +2 -2
- data/app/views/decidim/admin/components/manage_trash.html.erb +2 -2
- data/app/views/decidim/admin/conflicts/edit.html.erb +3 -1
- data/app/views/decidim/admin/conflicts/index.html.erb +3 -2
- data/app/views/decidim/admin/dashboard/show.html.erb +4 -4
- data/app/views/decidim/admin/help_sections/update.html.erb +2 -0
- data/app/views/decidim/admin/impersonatable_users/index.html.erb +3 -2
- data/app/views/decidim/admin/impersonations/_form.html.erb +2 -2
- data/app/views/decidim/admin/impersonations/new.html.erb +3 -2
- data/app/views/decidim/admin/imports/new.html.erb +1 -0
- data/app/views/decidim/admin/logs/_logs_list.html.erb +1 -1
- data/app/views/decidim/admin/logs/index.html.erb +1 -1
- data/app/views/decidim/admin/managed_users/impersonation_logs/index.html.erb +6 -5
- data/app/views/decidim/admin/managed_users/promotions/new.html.erb +3 -2
- data/app/views/decidim/admin/{participatory_space_private_users → members}/edit.html.erb +2 -2
- data/app/views/decidim/admin/{participatory_space_private_users → members}/index.html.erb +25 -25
- data/app/views/decidim/admin/{participatory_space_private_users → members}/new.html.erb +2 -2
- data/app/views/decidim/admin/{participatory_space_private_users_csv_imports → members_csv_imports}/new.html.erb +2 -2
- data/app/views/decidim/admin/moderations/_moderation-tr.html.erb +2 -6
- data/app/views/decidim/admin/moderations/_moderations-thead.html.erb +0 -1
- data/app/views/decidim/admin/moderations/reports/index.html.erb +1 -1
- data/app/views/decidim/admin/newsletter_templates/show.html.erb +3 -2
- data/app/views/decidim/admin/newsletters/confirm_recipients.html.erb +4 -6
- data/app/views/decidim/admin/newsletters/index.html.erb +2 -2
- data/app/views/decidim/admin/newsletters/select_recipients_to_deliver.html.erb +2 -2
- data/app/views/decidim/admin/newsletters/show.html.erb +3 -2
- data/app/views/decidim/admin/officializations/index.html.erb +6 -4
- data/app/views/decidim/admin/officializations/show_email.html.erb +2 -0
- data/app/views/decidim/admin/organization/form/_extra_features.html.erb +0 -4
- data/app/views/decidim/admin/organization_external_domain_allowlist/_form.html.erb +2 -2
- data/app/views/decidim/admin/organization_external_domain_allowlist/edit.html.erb +2 -2
- data/app/views/decidim/admin/reminders/new.html.erb +8 -1
- data/app/views/decidim/admin/resource_permissions/edit.html.erb +2 -2
- data/app/views/decidim/admin/scope_types/index.html.erb +3 -2
- data/app/views/decidim/admin/scopes/index.html.erb +2 -2
- data/app/views/decidim/admin/share_tokens/index.html.erb +2 -0
- data/app/views/decidim/admin/shared/landing_page/_content_blocks.html.erb +0 -2
- data/app/views/decidim/admin/shared/landing_page/edit.html.erb +2 -0
- data/app/views/decidim/admin/shared/landing_page_content_blocks/edit.html.erb +1 -0
- data/app/views/decidim/admin/static_page_topics/index.html.erb +2 -2
- data/app/views/decidim/admin/static_pages/edit.html.erb +2 -1
- data/app/views/decidim/admin/static_pages/index.html.erb +2 -2
- data/app/views/decidim/admin/statistics/_statistics.html.erb +1 -1
- data/app/views/decidim/admin/statistics/index.html.erb +2 -0
- data/app/views/decidim/admin/taxonomies/_row.html.erb +1 -1
- data/app/views/decidim/admin/taxonomies/_row_children.html.erb +1 -1
- data/app/views/decidim/admin/taxonomies/_table.html.erb +1 -1
- data/app/views/decidim/admin/taxonomies/edit.html.erb +2 -2
- data/app/views/decidim/admin/taxonomies/index.html.erb +4 -4
- data/app/views/decidim/admin/taxonomy_filters/index.html.erb +2 -2
- data/app/views/decidim/admin/taxonomy_filters_selector/index.html.erb +2 -0
- data/app/views/decidim/admin/taxonomy_filters_selector/new.html.erb +2 -0
- data/app/views/decidim/admin/taxonomy_filters_selector/show.html.erb +2 -0
- data/app/views/decidim/admin/taxonomy_items/edit.html.erb +2 -0
- data/app/views/decidim/admin/taxonomy_items/new.html.erb +2 -0
- data/app/views/decidim/admin/users/index.html.erb +3 -2
- data/config/locales/ar.yml +4 -48
- data/config/locales/bg.yml +4 -54
- data/config/locales/bs-BA.yml +0 -23
- data/config/locales/ca-IT.yml +126 -98
- data/config/locales/ca.yml +126 -98
- data/config/locales/cs.yml +122 -95
- data/config/locales/de.yml +109 -93
- data/config/locales/el.yml +11 -44
- data/config/locales/en.yml +126 -98
- data/config/locales/eo.yml +0 -6
- data/config/locales/es-MX.yml +126 -98
- data/config/locales/es-PY.yml +126 -98
- data/config/locales/es.yml +126 -98
- data/config/locales/eu.yml +126 -98
- data/config/locales/fi-plain.yml +126 -98
- data/config/locales/fi.yml +126 -98
- data/config/locales/fr-CA.yml +91 -90
- data/config/locales/fr.yml +91 -90
- data/config/locales/ga-IE.yml +0 -12
- data/config/locales/gl.yml +4 -40
- data/config/locales/he-IL.yml +0 -4
- data/config/locales/hu.yml +4 -51
- data/config/locales/id-ID.yml +4 -33
- data/config/locales/is-IS.yml +0 -14
- data/config/locales/it.yml +4 -67
- data/config/locales/ja.yml +124 -98
- data/config/locales/kaa.yml +0 -15
- data/config/locales/ko.yml +0 -39
- data/config/locales/lb.yml +4 -40
- data/config/locales/lt.yml +4 -51
- data/config/locales/lv.yml +4 -37
- data/config/locales/nl.yml +4 -45
- data/config/locales/no.yml +4 -45
- data/config/locales/pl.yml +4 -53
- data/config/locales/pt-BR.yml +109 -96
- data/config/locales/pt.yml +4 -41
- data/config/locales/ro-RO.yml +9 -50
- data/config/locales/ru.yml +4 -34
- data/config/locales/sk.yml +126 -98
- data/config/locales/sl.yml +0 -6
- data/config/locales/sq-AL.yml +0 -20
- data/config/locales/sr-CS.yml +0 -23
- data/config/locales/sv.yml +74 -86
- data/config/locales/th-TH.yml +0 -7
- data/config/locales/tr-TR.yml +21 -57
- data/config/locales/uk.yml +0 -25
- data/config/locales/zh-CN.yml +4 -37
- data/config/locales/zh-TW.yml +4 -51
- data/decidim-admin.gemspec +7 -10
- data/lib/decidim/admin/engine.rb +5 -2
- data/lib/decidim/admin/menu.rb +1 -1
- data/lib/decidim/admin/test/admin_members_shared_examples.rb +119 -0
- data/lib/decidim/admin/test/admin_participatory_space_access_examples.rb +3 -3
- data/lib/decidim/admin/test/filterable_examples.rb +20 -11
- data/lib/decidim/admin/test/invite_participatory_space_admins_shared_examples.rb +17 -17
- data/lib/decidim/admin/test/invite_participatory_space_collaborators_shared_examples.rb +1 -1
- data/lib/decidim/admin/test/invite_participatory_space_moderators_shared_examples.rb +1 -1
- data/lib/decidim/admin/test/invite_participatory_space_users_shared_context.rb +1 -1
- data/lib/decidim/admin/test/manage_attachment_collections_examples.rb +3 -3
- data/lib/decidim/admin/test/manage_attachments_examples.rb +6 -6
- data/lib/decidim/admin/test/manage_component_permissions_examples.rb +5 -5
- data/lib/decidim/admin/test/manage_moderations_examples.rb +6 -6
- data/lib/decidim/admin/test/manage_participatory_space_publications_examples.rb +2 -2
- data/lib/decidim/admin/test/manage_resource_soft_deletion_examples.rb +3 -3
- data/lib/decidim/admin/version.rb +1 -1
- data/lib/decidim/admin.rb +0 -2
- metadata +39 -35
- data/app/commands/decidim/admin/create_participatory_space_private_user.rb +0 -98
- data/app/commands/decidim/admin/destroy_participatory_space_private_user.rb +0 -28
- data/app/commands/decidim/admin/process_participatory_space_private_user_import_csv.rb +0 -44
- data/app/commands/decidim/admin/publish_all_participatory_space_private_users.rb +0 -50
- data/app/commands/decidim/admin/unpublish_all_participatory_space_private_users.rb +0 -50
- data/app/commands/decidim/admin/update_participatory_space_private_user.rb +0 -11
- data/app/controllers/concerns/decidim/participatory_space_private_users/admin/filterable.rb +0 -34
- data/app/controllers/decidim/admin/concerns/has_private_users.rb +0 -169
- data/app/controllers/decidim/admin/concerns/has_private_users_csv_import.rb +0 -65
- data/app/forms/decidim/admin/participatory_space_private_user_csv_import_form.rb +0 -31
- data/app/forms/decidim/admin/participatory_space_private_user_form.rb +0 -24
- data/app/jobs/decidim/admin/destroy_private_users_follows_job.rb +0 -37
- data/app/jobs/decidim/admin/import_participatory_space_private_user_csv_job.rb +0 -27
- data/app/views/decidim/admin/devise/mailers/password_change.html.erb +0 -3
- data/app/views/decidim/admin/devise/mailers/reset_password_instructions.html.erb +0 -8
- /data/app/views/decidim/admin/{participatory_space_private_users → members}/_form.html.erb +0 -0
|
@@ -70,7 +70,7 @@ shared_examples "manage attachments examples" do
|
|
|
70
70
|
find("*[type=submit]").click
|
|
71
71
|
end
|
|
72
72
|
|
|
73
|
-
expect(page).to
|
|
73
|
+
expect(page).to have_callout("Attachment created successfully.")
|
|
74
74
|
|
|
75
75
|
within "#attachments table" do
|
|
76
76
|
expect(page).to have_text("Very Important Document")
|
|
@@ -106,7 +106,7 @@ shared_examples "manage attachments examples" do
|
|
|
106
106
|
find("*[type=submit]").click
|
|
107
107
|
end
|
|
108
108
|
|
|
109
|
-
expect(page).to
|
|
109
|
+
expect(page).to have_callout("Attachment created successfully.")
|
|
110
110
|
|
|
111
111
|
within "#attachments table" do
|
|
112
112
|
expect(page).to have_text("Very Important Document")
|
|
@@ -142,7 +142,7 @@ shared_examples "manage attachments examples" do
|
|
|
142
142
|
find("*[type=submit]").click
|
|
143
143
|
end
|
|
144
144
|
|
|
145
|
-
expect(page).to
|
|
145
|
+
expect(page).to have_callout("Attachment created successfully.")
|
|
146
146
|
|
|
147
147
|
within "#attachments table" do
|
|
148
148
|
expect(page).to have_text("Document inside a collection")
|
|
@@ -178,7 +178,7 @@ shared_examples "manage attachments examples" do
|
|
|
178
178
|
accept_confirm { click_on "Delete" }
|
|
179
179
|
end
|
|
180
180
|
|
|
181
|
-
expect(page).to
|
|
181
|
+
expect(page).to have_callout("Attachment destroyed successfully.")
|
|
182
182
|
|
|
183
183
|
expect(page).to have_no_content(translated(attachment.title, locale: :en))
|
|
184
184
|
end
|
|
@@ -189,7 +189,7 @@ shared_examples "manage attachments examples" do
|
|
|
189
189
|
accept_confirm { click_on "Delete" }
|
|
190
190
|
end
|
|
191
191
|
|
|
192
|
-
expect(page).to
|
|
192
|
+
expect(page).to have_callout("Attachment destroyed successfully")
|
|
193
193
|
|
|
194
194
|
expect(page).to have_no_content(translated(attachment_with_link.title, locale: :en))
|
|
195
195
|
end
|
|
@@ -214,7 +214,7 @@ shared_examples "manage attachments examples" do
|
|
|
214
214
|
find("*[type=submit]").click
|
|
215
215
|
end
|
|
216
216
|
|
|
217
|
-
expect(page).to
|
|
217
|
+
expect(page).to have_callout("Attachment updated successfully.")
|
|
218
218
|
|
|
219
219
|
within "#attachments table" do
|
|
220
220
|
expect(page).to have_text("This is a nice photo")
|
|
@@ -60,7 +60,7 @@ shared_examples "Managing component permissions" do
|
|
|
60
60
|
find("*[type=submit]").click
|
|
61
61
|
end
|
|
62
62
|
|
|
63
|
-
expect(page).to
|
|
63
|
+
expect(page).to have_callout("Permissions updated successfully.")
|
|
64
64
|
|
|
65
65
|
expect(component.reload.permissions["foo"]).to(
|
|
66
66
|
include(
|
|
@@ -91,7 +91,7 @@ shared_examples "Managing component permissions" do
|
|
|
91
91
|
end
|
|
92
92
|
|
|
93
93
|
it "renders the form again" do
|
|
94
|
-
expect(page).to have_content("problem")
|
|
94
|
+
expect(page).to have_content("There was a problem updating the permissions of this component.")
|
|
95
95
|
end
|
|
96
96
|
end
|
|
97
97
|
|
|
@@ -125,7 +125,7 @@ shared_examples "Managing component permissions" do
|
|
|
125
125
|
find("*[type=submit]").click
|
|
126
126
|
end
|
|
127
127
|
|
|
128
|
-
expect(page).to
|
|
128
|
+
expect(page).to have_callout("Permissions updated successfully.")
|
|
129
129
|
|
|
130
130
|
expect(component.reload.permissions["foo"]).to be_nil
|
|
131
131
|
end
|
|
@@ -162,7 +162,7 @@ shared_examples "Managing component permissions" do
|
|
|
162
162
|
find("*[type=submit]").click
|
|
163
163
|
end
|
|
164
164
|
|
|
165
|
-
expect(page).to
|
|
165
|
+
expect(page).to have_callout("Permissions updated successfully.")
|
|
166
166
|
|
|
167
167
|
expect(component.reload.permissions["foo"]).to(
|
|
168
168
|
include(
|
|
@@ -185,7 +185,7 @@ shared_examples "Managing component permissions" do
|
|
|
185
185
|
find("*[type=submit]").click
|
|
186
186
|
end
|
|
187
187
|
|
|
188
|
-
expect(page).to
|
|
188
|
+
expect(page).to have_callout("Permissions updated successfully.")
|
|
189
189
|
|
|
190
190
|
expect(component.reload.permissions["foo"]).to(
|
|
191
191
|
include(
|
|
@@ -27,7 +27,7 @@ shared_examples "sorted moderations" do
|
|
|
27
27
|
click_on link_text
|
|
28
28
|
end
|
|
29
29
|
all("tbody tr").each_with_index do |row, _index|
|
|
30
|
-
expect(row.find("td:nth-child(2)")).to have_content(reportables.first.
|
|
30
|
+
expect(row.find("td:nth-child(2)")).to have_content(reportables.first.class.model_name.human)
|
|
31
31
|
end
|
|
32
32
|
end
|
|
33
33
|
end
|
|
@@ -86,7 +86,7 @@ shared_examples "manage moderations" do
|
|
|
86
86
|
click_on "Undo the report"
|
|
87
87
|
end
|
|
88
88
|
|
|
89
|
-
expect(page).to
|
|
89
|
+
expect(page).to have_callout("Resource successfully unreported")
|
|
90
90
|
end
|
|
91
91
|
|
|
92
92
|
it "user can hide a resource" do
|
|
@@ -95,7 +95,7 @@ shared_examples "manage moderations" do
|
|
|
95
95
|
click_on "Hide"
|
|
96
96
|
end
|
|
97
97
|
|
|
98
|
-
expect(page).to
|
|
98
|
+
expect(page).to have_callout("Resource successfully hidden")
|
|
99
99
|
expect(page).to have_no_content(moderation.reportable.reported_content_url)
|
|
100
100
|
end
|
|
101
101
|
|
|
@@ -107,8 +107,8 @@ shared_examples "manage moderations" do
|
|
|
107
107
|
click_on "Reports count"
|
|
108
108
|
|
|
109
109
|
all("tbody tr").each_with_index do |row, index|
|
|
110
|
-
|
|
111
|
-
expect(row.find("td:nth-child(2)")).to have_content(
|
|
110
|
+
reportable_type = moderations_ordered_by_report_count_asc[index].reportable.class.model_name.human
|
|
111
|
+
expect(row.find("td:nth-child(2)")).to have_content(reportable_type)
|
|
112
112
|
end
|
|
113
113
|
end
|
|
114
114
|
end
|
|
@@ -241,7 +241,7 @@ shared_examples "manage moderations" do
|
|
|
241
241
|
click_on "Hide"
|
|
242
242
|
end
|
|
243
243
|
|
|
244
|
-
expect(page).to
|
|
244
|
+
expect(page).to have_callout("Resource successfully hidden")
|
|
245
245
|
expect(page).to have_no_css("tr[data-id=\"#{moderation_id}\"]")
|
|
246
246
|
end
|
|
247
247
|
end
|
|
@@ -20,7 +20,7 @@ shared_examples "manage participatory space publications" do
|
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
it "publishes it" do
|
|
23
|
-
expect(page).to
|
|
23
|
+
expect(page).to have_callout(publish_callout_message)
|
|
24
24
|
|
|
25
25
|
visit public_collection_path
|
|
26
26
|
|
|
@@ -50,7 +50,7 @@ shared_examples "manage participatory space publications" do
|
|
|
50
50
|
click_on "Unpublish"
|
|
51
51
|
end
|
|
52
52
|
|
|
53
|
-
expect(page).to
|
|
53
|
+
expect(page).to have_callout(unpublish_callout_message)
|
|
54
54
|
|
|
55
55
|
visit public_collection_path
|
|
56
56
|
|
|
@@ -26,7 +26,7 @@ shared_examples "manage soft deletable component or space" do |resource_name|
|
|
|
26
26
|
end
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
-
expect(page).to
|
|
29
|
+
expect(page).to have_callout("#{resource_name.capitalize} successfully deleted.")
|
|
30
30
|
|
|
31
31
|
within "table" do
|
|
32
32
|
expect(page).to have_no_content(title[:en])
|
|
@@ -81,7 +81,7 @@ shared_examples "manage soft deletable resource" do |resource_name|
|
|
|
81
81
|
accept_confirm { click_on "Move to trash" }
|
|
82
82
|
end
|
|
83
83
|
|
|
84
|
-
expect(page).to
|
|
84
|
+
expect(page).to have_callout("#{resource_name.capitalize} successfully deleted.")
|
|
85
85
|
|
|
86
86
|
within "table" do
|
|
87
87
|
expect(page).to have_no_content(title[:en])
|
|
@@ -118,7 +118,7 @@ shared_examples "manage trashed resource" do |resource_name|
|
|
|
118
118
|
click_on "Restore"
|
|
119
119
|
end
|
|
120
120
|
|
|
121
|
-
expect(page).to
|
|
121
|
+
expect(page).to have_callout("#{resource_name.capitalize} successfully restored.")
|
|
122
122
|
visit trash_path
|
|
123
123
|
within "table" do
|
|
124
124
|
expect(page).to have_no_content(title[:en])
|
data/lib/decidim/admin.rb
CHANGED
|
@@ -15,8 +15,6 @@ module Decidim
|
|
|
15
15
|
autoload :Import, "decidim/admin/import"
|
|
16
16
|
autoload :CustomImport, "decidim/admin/custom_import"
|
|
17
17
|
|
|
18
|
-
include ActiveSupport::Configurable
|
|
19
|
-
|
|
20
18
|
# Public: Stores an instance of ViewHooks
|
|
21
19
|
def self.view_hooks
|
|
22
20
|
@view_hooks ||= ViewHooks.new
|
metadata
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: decidim-admin
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.32.0.rc2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Josep Jaume Rey Peroy
|
|
8
8
|
- Marc Riera Casals
|
|
9
9
|
- Oriol Gual Oliva
|
|
10
|
-
autorequire:
|
|
11
10
|
bindir: bin
|
|
12
11
|
cert_chain: []
|
|
13
|
-
date:
|
|
12
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
14
13
|
dependencies:
|
|
15
14
|
- !ruby/object:Gem::Dependency
|
|
16
15
|
name: active_link_to
|
|
@@ -32,28 +31,34 @@ dependencies:
|
|
|
32
31
|
requirements:
|
|
33
32
|
- - '='
|
|
34
33
|
- !ruby/object:Gem::Version
|
|
35
|
-
version: 0.
|
|
34
|
+
version: 0.32.0.rc2
|
|
36
35
|
type: :runtime
|
|
37
36
|
prerelease: false
|
|
38
37
|
version_requirements: !ruby/object:Gem::Requirement
|
|
39
38
|
requirements:
|
|
40
39
|
- - '='
|
|
41
40
|
- !ruby/object:Gem::Version
|
|
42
|
-
version: 0.
|
|
41
|
+
version: 0.32.0.rc2
|
|
43
42
|
- !ruby/object:Gem::Dependency
|
|
44
43
|
name: devise
|
|
45
44
|
requirement: !ruby/object:Gem::Requirement
|
|
46
45
|
requirements:
|
|
47
|
-
- - "
|
|
46
|
+
- - ">="
|
|
48
47
|
- !ruby/object:Gem::Version
|
|
49
48
|
version: '4.7'
|
|
49
|
+
- - "<"
|
|
50
|
+
- !ruby/object:Gem::Version
|
|
51
|
+
version: '6.0'
|
|
50
52
|
type: :runtime
|
|
51
53
|
prerelease: false
|
|
52
54
|
version_requirements: !ruby/object:Gem::Requirement
|
|
53
55
|
requirements:
|
|
54
|
-
- - "
|
|
56
|
+
- - ">="
|
|
55
57
|
- !ruby/object:Gem::Version
|
|
56
58
|
version: '4.7'
|
|
59
|
+
- - "<"
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '6.0'
|
|
57
62
|
- !ruby/object:Gem::Dependency
|
|
58
63
|
name: devise-i18n
|
|
59
64
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -94,28 +99,28 @@ dependencies:
|
|
|
94
99
|
requirements:
|
|
95
100
|
- - '='
|
|
96
101
|
- !ruby/object:Gem::Version
|
|
97
|
-
version: 0.
|
|
102
|
+
version: 0.32.0.rc2
|
|
98
103
|
type: :development
|
|
99
104
|
prerelease: false
|
|
100
105
|
version_requirements: !ruby/object:Gem::Requirement
|
|
101
106
|
requirements:
|
|
102
107
|
- - '='
|
|
103
108
|
- !ruby/object:Gem::Version
|
|
104
|
-
version: 0.
|
|
109
|
+
version: 0.32.0.rc2
|
|
105
110
|
- !ruby/object:Gem::Dependency
|
|
106
111
|
name: decidim-participatory_processes
|
|
107
112
|
requirement: !ruby/object:Gem::Requirement
|
|
108
113
|
requirements:
|
|
109
114
|
- - '='
|
|
110
115
|
- !ruby/object:Gem::Version
|
|
111
|
-
version: 0.
|
|
116
|
+
version: 0.32.0.rc2
|
|
112
117
|
type: :development
|
|
113
118
|
prerelease: false
|
|
114
119
|
version_requirements: !ruby/object:Gem::Requirement
|
|
115
120
|
requirements:
|
|
116
121
|
- - '='
|
|
117
122
|
- !ruby/object:Gem::Version
|
|
118
|
-
version: 0.
|
|
123
|
+
version: 0.32.0.rc2
|
|
119
124
|
description: Organization administration to manage a single organization.
|
|
120
125
|
email:
|
|
121
126
|
- josepjaume@gmail.com
|
|
@@ -155,7 +160,6 @@ files:
|
|
|
155
160
|
- app/commands/decidim/admin/create_import.rb
|
|
156
161
|
- app/commands/decidim/admin/create_import_example.rb
|
|
157
162
|
- app/commands/decidim/admin/create_newsletter.rb
|
|
158
|
-
- app/commands/decidim/admin/create_participatory_space_private_user.rb
|
|
159
163
|
- app/commands/decidim/admin/create_scope.rb
|
|
160
164
|
- app/commands/decidim/admin/create_scope_type.rb
|
|
161
165
|
- app/commands/decidim/admin/create_share_token.rb
|
|
@@ -166,7 +170,6 @@ files:
|
|
|
166
170
|
- app/commands/decidim/admin/deliver_newsletter.rb
|
|
167
171
|
- app/commands/decidim/admin/destroy_area.rb
|
|
168
172
|
- app/commands/decidim/admin/destroy_newsletter.rb
|
|
169
|
-
- app/commands/decidim/admin/destroy_participatory_space_private_user.rb
|
|
170
173
|
- app/commands/decidim/admin/destroy_scope.rb
|
|
171
174
|
- app/commands/decidim/admin/destroy_share_token.rb
|
|
172
175
|
- app/commands/decidim/admin/destroy_taxonomy.rb
|
|
@@ -177,13 +180,17 @@ files:
|
|
|
177
180
|
- app/commands/decidim/admin/invite_admin.rb
|
|
178
181
|
- app/commands/decidim/admin/officialize_user.rb
|
|
179
182
|
- app/commands/decidim/admin/participatory_space/create_admin.rb
|
|
183
|
+
- app/commands/decidim/admin/participatory_space/create_member.rb
|
|
180
184
|
- app/commands/decidim/admin/participatory_space/destroy_admin.rb
|
|
185
|
+
- app/commands/decidim/admin/participatory_space/destroy_member.rb
|
|
186
|
+
- app/commands/decidim/admin/participatory_space/import_member_csv.rb
|
|
181
187
|
- app/commands/decidim/admin/participatory_space/publish.rb
|
|
188
|
+
- app/commands/decidim/admin/participatory_space/publish_all_members.rb
|
|
182
189
|
- app/commands/decidim/admin/participatory_space/unpublish.rb
|
|
190
|
+
- app/commands/decidim/admin/participatory_space/unpublish_all_members.rb
|
|
183
191
|
- app/commands/decidim/admin/participatory_space/update_admin.rb
|
|
184
|
-
- app/commands/decidim/admin/
|
|
192
|
+
- app/commands/decidim/admin/participatory_space/update_member.rb
|
|
185
193
|
- app/commands/decidim/admin/promote_managed_user.rb
|
|
186
|
-
- app/commands/decidim/admin/publish_all_participatory_space_private_users.rb
|
|
187
194
|
- app/commands/decidim/admin/publish_component.rb
|
|
188
195
|
- app/commands/decidim/admin/remove_admin.rb
|
|
189
196
|
- app/commands/decidim/admin/reorder_components.rb
|
|
@@ -192,7 +199,6 @@ files:
|
|
|
192
199
|
- app/commands/decidim/admin/unblock_user.rb
|
|
193
200
|
- app/commands/decidim/admin/unhide_resource.rb
|
|
194
201
|
- app/commands/decidim/admin/unofficialize_user.rb
|
|
195
|
-
- app/commands/decidim/admin/unpublish_all_participatory_space_private_users.rb
|
|
196
202
|
- app/commands/decidim/admin/unpublish_component.rb
|
|
197
203
|
- app/commands/decidim/admin/unreport_resource.rb
|
|
198
204
|
- app/commands/decidim/admin/unreport_user.rb
|
|
@@ -207,7 +213,6 @@ files:
|
|
|
207
213
|
- app/commands/decidim/admin/update_newsletter.rb
|
|
208
214
|
- app/commands/decidim/admin/update_organization.rb
|
|
209
215
|
- app/commands/decidim/admin/update_organization_tos_version.rb
|
|
210
|
-
- app/commands/decidim/admin/update_participatory_space_private_user.rb
|
|
211
216
|
- app/commands/decidim/admin/update_resource_permissions.rb
|
|
212
217
|
- app/commands/decidim/admin/update_scope.rb
|
|
213
218
|
- app/commands/decidim/admin/update_scope_type.rb
|
|
@@ -233,7 +238,6 @@ files:
|
|
|
233
238
|
- app/controllers/concerns/decidim/admin/verification_conflicts/filterable.rb
|
|
234
239
|
- app/controllers/concerns/decidim/moderated_users/admin/filterable.rb
|
|
235
240
|
- app/controllers/concerns/decidim/moderations/admin/filterable.rb
|
|
236
|
-
- app/controllers/concerns/decidim/participatory_space_private_users/admin/filterable.rb
|
|
237
241
|
- app/controllers/decidim/admin/admin_terms_controller.rb
|
|
238
242
|
- app/controllers/decidim/admin/application_controller.rb
|
|
239
243
|
- app/controllers/decidim/admin/area_types_controller.rb
|
|
@@ -247,8 +251,6 @@ files:
|
|
|
247
251
|
- app/controllers/decidim/admin/concerns/has_attachments.rb
|
|
248
252
|
- app/controllers/decidim/admin/concerns/has_breadcrumb_items.rb
|
|
249
253
|
- app/controllers/decidim/admin/concerns/has_content_blocks.rb
|
|
250
|
-
- app/controllers/decidim/admin/concerns/has_private_users.rb
|
|
251
|
-
- app/controllers/decidim/admin/concerns/has_private_users_csv_import.rb
|
|
252
254
|
- app/controllers/decidim/admin/concerns/has_tabbed_menu.rb
|
|
253
255
|
- app/controllers/decidim/admin/conflicts_controller.rb
|
|
254
256
|
- app/controllers/decidim/admin/dashboard_controller.rb
|
|
@@ -273,6 +275,9 @@ files:
|
|
|
273
275
|
- app/controllers/decidim/admin/organization_external_domain_allowlist_controller.rb
|
|
274
276
|
- app/controllers/decidim/admin/organization_homepage_content_blocks_controller.rb
|
|
275
277
|
- app/controllers/decidim/admin/organization_homepage_controller.rb
|
|
278
|
+
- app/controllers/decidim/admin/participatory_space/concerns/has_members.rb
|
|
279
|
+
- app/controllers/decidim/admin/participatory_space/concerns/has_members_csv_import.rb
|
|
280
|
+
- app/controllers/decidim/admin/participatory_space/concerns/members_filterable.rb
|
|
276
281
|
- app/controllers/decidim/admin/participatory_space/user_role_controller.rb
|
|
277
282
|
- app/controllers/decidim/admin/reminders_controller.rb
|
|
278
283
|
- app/controllers/decidim/admin/resource_permissions_controller.rb
|
|
@@ -313,9 +318,9 @@ files:
|
|
|
313
318
|
- app/forms/decidim/admin/officialization_form.rb
|
|
314
319
|
- app/forms/decidim/admin/organization_external_domain_allowlist_form.rb
|
|
315
320
|
- app/forms/decidim/admin/organization_form.rb
|
|
321
|
+
- app/forms/decidim/admin/participatory_space/member_csv_import_form.rb
|
|
322
|
+
- app/forms/decidim/admin/participatory_space/member_form.rb
|
|
316
323
|
- app/forms/decidim/admin/participatory_space_admin_user_form.rb
|
|
317
|
-
- app/forms/decidim/admin/participatory_space_private_user_csv_import_form.rb
|
|
318
|
-
- app/forms/decidim/admin/participatory_space_private_user_form.rb
|
|
319
324
|
- app/forms/decidim/admin/permission_form.rb
|
|
320
325
|
- app/forms/decidim/admin/permissions_form.rb
|
|
321
326
|
- app/forms/decidim/admin/scope_form.rb
|
|
@@ -355,11 +360,11 @@ files:
|
|
|
355
360
|
- app/helpers/decidim/admin/user_moderations_helper.rb
|
|
356
361
|
- app/helpers/decidim/admin/user_roles_helper.rb
|
|
357
362
|
- app/jobs/decidim/admin/application_job.rb
|
|
358
|
-
- app/jobs/decidim/admin/destroy_private_users_follows_job.rb
|
|
359
363
|
- app/jobs/decidim/admin/expire_impersonation_job.rb
|
|
360
|
-
- app/jobs/decidim/admin/import_participatory_space_private_user_csv_job.rb
|
|
361
364
|
- app/jobs/decidim/admin/newsletter_delivery_job.rb
|
|
362
365
|
- app/jobs/decidim/admin/newsletter_job.rb
|
|
366
|
+
- app/jobs/decidim/admin/participatory_space/destroy_members_follows_job.rb
|
|
367
|
+
- app/jobs/decidim/admin/participatory_space/import_member_csv_job.rb
|
|
363
368
|
- app/models/decidim/admin/fake_newsletter.rb
|
|
364
369
|
- app/packs/entrypoints/decidim_admin.js
|
|
365
370
|
- app/packs/entrypoints/decidim_admin.scss
|
|
@@ -370,6 +375,8 @@ files:
|
|
|
370
375
|
- app/packs/src/decidim/admin/auto_buttons_by_position.component.js
|
|
371
376
|
- app/packs/src/decidim/admin/auto_label_by_position.component.js
|
|
372
377
|
- app/packs/src/decidim/admin/budget_rule_toggler.component.js
|
|
378
|
+
- app/packs/src/decidim/admin/controllers/access_mode/access_mode.test.js
|
|
379
|
+
- app/packs/src/decidim/admin/controllers/access_mode/controller.js
|
|
373
380
|
- app/packs/src/decidim/admin/controllers/slug/controller.js
|
|
374
381
|
- app/packs/src/decidim/admin/controllers/slug/slug.test.js
|
|
375
382
|
- app/packs/src/decidim/admin/css_preview.js
|
|
@@ -473,8 +480,6 @@ files:
|
|
|
473
480
|
- app/views/decidim/admin/conflicts/index.html.erb
|
|
474
481
|
- app/views/decidim/admin/dashboard/_pending_moderations.html.erb
|
|
475
482
|
- app/views/decidim/admin/dashboard/show.html.erb
|
|
476
|
-
- app/views/decidim/admin/devise/mailers/password_change.html.erb
|
|
477
|
-
- app/views/decidim/admin/devise/mailers/reset_password_instructions.html.erb
|
|
478
483
|
- app/views/decidim/admin/exports/_dropdown.html.erb
|
|
479
484
|
- app/views/decidim/admin/help_sections/_form.html.erb
|
|
480
485
|
- app/views/decidim/admin/help_sections/show.erb
|
|
@@ -491,6 +496,11 @@ files:
|
|
|
491
496
|
- app/views/decidim/admin/managed_users/impersonation_logs/index.html.erb
|
|
492
497
|
- app/views/decidim/admin/managed_users/promotions/_form.html.erb
|
|
493
498
|
- app/views/decidim/admin/managed_users/promotions/new.html.erb
|
|
499
|
+
- app/views/decidim/admin/members/_form.html.erb
|
|
500
|
+
- app/views/decidim/admin/members/edit.html.erb
|
|
501
|
+
- app/views/decidim/admin/members/index.html.erb
|
|
502
|
+
- app/views/decidim/admin/members/new.html.erb
|
|
503
|
+
- app/views/decidim/admin/members_csv_imports/new.html.erb
|
|
494
504
|
- app/views/decidim/admin/moderated_users/_bulk-actions.html.erb
|
|
495
505
|
- app/views/decidim/admin/moderated_users/_report.html.erb
|
|
496
506
|
- app/views/decidim/admin/moderated_users/bulk_actions/_block.html.erb
|
|
@@ -534,11 +544,6 @@ files:
|
|
|
534
544
|
- app/views/decidim/admin/organization_external_domain_allowlist/_external_domain.html.erb
|
|
535
545
|
- app/views/decidim/admin/organization_external_domain_allowlist/_form.html.erb
|
|
536
546
|
- app/views/decidim/admin/organization_external_domain_allowlist/edit.html.erb
|
|
537
|
-
- app/views/decidim/admin/participatory_space_private_users/_form.html.erb
|
|
538
|
-
- app/views/decidim/admin/participatory_space_private_users/edit.html.erb
|
|
539
|
-
- app/views/decidim/admin/participatory_space_private_users/index.html.erb
|
|
540
|
-
- app/views/decidim/admin/participatory_space_private_users/new.html.erb
|
|
541
|
-
- app/views/decidim/admin/participatory_space_private_users_csv_imports/new.html.erb
|
|
542
547
|
- app/views/decidim/admin/reminders/new.html.erb
|
|
543
548
|
- app/views/decidim/admin/resource_permissions/_options_form.html.erb
|
|
544
549
|
- app/views/decidim/admin/resource_permissions/edit.html.erb
|
|
@@ -729,6 +734,7 @@ files:
|
|
|
729
734
|
- lib/decidim/admin/menu.rb
|
|
730
735
|
- lib/decidim/admin/search_form_builder.rb
|
|
731
736
|
- lib/decidim/admin/test.rb
|
|
737
|
+
- lib/decidim/admin/test/admin_members_shared_examples.rb
|
|
732
738
|
- lib/decidim/admin/test/admin_participatory_space_access_examples.rb
|
|
733
739
|
- lib/decidim/admin/test/admin_participatory_space_component_access_examples.rb
|
|
734
740
|
- lib/decidim/admin/test/commands/create_attachment_collection_examples.rb
|
|
@@ -765,7 +771,6 @@ metadata:
|
|
|
765
771
|
funding_uri: https://opencollective.com/decidim
|
|
766
772
|
homepage_uri: https://decidim.org
|
|
767
773
|
source_code_uri: https://github.com/decidim/decidim
|
|
768
|
-
post_install_message:
|
|
769
774
|
rdoc_options: []
|
|
770
775
|
require_paths:
|
|
771
776
|
- lib
|
|
@@ -773,15 +778,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
773
778
|
requirements:
|
|
774
779
|
- - "~>"
|
|
775
780
|
- !ruby/object:Gem::Version
|
|
776
|
-
version: 3.
|
|
781
|
+
version: 3.4.0
|
|
777
782
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
778
783
|
requirements:
|
|
779
784
|
- - ">="
|
|
780
785
|
- !ruby/object:Gem::Version
|
|
781
786
|
version: '0'
|
|
782
787
|
requirements: []
|
|
783
|
-
rubygems_version: 3.
|
|
784
|
-
signing_key:
|
|
788
|
+
rubygems_version: 3.6.9
|
|
785
789
|
specification_version: 4
|
|
786
790
|
summary: Decidim organization administration
|
|
787
791
|
test_files: []
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Decidim
|
|
4
|
-
module Admin
|
|
5
|
-
# A command with all the business logic when creating a new participatory space
|
|
6
|
-
# private user in the system.
|
|
7
|
-
class CreateParticipatorySpacePrivateUser < Decidim::Command
|
|
8
|
-
delegate :current_user, to: :form
|
|
9
|
-
# Public: Initializes the command.
|
|
10
|
-
#
|
|
11
|
-
# form - A form object with the params.
|
|
12
|
-
# private_user_to - The private_user_to that will hold the
|
|
13
|
-
# user role
|
|
14
|
-
def initialize(form, private_user_to, via_csv: false)
|
|
15
|
-
@form = form
|
|
16
|
-
@private_user_to = private_user_to
|
|
17
|
-
@via_csv = via_csv
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
# Executes the command. Broadcasts these events:
|
|
21
|
-
#
|
|
22
|
-
# - :ok when everything is valid.
|
|
23
|
-
# - :invalid if the form was not valid and we could not proceed.
|
|
24
|
-
#
|
|
25
|
-
# Returns nothing.
|
|
26
|
-
def call
|
|
27
|
-
return broadcast(:invalid) if form.invalid?
|
|
28
|
-
|
|
29
|
-
ActiveRecord::Base.transaction do
|
|
30
|
-
@user ||= existing_user || new_user
|
|
31
|
-
create_private_user
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
broadcast(:ok)
|
|
35
|
-
rescue ActiveRecord::RecordInvalid
|
|
36
|
-
form.errors.add(:email, :taken)
|
|
37
|
-
broadcast(:invalid)
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
private
|
|
41
|
-
|
|
42
|
-
attr_reader :form, :private_user_to, :user
|
|
43
|
-
|
|
44
|
-
def create_private_user
|
|
45
|
-
action = @via_csv ? "create_via_csv" : "create"
|
|
46
|
-
Decidim.traceability.perform_action!(
|
|
47
|
-
action,
|
|
48
|
-
Decidim::ParticipatorySpacePrivateUser,
|
|
49
|
-
current_user,
|
|
50
|
-
resource: {
|
|
51
|
-
title: user.name
|
|
52
|
-
}
|
|
53
|
-
) do
|
|
54
|
-
Decidim::ParticipatorySpacePrivateUser.find_or_create_by!(
|
|
55
|
-
user:,
|
|
56
|
-
privatable_to: @private_user_to,
|
|
57
|
-
role: form.role,
|
|
58
|
-
published: form.published
|
|
59
|
-
)
|
|
60
|
-
end
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
def existing_user
|
|
64
|
-
return @existing_user if defined?(@existing_user)
|
|
65
|
-
|
|
66
|
-
@existing_user = User.find_by(
|
|
67
|
-
email: form.email.downcase,
|
|
68
|
-
organization: private_user_to.organization
|
|
69
|
-
)
|
|
70
|
-
|
|
71
|
-
InviteUserAgain.call(@existing_user, invitation_instructions) if @existing_user&.invitation_pending?
|
|
72
|
-
|
|
73
|
-
@existing_user
|
|
74
|
-
end
|
|
75
|
-
|
|
76
|
-
def new_user
|
|
77
|
-
@new_user ||= InviteUser.call(user_form) do
|
|
78
|
-
on(:ok) do |user|
|
|
79
|
-
return user
|
|
80
|
-
end
|
|
81
|
-
end
|
|
82
|
-
end
|
|
83
|
-
|
|
84
|
-
def user_form
|
|
85
|
-
OpenStruct.new(name: form.name,
|
|
86
|
-
email: form.email.downcase,
|
|
87
|
-
organization: private_user_to.organization,
|
|
88
|
-
admin: false,
|
|
89
|
-
invited_by: current_user,
|
|
90
|
-
invitation_instructions:)
|
|
91
|
-
end
|
|
92
|
-
|
|
93
|
-
def invitation_instructions
|
|
94
|
-
"invite_private_user"
|
|
95
|
-
end
|
|
96
|
-
end
|
|
97
|
-
end
|
|
98
|
-
end
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Decidim
|
|
4
|
-
module Admin
|
|
5
|
-
# A command with all the business logic to destroy a participatory space private user.
|
|
6
|
-
class DestroyParticipatorySpacePrivateUser < Decidim::Commands::DestroyResource
|
|
7
|
-
private
|
|
8
|
-
|
|
9
|
-
def extra_params
|
|
10
|
-
{
|
|
11
|
-
resource: {
|
|
12
|
-
title: resource.user.name
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def run_after_hooks
|
|
18
|
-
return unless resource.privatable_to.respond_to?(:private_space?)
|
|
19
|
-
return unless resource.privatable_to.private_space?
|
|
20
|
-
return if resource.privatable_to.respond_to?(:is_transparent) && resource.privatable_to.is_transparent?
|
|
21
|
-
|
|
22
|
-
# When private user is destroyed, a hook to destroy the follows of user on private non-transparent assembly
|
|
23
|
-
# or private participatory process and the follows of their children
|
|
24
|
-
DestroyPrivateUsersFollowsJob.perform_later(resource.decidim_user_id, resource.privatable_to)
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
end
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "csv"
|
|
4
|
-
|
|
5
|
-
module Decidim
|
|
6
|
-
module Admin
|
|
7
|
-
class ProcessParticipatorySpacePrivateUserImportCsv < Decidim::Command
|
|
8
|
-
include Decidim::Admin::CustomImport
|
|
9
|
-
|
|
10
|
-
delegate :current_user, to: :form
|
|
11
|
-
# Public: Initializes the command.
|
|
12
|
-
#
|
|
13
|
-
# form - the form object containing the uploaded file
|
|
14
|
-
# private_users_to - The private_users_to that will hold the user role
|
|
15
|
-
def initialize(form, private_users_to)
|
|
16
|
-
@form = form
|
|
17
|
-
@private_users_to = private_users_to
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
# Executes the command. Broadcasts these events:
|
|
21
|
-
#
|
|
22
|
-
# - :ok when everything is valid.
|
|
23
|
-
# - :invalid if the form was not valid and we could not proceed.
|
|
24
|
-
#
|
|
25
|
-
# Returns nothing.
|
|
26
|
-
def call
|
|
27
|
-
return broadcast(:invalid) unless @form.valid?
|
|
28
|
-
|
|
29
|
-
process_csv
|
|
30
|
-
broadcast(:ok)
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
private
|
|
34
|
-
|
|
35
|
-
attr_reader :form
|
|
36
|
-
|
|
37
|
-
def process_csv
|
|
38
|
-
process_import_file(@form.file) do |(email, user_name)|
|
|
39
|
-
ImportParticipatorySpacePrivateUserCsvJob.perform_later(email, user_name, @private_users_to, current_user) if email.present? && user_name.present?
|
|
40
|
-
end
|
|
41
|
-
end
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
end
|