-
Notifications
You must be signed in to change notification settings - Fork 81
feat(news): hook settings to the backend #17817
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
base: master
Are you sure you want to change the base?
Conversation
Jenkins BuildsClick to see older builds (7)
|
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.
LGTM in general
@@ -11,9 +11,11 @@ QtObject { | |||
readonly property string keyUid: userProfile.keyUid | |||
|
|||
// The following properties wrap Privacy and Security View related properties: | |||
property bool isStatusNewsViaRSSEnabled: true /*TODO: Connect it to the backend corresponding property*/ | |||
property bool isStatusNewsViaRSSEnabled: appSettings.newsRSSEnabled |
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.
readonly
@@ -55,6 +55,9 @@ const PROFILE_MIGRATION_NEEDED* = "profile-migration-needed" | |||
const KEY_URL_UNFURLING_MODE* = "url-unfurling-mode" | |||
const KEY_AUTO_REFRESH_TOKENS* = "auto-refresh-tokens-enabled" | |||
const KEY_LAST_TOKENS_UPDATE* = "last-tokens-update" | |||
const KEY_NEWS_FEED_ENABLED* = "news-feed-enabled?" | |||
const KEY_NEWS_NOTIFICATIONS_ENABLED* = "news-notifications-enabled?" | |||
const KEY_NEWS_RSS_ENABLED* = "news-rss-enabled?" |
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 just wouldn't use the question marks in the settings' keys
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.
Agree
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.
Yeah I get your point, but I can't do much about it, it was merged already with the question mark in status-go (not my PR)
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.
Wait...but these are also used as keys for our QSettings?
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 don't think so. I see that we only use them in the service and/or DTO. I renamed the Nim properties and QProperties to something nicer like newsRSSEnabled
.
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.
Good job!!
I have some doubts (probably only related to the UI integration), added as review comments.
# We convert the bools to the right setting | ||
# Send alerts means the News Feed is enabled + notifications are enabled | ||
# Deliver quietly means the News Feed is enabled + notifications are disabled | ||
# Turn off means the News Feed is disabled |
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.
Just to clarify.. since it confused me when I was reading!
# Turn off means the News Feed is disabled | |
# Turn off means the News Feed is disabled + notifications are disabled |
@@ -11,9 +11,11 @@ QtObject { | |||
readonly property string keyUid: userProfile.keyUid | |||
|
|||
// The following properties wrap Privacy and Security View related properties: | |||
property bool isStatusNewsViaRSSEnabled: true /*TODO: Connect it to the backend corresponding property*/ | |||
property bool isStatusNewsViaRSSEnabled: appSettings.newsRSSEnabled |
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.
Now it would be better:
property bool isStatusNewsViaRSSEnabled: appSettings.newsRSSEnabled | |
readonly property bool isStatusNewsViaRSSEnabled: appSettings.newsRSSEnabled |
dc11a2b
to
ffb5eca
Compare
2b837e2
to
e4ab15d
Compare
ffb5eca
to
815e205
Compare
Fixes #17811 Hooks the NewsFeedNotification setting and the RSS setting to the backend. The Notification setting has a bit of complexity on the service side, because while the UI setting is a select of 3 options, the status-go settings are actually 2 bool settings. So the service does some logic to set the right setting from those two. The settings are used to disable the polling if one of the settings is disabled. If the setting is on DeliverQuietly, the AC notif is shown, but no notificaiton
e4ab15d
to
468275a
Compare
Fixes #17811
Based on top of #17809
Status-go PR: status-im/status-go#6540
Hooks the NewsFeedNotification setting and the RSS setting to the backend.
The Notification setting has a bit of complexity on the service side, because while the UI setting is a select of 3 options, the status-go settings are actually 2 bool settings. So the service does some logic to set the right setting from those two.
The settings are used to disable the polling if one of the settings is disabled. If the setting is on DeliverQuietly, the AC notif is shown, but no OS or toast notification
What does the PR do
Hooks the UI settings to the backend settings. Makes the UX for the News Feed complete, once the feature flag on the status-go side is enabled and once we'll have a good RSS feed for Status
Affected areas
Architecture compliance
My PR is consistent with this document: Status Desktop Architecture Guide
Screenshot of functionality
settings-hooked.webm
Impact on end user
None without the feature flag on
Once it's turned on, it let's users choose the right settings for notifications or if they want to disable the feature altogether.
How to test
Risk
Nonce since the feature flag is disabled
Tick one: