From 355de8a9f2d87bec6551db241dd1e4935242a652 Mon Sep 17 00:00:00 2001 From: Alexandru Emil Lupu Date: Mon, 14 Oct 2024 09:16:24 +0300 Subject: [PATCH 1/6] Backport 'Fix translation bar css' to v0.28 (#13526) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ivan Vergés --- decidim-core/app/cells/decidim/translation_bar/show.erb | 6 +++--- decidim-core/app/cells/decidim/translation_bar_cell.rb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/decidim-core/app/cells/decidim/translation_bar/show.erb b/decidim-core/app/cells/decidim/translation_bar/show.erb index 52a2ae75e4206..715a9f9c4f9d2 100644 --- a/decidim-core/app/cells/decidim/translation_bar/show.erb +++ b/decidim-core/app/cells/decidim/translation_bar/show.erb @@ -1,6 +1,6 @@ -
-
+
+
<%= link %> - <%= help_text %> + <%= help_text %>
diff --git a/decidim-core/app/cells/decidim/translation_bar_cell.rb b/decidim-core/app/cells/decidim/translation_bar_cell.rb index cd4f1c6d0764f..5076768a40838 100644 --- a/decidim-core/app/cells/decidim/translation_bar_cell.rb +++ b/decidim-core/app/cells/decidim/translation_bar_cell.rb @@ -34,7 +34,7 @@ def link parsed_url.query = new_query url = parsed_url.to_s - link_to button_text, url, class: "button small hollow" + link_to button_text, url, class: "button button__sm button__transparent-secondary" end def button_text From cf5ef4114594002cd3815d0504f3d1e867a55e0b Mon Sep 17 00:00:00 2001 From: decidim-bot Date: Tue, 15 Oct 2024 22:05:56 +0200 Subject: [PATCH 2/6] Make the address card shown long locations with the time (#13540) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Andrés Pereira de Lucena --- .../app/packs/stylesheets/decidim/meetings/_item.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/decidim-meetings/app/packs/stylesheets/decidim/meetings/_item.scss b/decidim-meetings/app/packs/stylesheets/decidim/meetings/_item.scss index 99833b3ffbe35..04203bd2e5334 100644 --- a/decidim-meetings/app/packs/stylesheets/decidim/meetings/_item.scss +++ b/decidim-meetings/app/packs/stylesheets/decidim/meetings/_item.scss @@ -13,7 +13,7 @@ } &-container { - @apply grid grid-cols-[auto_1fr] md:grid-cols-[auto_1fr_1fr] items-center gap-0 md:gap-x-5 border-4 border-background rounded md:h-[140px] overflow-hidden; + @apply grid grid-cols-[auto_1fr] md:grid-cols-[auto_1fr_1fr] items-center gap-0 md:gap-x-5 border-4 border-background rounded overflow-hidden; > *:nth-child(2) { @apply p-4 md:p-0; @@ -28,7 +28,7 @@ } > *:nth-child(3) { - @apply order-1 md:order-2 h-[135px] md:h-full; + @apply order-1 md:order-2 h-[135px]; } } From ea1b37474ae926294b4a1b24898b8e83f819cac6 Mon Sep 17 00:00:00 2001 From: decidim-bot Date: Tue, 15 Oct 2024 22:06:07 +0200 Subject: [PATCH 3/6] Fix the missing meeting calendar in meetings' lists (#13542) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Andrés Pereira de Lucena --- .../cells/decidim/meetings/meeting_l_cell.rb | 5 ++ .../decidim/meetings/meeting_l_cell_spec.rb | 47 +++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 decidim-meetings/spec/cells/decidim/meetings/meeting_l_cell_spec.rb diff --git a/decidim-meetings/app/cells/decidim/meetings/meeting_l_cell.rb b/decidim-meetings/app/cells/decidim/meetings/meeting_l_cell.rb index 8b49c2f94066b..e083ea3923577 100644 --- a/decidim-meetings/app/cells/decidim/meetings/meeting_l_cell.rb +++ b/decidim-meetings/app/cells/decidim/meetings/meeting_l_cell.rb @@ -15,6 +15,11 @@ def extra_class "card__calendar-list__reset" end + # Renders the date in the meeting card list + def has_image? + true + end + def image render end diff --git a/decidim-meetings/spec/cells/decidim/meetings/meeting_l_cell_spec.rb b/decidim-meetings/spec/cells/decidim/meetings/meeting_l_cell_spec.rb new file mode 100644 index 0000000000000..d6f16ebcc1009 --- /dev/null +++ b/decidim-meetings/spec/cells/decidim/meetings/meeting_l_cell_spec.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +require "spec_helper" + +module Decidim::Meetings + describe MeetingLCell, type: :cell do + controller Decidim::Meetings::MeetingsController + include Decidim::SanitizeHelper + + subject { my_cell.call } + + let!(:meeting) { create(:meeting, :published, start_time: Time.new(2020, 10, 15, 10, 4, 5, 0)) } + let(:my_cell) { cell("decidim/meetings/meeting_l", meeting) } + + context "when rendering" do + it "renders the card" do + expect(subject).to have_css("#meetings__meeting_#{meeting.id}.card__calendar-list__reset") + end + + it "shows the start time's month" do + expect(subject).to have_css(".card__calendar-month", text: "Oct") + end + + it "shows the start time's day" do + expect(subject).to have_css(".card__calendar-day", text: "15") + end + + it "shows the start time's year" do + expect(subject).to have_css(".card__calendar-year", text: "2020") + end + end + + context "when title contains special html entities" do + let!(:original_title) { meeting.title["en"] } + + before do + meeting.update!(title: { en: "#{original_title} &'<" }) + meeting.reload + end + + it "escapes them correctly" do + title = decidim_html_escape(original_title).gsub(""", '"') + expect(subject.to_s).to include("<strong>#{title}</strong> &'<") + end + end + end +end From bd1fd87163d5e1b1e53ff2d93e93a694e9d13f00 Mon Sep 17 00:00:00 2001 From: decidim-bot Date: Tue, 15 Oct 2024 22:06:15 +0200 Subject: [PATCH 4/6] Fix editing the assembly content block "related assemblies" (#13544) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add layout helper for editing content block * Update decidim-assemblies/app/controllers/decidim/assemblies/admin/assembly_landing_page_content_blocks_controller.rb --------- Co-authored-by: Ivan Vergés Co-authored-by: Alexandru Emil Lupu --- ..._landing_page_content_blocks_controller.rb | 6 ++++ ...dmin_manages_assembly_landing_page_spec.rb | 34 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 decidim-assemblies/spec/system/admin/admin_manages_assembly_landing_page_spec.rb diff --git a/decidim-assemblies/app/controllers/decidim/assemblies/admin/assembly_landing_page_content_blocks_controller.rb b/decidim-assemblies/app/controllers/decidim/assemblies/admin/assembly_landing_page_content_blocks_controller.rb index b1bfe5717ab3a..f04b07eb97f19 100644 --- a/decidim-assemblies/app/controllers/decidim/assemblies/admin/assembly_landing_page_content_blocks_controller.rb +++ b/decidim-assemblies/app/controllers/decidim/assemblies/admin/assembly_landing_page_content_blocks_controller.rb @@ -10,6 +10,8 @@ class AssemblyLandingPageContentBlocksController < Decidim::Assemblies::Admin::A layout "decidim/admin/assemblies" + helper_method :parent_assembly + private def content_block_scope @@ -29,6 +31,10 @@ def edit_resource_landing_page_path def resource_landing_page_content_block_path assembly_landing_page_content_block_path(scoped_resource, params[:id]) end + + def parent_assembly + scoped_resource.parent + end end end end diff --git a/decidim-assemblies/spec/system/admin/admin_manages_assembly_landing_page_spec.rb b/decidim-assemblies/spec/system/admin/admin_manages_assembly_landing_page_spec.rb new file mode 100644 index 0000000000000..cd76485dd5eaa --- /dev/null +++ b/decidim-assemblies/spec/system/admin/admin_manages_assembly_landing_page_spec.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +require "spec_helper" + +describe "Admin manages assembly landing page" do + include_context "when admin administrating an assembly" + let!(:resource) { assembly } + let(:scope_name) { :assembly_homepage } + let(:edit_landing_page_path) { decidim_admin_assemblies.edit_assembly_landing_page_path(resource) } + + def edit_content_block_path(resource, content_block) + decidim_admin_assemblies.edit_assembly_landing_page_content_block_path(resource, content_block) + end + + before do + switch_to_host(organization.host) + login_as user, scope: :user + end + + context "when editing related assemblies" do + let!(:related_assemblies_content_block) { create(:content_block, organization:, scope_name: "assembly_homepage", manifest_name: "related_assemblies", scoped_resource_id: resource.id, settings: { "max_results" => "6" }) } + + it "updates the related assemblies content block" do + visit edit_content_block_path(resource, related_assemblies_content_block) + + expect(related_assemblies_content_block.settings["max_results"]).to eq(6) + select 12, from: :content_block_settings_max_results + click_on "Update" + + expect(page).to have_content("Related assemblies") + expect(related_assemblies_content_block.reload.settings["max_results"]).to eq(12) + end + end +end From 0bb43435a7d717aa68cab3f014b54a2f73930a7e Mon Sep 17 00:00:00 2001 From: Alexandru Emil Lupu Date: Thu, 17 Oct 2024 17:32:45 +0300 Subject: [PATCH 5/6] Backport 'Lock @tarekraafat/autocomplete.js version to 10.2.7' to v0.28 (#13557) * Fix @tarekraafat/autocomplete.jsversion upgrade * Lock @tarekraafat/autocomplete.js version to 10.2.7 * Trigger pipelines --- packages/core/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/package.json b/packages/core/package.json index ecdf8d7c2f661..0e07e4385caf2 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -12,7 +12,7 @@ "dependencies": { "@picmo/popup-picker": "^5.8.4", "@rails/activestorage": "^6.0.4", - "@tarekraafat/autocomplete.js": "^10.2.6", + "@tarekraafat/autocomplete.js": "10.2.7", "@tiptap/core": "2.1.13", "@tiptap/extension-blockquote": "2.1.13", "@tiptap/extension-bold": "2.1.13", From d85a29650d9c2f71a9dd49ac51dd0a1188457e1c Mon Sep 17 00:00:00 2001 From: decidim-bot Date: Fri, 18 Oct 2024 11:12:04 +0200 Subject: [PATCH 6/6] Fix redirect path after blocking an user (#13561) * Fix redirect path after blocking a user * Changed icons Co-authored-by: andra-panaite <135139066+andra-panaite@users.noreply.github.com> --- .../app/controllers/decidim/admin/block_user_controller.rb | 2 +- .../app/views/decidim/admin/moderated_users/index.html.erb | 4 ++-- decidim-admin/lib/decidim/admin/engine.rb | 1 + decidim-admin/spec/controllers/block_user_controller_spec.rb | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/decidim-admin/app/controllers/decidim/admin/block_user_controller.rb b/decidim-admin/app/controllers/decidim/admin/block_user_controller.rb index 205b3cdc83807..0ce59e8755dd1 100644 --- a/decidim-admin/app/controllers/decidim/admin/block_user_controller.rb +++ b/decidim-admin/app/controllers/decidim/admin/block_user_controller.rb @@ -22,7 +22,7 @@ def create BlockUser.call(@form) do on(:ok) do flash[:notice] = I18n.t("officializations.block.success", scope: "decidim.admin") - redirect_to moderated_users_path(blocked: true), notice: + redirect_to moderated_users_path, notice: end on(:invalid) do diff --git a/decidim-admin/app/views/decidim/admin/moderated_users/index.html.erb b/decidim-admin/app/views/decidim/admin/moderated_users/index.html.erb index bd777df1d2605..3f197003a9240 100644 --- a/decidim-admin/app/views/decidim/admin/moderated_users/index.html.erb +++ b/decidim-admin/app/views/decidim/admin/moderated_users/index.html.erb @@ -51,9 +51,9 @@ <% end %> <% if allowed_to?(:block, :moderate_users) %> <% if moderation.user.blocked? %> - <%= icon_link_to "forbid-2-line", user_block_path(user_id: moderation.user.id), t(".actions.unblock"), class: "action-icon action-icon--disabled", method: :delete %> + <%= icon_link_to "refresh-line", user_block_path(user_id: moderation.user.id), t(".actions.unblock"), class: "action-icon action-icon--disabled", method: :delete %> <% else %> - <%= icon_link_to "forbid-2-line", new_user_block_path(user_id: moderation.user.id), t(".actions.block"), class: "action-icon action-icon" %> + <%= icon_link_to "lock-2-line", new_user_block_path(user_id: moderation.user.id), t(".actions.block"), class: "action-icon action-icon" %> <% end %> <% end %> diff --git a/decidim-admin/lib/decidim/admin/engine.rb b/decidim-admin/lib/decidim/admin/engine.rb index bf2d427b75574..316e184a72bd7 100644 --- a/decidim-admin/lib/decidim/admin/engine.rb +++ b/decidim-admin/lib/decidim/admin/engine.rb @@ -26,6 +26,7 @@ class Engine < ::Rails::Engine end initializer "decidim_admin.register_icons" do |_app| + Decidim.icons.register(name: "lock-2-line", icon: "lock-2-line", category: "system", description: "Block user icon", engine: :admin) Decidim.icons.register(name: "layout-masonry-line", icon: "layout-masonry-line", category: "system", description: "", engine: :admin) Decidim.icons.register(name: "service-line", icon: "service-line", category: "system", description: "", engine: :admin) Decidim.icons.register(name: "fullscreen-line", icon: "fullscreen-line", category: "system", description: "", engine: :admin) diff --git a/decidim-admin/spec/controllers/block_user_controller_spec.rb b/decidim-admin/spec/controllers/block_user_controller_spec.rb index af1bd582d5e46..a99bc480980a8 100644 --- a/decidim-admin/spec/controllers/block_user_controller_spec.rb +++ b/decidim-admin/spec/controllers/block_user_controller_spec.rb @@ -75,6 +75,7 @@ module Admin expect(flash[:notice]).to be_present expect(user.reload.blocked?).to be(true) + expect(response).not_to redirect_to(moderated_users_path(blocked: true)) end end