Fix Slack User Group search in Escalation Steps (#4332)
# What this PR does Fix Slack User Group search in Escalation Steps ## Which issue(s) this PR closes Closes https://github.com/grafana/support-escalations/issues/10488 ## Checklist - [ ] Unit, integration, and e2e (if applicable) tests updated - [x] Documentation added (or `pr:no public docs` PR label added if not required) - [x] Added the relevant release notes label (see labels prefixed w/ `release:`). These labels dictate how your PR will show up in the autogenerated release notes.
This commit is contained in:
parent
d4ba57b68b
commit
434078186f
14 changed files with 2 additions and 23 deletions
|
|
@ -186,7 +186,6 @@ class _EscalationPolicy extends React.Component<EscalationPolicyProps, any> {
|
|||
<WithPermissionControlTooltip key="users-multiple" userAction={UserActions.EscalationChainsWrite}>
|
||||
<GSelect<ApiSchemas['User']>
|
||||
isMulti
|
||||
showSearch
|
||||
allowClear
|
||||
disabled={isDisabled}
|
||||
displayField="username"
|
||||
|
|
@ -348,7 +347,6 @@ class _EscalationPolicy extends React.Component<EscalationPolicyProps, any> {
|
|||
return (
|
||||
<WithPermissionControlTooltip key="notify_schedule" userAction={UserActions.EscalationChainsWrite}>
|
||||
<GSelect<Schedule>
|
||||
showSearch
|
||||
allowClear
|
||||
disabled={isDisabled}
|
||||
items={scheduleStore.items}
|
||||
|
|
@ -386,6 +384,7 @@ class _EscalationPolicy extends React.Component<EscalationPolicyProps, any> {
|
|||
return (
|
||||
<WithPermissionControlTooltip key="notify_to_group" userAction={UserActions.EscalationChainsWrite}>
|
||||
<GSelect<UserGroup[]>
|
||||
allowClear
|
||||
disabled={isDisabled}
|
||||
items={userGroupStore.items}
|
||||
fetchItemsFn={userGroupStore.updateItems}
|
||||
|
|
@ -415,7 +414,6 @@ class _EscalationPolicy extends React.Component<EscalationPolicyProps, any> {
|
|||
return (
|
||||
<WithPermissionControlTooltip key="custom-webhook" userAction={UserActions.EscalationChainsWrite}>
|
||||
<GSelect<ApiSchemas['Webhook']>
|
||||
showSearch
|
||||
disabled={isDisabled}
|
||||
items={outgoingWebhookStore.items}
|
||||
fetchItemsFn={outgoingWebhookStore.updateItems}
|
||||
|
|
@ -457,7 +455,6 @@ class _EscalationPolicy extends React.Component<EscalationPolicyProps, any> {
|
|||
return (
|
||||
<WithPermissionControlTooltip key="notify_to_team_members" userAction={UserActions.EscalationChainsWrite}>
|
||||
<GSelect<GrafanaTeam>
|
||||
showSearch
|
||||
disabled={isDisabled}
|
||||
items={grafanaTeamStore.items}
|
||||
fetchItemsFn={grafanaTeamStore.updateItems}
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ export const MSTeamsConnector = (props: MSTeamsConnectorProps) => {
|
|||
Post to Microsoft Teams channel
|
||||
<WithPermissionControlTooltip userAction={UserActions.IntegrationsWrite}>
|
||||
<GSelect<MSTeamsChannel>
|
||||
showSearch
|
||||
allowClear
|
||||
className={cx('select', 'control')}
|
||||
items={msteamsChannelStore.items}
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ export const SlackConnector = (props: SlackConnectorProps) => {
|
|||
Slack Channel
|
||||
<WithPermissionControlTooltip userAction={UserActions.IntegrationsWrite}>
|
||||
<GSelect<SlackChannel>
|
||||
showSearch
|
||||
allowClear
|
||||
className={cx('select', 'control')}
|
||||
items={slackChannelStore.items}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,6 @@ export const TelegramConnector = ({ channelFilterId }: TelegramConnectorProps) =
|
|||
Post to telegram channel
|
||||
<WithPermissionControlTooltip userAction={UserActions.IntegrationsWrite}>
|
||||
<GSelect<TelegramChannel>
|
||||
showSearch
|
||||
allowClear
|
||||
className={cx('select', 'control')}
|
||||
items={telegramChannelStore.items}
|
||||
|
|
|
|||
|
|
@ -75,7 +75,6 @@ export const AttachIncidentForm = observer(({ id, onUpdate, onHide }: AttachInci
|
|||
>
|
||||
<WithPermissionControlTooltip userAction={UserActions.AlertGroupsWrite}>
|
||||
<GSelect<ApiSchemas['AlertGroup']>
|
||||
showSearch
|
||||
items={Object.fromEntries(alertGroupStore.alerts)}
|
||||
fetchItemsFn={async (query: string) => {
|
||||
await alertGroupStore.fetchAlertGroups(false, query);
|
||||
|
|
|
|||
|
|
@ -99,7 +99,6 @@ export const EscalationChainForm: FC<EscalationChainFormProps> = (props) => {
|
|||
getSearchResult={grafanaTeamStore.getSearchResult}
|
||||
displayField="name"
|
||||
valueField="id"
|
||||
showSearch
|
||||
allowClear
|
||||
placeholder="Select a team"
|
||||
className={cx('team-select')}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ interface GSelectProps<Item> {
|
|||
className?: string;
|
||||
displayField?: string;
|
||||
valueField?: string;
|
||||
showSearch?: boolean;
|
||||
allowClear?: boolean;
|
||||
isMulti?: boolean;
|
||||
showWarningIfEmptyValue?: boolean;
|
||||
|
|
@ -49,7 +48,6 @@ interface GSelectProps<Item> {
|
|||
export const GSelect = observer(<Item,>(props: GSelectProps<Item>) => {
|
||||
const {
|
||||
autoFocus,
|
||||
showSearch = false,
|
||||
allowClear = false,
|
||||
isLoading,
|
||||
defaultOpen,
|
||||
|
|
@ -156,7 +154,7 @@ export const GSelect = observer(<Item,>(props: GSelectProps<Item>) => {
|
|||
<div className={cx('root', className)}>
|
||||
<Tag
|
||||
autoFocus={autoFocus}
|
||||
isSearchable={showSearch}
|
||||
isSearchable
|
||||
isClearable={allowClear}
|
||||
placeholder={placeholder}
|
||||
openMenuOnFocus={defaultOpen}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,6 @@ export const GrafanaTeamSelect = observer(
|
|||
|
||||
const select = (
|
||||
<GSelect<GrafanaTeam>
|
||||
showSearch
|
||||
items={grafanaTeamStore.items}
|
||||
fetchItemsFn={grafanaTeamStore.updateItems}
|
||||
fetchItemFn={grafanaTeamStore.fetchItemById}
|
||||
|
|
|
|||
|
|
@ -240,7 +240,6 @@ export const IntegrationForm = observer(
|
|||
getSearchResult: grafanaTeamStore.getSearchResult,
|
||||
displayField: 'name',
|
||||
valueField: 'id',
|
||||
showSearch: true,
|
||||
allowClear: true,
|
||||
}}
|
||||
onChange={(value) => {
|
||||
|
|
|
|||
|
|
@ -87,7 +87,6 @@ export const MaintenanceForm = observer((props: MaintenanceFormProps) => {
|
|||
>
|
||||
<GSelect<ApiSchemas['AlertReceiveChannel']>
|
||||
disabled
|
||||
showSearch
|
||||
items={alertReceiveChannelStore.items}
|
||||
fetchItemsFn={alertReceiveChannelStore.fetchItems}
|
||||
fetchItemFn={alertReceiveChannelStore.fetchItemById}
|
||||
|
|
|
|||
|
|
@ -83,7 +83,6 @@ export const OutgoingWebhookFormFields = ({
|
|||
error={errors.team?.message}
|
||||
>
|
||||
<GSelect<GrafanaTeam>
|
||||
showSearch
|
||||
allowClear
|
||||
items={grafanaTeamStore.items}
|
||||
fetchItemsFn={grafanaTeamStore.updateItems}
|
||||
|
|
@ -147,7 +146,6 @@ export const OutgoingWebhookFormFields = ({
|
|||
>
|
||||
<GSelect<ApiSchemas['AlertReceiveChannel']>
|
||||
isMulti
|
||||
showSearch
|
||||
placeholder="Choose (Optional)"
|
||||
items={alertReceiveChannelStore.items}
|
||||
fetchItemsFn={alertReceiveChannelStore.fetchItems}
|
||||
|
|
|
|||
|
|
@ -222,7 +222,6 @@ const ScheduleCommonFields = () => {
|
|||
render={({ field }) => (
|
||||
<Field label="Assign to team" invalid={!!errors.team} error={errors.team?.message}>
|
||||
<GSelect<GrafanaTeam>
|
||||
showSearch
|
||||
items={grafanaTeamStore.items}
|
||||
fetchItemsFn={grafanaTeamStore.updateItems}
|
||||
fetchItemFn={grafanaTeamStore.fetchItemById}
|
||||
|
|
@ -265,7 +264,6 @@ const ScheduleNotificationSettingsFields = () => {
|
|||
error={errors.slack_channel_id?.message}
|
||||
>
|
||||
<GSelect<SlackChannel>
|
||||
showSearch
|
||||
allowClear
|
||||
items={slackChannelStore.items}
|
||||
fetchItemsFn={slackChannelStore.updateItems}
|
||||
|
|
@ -292,7 +290,6 @@ const ScheduleNotificationSettingsFields = () => {
|
|||
error={errors.user_group?.message}
|
||||
>
|
||||
<GSelect<UserGroup[]>
|
||||
showSearch
|
||||
allowClear
|
||||
items={userGroupStore.items}
|
||||
fetchItemsFn={userGroupStore.updateItems}
|
||||
|
|
|
|||
|
|
@ -90,7 +90,6 @@ const GoogleCalendar: React.FC<{ id: ApiSchemas['User']['pk'] }> = observer(({ i
|
|||
<WithPermissionControlTooltip userAction={UserActions.UserSettingsWrite}>
|
||||
<GSelect<Schedule>
|
||||
isMulti
|
||||
showSearch
|
||||
allowClear
|
||||
disabled={false}
|
||||
items={scheduleStore.items}
|
||||
|
|
|
|||
|
|
@ -126,7 +126,6 @@ class _SlackSettings extends Component<SlackProps, SlackState> {
|
|||
>
|
||||
<WithPermissionControlTooltip userAction={UserActions.ChatOpsUpdateSettings}>
|
||||
<GSelect<SlackChannel>
|
||||
showSearch
|
||||
items={slackChannelStore.items}
|
||||
fetchItemsFn={slackChannelStore.updateItems}
|
||||
fetchItemFn={slackChannelStore.updateItem}
|
||||
|
|
@ -216,7 +215,6 @@ class _SlackSettings extends Component<SlackProps, SlackState> {
|
|||
return (
|
||||
<WithPermissionControlTooltip userAction={UserActions.ChatOpsUpdateSettings}>
|
||||
<GSelect<SlackChannel>
|
||||
showSearch
|
||||
className={cx('select', 'control')}
|
||||
items={slackChannelStore.items}
|
||||
fetchItemsFn={slackChannelStore.updateItems}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue