diff --git a/decidim-admin/app/views/decidim/admin/organization/form/_colors.html.erb b/decidim-admin/app/views/decidim/admin/organization/form/_colors.html.erb index 5a6dd48c678f5..533f77625b705 100644 --- a/decidim-admin/app/views/decidim/admin/organization/form/_colors.html.erb +++ b/decidim-admin/app/views/decidim/admin/organization/form/_colors.html.erb @@ -48,7 +48,7 @@ - diff --git a/decidim-core/app/cells/decidim/user_activity_cell.rb b/decidim-core/app/cells/decidim/user_activity_cell.rb index 0ee51977d51a3..7f6d25f41f282 100644 --- a/decidim-core/app/cells/decidim/user_activity_cell.rb +++ b/decidim-core/app/cells/decidim/user_activity_cell.rb @@ -11,7 +11,12 @@ def show end def activities - context[:activities] + resource_ids_to_filter = context[:activities].select { |log| log[:action] == "delete" && log[:resource_type] == "Decidim::Comments::Comment" }.map(&:resource_id) + if resource_ids_to_filter.any? + context[:activities].where.not("resource_id in (?) AND resource_type = ?", resource_ids_to_filter, "Decidim::Comments::Comment") + else + context[:activities] + end end def resource_types diff --git a/decidim-core/app/packs/stylesheets/decidim/editor.scss b/decidim-core/app/packs/stylesheets/decidim/editor.scss index db9eab632c6c2..0dc7c4c8f24ea 100644 --- a/decidim-core/app/packs/stylesheets/decidim/editor.scss +++ b/decidim-core/app/packs/stylesheets/decidim/editor.scss @@ -84,7 +84,9 @@ } .ProseMirror { - @apply relative p-2.5 outline-0 min-h-full prose max-w-none prose-headings:first:mt-0 prose-p:first:mt-0 prose-ul:first:mt-0 prose-ol:first:mt-0 prose-blockquote:first:mt-0 prose-pre:first:mt-0; + @apply relative p-2.5 outline-0 resize-y overflow-hidden prose max-w-none prose-headings:first:mt-0 prose-p:first:mt-0 prose-ul:first:mt-0 prose-ol:first:mt-0 prose-blockquote:first:mt-0 prose-pre:first:mt-0; + + min-height: inherit; &.ProseMirror-focused, &.dialog-open { diff --git a/decidim-core/lib/decidim/form_builder.rb b/decidim-core/lib/decidim/form_builder.rb index 1b5a9acb6c5b7..43ce2905e5302 100644 --- a/decidim-core/lib/decidim/form_builder.rb +++ b/decidim-core/lib/decidim/form_builder.rb @@ -204,7 +204,7 @@ def editor(name, options = {}) disabled: options[:disabled], options: editor_options[:editor] } - ) { content_tag(:div, nil, class: "editor-input", style: "height: #{lines}rem") } + ) { content_tag(:div, nil, class: "editor-input", style: "min-height: #{lines}rem") } template += error_for(name, options) if error?(name) template += editor_upload(editor_image, editor_options[:upload]) template.html_safe diff --git a/decidim-core/spec/cells/decidim/user_activity_cell_spec.rb b/decidim-core/spec/cells/decidim/user_activity_cell_spec.rb index 57116de1cbcaa..40265cf18496b 100644 --- a/decidim-core/spec/cells/decidim/user_activity_cell_spec.rb +++ b/decidim-core/spec/cells/decidim/user_activity_cell_spec.rb @@ -89,6 +89,33 @@ end end + context "when comment is deleted" do + let!(:logs) do + comments.first(14).map do |comment| + create( + :action_log, + action: "publish", + visibility: "all", + user: model, + resource: comment, + organization: component.organization, + participatory_space: component.participatory_space + ) + end + end + let!(:log_one) { create(:action_log, action: "create", visibility: "all", user: model, resource: comments.last, organization: component.organization, participatory_space: component.participatory_space) } + let!(:log_two) { create(:action_log, action: "delete", visibility: "all", user: model, resource: comments.last, organization: component.organization, participatory_space: component.participatory_space) } + + it "does not display the references to the comment on the first page if comment has been deleted" do + logs.last(2) do |log| + root_link = Decidim::ResourceLocatorPresenter.new(log.resource.root_commentable).path + comment_link = "#{root_link}?commentId=#{log.resource.id}#comment_#{log.resource.id}" + title = html_truncate(translated_attribute(log.resource.root_commentable.title), length: 80) + expect(subject).to have_no_link(title, href: comment_link) + end + end + end + context "when on the second page" do let(:current_page) { 2 } diff --git a/decidim-forms/config/locales/en.yml b/decidim-forms/config/locales/en.yml index ea49e7c9333df..10f426bee1a3e 100644 --- a/decidim-forms/config/locales/en.yml +++ b/decidim-forms/config/locales/en.yml @@ -55,7 +55,7 @@ en: tos: Terms of service questionnaires: actions: - back: Back to questions + back: Back to responses publish_responses: Publish responses show: Responses display_condition: diff --git a/decidim-surveys/app/views/decidim/surveys/admin/publish_responses/index.html.erb b/decidim-surveys/app/views/decidim/surveys/admin/publish_responses/index.html.erb index 4aff3102952b6..1174423e683cb 100644 --- a/decidim-surveys/app/views/decidim/surveys/admin/publish_responses/index.html.erb +++ b/decidim-surveys/app/views/decidim/surveys/admin/publish_responses/index.html.erb @@ -4,7 +4,7 @@

