AO3-6277 Make email and the Matching page reflect it when match generation results in no matches#5512
Conversation
|
I'm the procrastinator and forgot what else I wanted to do by now, so ready for review I guess. It might needs more tests? I couldn't actually get the "No potential matches were found" page to show up locally consistently (sometimes it becomes "No potential matches yet!"), but the test succeeds every time I run it, so not sure if that's an issue with the code... though i also had web and tests actually behave differently earlier... Also it resets the "no matches found" status and allows re-generating matches every time when any challenge settings get updated, even if they wouldn't have an effect on the ability to generate matches, bad idea or doesn't matter? |
| ) | ||
| end | ||
|
|
||
| def no_potential_matches_notification(collection_id, email) |
There was a problem hiding this comment.
I think this make more sense in https://github.com/otwcode/otwarchive/blob/master/app/mailers/collection_mailer.rb (or even a new gift exchange mailer)
There was a problem hiding this comment.
there are a lot of challenge-related emails in user_mailer, should i move all other ones too then?
There was a problem hiding this comment.
the item added notification is emailed only to the collection email, never maintainers, so i'm not so sure if we should combine emails that can go to maintainers into collection_mailer
| @@ -0,0 +1,5 @@ | |||
| class AddNoPotentialMatchesFoundToGiftExchanges < ActiveRecord::Migration[7.2] | |||
| def change | |||
| add_column :gift_exchanges, :no_potential_matches_found, :boolean, default: false, null: false | |||
There was a problem hiding this comment.
Can't we just use this?
@collection.challenge.no_potential_matches_found?I'm not sure why the extra database column is needed 🤔
Pull Request Checklist
as the first thing in your pull request title (e.g.
AO3-1234 Fix thing)until they are reviewed and merged before creating new pull requests.
Issue
https://otwarchive.atlassian.net/browse/AO3-6277
Purpose
When a gift exchange's match generation results in no matches, sends a "No potential matches found" email and makes the Matching page reflect the matching status appropriately too.
Also prepares some other Matching page states for localization, I got a bit carried away...
Credit
slavalamp (they/them)