diff --git a/ui/src/App.test.tsx b/ui/src/App.test.tsx
index 1506d3e08..e627b4812 100644
--- a/ui/src/App.test.tsx
+++ b/ui/src/App.test.tsx
@@ -19,6 +19,7 @@ const uiDefaults: UIDefaults = {
AlertsPerGroup: 5,
CollapseGroups: "collapsedOnMobile",
Theme: "auto",
+ Animations: true,
MultiGridLabel: "cluster",
MultiGridSortReverse: false,
};
@@ -40,6 +41,7 @@ beforeEach(() => {
afterEach(() => {
localStorage.setItem("savedFilters", "");
+ localStorage.setItem("themeConfig", "");
jest.restoreAllMocks();
window.history.pushState({}, "App", "/");
global.window.location = {
diff --git a/ui/src/Components/MainModal/Configuration/AlertGroupSortConfiguration.tsx b/ui/src/Components/MainModal/Configuration/AlertGroupSortConfiguration.tsx
index 1a783c7e3..5de860b33 100644
--- a/ui/src/Components/MainModal/Configuration/AlertGroupSortConfiguration.tsx
+++ b/ui/src/Components/MainModal/Configuration/AlertGroupSortConfiguration.tsx
@@ -71,7 +71,6 @@ const AlertGroupSortConfiguration: FC<{
id="configuration-sort-reverse"
className="custom-control-input"
type="checkbox"
- value=""
checked={settingsStore.gridConfig.config.reverseSort || false}
onChange={(event) => onSortReverseChange(event.target.checked)}
/>
diff --git a/ui/src/Components/MainModal/Configuration/AlertGroupTitleBarColor.tsx b/ui/src/Components/MainModal/Configuration/AlertGroupTitleBarColor.tsx
index 78bef940e..312c22195 100644
--- a/ui/src/Components/MainModal/Configuration/AlertGroupTitleBarColor.tsx
+++ b/ui/src/Components/MainModal/Configuration/AlertGroupTitleBarColor.tsx
@@ -19,7 +19,6 @@ const AlertGroupTitleBarColor: FC<{
id="configuration-colortitlebar"
className="custom-control-input"
type="checkbox"
- value=""
checked={
settingsStore.alertGroupConfig.config.colorTitleBar || false
}
diff --git a/ui/src/Components/MainModal/Configuration/AnimationsConfiguration.tsx b/ui/src/Components/MainModal/Configuration/AnimationsConfiguration.tsx
index 137e6b14f..1e330624f 100644
--- a/ui/src/Components/MainModal/Configuration/AnimationsConfiguration.tsx
+++ b/ui/src/Components/MainModal/Configuration/AnimationsConfiguration.tsx
@@ -19,7 +19,6 @@ const AnimationsConfiguration: FC<{
id="configuration-animations"
className="custom-control-input"
type="checkbox"
- value=""
checked={settingsStore.themeConfig.config.animations || false}
onChange={(event) => onChange(event.target.checked)}
/>
diff --git a/ui/src/Components/MainModal/Configuration/FilterBarConfiguration.tsx b/ui/src/Components/MainModal/Configuration/FilterBarConfiguration.tsx
index e466e973a..304a17a3b 100644
--- a/ui/src/Components/MainModal/Configuration/FilterBarConfiguration.tsx
+++ b/ui/src/Components/MainModal/Configuration/FilterBarConfiguration.tsx
@@ -18,7 +18,6 @@ const FilterBarConfiguration: FC<{
id="configuration-autohide"
className="custom-control-input"
type="checkbox"
- value=""
checked={settingsStore.filterBarConfig.config.autohide || false}
onChange={(event) => onAutohideChange(event.target.checked)}
/>
diff --git a/ui/src/Components/MainModal/Configuration/MultiGridConfiguration.tsx b/ui/src/Components/MainModal/Configuration/MultiGridConfiguration.tsx
index 6f2d3d634..2852ad881 100644
--- a/ui/src/Components/MainModal/Configuration/MultiGridConfiguration.tsx
+++ b/ui/src/Components/MainModal/Configuration/MultiGridConfiguration.tsx
@@ -24,7 +24,6 @@ const MultiGridConfiguration: FC<{
id="configuration-multigrid-sort-reverse"
className="custom-control-input"
type="checkbox"
- value=""
checked={
settingsStore.multiGridConfig.config.gridSortReverse || false
}
diff --git a/ui/src/Components/MainModal/Configuration/ThemeConfiguration.test.tsx b/ui/src/Components/MainModal/Configuration/ThemeConfiguration.test.tsx
index 9dd4ff3e1..d6abda0b5 100644
--- a/ui/src/Components/MainModal/Configuration/ThemeConfiguration.test.tsx
+++ b/ui/src/Components/MainModal/Configuration/ThemeConfiguration.test.tsx
@@ -5,7 +5,7 @@ import { mount } from "enzyme";
import toDiffableHtml from "diffable-html";
import { MockThemeContext } from "__mocks__/Theme";
-import { Settings } from "Stores/Settings";
+import { Settings, ThemeT } from "Stores/Settings";
import { ThemeConfiguration } from "./ThemeConfiguration";
let settingsStore: Settings;
@@ -29,7 +29,7 @@ describe("", () => {
});
it("resets stored config to defaults if it is invalid", (done) => {
- (settingsStore.themeConfig.config.theme as string) = "foo";
+ settingsStore.themeConfig.setTheme("foo" as ThemeT);
const tree = FakeConfiguration();
const select = tree.find("div.react-select__value-container");
expect(select.text()).toBe(settingsStore.themeConfig.options.auto.label);
diff --git a/ui/src/Components/MainModal/Configuration/ThemeConfiguration.tsx b/ui/src/Components/MainModal/Configuration/ThemeConfiguration.tsx
index e22922f3f..829bc3523 100644
--- a/ui/src/Components/MainModal/Configuration/ThemeConfiguration.tsx
+++ b/ui/src/Components/MainModal/Configuration/ThemeConfiguration.tsx
@@ -26,7 +26,7 @@ const ThemeConfiguration: FC<{
};
};
- const onCollapseChange = (newValue: ThemeT) => {
+ const onChange = (newValue: ThemeT) => {
settingsStore.themeConfig.setTheme(newValue);
};
@@ -40,9 +40,7 @@ const ThemeConfiguration: FC<{
instanceId="configuration-theme"
defaultValue={valueToOption(settingsStore.themeConfig.config.theme)}
options={Object.values(settingsStore.themeConfig.options)}
- onChange={(option) =>
- onCollapseChange((option as OptionT).value as ThemeT)
- }
+ onChange={(option) => onChange((option as OptionT).value as ThemeT)}
hideSelectedOptions
/>
diff --git a/ui/src/Components/MainModal/Configuration/__snapshots__/AlertGroupTitleBarColor.test.tsx.snap b/ui/src/Components/MainModal/Configuration/__snapshots__/AlertGroupTitleBarColor.test.tsx.snap
index 1dc05774d..90548de2f 100644
--- a/ui/src/Components/MainModal/Configuration/__snapshots__/AlertGroupTitleBarColor.test.tsx.snap
+++ b/ui/src/Components/MainModal/Configuration/__snapshots__/AlertGroupTitleBarColor.test.tsx.snap
@@ -8,7 +8,6 @@ exports[` matches snapshot with default values 1`] =
matches snapshot with default values 1`] =
matches snapshot with default values 1`] = `
matches snapshot with default values 1`] = `
matches snapshot 1`] = `
matches snapshot 1`] = `
matches snapshot 1`] = `
matches snapshot 1`] = `
matches snapshot 1`] = `
matches snapshot 1`] = `
matches snapshot 1`] = `
matches snapshot 1`] = `