Skip to content

Send notification when signature threshold reached#6098

Merged
Leusev merged 12 commits intodecidim:developfrom
armandfardeau:feature/notify-admin-support-result
May 28, 2020
Merged

Send notification when signature threshold reached#6098
Leusev merged 12 commits intodecidim:developfrom
armandfardeau:feature/notify-admin-support-result

Conversation

@armandfardeau
Copy link
Copy Markdown
Contributor

@armandfardeau armandfardeau commented May 14, 2020

🎩 What? Why?

This PR will add a notification that will be sent authors, promoting committee members, followers of the initiative and admins to receive a notification when an initiative reaches the support threshold.

linked to : https://meta.decidim.org/processes/roadmap/f/122/proposals/15280

📋 Subtasks

  • Add CHANGELOG entry
  • Add tests

@armandfardeau armandfardeau changed the title Notify admin when initiative is accepted Send notification when initiative reaches 100% of support thereshold May 15, 2020
@virgile-dev
Copy link
Copy Markdown
Contributor

virgile-dev commented May 15, 2020

@armandfardeau looks like we didn't understand each other on this one.
It's the admin who click on the button to accept an initiative so it doesn't make sense to send him and email when accepting an initiative. Same for rejecting.

It does for authors, followers, promotting committee members though. So maybe we can slightly revamp this to exclude admin and include authors, followers, promotting committee members.

What I wanted to do with this PR is to send a notification to the admin when the initiative reaches the 100% milestone. (see this PR for ref)

CHANGELOG.md Outdated

### Added

- **decidim-initiatives**: Notify admin when an initiative is accepted. [\#6098](https://github.com/decidim/decidim/pull/6098)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notify authors, promoting committee members, followers of the initiative and admins to receive a notification when an initiative reaches the 100% of the support threshold.

@armandfardeau armandfardeau changed the title Send notification when initiative reaches 100% of support thereshold Notify authors, promoting committee members, followers of the initiative and admins to receive a notification when an initiative reaches the 100% of the support threshold May 19, 2020
@andreslucena andreslucena changed the title Notify authors, promoting committee members, followers of the initiative and admins to receive a notification when an initiative reaches the 100% of the support threshold Send notification when initiative reaches 100% of signatures threshold May 20, 2020
@virgile-dev
Copy link
Copy Markdown
Contributor

@carolromero is this one okay with you ? I see that @andreslucena had a look.

@Leusev Leusev self-requested a review May 21, 2020 13:56
@andreslucena
Copy link
Copy Markdown
Member

@carolromero is this one okay with you ? I see that @andreslucena had a look

Hey all, I've actually didn't look at this, it's just that I hate long titles on PR/commits. I've updated the docs with this a few weeks ago, please take a look at https://github.com/decidim/decidim/blob/develop/docs/development_guide.md#git-commit-messages-and-pull-request-titles

The title "Notify authors, promoting committee members, followers of the initiative and admins to receive a notification when an initiative reaches the 100% of the support threshold" is 171 characters
Hell, even the new title is too long by the guidelines that I've linked (we're on 71 chars, guidelines says 50 chars), but I can live with that for the time being.

(Still the title is shorter than the title of Garcia Marquez book "Relatos de un naufrago" / "The Story of a Shipwrecked Sailor" which full title is "The Story of a Shipwrecked Sailor: Who Drifted on a Liferaft for Ten Days Without Food or Water, Was Proclaimed a National Hero, Kissed by Beauty Queens, Made Rich Through Publicity, and Then Spurned by the Government and Forgotten for All Time.", 246 chars!!)

@armandfardeau armandfardeau changed the title Send notification when initiative reaches 100% of signatures threshold Send notification when signature threshold reached May 22, 2020
@armandfardeau
Copy link
Copy Markdown
Contributor Author

@carolromero is this one okay with you ? I see that @andreslucena had a look

Hey all, I've actually didn't look at this, it's just that I hate long titles on PR/commits. I've updated the docs with this a few weeks ago, please take a look at https://github.com/decidim/decidim/blob/develop/docs/development_guide.md#git-commit-messages-and-pull-request-titles

The title "Notify authors, promoting committee members, followers of the initiative and admins to receive a notification when an initiative reaches the 100% of the support threshold" is 171 characters
Hell, even the new title is too long by the guidelines that I've linked (we're on 71 chars, guidelines says 50 chars), but I can live with that for the time being.

(Still the title is shorter than the title of Garcia Marquez book "Relatos de un naufrago" / "The Story of a Shipwrecked Sailor" which full title is "The Story of a Shipwrecked Sailor: Who Drifted on a Liferaft for Ten Days Without Food or Water, Was Proclaimed a National Hero, Kissed by Beauty Queens, Made Rich Through Publicity, and Then Spurned by the Government and Forgotten for All Time.", 246 chars!!)

I was not aware of these new guidelines, thank you for the clarification. I've updated this P.R., let me know if anything is still out of order.

@virgile-dev
Copy link
Copy Markdown
Contributor

@carolromero thanks for accepting the proposal on meta decidim. Does this mean that @Leusev can merge the PR ?

@carolromero
Copy link
Copy Markdown
Member

@virgile-dev yep, it's ok on my side

