-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
ref(hybrid-cloud): Restrict notification settings UX to a single organization #50279
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
Conversation
…ion settings to a single organization. This is required to simplify some user notification setting APIs and make them compatible with hybrid cloud.
🚨 Warning: This pull request contains Frontend and Backend changes! It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently. Have questions? Please ask in the |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #50279 +/- ##
==========================================
+ Coverage 74.71% 79.37% +4.66%
==========================================
Files 4901 4923 +22
Lines 206414 206690 +276
Branches 35296 35333 +37
==========================================
+ Hits 154212 164068 +9856
+ Misses 46936 37599 -9337
+ Partials 5266 5023 -243
|
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.
Seems good, there is an issue with the component props.
src/sentry/notifications/helpers.py
Outdated
team_providers = ExternalActor.objects.filter( | ||
actor_id=recipient.actor_id, provider__in=possible_providers | ||
).values_list("provider", flat=True) | ||
return [get_provider_enum(provider) for provider in team_providers] |
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.
Was the team scenario never used? Looking at the call sites it looks like they are all User only.
const fineTuneType = getNotificationTypeFromPathname(pathnameType); | ||
const endpoints = [ | ||
['notifications', '/users/me/notifications/'], | ||
['fineTuneData', `/users/me/notifications/${fineTuneType}/`], | ||
]; | ||
|
||
if (isGroupedByProject(fineTuneType)) { | ||
endpoints.push(['projects', '/projects/']); | ||
endpoints.push(['projects', `/projects/?organization_id=${orgId}`]); |
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.
endpoints.push(['projects', `/projects/?organization_id=${orgId}`]); | |
endpoints.push(['projects', `/projects/?organizationId=${orgId}`]); |
To go with the other casing change.
'projects', | ||
`/projects/`, | ||
{ | ||
query: {organization_id: this.props.organizationId}, |
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.
query: {organization_id: this.props.organizationId}, | |
query: {organizationId: this.props.organizationId}, |
To go with the other change.
static/app/views/settings/account/notifications/notificationSettingsByProjects.tsx
Outdated
Show resolved
Hide resolved
{canSearch && | ||
this.renderSearchInput({ | ||
stateKey: 'projects', | ||
url: `/projects/?organization_id=${this.props.organizationId}`, |
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.
url: `/projects/?organization_id=${this.props.organizationId}`, | |
url: `/projects/?organizationId=${this.props.organizationId}`, |
// issue, quotaErrors, quotaTransactions, quotaAttachments, | ||
// quotaReplays, quotaWarnings, quotaSpendAllocations |
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.
Are these cases that still need to be handled or cases where the default is ''?
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.
The latter, I'll clarify
|
||
self.login_as(user=user, superuser=False) | ||
|
||
response = self.get_success_response(qs_params={"organization_id": str(org.id)}) |
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.
response = self.get_success_response(qs_params={"organization_id": str(org.id)}) | |
response = self.get_success_response(qs_params={"organizationId": str(org.id)}) |
…ttingsByProjects.tsx Co-authored-by: Mark Story <[email protected]>
Refactor the notification settings page to restrict viewing notification settings to a single organization. This is required to simplify some user notification setting APIs and make them compatible with hybrid cloud.
Currently the user notifications APIs return "virtual" notification settings for every project. This page doesn't really use those settings, it instead renders projects from the list of projects and merges in what gets returned. I think it should work fine if we only return actual notification settings records, which will allow us to simplify the user notification settings endpoints by removing these "virtual" entries -- assuming this was the only use case.