Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 1be43a1
Author: decidim-bot <decidim-bot@users.noreply.github.com>
Date:   Wed Mar 20 09:14:38 2019 +0100

    New Crowdin translations (decidim#4985)

    Enjoy!

commit b0d608c
Author: Marc Riera <mrc2407@gmail.com>
Date:   Wed Mar 20 08:57:57 2019 +0100

    [Backport] Bring decidim#4980 and decidim#4978 to 0.16 (decidim#4984)

    #### 🎩 What? Why?
    This PR backports decidim#4980 and decidim#4978 to 0.16.

    #### 📌 Related Issues
    - Related to decidim#4978, decidim#4980

    #### 📋 Subtasks
    - [x] Add `CHANGELOG` entry

commit c188c31
Author: decidim-bot <decidim-bot@users.noreply.github.com>
Date:   Mon Mar 18 16:06:57 2019 +0100

    New Crowdin translations (decidim#4968)

    * New translations en.yml (Czech)

    * New translations en.yml (Catalan)

    * New translations en.yml (Catalan)

    * New translations en.yml (Catalan)

    * New translations en.yml (Spanish)

    * New translations en.yml (Spanish)

    * New translations en.yml (Turkish)

    * New translations en.yml (Turkish)

    * New translations en.yml (Turkish)

    * New translations en.yml (Turkish)

    * New translations en.yml (Turkish)

    * New translations en.yml (Turkish)

    * New translations en.yml (Italian)

    * New translations en.yml (Italian)

    * New translations en.yml (Hungarian)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Catalan)

    * New translations en.yml (Finnish)

    * New translations en.yml (Finnish)

    * New translations en.yml (Finnish)

    * New translations en.yml (Finnish)

    * New translations en.yml (Spanish)

    * New translations en.yml (Spanish)

    * New translations en.yml (Spanish)

    * New translations en.yml (Spanish)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Hungarian)

    * New translations en.yml (Catalan)

    * New translations en.yml (Spanish)

    * New translations en.yml (Finnish)

    * New translations en.yml (Finnish)

    * New translations en.yml (Catalan)

    * New translations en.yml (Finnish)

    * New translations en.yml (Finnish)

    * New translations en.yml (German)

    * New translations en.yml (Finnish)

    * New translations en.yml (Finnish)

    * New translations en.yml (Finnish)

    * New translations en.yml (Finnish)

    * New translations en.yml (Swedish)

    * New translations en.yml (Arabic)

    * Update comments bundle

    * New translations en.yml (Spanish)

    * New translations en.yml (Spanish)

    * New translations en.yml (Spanish)

    * New translations en.yml (Spanish)

    * New translations en.yml (Finnish (plain))

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Arabic)

    * New translations en.yml (Finnish (plain))

    * New translations en.yml (Catalan)

    * New translations en.yml (Arabic)

