decidim-core 0.26.5 → 0.26.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/announcement_cell.rb +1 -1
  3. data/app/cells/decidim/content_blocks/cta_cell.rb +1 -1
  4. data/app/cells/decidim/content_blocks/hero/show.erb +1 -1
  5. data/app/cells/decidim/content_blocks/highlighted_content_banner/show.erb +1 -1
  6. data/app/cells/decidim/content_blocks/sub_hero_cell.rb +1 -1
  7. data/app/controllers/decidim/links_controller.rb +8 -11
  8. data/app/helpers/decidim/cells_helper.rb +1 -0
  9. data/app/helpers/decidim/external_domain_helper.rb +14 -3
  10. data/app/helpers/decidim/sanitize_helper.rb +15 -5
  11. data/app/models/decidim/scope_type.rb +28 -0
  12. data/app/packs/src/decidim/editor/clipboard_override.js +6 -2
  13. data/app/packs/src/decidim/editor.js +63 -33
  14. data/app/packs/stylesheets/decidim/_editor.scss +129 -0
  15. data/app/packs/stylesheets/decidim/extras/_quill.scss +0 -6
  16. data/app/packs/stylesheets/decidim/modules/_buttons.scss +10 -6
  17. data/app/packs/stylesheets/decidim/modules/_cards.scss +1 -1
  18. data/app/packs/stylesheets/decidim/modules/_comments.scss +24 -0
  19. data/app/packs/stylesheets/decidim/vizzs/_linechart.scss +2 -2
  20. data/app/packs/stylesheets/decidim/vizzs/_rowchart.scss +2 -2
  21. data/app/presenters/decidim/notification_presenter.rb +1 -1
  22. data/app/presenters/decidim/user_group_presenter.rb +1 -1
  23. data/app/presenters/decidim/user_presenter.rb +1 -1
  24. data/app/scrubbers/decidim/admin_input_scrubber.rb +27 -0
  25. data/app/scrubbers/decidim/user_input_scrubber.rb +32 -5
  26. data/app/services/decidim/traceability.rb +1 -0
  27. data/app/views/decidim/links/_invalid_url_modal.html.erb +17 -0
  28. data/app/views/decidim/links/_modal.html.erb +1 -1
  29. data/app/views/decidim/links/invalid_url.js.erb +24 -0
  30. data/app/views/decidim/links/new.html.erb +1 -1
  31. data/app/views/decidim/messaging/conversations/_conversation.html.erb +1 -5
  32. data/app/views/decidim/pages/_standalone.html.erb +1 -1
  33. data/app/views/decidim/pages/_tabbed.html.erb +1 -1
  34. data/config/locales/ar.yml +422 -7
  35. data/config/locales/bg.yml +1 -4
  36. data/config/locales/ca.yml +20 -18
  37. data/config/locales/cs.yml +21 -29
  38. data/config/locales/da.yml +3 -0
  39. data/config/locales/de.yml +4 -23
  40. data/config/locales/el.yml +2 -4
  41. data/config/locales/en.yml +15 -13
  42. data/config/locales/eo.yml +2 -1
  43. data/config/locales/es-MX.yml +19 -17
  44. data/config/locales/es-PY.yml +19 -17
  45. data/config/locales/es.yml +20 -18
  46. data/config/locales/et.yml +3 -0
  47. data/config/locales/eu.yml +87 -63
  48. data/config/locales/fa-IR.yml +1 -0
  49. data/config/locales/fi-plain.yml +0 -19
  50. data/config/locales/fi.yml +17 -15
  51. data/config/locales/fr-CA.yml +22 -17
  52. data/config/locales/fr.yml +20 -15
  53. data/config/locales/ga-IE.yml +1 -0
  54. data/config/locales/gl.yml +0 -22
  55. data/config/locales/gn-PY.yml +3 -0
  56. data/config/locales/hr.yml +3 -0
  57. data/config/locales/hu.yml +48 -24
  58. data/config/locales/id-ID.yml +2 -4
  59. data/config/locales/is-IS.yml +2 -1
  60. data/config/locales/it.yml +1 -11
  61. data/config/locales/ja.yml +9 -23
  62. data/config/locales/ka-GE.yml +3 -0
  63. data/config/locales/kaa.yml +1 -0
  64. data/config/locales/lb.yml +0 -4
  65. data/config/locales/lt.yml +0 -33
  66. data/config/locales/lv.yml +0 -3
  67. data/config/locales/nl.yml +1 -20
  68. data/config/locales/no.yml +1 -24
  69. data/config/locales/oc-FR.yml +2 -0
  70. data/config/locales/pl.yml +0 -33
  71. data/config/locales/pt-BR.yml +2 -6
  72. data/config/locales/pt.yml +0 -4
  73. data/config/locales/ro-RO.yml +5 -8
  74. data/config/locales/ru.yml +1 -3
  75. data/config/locales/sk.yml +3 -5
  76. data/config/locales/sl.yml +1 -0
  77. data/config/locales/sr-CS.yml +2 -0
  78. data/config/locales/sv.yml +1 -24
  79. data/config/locales/tr-TR.yml +3 -7
  80. data/config/locales/uk.yml +1 -3
  81. data/config/locales/zh-CN.yml +0 -4
  82. data/config/locales/zh-TW.yml +1712 -0
  83. data/lib/decidim/core/test/shared_examples/comments_examples.rb +36 -0
  84. data/lib/decidim/core/test/shared_examples/editor_shared_examples.rb +10 -0
  85. data/lib/decidim/core/test/shared_examples/rich_text_editor_examples.rb +7 -3
  86. data/lib/decidim/core/test.rb +1 -0
  87. data/lib/decidim/core/version.rb +1 -1
  88. data/lib/decidim/form_builder.rb +0 -1
  89. data/lib/decidim/publicable.rb +4 -0
  90. metadata +12 -6
