decidim-admin 0.26.5 → 0.27.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of decidim-admin might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/cells/decidim/admin/attachments_privacy_warning/show.erb +3 -0
- data/app/cells/decidim/admin/attachments_privacy_warning_cell.rb +19 -0
- data/app/commands/decidim/admin/block_user.rb +1 -1
- data/app/commands/decidim/admin/close_session_managed_user.rb +1 -1
- data/app/commands/decidim/admin/create_area.rb +1 -1
- data/app/commands/decidim/admin/create_area_type.rb +6 -3
- data/app/commands/decidim/admin/create_attachment.rb +14 -6
- data/app/commands/decidim/admin/create_attachment_collection.rb +13 -4
- data/app/commands/decidim/admin/create_category.rb +6 -4
- data/app/commands/decidim/admin/create_component.rb +1 -1
- data/app/commands/decidim/admin/create_import.rb +4 -5
- data/app/commands/decidim/admin/create_import_example.rb +1 -1
- data/app/commands/decidim/admin/create_newsletter.rb +1 -1
- data/app/commands/decidim/admin/create_participatory_space_private_user.rb +1 -1
- data/app/commands/decidim/admin/create_scope.rb +1 -1
- data/app/commands/decidim/admin/create_scope_type.rb +6 -3
- data/app/commands/decidim/admin/create_static_page.rb +1 -1
- data/app/commands/decidim/admin/create_static_page_topic.rb +1 -1
- data/app/commands/decidim/admin/deliver_newsletter.rb +6 -6
- data/app/commands/decidim/admin/destroy_area.rb +1 -1
- data/app/commands/decidim/admin/destroy_category.rb +6 -3
- data/app/commands/decidim/admin/destroy_component.rb +1 -1
- data/app/commands/decidim/admin/destroy_newsletter.rb +1 -1
- data/app/commands/decidim/admin/destroy_participatory_space_private_user.rb +1 -1
- data/app/commands/decidim/admin/destroy_scope.rb +1 -1
- data/app/commands/decidim/admin/destroy_share_token.rb +1 -1
- data/app/commands/decidim/admin/destroy_static_page.rb +1 -1
- data/app/commands/decidim/admin/destroy_static_page_topic.rb +1 -1
- data/app/commands/decidim/admin/hide_resource.rb +2 -2
- data/app/commands/decidim/admin/impersonate_user.rb +1 -1
- data/app/commands/decidim/admin/invite_admin.rb +1 -1
- data/app/commands/decidim/admin/officialize_user.rb +1 -1
- data/app/commands/decidim/admin/process_participatory_space_private_user_import_csv.rb +7 -3
- data/app/commands/decidim/admin/process_user_group_verification_csv.rb +8 -4
- data/app/commands/decidim/admin/promote_managed_user.rb +1 -1
- data/app/commands/decidim/admin/publish_component.rb +1 -1
- data/app/commands/decidim/admin/reject_user_group.rb +1 -1
- data/app/commands/decidim/admin/remove_admin.rb +1 -1
- data/app/commands/decidim/admin/reorder_content_blocks.rb +1 -1
- data/app/commands/decidim/admin/transfer_user.rb +1 -1
- data/app/commands/decidim/admin/unblock_user.rb +2 -2
- data/app/commands/decidim/admin/unhide_resource.rb +1 -1
- data/app/commands/decidim/admin/unofficialize_user.rb +1 -1
- data/app/commands/decidim/admin/unpublish_component.rb +1 -1
- data/app/commands/decidim/admin/unreport_resource.rb +1 -1
- data/app/commands/decidim/admin/unreport_user.rb +1 -1
- data/app/commands/decidim/admin/update_area.rb +1 -1
- data/app/commands/decidim/admin/update_area_type.rb +8 -3
- data/app/commands/decidim/admin/update_attachment.rb +4 -3
- data/app/commands/decidim/admin/update_attachment_collection.rb +8 -3
- data/app/commands/decidim/admin/update_category.rb +9 -5
- data/app/commands/decidim/admin/update_component.rb +8 -5
- data/app/commands/decidim/admin/update_component_permissions.rb +9 -6
- data/app/commands/decidim/admin/update_content_block.rb +1 -1
- data/app/commands/decidim/admin/update_external_domain_whitelist.rb +6 -3
- data/app/commands/decidim/admin/update_help_sections.rb +17 -3
- data/app/commands/decidim/admin/update_newsletter.rb +1 -1
- data/app/commands/decidim/admin/update_organization.rb +1 -1
- data/app/commands/decidim/admin/update_organization_appearance.rb +1 -1
- data/app/commands/decidim/admin/update_organization_tos_version.rb +1 -1
- data/app/commands/decidim/admin/update_resource_permissions.rb +2 -2
- data/app/commands/decidim/admin/update_scope.rb +1 -1
- data/app/commands/decidim/admin/update_scope_type.rb +8 -3
- data/app/commands/decidim/admin/update_static_page.rb +1 -1
- data/app/commands/decidim/admin/update_static_page_topic.rb +1 -1
- data/app/commands/decidim/admin/update_user_groups.rb +1 -1
- data/app/commands/decidim/admin/verify_user_group.rb +1 -1
- data/app/controllers/concerns/decidim/admin/filterable.rb +1 -1
- data/app/controllers/concerns/decidim/admin/participatory_space_export.rb +3 -1
- data/app/controllers/decidim/admin/application_controller.rb +1 -0
- data/app/controllers/decidim/admin/area_types_controller.rb +6 -3
- data/app/controllers/decidim/admin/block_user_controller.rb +3 -3
- data/app/controllers/decidim/admin/categories_controller.rb +3 -3
- data/app/controllers/decidim/admin/component_permissions_controller.rb +1 -1
- data/app/controllers/decidim/admin/components/base_controller.rb +1 -0
- data/app/controllers/decidim/admin/components_controller.rb +1 -1
- data/app/controllers/decidim/admin/concerns/has_attachment_collections.rb +6 -3
- data/app/controllers/decidim/admin/concerns/has_attachments.rb +6 -3
- data/app/controllers/decidim/admin/concerns/has_private_users_csv_import.rb +7 -0
- data/app/controllers/decidim/admin/dashboard_controller.rb +4 -3
- data/app/controllers/decidim/admin/exports_controller.rb +4 -1
- data/app/controllers/decidim/admin/help_sections_controller.rb +1 -1
- data/app/controllers/decidim/admin/metrics_controller.rb +2 -1
- data/app/controllers/decidim/admin/moderations_controller.rb +9 -7
- data/app/controllers/decidim/admin/newsletter_templates_controller.rb +1 -1
- data/app/controllers/decidim/admin/newsletters_controller.rb +1 -1
- data/app/controllers/decidim/admin/organization_controller.rb +3 -4
- data/app/controllers/decidim/admin/organization_external_domain_whitelist_controller.rb +1 -1
- data/app/controllers/decidim/admin/reminders_controller.rb +61 -0
- data/app/controllers/decidim/admin/resource_permissions_controller.rb +3 -3
- data/app/controllers/decidim/admin/scope_types_controller.rb +6 -3
- data/app/controllers/decidim/admin/static_pages_controller.rb +1 -7
- data/app/forms/decidim/admin/block_user_form.rb +2 -2
- data/app/forms/decidim/admin/category_form.rb +1 -2
- data/app/forms/decidim/admin/component_form.rb +16 -7
- data/app/forms/decidim/admin/import_example_form.rb +1 -5
- data/app/forms/decidim/admin/import_form.rb +7 -10
- data/app/forms/decidim/admin/managed_user_promotion_form.rb +1 -1
- data/app/forms/decidim/admin/participatory_space_private_user_csv_import_form.rb +7 -4
- data/app/forms/decidim/admin/permission_form.rb +9 -8
- data/app/forms/decidim/admin/permissions_form.rb +1 -10
- data/app/forms/decidim/admin/user_group_csv_verification_form.rb +2 -2
- data/app/helpers/decidim/admin/bulk_actions_helper.rb +6 -5
- data/app/helpers/decidim/admin/moderations/reports_helper.rb +11 -2
- data/app/helpers/decidim/admin/reminders_helper.rb +12 -0
- data/app/helpers/decidim/admin/settings_helper.rb +11 -57
- data/app/models/decidim/admin/fake_newsletter.rb +0 -20
- data/app/packs/entrypoints/decidim_admin.js +3 -6
- data/app/packs/src/decidim/admin/admin_autocomplete.js +82 -0
- data/app/packs/src/decidim/admin/application.js +0 -16
- data/app/packs/src/decidim/admin/choose_language.js +9 -11
- data/app/packs/src/decidim/admin/dynamic_fields.component.js +0 -1
- data/app/packs/stylesheets/decidim/admin/_decidim.scss +0 -1
- data/app/packs/stylesheets/decidim/admin/modules/_autocomplete.scss +5 -0
- data/app/packs/stylesheets/decidim/admin/modules/_forms.scss +0 -6
- data/app/packs/stylesheets/decidim/admin/modules/_import_result.scss +10 -0
- data/app/packs/stylesheets/decidim/admin/modules/_modules.scss +3 -0
- data/app/packs/stylesheets/decidim/admin/modules/_upload_modal.scss +42 -0
- data/app/permissions/decidim/admin/permissions.rb +3 -32
- data/app/presenters/decidim/admin/dashboard_metric_charts_presenter.rb +3 -1
- data/app/queries/decidim/admin/active_users_counter.rb +1 -1
- data/app/queries/decidim/admin/newsletter_recipients.rb +2 -2
- data/app/queries/decidim/admin/user_filter.rb +1 -1
- data/app/queries/decidim/admin/user_groups_evaluation.rb +1 -1
- data/app/views/decidim/admin/attachments/index.html.erb +1 -0
- data/app/views/decidim/admin/categories/_form.html.erb +0 -4
- data/app/views/decidim/admin/categories/show.html.erb +1 -2
- data/app/views/decidim/admin/dashboard/show.html.erb +1 -1
- data/app/views/decidim/admin/imports/new.html.erb +1 -1
- data/app/views/decidim/admin/moderated_users/index.html.erb +1 -1
- data/app/views/decidim/admin/moderations/index.html.erb +4 -8
- data/app/views/decidim/admin/moderations/reports/index.html.erb +1 -5
- data/app/views/decidim/admin/organization_appearance/form/_images.html.erb +5 -4
- data/app/views/decidim/admin/participatory_space_private_users/index.html.erb +1 -1
- data/app/views/decidim/admin/participatory_space_private_users_csv_imports/new.html.erb +20 -1
- data/app/views/decidim/admin/reminders/new.html.erb +21 -0
- data/app/views/decidim/admin/resource_permissions/edit.html.erb +1 -1
- data/app/views/decidim/admin/shared/_gallery.html.erb +6 -1
- data/app/views/decidim/admin/shared/_js-callout.html.erb +6 -0
- data/app/views/decidim/admin/users_statistics/_users_count.html.erb +2 -2
- data/app/views/layouts/decidim/admin/_application.html.erb +2 -0
- data/config/locales/am-ET.yml +1 -0
- data/config/locales/ar.yml +28 -21
- data/config/locales/bg.yml +1 -0
- data/config/locales/ca.yml +27 -21
- data/config/locales/cs.yml +41 -33
- data/config/locales/da.yml +1 -0
- data/config/locales/de.yml +23 -18
- data/config/locales/el.yml +2 -5
- data/config/locales/en.yml +22 -17
- data/config/locales/eo.yml +1 -0
- data/config/locales/es-MX.yml +25 -19
- data/config/locales/es-PY.yml +25 -19
- data/config/locales/es.yml +27 -21
- data/config/locales/et.yml +1 -0
- data/config/locales/eu.yml +12 -35
- data/config/locales/fi-plain.yml +26 -20
- data/config/locales/fi.yml +28 -22
- data/config/locales/fr-CA.yml +25 -19
- data/config/locales/fr.yml +39 -33
- data/config/locales/ga-IE.yml +1 -0
- data/config/locales/gl.yml +17 -4
- data/config/locales/hr.yml +1 -0
- data/config/locales/hu.yml +16 -188
- data/config/locales/id-ID.yml +2 -7
- data/config/locales/is-IS.yml +3 -8
- data/config/locales/it.yml +8 -6
- data/config/locales/ja.yml +23 -18
- data/config/locales/ko.yml +1 -0
- data/config/locales/lb.yml +2 -5
- data/config/locales/lt.yml +13 -141
- data/config/locales/lv.yml +2 -4
- data/config/locales/mt.yml +1 -0
- data/config/locales/nl.yml +4 -67
- data/config/locales/no.yml +13 -10
- data/config/locales/om-ET.yml +1 -0
- data/config/locales/pl.yml +21 -6
- data/config/locales/pt-BR.yml +4 -7
- data/config/locales/pt.yml +2 -5
- data/config/locales/ro-RO.yml +12 -27
- data/config/locales/ru.yml +2 -7
- data/config/locales/si-LK.yml +1 -0
- data/config/locales/sk.yml +2 -4
- data/config/locales/sl.yml +1 -0
- data/config/locales/so-SO.yml +1 -0
- data/config/locales/sr-CS.yml +1 -10
- data/config/locales/sv.yml +24 -18
- data/config/locales/sw-KE.yml +1 -0
- data/config/locales/ti-ER.yml +1 -0
- data/config/locales/tr-TR.yml +2 -5
- data/config/locales/uk.yml +2 -6
- data/config/locales/val-ES.yml +1 -0
- data/config/locales/vi.yml +1 -0
- data/config/locales/zh-CN.yml +2 -4
- data/config/locales/zh-TW.yml +1 -0
- data/lib/decidim/admin/engine.rb +1 -12
- data/lib/decidim/admin/import/importer.rb +9 -7
- data/lib/decidim/admin/import/readers/json.rb +1 -1
- data/lib/decidim/admin/test/commands/create_attachment_collection_examples.rb +15 -2
- data/lib/decidim/admin/test/commands/create_category_examples.rb +16 -6
- data/lib/decidim/admin/test/commands/destroy_category_examples.rb +29 -1
- data/lib/decidim/admin/test/commands/update_attachment_collection_examples.rb +15 -2
- data/lib/decidim/admin/test/commands/update_category_examples.rb +16 -6
- data/lib/decidim/admin/test/filters_participatory_space_user_roles_examples.rb +4 -4
- data/lib/decidim/admin/test/filters_participatory_space_users_examples.rb +4 -4
- data/lib/decidim/admin/test/forms/category_form_examples.rb +1 -21
- data/lib/decidim/admin/test/manage_attachments_examples.rb +9 -2
- data/lib/decidim/admin/test/manage_categories_examples.rb +0 -10
- data/lib/decidim/admin/test/manage_component_permissions_examples.rb +0 -2
- data/lib/decidim/admin/test/manage_moderations_examples.rb +27 -79
- data/lib/decidim/admin/version.rb +1 -1
- metadata +22 -19
- data/app/packs/src/decidim/admin/autocomplete.component.js +0 -146
- data/app/packs/src/decidim/admin/autocomplete.component.test.js +0 -19
- data/app/packs/stylesheets/decidim/admin/components/_autocomplete_select.component.scss +0 -19
- data/config/locales/gn-PY.yml +0 -1
- data/config/locales/ka-GE.yml +0 -1
- data/config/locales/lo-LA.yml +0 -1
- data/config/locales/oc-FR.yml +0 -1
@@ -7,16 +7,14 @@ module Decidim
|
|
7
7
|
shared_examples_for "UpdateCategory command" do
|
8
8
|
describe "call" do
|
9
9
|
let(:organization) { create(:organization) }
|
10
|
+
let(:user) { create(:user, organization: organization) }
|
10
11
|
let(:category) { create(:category, participatory_space: participatory_space) }
|
11
12
|
let(:form_params) do
|
12
13
|
{
|
13
14
|
"category" => {
|
14
15
|
"name_en" => "New title",
|
15
16
|
"name_es" => "Title",
|
16
|
-
"name_ca" => "Title"
|
17
|
-
"description_en" => "Description",
|
18
|
-
"description_es" => "Description",
|
19
|
-
"description_ca" => "Description"
|
17
|
+
"name_ca" => "Title"
|
20
18
|
}
|
21
19
|
}
|
22
20
|
end
|
@@ -28,11 +26,11 @@ module Decidim
|
|
28
26
|
current_organization: organization
|
29
27
|
)
|
30
28
|
end
|
31
|
-
let(:command) { described_class.new(category, form) }
|
29
|
+
let(:command) { described_class.new(category, form, user) }
|
32
30
|
|
33
31
|
describe "when the form is not valid" do
|
34
32
|
before do
|
35
|
-
|
33
|
+
allow(form).to receive(:invalid?).and_return(true)
|
36
34
|
end
|
37
35
|
|
38
36
|
it "broadcasts invalid" do
|
@@ -58,6 +56,18 @@ module Decidim
|
|
58
56
|
|
59
57
|
expect(translated(category.name)).to eq("New title")
|
60
58
|
end
|
59
|
+
|
60
|
+
it "traces the action", versioning: true do
|
61
|
+
expect(Decidim.traceability)
|
62
|
+
.to receive(:perform_action!)
|
63
|
+
.with(:update, Decidim::Category, user, {})
|
64
|
+
.and_call_original
|
65
|
+
|
66
|
+
expect { command.call }.to change(Decidim::ActionLog, :count)
|
67
|
+
action_log = Decidim::ActionLog.last
|
68
|
+
expect(action_log.action).to eq("update")
|
69
|
+
expect(action_log.version).to be_present
|
70
|
+
end
|
61
71
|
end
|
62
72
|
end
|
63
73
|
end
|
@@ -99,7 +99,7 @@ shared_examples "filterable participatory space user roles" do
|
|
99
99
|
apply_filter("Invite accepted", "Yes")
|
100
100
|
|
101
101
|
within ".stack tbody" do
|
102
|
-
expect(page).to have_content(
|
102
|
+
expect(page).to have_content(invited_user2.name)
|
103
103
|
expect(page).to have_css("tr", count: 1)
|
104
104
|
end
|
105
105
|
end
|
@@ -110,7 +110,7 @@ shared_examples "filterable participatory space user roles" do
|
|
110
110
|
apply_filter("Invite accepted", "No")
|
111
111
|
|
112
112
|
within ".stack tbody" do
|
113
|
-
expect(page).to have_content(
|
113
|
+
expect(page).to have_content(invited_user1.name)
|
114
114
|
expect(page).to have_css("tr", count: 1)
|
115
115
|
end
|
116
116
|
end
|
@@ -123,7 +123,7 @@ shared_examples "filterable participatory space user roles" do
|
|
123
123
|
apply_filter("Ever logged in", "Yes")
|
124
124
|
|
125
125
|
within ".stack tbody" do
|
126
|
-
expect(page).to have_content(
|
126
|
+
expect(page).to have_content(invited_user2.name)
|
127
127
|
expect(page).to have_css("tr", count: 1)
|
128
128
|
end
|
129
129
|
end
|
@@ -134,7 +134,7 @@ shared_examples "filterable participatory space user roles" do
|
|
134
134
|
apply_filter("Ever logged in", "No")
|
135
135
|
|
136
136
|
within ".stack tbody" do
|
137
|
-
expect(page).to have_content(
|
137
|
+
expect(page).to have_content(invited_user1.name)
|
138
138
|
expect(page).to have_css("tr", count: 1)
|
139
139
|
end
|
140
140
|
end
|
@@ -7,7 +7,7 @@ shared_examples "filterable participatory space users" do
|
|
7
7
|
apply_filter("Invitation sent", "Not sent")
|
8
8
|
|
9
9
|
within ".stack tbody" do
|
10
|
-
expect(page).to have_content(
|
10
|
+
expect(page).to have_content(invited_user2.name)
|
11
11
|
expect(page).to have_css("tr", count: 1)
|
12
12
|
end
|
13
13
|
end
|
@@ -18,7 +18,7 @@ shared_examples "filterable participatory space users" do
|
|
18
18
|
apply_filter("Invitation sent", "Sent")
|
19
19
|
|
20
20
|
within ".stack tbody" do
|
21
|
-
expect(page).to have_content(
|
21
|
+
expect(page).to have_content(invited_user1.name)
|
22
22
|
expect(page).to have_css("tr", count: 1)
|
23
23
|
end
|
24
24
|
end
|
@@ -31,7 +31,7 @@ shared_examples "filterable participatory space users" do
|
|
31
31
|
apply_filter("Invitation accepted", "Not accepted")
|
32
32
|
|
33
33
|
within ".stack tbody" do
|
34
|
-
expect(page).to have_content(
|
34
|
+
expect(page).to have_content(invited_user2.name)
|
35
35
|
expect(page).to have_css("tr", count: 1)
|
36
36
|
end
|
37
37
|
end
|
@@ -42,7 +42,7 @@ shared_examples "filterable participatory space users" do
|
|
42
42
|
apply_filter("Invitation accepted", "Accepted")
|
43
43
|
|
44
44
|
within ".stack tbody" do
|
45
|
-
expect(page).to have_content(
|
45
|
+
expect(page).to have_content(invited_user1.name)
|
46
46
|
expect(page).to have_css("tr", count: 1)
|
47
47
|
end
|
48
48
|
end
|
@@ -21,13 +21,6 @@ module Decidim
|
|
21
21
|
ca: "Nom"
|
22
22
|
}
|
23
23
|
end
|
24
|
-
let(:description) do
|
25
|
-
{
|
26
|
-
en: "Description",
|
27
|
-
es: "Descripción",
|
28
|
-
ca: "Descripció"
|
29
|
-
}
|
30
|
-
end
|
31
24
|
let(:parent_id) { nil }
|
32
25
|
let(:attributes) do
|
33
26
|
{
|
@@ -35,10 +28,7 @@ module Decidim
|
|
35
28
|
"name_en" => name[:en],
|
36
29
|
"name_es" => name[:es],
|
37
30
|
"name_ca" => name[:ca],
|
38
|
-
"parent_id" => parent_id
|
39
|
-
"description_en" => description[:en],
|
40
|
-
"description_es" => description[:es],
|
41
|
-
"description_ca" => description[:ca]
|
31
|
+
"parent_id" => parent_id
|
42
32
|
}
|
43
33
|
}
|
44
34
|
end
|
@@ -59,16 +49,6 @@ module Decidim
|
|
59
49
|
it { is_expected.to be_invalid }
|
60
50
|
end
|
61
51
|
|
62
|
-
context "when some language in description is missing" do
|
63
|
-
let(:description) do
|
64
|
-
{
|
65
|
-
ca: "Descripció"
|
66
|
-
}
|
67
|
-
end
|
68
|
-
|
69
|
-
it { is_expected.to be_invalid }
|
70
|
-
end
|
71
|
-
|
72
52
|
context "when the parent_id is set" do
|
73
53
|
let!(:category) { create :category, participatory_space: participatory_space }
|
74
54
|
|
@@ -48,8 +48,11 @@ shared_examples "manage attachments examples" do
|
|
48
48
|
es: "Este documento contiene información importante",
|
49
49
|
ca: "Aquest document conté informació important"
|
50
50
|
)
|
51
|
+
end
|
52
|
+
|
53
|
+
dynamically_attach_file(:attachment_file, Decidim::Dev.asset("Exampledocument.pdf"))
|
51
54
|
|
52
|
-
|
55
|
+
within ".new_attachment" do
|
53
56
|
find("*[type=submit]").click
|
54
57
|
end
|
55
58
|
|
@@ -81,7 +84,11 @@ shared_examples "manage attachments examples" do
|
|
81
84
|
)
|
82
85
|
|
83
86
|
select translated(attachment_collection.name, locale: :en), from: "attachment_attachment_collection_id"
|
84
|
-
|
87
|
+
end
|
88
|
+
|
89
|
+
dynamically_attach_file(:attachment_file, Decidim::Dev.asset("Exampledocument.pdf"))
|
90
|
+
|
91
|
+
within ".new_attachment" do
|
85
92
|
find("*[type=submit]").click
|
86
93
|
end
|
87
94
|
|
@@ -14,9 +14,6 @@ shared_examples "manage categories examples" do
|
|
14
14
|
|
15
15
|
expect(page).to have_selector("input#category_name_en[value='#{translated(category.name, locale: :en)}']")
|
16
16
|
expect(page).to have_selector("input#category_weight[value='#{category.weight}']")
|
17
|
-
within ".editor .editor-container" do
|
18
|
-
expect(page).to have_content(strip_tags(translated(category.description, locale: :en)))
|
19
|
-
end
|
20
17
|
|
21
18
|
expect(page).to have_selector("select#category_parent_id")
|
22
19
|
end
|
@@ -32,13 +29,6 @@ shared_examples "manage categories examples" do
|
|
32
29
|
es: "Mi categoría",
|
33
30
|
ca: "La meva categoria"
|
34
31
|
)
|
35
|
-
fill_in_i18n_editor(
|
36
|
-
:category_description,
|
37
|
-
"#category-description-tabs",
|
38
|
-
en: "Description",
|
39
|
-
es: "Descripción",
|
40
|
-
ca: "Descripció"
|
41
|
-
)
|
42
32
|
|
43
33
|
find("*[type=submit]").click
|
44
34
|
end
|
@@ -52,9 +52,7 @@ shared_examples "Managing component permissions" do
|
|
52
52
|
|
53
53
|
context "when failing to set permissions" do
|
54
54
|
before do
|
55
|
-
# rubocop:disable RSpec/AnyInstance
|
56
55
|
allow_any_instance_of(Decidim::Admin::PermissionsForm).to receive(:valid?).and_return(false)
|
57
|
-
# rubocop:enable RSpec/AnyInstance
|
58
56
|
within ".component-#{component.id}" do
|
59
57
|
click_link "Permissions"
|
60
58
|
end
|
@@ -1,5 +1,31 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
shared_examples "sorted moderations" do
|
4
|
+
let!(:moderations) do
|
5
|
+
reportables.first(reportables.length - 1).map do |reportable|
|
6
|
+
moderation = create(:moderation, reportable: reportable, report_count: 1, reported_content: reportable.reported_searchable_content_text)
|
7
|
+
create(:report, moderation: moderation)
|
8
|
+
moderation
|
9
|
+
end
|
10
|
+
end
|
11
|
+
let!(:moderation) { moderations.first }
|
12
|
+
let(:moderations_link_text) { "Moderations" }
|
13
|
+
|
14
|
+
before do
|
15
|
+
visit participatory_space_path
|
16
|
+
click_link moderations_link_text
|
17
|
+
end
|
18
|
+
|
19
|
+
it "sorts the most recent first" do
|
20
|
+
within ".pagination" do
|
21
|
+
click_link "Last"
|
22
|
+
end
|
23
|
+
all("tbody tr").each_with_index do |row, _index|
|
24
|
+
expect(row.find("td:first-child")).to have_content(reportables.first.id)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
3
29
|
shared_examples "manage moderations" do
|
4
30
|
let!(:moderations) do
|
5
31
|
reportables.first(reportables.length - 1).map do |reportable|
|
@@ -110,53 +136,14 @@ shared_examples "manage moderations" do
|
|
110
136
|
expect(page).to have_no_selector("tr[data-id=\"#{moderation.id}\"]")
|
111
137
|
end
|
112
138
|
end
|
113
|
-
|
114
|
-
context "when the user changes language" do
|
115
|
-
around do |example|
|
116
|
-
previous_backend = I18n.backend
|
117
|
-
I18n.backend = I18n::Backend::Simple.new
|
118
|
-
example.run
|
119
|
-
I18n.backend = previous_backend
|
120
|
-
end
|
121
|
-
|
122
|
-
before do
|
123
|
-
I18n.backend.store_translations(
|
124
|
-
:ca,
|
125
|
-
activerecord: {
|
126
|
-
models: {
|
127
|
-
moderation.reportable.class.name.underscore.to_sym => {
|
128
|
-
one: "Objecte informable",
|
129
|
-
other: "Objectes informables"
|
130
|
-
}
|
131
|
-
}
|
132
|
-
}
|
133
|
-
)
|
134
|
-
|
135
|
-
within_language_menu do
|
136
|
-
click_link "Català"
|
137
|
-
end
|
138
|
-
end
|
139
|
-
|
140
|
-
it "renders the reportable types in the selected language" do
|
141
|
-
within "tr[data-id=\"#{moderation.id}\"]" do
|
142
|
-
expect(page).to have_content("Objecte informable")
|
143
|
-
end
|
144
|
-
end
|
145
|
-
end
|
146
139
|
end
|
147
140
|
|
148
141
|
context "when listing hidden resources" do
|
149
|
-
|
142
|
+
it "user can review them" do
|
150
143
|
within ".card-title" do
|
151
144
|
click_link "Hidden"
|
152
145
|
end
|
153
|
-
end
|
154
146
|
|
155
|
-
it "user can't unreport them" do
|
156
|
-
expect(page).not_to have_css(".action-icon--unreport")
|
157
|
-
end
|
158
|
-
|
159
|
-
it "user can review them" do
|
160
147
|
hidden_moderations.each do |moderation|
|
161
148
|
within "tr[data-id=\"#{moderation.id}\"]" do
|
162
149
|
expect(page).to have_css("a[href='#{moderation.reportable.reported_content_url}']")
|
@@ -164,43 +151,4 @@ shared_examples "manage moderations" do
|
|
164
151
|
end
|
165
152
|
end
|
166
153
|
end
|
167
|
-
|
168
|
-
context "when listing comments for deleted resources" do
|
169
|
-
let(:comments) do
|
170
|
-
reportables.first(reportables.length - 1).map do |resource|
|
171
|
-
create(:comment, commentable: resource)
|
172
|
-
end
|
173
|
-
end
|
174
|
-
let!(:moderations) do
|
175
|
-
comments.map do |reportable|
|
176
|
-
space = reportable.is_a?(Decidim::Participable) ? reportable : reportable.participatory_space
|
177
|
-
moderation = create(:moderation, reportable: reportable, report_count: 1, participatory_space: space, reported_content: reportable.reported_searchable_content_text)
|
178
|
-
create(:report, moderation: moderation)
|
179
|
-
|
180
|
-
reportable.root_commentable.destroy!
|
181
|
-
reportable.reload
|
182
|
-
|
183
|
-
moderation
|
184
|
-
end
|
185
|
-
end
|
186
|
-
|
187
|
-
it "user can review them" do
|
188
|
-
moderations.each do |moderation|
|
189
|
-
within "tr[data-id=\"#{moderation.id}\"]" do
|
190
|
-
expect(page).to have_content "Deleted resource"
|
191
|
-
expect(page).to have_content "Spam"
|
192
|
-
end
|
193
|
-
end
|
194
|
-
end
|
195
|
-
|
196
|
-
it "user can hide them" do
|
197
|
-
moderation_id = moderations.first.id
|
198
|
-
within "tr[data-id=\"#{moderation_id}\"]" do
|
199
|
-
click_link "Hide"
|
200
|
-
end
|
201
|
-
|
202
|
-
expect(page).to have_admin_callout("Resource successfully hidden")
|
203
|
-
expect(page).not_to have_selector("tr[data-id=\"#{moderation_id}\"]")
|
204
|
-
end
|
205
|
-
end
|
206
154
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decidim-admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.27.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josep Jaume Rey Peroy
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2022-06-27 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: active_link_to
|
@@ -32,14 +32,14 @@ dependencies:
|
|
32
32
|
requirements:
|
33
33
|
- - '='
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version: 0.
|
35
|
+
version: 0.27.0.rc1
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
40
|
- - '='
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: 0.
|
42
|
+
version: 0.27.0.rc1
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: devise
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
@@ -88,28 +88,28 @@ dependencies:
|
|
88
88
|
requirements:
|
89
89
|
- - '='
|
90
90
|
- !ruby/object:Gem::Version
|
91
|
-
version: 0.
|
91
|
+
version: 0.27.0.rc1
|
92
92
|
type: :development
|
93
93
|
prerelease: false
|
94
94
|
version_requirements: !ruby/object:Gem::Requirement
|
95
95
|
requirements:
|
96
96
|
- - '='
|
97
97
|
- !ruby/object:Gem::Version
|
98
|
-
version: 0.
|
98
|
+
version: 0.27.0.rc1
|
99
99
|
- !ruby/object:Gem::Dependency
|
100
100
|
name: decidim-participatory_processes
|
101
101
|
requirement: !ruby/object:Gem::Requirement
|
102
102
|
requirements:
|
103
103
|
- - '='
|
104
104
|
- !ruby/object:Gem::Version
|
105
|
-
version: 0.
|
105
|
+
version: 0.27.0.rc1
|
106
106
|
type: :development
|
107
107
|
prerelease: false
|
108
108
|
version_requirements: !ruby/object:Gem::Requirement
|
109
109
|
requirements:
|
110
110
|
- - '='
|
111
111
|
- !ruby/object:Gem::Version
|
112
|
-
version: 0.
|
112
|
+
version: 0.27.0.rc1
|
113
113
|
description: Organization administration to manage a single organization.
|
114
114
|
email:
|
115
115
|
- josepjaume@gmail.com
|
@@ -121,6 +121,8 @@ extra_rdoc_files: []
|
|
121
121
|
files:
|
122
122
|
- README.md
|
123
123
|
- Rakefile
|
124
|
+
- app/cells/decidim/admin/attachments_privacy_warning/show.erb
|
125
|
+
- app/cells/decidim/admin/attachments_privacy_warning_cell.rb
|
124
126
|
- app/cells/decidim/admin/content_block/show.erb
|
125
127
|
- app/cells/decidim/admin/content_block_cell.rb
|
126
128
|
- app/cells/decidim/admin/results_per_page/show.erb
|
@@ -243,6 +245,7 @@ files:
|
|
243
245
|
- app/controllers/decidim/admin/organization_external_domain_whitelist_controller.rb
|
244
246
|
- app/controllers/decidim/admin/organization_homepage_content_blocks_controller.rb
|
245
247
|
- app/controllers/decidim/admin/organization_homepage_controller.rb
|
248
|
+
- app/controllers/decidim/admin/reminders_controller.rb
|
246
249
|
- app/controllers/decidim/admin/resource_permissions_controller.rb
|
247
250
|
- app/controllers/decidim/admin/scope_types_controller.rb
|
248
251
|
- app/controllers/decidim/admin/scopes_controller.rb
|
@@ -303,6 +306,7 @@ files:
|
|
303
306
|
- app/helpers/decidim/admin/moderations_helper.rb
|
304
307
|
- app/helpers/decidim/admin/newsletters_helper.rb
|
305
308
|
- app/helpers/decidim/admin/paginable/per_page_helper.rb
|
309
|
+
- app/helpers/decidim/admin/reminders_helper.rb
|
306
310
|
- app/helpers/decidim/admin/resource_permissions_helper.rb
|
307
311
|
- app/helpers/decidim/admin/resource_scope_helper.rb
|
308
312
|
- app/helpers/decidim/admin/scopes_helper.rb
|
@@ -320,11 +324,10 @@ files:
|
|
320
324
|
- app/models/decidim/admin/fake_newsletter.rb
|
321
325
|
- app/packs/entrypoints/decidim_admin.js
|
322
326
|
- app/packs/entrypoints/decidim_admin.scss
|
327
|
+
- app/packs/src/decidim/admin/admin_autocomplete.js
|
323
328
|
- app/packs/src/decidim/admin/application.js
|
324
329
|
- app/packs/src/decidim/admin/auto_buttons_by_position.component.js
|
325
330
|
- app/packs/src/decidim/admin/auto_label_by_position.component.js
|
326
|
-
- app/packs/src/decidim/admin/autocomplete.component.js
|
327
|
-
- app/packs/src/decidim/admin/autocomplete.component.test.js
|
328
331
|
- app/packs/src/decidim/admin/budget_rule_toggler.component.js
|
329
332
|
- app/packs/src/decidim/admin/choose_language.js
|
330
333
|
- app/packs/src/decidim/admin/draggable-list.js
|
@@ -351,7 +354,6 @@ files:
|
|
351
354
|
- app/packs/stylesheets/decidim/admin/application.scss
|
352
355
|
- app/packs/stylesheets/decidim/admin/bundle.scss
|
353
356
|
- app/packs/stylesheets/decidim/admin/components/_accordion.scss
|
354
|
-
- app/packs/stylesheets/decidim/admin/components/_autocomplete_select.component.scss
|
355
357
|
- app/packs/stylesheets/decidim/admin/components/_dropdown-menu.scss
|
356
358
|
- app/packs/stylesheets/decidim/admin/components/_sortable.scss
|
357
359
|
- app/packs/stylesheets/decidim/admin/extra/_action-icon.scss
|
@@ -373,6 +375,7 @@ files:
|
|
373
375
|
- app/packs/stylesheets/decidim/admin/extra/_title_bar.scss
|
374
376
|
- app/packs/stylesheets/decidim/admin/modules/_action-icon.scss
|
375
377
|
- app/packs/stylesheets/decidim/admin/modules/_agenda.scss
|
378
|
+
- app/packs/stylesheets/decidim/admin/modules/_autocomplete.scss
|
376
379
|
- app/packs/stylesheets/decidim/admin/modules/_buttons.scss
|
377
380
|
- app/packs/stylesheets/decidim/admin/modules/_callouts.scss
|
378
381
|
- app/packs/stylesheets/decidim/admin/modules/_card-grid.scss
|
@@ -384,6 +387,7 @@ files:
|
|
384
387
|
- app/packs/stylesheets/decidim/admin/modules/_filters.scss
|
385
388
|
- app/packs/stylesheets/decidim/admin/modules/_forms.scss
|
386
389
|
- app/packs/stylesheets/decidim/admin/modules/_icons.scss
|
390
|
+
- app/packs/stylesheets/decidim/admin/modules/_import_result.scss
|
387
391
|
- app/packs/stylesheets/decidim/admin/modules/_layout.scss
|
388
392
|
- app/packs/stylesheets/decidim/admin/modules/_loading-spinner.scss
|
389
393
|
- app/packs/stylesheets/decidim/admin/modules/_main-nav.scss
|
@@ -397,6 +401,7 @@ files:
|
|
397
401
|
- app/packs/stylesheets/decidim/admin/modules/_tabs.scss
|
398
402
|
- app/packs/stylesheets/decidim/admin/modules/_title-bar.scss
|
399
403
|
- app/packs/stylesheets/decidim/admin/modules/_typography.scss
|
404
|
+
- app/packs/stylesheets/decidim/admin/modules/_upload_modal.scss
|
400
405
|
- app/packs/stylesheets/decidim/admin/modules/_user-login.scss
|
401
406
|
- app/packs/stylesheets/decidim/admin/modules/_users_statistics.scss
|
402
407
|
- app/packs/stylesheets/decidim/admin/plugins/_foundation-datepicker.scss
|
@@ -528,6 +533,7 @@ files:
|
|
528
533
|
- app/views/decidim/admin/participatory_space_private_users/index.html.erb
|
529
534
|
- app/views/decidim/admin/participatory_space_private_users/new.html.erb
|
530
535
|
- app/views/decidim/admin/participatory_space_private_users_csv_imports/new.html.erb
|
536
|
+
- app/views/decidim/admin/reminders/new.html.erb
|
531
537
|
- app/views/decidim/admin/resource_permissions/_options_form.html.erb
|
532
538
|
- app/views/decidim/admin/resource_permissions/edit.html.erb
|
533
539
|
- app/views/decidim/admin/scope_types/_form.html.erb
|
@@ -541,6 +547,7 @@ files:
|
|
541
547
|
- app/views/decidim/admin/share_tokens/_share_tokens.html.erb
|
542
548
|
- app/views/decidim/admin/shared/_filters.html.erb
|
543
549
|
- app/views/decidim/admin/shared/_gallery.html.erb
|
550
|
+
- app/views/decidim/admin/shared/_js-callout.html.erb
|
544
551
|
- app/views/decidim/admin/shared/landing_page/edit.html.erb
|
545
552
|
- app/views/decidim/admin/shared/landing_page_content_blocks/edit.html.erb
|
546
553
|
- app/views/decidim/admin/static_page_topics/_form.html.erb
|
@@ -605,7 +612,6 @@ files:
|
|
605
612
|
- config/locales/fr.yml
|
606
613
|
- config/locales/ga-IE.yml
|
607
614
|
- config/locales/gl.yml
|
608
|
-
- config/locales/gn-PY.yml
|
609
615
|
- config/locales/hr-HR.yml
|
610
616
|
- config/locales/hr.yml
|
611
617
|
- config/locales/hu.yml
|
@@ -614,12 +620,10 @@ files:
|
|
614
620
|
- config/locales/is.yml
|
615
621
|
- config/locales/it.yml
|
616
622
|
- config/locales/ja.yml
|
617
|
-
- config/locales/ka-GE.yml
|
618
623
|
- config/locales/ko-KR.yml
|
619
624
|
- config/locales/ko.yml
|
620
625
|
- config/locales/lb-LU.yml
|
621
626
|
- config/locales/lb.yml
|
622
|
-
- config/locales/lo-LA.yml
|
623
627
|
- config/locales/lt-LT.yml
|
624
628
|
- config/locales/lt.yml
|
625
629
|
- config/locales/lv.yml
|
@@ -627,7 +631,6 @@ files:
|
|
627
631
|
- config/locales/mt.yml
|
628
632
|
- config/locales/nl.yml
|
629
633
|
- config/locales/no.yml
|
630
|
-
- config/locales/oc-FR.yml
|
631
634
|
- config/locales/om-ET.yml
|
632
635
|
- config/locales/pl.yml
|
633
636
|
- config/locales/pt-BR.yml
|
@@ -701,14 +704,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
701
704
|
requirements:
|
702
705
|
- - ">="
|
703
706
|
- !ruby/object:Gem::Version
|
704
|
-
version: '
|
707
|
+
version: '3.0'
|
705
708
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
706
709
|
requirements:
|
707
|
-
- - "
|
710
|
+
- - ">"
|
708
711
|
- !ruby/object:Gem::Version
|
709
|
-
version:
|
712
|
+
version: 1.3.1
|
710
713
|
requirements: []
|
711
|
-
rubygems_version: 3.
|
714
|
+
rubygems_version: 3.2.22
|
712
715
|
signing_key:
|
713
716
|
specification_version: 4
|
714
717
|
summary: Decidim organization administration
|