commit 7372946
Author: Marc Riera <mrc2407@gmail.com>
Date:   Mon Mar 18 09:14:47 2019 +0100

    [BACKPORT] Fix user presenter for user groups (decidim#4974)

    * Fix user presenter for user groups (decidim#4973)

    * Fix user presenter for user groups

    The user groups do not have a `.deleted?` method defined for them
    which caused the user presenter to break the notifications view
    in case the notification was linking to a group user.

    * Add CHANGELOG entry

    * Fix changelog

commit c5b711d
Author: Marc Riera <mrc2407@gmail.com>
Date:   Wed Mar 13 09:13:45 2019 +0100

    [Backport] Fix authorization workflows index (decidim#4963)

    * Let admins visit the authorization workflows index page

    * Add changelog

commit 700fe2d
Author: Marc Riera <mrc2407@gmail.com>
Date:   Wed Mar 13 08:42:29 2019 +0100

    [BACKPORT] Don't render profile URL if user has no nickname (decidim#4962)

    * Don't render profile URL if user has no nickname

    * Add changelog

commit 7c82e9d
Author: decidim-bot <decidim-bot@users.noreply.github.com>
Date:   Tue Mar 12 08:53:39 2019 +0100

    New Crowdin translations (decidim#4959)

    * New translations en.yml (Turkish)

    * New translations en.yml (Turkish)

    * New translations en.yml (Turkish)

    * New translations en.yml (Turkish)

    * New translations en.yml (Turkish)

commit 066d830
Author: Marc Riera <mrc2407@gmail.com>
Date:   Mon Mar 11 13:12:16 2019 +0100

    [BACKPORT] Skip callbacks on follower counters migration (decidim#4955)

    * Skip callbacks on follower counters migration

    * Add changelog

commit b5e534d
Author: decidim-bot <decidim-bot@users.noreply.github.com>
Date:   Fri Mar 8 08:47:30 2019 +0100

    New Crowdin translations (decidim#4948)

    * New translations en.yml (Catalan)

    * New translations en.yml (Catalan)

    * New translations en.yml (Catalan)

    * New translations en.yml (Spanish)

    * New translations en.yml (Finnish)

    * New translations en.yml (Hungarian)

    * New translations en.yml (German)

    * New translations en.yml (Swedish)

    * New translations en.yml (Finnish)

commit b81e09d
Author: Marc Riera <mrc2407@gmail.com>
Date:   Thu Mar 7 15:04:29 2019 +0100

    Fix meeting questionnaire migration (decidim#4949)

commit d663fee
Author: decidim-bot <decidim-bot@users.noreply.github.com>
Date:   Mon Mar 4 12:57:04 2019 +0100

    New Crowdin translations (decidim#4925)

    * New translations en.yml (Basque)

    * New translations en.yml (Portuguese)

    * New translations en.yml (Portuguese)

    * New translations en.yml (Portuguese)

    * New translations en.yml (Polish)

    * New translations en.yml (Portuguese)

    * New translations en.yml (Polish)

    * New translations en.yml (Portuguese, Brazilian)

    * New translations en.yml (Portuguese, Brazilian)

    * New translations en.yml (Portuguese, Brazilian)

    * New translations en.yml (Portuguese, Brazilian)

    * New translations en.yml (Portuguese)

    * New translations en.yml (Portuguese)

    * New translations en.yml (Polish)

    * New translations en.yml (Indonesian)

    * New translations en.yml (Indonesian)

    * New translations en.yml (Indonesian)

    * New translations en.yml (Indonesian)

    * New translations en.yml (Indonesian)

    * New translations en.yml (Indonesian)

    * New translations en.yml (Italian)

    * New translations en.yml (Indonesian)

    * New translations en.yml (Indonesian)

    * New translations en.yml (Indonesian)

    * New translations en.yml (Indonesian)

    * New translations en.yml (Indonesian)

    * New translations en.yml (Indonesian)

    * New translations en.yml (Indonesian)

    * New translations en.yml (Indonesian)

    * New translations en.yml (Italian)

    * New translations en.yml (Italian)

    * New translations en.yml (Polish)

    * New translations en.yml (Polish)

    * New translations en.yml (Basque)

    * New translations en.yml (Italian)

    * New translations en.yml (Italian)

    * New translations en.yml (Italian)

    * New translations en.yml (Portuguese, Brazilian)

    * New translations en.yml (Indonesian)

    * New translations en.yml (Spanish, Paraguay)

    * New translations en.yml (Spanish, Paraguay)

    * New translations en.yml (Spanish, Paraguay)

    * New translations en.yml (Spanish, Paraguay)

    * New translations en.yml (Spanish, Paraguay)

    * New translations en.yml (Spanish, Mexico)

    * New translations en.yml (Swedish)

    * New translations en.yml (Swedish)

    * New translations en.yml (Swedish)

    * New translations en.yml (Swedish)

    * New translations en.yml (Swedish)

    * New translations en.yml (Swedish)

    * New translations en.yml (Spanish, Paraguay)

    * New translations en.yml (Spanish, Mexico)

    * New translations en.yml (Spanish)

    * New translations en.yml (Spanish)

    * New translations en.yml (Spanish)

    * New translations en.yml (Portuguese, Brazilian)

    * New translations en.yml (Spanish, Mexico)

    * New translations en.yml (Spanish, Mexico)

    * New translations en.yml (Spanish, Mexico)

    * New translations en.yml (Spanish)

    * New translations en.yml (Spanish)

    * New translations en.yml (Indonesian)

    * New translations en.yml (Polish)

    * New translations en.yml (Hungarian)

    * New translations en.yml (Dutch)

    * New translations en.yml (Dutch)

    * New translations en.yml (Dutch)

    * New translations en.yml (Czech)

    * New translations en.yml (Dutch)

    * New translations en.yml (Czech)

    * New translations en.yml (Finnish)

    * New translations en.yml (Finnish)

    * New translations en.yml (Finnish)

    * New translations en.yml (Finnish)

    * New translations en.yml (Dutch)

    * New translations en.yml (Dutch)

    * New translations en.yml (Czech)

    * New translations en.yml (Basque)

    * New translations en.yml (Catalan)

    * New translations en.yml (Basque)

    * New translations en.yml (Basque)

    * New translations en.yml (Basque)

    * New translations en.yml (Catalan)

    * New translations en.yml (Czech)

    * New translations en.yml (Czech)

    * New translations en.yml (Czech)

    * New translations en.yml (Catalan)

    * New translations en.yml (Catalan)

    * New translations en.yml (Catalan)

    * New translations en.yml (Finnish)

    * New translations en.yml (German)

    * New translations en.yml (German)

    * New translations en.yml (German)

    * New translations en.yml (German)

    * New translations en.yml (German)

    * New translations en.yml (German)

    * New translations en.yml (Galician)

    * New translations en.yml (Hungarian)

    * New translations en.yml (Hungarian)

    * New translations en.yml (Hungarian)

    * New translations en.yml (Hungarian)

    * New translations en.yml (Hungarian)

    * New translations en.yml (Hungarian)

    * New translations en.yml (Hungarian)

    * New translations en.yml (Hungarian)

    * New translations en.yml (French)

    * New translations en.yml (French)

    * New translations en.yml (French)

    * New translations en.yml (French)

    * New translations en.yml (French)

    * New translations en.yml (French)

    * New translations en.yml (Finnish)

    * New translations en.yml (Galician)

    * New translations en.yml (Galician)

    * New translations en.yml (Galician)

    * New translations en.yml (French)

    * New translations en.yml (Galician)

    * New translations en.yml (Galician)

    * New translations en.yml (Russian with many plural form)

    * New translations en.yml (Russian with many plural form)

    * New translations en.yml (Ukrainian with many plural form)

    * New translations en.yml (Turkish)

    * New translations en.yml (Turkish)

    * New translations en.yml (Turkish)

    * New translations en.yml (Turkish)

    * New translations en.yml (Turkish)

    * New translations en.yml (Turkish)

    * New translations en.yml (Turkish)

    * New translations en.yml (Turkish)

    * New translations en.yml (Turkish)

    * New translations en.yml (Turkish)

    * New translations en.yml (Turkish)

    * New translations en.yml (Turkish)

    * New translations en.yml (Turkish)

    * New translations en.yml (Turkish)

    * New translations en.yml (Turkish)

    * New translations en.yml (Finnish (plain))

    * New translations en.yml (Finnish (plain))

    * New translations en.yml (Turkish)

    * New translations en.yml (Finnish (plain))

    * New translations en.yml (Finnish (plain))

    * New translations en.yml (Finnish (plain))

    * New translations en.yml (Finnish (plain))

    * New translations en.yml (Ukrainian with many plural form)

commit 490ef8e
Author: Oriol Gual <oriolgual@users.noreply.github.com>
Date:   Mon Mar 4 10:57:31 2019 +0100

    Debates dates are optional (decidim#4921)

commit de4b9b5
Author: Ivan Vergés <ivan@platoniq.net>
Date:   Fri Mar 1 11:28:42 2019 +0100

    fix wrong check of avatar_url in /oauth/me controller 0.16 backport (decidim#4917) (decidim#4919)

    * fix wrong check of avatar_url in /oauth/me controller that leads to a 500 error

    In Decidim intallations configured to use external services as file provider
    (such as AWS-S3), if a user has an avatar cannot authenticate using the builtin
    OAuth server due an error checking the url in the credentials_controller

    * fix rubocop complain

    * [ci_skip] Changelog fix entry

commit e14897b
Author: Oriol Gual <oriolgual@users.noreply.github.com>
Date:   Wed Feb 20 11:02:55 2019 +0100

    Backport more bugfixes (decidim#4883)

    * Don't allow unknown process filters

    * Don't count withdrawn proposals when publishing one

    * Add start and end times to debates card

    * Fix debates ordering

    * Update CHANGELOG

commit 7454642
Author: Oriol Gual <oriolgual@users.noreply.github.com>
Date:   Mon Feb 18 17:00:42 2019 +0100

    Backport bugfixes (decidim#4863)

    * Remove SMS authorization presenter call since it doesn't exist

    * Use MD5 for proposals search indexes

    * Remove etiquetter validator for admins

    * Order recent proposals by published date

    * Scope users search to current organization

    * Use user group as author when present in a comment

    * Allow HTML content at debates page

    * Fix proposal body rendering in activity cell

    * Fix free text answers exporting

    * Better handling with empty fields when exporting

    * Search initiatives at admin at the whole text, not just starting with

    * Order meetings at admin

    * Update CHANGELOG

    * Add missing admin link for proposals. Closes decidim#4834

    * Update CHANGELOG

commit a2c5fe3
Author: decidim-bot <decidim-bot@users.noreply.github.com>
Date:   Mon Feb 18 17:00:19 2019 +0100

    New Crowdin translations (decidim#4860)

    * New translations en.yml (Spanish, Paraguay)

    * New translations en.yml (Turkish)

    * New translations en.yml (Basque)

    * New translations en.yml (Portuguese)

    * New translations en.yml (Portuguese, Brazilian)

    * New translations en.yml (Spanish)

    * New translations en.yml (Original)

    * New translations en.yml (Spanish, Mexico)

    * New translations en.yml (Turkish)

    * New translations en.yml (Turkish)

    * New translations en.yml (Original)

    * New translations en.yml (Original)

    * New translations en.yml (French)

    * New translations en.yml (Catalan)

    * New translations en.yml (Dutch)

    * New translations en.yml (Indonesian)

    * New translations en.yml (Indonesian)

    * New translations en.yml (Indonesian)

    * New translations en.yml (Polish)

    * Readd missing keys

    * Readd missing keys

    * New translations en.yml (Original)

    * Revert "New translations en.yml (Original)"

    This reverts commit 2d52564.

commit 7f6129e
Author: Aitor Lopez Beltran <aitor.lb@coditramuntana.com>
Date:   Sat Feb 16 01:36:05 2019 +0100

    Backport decidim#4852 to 0.16 stable (decidim#4855)

    * Backport decidim#4852 to 0.16-stable

    * Add CHANGELOG entry

commit 8ecaa23
Author: decidim-bot <decidim-bot@users.noreply.github.com>
Date:   Sat Feb 16 01:33:31 2019 +0100

    New Crowdin translations (decidim#4781)

    * New translations en.yml (Indonesian)

    * New translations en.yml (Spanish)

    * New translations en.yml (Spanish, Paraguay)

    * New translations en.yml (Dutch)

    * New translations en.yml (Hungarian)

    * New translations en.yml (Catalan)

    * New translations en.yml (German)

    * New translations en.yml (Russian with many plural form)

    * New translations en.yml (Ukrainian with many plural form)

    * New translations en.yml (Turkish)

    * New translations en.yml (Finnish)

    * New translations en.yml (Spanish)

    * New translations en.yml (Catalan)

    * New translations en.yml (Catalan)

    * New translations en.yml (Catalan)

    * New translations en.yml (Spanish, Paraguay)

    * New translations en.yml (Spanish)

    * New translations en.yml (Original)

    * New translations en.yml (Original)

    * New translations en.yml (Original)

    * New translations en.yml (Original)

    * New translations en.yml (Original)

    * New translations en.yml (Original)

    * New translations en.yml (Original)

    * New translations en.yml (Original)

    * New translations en.yml (Original)

    * New translations en.yml (Original)

    * New translations en.yml (Catalan)

    * New translations en.yml (Turkish)

    * New translations en.yml (Czech)

    * New translations en.yml (Spanish, Mexico)

    * New translations en.yml (Spanish, Mexico)

    * New translations en.yml (Spanish, Mexico)

    * New translations en.yml (Spanish, Mexico)

    * New translations en.yml (Spanish, Mexico)

    * New translations en.yml (Spanish, Mexico)

    * New translations en.yml (Spanish, Mexico)

    * New translations en.yml (Spanish, Mexico)

    * New translations en.yml (Spanish, Mexico)

    * New translations en.yml (Spanish, Mexico)

    * New translations en.yml (Spanish, Mexico)

    * New translations en.yml (Spanish, Mexico)

    * New translations en.yml (Spanish, Mexico)

    * New translations en.yml (Spanish, Mexico)

    * New translations en.yml (Spanish, Mexico)

    * New translations en.yml (Spanish, Mexico)

    * New translations en.yml (Spanish, Mexico)

    * New translations en.yml (Spanish, Mexico)

    * New translations en.yml (Spanish, Mexico)

    * New translations en.yml (Spanish, Mexico)

    * New translations en.yml (Czech)

    * New translations en.yml (Czech)

    * New translations en.yml (Czech)

    * New translations en.yml (Czech)

    * New translations en.yml (Czech)

    * New translations en.yml (Czech)

    * New translations en.yml (Czech)

    * New translations en.yml (Czech)

    * New translations en.yml (Czech)

    * New translations en.yml (Czech)

    * New translations en.yml (Czech)

    * New translations en.yml (Czech)

    * New translations en.yml (Czech)

    * New translations en.yml (Czech)

    * New translations en.yml (Czech)

    * New translations en.yml (Czech)

    * New translations en.yml (Czech)

    * New translations en.yml (Czech)

    * New translations en.yml (Czech)

    * New translations en.yml (Czech)

    * New translations en.yml (Spanish, Mexico)

    * New translations en.yml (Czech)

    * New translations en.yml (Czech)

    * New translations en.yml (Czech)

    * New translations en.yml (Czech)

    * New translations en.yml (Czech)

    * New translations en.yml (Czech)

    * New translations en.yml (Czech)

    * New translations en.yml (Czech)

    * New translations en.yml (Czech)

    * New translations en.yml (Czech)

    * New translations en.yml (Czech)

    * New translations en.yml (Czech)

    * New translations en.yml (Czech)

    * New translations en.yml (Czech)

    * New translations en.yml (Czech)

    * New translations en.yml (Czech)

    * New translations en.yml (Czech)

    * New translations en.yml (Czech)

    * New translations en.yml (Czech)

    * New translations en.yml (Czech)

    * New translations en.yml (Czech)

    * New translations en.yml (Catalan)

    * New translations en.yml (Catalan)

    * New translations en.yml (Finnish)

    * New translations en.yml (Finnish)

    * New translations en.yml (Finnish)

    * New translations en.yml (Finnish)

    * New translations en.yml (Finnish (plain))

    * New translations en.yml (Original)

    * New translations en.yml (Spanish, Mexico)

    * New translations en.yml (Spanish)

    * New translations en.yml (Catalan)

    * New translations en.yml (Hungarian)

    * New translations en.yml (Hungarian)

    * New translations en.yml (Original)

    * New translations en.yml (Hungarian)

    * New translations en.yml (Original)

    * New translations en.yml (Original)

    * New translations en.yml (Original)

    * New translations en.yml (Original)

    * New translations en.yml (Original)

    * New translations en.yml (Original)

    * New translations en.yml (Original)

    * New translations en.yml (Finnish)

    * New translations en.yml (Finnish)

    * New translations en.yml (Finnish)

    * New translations en.yml (Finnish)

    * New translations en.yml (Finnish)

    * New translations en.yml (Finnish)

    * New translations en.yml (Finnish)

    * New translations en.yml (Catalan)

    * New translations en.yml (Catalan)

    * New translations en.yml (Catalan)

    * New translations en.yml (Catalan)

    * New translations en.yml (Catalan)

    * New translations en.yml (Catalan)

    * New translations en.yml (Catalan)

    * New translations en.yml (Hungarian)

    * New translations en.yml (Hungarian)

    * New translations en.yml (Hungarian)

    * New translations en.yml (Hungarian)

    * New translations en.yml (Hungarian)

    * New translations en.yml (Hungarian)

    * New translations en.yml (Hungarian)

    * New translations en.yml (Hungarian)

    * New translations en.yml (Hungarian)

    * Fix locales

    * Fix specs

    * More spec fixes

    * Spec fixes

commit c7ace25
Author: Aitor Lopez Beltran <aitor.lb@coditramuntana.com>
Date:   Fri Feb 15 08:56:26 2019 +0100

    Backport decidim#4718 to 0.16 stable (decidim#4847)

    * Backport decidim#4718 to 0.16 stable

    * Add CHANGELOG entry

commit f523607
Author: Aitor Lopez Beltran <aitor.lb@coditramuntana.com>
Date:   Wed Feb 13 14:49:49 2019 +0100

    Backport decidim#4828 to 0.16 stable (decidim#4836)

    * Backport decidim#4828 to 0.16-stable

    * Add CHANGELOG entry

commit d587a42
Author: Oliver Valls <tramuntanal@gmail.com>
Date:   Mon Feb 11 17:01:13 2019 +0100

    Backport/more participatory text features (decidim#4817)

    * [REFACTOR] Save participatory text drafts.

    * [REFACTOR] All participatory texts cards open by default.

    * [FEATURE] Option to reset participatory text file.

    * [I18N] Use "discard" terminology.

    * Update links to PR in changelog.

    * [TEST] Update literals in tests.

    * [TEST] Fix flacky test.

commit 5c460f7
Author: Aitor Lopez Beltran <aitor.lb@coditramuntana.com>
Date:   Mon Feb 4 15:56:46 2019 +0100

    Backport decidim#4811 to 0.16-stable (decidim#4815)

    * Fix attachments not being inherited and add test

    * Add CHANGELOG entry

commit 99eacbd
Author: Oliver Valls <tramuntanal@gmail.com>
Date:   Tue Jan 29 15:29:18 2019 +0100

    Backport participatory text related evoutives and fixes. (decidim#4801)

    * Backport participatory text related evoutives and fixes.

    * Add changelog entry.

    * Update decidim_app-design Gemfile.lock.

    * Update decidim-generators Gemfile.lock.

    * Sort this PR's changelog entries for the next v0.16.1.

    * [TEST] Update participatory_text.odt document version with non ASCII symbols.

commit 2fa4618
Author: Aitor Lopez Beltran <aitor.lb@coditramuntana.com>
Date:   Tue Jan 22 16:04:29 2019 +0100

    Backport decidim#4778 to 0.16-stable (decidim#4777)

    * Move code parent assemblies from index to partial

    * Refactor filtered assemblies query

    * Refactor filter assemblies helper and partial

    * Change tests

    * Add CHANGELOG entry

commit 586b2a2
Author: Oriol Gual <oriolgual@users.noreply.github.com>
Date:   Fri Jan 11 09:22:44 2019 +0100

    Fix action authorizer with blank permissions 0.16 backport (decidim#4746)

    * Ignore blank permission options in action authorizer

    * Add CHANGELOG

commit b7599a8
Author: Leonardo Diez <leiodd@gmail.com>
Date:   Thu Jan 10 14:41:23 2019 +0100

    Adds environment to open data export task to avoid errors (decidim#4743)

COMMAND HISTORY
```shell
$ git merge -s recursive -Xfind-renames=25% -Xsubtree=decidim-proposals -Xpatience --squash decidim/0.16-stable

$ git ls-tree -dr HEAD --name-only | grep proposal

$ git ls-files | grep proposal

$ git mv spec/cells/decidim/questions/proposal_activity_cell_spec.rb spec/cells/decidim/questions/question_activity_cell_spec.rb

$ git ls-tree -dr HEAD --name-only | grep proposal

```
  • Loading branch information
moustachu committed Mar 21, 2019
1 parent 489eafb commit 1427cd5
Show file tree
Hide file tree
Showing 69 changed files with 8,187 additions and 8,517 deletions.
Expand Up @@ -10,6 +10,7 @@ class ParticipatoryTextQuestionCell < Decidim::ViewModel
include QuestionCellsHelper
include Cell::ViewModel::Partial
include Messaging::ConversationHelper
include Decidim::SanitizeHelper

delegate :current_organization, to: :controller

Expand All @@ -30,7 +31,8 @@ def title

def body
return unless model.participatory_text_level == "article"
present(model).body
formatted = simple_format(present(model).body)
decidim_sanitize(strip_links(formatted))
end

def current_user
Expand Down
10 changes: 9 additions & 1 deletion app/cells/decidim/questions/question_activity_cell.rb
Expand Up @@ -12,7 +12,15 @@ def title
end

def resource_link_text
Decidim::Questions::QuestionPresenter.new(resource).title
presenter.title
end

def description
presenter.body(links: true)
end

def presenter
@presenter ||= Decidim::Questions::QuestionPresenter.new(resource).title
end
end
end
Expand Down
40 changes: 40 additions & 0 deletions app/commands/decidim/questions/admin/discard_participatory_text.rb
@@ -0,0 +1,40 @@
# frozen_string_literal: true

module Decidim
module Questions
module Admin
# A command with all the business logic related with an admin discarding participatory text questions.
class DiscardParticipatoryText < Rectify::Command
# Public: Initializes the command.
#
# form - A PreviewParticipatoryTextForm form object with the params.
def initialize(component)
@component = component
end

# Executes the command. Broadcasts these events:
#
# - :ok when everything is valid.
# - :invalid if the form wasn't valid and we couldn't proceed.
#
# Returns nothing.
def call
transaction do
discard_drafts
end

broadcast(:ok)
end

private

attr_reader :form

def discard_drafts
questions = Decidim::Questions::Question.drafts.where(component: @component)
questions.destroy_all
end
end
end
end
end
Expand Up @@ -39,7 +39,11 @@ def save_participatory_text_meta(form)
end

def parse_participatory_text_doc(form)
markdown = DocToMarkdown.new(form.document_text, form.document_type).to_md
return if form.document.blank?

document = form.document_text
document = Decidim::IoEncoder.to_standard_encoding(document)
markdown = DocToMarkdown.new(document, form.document_type).to_md
parser = MarkdownToQuestions.new(form.current_component, form.current_user)
parser.parse(markdown)
end
Expand Down
Expand Up @@ -5,7 +5,7 @@ module Questions
module Admin
# A command with all the business logic when an admin imports questions from
# a participatory text.
class PublishParticipatoryText < Rectify::Command
class PublishParticipatoryText < UpdateParticipatoryText
# Public: Initializes the command.
#
# form - A PreviewParticipatoryTextForm form object with the params.
Expand All @@ -21,13 +21,14 @@ def initialize(form)
# Returns nothing.
def call
transaction do
@publish_failures = {}
update_contents_and_resort_questions(form)
@failures = {}
# TODO (merge 20190320) : check if still needed
# update_contents_and_resort_questions(form)
publish_drafts
end

if @publish_failures.any?
broadcast(:invalid, @publish_failures)
if @failures.any?
broadcast(:invalid, @failures)
else
broadcast(:ok)
end
Expand All @@ -53,11 +54,11 @@ def publish_drafts
Decidim::Questions::Question.where(component: form.current_component).drafts.find_each do |question|
add_failure(question) unless question.update(published_at: Time.current)
end
raise ActiveRecord::Rollback if @publish_failures.any?
raise ActiveRecord::Rollback if @failures.any?
end

def add_failure(question)
@publish_failures[question.id] = question.errors.full_messages
@failures[question.id] = question.errors.full_messages
end
end
end
Expand Down
56 changes: 56 additions & 0 deletions app/commands/decidim/questions/admin/update_participatory_text.rb
@@ -0,0 +1,56 @@
# frozen_string_literal: true

module Decidim
module Questions
module Admin
# A command with all the business logic when an admin updates participatory text questions.
class UpdateParticipatoryText < Rectify::Command
# Public: Initializes the command.
#
# form - A PreviewParticipatoryTextForm form object with the params.
def initialize(form)
@form = form
end

# Executes the command. Broadcasts these events:
#
# - :ok when everything is valid.
# - :invalid if the form wasn't valid and we couldn't proceed.
#
# Returns nothing.
def call
transaction do
@failures = {}
update_contents_and_resort_questions(form)
end

if @failures.any?
broadcast(:invalid, @failures)
else
broadcast(:ok)
end
end

private

attr_reader :form

def update_contents_and_resort_questions(form)
form.questions.each do |prop_form|
question = Decidim::Questions::Question.where(component: form.current_component).find(prop_form.id)
question.set_list_position(prop_form.position) if question.position != prop_form.position
question.title = prop_form.title
question.body = prop_form.body if question.participatory_text_level == Decidim::Questions::ParticipatoryTextSection::LEVELS[:article]

add_failure(question) unless question.save
end
raise ActiveRecord::Rollback if @failures.any?
end

def add_failure(question)
@failures[question.id] = question.errors.full_messages
end
end
end
end
end
43 changes: 21 additions & 22 deletions app/commands/decidim/questions/create_question.rb
Expand Up @@ -43,29 +43,28 @@ def call

attr_reader :form, :question, :attachment

def question_attributes
fields = {}

fields[:title] = title_with_hashtags
fields[:body] = body_with_hashtags
fields[:component] = form.component

fields
end

# This will be the PaperTrail version that is
# shown in the version control feature (1 of 1)
# Prevent PaperTrail from creating an additional version
# in the question multi-step creation process (step 1: create)
#
# A first version will be created in step 4: publish
# for diff rendering in the question version control
def create_question
@question = Decidim.traceability.perform_action!(
:create,
Decidim::Questions::Question,
@current_user,
visibility: "public-only"
) do
question = Question.new(question_attributes)
question.add_coauthor(@current_user, user_group: user_group)
question.save!
question
PaperTrail.request(enabled: false) do
@question = Decidim.traceability.perform_action!(
:create,
Decidim::Questions::Question,
@current_user,
visibility: "public-only"
) do
question = Question.new(
title: title_with_hashtags,
body: body_with_hashtags,
component: form.component
)
question.add_coauthor(@current_user, user_group: user_group)
question.save!
question
end
end
end

Expand Down
Expand Up @@ -79,6 +79,7 @@ def create_question!
new_question = Question.new(question_attributes)
new_question.coauthorships = @collaborative_draft.coauthorships
new_question.category = @collaborative_draft.category
new_question.attachments = @collaborative_draft.attachments
new_question.save!
new_question
end
Expand Down
28 changes: 25 additions & 3 deletions app/commands/decidim/questions/publish_question.rb
Expand Up @@ -34,12 +34,34 @@ def call

private

# Prevent PaperTrail from creating an additional version
# in the question multi-step creation process (step 4: publish)
# This will be the PaperTrail version that is
# shown in the version control feature (1 of 1)
#
# For an attribute to appear in the new version it has to be reset
# and reassigned, as PaperTrail only keeps track of object CHANGES.
def publish_question
title = reset(:title)
body = reset(:body)

Decidim.traceability.perform_action!(
"publish",
@question,
@current_user,
visibility: "public-only"
) do
@question.update title: title, body: body, published_at: Time.current
end
end

# Reset the attribute to an empty string and return the old value
def reset(attribute)
attribute_value = @question[attribute]
PaperTrail.request(enabled: false) do
@question.update published_at: Time.current
# rubocop:disable Rails/SkipsModelValidations
@question.update_attribute attribute, ""
# rubocop:enable Rails/SkipsModelValidations
end
attribute_value
end

def send_notification
Expand Down
42 changes: 19 additions & 23 deletions app/commands/decidim/questions/update_question.rb
Expand Up @@ -53,41 +53,37 @@ def call

attr_reader :form, :question, :current_user, :attachment

def question_attributes
fields = {}

fields[:title] = title_with_hashtags
fields[:body] = body_with_hashtags
fields[:category] = form.category
fields[:scope] = form.scope
fields[:address] = form.address
fields[:latitude] = form.latitude
fields[:longitude] = form.longitude

fields
end

# Prevent PaperTrail from creating an additional version
# in the question multi-step creation process (step 3: complete)
#
# A first version will be created in step 4: publish
# for diff rendering in the question control version
def update_draft
PaperTrail.request(enabled: false) do
@question.update(question_attributes)
@question.update(attributes)
@question.coauthorships.clear
@question.add_coauthor(current_user, user_group: user_group)
end
end

def update_question
@question = Decidim.traceability.update!(
@question,
current_user,
question_attributes,
visibility: "public-only"
)
@question.update!(attributes)
@question.coauthorships.clear
@question.add_coauthor(current_user, user_group: user_group)
end

def attributes
{
title: title_with_hashtags,
body: body_with_hashtags,
category: form.category,
scope: form.scope,
address: form.address,
latitude: form.latitude,
longitude: form.longitude
}
end

def question_limit_reached?
question_limit = form.current_component.settings.question_limit

Expand All @@ -109,11 +105,11 @@ def organization
end

def current_user_questions
Question.from_author(current_user).where(component: form.current_component).published.where.not(id: question.id)
Question.from_author(current_user).where(component: form.current_component).published.where.not(id: question.id).except_withdrawn
end

def user_group_questions
Question.from_user_group(user_group).where(component: form.current_component).published.where.not(id: question.id)
Question.from_user_group(user_group).where(component: form.current_component).published.where.not(id: question.id).except_withdrawn
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/concerns/decidim/questions/orderable.rb
Expand Up @@ -59,7 +59,7 @@ def reorder(questions)
when "most_voted"
questions.order(question_votes_count: :desc)
when "recent"
questions.order(created_at: :desc)
questions.order(published_at: :desc)
end
end
end
Expand Down

0 comments on commit 1427cd5

Please sign in to comment.