mirror of https://github.com/buster-so/buster.git
Update slack integrations
This commit is contained in:
parent
fcfc483c67
commit
1151b72467
|
@ -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}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
|
|
Loading…
Reference in New Issue