decidim-admin 0.28.1 → 0.28.2
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/app/controllers/decidim/admin/authorization_workflows_controller.rb +3 -1
- data/app/controllers/decidim/admin/organization_controller.rb +7 -4
- data/app/packs/src/decidim/admin/application.js +6 -1
- data/app/packs/src/decidim/admin/choose_language.js +2 -0
- data/app/packs/src/decidim/admin/dynamic_fields.component.js +2 -1
- data/app/views/decidim/admin/shared/_js-callout.html.erb +2 -2
- data/app/views/layouts/decidim/admin/_sidebar_menu.html.erb +2 -2
- data/config/locales/ar.yml +1 -0
- data/config/locales/bg.yml +1000 -3
- data/config/locales/ca.yml +2 -0
- data/config/locales/cs.yml +2 -0
- data/config/locales/de.yml +10 -8
- data/config/locales/el.yml +1 -0
- data/config/locales/en.yml +2 -0
- data/config/locales/es-MX.yml +9 -7
- data/config/locales/es-PY.yml +9 -7
- data/config/locales/es.yml +18 -16
- data/config/locales/eu.yml +2 -0
- data/config/locales/fi-plain.yml +2 -0
- data/config/locales/fi.yml +2 -0
- data/config/locales/fr-CA.yml +2 -0
- data/config/locales/fr.yml +2 -0
- data/config/locales/ga-IE.yml +1 -0
- data/config/locales/gl.yml +1 -0
- data/config/locales/hu.yml +1 -0
- data/config/locales/id-ID.yml +1 -0
- data/config/locales/is-IS.yml +1 -0
- data/config/locales/it.yml +2 -0
- data/config/locales/ja.yml +2 -0
- data/config/locales/lb.yml +1 -0
- data/config/locales/lt.yml +2 -0
- data/config/locales/lv.yml +1 -0
- data/config/locales/nl.yml +1 -0
- data/config/locales/no.yml +1 -0
- data/config/locales/pl.yml +3 -0
- data/config/locales/pt-BR.yml +1 -0
- data/config/locales/pt.yml +1 -0
- data/config/locales/ro-RO.yml +1 -0
- data/config/locales/ru.yml +1 -0
- data/config/locales/sk.yml +1 -0
- data/config/locales/sl.yml +1 -0
- data/config/locales/sq-AL.yml +413 -0
- data/config/locales/sr-CS.yml +1 -0
- data/config/locales/sv.yml +1 -0
- data/config/locales/th-TH.yml +101 -0
- data/config/locales/tr-TR.yml +1 -0
- data/config/locales/uk.yml +1 -0
- data/config/locales/zh-CN.yml +1 -0
- data/config/locales/zh-TW.yml +2 -0
- data/lib/decidim/admin/test/admin_participatory_space_access_examples.rb +27 -0
- data/lib/decidim/admin/test/invite_participatory_space_admins_shared_examples.rb +180 -0
- data/lib/decidim/admin/test/invite_participatory_space_collaborators_shared_examples.rb +67 -0
- data/lib/decidim/admin/test/invite_participatory_space_moderators_shared_examples.rb +77 -0
- data/lib/decidim/admin/test/invite_participatory_space_users_shared_context.rb +33 -0
- data/lib/decidim/admin/test/manage_attachment_collections_examples.rb +12 -11
- data/lib/decidim/admin/test/manage_categories_examples.rb +11 -8
- data/lib/decidim/admin/test/manage_hide_content_examples.rb +4 -0
- data/lib/decidim/admin/test.rb +1 -0
- data/lib/decidim/admin/version.rb +1 -1
- metadata +16 -13
- data/app/mailers/decidim/admin/application_mailer.rb +0 -12
|
@@ -15,6 +15,23 @@ shared_examples "showing the unauthorized error message" do
|
|
|
15
15
|
end
|
|
16
16
|
end
|
|
17
17
|
|
|
18
|
+
shared_examples "admin participatory space edit button" do
|
|
19
|
+
context "and visits the participatory space public page" do
|
|
20
|
+
before do
|
|
21
|
+
switch_to_host(organization.host)
|
|
22
|
+
login_as role, scope: :user
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
it "shows the admin bar with the Edit button" do
|
|
26
|
+
visit participatory_space_path
|
|
27
|
+
|
|
28
|
+
within "#admin-bar" do
|
|
29
|
+
expect(page).to have_link("Edit", href: target_path)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
18
35
|
shared_examples "admin participatory space access" do
|
|
19
36
|
before do
|
|
20
37
|
switch_to_host(organization.host)
|
|
@@ -31,6 +48,16 @@ shared_examples "admin participatory space access" do
|
|
|
31
48
|
context "when the user has the role" do
|
|
32
49
|
let(:user) { role }
|
|
33
50
|
|
|
51
|
+
context "and visits the root path" do
|
|
52
|
+
it "shows the admin bar" do
|
|
53
|
+
visit decidim.root_path
|
|
54
|
+
|
|
55
|
+
within "#admin-bar" do
|
|
56
|
+
expect(page).to have_link("Admin dashboard", href: "/admin/")
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
|
|
34
61
|
context "and has permission" do
|
|
35
62
|
before do
|
|
36
63
|
visit target_path
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
shared_examples "inviting participatory space admins" do |check_private_space: true, check_landing_page: true|
|
|
4
|
+
let(:role) { "Administrator" }
|
|
5
|
+
|
|
6
|
+
before do
|
|
7
|
+
switch_to_host organization.host
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
shared_examples "sees public space menu" do
|
|
11
|
+
it "can access all sections" do
|
|
12
|
+
within_admin_sidebar_menu do
|
|
13
|
+
expect(page).to have_content(about_this_space_label)
|
|
14
|
+
expect(page).to have_content("Landing page") if check_landing_page
|
|
15
|
+
expect(page).to have_content("Phases") if participatory_space.is_a?(Decidim::ParticipatoryProcess)
|
|
16
|
+
expect(page).to have_content("Components")
|
|
17
|
+
expect(page).to have_content("Categories")
|
|
18
|
+
expect(page).to have_content("Attachments")
|
|
19
|
+
expect(page).to have_content(space_admins_label)
|
|
20
|
+
expect(page).not_to have_content("Private participants") if participatory_space.respond_to?(:private_space)
|
|
21
|
+
expect(page).to have_content("Moderations")
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
shared_examples "sees private space menu" do
|
|
27
|
+
it "can access all sections" do
|
|
28
|
+
within_admin_sidebar_menu do
|
|
29
|
+
expect(page).to have_content(about_this_space_label)
|
|
30
|
+
expect(page).to have_content("Landing page") if check_landing_page
|
|
31
|
+
expect(page).to have_content("Phases") if participatory_space.is_a?(Decidim::ParticipatoryProcess)
|
|
32
|
+
expect(page).to have_content("Components")
|
|
33
|
+
expect(page).to have_content("Categories")
|
|
34
|
+
expect(page).to have_content("Attachments")
|
|
35
|
+
expect(page).to have_content(space_admins_label)
|
|
36
|
+
expect(page).to have_content("Private participants") if participatory_space.respond_to?(:private_space)
|
|
37
|
+
expect(page).to have_content("Moderations")
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
context "when the user does not exist" do
|
|
43
|
+
before do
|
|
44
|
+
perform_enqueued_jobs { invite_user }
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
it "asks for a password and nickname and redirects to the admin dashboard" do
|
|
48
|
+
visit last_email_link
|
|
49
|
+
|
|
50
|
+
within "form.new_user" do
|
|
51
|
+
fill_in :invitation_user_nickname, with: "caballo_loco"
|
|
52
|
+
fill_in :invitation_user_password, with: "decidim123456789"
|
|
53
|
+
check :invitation_user_tos_agreement
|
|
54
|
+
find("*[type=submit]").click
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
expect(page).to have_current_path "/admin/admin_terms/show"
|
|
58
|
+
|
|
59
|
+
visit decidim_admin.admin_terms_show_path
|
|
60
|
+
|
|
61
|
+
find_button("I agree with the terms").click
|
|
62
|
+
|
|
63
|
+
click_on space_sidebar_label
|
|
64
|
+
|
|
65
|
+
within "div.table-scroll" do
|
|
66
|
+
expect(page).to have_i18n_content(participatory_space.title)
|
|
67
|
+
within "tr", text: translated(participatory_space.title) do
|
|
68
|
+
click_on translated(participatory_space.title)
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
context "when the user does not exist" do
|
|
74
|
+
before do
|
|
75
|
+
perform_enqueued_jobs { invite_user }
|
|
76
|
+
|
|
77
|
+
visit last_email_link
|
|
78
|
+
|
|
79
|
+
within "form.new_user" do
|
|
80
|
+
fill_in :invitation_user_nickname, with: "caballo_loco"
|
|
81
|
+
fill_in :invitation_user_password, with: "decidim123456789"
|
|
82
|
+
check :invitation_user_tos_agreement
|
|
83
|
+
find("*[type=submit]").click
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
expect(page).to have_current_path "/admin/admin_terms/show"
|
|
87
|
+
|
|
88
|
+
visit decidim_admin.admin_terms_show_path
|
|
89
|
+
|
|
90
|
+
find_button("I agree with the terms").click
|
|
91
|
+
|
|
92
|
+
click_on space_sidebar_label
|
|
93
|
+
|
|
94
|
+
within "div.table-scroll" do
|
|
95
|
+
expect(page).to have_i18n_content(participatory_space.title)
|
|
96
|
+
within "tr", text: translated(participatory_space.title) do
|
|
97
|
+
click_on translated(participatory_space.title)
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
context "and is a public space" do
|
|
103
|
+
it_behaves_like "sees public space menu"
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
if check_private_space
|
|
107
|
+
context "and is a private space" do
|
|
108
|
+
let(:participatory_space) { private_participatory_space }
|
|
109
|
+
|
|
110
|
+
it_behaves_like "sees private space menu"
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
context "when the user already exists" do
|
|
117
|
+
let(:email) { "administrator@example.org" }
|
|
118
|
+
|
|
119
|
+
let!(:administrator) do
|
|
120
|
+
create(:user, :confirmed, :admin_terms_accepted, email:, organization:)
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
before do
|
|
124
|
+
perform_enqueued_jobs { invite_user }
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
it "redirects the administrator to the admin dashboard" do
|
|
128
|
+
login_as administrator, scope: :user
|
|
129
|
+
|
|
130
|
+
visit decidim_admin.root_path
|
|
131
|
+
|
|
132
|
+
click_on space_sidebar_label
|
|
133
|
+
|
|
134
|
+
within "div.table-scroll" do
|
|
135
|
+
expect(page).to have_i18n_content(participatory_space.title)
|
|
136
|
+
expect(page).to have_i18n_content(participatory_space.title)
|
|
137
|
+
within "tr", text: translated(participatory_space.title) do
|
|
138
|
+
click_on translated(participatory_space.title)
|
|
139
|
+
end
|
|
140
|
+
end
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
it "selects the user role in the form" do
|
|
144
|
+
edit_user(administrator.name)
|
|
145
|
+
|
|
146
|
+
expect(page).to have_select("Role", selected: "Administrator")
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
context "when user exists in the organization" do
|
|
150
|
+
before do
|
|
151
|
+
perform_enqueued_jobs { invite_user }
|
|
152
|
+
login_as administrator, scope: :user
|
|
153
|
+
|
|
154
|
+
visit decidim_admin.root_path
|
|
155
|
+
|
|
156
|
+
click_on space_sidebar_label
|
|
157
|
+
|
|
158
|
+
within "div.table-scroll" do
|
|
159
|
+
expect(page).to have_i18n_content(participatory_space.title)
|
|
160
|
+
expect(page).to have_i18n_content(participatory_space.title)
|
|
161
|
+
within "tr", text: translated(participatory_space.title) do
|
|
162
|
+
click_on translated(participatory_space.title)
|
|
163
|
+
end
|
|
164
|
+
end
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
context "and is a public space" do
|
|
168
|
+
it_behaves_like "sees public space menu"
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
if check_private_space
|
|
172
|
+
context "and is a private space" do
|
|
173
|
+
let(:participatory_space) { private_participatory_space }
|
|
174
|
+
|
|
175
|
+
it_behaves_like "sees private space menu"
|
|
176
|
+
end
|
|
177
|
+
end
|
|
178
|
+
end
|
|
179
|
+
end
|
|
180
|
+
end
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
shared_examples "inviting participatory space collaborators" do
|
|
4
|
+
let(:role) { "Collaborator" }
|
|
5
|
+
|
|
6
|
+
before do
|
|
7
|
+
switch_to_host organization.host
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
context "when the user does not exist" do
|
|
11
|
+
before do
|
|
12
|
+
perform_enqueued_jobs { invite_user }
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
it "asks for a password and nickname and redirects to the admin dashboard" do
|
|
16
|
+
visit last_email_link
|
|
17
|
+
|
|
18
|
+
within "form.new_user" do
|
|
19
|
+
fill_in :invitation_user_nickname, with: "caballo_loco"
|
|
20
|
+
fill_in :invitation_user_password, with: "decidim123456789"
|
|
21
|
+
check :invitation_user_tos_agreement
|
|
22
|
+
find("*[type=submit]").click
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
expect(page).to have_current_path "/admin/admin_terms/show"
|
|
26
|
+
|
|
27
|
+
visit decidim_admin.admin_terms_show_path
|
|
28
|
+
find_button("I agree with the terms").click
|
|
29
|
+
|
|
30
|
+
click_on space_sidebar_label
|
|
31
|
+
|
|
32
|
+
within "div.table-scroll" do
|
|
33
|
+
expect(page).to have_i18n_content(participatory_space.title)
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
context "when the user already exists" do
|
|
39
|
+
let(:email) { "collaborator@example.org" }
|
|
40
|
+
|
|
41
|
+
let!(:collaborator) do
|
|
42
|
+
create(:user, :confirmed, :admin_terms_accepted, email:, organization:)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
before do
|
|
46
|
+
perform_enqueued_jobs { invite_user }
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
it "redirects the collaborator to the admin dashboard" do
|
|
50
|
+
login_as collaborator, scope: :user
|
|
51
|
+
|
|
52
|
+
visit decidim_admin.root_path
|
|
53
|
+
|
|
54
|
+
click_on space_sidebar_label
|
|
55
|
+
|
|
56
|
+
within "div.table-scroll" do
|
|
57
|
+
expect(page).to have_i18n_content(participatory_space.title)
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
it "selects the user role in the form" do
|
|
62
|
+
edit_user(collaborator.name)
|
|
63
|
+
|
|
64
|
+
expect(page).to have_select("Role", selected: "Collaborator")
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
shared_examples "inviting participatory space moderators" do
|
|
4
|
+
before do
|
|
5
|
+
switch_to_host organization.host
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
context "when the user does not exist" do
|
|
9
|
+
before do
|
|
10
|
+
perform_enqueued_jobs { invite_user }
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
it "asks for a password and nickname and redirects to the admin dashboard" do
|
|
14
|
+
visit last_email_link
|
|
15
|
+
|
|
16
|
+
within "form.new_user" do
|
|
17
|
+
fill_in :invitation_user_nickname, with: "caballo_loco"
|
|
18
|
+
fill_in :invitation_user_password, with: "decidim123456789"
|
|
19
|
+
check :invitation_user_tos_agreement
|
|
20
|
+
find("*[type=submit]").click
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
expect(page).to have_current_path "/admin/admin_terms/show"
|
|
24
|
+
|
|
25
|
+
visit decidim_admin.admin_terms_show_path
|
|
26
|
+
find_button("I agree with the terms").click
|
|
27
|
+
|
|
28
|
+
click_on space_sidebar_label
|
|
29
|
+
|
|
30
|
+
within "div.table-scroll" do
|
|
31
|
+
expect(page).to have_i18n_content(participatory_space.title)
|
|
32
|
+
click_on "Moderate"
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
within "div.process-title-content-breadcrumb-container-left" do
|
|
36
|
+
expect(page).to have_css("span.process-title-content-breadcrumb", text: "Moderations")
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
context "when the user already exists" do
|
|
42
|
+
let(:email) { "moderator@example.org" }
|
|
43
|
+
|
|
44
|
+
let!(:moderator) do
|
|
45
|
+
create(:user, :confirmed, :admin_terms_accepted, email:, organization:)
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
before do
|
|
49
|
+
perform_enqueued_jobs { invite_user }
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
it "redirects the moderator to the admin dashboard" do
|
|
53
|
+
login_as moderator, scope: :user
|
|
54
|
+
|
|
55
|
+
visit decidim_admin.root_path
|
|
56
|
+
|
|
57
|
+
click_on space_sidebar_label
|
|
58
|
+
|
|
59
|
+
within "div.table-scroll" do
|
|
60
|
+
expect(page).to have_i18n_content(participatory_space.title)
|
|
61
|
+
within "tr", text: translated(participatory_space.title) do
|
|
62
|
+
click_on "Moderate"
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
within "div.process-title-content-breadcrumb-container-left" do
|
|
67
|
+
expect(page).to have_css("span.process-title-content-breadcrumb", text: "Moderations")
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
it "selects the user role in the form" do
|
|
72
|
+
edit_user(moderator.name)
|
|
73
|
+
|
|
74
|
+
expect(page).to have_select("Role", selected: "Moderator")
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
shared_context "when inviting participatory space users" do
|
|
4
|
+
let(:organization) { participatory_space.organization }
|
|
5
|
+
let(:user) { create(:user, :admin, :confirmed, organization: participatory_space.organization) }
|
|
6
|
+
let(:email) { "this_email_does_not_exist@example.org" }
|
|
7
|
+
let(:role) { "Moderator" }
|
|
8
|
+
|
|
9
|
+
def invite_user
|
|
10
|
+
login_as user, scope: :user
|
|
11
|
+
|
|
12
|
+
visit participatory_space_user_roles_path
|
|
13
|
+
within "[data-content]" do
|
|
14
|
+
click_on new_button_label
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
fill_in "Name", with: "Alice Liddel"
|
|
18
|
+
fill_in "Email", with: email
|
|
19
|
+
select role, from: "Role"
|
|
20
|
+
click_on "Create"
|
|
21
|
+
logout :user
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def edit_user(username)
|
|
25
|
+
login_as user, scope: :user
|
|
26
|
+
|
|
27
|
+
visit participatory_space_user_roles_path
|
|
28
|
+
|
|
29
|
+
within "tr", text: username do
|
|
30
|
+
click_on "Edit"
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
shared_examples "manage attachment collections examples" do
|
|
4
4
|
let!(:attachment_collection) { create(:attachment_collection, collection_for:) }
|
|
5
|
+
let(:attributes) { attributes_for(:attachment_collection) }
|
|
5
6
|
|
|
6
7
|
before do
|
|
7
8
|
visit current_path
|
|
@@ -30,17 +31,13 @@ shared_examples "manage attachment collections examples" do
|
|
|
30
31
|
fill_in_i18n(
|
|
31
32
|
:attachment_collection_name,
|
|
32
33
|
"#attachment_collection-name-tabs",
|
|
33
|
-
|
|
34
|
-
es: "Formularios de solicitud",
|
|
35
|
-
ca: "Formularis de sol·licitud"
|
|
34
|
+
**attributes[:name].except("machine_translations")
|
|
36
35
|
)
|
|
37
36
|
|
|
38
37
|
fill_in_i18n(
|
|
39
38
|
:attachment_collection_description,
|
|
40
39
|
"#attachment_collection-description-tabs",
|
|
41
|
-
|
|
42
|
-
es: "Contiene los formularios de solicitud",
|
|
43
|
-
ca: "Conté els formularis de sol·licitud"
|
|
40
|
+
**attributes[:description].except("machine_translations")
|
|
44
41
|
)
|
|
45
42
|
|
|
46
43
|
find("*[type=submit]").click
|
|
@@ -49,8 +46,11 @@ shared_examples "manage attachment collections examples" do
|
|
|
49
46
|
expect(page).to have_admin_callout("successfully")
|
|
50
47
|
|
|
51
48
|
within "#attachment_collections table" do
|
|
52
|
-
expect(page).to
|
|
49
|
+
expect(page).to have_content(translated(attributes[:name]))
|
|
53
50
|
end
|
|
51
|
+
|
|
52
|
+
visit decidim_admin.root_path
|
|
53
|
+
expect(page).to have_content("created the #{translated(attributes[:name])} attachment collection")
|
|
54
54
|
end
|
|
55
55
|
|
|
56
56
|
it "can update an attachment collection" do
|
|
@@ -64,9 +64,7 @@ shared_examples "manage attachment collections examples" do
|
|
|
64
64
|
fill_in_i18n(
|
|
65
65
|
:attachment_collection_name,
|
|
66
66
|
"#attachment_collection-name-tabs",
|
|
67
|
-
|
|
68
|
-
es: "Últimos formularios de solicitud",
|
|
69
|
-
ca: "Últims formularis de sol·licitud"
|
|
67
|
+
**attributes[:name].except("machine_translations")
|
|
70
68
|
)
|
|
71
69
|
|
|
72
70
|
find("*[type=submit]").click
|
|
@@ -75,8 +73,11 @@ shared_examples "manage attachment collections examples" do
|
|
|
75
73
|
expect(page).to have_admin_callout("successfully")
|
|
76
74
|
|
|
77
75
|
within "#attachment_collections table" do
|
|
78
|
-
expect(page).to
|
|
76
|
+
expect(page).to have_content(translated(attributes[:name]))
|
|
79
77
|
end
|
|
78
|
+
|
|
79
|
+
visit decidim_admin.root_path
|
|
80
|
+
expect(page).to have_content("updated the #{translated(attributes[:name])} attachment collection")
|
|
80
81
|
end
|
|
81
82
|
|
|
82
83
|
context "when deleting a attachment collection" do
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
shared_examples "manage categories examples" do
|
|
4
|
+
let(:attributes) { attributes_for(:category) }
|
|
4
5
|
it "lists all the categories for the process" do
|
|
5
6
|
within "#categories table" do
|
|
6
7
|
expect(page).to have_content(translated(category.name, locale: :en))
|
|
@@ -25,9 +26,7 @@ shared_examples "manage categories examples" do
|
|
|
25
26
|
fill_in_i18n(
|
|
26
27
|
:category_name,
|
|
27
28
|
"#category-name-tabs",
|
|
28
|
-
|
|
29
|
-
es: "Mi categoría",
|
|
30
|
-
ca: "La meva categoria"
|
|
29
|
+
**attributes[:name].except("machine_translations")
|
|
31
30
|
)
|
|
32
31
|
|
|
33
32
|
find("*[type=submit]").click
|
|
@@ -36,8 +35,11 @@ shared_examples "manage categories examples" do
|
|
|
36
35
|
expect(page).to have_admin_callout("successfully")
|
|
37
36
|
|
|
38
37
|
within "#categories table" do
|
|
39
|
-
expect(page).to have_content(
|
|
38
|
+
expect(page).to have_content(translated(attributes[:name]))
|
|
40
39
|
end
|
|
40
|
+
|
|
41
|
+
visit decidim_admin.root_path
|
|
42
|
+
expect(page).to have_content("added the #{translated(attributes[:name])} category to the")
|
|
41
43
|
end
|
|
42
44
|
|
|
43
45
|
it "updates a category" do
|
|
@@ -51,9 +53,7 @@ shared_examples "manage categories examples" do
|
|
|
51
53
|
fill_in_i18n(
|
|
52
54
|
:category_name,
|
|
53
55
|
"#category-name-tabs",
|
|
54
|
-
|
|
55
|
-
es: "Mi nuevo nombre",
|
|
56
|
-
ca: "El meu nou nom"
|
|
56
|
+
**attributes[:name].except("machine_translations")
|
|
57
57
|
)
|
|
58
58
|
|
|
59
59
|
find("*[type=submit]").click
|
|
@@ -62,8 +62,11 @@ shared_examples "manage categories examples" do
|
|
|
62
62
|
expect(page).to have_admin_callout("successfully")
|
|
63
63
|
|
|
64
64
|
within "#categories table" do
|
|
65
|
-
expect(page).to have_content(
|
|
65
|
+
expect(page).to have_content(translated(attributes[:name]))
|
|
66
66
|
end
|
|
67
|
+
|
|
68
|
+
visit decidim_admin.root_path
|
|
69
|
+
expect(page).to have_content("updated the #{translated(attributes[:name])} category in the")
|
|
67
70
|
end
|
|
68
71
|
|
|
69
72
|
context "when deleting a category" do
|
|
@@ -54,6 +54,10 @@ shared_examples "hideable resource during block" do
|
|
|
54
54
|
click_button I18n.t("decidim.admin.block_user.new.action")
|
|
55
55
|
|
|
56
56
|
expect(content.reload).to be_hidden
|
|
57
|
+
|
|
58
|
+
visit decidim_admin.root_path
|
|
59
|
+
expect(page).to have_content("blocked user")
|
|
60
|
+
expect(page).to have_content("hid a resource of type")
|
|
57
61
|
end
|
|
58
62
|
end
|
|
59
63
|
end
|
data/lib/decidim/admin/test.rb
CHANGED
|
@@ -14,3 +14,4 @@ require "decidim/admin/test/manage_hide_content_examples"
|
|
|
14
14
|
require "decidim/admin/test/needs_admin_tos_accepted_examples"
|
|
15
15
|
require "decidim/admin/test/destroy_admin_examples"
|
|
16
16
|
require "decidim/admin/test/commands/publish_participatory_space_examples"
|
|
17
|
+
require "decidim/admin/test/invite_participatory_space_users_shared_context"
|
metadata
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: decidim-admin
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.28.
|
|
4
|
+
version: 0.28.2
|
|
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:
|
|
10
|
+
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date: 2024-
|
|
13
|
+
date: 2024-07-16 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.28.
|
|
35
|
+
version: 0.28.2
|
|
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.28.
|
|
42
|
+
version: 0.28.2
|
|
43
43
|
- !ruby/object:Gem::Dependency
|
|
44
44
|
name: devise
|
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -94,28 +94,28 @@ dependencies:
|
|
|
94
94
|
requirements:
|
|
95
95
|
- - '='
|
|
96
96
|
- !ruby/object:Gem::Version
|
|
97
|
-
version: 0.28.
|
|
97
|
+
version: 0.28.2
|
|
98
98
|
type: :development
|
|
99
99
|
prerelease: false
|
|
100
100
|
version_requirements: !ruby/object:Gem::Requirement
|
|
101
101
|
requirements:
|
|
102
102
|
- - '='
|
|
103
103
|
- !ruby/object:Gem::Version
|
|
104
|
-
version: 0.28.
|
|
104
|
+
version: 0.28.2
|
|
105
105
|
- !ruby/object:Gem::Dependency
|
|
106
106
|
name: decidim-participatory_processes
|
|
107
107
|
requirement: !ruby/object:Gem::Requirement
|
|
108
108
|
requirements:
|
|
109
109
|
- - '='
|
|
110
110
|
- !ruby/object:Gem::Version
|
|
111
|
-
version: 0.28.
|
|
111
|
+
version: 0.28.2
|
|
112
112
|
type: :development
|
|
113
113
|
prerelease: false
|
|
114
114
|
version_requirements: !ruby/object:Gem::Requirement
|
|
115
115
|
requirements:
|
|
116
116
|
- - '='
|
|
117
117
|
- !ruby/object:Gem::Version
|
|
118
|
-
version: 0.28.
|
|
118
|
+
version: 0.28.2
|
|
119
119
|
description: Organization administration to manage a single organization.
|
|
120
120
|
email:
|
|
121
121
|
- josepjaume@gmail.com
|
|
@@ -347,7 +347,6 @@ files:
|
|
|
347
347
|
- app/jobs/decidim/admin/newsletter_delivery_job.rb
|
|
348
348
|
- app/jobs/decidim/admin/newsletter_job.rb
|
|
349
349
|
- app/jobs/decidim/admin/verify_user_group_from_csv_job.rb
|
|
350
|
-
- app/mailers/decidim/admin/application_mailer.rb
|
|
351
350
|
- app/models/decidim/admin/fake_newsletter.rb
|
|
352
351
|
- app/packs/entrypoints/decidim_admin.js
|
|
353
352
|
- app/packs/entrypoints/decidim_admin.scss
|
|
@@ -676,6 +675,10 @@ files:
|
|
|
676
675
|
- lib/decidim/admin/test/forms/attachment_collection_form_examples.rb
|
|
677
676
|
- lib/decidim/admin/test/forms/attachment_form_examples.rb
|
|
678
677
|
- lib/decidim/admin/test/forms/category_form_examples.rb
|
|
678
|
+
- lib/decidim/admin/test/invite_participatory_space_admins_shared_examples.rb
|
|
679
|
+
- lib/decidim/admin/test/invite_participatory_space_collaborators_shared_examples.rb
|
|
680
|
+
- lib/decidim/admin/test/invite_participatory_space_moderators_shared_examples.rb
|
|
681
|
+
- lib/decidim/admin/test/invite_participatory_space_users_shared_context.rb
|
|
679
682
|
- lib/decidim/admin/test/manage_attachment_collections_examples.rb
|
|
680
683
|
- lib/decidim/admin/test/manage_attachments_examples.rb
|
|
681
684
|
- lib/decidim/admin/test/manage_categories_examples.rb
|
|
@@ -695,7 +698,7 @@ metadata:
|
|
|
695
698
|
funding_uri: https://opencollective.com/decidim
|
|
696
699
|
homepage_uri: https://decidim.org
|
|
697
700
|
source_code_uri: https://github.com/decidim/decidim
|
|
698
|
-
post_install_message:
|
|
701
|
+
post_install_message:
|
|
699
702
|
rdoc_options: []
|
|
700
703
|
require_paths:
|
|
701
704
|
- lib
|
|
@@ -710,8 +713,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
710
713
|
- !ruby/object:Gem::Version
|
|
711
714
|
version: '0'
|
|
712
715
|
requirements: []
|
|
713
|
-
rubygems_version: 3.
|
|
714
|
-
signing_key:
|
|
716
|
+
rubygems_version: 3.3.7
|
|
717
|
+
signing_key:
|
|
715
718
|
specification_version: 4
|
|
716
719
|
summary: Decidim organization administration
|
|
717
720
|
test_files: []
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Decidim
|
|
4
|
-
module Admin
|
|
5
|
-
# Custom application mailer, scoped to the admin mailer.
|
|
6
|
-
#
|
|
7
|
-
class ApplicationMailer < ActionMailer::Base
|
|
8
|
-
default from: Decidim.config.mailer_sender
|
|
9
|
-
layout "mailer"
|
|
10
|
-
end
|
|
11
|
-
end
|
|
12
|
-
end
|