Skip to content
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

feat(notifications): adds approval notifications to the UI #29651

Merged
merged 6 commits into from
Nov 2, 2021

Conversation

scefali
Copy link
Contributor

@scefali scefali commented Oct 28, 2021

This PR adds the UI for approval notifications which is hidden behind the feature flag organization:slack-requsts. These approval notifications require someone with the right permissions to approve or reject requests. These notifications are at an organization level as well.

Screen Shot 2021-10-28 at 1 27 47 PM
Screen Shot 2021-10-28 at 1 28 04 PM

@scefali scefali requested review from ceorourke and mgaeta October 28, 2021 21:44
@github-actions
Copy link
Contributor

github-actions bot commented Oct 28, 2021

size-limit report

Path Base Size (30ba759) Current Size Change
src/sentry/static/sentry/dist/entrypoints/app.js 52.73 KB 52.72 KB -0.01% 🔽
src/sentry/static/sentry/dist/entrypoints/sentry.css 70.89 KB 70.89 KB 0%

@scefali scefali requested a review from a team October 29, 2021 16:39
approval: {
title: t('Approvals'),
description: t('Notifications from teammates that require review or approval.'),
type: 'select',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't this just be on or off?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@NisanthanNanthakumar Correct, it would be on or off. The issue is that we only use the title and description from this (

const {title, description} = ACCOUNT_NOTIFICATION_FIELDS[notificationType];
).

It looks like we used to read all fields a change was made to basically bypass logic depending in the field:

if (['alerts', 'deploy', 'workflow', 'approval'].includes(fineTuneType)) {
return <NotificationSettingsByType notificationType={fineTuneType} />;
}
const {notifications, projects, fineTuneData, projectsPageLinks} = this.state;
const isProject = isGroupedByProject(fineTuneType);
const field = ACCOUNT_NOTIFICATION_FIELDS[fineTuneType];

Looks like a lot of the unused fields weren't cleaned up. We are looking at the options for some of these fields but not all of them. IMO this needs to be fixed because it was very confusing when the fields are treated differently from this file but you won't know until you look at other parts of the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gonna put in another TODO for cleanup

@@ -72,6 +72,7 @@ def provider_str(self) -> str:
(NotificationSettingTypes.DEPLOY, "deploy"),
(NotificationSettingTypes.ISSUE_ALERTS, "issue"),
(NotificationSettingTypes.WORKFLOW, "workflow"),
(NotificationSettingTypes.APPROVAL, "approval"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will actually require a migration because it changes a DB constraint.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mgaeta good point...let me generate that, thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mgaeta I am seeing:

sentry django makemigrations sentry -n approval_notification_type
....
No changes detected in app 'sentry'

Maybe we don't need migrations for this kind of change anymore?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope so that would save a lot of time.

@scefali scefali merged commit 43dff9f into master Nov 2, 2021
@scefali scefali deleted the feat/approval-notifications-ui branch November 2, 2021 16:24
@github-actions github-actions bot locked and limited conversation to collaborators Nov 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants