Skip to content

Commit 65cfd24

Browse files
authored
Merge pull request #3905 from IntersectMBO/staging
Staging -> main
2 parents cb91d9a + a34dd55 commit 65cfd24

File tree

25 files changed

+193
-55
lines changed

25 files changed

+193
-55
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@ changes.
1010

1111
## [Unreleased]
1212

13+
### Added
14+
15+
### Fixed
16+
17+
### Changed
18+
19+
### Removed
20+
21+
## [v2.0.29](https://github.com/IntersectMBO/govtool/releases/tag/v2.0.29) 2025-07-16
22+
23+
1324
### Added
1425

1526
- Preserve maintenance ending banner state on the wallet connection change [Issue 3681](https://github.com/IntersectMBO/govtool/issues/3681)

govtool/backend/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ FROM $BASE_IMAGE_REPO:$BASE_IMAGE_TAG
44
WORKDIR /src
55
COPY . .
66
RUN cabal build
7-
RUN cp dist-newstyle/build/x86_64-linux/ghc-9.2.7/vva-be-2.0.23/x/vva-be/build/vva-be/vva-be /usr/local/bin
7+
RUN cp dist-newstyle/build/x86_64-linux/ghc-9.2.7/vva-be-2.0.29/x/vva-be/build/vva-be/vva-be /usr/local/bin

govtool/backend/Dockerfile.qovery

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ FROM $BASE_IMAGE_REPO:$BASE_IMAGE_TAG
44
WORKDIR /src
55
COPY . .
66
RUN cabal build
7-
RUN cp dist-newstyle/build/x86_64-linux/ghc-9.2.7/vva-be-2.0.23/x/vva-be/build/vva-be/vva-be /usr/local/bin
7+
RUN cp dist-newstyle/build/x86_64-linux/ghc-9.2.7/vva-be-2.0.29/x/vva-be/build/vva-be/vva-be /usr/local/bin
88

99
# Expose the necessary port
1010
EXPOSE 9876

govtool/backend/sql/get-network-metrics.sql

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,10 @@ CommitteeThreshold AS (
186186
SELECT
187187
c.*
188188
FROM committee c
189-
LEFT JOIN LatestGovAction lga ON c.gov_action_proposal_id = lga.id
190-
WHERE (c.gov_action_proposal_id IS NOT NULL AND lga.id IS NOT NULL)
191-
OR (c.gov_action_proposal_id IS NULL)
189+
where
190+
( c.gov_action_proposal_id = (Select id from LatestGovAction))
191+
OR ( c.gov_action_proposal_id IS NULL)
192+
order by gov_action_proposal_id nulls last limit 1
192193
)
193194
SELECT
194195
UniqueDelegators.count AS unique_delegators,

govtool/backend/vva-be.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 3.6
22
name: vva-be
3-
version: 2.0.23
3+
version: 2.0.29
44

55
-- A short (one-line) description of the package.
66
-- synopsis:

govtool/frontend/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

govtool/frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@govtool/frontend",
33
"private": true,
4-
"version": "2.0.23",
4+
"version": "2.0.29",
55
"type": "module",
66
"scripts": {
77
"build": "vite build",

govtool/frontend/src/components/molecules/GovernanceActionNewCommitteeDetailsTabContent.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ type CCMember = {
1313
newExpirationEpoch?: number;
1414
};
1515

16+
function isArrayOfStrings(value: unknown): value is string[] {
17+
return (
18+
Array.isArray(value) && value.every((item) => typeof item === "string")
19+
);
20+
}
21+
1622
export const GovernanceActionNewCommitteeDetailsTabContent = ({
1723
details,
1824
}: Pick<ProposalData, "details">) => {
@@ -38,6 +44,10 @@ export const GovernanceActionNewCommitteeDetailsTabContent = ({
3844
newExpirationEpoch: member.newExpirationEpoch,
3945
}));
4046

47+
const membersToBeRemoved = isArrayOfStrings(details?.membersToBeRemoved)
48+
? details.membersToBeRemoved
49+
: [];
50+
4151
return (
4252
<Box>
4353
{membersToBeAdded.length > 0 && (
@@ -78,7 +88,7 @@ export const GovernanceActionNewCommitteeDetailsTabContent = ({
7888
))}
7989
</Box>
8090
)}
81-
{(details?.membersToBeRemoved as string[]).length > 0 && (
91+
{membersToBeRemoved.length > 0 && (
8292
<Box mb="32px">
8393
<Typography
8494
sx={{
@@ -93,8 +103,8 @@ export const GovernanceActionNewCommitteeDetailsTabContent = ({
93103
>
94104
{t("govActions.membersToBeRemoved")}
95105
</Typography>
96-
{(details?.membersToBeRemoved as string[]).map((hash) => (
97-
<Box display="flex" flexDirection="row">
106+
{membersToBeRemoved.map((hash) => (
107+
<Box display="flex" flexDirection="row" key={hash}>
98108
<Typography
99109
sx={{
100110
fontSize: 16,

govtool/frontend/src/components/molecules/VotesSubmitted.tsx

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ export const VotesSubmitted = ({
8484
dRepAbstainVotes + (networkTotalStake?.alwaysAbstainVotingPower ?? 0);
8585

8686
// TODO: Move this logic to backend
87+
88+
// DRep votes
8789
const dRepYesVotesPercentage = totalStakeControlledByDReps
8890
? (dRepYesVotes / totalStakeControlledByDReps) * 100
8991
: undefined;
@@ -108,25 +110,45 @@ export const VotesSubmitted = ({
108110
const dRepNotVotedVotesPercentage =
109111
100 - (dRepYesVotesPercentage ?? 0) - (dRepNoVotesPercentage ?? 0);
110112

113+
// SPO/Pool votes
111114
const poolYesVotesPercentage =
112-
poolYesVotes + poolNoVotes
113-
? (poolYesVotes / (poolYesVotes + poolNoVotes)) * 100
115+
typeof poolYesVotes === "number" &&
116+
typeof networkTotalStake?.totalStakeControlledBySPOs === "number" &&
117+
networkTotalStake.totalStakeControlledBySPOs > 0
118+
? (poolYesVotes / networkTotalStake.totalStakeControlledBySPOs) * 100
114119
: undefined;
115-
const poolNoVotesPercentage = poolYesVotesPercentage
116-
? 100 - poolYesVotesPercentage
117-
: poolNoVotes
118-
? 100
119-
: undefined;
120120

121+
const poolNoVotesPercentage =
122+
typeof poolNoVotes === "number" &&
123+
typeof networkTotalStake?.totalStakeControlledBySPOs === "number" &&
124+
networkTotalStake.totalStakeControlledBySPOs > 0
125+
? (poolNoVotes / networkTotalStake.totalStakeControlledBySPOs) * 100
126+
: undefined;
127+
128+
const poolNotVotedVotes =
129+
typeof networkTotalStake?.totalStakeControlledBySPOs === "number"
130+
? networkTotalStake.totalStakeControlledBySPOs -
131+
(poolYesVotes + poolNoVotes + poolAbstainVotes)
132+
: undefined;
133+
134+
const poolNotVotedVotesPercentage =
135+
100 -
136+
(typeof poolYesVotesPercentage === "number" ? poolYesVotesPercentage : 0) -
137+
(typeof poolNoVotesPercentage === "number" ? poolNoVotesPercentage : 0);
138+
139+
// Constitutional Commission votes
121140
const ccYesVotesPercentage = noOfCommitteeMembers
122141
? (ccYesVotes / noOfCommitteeMembers) * 100
123142
: undefined;
124-
const ccNoVotesPercentage = noOfCommitteeMembers
143+
144+
const ccNoVotesPercentage = noOfCommitteeMembers
125145
? (ccNoVotes / noOfCommitteeMembers) * 100
126146
: undefined;
127-
const ccNotVotedVotes =
147+
148+
const ccNotVotedVotes =
128149
noOfCommitteeMembers - ccYesVotes - ccNoVotes - ccAbstainVotes;
129-
const ccNotVotedVotesPercentage =
150+
151+
const ccNotVotedVotesPercentage =
130152
100 - (ccYesVotesPercentage ?? 0) - (ccNoVotesPercentage ?? 0);
131153

132154
return (
@@ -200,6 +222,8 @@ export const VotesSubmitted = ({
200222
noVotes={poolNoVotes}
201223
noVotesPercentage={poolNoVotesPercentage}
202224
abstainVotes={poolAbstainVotes}
225+
notVotedVotes={poolNotVotedVotes}
226+
notVotedPercentage={poolNotVotedVotesPercentage}
203227
threshold={
204228
(() => {
205229
const votingThresholdKey = getGovActionVotingThresholdKey({

govtool/frontend/src/components/organisms/DrawerMobile.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ export const DrawerMobile = ({
9090
<MenuNavItem
9191
closeDrawer={() => setIsDrawerOpen(false)}
9292
navItem={navItem}
93+
key={navItem.label}
9394
/>
9495
);
9596
}

0 commit comments

Comments
 (0)