From 924d2813f745433133bd8a0f970cf891c9e6d747 Mon Sep 17 00:00:00 2001 From: Lukasz Mierzwa Date: Mon, 23 Feb 2026 09:28:42 +0000 Subject: [PATCH] fix(project): fix typos --- ui/embed.go | 2 +- ui/src/App.test.tsx | 2 +- .../GroupFooter/__snapshots__/index.test.tsx.snap | 2 +- .../AlertGrid/AlertGroup/GroupFooter/index.test.tsx | 2 +- .../Components/Grid/AlertGrid/AlertGroup/Silences.tsx | 6 +++--- ui/src/Components/Grid/AlertGrid/AlertGroup/index.tsx | 2 +- .../ReloadNeeded/__snapshots__/index.test.tsx.snap | 2 +- ui/src/Components/Grid/ReloadNeeded/index.tsx | 2 +- .../Components/Labels/FilterInputLabel/index.test.tsx | 1 - .../Components/Labels/LabelWithPercent/index.test.tsx | 2 +- ui/src/Components/MainModal/Help.tsx | 6 +++--- .../MainModal/__snapshots__/Help.test.tsx.snap | 6 +++--- .../ManagedSilence/__snapshots__/index.test.tsx.snap | 2 +- ui/src/Components/ManagedSilence/index.test.tsx | 2 +- ui/src/Components/SilenceModal/Browser/index.test.tsx | 2 +- ui/src/Components/Toast/ToastMessages.test.tsx | 2 +- ui/src/Hooks/useWindowSize.ts | 8 ++++---- ui/src/Stores/AlertStore.test.ts | 2 +- ui/src/Stores/SilenceFormStore.test.ts | 10 +++++----- 19 files changed, 31 insertions(+), 32 deletions(-) diff --git a/ui/embed.go b/ui/embed.go index 2e01699a9..92c2ca0ef 100644 --- a/ui/embed.go +++ b/ui/embed.go @@ -4,5 +4,5 @@ import "embed" //go:embed dist/* mock/* -// StaticFiles exports build and src directorires as embed.FS +// StaticFiles exports build and src directories as embed.FS var StaticFiles embed.FS diff --git a/ui/src/App.test.tsx b/ui/src/App.test.tsx index 7ed8b4a83..5266697fb 100644 --- a/ui/src/App.test.tsx +++ b/ui/src/App.test.tsx @@ -26,7 +26,7 @@ const uiDefaults: UIDefaults = { }; beforeEach(() => { - // createing App instance will push current filters into window.location + // creating App instance will push current filters into window.location // ensure it's wiped after each test window.history.pushState({}, "App", "/"); diff --git a/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupFooter/__snapshots__/index.test.tsx.snap b/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupFooter/__snapshots__/index.test.tsx.snap index d71b52455..b13b97108 100644 --- a/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupFooter/__snapshots__/index.test.tsx.snap +++ b/ui/src/Components/Grid/AlertGrid/AlertGroup/GroupFooter/__snapshots__/index.test.tsx.snap @@ -150,7 +150,7 @@ exports[` matches snapshot 1`] = ` `; -exports[` mathes snapshot when silence is rendered 1`] = ` +exports[` matches snapshot when silence is rendered 1`] = ` diff --git a/ui/src/Components/Grid/ReloadNeeded/index.tsx b/ui/src/Components/Grid/ReloadNeeded/index.tsx index bebca5cb9..c376f2a6a 100644 --- a/ui/src/Components/Grid/ReloadNeeded/index.tsx +++ b/ui/src/Components/Grid/ReloadNeeded/index.tsx @@ -23,7 +23,7 @@ const ReloadNeeded: FC<{ />

- All API connection attempts failed. This migth be caused by + All API connection attempts failed. This might be caused by authentication middleware, will try to reload.