@@ -213,6 +213,42 @@ shared_examples "comments" do
213
213
  )
214
214
  end
215
215
 
216
+ context "when user can hide replies on a thread" do
217
+ let(:thread) { comments.first }
218
+ let(:new_reply_body) { "Hey, I just jumped inside the thread!" }
219
+ let!(:new_reply) { create(:comment, commentable: thread, root_commentable: commentable, body: new_reply_body) }
220
+
221
+ it "displays the hide button" do
222
+ visit current_path
223
+ within "#comment_#{thread.id}" do
224
+ expect(page).to have_content("Hide replies")
225
+ expect(page).to have_content(new_reply_body)
226
+ end
227
+ end
228
+
229
+ it "displays the show button" do
230
+ visit current_path
231
+ within "#comment_#{thread.id}" do
232
+ click_button "Hide replies"
233
+ expect(page).to have_content("Show reply")
234
+ expect(page).not_to have_content(new_reply_body)
235
+ end
236
+ end
237
+
238
+ context "when are more replies" do
239
+ let!(:new_replies) { create_list(:comment, 2, commentable: thread, root_commentable: commentable, body: new_reply_body) }
240
+
241
+ it "displays the show button" do
242
+ visit current_path
243
+ within "#comment_#{thread.id}" do
244
+ click_button "Hide replies"
245
+ expect(page).to have_content("Show 3 replies")
246
+ expect(page).not_to have_content(new_reply_body)
247
+ end
248
+ end
249
+ end
250
+ end
251
+
216
252
  context "when inside a thread reply form" do
217
253
  let(:thread) { comments.first }
218
254
  let(:new_reply_body) { "Hey, I just jumped inside the thread!" }
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ shared_examples_for "has embedded video in description" do |description_attribute_name, count: 1|
4
+ let(description_attribute_name) { { en: %(Description <iframe class="ql-video" allowfullscreen="true" src="#{iframe_src}" frameborder="0"></iframe>) } }
5
+ let(:iframe_src) { "http://www.example.org" }
6
+
7
+ it "shows iframe" do
8
+ expect(page).to have_selector("iframe", count: count)
9
+ end
10
+ end
@@ -1,13 +1,17 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- shared_examples "having a rich text editor" do |css, toolbar|
4
- it "has a form with a rich text editor" do
5
- within "form.#{css}" do
3
+ shared_examples "having a rich text editor for field" do |selector, toolbar|
4
+ it "has a rich text editor" do
5
+ within selector do
6
6
  expect(page).to have_selector("div.editor-container[data-toolbar='#{toolbar}']", visible: :all)
7
7
  end
8
8
  end
9
9
  end
10
10
 
11
+ shared_examples "having a rich text editor" do |css, toolbar|
12
+ it_behaves_like "having a rich text editor for field", "form.#{css}", toolbar
13
+ end
14
+
11
15
  shared_context "with rich text editor content" do
12
16
  let(:content) { "<p>#{safe_tags}</p>#{script}" }
13
17
  let(:safe_tags) { em + u + strong }
@@ -4,6 +4,7 @@ require "decidim/core/test/shared_examples/acts_as_author_examples"
4
4
  require "decidim/core/test/shared_examples/admin_log_presenter_examples"
5
5
  require "decidim/core/test/shared_examples/authorable"
6
6
  require "decidim/core/test/shared_examples/coauthorable"
7
+ require "decidim/core/test/shared_examples/editor_shared_examples"
7
8
  require "decidim/core/test/shared_examples/endorsable"
8
9
  require "decidim/core/test/shared_examples/publicable"
9
10
  require "decidim/core/test/shared_examples/localised_email"
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds the decidim-core version.
5
5
  module Core
6
6
  def self.version
7
- "0.26.5"
7
+ "0.26.7"
8
8
  end
9
9
  end
10
10
  end
@@ -913,7 +913,6 @@ module Decidim
913
913
  return {} unless options[:editor_images]
914
914
 
