-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of github.com:decidim-ice/decidim-module-decid…
…im_awesome into develop
- Loading branch information
Showing
126 changed files
with
2,765 additions
and
794 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
app/commands/concerns/decidim/decidim_awesome/proposals/admin/update_proposal_override.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# frozen_string_literal: true | ||
|
||
module Decidim | ||
module DecidimAwesome | ||
module Proposals | ||
module Admin | ||
## | ||
# Decorates update draft and update proposal | ||
# to avoid private field to be logged in PaperTrail. | ||
module UpdateProposalOverride | ||
extend ActiveSupport::Concern | ||
|
||
included do | ||
private | ||
|
||
alias_method :decidim_original_update_proposal, :update_proposal | ||
|
||
def update_proposal | ||
decidim_original_update_proposal | ||
update_private_field! | ||
end | ||
|
||
def update_private_field! | ||
@proposal.update_private_body!(form.private_body) if form.private_body.present? | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
27 changes: 27 additions & 0 deletions
27
...ommands/concerns/decidim/decidim_awesome/proposals/create_collaborative_draft_override.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# frozen_string_literal: true | ||
|
||
module Decidim | ||
module DecidimAwesome | ||
module Proposals | ||
## | ||
# Decorate create_collaborative_draft to avoid | ||
# private data to be in PaperTrail | ||
module CreateCollaborativeDraftOverride | ||
extend ActiveSupport::Concern | ||
|
||
included do | ||
private | ||
|
||
alias_method :decidim_original_create_collaborative_draft, :create_collaborative_draft | ||
|
||
def create_collaborative_draft | ||
created_draft = decidim_original_create_collaborative_draft | ||
# Update the proposal with the private body, to | ||
# avoid tracebility on private fields. | ||
created_draft.update_private_body!(form.private_body) if form.private_body.present? | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
27 changes: 27 additions & 0 deletions
27
app/commands/concerns/decidim/decidim_awesome/proposals/create_proposal_override.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# frozen_string_literal: true | ||
|
||
module Decidim | ||
module DecidimAwesome | ||
module Proposals | ||
## | ||
# Decorate create_proposal to avoid | ||
# private data to be in PaperTrail | ||
module CreateProposalOverride | ||
extend ActiveSupport::Concern | ||
|
||
included do | ||
private | ||
|
||
alias_method :decidim_original_create_proposal, :create_proposal | ||
|
||
def create_proposal | ||
created_proposal = decidim_original_create_proposal | ||
# Update the proposal with the private body, to | ||
# avoid tracebility on private fields. | ||
created_proposal.update_private_body!(form.private_body) if form.private_body.present? | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
27 changes: 27 additions & 0 deletions
27
...ommands/concerns/decidim/decidim_awesome/proposals/update_collaborative_draft_override.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# frozen_string_literal: true | ||
|
||
module Decidim | ||
module DecidimAwesome | ||
module Proposals | ||
## | ||
# Decorates update draft and update proposal | ||
# to avoid private field to be logged in PaperTrail. | ||
module UpdateCollaborativeDraftOverride | ||
extend ActiveSupport::Concern | ||
|
||
included do | ||
private | ||
|
||
alias_method :decidim_original_update_collaborative_draft, :update_collaborative_draft | ||
|
||
def update_collaborative_draft | ||
decidim_original_update_collaborative_draft | ||
# Update the proposal with the private body, to | ||
# avoid tracebility on private fields. | ||
@collaborative_draft.update_private_body!(form.private_body) if form.private_body.present? | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
26 changes: 26 additions & 0 deletions
26
app/commands/concerns/decidim/decidim_awesome/proposals/update_proposal_override.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# frozen_string_literal: true | ||
|
||
module Decidim | ||
module DecidimAwesome | ||
module Proposals | ||
## | ||
# Decorates update draft and update proposal | ||
# to avoid private field to be logged in PaperTrail. | ||
module UpdateProposalOverride | ||
extend ActiveSupport::Concern | ||
include Admin::UpdateProposalOverride | ||
|
||
included do | ||
private | ||
|
||
alias_method :decidim_original_update_draft, :update_draft | ||
|
||
def update_proposal | ||
decidim_original_update_proposal | ||
update_private_field! | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.