Merge pull request #478 from buster-so/big-nate/bus-1361-slack-integration-tweaks

Update slack integrations
This commit is contained in:
Nate Kelley 2025-07-10 15:07:43 -06:00 committed by GitHub
commit 232b0d28b7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 15 additions and 3 deletions

View File

@ -15,8 +15,8 @@ import {
import { Dropdown, type DropdownItems } from '@/components/ui/dropdown'; import { Dropdown, type DropdownItems } from '@/components/ui/dropdown';
import { LinkSlash, Refresh2 } from '@/components/ui/icons'; import { LinkSlash, Refresh2 } from '@/components/ui/icons';
import { Select } from '@/components/ui/select'; import { Select } from '@/components/ui/select';
import { StatusCard } from '@/components/ui/card/StatusCard';
import { useMemoizedFn } from '@/hooks'; import { useMemoizedFn } from '@/hooks';
import { StatusCard } from '@/components/ui/card/StatusCard';
export const SlackIntegrations = React.memo(() => { export const SlackIntegrations = React.memo(() => {
const { const {
@ -112,6 +112,7 @@ const ConnectedSlackChannels = React.memo(() => {
const { const {
data: slackChannelsData, data: slackChannelsData,
isLoading: isLoadingSlackChannels, isLoading: isLoadingSlackChannels,
isRefetching: isRefetchingSlackChannels,
refetch: refetchSlackChannels, refetch: refetchSlackChannels,
isFetched: isFetchedSlackChannels, isFetched: isFetchedSlackChannels,
error: slackChannelsError error: slackChannelsError
@ -136,10 +137,13 @@ const ConnectedSlackChannels = React.memo(() => {
}); });
}); });
const showLoadingButton =
isLoadingSlackChannels || isLoadingSlackIntegration || isRefetchingSlackChannels;
return ( return (
<div className="flex items-center justify-between space-x-4"> <div className="flex items-center justify-between space-x-4">
<div className="flex flex-col space-y-0.5"> <div className="flex flex-col space-y-0.5">
<Text>Alerts channels</Text> <Text>Alerts channel</Text>
<Text variant="secondary" size={'xs'}> <Text variant="secondary" size={'xs'}>
Select which slack channel Buster should send alerts to Select which slack channel Buster should send alerts to
</Text> </Text>
@ -151,7 +155,14 @@ const ConnectedSlackChannels = React.memo(() => {
<Button <Button
size={'tall'} size={'tall'}
variant="ghost" variant="ghost"
suffix={<Refresh2 />} loading={showLoadingButton}
suffix={
!showLoadingButton && (
<span className="flex items-center justify-center text-base">
<Refresh2 />
</span>
)
}
onClick={() => refetchSlackChannels()}> onClick={() => refetchSlackChannels()}>
Refresh Refresh
</Button> </Button>
@ -163,6 +174,7 @@ const ConnectedSlackChannels = React.memo(() => {
placeholder="Select a channel" placeholder="Select a channel"
value={selectedChannelId} value={selectedChannelId}
onChange={onChange} onChange={onChange}
search={true}
loading={isLoadingSlackChannels || isLoadingSlackIntegration} loading={isLoadingSlackChannels || isLoadingSlackIntegration}
/> />
</> </>