fix(slack-integration): improve channel handling by filtering empty values and update Microsoft Teams badge status

This commit is contained in:
Victor Santos
2025-10-27 09:44:09 -03:00
parent c1dc3c2b76
commit 16cf4a91c0
3 changed files with 7 additions and 7 deletions

View File

@@ -25,15 +25,15 @@ const handleSlackNotification = async ({
switch (notification.type) {
case TriggerFeature.ACCESS_REQUEST:
case TriggerFeature.ACCESS_REQUEST_UPDATED:
targetChannelIds = slackConfig.accessRequestChannels?.split(", ") || [];
targetChannelIds = slackConfig.accessRequestChannels?.split(", ").filter(Boolean) || [];
isEnabled = slackConfig.isAccessRequestNotificationEnabled;
break;
case TriggerFeature.SECRET_APPROVAL:
targetChannelIds = slackConfig.secretRequestChannels?.split(", ") || [];
targetChannelIds = slackConfig.secretRequestChannels?.split(", ").filter(Boolean) || [];
isEnabled = slackConfig.isSecretRequestNotificationEnabled;
break;
case TriggerFeature.SECRET_SYNC_ERROR:
targetChannelIds = slackConfig.secretSyncErrorChannels?.split(", ") || [];
targetChannelIds = slackConfig.secretSyncErrorChannels?.split(", ").filter(Boolean) || [];
isEnabled = slackConfig.isSecretSyncErrorNotificationEnabled;
break;
default:

View File

@@ -93,7 +93,7 @@ export const MicrosoftTeamsConfigRow = ({
)}
</Td>
<Td>
<Badge variant="danger">Coming Soon</Badge>
<Badge variant="danger">Disabled</Badge>
</Td>
<Td>
<DropdownMenu>

View File

@@ -141,19 +141,19 @@ export const SlackIntegrationForm = ({ onClose }: Props) => {
if (slackChannels) {
setValue(
"secretRequestChannels",
slackConfig.secretRequestChannels
(slackConfig.secretRequestChannels || "")
.split(", ")
.filter((channel) => channel in slackChannelIdToName)
);
setValue(
"accessRequestChannels",
slackConfig.accessRequestChannels
(slackConfig.accessRequestChannels || "")
.split(", ")
.filter((channel) => channel in slackChannelIdToName)
);
setValue(
"secretSyncErrorChannels",
slackConfig.secretSyncErrorChannels
(slackConfig.secretSyncErrorChannels || "")
.split(", ")
.filter((channel) => channel in slackChannelIdToName)
);