From 6be77f6a335583dfabbf94b714da9392810f40fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Sza=C5=82owski?= Date: Mon, 16 Dec 2024 12:00:02 +0100 Subject: [PATCH] fix: fix wrong DRep voting conditions --- CHANGELOG.md | 1 + govtool/frontend/src/context/featureFlag.test.tsx | 4 ++-- govtool/frontend/src/context/featureFlag.tsx | 10 ++-------- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 76352c5e1..b34236d5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ changes. - Fix scaling gov action votes on lower resolutions - Fix storing url missing length validation [Issue 2044](https://github.com/IntersectMBO/govtool/issues/2044) - Fix governance action details page crash on missing data [Issue 2511](https://github.com/IntersectMBO/govtool/issues/2511) +- Fix wrong voting conditions for drep ### Changed diff --git a/govtool/frontend/src/context/featureFlag.test.tsx b/govtool/frontend/src/context/featureFlag.test.tsx index e3f5f8ecf..8840d6545 100644 --- a/govtool/frontend/src/context/featureFlag.test.tsx +++ b/govtool/frontend/src/context/featureFlag.test.tsx @@ -124,7 +124,7 @@ describe("FeatureFlagProvider", () => { ).toBe(true); }); - it("should hide DRep vote totals for MotionNoConfidence in full governance", () => { + it("should show DRep vote totals for MotionNoConfidence in full governance", () => { mockUseAppContext.mockReturnValue({ ...mockUseAppContextReturnValue, isAppInitializing: false, @@ -140,7 +140,7 @@ describe("FeatureFlagProvider", () => { result.current.areDRepVoteTotalsDisplayed( GovernanceActionType.NoConfidence, ), - ).toBe(false); + ).toBe(true); }); }); diff --git a/govtool/frontend/src/context/featureFlag.tsx b/govtool/frontend/src/context/featureFlag.tsx index d008f67f7..9f69c595f 100644 --- a/govtool/frontend/src/context/featureFlag.tsx +++ b/govtool/frontend/src/context/featureFlag.tsx @@ -77,16 +77,10 @@ const FeatureFlagProvider = ({ children }: PropsWithChildren) => { !isSecurityGroup) ); } - if (isFullGovernance) { - return ![ - GovernanceActionType.NoConfidence, - GovernanceActionType.NewCommittee, - GovernanceActionType.NewConstitution, - ].includes(governanceActionType); - } + return true; }, - [isAppInitializing, isInBootstrapPhase, isFullGovernance], + [isAppInitializing, isInBootstrapPhase], ); /**