forked from decidim/decidim
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add notification to valuators when a proposal is assigned (decidim#13022
) * Add notification to valuators when a proposal is assigned to them. Also adds a new notifications setting to disable this notification * Update decidim-core/spec/commands/decidim/update_notifications_settings_spec.rb Co-authored-by: Eduardo Martínez <[email protected]> --------- Co-authored-by: Eduardo Martínez <[email protected]>
- Loading branch information
Showing
12 changed files
with
88 additions
and
1 deletion.
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
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
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
27 changes: 27 additions & 0 deletions
27
decidim-proposals/app/events/decidim/proposals/admin/proposal_assigned_to_valuator_event.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 Proposals | ||
module Admin | ||
class ProposalAssignedToValuatorEvent < Decidim::Events::SimpleEvent | ||
include Rails.application.routes.mounted_helpers | ||
|
||
i18n_attributes :admin_proposal_info_url, :admin_proposal_info_path | ||
|
||
def admin_proposal_info_path | ||
ResourceLocatorPresenter.new(resource).show | ||
end | ||
|
||
def admin_proposal_info_url | ||
send(resource.component.mounted_admin_engine).proposal_url(resource, resource.component.mounted_params) | ||
end | ||
|
||
private | ||
|
||
def organization | ||
@organization ||= component.participatory_space.organization | ||
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
7 changes: 7 additions & 0 deletions
7
decidim-proposals/db/migrate/20240617091140_add_email_on_assigned_proposals_to_users.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,7 @@ | ||
# frozen_string_literal: true | ||
|
||
class AddEmailOnAssignedProposalsToUsers < ActiveRecord::Migration[6.1] | ||
def change | ||
add_column :decidim_users, :email_on_assigned_proposals, :boolean, default: true | ||
end | ||
end |