decidim-core 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/app/cells/decidim/address/online.erb +2 -2
- data/app/cells/decidim/address_cell.rb +4 -0
- data/app/cells/decidim/announcement/show.erb +2 -2
- data/app/cells/decidim/author/show.erb +5 -5
- data/app/cells/decidim/card/show.erb +1 -1
- data/app/cells/decidim/card_g/show.erb +1 -1
- data/app/cells/decidim/card_g_cell.rb +5 -2
- data/app/cells/decidim/card_l/image.erb +2 -2
- data/app/cells/decidim/card_l_cell.rb +5 -2
- data/app/cells/decidim/card_metadata/show.erb +2 -2
- data/app/cells/decidim/content_blocks/hero_cell.rb +1 -1
- data/app/cells/decidim/content_blocks/highlighted_content_banner/show.erb +1 -1
- data/app/cells/decidim/content_blocks/participatory_space_hero_cell.rb +2 -2
- data/app/cells/decidim/data_consent/category.erb +1 -1
- data/app/cells/decidim/nav_links/show.erb +2 -2
- data/app/cells/decidim/notification/moderated.erb +12 -0
- data/app/cells/decidim/notification_cell.rb +5 -1
- data/app/cells/decidim/profile/details.erb +1 -1
- data/app/cells/decidim/progress_bar/show.erb +1 -1
- data/app/cells/decidim/progress_bar_cell.rb +2 -0
- data/app/cells/decidim/report_button/flag_modal.erb +5 -1
- data/app/cells/decidim/resource_types_filter/show.erb +3 -3
- data/app/cells/decidim/statistic/show.erb +2 -2
- data/app/cells/decidim/upload_modal/modal.erb +3 -4
- data/app/commands/decidim/create_omniauth_registration.rb +10 -4
- data/app/controllers/concerns/decidim/devise_controllers.rb +1 -0
- data/app/controllers/concerns/decidim/force_authentication.rb +1 -1
- data/app/controllers/concerns/decidim/paginable.rb +1 -1
- data/app/controllers/concerns/decidim/use_organization_time_zone.rb +1 -1
- data/app/controllers/decidim/application_controller.rb +1 -0
- data/app/controllers/decidim/gamification/badges_controller.rb +2 -0
- data/app/controllers/decidim/links_controller.rb +15 -2
- data/app/helpers/concerns/decidim/flash_helper_extensions.rb +2 -2
- data/app/helpers/decidim/check_boxes_tree_helper.rb +1 -2
- data/app/helpers/decidim/paginate_helper.rb +3 -5
- data/app/mailers/decidim/application_mailer.rb +40 -6
- data/app/models/decidim/attachment.rb +3 -3
- data/app/models/decidim/component.rb +4 -1
- data/app/models/decidim/content_block.rb +2 -2
- data/app/models/decidim/user.rb +12 -12
- data/app/packs/src/decidim/a11y.js +14 -0
- data/app/packs/src/decidim/abide_form_validator_fixer.js +44 -0
- data/app/packs/src/decidim/direct_uploads/upload_modal.js +2 -6
- data/app/packs/src/decidim/index.js +29 -1
- data/app/packs/src/decidim/input_character_counter.js +1 -1
- data/app/packs/stylesheets/decidim/_accordion.scss +2 -2
- data/app/packs/stylesheets/decidim/_cards.scss +2 -2
- data/app/packs/stylesheets/decidim/_dropdown.scss +9 -9
- data/app/packs/stylesheets/decidim/_forms.scss +4 -4
- data/app/packs/stylesheets/decidim/_layout.scss +3 -3
- data/app/packs/stylesheets/decidim/_modal_update.scss +1 -3
- data/app/packs/stylesheets/decidim/_tooltip.scss +10 -10
- data/app/packs/stylesheets/decidim/editor.scss +1 -1
- data/app/presenters/decidim/admin_log/organization_presenter.rb +1 -1
- data/app/presenters/decidim/log/resource_presenter.rb +7 -1
- data/app/services/decidim/download_your_data_exporter.rb +36 -25
- data/app/services/decidim/log/diff_changeset_calculator.rb +1 -1
- data/app/services/decidim/open_data_exporter.rb +8 -7
- data/app/views/decidim/account/show.html.erb +2 -2
- data/app/views/decidim/application/_document.html.erb +2 -2
- data/app/views/decidim/endorsements/update_buttons_and_counters.js.erb +2 -1
- data/app/views/decidim/gamification/badges/index.html.erb +34 -33
- data/app/views/decidim/links/_modal.html.erb +1 -1
- data/app/views/decidim/links/new.html.erb +3 -1
- data/app/views/decidim/manifests/show.json.erb +5 -5
- data/app/views/decidim/messaging/conversations/create.js.erb +1 -1
- data/app/views/decidim/notifications_settings/show.html.erb +6 -6
- data/app/views/decidim/pages/_tabbed.html.erb +2 -2
- data/app/views/decidim/searches/_filters.html.erb +2 -2
- data/app/views/decidim/shared/_filters.html.erb +2 -2
- data/app/views/decidim/shared/_orders.html.erb +2 -2
- data/app/views/decidim/shared/filters/_collection.html.erb +5 -3
- data/app/views/decidim/shared/filters/_dropdown_label.html.erb +21 -19
- data/app/views/layouts/decidim/_logo.html.erb +1 -1
- data/app/views/layouts/decidim/_wrapper.html.erb +1 -1
- data/app/views/layouts/decidim/footer/_main_intro.html.erb +1 -1
- data/app/views/layouts/decidim/footer/_main_links.html.erb +3 -1
- data/app/views/layouts/decidim/header/_main_links_desktop.html.erb +5 -3
- data/app/views/layouts/decidim/header/_main_links_mobile_account.html.erb +1 -1
- data/app/views/layouts/decidim/header/_menu_breadcrumb_items.html.erb +2 -0
- data/app/views/layouts/decidim/shared/_layout_user_profile.html.erb +2 -2
- data/config/locales/ar.yml +1 -5
- data/config/locales/bg.yml +878 -1
- data/config/locales/ca.yml +5 -3
- data/config/locales/cs.yml +3 -1
- data/config/locales/de.yml +3 -1
- data/config/locales/el.yml +8 -1
- data/config/locales/en.yml +3 -1
- data/config/locales/es-MX.yml +8 -6
- data/config/locales/es-PY.yml +8 -6
- data/config/locales/es.yml +32 -30
- data/config/locales/eu.yml +4 -2
- data/config/locales/fi-plain.yml +6 -4
- data/config/locales/fi.yml +32 -30
- data/config/locales/fr-CA.yml +2 -0
- data/config/locales/fr.yml +2 -0
- data/config/locales/ga-IE.yml +8 -0
- data/config/locales/gl.yml +1 -0
- data/config/locales/hu.yml +1 -2
- data/config/locales/is-IS.yml +3 -0
- data/config/locales/it.yml +7 -1
- data/config/locales/ja.yml +3 -1
- data/config/locales/kaa.yml +5 -0
- data/config/locales/lb.yml +7 -1
- data/config/locales/lt.yml +8 -2
- data/config/locales/lv.yml +8 -1
- data/config/locales/nl.yml +7 -1
- data/config/locales/no.yml +7 -1
- data/config/locales/pl.yml +35 -0
- data/config/locales/pt-BR.yml +0 -1
- data/config/locales/pt.yml +7 -1
- data/config/locales/ro-RO.yml +8 -0
- data/config/locales/ru.yml +8 -0
- data/config/locales/sk.yml +8 -1
- data/config/locales/sl.yml +8 -0
- data/config/locales/sv.yml +132 -88
- data/config/locales/tr-TR.yml +21 -4
- data/config/locales/uk.yml +10 -0
- data/config/locales/zh-CN.yml +0 -1
- data/config/locales/zh-TW.yml +8 -1
- data/db/migrate/20181025082245_add_timestamps_to_components.rb +5 -1
- data/decidim-core.gemspec +0 -1
- data/lib/decidim/asset_router/storage.rb +214 -11
- data/lib/decidim/core/engine.rb +8 -0
- data/lib/decidim/core/seeds.rb +1 -1
- data/lib/decidim/core/test/shared_examples/attachable_interface_examples.rb +1 -1
- data/lib/decidim/core/test/shared_examples/comments_examples.rb +76 -6
- data/lib/decidim/core/test/shared_examples/follows_examples.rb +8 -3
- data/lib/decidim/core/test/shared_examples/logo_email.rb +2 -2
- data/lib/decidim/core/test/shared_examples/paginated_resource_examples.rb +5 -5
- data/lib/decidim/core/version.rb +1 -1
- data/lib/decidim/core.rb +6 -1
- data/lib/decidim/events/base_event.rb +4 -0
- data/lib/decidim/organization_settings.rb +10 -2
- data/lib/decidim/seven_zip_wrapper.rb +29 -0
- data/lib/tasks/upgrade/decidim_fix_categorization.rake +101 -1
- metadata +13 -25
- data/app/services/decidim/zip_stream/writer.rb +0 -39
@@ -54,7 +54,7 @@ shared_examples "comments" do
|
|
54
54
|
expect(page).to have_css(".comment", minimum: 1)
|
55
55
|
|
56
56
|
within("#accordion-#{single_comment.id}") do
|
57
|
-
expect(page).to have_content "Hide
|
57
|
+
expect(page).to have_content "Hide reply"
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
@@ -70,7 +70,7 @@ shared_examples "comments" do
|
|
70
70
|
expect(page).to have_css(".comment", minimum: 1)
|
71
71
|
|
72
72
|
within("#accordion-#{single_comment.id}") do
|
73
|
-
expect(page).not_to have_content "Hide
|
73
|
+
expect(page).not_to have_content "Hide reply"
|
74
74
|
end
|
75
75
|
end
|
76
76
|
end
|
@@ -117,7 +117,8 @@ shared_examples "comments" do
|
|
117
117
|
context "when not authenticated" do
|
118
118
|
it "does not show form to add comments to user" do
|
119
119
|
visit resource_path
|
120
|
-
expect(page).not_to
|
120
|
+
expect(page).not_to have_css(".add-comment form")
|
121
|
+
expect(page).to have_css(".comment-thread")
|
121
122
|
end
|
122
123
|
end
|
123
124
|
|
@@ -131,6 +132,32 @@ shared_examples "comments" do
|
|
131
132
|
expect(page).to have_selector(".add-comment form")
|
132
133
|
end
|
133
134
|
|
135
|
+
context "when user is not authorized to comment" do
|
136
|
+
let(:permissions) do
|
137
|
+
{
|
138
|
+
comment: {
|
139
|
+
authorization_handlers: {
|
140
|
+
"dummy_authorization_handler" => { "options" => {} }
|
141
|
+
}
|
142
|
+
}
|
143
|
+
}
|
144
|
+
end
|
145
|
+
|
146
|
+
before do
|
147
|
+
organization.available_authorizations = ["dummy_authorization_handler"]
|
148
|
+
organization.save!
|
149
|
+
commentable.create_resource_permission(permissions:)
|
150
|
+
allow(commentable).to receive(:user_allowed_to_comment?).with(user).and_return(false)
|
151
|
+
allow(commentable).to receive(:user_authorized_to_comment?).with(user).and_return(true)
|
152
|
+
end
|
153
|
+
|
154
|
+
it "shows a message indicating that comments are restricted" do
|
155
|
+
visit resource_path
|
156
|
+
expect(page).not_to have_content("Comments are disabled at this time")
|
157
|
+
expect(page).to have_content("You need to be verified to comment at this moment")
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
134
161
|
describe "when using emojis" do
|
135
162
|
before do
|
136
163
|
within_language_menu do
|
@@ -520,7 +547,7 @@ shared_examples "comments" do
|
|
520
547
|
it "displays the hide button" do
|
521
548
|
visit current_path
|
522
549
|
within "#comment_#{thread.id}" do
|
523
|
-
expect(page).to have_content("Hide
|
550
|
+
expect(page).to have_content("Hide reply")
|
524
551
|
expect(page).to have_content(new_reply_body)
|
525
552
|
end
|
526
553
|
end
|
@@ -528,7 +555,7 @@ shared_examples "comments" do
|
|
528
555
|
it "displays the show button" do
|
529
556
|
visit current_path
|
530
557
|
within "#comment_#{thread.id}" do
|
531
|
-
click_button "Hide
|
558
|
+
click_button "Hide reply"
|
532
559
|
expect(page).to have_content("Show reply")
|
533
560
|
expect(page).not_to have_content(new_reply_body)
|
534
561
|
end
|
@@ -540,7 +567,7 @@ shared_examples "comments" do
|
|
540
567
|
it "displays the show button" do
|
541
568
|
visit current_path
|
542
569
|
within "#comment_#{thread.id}" do
|
543
|
-
click_button "Hide replies"
|
570
|
+
click_button "Hide 3 replies"
|
544
571
|
expect(page).to have_content("Show 3 replies")
|
545
572
|
expect(page).not_to have_content(new_reply_body)
|
546
573
|
end
|
@@ -969,3 +996,46 @@ shared_examples "comments" do
|
|
969
996
|
end
|
970
997
|
end
|
971
998
|
end
|
999
|
+
|
1000
|
+
shared_examples "comments blocked" do
|
1001
|
+
context "when not authenticated" do
|
1002
|
+
context "when comments are blocked" do
|
1003
|
+
let(:active_step_id) { component.participatory_space.active_step.id }
|
1004
|
+
|
1005
|
+
before do
|
1006
|
+
component.update!(step_settings: { active_step_id => { comments_blocked: true } })
|
1007
|
+
end
|
1008
|
+
|
1009
|
+
it "shows a message indicating that comments are disabled" do
|
1010
|
+
visit resource_path
|
1011
|
+
expect(page).to have_content("Comments are disabled at this time")
|
1012
|
+
expect(page).not_to have_content("You need to be verified to comment at this moment")
|
1013
|
+
end
|
1014
|
+
end
|
1015
|
+
end
|
1016
|
+
|
1017
|
+
context "when authenticated" do
|
1018
|
+
let!(:organization) { create(:organization) }
|
1019
|
+
let!(:user) { create(:user, :confirmed, organization:) }
|
1020
|
+
let!(:comments) { create_list(:comment, 3, commentable:) }
|
1021
|
+
|
1022
|
+
before do
|
1023
|
+
login_as user, scope: :user
|
1024
|
+
visit resource_path
|
1025
|
+
end
|
1026
|
+
|
1027
|
+
context "when comments are blocked" do
|
1028
|
+
let(:active_step_id) { component.participatory_space.active_step.id }
|
1029
|
+
|
1030
|
+
before do
|
1031
|
+
component.update!(step_settings: { active_step_id => { comments_blocked: true } })
|
1032
|
+
end
|
1033
|
+
|
1034
|
+
it "shows a message indicating that comments are disabled" do
|
1035
|
+
visit resource_path
|
1036
|
+
expect(page).to have_content("Comments are disabled at this time")
|
1037
|
+
expect(page).not_to have_content("You need to be verified to comment at this moment")
|
1038
|
+
end
|
1039
|
+
end
|
1040
|
+
end
|
1041
|
+
end
|
@@ -1,7 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
# When using these shared examples, make sure there are no prior requests within
|
4
|
+
# the same group of examples where this is included. Otherwise you may end up
|
5
|
+
# in race conditions that cause these to fail as explained at:
|
6
|
+
# https://github.com/decidim/decidim/pull/6161
|
7
|
+
shared_examples "followable content for users" do
|
4
8
|
before do
|
9
|
+
switch_to_host(organization.host)
|
5
10
|
login_as user, scope: :user
|
6
11
|
end
|
7
12
|
|
@@ -34,9 +39,9 @@ shared_examples "follows" do
|
|
34
39
|
end
|
35
40
|
end
|
36
41
|
|
37
|
-
shared_examples "
|
42
|
+
shared_examples "followable content for users with a component" do
|
38
43
|
include_context "with a component"
|
39
|
-
include_examples "
|
44
|
+
include_examples "followable content for users"
|
40
45
|
|
41
46
|
context "when the user is following the followable's participatory space" do
|
42
47
|
before do
|
@@ -5,7 +5,7 @@ require "spec_helper"
|
|
5
5
|
shared_examples "email with logo" do
|
6
6
|
context "when organization has a logo" do
|
7
7
|
let(:organization_logo) { Decidim::Dev.test_file("city.jpeg", "image/jpeg") }
|
8
|
-
let(:organization) { create(:organization, logo: organization_logo) }
|
8
|
+
let(:organization) { create(:organization, name: "O'Higgins", logo: organization_logo) }
|
9
9
|
let(:mail) { described_class.event_received(event, event_class_name, resource, user, :follower, extra) }
|
10
10
|
let(:logo_path) { Rails.application.routes.url_helpers.rails_representation_path(organization.logo.variant(resize_to_fit: [600, 160]), only_path: true) }
|
11
11
|
|
@@ -14,7 +14,7 @@ shared_examples "email with logo" do
|
|
14
14
|
end
|
15
15
|
|
16
16
|
it "includes organization logo with full link" do
|
17
|
-
expect(mail.body).to include("alt=\"#{organization.name}\"")
|
17
|
+
expect(mail.body).to include("alt=\"#{decidim_escape_translated(organization.name)}\"")
|
18
18
|
expect(mail.body).to match(%r{https{0,1}://#{organization.host}:#{Capybara.server_port}#{logo_path}})
|
19
19
|
end
|
20
20
|
end
|
@@ -1,22 +1,22 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
shared_examples "a paginated resource" do
|
4
|
-
let(:collection_size) {
|
4
|
+
let(:collection_size) { 50 }
|
5
5
|
|
6
6
|
before do
|
7
7
|
visit_component
|
8
8
|
end
|
9
9
|
|
10
|
-
it "lists
|
11
|
-
expect(page).to have_css(resource_selector, count:
|
12
|
-
expect(page).to have_css("[data-pages] [data-page]", count:
|
10
|
+
it "lists 25 resources per page by default" do
|
11
|
+
expect(page).to have_css(resource_selector, count: 25)
|
12
|
+
expect(page).to have_css("[data-pages] [data-page]", count: 2)
|
13
13
|
end
|
14
14
|
|
15
15
|
it "results per page can be changed from the selector" do
|
16
16
|
expect(page).to have_css("[data-pagination]")
|
17
17
|
|
18
18
|
within "[data-pagination]" do
|
19
|
-
page.find("summary", text: "
|
19
|
+
page.find("summary", text: "25").click
|
20
20
|
click_link "50"
|
21
21
|
end
|
22
22
|
|
data/lib/decidim/core/version.rb
CHANGED
data/lib/decidim/core.rb
CHANGED
@@ -191,8 +191,13 @@ module Decidim
|
|
191
191
|
resource_type.constantize.find_each do |resource|
|
192
192
|
# exclude the users that already endorsed
|
193
193
|
users = resource.endorsements.map(&:author)
|
194
|
-
|
194
|
+
remaining_count = Decidim::User.count - users.count
|
195
|
+
next if remaining_count < 1
|
196
|
+
|
197
|
+
rand([50, remaining_count].min).times do
|
195
198
|
user = (Decidim::User.all - users).sample
|
199
|
+
next unless user
|
200
|
+
|
196
201
|
Decidim::Endorsement.create!(resource:, author: user)
|
197
202
|
users << user
|
198
203
|
end
|
@@ -129,12 +129,20 @@ module Decidim
|
|
129
129
|
)
|
130
130
|
},
|
131
131
|
"maximum_file_size" => {
|
132
|
-
"default" =>
|
133
|
-
"avatar" =>
|
132
|
+
"default" => default_maximum_attachment_size,
|
133
|
+
"avatar" => default_maximum_avatar_size
|
134
134
|
}
|
135
135
|
}
|
136
136
|
}
|
137
137
|
end
|
138
|
+
|
139
|
+
def default_maximum_attachment_size
|
140
|
+
(Rails.application.secrets.decidim[:maximum_attachment_size].presence || 10).to_f
|
141
|
+
end
|
142
|
+
|
143
|
+
def default_maximum_avatar_size
|
144
|
+
(Rails.application.secrets.decidim[:maximum_avatar_size].presence || 5).to_f
|
145
|
+
end
|
138
146
|
end
|
139
147
|
|
140
148
|
def initialize(organization)
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "shellwords"
|
4
|
+
|
5
|
+
module Decidim
|
6
|
+
class SevenZipWrapper
|
7
|
+
class << self
|
8
|
+
def compress_and_encrypt(filename:, password:, input_directory:)
|
9
|
+
run("cd #{escape(input_directory)} && 7z a -tzip -p#{escape(password)} -mem=AES256 #{escape(filename)} .")
|
10
|
+
end
|
11
|
+
|
12
|
+
def extract_and_decrypt(filename:, password:, output_directory:)
|
13
|
+
run("7z x -tzip #{escape(filename)} -o#{escape(output_directory)} -p#{escape(password)}")
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def run(command)
|
19
|
+
success = system(command)
|
20
|
+
|
21
|
+
raise "Command failed: #{command}" unless success
|
22
|
+
end
|
23
|
+
|
24
|
+
def escape(string)
|
25
|
+
Shellwords.escape(string)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -2,7 +2,107 @@
|
|
2
2
|
|
3
3
|
namespace :decidim do
|
4
4
|
namespace :upgrade do
|
5
|
-
|
5
|
+
namespace :clean do
|
6
|
+
desc "Removes all the invalid records from search, notifications, follows and action_logs"
|
7
|
+
task invalid_records: [
|
8
|
+
:"decidim:upgrade:clean:searchable_resources",
|
9
|
+
:"decidim:upgrade:clean:notifications",
|
10
|
+
:"decidim:upgrade:clean:follows",
|
11
|
+
:"decidim:upgrade:clean:action_logs"
|
12
|
+
]
|
13
|
+
|
14
|
+
desc "Removes any action logs belonging to invalid resources"
|
15
|
+
task :action_logs, [] => :environment do
|
16
|
+
puts "=== Deleting Action logs\n"
|
17
|
+
invalid = 0
|
18
|
+
Decidim::ActionLog.find_each do |log|
|
19
|
+
log.participatory_space if log.participatory_space_type.present?
|
20
|
+
log.resource if log.resource_type.present?
|
21
|
+
|
22
|
+
if log.resource_type == "Decidim::Component" && log.resource.blank?
|
23
|
+
log.delete
|
24
|
+
invalid += 1
|
25
|
+
end
|
26
|
+
|
27
|
+
next if log.decidim_component_id.blank?
|
28
|
+
next if log.component.present?
|
29
|
+
|
30
|
+
log.delete
|
31
|
+
invalid += 1
|
32
|
+
rescue NameError
|
33
|
+
log.delete
|
34
|
+
invalid += 1
|
35
|
+
end
|
36
|
+
puts "===== Deleted #{invalid} invalid action logs\n"
|
37
|
+
end
|
38
|
+
|
39
|
+
desc "Removes any follows belonging to invalid resources"
|
40
|
+
task :follows, [] => :environment do
|
41
|
+
puts "=== Deleting Follows\n"
|
42
|
+
invalid = 0
|
43
|
+
Decidim::Follow.find_each do |follow|
|
44
|
+
follow.followable
|
45
|
+
|
46
|
+
next unless follow.followable.respond_to?(:component)
|
47
|
+
next if follow.followable.component.present?
|
48
|
+
|
49
|
+
# We attempt to remove any of the follows that refer to spaces or components that disappeared
|
50
|
+
follow.destroy
|
51
|
+
invalid += 1
|
52
|
+
rescue NameError
|
53
|
+
# We use delete as we do not want to call the hooks
|
54
|
+
follow.delete
|
55
|
+
invalid += 1
|
56
|
+
end
|
57
|
+
puts "===== Deleted #{invalid} invalid follows\n"
|
58
|
+
end
|
59
|
+
|
60
|
+
desc "Removes any notifications belonging to invalid resources"
|
61
|
+
task :notifications, [] => :environment do
|
62
|
+
puts "=== Deleting Notification\n"
|
63
|
+
invalid = 0
|
64
|
+
Decidim::Notification.find_each do |notification|
|
65
|
+
# Check if the resource class still exists
|
66
|
+
notification.resource
|
67
|
+
# Check if the event class still exists
|
68
|
+
notification.event_class_instance
|
69
|
+
rescue NameError
|
70
|
+
notification.destroy
|
71
|
+
invalid += 1
|
72
|
+
end
|
73
|
+
puts "===== Deleted #{invalid} invalid notifications\n"
|
74
|
+
end
|
75
|
+
|
76
|
+
desc "Removes any resources from search index that do not exist"
|
77
|
+
task :searchable_resources, [] => :environment do
|
78
|
+
puts "=== Deleting Searchable results\n"
|
79
|
+
puts "==== Deleting invalid spaces \n"
|
80
|
+
invalid = 0
|
81
|
+
Decidim::SearchableResource.where.not(decidim_participatory_space_type: nil).find_each do |search|
|
82
|
+
search.decidim_participatory_space
|
83
|
+
rescue NameError
|
84
|
+
search.destroy!
|
85
|
+
invalid += 1
|
86
|
+
end
|
87
|
+
puts "===== Deleted #{invalid} invalid spaces\n"
|
88
|
+
|
89
|
+
puts "==== Deleting invalid resources from search index \n"
|
90
|
+
invalid = 0
|
91
|
+
Decidim::SearchableResource.find_each do |search|
|
92
|
+
next unless search.resource.respond_to?(:component)
|
93
|
+
next if search.resource.component.present?
|
94
|
+
|
95
|
+
search.destroy
|
96
|
+
invalid += 1
|
97
|
+
rescue NameError
|
98
|
+
search.destroy!
|
99
|
+
invalid += 1
|
100
|
+
end
|
101
|
+
puts "===== Deleted #{invalid} invalid resources\n"
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
desc "Removes orphan categorizations"
|
6
106
|
task fix_orphan_categorizations: :environment do
|
7
107
|
logger = Logger.new($stdout)
|
8
108
|
logger.info("Removing orphan categorizations...")
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decidim-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.28.
|
4
|
+
version: 0.28.3
|
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-09-10 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: active_link_to
|
@@ -688,20 +688,6 @@ dependencies:
|
|
688
688
|
- - "~>"
|
689
689
|
- !ruby/object:Gem::Version
|
690
690
|
version: '2.0'
|
691
|
-
- !ruby/object:Gem::Dependency
|
692
|
-
name: seven_zip_ruby
|
693
|
-
requirement: !ruby/object:Gem::Requirement
|
694
|
-
requirements:
|
695
|
-
- - "~>"
|
696
|
-
- !ruby/object:Gem::Version
|
697
|
-
version: '1.3'
|
698
|
-
type: :runtime
|
699
|
-
prerelease: false
|
700
|
-
version_requirements: !ruby/object:Gem::Requirement
|
701
|
-
requirements:
|
702
|
-
- - "~>"
|
703
|
-
- !ruby/object:Gem::Version
|
704
|
-
version: '1.3'
|
705
691
|
- !ruby/object:Gem::Dependency
|
706
692
|
name: shakapacker
|
707
693
|
requirement: !ruby/object:Gem::Requirement
|
@@ -764,28 +750,28 @@ dependencies:
|
|
764
750
|
requirements:
|
765
751
|
- - '='
|
766
752
|
- !ruby/object:Gem::Version
|
767
|
-
version: 0.28.
|
753
|
+
version: 0.28.3
|
768
754
|
type: :development
|
769
755
|
prerelease: false
|
770
756
|
version_requirements: !ruby/object:Gem::Requirement
|
771
757
|
requirements:
|
772
758
|
- - '='
|
773
759
|
- !ruby/object:Gem::Version
|
774
|
-
version: 0.28.
|
760
|
+
version: 0.28.3
|
775
761
|
- !ruby/object:Gem::Dependency
|
776
762
|
name: decidim-dev
|
777
763
|
requirement: !ruby/object:Gem::Requirement
|
778
764
|
requirements:
|
779
765
|
- - '='
|
780
766
|
- !ruby/object:Gem::Version
|
781
|
-
version: 0.28.
|
767
|
+
version: 0.28.3
|
782
768
|
type: :development
|
783
769
|
prerelease: false
|
784
770
|
version_requirements: !ruby/object:Gem::Requirement
|
785
771
|
requirements:
|
786
772
|
- - '='
|
787
773
|
- !ruby/object:Gem::Version
|
788
|
-
version: 0.28.
|
774
|
+
version: 0.28.3
|
789
775
|
description: Adds core features so other engines can hook into the framework.
|
790
776
|
email:
|
791
777
|
- josepjaume@gmail.com
|
@@ -1023,6 +1009,7 @@ files:
|
|
1023
1009
|
- app/cells/decidim/newsletter_templates/image_text_cta_cell.rb
|
1024
1010
|
- app/cells/decidim/newsletter_templates/image_text_cta_settings_form/show.erb
|
1025
1011
|
- app/cells/decidim/newsletter_templates/image_text_cta_settings_form_cell.rb
|
1012
|
+
- app/cells/decidim/notification/moderated.erb
|
1026
1013
|
- app/cells/decidim/notification/show.erb
|
1027
1014
|
- app/cells/decidim/notification_cell.rb
|
1028
1015
|
- app/cells/decidim/notifications/show.erb
|
@@ -1538,6 +1525,7 @@ files:
|
|
1538
1525
|
- app/packs/images/decidim/vendor/social-share-button/x.svg
|
1539
1526
|
- app/packs/images/decidim/vendor/social-share-button/xing.svg
|
1540
1527
|
- app/packs/src/decidim/a11y.js
|
1528
|
+
- app/packs/src/decidim/abide_form_validator_fixer.js
|
1541
1529
|
- app/packs/src/decidim/account_form.js
|
1542
1530
|
- app/packs/src/decidim/append_elements.js
|
1543
1531
|
- app/packs/src/decidim/append_redirect_url_to_modals.js
|
@@ -1878,7 +1866,6 @@ files:
|
|
1878
1866
|
- app/services/decidim/static_map_generator.rb
|
1879
1867
|
- app/services/decidim/tokenizer.rb
|
1880
1868
|
- app/services/decidim/traceability.rb
|
1881
|
-
- app/services/decidim/zip_stream/writer.rb
|
1882
1869
|
- app/uploaders/decidim/application_uploader.rb
|
1883
1870
|
- app/uploaders/decidim/attachment_uploader.rb
|
1884
1871
|
- app/uploaders/decidim/avatar_uploader.rb
|
@@ -2812,6 +2799,7 @@ files:
|
|
2812
2799
|
- lib/decidim/searchable.rb
|
2813
2800
|
- lib/decidim/seeds.rb
|
2814
2801
|
- lib/decidim/settings_manifest.rb
|
2802
|
+
- lib/decidim/seven_zip_wrapper.rb
|
2815
2803
|
- lib/decidim/shareable_with_token.rb
|
2816
2804
|
- lib/decidim/snippets.rb
|
2817
2805
|
- lib/decidim/social_share_service_manifest.rb
|
@@ -2868,7 +2856,7 @@ metadata:
|
|
2868
2856
|
funding_uri: https://opencollective.com/decidim
|
2869
2857
|
homepage_uri: https://decidim.org
|
2870
2858
|
source_code_uri: https://github.com/decidim/decidim
|
2871
|
-
post_install_message:
|
2859
|
+
post_install_message:
|
2872
2860
|
rdoc_options: []
|
2873
2861
|
require_paths:
|
2874
2862
|
- lib
|
@@ -2883,8 +2871,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
2883
2871
|
- !ruby/object:Gem::Version
|
2884
2872
|
version: '0'
|
2885
2873
|
requirements: []
|
2886
|
-
rubygems_version: 3.
|
2887
|
-
signing_key:
|
2874
|
+
rubygems_version: 3.3.7
|
2875
|
+
signing_key:
|
2888
2876
|
specification_version: 4
|
2889
2877
|
summary: The core of the Decidim framework.
|
2890
2878
|
test_files: []
|
@@ -1,39 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Decidim
|
4
|
-
module ZipStream
|
5
|
-
module Writer
|
6
|
-
def add_user_data_to_zip_stream(out, user_data)
|
7
|
-
user_data.each do |element|
|
8
|
-
filename_file = element.last.filename(element.first.parameterize)
|
9
|
-
|
10
|
-
out.put_next_entry(filename_file)
|
11
|
-
if element.last.read.presence
|
12
|
-
out.write element.last.read
|
13
|
-
else
|
14
|
-
out.write "No data"
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
def add_attachments_to_zip_stream(out, export_attachments)
|
20
|
-
export_attachments.each do |attachment_block|
|
21
|
-
next if attachment_block.last.nil?
|
22
|
-
|
23
|
-
folder_name = attachment_block.first.parameterize
|
24
|
-
attachment_block.last.each do |attachment|
|
25
|
-
next unless attachment.attached?
|
26
|
-
|
27
|
-
blobs = attachment.is_a?(ActiveStorage::Attached::One) ? [attachment.blob] : attachment.blobs
|
28
|
-
blobs.each do |blob|
|
29
|
-
out.put_next_entry("#{folder_name}/#{blob.filename}")
|
30
|
-
blob.open do |f|
|
31
|
-
out << f.read
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|