Skip to content

Commit a77dc2e

Browse files
committed
fix(ui): fix types
1 parent 7fc350b commit a77dc2e

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

ui/src/Components/MainModal/Configuration/AlertGroupCollapseConfiguration.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { FC } from "react";
22

33
import { observer } from "mobx-react-lite";
44

5-
import Select from "react-select";
5+
import Select, { OnChangeValue } from "react-select";
66

77
import type { OptionT } from "Common/Select";
88
import type { Settings, CollapseStateT } from "Stores/Settings";
@@ -44,7 +44,7 @@ const AlertGroupCollapseConfiguration: FC<{
4444
settingsStore.alertGroupConfig.config.defaultCollapseState,
4545
)}
4646
options={Object.values(settingsStore.alertGroupConfig.options)}
47-
onChange={(option) =>
47+
onChange={(option: OnChangeValue<OptionT, false>) =>
4848
onCollapseChange((option as OptionT).value as CollapseStateT)
4949
}
5050
hideSelectedOptions

ui/src/Components/MainModal/Configuration/GridLabelName.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import type { Settings } from "Stores/Settings";
88
import { ThemeContext } from "Components/Theme";
99
import { AnimatedMenu } from "Components/Select";
1010
import { NewLabelName, StringToOption, OptionT } from "Common/Select";
11+
import { OnChangeValue } from "react-select";
1112

1213
const disabledLabel = "Disable multi-grid";
1314

@@ -54,7 +55,7 @@ const GridLabelName: FC<{
5455
]
5556
: staticValues
5657
}
57-
onChange={(option) => {
58+
onChange={(option: OnChangeValue<OptionT, false>) => {
5859
settingsStore.multiGridConfig.setGridLabel((option as OptionT).value);
5960
}}
6061
components={{ Menu: AnimatedMenu }}

ui/src/Components/MainModal/Configuration/SortLabelName.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { useFetchGet } from "Hooks/useFetchGet";
1010
import { ThemeContext } from "Components/Theme";
1111
import { AnimatedMenu } from "Components/Select";
1212
import { NewLabelName, StringToOption } from "Common/Select";
13+
import { OnChangeValue } from "react-select";
1314

1415
const SortLabelName: FC<{
1516
settingsStore: Settings;
@@ -36,7 +37,7 @@ const SortLabelName: FC<{
3637
options={
3738
response ? response.map((value: string) => StringToOption(value)) : []
3839
}
39-
onChange={(option) => {
40+
onChange={(option: OnChangeValue<OptionT, false>) => {
4041
settingsStore.gridConfig.setSortLabel(
4142
(option as OptionT).value as string,
4243
);

ui/src/Components/SilenceModal/SilenceMatch/LabelNameInput.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { ValidationError } from "Components/ValidationError";
99
import { ThemeContext } from "Components/Theme";
1010
import { AnimatedMenu } from "Components/Select";
1111
import { NewLabelName, OptionT, StringToOption } from "Common/Select";
12+
import { OnChangeValue } from "react-select";
1213

1314
const LabelNameInput: FC<{
1415
matcher: MatcherWithIDT;
@@ -31,7 +32,7 @@ const LabelNameInput: FC<{
3132
response ? response.map((value: string) => StringToOption(value)) : []
3233
}
3334
placeholder={isValid ? "Label name" : <ValidationError />}
34-
onChange={(option) => {
35+
onChange={(option: OnChangeValue<OptionT, false>) => {
3536
matcher.name = (option as OptionT).value;
3637
}}
3738
hideSelectedOptions

0 commit comments

Comments
 (0)