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(growth): adds set up slack button to issue alert page #28546

Merged
merged 6 commits into from Sep 15, 2021

Conversation

scefali
Copy link
Member

@scefali scefali commented Sep 13, 2021

This PR adds a button that says "Set Up Slack" on the issue alert creation page if the organization doesn't have any alerting integrations set up for that project. We do this because some folks may not realize Slack is an available integration. For SaaS, we send the user to the integration page for Slack. For on-prem, we send them to docs. This is similar to what we've done for the issue alert emails (#26085).

Screen Shot 2021-09-14 at 12 13 58 AM

@scefali scefali requested review from a team September 13, 2021 21:16
@scefali scefali requested a review from a team as a code owner September 13, 2021 21:16
};

return (
<Tooltip title={t('Send Alerts to Slack. Install the integration now.')}>
Copy link
Member

Choose a reason for hiding this comment

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

Can you at least leave a TODO above this about the tooltip problem

Copy link
Member Author

Choose a reason for hiding this comment

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

from sentry.notifications.utils import has_alert_integration


class ProjectHasAlertIntegrationInstalled(ProjectEndpoint):
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add hasAlertIntegrationInstalled as an extend parameter to the ProjectSerializer?

Copy link
Member Author

Choose a reason for hiding this comment

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

hmmm...let me think about it

Copy link
Member

Choose a reason for hiding this comment

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

I agree w/ this yeah.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think we have anything for expand yet for the ProjectSerializer but I can go ahead and add it for that endpoint

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

@mgaeta Optional parameters to project serialization is kind of a mess here. I see we are using include for optional params on the project details endpoint so I just added it to there and added a TODO.

Copy link
Contributor

Choose a reason for hiding this comment

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

Cool we can refactor the endpoint when we add expand to the project serializer. Can you put your variable in an expand now so that it won't be a breaking change later?

expand = set(filter(bool, request.GET.get("expand", "").split(",")))
if "hasAlertIntegration" in expand:
  ...

Copy link
Member Author

Choose a reason for hiding this comment

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

@mgaeta You mean so we can use expand or include? Right now we are using include for the same purpose

Copy link
Contributor

Choose a reason for hiding this comment

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

include is deprecated so your new variable should be in expand. In this case, both query parameters would be used.

Copy link
Member Author

Choose a reason for hiding this comment

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

@mgaeta got it, updated so only the new param uses expand

organization={organization}
/>
);
await tick();
Copy link
Member

@scttcper scttcper Sep 14, 2021

Choose a reason for hiding this comment

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

ticks are from enzyme. if it isn't passing without it wrap the expect with await waitFor

https://testing-library.com/docs/dom-testing-library/api-async/#waitfor

Copy link
Member

Choose a reason for hiding this comment

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

or try using getByText instead

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.

None yet

4 participants