diff --git a/ui/src/Components/Labels/FilterInputLabel/index.test.tsx b/ui/src/Components/Labels/FilterInputLabel/index.test.tsx index cfd292894..b32a1a6b8 100644 --- a/ui/src/Components/Labels/FilterInputLabel/index.test.tsx +++ b/ui/src/Components/Labels/FilterInputLabel/index.test.tsx @@ -175,7 +175,6 @@ describe(" onChange", () => { ); }); - it("editing filter to new value replaces it in alertStore", () => { // Verifies that onChange replaces filter when edited to new value const filter = createFilter("=", true, true, 1); diff --git a/ui/src/Components/Labels/LabelWithPercent/index.test.tsx b/ui/src/Components/Labels/LabelWithPercent/index.test.tsx index c8a4cc99a..8e63f2acd 100644 --- a/ui/src/Components/Labels/LabelWithPercent/index.test.tsx +++ b/ui/src/Components/Labels/LabelWithPercent/index.test.tsx @@ -82,7 +82,7 @@ describe("", () => { ); }); - it("clicking the X buttom removes label from filters", () => { + it("clicking the X button removes label from filters", () => { const { container } = renderLabelWithPercent("foo", "bar", 25, 50, 0, true); const removeButton = container.querySelector("svg.fa-xmark"); fireEvent.click(removeButton!); diff --git a/ui/src/Components/MainModal/Help.tsx b/ui/src/Components/MainModal/Help.tsx index 0a778da1e..41eccbf8c 100644 --- a/ui/src/Components/MainModal/Help.tsx +++ b/ui/src/Components/MainModal/Help.tsx @@ -69,7 +69,7 @@ const FilterExample: FC<{ const Help: FC<{ defaultIsOpen: boolean }> = ({ defaultIsOpen }) => ( @@ -99,7 +99,7 @@ const Help: FC<{ defaultIsOpen: boolean }> = ({ defaultIsOpen }) => ( value. - True if compared alert attribue value is less than{" "} + True if compared alert attribute value is less than{" "} value. @@ -140,7 +140,7 @@ const Help: FC<{ defaultIsOpen: boolean }> = ({ defaultIsOpen }) => ( Match alerts with label priority value{" "} > than 4. Value will be casted to - integer if possible, string comparision will be used as fallback. + integer if possible, string comparison will be used as fallback. diff --git a/ui/src/Components/MainModal/__snapshots__/Help.test.tsx.snap b/ui/src/Components/MainModal/__snapshots__/Help.test.tsx.snap index f4dbcf566..df4effc9c 100644 --- a/ui/src/Components/MainModal/__snapshots__/Help.test.tsx.snap +++ b/ui/src/Components/MainModal/__snapshots__/Help.test.tsx.snap @@ -15,7 +15,7 @@ exports[` matches snapshot 1`] = ` class="accordion-button " type="button" > - Fiter operators + Filter operators
matches snapshot 1`] = `
- True if compared alert attribue value is less than + True if compared alert attribute value is less than value @@ -365,7 +365,7 @@ exports[` matches snapshot 1`] = ` 4 - . Value will be casted to integer if possible, string comparision will be used as fallback. + . Value will be casted to integer if possible, string comparison will be used as fallback.
diff --git a/ui/src/Components/ManagedSilence/__snapshots__/index.test.tsx.snap b/ui/src/Components/ManagedSilence/__snapshots__/index.test.tsx.snap index fac1840f7..e6a8b80f1 100644 --- a/ui/src/Components/ManagedSilence/__snapshots__/index.test.tsx.snap +++ b/ui/src/Components/ManagedSilence/__snapshots__/index.test.tsx.snap @@ -108,7 +108,7 @@ exports[` matches snapshot when collapsed 1`] = `
`; -exports[` matches snapshot with expaned details 1`] = ` +exports[` matches snapshot with expanded details 1`] = `
", () => { expect(screen.getByText("Edit")).toBeInTheDocument(); }); - it("matches snapshot with expaned details", () => { + it("matches snapshot with expanded details", () => { const { container, asFragment } = renderManagedSilence(); const toggle = container.querySelector("svg.text-muted.cursor-pointer"); fireEvent.click(toggle!); diff --git a/ui/src/Components/SilenceModal/Browser/index.test.tsx b/ui/src/Components/SilenceModal/Browser/index.test.tsx index a29e9366b..f8644a73c 100644 --- a/ui/src/Components/SilenceModal/Browser/index.test.tsx +++ b/ui/src/Components/SilenceModal/Browser/index.test.tsx @@ -530,7 +530,7 @@ describe("", () => { const { container, unmount } = renderBrowser(); - // nothing is selected intially + // nothing is selected initially const checkboxes = container.querySelectorAll("input.form-check-input"); expect(checkboxes).toHaveLength(5); for (const i of [1, 2, 3, 4]) { diff --git a/ui/src/Components/Toast/ToastMessages.test.tsx b/ui/src/Components/Toast/ToastMessages.test.tsx index ab01f0580..9f5b9c448 100644 --- a/ui/src/Components/Toast/ToastMessages.test.tsx +++ b/ui/src/Components/Toast/ToastMessages.test.tsx @@ -40,7 +40,7 @@ describe("", () => { expect(button.textContent).toBe("Reload now"); }); - it("clicking on the reload buton triggers a reload", () => { + it("clicking on the reload button triggers a reload", () => { render(); const button = screen.getByRole("button"); diff --git a/ui/src/Hooks/useWindowSize.ts b/ui/src/Hooks/useWindowSize.ts index a2f2d5848..6ba0ddb83 100644 --- a/ui/src/Hooks/useWindowSize.ts +++ b/ui/src/Hooks/useWindowSize.ts @@ -1,19 +1,19 @@ import { useState, useEffect } from "react"; -interface Dimentions { +interface Dimensions { width: number; height: number; } -function getSize(): Dimentions { +function getSize(): Dimensions { return { width: window.innerWidth, height: window.innerHeight, }; } -function useWindowSize(): Dimentions { - const [windowSize, setWindowSize] = useState(getSize()); +function useWindowSize(): Dimensions { + const [windowSize, setWindowSize] = useState(getSize()); useEffect(() => { const handleResize = () => { diff --git a/ui/src/Stores/AlertStore.test.ts b/ui/src/Stores/AlertStore.test.ts index 046fc1623..fea4aac8b 100644 --- a/ui/src/Stores/AlertStore.test.ts +++ b/ui/src/Stores/AlertStore.test.ts @@ -513,7 +513,7 @@ describe("AlertStore.fetch", () => { // there should be no filters set on AlertStore instance since we started // with 0 and rejected response with 1 filter expect(store.filters.values).toHaveLength(0); - // console.info should have been called since we emited a log line + // console.info should have been called since we emitted a log line expect(consoleSpy).toHaveBeenCalledTimes(1); }); diff --git a/ui/src/Stores/SilenceFormStore.test.ts b/ui/src/Stores/SilenceFormStore.test.ts index 6c33ad4c4..82455d6f7 100644 --- a/ui/src/Stores/SilenceFormStore.test.ts +++ b/ui/src/Stores/SilenceFormStore.test.ts @@ -824,7 +824,7 @@ describe("SilenceFormStore.data", () => { }); } - it("toAlertmanagerPayload constains id when store.data.silenceID is set", () => { + it("toAlertmanagerPayload contains id when store.data.silenceID is set", () => { store.data.setSilenceID("12345"); expect(store.data.toAlertmanagerPayload).toMatchObject({ id: "12345", @@ -1036,7 +1036,7 @@ describe("SilenceFormStore.data.isValid", () => { expect(store.data.isValid).toBe(false); }); - it("isValid returns 'false' if matchers list is pupulated when a matcher without any name", () => { + it("isValid returns 'false' if matchers list is populated when a matcher without any name", () => { store.data.setAlertmanagers([MockAlertmanagerOption()]); store.data.setMatchers([ MockMatcher("", [{ label: "bar", value: "bar", wasCreated: false }]), @@ -1046,7 +1046,7 @@ describe("SilenceFormStore.data.isValid", () => { expect(store.data.isValid).toBe(false); }); - it("isValid returns 'false' if matchers list is pupulated when a matcher without any value ([])", () => { + it("isValid returns 'false' if matchers list is populated when a matcher without any value ([])", () => { store.data.setAlertmanagers([MockAlertmanagerOption()]); store.data.setMatchers([MockMatcher("foo", [])]); store.data.setAuthor("me@example.com"); @@ -1054,7 +1054,7 @@ describe("SilenceFormStore.data.isValid", () => { expect(store.data.isValid).toBe(false); }); - it("isValid returns 'false' if matchers list is pupulated when a matcher with empty value ([''])", () => { + it("isValid returns 'false' if matchers list is populated when a matcher with empty value ([''])", () => { store.data.setAlertmanagers([MockAlertmanagerOption()]); store.data.setMatchers([MockMatcher("foo", [])]); store.data.setAuthor("me@example.com"); @@ -1082,7 +1082,7 @@ describe("SilenceFormStore.data.isValid", () => { expect(store.data.isValid).toBe(false); }); - it("isValid returns 'true' if all fileds are set", () => { + it("isValid returns 'true' if all fields are set", () => { store.data.setAlertmanagers([MockAlertmanagerOption()]); store.data.setMatchers([ MockMatcher("foo", [{ label: "bar", value: "bar", wasCreated: false }]),