decidim-admin 0.28.1 → 0.28.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -13
- data/app/commands/decidim/admin/destroy_component.rb +1 -0
- data/app/controllers/concerns/decidim/admin/filterable.rb +1 -1
- data/app/controllers/concerns/decidim/admin/verification_conflicts/filterable.rb +31 -0
- data/app/controllers/decidim/admin/application_controller.rb +1 -1
- data/app/controllers/decidim/admin/authorization_workflows_controller.rb +3 -1
- data/app/controllers/decidim/admin/conflicts_controller.rb +13 -5
- data/app/controllers/decidim/admin/organization_controller.rb +7 -4
- data/app/helpers/decidim/admin/application_helper.rb +13 -0
- 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/block_user/new.html.erb +1 -1
- data/app/views/decidim/admin/components/index.html.erb +5 -1
- data/app/views/decidim/admin/conflicts/index.html.erb +29 -6
- data/app/views/decidim/admin/exports/_dropdown.html.erb +5 -5
- data/app/views/decidim/admin/imports/_dropdown.html.erb +6 -4
- data/app/views/decidim/admin/imports/new.html.erb +5 -4
- data/app/views/decidim/admin/organization_appearance/form/_minimap.html.erb +3 -3
- data/app/views/decidim/admin/shared/_js-callout.html.erb +2 -2
- data/app/views/layouts/decidim/admin/_application.html.erb +1 -1
- 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 +6 -2
- data/config/locales/cs.yml +9 -0
- data/config/locales/de.yml +12 -8
- data/config/locales/el.yml +1 -0
- data/config/locales/en.yml +4 -0
- data/config/locales/es-MX.yml +11 -7
- data/config/locales/es-PY.yml +11 -7
- data/config/locales/es.yml +22 -18
- data/config/locales/eu.yml +4 -0
- data/config/locales/fi-plain.yml +5 -1
- data/config/locales/fi.yml +9 -5
- data/config/locales/fr-CA.yml +4 -0
- data/config/locales/fr.yml +4 -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 +4 -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 +10 -3
- 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 +303 -162
- 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 +34 -0
- data/lib/decidim/admin/test/manage_attachment_collections_examples.rb +12 -11
- data/lib/decidim/admin/test/manage_attachments_examples.rb +13 -1
- 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/manage_paginated_collection_examples.rb +4 -4
- data/lib/decidim/admin/test.rb +1 -0
- data/lib/decidim/admin/version.rb +1 -1
- data/lib/decidim/admin.rb +0 -15
- metadata +17 -15
- data/app/controllers/concerns/decidim/admin/paginable.rb +0 -20
- data/app/helpers/decidim/admin/paginable/per_page_helper.rb +0 -22
- data/app/mailers/decidim/admin/application_mailer.rb +0 -12
data/config/locales/th-TH.yml
CHANGED
@@ -1 +1,102 @@
|
|
1
|
+
---
|
1
2
|
th:
|
3
|
+
activemodel:
|
4
|
+
attributes:
|
5
|
+
area:
|
6
|
+
area_type: ประเภทพื้นที่
|
7
|
+
name: ชื่อ
|
8
|
+
organization: องค์กร
|
9
|
+
area_type:
|
10
|
+
name: ชื่อ
|
11
|
+
organization: องค์กร
|
12
|
+
plural: พหูพจน์
|
13
|
+
attachment:
|
14
|
+
attachment_collection_id: โฟลเดอร์
|
15
|
+
description: คำอธิบาย
|
16
|
+
file: ไฟล์
|
17
|
+
title: ชื่อไฟล์แนบหรือรูปภาพ
|
18
|
+
weight: ตำแหน่งการสั่งซื้อ
|
19
|
+
attachment_collection:
|
20
|
+
description: คำอธิบาย
|
21
|
+
name: ชื่อ
|
22
|
+
organization:
|
23
|
+
machine_translation_display_priority_translation: แปลข้อความก่อน
|
24
|
+
name: ชื่อ
|
25
|
+
official_img_footer: ส่วนท้ายของโลโก้อย่างเป็นทางการ
|
26
|
+
official_url: URL องค์กรอย่างเป็นทางการ
|
27
|
+
omnipresent_banner_short_description: คำอธิบายสั้น
|
28
|
+
omnipresent_banner_title: ชื่อ
|
29
|
+
omnipresent_banner_url: URL
|
30
|
+
organization_admin_email: อีเมลผู้ดูแลระบบองค์กร
|
31
|
+
organization_admin_name: อีเมลผู้ดูแลระบบองค์กร
|
32
|
+
organization_locales: สถานที่ขององค์กร
|
33
|
+
primary_color: หลัก
|
34
|
+
reference_prefix: คำนำหน้าอ้างอิง
|
35
|
+
rich_text_editor_in_public_views: เปิดใช้งานโปรแกรมแก้ไขข้อความแบบ Rich Text สำหรับผู้เข้าร่วม
|
36
|
+
secondary_color: รอง
|
37
|
+
secondary_hosts: เจ้าภาพรอง
|
38
|
+
send_welcome_notification: ส่งการแจ้งเตือนยินดีต้อนรับ
|
39
|
+
success_color: ความสำเร็จ
|
40
|
+
tertiary_color: ระดับอุดมศึกษา
|
41
|
+
time_zone: เขตเวลา
|
42
|
+
tos_version: เงื่อนไขการให้บริการเวอร์ชัน
|
43
|
+
twitter_handler: ตัวจัดการเอ็กซ์
|
44
|
+
user_groups_enabled: เปิดใช้งานกลุ่ม
|
45
|
+
users_registration_mode: โหมดการลงทะเบียนผู้ใช้
|
46
|
+
warning_color: คำเตือน
|
47
|
+
welcome_notification_body: ยินดีต้อนรับเนื้อหาการแจ้งเตือน
|
48
|
+
welcome_notification_subject: ยินดีต้อนรับเรื่องการแจ้งเตือน
|
49
|
+
youtube_handler: ตัวจัดการ YouTube
|
50
|
+
participatory_space_private_user:
|
51
|
+
email: อีเมล
|
52
|
+
name: ชื่อ
|
53
|
+
scope:
|
54
|
+
code: รหัส
|
55
|
+
name: ชื่อ
|
56
|
+
organization: องค์กร
|
57
|
+
parent_id: พ่อแม่
|
58
|
+
scope_type: ประเภทขอบเขต
|
59
|
+
scope_type_id: ประเภทขอบเขต
|
60
|
+
scope_type:
|
61
|
+
name: ชื่อ
|
62
|
+
organization: องค์กร
|
63
|
+
plural: พหูพจน์
|
64
|
+
settings:
|
65
|
+
scope_id: ขอบเขต
|
66
|
+
static_page:
|
67
|
+
allow_public_access: อนุญาตการเข้าถึงโดยไม่ต้องตรวจสอบสิทธิ์
|
68
|
+
changed_notably: มีการเปลี่ยนแปลงที่เห็นได้ชัดเจน
|
69
|
+
content: เนื้อหา
|
70
|
+
organization: องค์กร
|
71
|
+
show_in_footer: แสดงในส่วนท้าย
|
72
|
+
slug: บุ้ง URL
|
73
|
+
title: ชื่อ
|
74
|
+
topic_id: หัวข้อ
|
75
|
+
weight: ตำแหน่งการสั่งซื้อ
|
76
|
+
static_page_topic:
|
77
|
+
description: คำอธิบาย
|
78
|
+
name: ชื่อหัวข้อ
|
79
|
+
decidim:
|
80
|
+
admin:
|
81
|
+
area_types:
|
82
|
+
edit:
|
83
|
+
title: แก้ไขประเภทพื้นที่
|
84
|
+
update: อัปเดต
|
85
|
+
new:
|
86
|
+
create: สร้างประเภทพื้นที่
|
87
|
+
title: ประเภทพื้นที่ใหม่
|
88
|
+
update:
|
89
|
+
error: เกิดปัญหาในการอัปเดตประเภทพื้นที่นี้
|
90
|
+
success: อัปเดตประเภทพื้นที่เรียบร้อยแล้ว
|
91
|
+
areas:
|
92
|
+
create:
|
93
|
+
error: เกิดปัญหาในการสร้างพื้นที่ใหม่
|
94
|
+
success: สร้างพื้นที่สำเร็จแล้ว
|
95
|
+
destroy:
|
96
|
+
has_spaces: พื้นที่นี้มีช่องว่างที่ต้องพึ่งพา โปรดตรวจสอบให้แน่ใจว่าไม่มี Participatory Space อ้างอิงถึงพื้นที่นี้ก่อนที่จะลบออก
|
97
|
+
success: ทำลายพื้นที่สำเร็จ
|
98
|
+
edit:
|
99
|
+
title: แก้ไขพื้นที่
|
100
|
+
organization_external_domain_whitelist:
|
101
|
+
edit:
|
102
|
+
update: อัปเดต
|
data/config/locales/tr-TR.yml
CHANGED
data/config/locales/uk.yml
CHANGED
data/config/locales/zh-CN.yml
CHANGED
data/config/locales/zh-TW.yml
CHANGED
@@ -182,6 +182,7 @@ zh-TW:
|
|
182
182
|
export: 全部匯出
|
183
183
|
export-selection: 匯出選擇
|
184
184
|
import: 匯入
|
185
|
+
manage: 管理
|
185
186
|
newsletter:
|
186
187
|
new: 新電子報
|
187
188
|
participatory_space_private_user:
|
@@ -538,6 +539,7 @@ zh-TW:
|
|
538
539
|
appearance: 外觀
|
539
540
|
area_types: 區域類型
|
540
541
|
areas: 區域
|
542
|
+
components: 组件
|
541
543
|
configuration: 配置
|
542
544
|
content: 被檢舉的內容
|
543
545
|
help_sections: 幫助部分
|
@@ -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,34 @@
|
|
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
|
+
expect(page).to have_content("successfully added")
|
22
|
+
logout :user
|
23
|
+
end
|
24
|
+
|
25
|
+
def edit_user(username)
|
26
|
+
login_as user, scope: :user
|
27
|
+
|
28
|
+
visit participatory_space_user_roles_path
|
29
|
+
|
30
|
+
within "tr", text: username do
|
31
|
+
click_on "Edit"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
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
|
@@ -26,7 +26,19 @@ shared_examples "manage attachments examples" do
|
|
26
26
|
expect(page).to have_selector("input#attachment_description_en[value='#{translated(attachment.description, locale: :en)}']")
|
27
27
|
expect(page).to have_selector("input#attachment_weight[value='#{attachment.weight}']")
|
28
28
|
expect(page).to have_select("attachment_attachment_collection_id", selected: translated(attachment_collection.name, locale: :en))
|
29
|
-
|
29
|
+
|
30
|
+
# The image's URL changes every time it is requested because the disk
|
31
|
+
# service generates a unique URL based on the expiry time of the link.
|
32
|
+
# This expiry time is calculated at the time when the URL is requested
|
33
|
+
# which is why it changes every time to different URL. This changes the
|
34
|
+
# JSON encoded file identifier which includes the expiry time as well as
|
35
|
+
# the digest of the URL because the digest is calculated based on the
|
36
|
+
# passed data.
|
37
|
+
filename = attachment.file.blob.filename
|
38
|
+
within %([data-active-uploads] [data-filename="#{filename}"]) do
|
39
|
+
src = page.find("img")["src"]
|
40
|
+
expect(src).to be_blob_url(attachment.file.blob)
|
41
|
+
end
|
30
42
|
end
|
31
43
|
|
32
44
|
it "can add attachments without a collection to a process" 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
|