-
Notifications
You must be signed in to change notification settings - Fork 291
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add user locale field to mobile app user settings table + change goin…
…g on call push notification text (#2131) # What this PR does - add user locale field to mobile app user settings table + add a test that sends `PATCH` requests to this endpoint - change "you're going on call" push notification text to include localized shift time. The general format is now: ```python f"You're going on call in {time_until_going_oncall} for schedule {schedule.name}, {formatted_shift}" ``` - `time_until_going_oncall` is a "human-readable" format of the time until the start) - `schedule.name` is self-explanatory - `formatted_shift` this depends on the shift. If the shift starts and ends on the same day, the format will be "HH:mm - HH:mm". Otherwise, if the shift starts and ends on different days, the format will be "YYYY-MM-DD HH:mm - YYYY-MM-DD HH:mm". **Note** that all datetime related formatting will use the new `locale` field that we are now storing in the mobile app user settings table. If no locale is yet present we will fallback to "en" ## Which issue(s) this PR fixes closes #2024 grafana/oncall-mobile-app#187 ## Checklist - [x] Unit, integration, and e2e (if applicable) tests updated - [ ] Documentation added (or `pr:no public docs` PR label added if not required) - [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not required)
- Loading branch information
1 parent
c8669ce
commit 572131b
Showing
10 changed files
with
346 additions
and
19 deletions.
There are no files selected for viewing
This file contains 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
18 changes: 18 additions & 0 deletions
18
engine/apps/mobile_app/migrations/0008_mobileappusersettings_locale.py
This file contains 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,18 @@ | ||
# Generated by Django 3.2.19 on 2023-06-08 10:51 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('mobile_app', '0007_alter_mobileappusersettings_info_notifications_enabled'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='mobileappusersettings', | ||
name='locale', | ||
field=models.CharField(max_length=50, null=True), | ||
), | ||
] |
This file contains 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 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 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 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.