-
Notifications
You must be signed in to change notification settings - Fork 299
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
Conversation
7422340
to
f29c9dc
Compare
grafana-plugin/src/containers/GrafanaTeamSelect/GrafanaTeamSelect.tsx
Outdated
Show resolved
Hide resolved
grafana-plugin/src/components/ManualAlertGroup/ManualAlertGroup.tsx
Outdated
Show resolved
Hide resolved
grafana-plugin/src/components/ManualAlertGroup/ManualAlertGroup.tsx
Outdated
Show resolved
Hide resolved
grafana-plugin/src/components/ManualAlertGroup/ManualAlertGroup.tsx
Outdated
Show resolved
Hide resolved
grafana-plugin/src/models/alert_receive_channel/alert_receive_channel.types.ts
Outdated
Show resolved
Hide resolved
IntegrationHelper.getChatOpsChannels(alertReceiveChannelStore.channelFilters[channelFilterId], store) | ||
.filter((channel) => channel) | ||
.map((channel) => { | ||
if (!channelKeys.has(channel.name + channel.icon)) { |
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.
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) |
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.
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}`} |
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.
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) => { |
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.
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'
# 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)
What this PR does
Fixes #2442
Screen.Recording.2023-07-10.at.11.12.07.PM.mov
Which issue(s) this PR fixes
Checklist
pr:no public docs
PR label added if not required)CHANGELOG.md
updated (orpr:no changelog
PR label added if not required)