mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-02 20:25:47 +00:00
fix(slack-integration): improve channel handling by filtering empty values and update Microsoft Teams badge status
This commit is contained in:
@@ -25,15 +25,15 @@ const handleSlackNotification = async ({
|
|||||||
switch (notification.type) {
|
switch (notification.type) {
|
||||||
case TriggerFeature.ACCESS_REQUEST:
|
case TriggerFeature.ACCESS_REQUEST:
|
||||||
case TriggerFeature.ACCESS_REQUEST_UPDATED:
|
case TriggerFeature.ACCESS_REQUEST_UPDATED:
|
||||||
targetChannelIds = slackConfig.accessRequestChannels?.split(", ") || [];
|
targetChannelIds = slackConfig.accessRequestChannels?.split(", ").filter(Boolean) || [];
|
||||||
isEnabled = slackConfig.isAccessRequestNotificationEnabled;
|
isEnabled = slackConfig.isAccessRequestNotificationEnabled;
|
||||||
break;
|
break;
|
||||||
case TriggerFeature.SECRET_APPROVAL:
|
case TriggerFeature.SECRET_APPROVAL:
|
||||||
targetChannelIds = slackConfig.secretRequestChannels?.split(", ") || [];
|
targetChannelIds = slackConfig.secretRequestChannels?.split(", ").filter(Boolean) || [];
|
||||||
isEnabled = slackConfig.isSecretRequestNotificationEnabled;
|
isEnabled = slackConfig.isSecretRequestNotificationEnabled;
|
||||||
break;
|
break;
|
||||||
case TriggerFeature.SECRET_SYNC_ERROR:
|
case TriggerFeature.SECRET_SYNC_ERROR:
|
||||||
targetChannelIds = slackConfig.secretSyncErrorChannels?.split(", ") || [];
|
targetChannelIds = slackConfig.secretSyncErrorChannels?.split(", ").filter(Boolean) || [];
|
||||||
isEnabled = slackConfig.isSecretSyncErrorNotificationEnabled;
|
isEnabled = slackConfig.isSecretSyncErrorNotificationEnabled;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
+1
-1
@@ -93,7 +93,7 @@ export const MicrosoftTeamsConfigRow = ({
|
|||||||
)}
|
)}
|
||||||
</Td>
|
</Td>
|
||||||
<Td>
|
<Td>
|
||||||
<Badge variant="danger">Coming Soon</Badge>
|
<Badge variant="danger">Disabled</Badge>
|
||||||
</Td>
|
</Td>
|
||||||
<Td>
|
<Td>
|
||||||
<DropdownMenu>
|
<DropdownMenu>
|
||||||
|
|||||||
+3
-3
@@ -141,19 +141,19 @@ export const SlackIntegrationForm = ({ onClose }: Props) => {
|
|||||||
if (slackChannels) {
|
if (slackChannels) {
|
||||||
setValue(
|
setValue(
|
||||||
"secretRequestChannels",
|
"secretRequestChannels",
|
||||||
slackConfig.secretRequestChannels
|
(slackConfig.secretRequestChannels || "")
|
||||||
.split(", ")
|
.split(", ")
|
||||||
.filter((channel) => channel in slackChannelIdToName)
|
.filter((channel) => channel in slackChannelIdToName)
|
||||||
);
|
);
|
||||||
setValue(
|
setValue(
|
||||||
"accessRequestChannels",
|
"accessRequestChannels",
|
||||||
slackConfig.accessRequestChannels
|
(slackConfig.accessRequestChannels || "")
|
||||||
.split(", ")
|
.split(", ")
|
||||||
.filter((channel) => channel in slackChannelIdToName)
|
.filter((channel) => channel in slackChannelIdToName)
|
||||||
);
|
);
|
||||||
setValue(
|
setValue(
|
||||||
"secretSyncErrorChannels",
|
"secretSyncErrorChannels",
|
||||||
slackConfig.secretSyncErrorChannels
|
(slackConfig.secretSyncErrorChannels || "")
|
||||||
.split(", ")
|
.split(", ")
|
||||||
.filter((channel) => channel in slackChannelIdToName)
|
.filter((channel) => channel in slackChannelIdToName)
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user