@armandfardeau
Copy link
Copy Markdown
Contributor Author

@Leusev GH actions had a malfunction, can you restart them on your side? Everything should be green by now

@Leusev Leusev self-assigned this May 25, 2020
@Leusev
Copy link
Copy Markdown
Contributor

Leusev commented May 25, 2020

Hi @armandfardeau
for sure, I've re-launched "[CI] admin / Tests" again
I know it is repetitive, but it seems that the changelog has conflict again
Thanks!

@armandfardeau
Copy link
Copy Markdown
Contributor Author

Hi @armandfardeau
for sure, I've re-launched "[CI] admin / Tests" again
I know it is repetitive, but it seems that the changelog has conflict again
Thanks!

I should have done my chores a long time ago ;)

@virgile-dev
Copy link
Copy Markdown
Contributor

@Leusev could you check if we can merge this now ? Thanks !

Copy link
Copy Markdown
Contributor

@Leusev Leusev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All ok now @armandfardeau 👍

@Leusev Leusev merged commit cf6c671 into decidim:develop May 28, 2020
ace pushed a commit to aspgems/decidim that referenced this pull request May 28, 2020
* feature/add_areas_to_initiatives: (30 commits)
  Adds areas to FO filters
  Fix lint issue
  Fixes rubocop issues
  Updates changelog
  Adds areas to initiatives
  Send notification when signature threshold reached (decidim#6098)
  Adds filter by initiative type to admin panel (decidim#6093)
  Require confirmation on exiting a survey mid-answering (decidim#6118)
  Information message when there isn't any Proposal (decidim#6063)
  Set email asset host dynamically (decidim#5888)
  Harmonizes the design of initiatives search in FO (decidim#6090)
  Include year in meetings card (decidim#6102)
  Add attachment enabled option to initiative types and initiatives (decidim#6036)
  Fix a flaky test in group profile conversations (decidim#6123)
  Add attachments to Initiatives (decidim#5844)
  Add initiatives export (decidim#6070)
  Improvements to conversations with more than one participant (decidim#6094)
  Elections module and election administration (decidim#6065)
  Separate forms in steps (decidim#6108)
  Add sorting by publishing date to initiatives (decidim#6016)
  ...

# Conflicts:
#	decidim-initiatives/app/cells/decidim/initiatives/initiative_m_cell.rb
#	decidim-initiatives/app/commands/decidim/initiatives/admin/update_initiative.rb
#	decidim-initiatives/app/controllers/decidim/initiatives/initiatives_controller.rb
#	decidim-initiatives/app/forms/decidim/initiatives/admin/initiative_form.rb
#	decidim-initiatives/app/helpers/decidim/initiatives/application_helper.rb
#	decidim-initiatives/app/models/decidim/initiative.rb
#	decidim-initiatives/app/services/decidim/initiatives/initiative_search.rb
#	decidim-initiatives/app/views/decidim/initiatives/create_initiative/fill_data.html.erb
#	decidim-initiatives/app/views/decidim/initiatives/initiatives/_filters.html.erb
#	decidim-initiatives/app/views/decidim/initiatives/initiatives/_tags.html.erb
#	decidim-initiatives/config/locales/en.yml
#	decidim-initiatives/db/migrate/20200514085422_add_area_to_initiatives.rb
#	decidim-initiatives/db/migrate/20200514102631_add_area_enabled_option_to_initiatives.rb
#	decidim-initiatives/spec/forms/initiative_form_spec.rb
#	decidim-initiatives/spec/services/decidim/initiatives/initiative_search_spec.rb
#	decidim-initiatives/spec/shared/update_initiative_type_example.rb
#	decidim-initiatives/spec/system/admin/admin_manages_initiatives_spec.rb
#	decidim-initiatives/spec/system/admin/initiative_types_controller_spec.rb
#	decidim-initiatives/spec/system/filter_initiatives_spec.rb
ace pushed a commit to aspgems/decidim that referenced this pull request May 29, 2020
* develop:
  Send notification when signature threshold reached (decidim#6098)
  Adds filter by initiative type to admin panel (decidim#6093)
  Require confirmation on exiting a survey mid-answering (decidim#6118)
  Information message when there isn't any Proposal (decidim#6063)
  Set email asset host dynamically (decidim#5888)
  Harmonizes the design of initiatives search in FO (decidim#6090)
Quentinchampenois pushed a commit to OpenSourcePolitics/decidim that referenced this pull request Jun 1, 2020
* Notify admin when initiative is accepted

* Don't send notificaiton to admin if initiative is rejected

* Revert c3212c0

* Notify admin if the percentage is 100%

* Normalize en locale

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md

Co-authored-by: Ramon Costa <ramon.costa@gmail.com>
anaghavl pushed a commit to codegram/decidim that referenced this pull request Jun 3, 2020
* Notify admin when initiative is accepted

* Don't send notificaiton to admin if initiative is rejected

* Revert c3212c0

* Notify admin if the percentage is 100%

* Normalize en locale

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md

Co-authored-by: Ramon Costa <ramon.costa@gmail.com>
@armandfardeau armandfardeau deleted the feature/notify-admin-support-result branch July 17, 2020 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants