-
Notifications
You must be signed in to change notification settings - Fork 297
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
make mobile app notification title and subtitle templatable #3845
Conversation
engine/apps/alerts/migrations/0045_alertreceivechannel_mobile_app_message_template_and_more.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From a mobile point of view it looks great
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doc updates look good! thanks :)
templatable (sans messaging backend usage) finalizing things final tweaks fix test add one more test case
8359f64
to
c071ce6
Compare
@@ -10,6 +10,7 @@ class BaseMessagingBackend: | |||
|
|||
templater = None | |||
template_fields = ("title", "message", "image_url") | |||
skip_default_template_fields = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this to avoid having these auto-added as the default template values (see usage here):
(this is a screenshot of the Web templates but the same values were showing up by default for Mobile app templates (even though the templates for these fields in the alert_receive_channel.messaging_backends_templates
object were not set))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with the latest commit, c071ce6, labels cannot be (easily w/o decent refactor/hackery) used in the templates here because I am using the MessagingBackend
/AlertTemplater
approach. AlertTemplater
will need to be refactored to support the concept of labels.
Otherwise 27ecdd4 supports the usage of labels
in the templates (but as a caveat adds two new columns to the AlertReceiveChannel
table, as it does not use the MessagingBackend
approach)
# this is a dirty hack to get around EXTRA_MESSAGING_BACKENDS being set in settings/ci-test.py | ||
# we can't simply change the value because 100s of tests fail as they rely on the value being set to a specific value 🫠 | ||
# see where this value is used in the unitest.mock.patch calls down below for more context |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if there's a better approach here?
I wasn't very fond on updating 100+ tests in this PR, that're tightly coupled to the value of EXTRA_MESSAGING_BACKENDS
in settings/ci-test.py
# What this PR does Closes #2050 https://www.loom.com/share/cca9af04f905456087f25e9cbf1845ab ## Checklist - [x] Unit, integration, and e2e (if applicable) tests updated - [x] 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)
What this PR does
Closes #2050
https://www.loom.com/share/cca9af04f905456087f25e9cbf1845ab
Checklist
pr:no public docs
PR label added if not required)CHANGELOG.md
updated (orpr:no changelog
PR label added if not required)