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

Unhide direct paging integration #2483

Merged
merged 15 commits into from
Jul 13, 2023
Merged

Unhide direct paging integration #2483

merged 15 commits into from
Jul 13, 2023

Conversation

iskhakov
Copy link
Contributor

@iskhakov iskhakov commented Jul 10, 2023

What this PR does

Fixes #2442

Screen.Recording.2023-07-10.at.11.12.07.PM.mov

Which issue(s) this PR fixes

Checklist

  • Unit, integration, and e2e (if applicable) tests updated
  • Documentation added (or pr:no public docs PR label added if not required)
  • CHANGELOG.md updated (or pr:no changelog PR label added if not required)

@iskhakov iskhakov requested a review from a team July 10, 2023 15:39
@iskhakov iskhakov self-assigned this Jul 10, 2023
@iskhakov iskhakov requested a review from a team July 10, 2023 15:39
@iskhakov iskhakov force-pushed the iskhakov/polish-direct-paging branch from 7422340 to f29c9dc Compare July 10, 2023 15:44
IntegrationHelper.getChatOpsChannels(alertReceiveChannelStore.channelFilters[channelFilterId], store)
.filter((channel) => channel)
.map((channel) => {
if (!channelKeys.has(channel.name + channel.icon)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

it's better to extract this to var const channelKey = channel.name + channel.icon and use it below

let channelKeys = new Set();
filterIds.map((channelFilterId) => {
IntegrationHelper.getChatOpsChannels(alertReceiveChannelStore.channelFilters[channelFilterId], store)
.filter((channel) => channel)
Copy link
Contributor

@maskin25 maskin25 Jul 12, 2023

Choose a reason for hiding this comment

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

weird that we need to filter here, why might they be nullable? maybe we need to filter them on backend side....

{chatOpsAvailableChannels.map(
(chatOpsChannel: { name: string; icon: IconName }, chatOpsIndex) => (
<div
key={`${chatOpsChannel?.name}-${chatOpsIndex}`}
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe key=chatOpsChannel?.name+chatOpsChannel?.icon? and actually you can get rid of question mark here chatOpsChannel?.name because you iterate over array and chatOpsChannel cannot be undefined inside loop

@@ -960,6 +960,17 @@ const HowToConnectComponent: React.FC<{ id: AlertReceiveChannel['id'] }> = ({ id
const item = alertReceiveChannelStore.items[id];
const url = item?.integration_url || item?.inbound_email;

const howToConnectTagName = (integration: string) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe use enum like

enum IntegrationKind {
DIRECT_PAGING='direct_paging',
EMAIL='email''
}

and map object to get names:

 const integrationToName = { IntegrationKind.DIRECT_PAGING:'Manual'. IntegrationKind.EMAIL:'email' }

and then

const name=integrationToName[integration]||'HTTP Endpoint'

@iskhakov iskhakov added the pr:no public docs Added to a PR that does not require public documentation updates label Jul 12, 2023
@iskhakov iskhakov merged commit 0b28815 into dev Jul 13, 2023
@iskhakov iskhakov deleted the iskhakov/polish-direct-paging branch July 13, 2023 05:41
brojd pushed a commit that referenced this pull request Sep 18, 2024
# What this PR does
Fixes #2442



https://github.com/grafana/oncall/assets/2262529/08bb8e5f-acc6-4f2d-9e38-717c9f37e3da





## Which issue(s) this PR fixes

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated
- [ ] Documentation added (or `pr:no public docs` PR label added if not
required)
- [ ] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:no public docs Added to a PR that does not require public documentation updates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Broken "bring someone from the team" use-case
3 participants