decidim-core 0.28.4 → 0.28.5
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/activity_cell.rb +1 -4
- data/app/cells/decidim/author/show.erb +5 -4
- data/app/cells/decidim/author_cell.rb +26 -0
- data/app/cells/decidim/card_s/show.erb +5 -3
- data/app/cells/decidim/diff_cell.rb +4 -0
- data/app/cells/decidim/newsletter_templates/image_text_cta_cell.rb +1 -1
- data/app/cells/decidim/translation_bar/show.erb +3 -3
- data/app/cells/decidim/translation_bar_cell.rb +1 -1
- data/app/commands/decidim/destroy_account.rb +3 -0
- data/app/controllers/decidim/doorkeeper/credentials_controller.rb +1 -1
- data/app/controllers/decidim/links_controller.rb +1 -1
- data/app/controllers/decidim/profiles_controller.rb +4 -0
- data/app/helpers/concerns/decidim/user_role_checker.rb +46 -0
- data/app/helpers/decidim/cta_button_helper.rb +1 -1
- data/app/helpers/decidim/map_helper.rb +6 -1
- data/app/helpers/decidim/sanitize_helper.rb +11 -2
- data/app/models/decidim/attachment.rb +1 -1
- data/app/packs/src/decidim/append_redirect_url_to_modals.js +14 -6
- data/app/packs/src/decidim/direct_uploads/upload_field.js +21 -8
- data/app/packs/src/decidim/index.js +3 -0
- data/app/packs/src/decidim/remote_tooltips.js +38 -0
- data/app/packs/src/decidim/toggle.js +1 -1
- data/app/packs/src/decidim/tooltips.js +42 -22
- data/app/packs/stylesheets/decidim/_profile.scss +1 -1
- data/app/packs/stylesheets/decidim/_progress-bar.scss +1 -1
- data/app/packs/stylesheets/decidim/legacy/conference-diploma.scss +2 -1
- data/app/presenters/decidim/attachment_presenter.rb +1 -1
- data/app/services/decidim/base_diff_renderer.rb +26 -2
- data/app/services/decidim/email_notification_generator.rb +14 -5
- data/app/views/decidim/pages/_tabbed.html.erb +2 -2
- data/app/views/layouts/decidim/header/_menu_breadcrumb_mobile_tablet.html.erb +1 -1
- data/config/locales/ar.yml +12 -0
- data/config/locales/bn-BD.yml +1 -0
- data/config/locales/bs-BA.yml +98 -0
- data/config/locales/ca.yml +13 -9
- data/config/locales/cs.yml +5 -0
- data/config/locales/de.yml +16 -12
- data/config/locales/el.yml +3 -0
- data/config/locales/en.yml +4 -0
- data/config/locales/es-MX.yml +5 -1
- data/config/locales/es-PY.yml +5 -1
- data/config/locales/es.yml +11 -7
- data/config/locales/eu.yml +198 -181
- data/config/locales/fi-plain.yml +4 -0
- data/config/locales/fi.yml +39 -35
- data/config/locales/fr-CA.yml +5 -1
- data/config/locales/fr.yml +4 -0
- data/config/locales/ga-IE.yml +5 -0
- data/config/locales/gl.yml +4 -0
- data/config/locales/hu.yml +1 -1
- data/config/locales/id-ID.yml +4 -0
- data/config/locales/is-IS.yml +4 -1
- data/config/locales/it.yml +40 -0
- data/config/locales/ja.yml +15 -13
- data/config/locales/lb.yml +5 -0
- data/config/locales/lt.yml +1 -1
- data/config/locales/lv.yml +4 -0
- data/config/locales/nl.yml +6 -1
- data/config/locales/no.yml +5 -0
- data/config/locales/pl.yml +1 -1
- data/config/locales/pt-BR.yml +1 -1
- data/config/locales/pt.yml +11 -0
- data/config/locales/ro-RO.yml +243 -134
- data/config/locales/ru.yml +4 -0
- data/config/locales/sk.yml +5 -1
- data/config/locales/sv.yml +7 -7
- data/config/locales/tr-TR.yml +6 -1
- data/config/locales/uk.yml +4 -1
- data/config/locales/zh-CN.yml +5 -0
- data/config/locales/zh-TW.yml +4 -0
- data/config/routes.rb +1 -0
- data/decidim-core.gemspec +4 -1
- data/lib/decidim/api/functions/component_list.rb +1 -1
- data/lib/decidim/api/functions/participatory_space_finder_base.rb +11 -1
- data/lib/decidim/api/interfaces/participatory_space_interface.rb +1 -1
- data/lib/decidim/api/types/component_type.rb +7 -0
- data/lib/decidim/api/types/user_group_type.rb +4 -0
- data/lib/decidim/api/types/user_type.rb +4 -0
- data/lib/decidim/attributes/rich_text.rb +38 -0
- data/lib/decidim/attributes/time_with_zone.rb +11 -1
- data/lib/decidim/attributes.rb +2 -0
- data/lib/decidim/content_parsers/blob_parser.rb +93 -0
- data/lib/decidim/content_parsers.rb +1 -0
- data/lib/decidim/content_renderers/blob_renderer.rb +90 -0
- data/lib/decidim/content_renderers.rb +1 -0
- data/lib/decidim/core/engine.rb +29 -1
- data/lib/decidim/core/test/factories.rb +28 -0
- data/lib/decidim/core/test/shared_examples/authorable_interface_examples.rb +1 -1
- data/lib/decidim/core/test/shared_examples/comments_examples.rb +15 -2
- data/lib/decidim/core/version.rb +1 -1
- data/lib/decidim/diffy_extension.rb +18 -0
- data/lib/decidim/form_builder.rb +1 -1
- data/lib/decidim/map/autocomplete.rb +1 -0
- data/lib/decidim/participatory_space_user.rb +4 -0
- data/lib/decidim/query_extensions.rb +0 -26
- data/lib/decidim/settings_manifest.rb +2 -0
- data/lib/decidim/translatable_attributes.rb +6 -1
- data/lib/tasks/upgrade/decidim_fix_categorization.rake +34 -8
- metadata +28 -7
@@ -613,7 +613,7 @@ shared_examples "comments" do
|
|
613
613
|
end
|
614
614
|
|
615
615
|
context "when the user has verified organizations" do
|
616
|
-
let(:user_group) { create(:user_group, :verified) }
|
616
|
+
let(:user_group) { create(:user_group, :verified, organization:) }
|
617
617
|
let(:content) { "This is a new comment" }
|
618
618
|
|
619
619
|
before do
|
@@ -741,6 +741,20 @@ shared_examples "comments" do
|
|
741
741
|
expect(page).to have_content("Edited")
|
742
742
|
end
|
743
743
|
end
|
744
|
+
|
745
|
+
it "has only one edit modal" do
|
746
|
+
expect(page).to have_css("#editCommentModal#{comment.id}", visible: :hidden, count: 1)
|
747
|
+
3.times do |index|
|
748
|
+
sleep 2
|
749
|
+
within "#comment_#{comment.id}" do
|
750
|
+
page.find("[id^='dropdown-trigger']").click
|
751
|
+
click_on "Edit"
|
752
|
+
end
|
753
|
+
fill_in "edit_comment_#{comment.id}", with: " This comment has been edited #{1 + index} times"
|
754
|
+
click_on "Send"
|
755
|
+
end
|
756
|
+
expect(page).to have_css("#editCommentModal#{comment.id}", visible: :all, count: 1)
|
757
|
+
end
|
744
758
|
end
|
745
759
|
end
|
746
760
|
end
|
@@ -1025,7 +1039,6 @@ shared_examples "comments blocked" do
|
|
1025
1039
|
end
|
1026
1040
|
|
1027
1041
|
context "when authenticated" do
|
1028
|
-
let!(:organization) { create(:organization) }
|
1029
1042
|
let!(:user) { create(:user, :confirmed, organization:) }
|
1030
1043
|
let!(:comments) { create_list(:comment, 3, commentable:) }
|
1031
1044
|
|
data/lib/decidim/core/version.rb
CHANGED
@@ -13,6 +13,24 @@ module Decidim
|
|
13
13
|
str = wrap_lines(@diff.map { |line| wrap_line(line) })
|
14
14
|
ActionView::Base.new(ActionView::LookupContext.new(nil), {}, nil).sanitize(str, tags: TAGS)
|
15
15
|
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def wrap_line(line)
|
20
|
+
cleaned = clean_line(line)
|
21
|
+
case line
|
22
|
+
when /^(---|\+\+\+|\\\\)/
|
23
|
+
" <li class=\"diff-comment\"><div>#{line.chomp}</div></li>"
|
24
|
+
when /^\+/
|
25
|
+
" <li class=\"ins\"><ins>#{cleaned}</ins></li>"
|
26
|
+
when /^-/
|
27
|
+
" <li class=\"del\"><del>#{cleaned}</del></li>"
|
28
|
+
when /^ /
|
29
|
+
" <li class=\"unchanged\"><div>#{cleaned}</div></li>"
|
30
|
+
when /^@@/
|
31
|
+
" <li class=\"diff-block-info\"><div>#{line.chomp}</div></li>"
|
32
|
+
end
|
33
|
+
end
|
16
34
|
end
|
17
35
|
|
18
36
|
# Adding a new method to Diffy::Format so we can pass the
|
data/lib/decidim/form_builder.rb
CHANGED
@@ -390,7 +390,7 @@ module Decidim
|
|
390
390
|
# options - A Hash with options to build the field. See upload method for
|
391
391
|
# more detailed information.
|
392
392
|
def attachment(attribute, options = {})
|
393
|
-
object_attachment = object.attachment.present?
|
393
|
+
object_attachment = object.respond_to?(:attachment) && object.attachment.present?
|
394
394
|
record = object_attachment ? object.attachment : object
|
395
395
|
options = {
|
396
396
|
titled: options[:multiple],
|
@@ -10,22 +10,6 @@ module Decidim
|
|
10
10
|
#
|
11
11
|
# Returns nothing.
|
12
12
|
def self.included(type)
|
13
|
-
type.field :participatory_processes,
|
14
|
-
[Decidim::ParticipatoryProcesses::ParticipatoryProcessType],
|
15
|
-
null: true,
|
16
|
-
description: "Lists all participatory_processes" do
|
17
|
-
argument :filter, Decidim::ParticipatoryProcesses::ParticipatoryProcessInputFilter, "This argument lets you filter the results", required: false
|
18
|
-
argument :order, Decidim::ParticipatoryProcesses::ParticipatoryProcessInputSort, "This argument lets you order the results", required: false
|
19
|
-
end
|
20
|
-
|
21
|
-
type.field :participatory_process,
|
22
|
-
Decidim::ParticipatoryProcesses::ParticipatoryProcessType,
|
23
|
-
null: true,
|
24
|
-
description: "Finds a participatory_process" do
|
25
|
-
argument :id, GraphQL::Types::ID, "The ID of the participatory space", required: false
|
26
|
-
argument :slug, String, "The slug of the participatory process", required: false
|
27
|
-
end
|
28
|
-
|
29
13
|
type.field :component, Decidim::Core::ComponentInterface, null: true do
|
30
14
|
description "Lists the components this space contains."
|
31
15
|
argument :id, GraphQL::Types::ID, required: true, description: "The ID of the component to be found"
|
@@ -62,16 +46,6 @@ module Decidim
|
|
62
46
|
end
|
63
47
|
end
|
64
48
|
|
65
|
-
def participatory_processes(filter: {}, order: {})
|
66
|
-
manifest = Decidim.participatory_space_manifests.select { |m| m.name == :participatory_processes }.first
|
67
|
-
Decidim::Core::ParticipatorySpaceListBase.new(manifest:).call(object, { filter:, order: }, context)
|
68
|
-
end
|
69
|
-
|
70
|
-
def participatory_process(id: nil, slug: nil)
|
71
|
-
manifest = Decidim.participatory_space_manifests.select { |m| m.name == :participatory_processes }.first
|
72
|
-
Decidim::Core::ParticipatorySpaceFinderBase.new(manifest:).call(object, { id:, slug: }, context)
|
73
|
-
end
|
74
|
-
|
75
49
|
def component(id: {})
|
76
50
|
component = Decidim::Component.published.find_by(id:)
|
77
51
|
component&.organization == context[:current_organization] ? component : nil
|
@@ -34,6 +34,7 @@ module Decidim
|
|
34
34
|
# end
|
35
35
|
#
|
36
36
|
# Returns nothing.
|
37
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
37
38
|
def translatable_attribute(name, type, **options)
|
38
39
|
attribute(name, { String => Object }, default: {})
|
39
40
|
|
@@ -41,6 +42,8 @@ module Decidim
|
|
41
42
|
attribute_name = "#{name}_#{locale}".gsub("-", "__")
|
42
43
|
attribute attribute_name, type, **options
|
43
44
|
|
45
|
+
value_type = attribute_types[attribute_name.to_s]
|
46
|
+
|
44
47
|
define_method attribute_name do
|
45
48
|
field = public_send(name) || {}
|
46
49
|
value =
|
@@ -51,7 +54,6 @@ module Decidim
|
|
51
54
|
# changed and the old value is still stored against the record.
|
52
55
|
field
|
53
56
|
end
|
54
|
-
value_type = self.class.attribute_types[attribute_name.to_s]
|
55
57
|
value_type ? value_type.cast(value) : value
|
56
58
|
end
|
57
59
|
|
@@ -60,12 +62,15 @@ module Decidim
|
|
60
62
|
final = super(value)
|
61
63
|
return unless final # Do not set the `nil` values for the parent hash
|
62
64
|
|
65
|
+
final = value_type.serialize(final) if value_type
|
66
|
+
|
63
67
|
public_send("#{name}=", field.merge(locale => final))
|
64
68
|
end
|
65
69
|
|
66
70
|
yield(attribute_name, locale) if block_given?
|
67
71
|
end
|
68
72
|
end
|
73
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
69
74
|
|
70
75
|
def locales
|
71
76
|
Decidim.available_locales
|
@@ -8,9 +8,18 @@ namespace :decidim do
|
|
8
8
|
:"decidim:upgrade:clean:searchable_resources",
|
9
9
|
:"decidim:upgrade:clean:notifications",
|
10
10
|
:"decidim:upgrade:clean:follows",
|
11
|
-
:"decidim:upgrade:clean:action_logs"
|
11
|
+
:"decidim:upgrade:clean:action_logs",
|
12
|
+
:"decidim:upgrade:clean:clean_deleted_users",
|
13
|
+
:"decidim:upgrade:clean:fix_blocked_user_notification"
|
12
14
|
]
|
13
15
|
|
16
|
+
desc "Remove data from deleted users"
|
17
|
+
task clean_deleted_users: :environment do
|
18
|
+
logger = Logger.new($stdout)
|
19
|
+
logger.info("=== Removing extra data from deleted users")
|
20
|
+
Decidim::User.where.not(deleted_at: nil).update_all(personal_url: "", about: "", notifications_sending_frequency: "none") # rubocop:disable Rails/SkipsModelValidations
|
21
|
+
end
|
22
|
+
|
14
23
|
desc "Removes any action logs belonging to invalid resources"
|
15
24
|
task :action_logs, [] => :environment do
|
16
25
|
puts "=== Deleting Action logs\n"
|
@@ -100,15 +109,32 @@ namespace :decidim do
|
|
100
109
|
end
|
101
110
|
puts "===== Deleted #{invalid} invalid resources\n"
|
102
111
|
end
|
103
|
-
end
|
104
112
|
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
113
|
+
desc "Removes orphan categorizations"
|
114
|
+
task fix_orphan_categorizations: :environment do
|
115
|
+
logger = Logger.new($stdout)
|
116
|
+
logger.info("Removing orphan categorizations...")
|
117
|
+
|
118
|
+
Decidim::Categorization.find_each do |categorization|
|
119
|
+
categorization.destroy if categorization.categorizable.nil?
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
desc "Update all blocked users notifications_sending_frequency setting"
|
124
|
+
task fix_blocked_user_notification: :environment do
|
125
|
+
logger.info("=== Updating all blocked users notifications_sending_frequency ...")
|
126
|
+
blocked_users = 0
|
127
|
+
Decidim::User.blocked.where.not("notifications_sending_frequency = ?", "none").find_each do |blocked_user|
|
128
|
+
unless blocked_user.notifications_sending_frequency == "none"
|
129
|
+
blocked_user.update(notifications_sending_frequency: "none")
|
130
|
+
blocked_users += 1
|
131
|
+
end
|
132
|
+
end
|
133
|
+
logger.info("===== Updated #{blocked_users} blocked users")
|
134
|
+
end
|
109
135
|
|
110
|
-
|
111
|
-
|
136
|
+
def logger
|
137
|
+
@logger ||= Logger.new($stdout)
|
112
138
|
end
|
113
139
|
end
|
114
140
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josep Jaume Rey Peroy
|
@@ -10,8 +10,22 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2025-02-12 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: concurrent-ruby
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
requirements:
|
19
|
+
- - '='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 1.2.2
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
requirements:
|
26
|
+
- - '='
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
version: 1.2.2
|
15
29
|
- !ruby/object:Gem::Dependency
|
16
30
|
name: active_link_to
|
17
31
|
requirement: !ruby/object:Gem::Requirement
|
@@ -750,28 +764,28 @@ dependencies:
|
|
750
764
|
requirements:
|
751
765
|
- - '='
|
752
766
|
- !ruby/object:Gem::Version
|
753
|
-
version: 0.28.
|
767
|
+
version: 0.28.5
|
754
768
|
type: :development
|
755
769
|
prerelease: false
|
756
770
|
version_requirements: !ruby/object:Gem::Requirement
|
757
771
|
requirements:
|
758
772
|
- - '='
|
759
773
|
- !ruby/object:Gem::Version
|
760
|
-
version: 0.28.
|
774
|
+
version: 0.28.5
|
761
775
|
- !ruby/object:Gem::Dependency
|
762
776
|
name: decidim-dev
|
763
777
|
requirement: !ruby/object:Gem::Requirement
|
764
778
|
requirements:
|
765
779
|
- - '='
|
766
780
|
- !ruby/object:Gem::Version
|
767
|
-
version: 0.28.
|
781
|
+
version: 0.28.5
|
768
782
|
type: :development
|
769
783
|
prerelease: false
|
770
784
|
version_requirements: !ruby/object:Gem::Requirement
|
771
785
|
requirements:
|
772
786
|
- - '='
|
773
787
|
- !ruby/object:Gem::Version
|
774
|
-
version: 0.28.
|
788
|
+
version: 0.28.5
|
775
789
|
description: Adds core features so other engines can hook into the framework.
|
776
790
|
email:
|
777
791
|
- josepjaume@gmail.com
|
@@ -1300,6 +1314,7 @@ files:
|
|
1300
1314
|
- app/forms/decidim/user_interest_scope_form.rb
|
1301
1315
|
- app/forms/decidim/user_interests_form.rb
|
1302
1316
|
- app/helpers/concerns/decidim/flash_helper_extensions.rb
|
1317
|
+
- app/helpers/concerns/decidim/user_role_checker.rb
|
1303
1318
|
- app/helpers/decidim/account_helper.rb
|
1304
1319
|
- app/helpers/decidim/action_authorization_helper.rb
|
1305
1320
|
- app/helpers/decidim/amendments_helper.rb
|
@@ -1650,6 +1665,7 @@ files:
|
|
1650
1665
|
- app/packs/src/decidim/notifications.js
|
1651
1666
|
- app/packs/src/decidim/password_toggler.js
|
1652
1667
|
- app/packs/src/decidim/remote_modal.js
|
1668
|
+
- app/packs/src/decidim/remote_tooltips.js
|
1653
1669
|
- app/packs/src/decidim/responsive_horizontal_tabs.js
|
1654
1670
|
- app/packs/src/decidim/results_listing.js
|
1655
1671
|
- app/packs/src/decidim/scroll_to_last_child.js
|
@@ -2124,6 +2140,8 @@ files:
|
|
2124
2140
|
- config/locales/ar.yml
|
2125
2141
|
- config/locales/bg-BG.yml
|
2126
2142
|
- config/locales/bg.yml
|
2143
|
+
- config/locales/bn-BD.yml
|
2144
|
+
- config/locales/bs-BA.yml
|
2127
2145
|
- config/locales/ca.yml
|
2128
2146
|
- config/locales/cs-CZ.yml
|
2129
2147
|
- config/locales/cs.yml
|
@@ -2520,6 +2538,7 @@ files:
|
|
2520
2538
|
- lib/decidim/attributes/localized_date.rb
|
2521
2539
|
- lib/decidim/attributes/model.rb
|
2522
2540
|
- lib/decidim/attributes/object.rb
|
2541
|
+
- lib/decidim/attributes/rich_text.rb
|
2523
2542
|
- lib/decidim/attributes/symbol.rb
|
2524
2543
|
- lib/decidim/attributes/time_with_zone.rb
|
2525
2544
|
- lib/decidim/authorable.rb
|
@@ -2539,6 +2558,7 @@ files:
|
|
2539
2558
|
- lib/decidim/content_blocks/has_related_components.rb
|
2540
2559
|
- lib/decidim/content_parsers.rb
|
2541
2560
|
- lib/decidim/content_parsers/base_parser.rb
|
2561
|
+
- lib/decidim/content_parsers/blob_parser.rb
|
2542
2562
|
- lib/decidim/content_parsers/hashtag_parser.rb
|
2543
2563
|
- lib/decidim/content_parsers/inline_images_parser.rb
|
2544
2564
|
- lib/decidim/content_parsers/link_parser.rb
|
@@ -2550,6 +2570,7 @@ files:
|
|
2550
2570
|
- lib/decidim/content_processor.rb
|
2551
2571
|
- lib/decidim/content_renderers.rb
|
2552
2572
|
- lib/decidim/content_renderers/base_renderer.rb
|
2573
|
+
- lib/decidim/content_renderers/blob_renderer.rb
|
2553
2574
|
- lib/decidim/content_renderers/hashtag_renderer.rb
|
2554
2575
|
- lib/decidim/content_renderers/link_renderer.rb
|
2555
2576
|
- lib/decidim/content_renderers/resource_renderer.rb
|
@@ -2851,7 +2872,7 @@ files:
|
|
2851
2872
|
- lib/tasks/upgrade/decidim_user_moderation.rake
|
2852
2873
|
homepage: https://decidim.org
|
2853
2874
|
licenses:
|
2854
|
-
- AGPL-3.0
|
2875
|
+
- AGPL-3.0-or-later
|
2855
2876
|
metadata:
|
2856
2877
|
bug_tracker_uri: https://github.com/decidim/decidim/issues
|
2857
2878
|
documentation_uri: https://docs.decidim.org/
|