Commit a95a278
4473 expand reminder date possibilities (#5190)
* Replaces reminder_day with reminder_schedule
Via db migrations, replaces the simple integer `reminder_day` with the more complex
`reminder_schedule` which is an ical string that can be parsed to a repeating Schedule class.
Adjusts the logic in the `fetch_partners_to_reminder_now_service` to use the repeating schedule.
Updates related tests.
* Adds input for the reminder schedule in the Edit Partner Group page
Builds an ActiveModel, ReminderSchedule, which takes the necessary information
and turns it into an IceCubeSchedule, which is what ultimate get saved in the db.
Builds the form for this reminder schedule. Still needs to conditionally show or hide
sections depending on if the user wants date or day of the week.
* Adds Reminder Schedule fields to New and Edit Organization
Now either while creating new Organization/Partner Groups or editing them,
all the transfers from Reminder Date to Reminder Day have been made.
* Makes the day of week or date hide depending on selection
This uses css for ease and accessibility.
* Adds tests and does refactoring
Adds a number of refactors, including moving all the create_schedule logic
to the deadlinable helper, and creates unit and system tests for the new functionality.
* 4473 - Makes same warning appear for reminder date
Reintroduces the functionality of having warnings for having the reminder
date the same as the deadline date.
* Only create new schedule if details have changed
We don't want to create a new schedule if nothing has changed,
as it will reset the start date and potentially mess with those
who have every 2/3/etc months reminders.
* 4473 - Removes Every N Months
All reminders should be Monthly, so every N Months is removed.
Also allows users to select "Last" as an option.
* 4473 - Updates names of Month vs Week fields
Rather than "date" and "week_day", we are now using "day_of_month" and
"day_of_week" for clarity.
* 4473 - fixes reminder day vs deadline display bug
There was a bug in which if the reminder day of the month was the same
as the deadline day, it would dislplay the error message even if the user
changed to the day of the week option. Now the error message is hidden if
the user is selecting the day of the week option.
* Changes made by linter
* Removed references to factored out ReminderSchedule model
* Removed reference to factored out reminder_day
* Removed redundant/outdated additions to the organizations detail page
* Fixed accidentally removing receive_email_on_requests from organization_params during merge
* Updated organization system specs to reflect current organization details page and verify new reminder schedule interface
* Added every_nth_month field to let users specify a monthly frequency for reminders
* Cleaned up _deadline_day_fields.html.erb and reworked it to hook up to new stimulus controller, replaced conditional SASS rule with JS implementation for sake of readability/maintainability
* Updated deadline_day_controller to calculate the reminder and deadline dates using new rrule library
* Reworked deadlinable specs to use explicit, hardcoded values
* Updated check for same reminder and deadline days to only consider dayOfMonth and deadlineDay fields, as exact remidner date will shift when using byDayOfWeek
* Renamed validations to clairfy they validate the day_of_month field and not the reminder date more generally
* Updated should_update_reminder_schedule and create_schedule to be public since they don't have side effects, tweaked should_update_reminder_schedule
* Added specs for remaining deadlinable functions
* Fixed specs using wrong type of params for creating schedules
* Added spec to validate that if a partner has reminders disabled but is part of a group with reminders, it still receives a reminder
* Added spec to verify that the partner group deadline day is prioritized over the organization deadline day
* Removed redundant checks on deadlinable fields from other models' specs
* Fixed labels not being correctly hooked up to radio buttons
* Updated description of deadlines to specify they always happen after the reminder
* Updated deadline_day_controller to let user know when their input violates the between 1 and 28 constraint on dayOfMonth and deadlineDay
* Added specs for shared deadline day form in the three pages where that form is used
* Added spec to verify that the reminder and deadlines dates are consistent across the front and back end
* Fixed spec refering to old radio button id
* Changes made by linter
* Updated and modified documentation to explain how reminder schedules work
* Fixed PartnerGroup not checking if reminder_schedule needs to be updates, added comments explaining need for the check
* Forgot to include Gemfile.lock
* Changes made by linter
* Updated spec to not use Organization.short_name
* Forgot to run linter
* Fixed migration not correctly converting reminder_day to reminder_schedule
* First pass at adding start_date to deadline day form
* Updated tests to consider start date
* Forgot to add tests for get_values_from_reminder_schedule
* Changes made by linter
* Reworked create_schedule to start the schedule at the current date time if a start_date isn't provided
* Reworked wording of deadline day form, updated javascript controller to calculate next reminder day after the current date
* Removed confusing commented out configurations
* Expanded tests to cover all combinations of the order of the start, current, and reminder dates
* Fixed tests not setting deadline_day which made partner_groups fail validation
* Removed unecessary should_update_reminder_schedule and from_ical functions
* Extended untilDate calculation to account for week day rules that would be more than exactly monthylInterval months out
* Updated factories to not set a deadline_day as it was causing issues with deadline_day_fields_shared_example tests
* Changes made by linter
* Renamed reminder schedule field, removed migration that removed reminder_day field, and added first pass at ReminderScheduleService [skip ci]
* Removed validations from ReminderScheduleService that rely on the parent object
* Minor change to make conditional cleaner
* Factored out ReminderScheduleable concern, updated _deadline_day_fields form to use a ReminderScheduleService object instead of an ActiveRecord object [skip ci]
* Slightly reworked how attributes are assigned to the reminder_schedule
* Updated partner groups and admin organizations controller to use the new ReminderScheduleService object
* Updated deadline day fields tests to only fill out the form with dates between 1 and 28
* Exposed IceCube occurs_on? function through ReminderScheduleService and updated FetchPartnersToRemindNowService to use it
* Fixed day_of_week and every_nth_day validations not casting before comparing
* Reverted change to _details because it didn't show 'Not defined' for an empty schedule object
* Updated shared deadline day field tests to reflect the new form
* Forgot to update partner group form to use new deadline_day_fields partial
* Moved test comparing output of FetchPartnersToRemindNowService to what is shown in the form out of the shared examples, as orgs created via the admin interface won't have partners
* Removed outdated test on removed edit_admin_organization_path, moved tests on deadline day form to happen on new_admin_organization_path
* Made reminder_schedule_service params permitted but optional
* Removed reminder schedule definitions from org and partner group factories as they aren't necessary to initializing those models
* Updated tests to use new reminder schedule service
* Updated reminder_schedule_is_empty_or_valid? to not raise errors if the user hasn't filled out the form at all, added a check to partner groups to make sure a valid reminder schedule is present when send_reminders is true
* Teaked custom validation functions to explicitly check for presence of field
* Added tests for the ReminderScheduleService
* Removed old concerns and associated tests
* Changes made by linter
* Addressed linter's warning about using mixed logical operators in an unless condition
* Reworked DeadlineService and exposed IceCube schedule next_occurrence to show user next reminder and deadline date in views
* Added tests to verify reminder and deadilne dates added to organization and partner group views
* Updated the reminder schedule form to instruct users how to set the start date for non-monthly schedules and warn them about same-day schedules likely not firing
* Changes made by linter
* Removed start_date and every_nth_month fields from ReminderScheduleService, now assuming all schedules are monthyl and start today; removed associated tests
* Changed field label to be consistent with reminder day of week label
* Forgot to remove unnecessary test now that start_date isn't tracked
* Changed wording of deadline day field
* Fixed deadline day controller incorrectly predicting deadline day if reminder would be sent on the 31st of a month
* Updated user guide to reflect reduced scope of reminder schedule form
* Fixed deadline_day being checked against day_of_month even for by_day_of_week schedules, added tests to verify
* Forgot to add comment
* Reworked reminder_schedule_is_empty_or_valid? conditionals to be more readable
* Combined multiple asserts into larger it blocks for the sake of performance
* Moved tests that didn't rely on javascript to requests
* Moved definition of safe_add/subtract_days so they can be used in other tests, used them to fix test failing intermitently on the 14th
---------
Co-authored-by: Jesse Landis-Eigsti <[email protected]>1 parent 7f5b420 commit a95a278
File tree
50 files changed
+1657
-288
lines changed- app
- controllers
- admin
- javascript
- controllers
- utils
- mailers
- models
- concerns
- services
- partners
- views
- admin/organizations
- organizations
- partner_groups
- partners
- config
- environments
- db
- migrate
- docs/user_guide/bank
- images/partners
- spec
- factories
- mailers
- models
- concerns
- requests
- services
- partners
- support
- system
- admin
- vendor/javascript
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
50 files changed
+1657
-288
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
| 98 | + | |
97 | 99 | | |
98 | 100 | | |
99 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
278 | | - | |
279 | 278 | | |
280 | 279 | | |
281 | 280 | | |
| |||
784 | 783 | | |
785 | 784 | | |
786 | 785 | | |
| 786 | + | |
787 | 787 | | |
788 | 788 | | |
789 | 789 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | 33 | | |
35 | | - | |
| 34 | + | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
78 | 83 | | |
79 | 84 | | |
80 | 85 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
112 | 116 | | |
113 | 117 | | |
114 | 118 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| 26 | + | |
24 | 27 | | |
25 | 28 | | |
26 | 29 | | |
27 | 30 | | |
| 31 | + | |
28 | 32 | | |
29 | 33 | | |
30 | 34 | | |
| |||
52 | 56 | | |
53 | 57 | | |
54 | 58 | | |
55 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
56 | 64 | | |
57 | 65 | | |
58 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
This file was deleted.
0 commit comments