915
915
  {
916
- editor_images: true,
917
916
  upload_images_path: Decidim::Core::Engine.routes.url_helpers.editor_images_path,
918
917
  drag_and_drop_help_text: I18n.t("drag_and_drop_help", scope: "decidim.editor_images")
919
918
  }
@@ -45,5 +45,9 @@ module Decidim
45
45
  def unpublish!
46
46
  update!(published_at: nil)
47
47
  end
48
+
49
+ def previously_published?
50
+ respond_to?(:versions) && versions.where(event: "update").where("object ->> 'published_at' IS NOT NULL").any?
51
+ end
48
52
  end
49
53
  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.26.5
4
+ version: 0.26.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josep Jaume Rey Peroy
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2023-02-13 00:00:00.000000000 Z
13
+ date: 2023-05-11 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: active_link_to
@@ -754,28 +754,28 @@ dependencies:
754
754
  requirements:
755
755
  - - '='
756
756
  - !ruby/object:Gem::Version
757
- version: 0.26.5
757
+ version: 0.26.7
758
758
  type: :runtime
759
759
  prerelease: false
760
760
  version_requirements: !ruby/object:Gem::Requirement
761
761
  requirements:
762
762
  - - '='
763
763
  - !ruby/object:Gem::Version
764
- version: 0.26.5
764
+ version: 0.26.7
765
765
  - !ruby/object:Gem::Dependency
766
766
  name: decidim-dev
767
767
  requirement: !ruby/object:Gem::Requirement
768
768
  requirements:
769
769
  - - '='
770
770
  - !ruby/object:Gem::Version
771
- version: 0.26.5
771
+ version: 0.26.7
772
772
  type: :development
773
773
  prerelease: false
774
774
  version_requirements: !ruby/object:Gem::Requirement
775
775
  requirements:
776
776
  - - '='
777
777
  - !ruby/object:Gem::Version
778
- version: 0.26.5
778
+ version: 0.26.7
779
779
  description: Adds core features so other engines can hook into the framework.
780
780
  email:
781
781
  - josepjaume@gmail.com
@@ -1679,6 +1679,7 @@ files:
1679
1679
  - app/queries/decidim/user_groups/member_memberships.rb
1680
1680
  - app/resolvers/decidim/core/metric_resolver.rb
1681
1681
  - app/resolvers/decidim/hashtags_resolver.rb
1682
+ - app/scrubbers/decidim/admin_input_scrubber.rb
1682
1683
  - app/scrubbers/decidim/newsletter_scrubber.rb
1683
1684
  - app/scrubbers/decidim/user_input_scrubber.rb
1684
1685
  - app/serializers/decidim/exporters/participatory_space_components_serializer.rb
@@ -1801,8 +1802,10 @@ files:
1801
1802
  - app/views/decidim/last_activities/_activities.html.erb
1802
1803
  - app/views/decidim/last_activities/index.html.erb
1803
1804
  - app/views/decidim/last_activities/index.js.erb
1805
+ - app/views/decidim/links/_invalid_url_modal.html.erb
1804
1806
  - app/views/decidim/links/_modal.html.erb
1805
1807
  - app/views/decidim/links/_warning.html.erb
1808
+ - app/views/decidim/links/invalid_url.js.erb
1806
1809
  - app/views/decidim/links/new.html.erb
1807
1810
  - app/views/decidim/links/new.js.erb
1808
1811
  - app/views/decidim/messaging/conversation_mailer/comanagers_new_conversation.html.erb
@@ -1967,6 +1970,7 @@ files:
1967
1970
  - config/locales/et-EE.yml
1968
1971
  - config/locales/et.yml
1969
1972
  - config/locales/eu.yml
1973
+ - config/locales/fa-IR.yml
1970
1974
  - config/locales/fi-pl.yml
1971
1975
  - config/locales/fi-plain.yml
1972
1976
  - config/locales/fi.yml
@@ -1985,6 +1989,7 @@ files:
1985
1989
  - config/locales/it.yml
1986
1990
  - config/locales/ja.yml
1987
1991
  - config/locales/ka-GE.yml
1992
+ - config/locales/kaa.yml
1988
1993
  - config/locales/ko-KR.yml
1989
1994
  - config/locales/ko.yml
1990
1995
  - config/locales/lb-LU.yml
@@ -2363,6 +2368,7 @@ files:
2363
2368
  - lib/decidim/core/test/shared_examples/conversations_examples.rb
2364
2369
  - lib/decidim/core/test/shared_examples/counts_commentators_as_newsletter_participants.rb
2365
2370
  - lib/decidim/core/test/shared_examples/edit_link_shared_examples.rb
2371
+ - lib/decidim/core/test/shared_examples/editor_shared_examples.rb
2366
2372
  - lib/decidim/core/test/shared_examples/embed_resource_examples.rb
2367
2373
  - lib/decidim/core/test/shared_examples/endorsable.rb
2368
2374
  - lib/decidim/core/test/shared_examples/endorsable_interface_examples.rb