diff --git a/govtool/backend/sql/get-network-metrics.sql b/govtool/backend/sql/get-network-metrics.sql index 4aa9c8cbb..73ddabc95 100644 --- a/govtool/backend/sql/get-network-metrics.sql +++ b/govtool/backend/sql/get-network-metrics.sql @@ -186,9 +186,10 @@ CommitteeThreshold AS ( SELECT c.* FROM committee c - LEFT JOIN LatestGovAction lga ON c.gov_action_proposal_id = lga.id - WHERE (c.gov_action_proposal_id IS NOT NULL AND lga.id IS NOT NULL) - OR (c.gov_action_proposal_id IS NULL) + where + ( c.gov_action_proposal_id = (Select id from LatestGovAction)) + OR ( c.gov_action_proposal_id IS NULL) + order by gov_action_proposal_id nulls last limit 1 ) SELECT UniqueDelegators.count AS unique_delegators, diff --git a/govtool/frontend/src/components/organisms/GovernanceActionDetailsCardData.tsx b/govtool/frontend/src/components/organisms/GovernanceActionDetailsCardData.tsx index b38a2b2d0..b8adba8e1 100644 --- a/govtool/frontend/src/components/organisms/GovernanceActionDetailsCardData.tsx +++ b/govtool/frontend/src/components/organisms/GovernanceActionDetailsCardData.tsx @@ -1,5 +1,5 @@ import { useMemo, useState, useEffect } from "react"; -import { Box, Tabs, Tab, styled, Skeleton } from "@mui/material"; +import { Box, Tabs, Tab, styled, Skeleton, Link } from "@mui/material"; import { useLocation } from "react-router-dom"; import CheckCircleOutlineIcon from "@mui/icons-material/CheckCircleOutline"; import CancelOutlinedIcon from "@mui/icons-material/CancelOutlined"; @@ -29,9 +29,11 @@ import { validateSignature, } from "@utils"; import { MetadataValidationStatus, ProposalData } from "@models"; +import { Trans } from "react-i18next"; import { errorRed, successGreen } from "@/consts"; import { GovernanceActionType } from "@/types/governanceAction"; import { useAppContext } from "@/context"; +import { theme } from "@/theme"; type TabPanelProps = { children?: React.ReactNode; @@ -165,6 +167,11 @@ export const GovernanceActionDetailsCardData = ({ hash ?? "" }`; + const isItMLabsWithdrawal = + type === GovernanceActionType.TreasuryWithdrawals && + cip129GovernanceActionId === + "gov_action18nefry4qacd80xzs2srjahxm2e4vz3c8wvrr03rrtk8mdqfuknysq66459t"; + const tabs = useMemo( () => [ @@ -390,6 +397,7 @@ export const GovernanceActionDetailsCardData = ({ publicKey={author.publicKey} algorithm={author.witnessAlgorithm} jsonContent={jsonContent} + forceValidStatus={isItMLabsWithdrawal} /> {author.name} ))} + {isItMLabsWithdrawal && authors && authors.length > 0 && } @@ -520,13 +529,16 @@ const AuthorSignatureStatus = ({ publicKey, signature, jsonContent, + forceValidStatus = false, }: { algorithm?: string; publicKey?: string; signature?: string; jsonContent?: Record; + forceValidStatus: boolean; }) => { const { t } = useTranslation(); + const [isSignatureValid, setIsSignatureValid] = useState( null, ); @@ -543,6 +555,9 @@ const AuthorSignatureStatus = ({ const result = await validateSignature(args); if (!cancelled) setIsSignatureValid(result); } + if (forceValidStatus) { + return setIsSignatureValid(true); + } checkSignature(); return () => { cancelled = true; @@ -573,3 +588,46 @@ const AuthorSignatureStatus = ({ ); }; + +const AuthorsVerificationInfoBox = () => { + const { t } = useTranslation(); + const { + palette: { lightBlue, secondaryBlue }, + } = theme; + + return ( + + + + + {t("govActions.safeModeInfoBox.title")} + + + {t("govActions.safeModeInfoBox.line1")} + + + ]} + /> + + + {t("govActions.safeModeInfoBox.link")} + + + + ); +}; diff --git a/govtool/frontend/src/i18n/locales/en.json b/govtool/frontend/src/i18n/locales/en.json index 4ecbc2ea9..4e89f3fb1 100644 --- a/govtool/frontend/src/i18n/locales/en.json +++ b/govtool/frontend/src/i18n/locales/en.json @@ -482,6 +482,12 @@ "additionalInformationAboutYourVote": "Additional information about your vote", "provideNewContextAboutYourVote": "Provide new context about your vote", "rationale": "Rationale", + "safeModeInfoBox": { + "title": "How this Author got verified?", + "line1": "A metadata formatting issue caused only part of the data to be signed, preventing automatic verification — the signature is valid and can be manually confirmed.", + "line2": "<0>Govtool have manually verified the signature confirming this Treasury action is genuinely coming from Intersect and has marked it accordingly to make it explicit to DReps.", + "link": "More details" + }, "seeExternalData": "See external data", "selectDifferentOption": "Select a different option to change your vote", "showVotes": "Show votes",