-
-
Notifications
You must be signed in to change notification settings - Fork 592
Resolves #5668 Org level disable reminder emails #5686
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
27599b1
Reminders toggle at the model level. Preserve behavior for existing orgs
181c754
Merge branch 'main' into 5668_disable_reminders
LizPrescott 1ba2aa8
Controller and org-level views of disable toggle
4314008
Enforce organization reminder toggles in the email paths
d229040
Hide reminder-schedule fields when monthly deadline reminders are off
d4c0d69
Merge branch '5668_disable_reminders' of github.com:rubyforgood/human…
b4b8a15
Add reminder toggles to the super-admin new organization form
ae383be
Show a "reminders are disabled" notice in reminder-config forms
e75dd85
Backfill reminder toggles to true for all existing organizations
cb85aa5
Adding guard clause to reminder email when org-level disabled
57a0df8
Merge branch 'main' into 5668_disable_reminders
LizPrescott File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,23 @@ | ||
| import { Controller } from "@hotwired/stimulus" | ||
|
|
||
| /* | ||
| * ReminderToggleController shows/hides dependent reminder-schedule fields based | ||
| * on the selected value of a Yes/No radio-button group. Used on the organization | ||
| * settings form so the reminder schedule and reminder email text are only shown | ||
| * when "Send monthly deadline reminder emails?" is set to Yes. | ||
| */ | ||
| export default class extends Controller { | ||
| static targets = ["source", "dependentField"] | ||
|
|
||
| connect() { | ||
| this.toggle() | ||
| } | ||
|
|
||
| toggle() { | ||
| const selected = this.sourceTargets.find((input) => input.checked) | ||
| const show = selected?.value === "true" | ||
| this.dependentFieldTargets.forEach((field) => { | ||
| field.classList.toggle("d-none", !show) | ||
| }) | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 @@ | ||
| <%# | ||
| Shown in place of reminder-configuration fields when the organization has | ||
| turned the relevant reminder emails off on its settings page. | ||
|
|
||
| Locals: | ||
| reminder_type - :deadline, :distribution, or :all | ||
| %> | ||
| <div class="callout callout-info"> | ||
| <h5 class="font-weight-bold"> | ||
| <% case reminder_type %> | ||
| <% when :distribution %> | ||
| Day-before distribution reminder emails are turned off | ||
| <% when :all %> | ||
| Reminder emails are turned off for your organization | ||
| <% else %> | ||
| Monthly deadline reminder emails are turned off | ||
| <% end %> | ||
| </h5> | ||
| <p class="mb-0"> | ||
| Your organization has turned this off, so these emails will not be sent. | ||
| <% if can_administrate? %> | ||
| <%= link_to "Change this in your organization settings", edit_organization_path %>. | ||
| <% else %> | ||
| Contact your organization administrator to change this. | ||
| <% end %> | ||
| </p> | ||
| </div> |
15 changes: 15 additions & 0 deletions
15
db/migrate/20260829112930_add_reminder_toggles_to_organizations.rb
This file contains hidden or 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,15 @@ | ||
| class AddReminderTogglesToOrganizations < ActiveRecord::Migration[8.1] | ||
| def up | ||
| add_column :organizations, :deadline_reminders_enabled, :boolean, null: false, default: false | ||
| add_column :organizations, :distribution_reminders_enabled, :boolean, null: false, default: false | ||
|
|
||
| # Set the existing orgs value to true. | ||
| # This preserves current behavior since emails only get sent if the org already has reminder settings. | ||
| Organization.update_all(deadline_reminders_enabled: true, distribution_reminders_enabled: true) | ||
| end | ||
|
|
||
| def down | ||
| remove_column :organizations, :distribution_reminders_enabled | ||
| remove_column :organizations, :deadline_reminders_enabled | ||
| end | ||
| end |
This file contains hidden or 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 hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.