<%= t(".title") %> - <%= link_to t("actions.back", scope: "decidim.forms.admin.questionnaires"), questionnaire_url, class: "button button__sm button__secondary new" %> + <%= link_to t("actions.back", scope: "decidim.forms.admin.questionnaires"), survey_responses_path, class: "button button__sm button__secondary new" %>

diff --git a/docs/modules/customize/assets/images/content_security_policy.png b/docs/modules/customize/assets/images/content_security_policy.png new file mode 100644 index 0000000000000..ab67864b33335 Binary files /dev/null and b/docs/modules/customize/assets/images/content_security_policy.png differ diff --git a/docs/modules/customize/pages/content_security_policy.adoc b/docs/modules/customize/pages/content_security_policy.adoc index 6653b7c5cc51c..fcb322d09764a 100644 --- a/docs/modules/customize/pages/content_security_policy.adoc +++ b/docs/modules/customize/pages/content_security_policy.adoc @@ -19,14 +19,20 @@ By default, the CSP is enabled, and is configured to be as restrictive as possib In order to customize the CSP we are providing, have 2 options, either by using a configuration key the xref:configure:initializer.adoc[initializer] or by setting values in the Organization's xref:configure:system.adoc[system panel]. -Using the initializer is the recommended way to customize the CSP when you have multiple organizations sharing the same Decidim instance, sharing the same tools. Fox example, if you are using a custom map provider, you will need to add the domain to the CSP, so that the map can be displayed. In this case, you will need to add the following to your initializer: +We recommend using the System panel, as you will not need to be restarting the server when making changes. + +image::content_security_policy.png[Content Security Policy] + +On the other hand, the initializer is more comfortable when you have multiple organizations sharing the same Decidim instance, sharing the same tools. For example, if you are using a custom map provider, you will need to add the domain to the CSP, so that the map can be displayed. In this case, you will need to add the following to your initializer: [source,ruby] .... -config.content_security_policies_extra = { - "connect-src" => %w(https://*.example.com), - "img-src" => %w(https://*.example.com) -} +Decidim.configure do |config| + config.content_security_policies_extra = { + "connect-src" => %w(https://*.example.com), + "img-src" => %w(https://*.example.com) + } +end .... For specific organization setup, you could use the system panel to customize the Content Security Policies, by adding the domains or directives that you need to allow in the predesignated spots. diff --git a/docs/modules/services/pages/activestorage.adoc b/docs/modules/services/pages/activestorage.adoc index e895773282adc..6b75c6099d3c8 100644 --- a/docs/modules/services/pages/activestorage.adoc +++ b/docs/modules/services/pages/activestorage.adoc @@ -4,6 +4,11 @@ Decidim uses https://edgeguides.rubyonrails.org/active_storage_overview.html[Act In order to plug Decidim into a storage provider of your choice, you need to generate the Decidim application using the `--storage` modifier as explained at the xref:configure:index.adoc[configuration guide]. You will also need to provide the correct configuration options for the selected storage provider as explained at the xref:configure:environment_variables.adoc[environment variables guide]. +[NOTE] +==== +If you use any other provider than the default (`local`) you will need to also configure the xref:customize:content_security_policy.adoc[Content security policy]. For the directives "default-src", "img-src", "media-src", and "connect-src"`. +==== + == Dynamic file uploads Decidim allows participants to upload files dynamically from their browsers to the website using the upload modals where participants can drag and drop the files to or select them from their computer. With the default configuration using a local file storage, this feature does not require any additional configuration. With external storage providers, you have to configure those storages properly to support the client-side file uploads to Decidim.