diff --git a/ui/src/Components/Grid/AlertGrid/index.test.js b/ui/src/Components/Grid/AlertGrid/index.test.js index 97dbee9c0..023ee5ce3 100644 --- a/ui/src/Components/Grid/AlertGrid/index.test.js +++ b/ui/src/Components/Grid/AlertGrid/index.test.js @@ -61,10 +61,8 @@ const MockGroupList = (count, alertPerGroup) => { let groups = []; for (let i = 1; i <= count; i++) { let id = `id${i}`; - let hash = `hash${i}`; let group = MockGroup(`group${i}`, alertPerGroup); group.id = id; - group.hash = hash; groups.push(group); } alertStore.data.upstreams = { diff --git a/ui/src/Models/API.js b/ui/src/Models/API.js index e6e7e9c44..d55e94782 100644 --- a/ui/src/Models/API.js +++ b/ui/src/Models/API.js @@ -33,7 +33,6 @@ const APIGroup = PropTypes.exact({ labels: PropTypes.object.isRequired, alerts: PropTypes.arrayOf(APIAlert), id: PropTypes.string.isRequired, - hash: PropTypes.string.isRequired, alertmanagerCount: PropTypes.objectOf(PropTypes.number).isRequired, stateCount: PropTypes.exact({ active: PropTypes.number.isRequired, diff --git a/ui/src/Stores/AlertStore.test.js b/ui/src/Stores/AlertStore.test.js index e15a1cc78..6b95b35d9 100644 --- a/ui/src/Stores/AlertStore.test.js +++ b/ui/src/Stores/AlertStore.test.js @@ -485,21 +485,6 @@ describe("AlertStore.fetch", () => { expect(store.data.groups).toMatchObject({ foo: "foo", bar: "bar" }); }); - it("is no-op for groups that didn't change", () => { - const store = new AlertStore(["label=value"]); - store.data.groups = { foo: { hash: "foo" }, bar: { hash: "bar" } }; - - const response = EmptyAPIResponse(); - response.groups = { foo: { hash: "foo" }, bar: { hash: "bar" } }; - - store.parseAPIResponse(response); - expect(Object.keys(store.data.groups)).toHaveLength(2); - expect(store.data.groups).toMatchObject({ - foo: { hash: "foo" }, - bar: { hash: "bar" } - }); - }); - it("removes old groups from the store after fetch", () => { const store = new AlertStore(["label=value"]); store.data.groups = { foo: "foo", delete: "me", bar: "bar" }; @@ -512,25 +497,4 @@ describe("AlertStore.fetch", () => { expect(Object.keys(store.data.groups)).toHaveLength(2); expect(store.data.groups).toMatchObject({ foo: "foo", bar: "bar" }); }); - - it("updates groups with new hash after fetch", () => { - const store = new AlertStore(["label=value"]); - store.data.groups = [ - { id: "foo", hash: "foo" }, - { id: "bar", hash: "bar" } - ]; - - const response = EmptyAPIResponse(); - response.groups = [ - { id: "foo", hash: "newFoo" }, - { id: "bar", hash: "newBar" } - ]; - - store.parseAPIResponse(response); - expect(store.data.groups).toHaveLength(2); - expect(store.data.groups).toMatchObject([ - { id: "foo", hash: "newFoo" }, - { id: "bar", hash: "newBar" } - ]); - }); }); diff --git a/ui/src/__mocks__/Alerts.js b/ui/src/__mocks__/Alerts.js index afec1d72a..d09fce329 100644 --- a/ui/src/__mocks__/Alerts.js +++ b/ui/src/__mocks__/Alerts.js @@ -35,7 +35,6 @@ const MockAlertGroup = ( labels: rootLabels, alerts: alerts, id: "099c5ca6d1c92f615b13056b935d0c8dee70f18c", - hash: "53a4bb3d7e916450b3bda550976f9578db5b2ad3", alertmanagerCount: { default: 1 }, diff --git a/ui/src/__mocks__/Stories.js b/ui/src/__mocks__/Stories.js index 5952976d0..4932fc4e0 100644 --- a/ui/src/__mocks__/Stories.js +++ b/ui/src/__mocks__/Stories.js @@ -185,7 +185,6 @@ const MockGrid = alertStore => { const unprocessed = Math.max(0, i - active - suppressed); const id = `id${i}`; - const hash = `hash${i}`; const group = MockGroup(`group${i}`, i, active, suppressed, unprocessed); for (let j = 0; j < group.alerts.length; j++) { @@ -207,7 +206,6 @@ const MockGrid = alertStore => { } group.id = id; - group.hash = hash; group.stateCount.active = active; group.stateCount.suppressed = suppressed; group.stateCount.unprocessed = unprocessed;