integreat-cms
integreat-cms copied to clipboard
Require the title field for all region default languages in push notification form
Short description
This pr makes the title field in the push notification form required for every language that is a default language in one of the push notifications regions. This fixes two issues:
- Previously, only the title field of the first language of the query was required, even if it differed from the primary regions language.
- With the first problem fixed, it was still undefined what happened if a push notification was assigned to two regions with different default languages. The title was arbitrarily required for the language of either region, but not both.
Proposed changes
- Require the title field for all region default languages in push notification form
- Do a small refactor on the push notification form view post handler, to make it easier to add this functionality
Side effects
It is still arbitrary what will be used as the default language if a push notification without title and text gets send. Maybe we should always use the default language of the region from which the push notification was sent?
Resolved issues
Fixes: #2722
Code Climate has analyzed commit 4261baa9 and detected 0 issues on this pull request.
The test coverage on the diff in this pull request is 62.1% (50% is the threshold).
This pull request will bring the total coverage in the repository to 81.8% (0.0% change).
View more on Code Climate.
It is still arbitrary what will be used as the default language if a push notification without title and text gets send. Maybe we should always use the default language of the region from which the push notification was sent?
This is probably a question for @osmers or for the next weekly :)