Skip to content

Commit b9b165d

Browse files
authored
Merge pull request #3900 from IntersectMBO/develop
Merge Develop into QA
2 parents 2fe116c + bd06d82 commit b9b165d

File tree

3 files changed

+69
-4
lines changed

3 files changed

+69
-4
lines changed

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/frontend/src/components/organisms/GovernanceActionDetailsCardData.tsx

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useMemo, useState, useEffect } from "react";
2-
import { Box, Tabs, Tab, styled, Skeleton } from "@mui/material";
2+
import { Box, Tabs, Tab, styled, Skeleton, Link } from "@mui/material";
33
import { useLocation } from "react-router-dom";
44
import CheckCircleOutlineIcon from "@mui/icons-material/CheckCircleOutline";
55
import CancelOutlinedIcon from "@mui/icons-material/CancelOutlined";
@@ -29,9 +29,11 @@ import {
2929
validateSignature,
3030
} from "@utils";
3131
import { MetadataValidationStatus, ProposalData } from "@models";
32+
import { Trans } from "react-i18next";
3233
import { errorRed, successGreen } from "@/consts";
3334
import { GovernanceActionType } from "@/types/governanceAction";
3435
import { useAppContext } from "@/context";
36+
import { theme } from "@/theme";
3537

3638
type TabPanelProps = {
3739
children?: React.ReactNode;
@@ -165,6 +167,11 @@ export const GovernanceActionDetailsCardData = ({
165167
hash ?? ""
166168
}`;
167169

170+
const isItMLabsWithdrawal =
171+
type === GovernanceActionType.TreasuryWithdrawals &&
172+
cip129GovernanceActionId ===
173+
"gov_action18nefry4qacd80xzs2srjahxm2e4vz3c8wvrr03rrtk8mdqfuknysq66459t";
174+
168175
const tabs = useMemo(
169176
() =>
170177
[
@@ -390,6 +397,7 @@ export const GovernanceActionDetailsCardData = ({
390397
publicKey={author.publicKey}
391398
algorithm={author.witnessAlgorithm}
392399
jsonContent={jsonContent}
400+
forceValidStatus={isItMLabsWithdrawal}
393401
/>
394402
<span>{author.name}</span>
395403
<Tooltip
@@ -409,6 +417,7 @@ export const GovernanceActionDetailsCardData = ({
409417
</Tooltip>
410418
</Box>
411419
))}
420+
{isItMLabsWithdrawal && authors && authors.length > 0 && <AuthorsVerificationInfoBox />}
412421
</Box>
413422
</GovernanceActionCardElement>
414423

@@ -520,13 +529,16 @@ const AuthorSignatureStatus = ({
520529
publicKey,
521530
signature,
522531
jsonContent,
532+
forceValidStatus = false,
523533
}: {
524534
algorithm?: string;
525535
publicKey?: string;
526536
signature?: string;
527537
jsonContent?: Record<string, unknown>;
538+
forceValidStatus: boolean;
528539
}) => {
529540
const { t } = useTranslation();
541+
530542
const [isSignatureValid, setIsSignatureValid] = useState<boolean | null>(
531543
null,
532544
);
@@ -543,6 +555,9 @@ const AuthorSignatureStatus = ({
543555
const result = await validateSignature(args);
544556
if (!cancelled) setIsSignatureValid(result);
545557
}
558+
if (forceValidStatus) {
559+
return setIsSignatureValid(true);
560+
}
546561
checkSignature();
547562
return () => {
548563
cancelled = true;
@@ -573,3 +588,46 @@ const AuthorSignatureStatus = ({
573588
</Tooltip>
574589
);
575590
};
591+
592+
const AuthorsVerificationInfoBox = () => {
593+
const { t } = useTranslation();
594+
const {
595+
palette: { lightBlue, secondaryBlue },
596+
} = theme;
597+
598+
return (
599+
<Box
600+
sx={{
601+
display: "flex",
602+
gap: 1,
603+
backgroundColor: lightBlue,
604+
p: 2,
605+
borderRadius: "5px",
606+
}}
607+
>
608+
<InfoOutlinedIcon fontSize="small" style={{ color: secondaryBlue }} />
609+
<Box sx={{ display: "flex", flexDirection: "column", gap: 2 }}>
610+
<Typography variant="body2">
611+
{t("govActions.safeModeInfoBox.title")}
612+
</Typography>
613+
<Typography variant="body2">
614+
{t("govActions.safeModeInfoBox.line1")}
615+
</Typography>
616+
<Typography variant="body2">
617+
<Trans
618+
i18nKey="govActions.safeModeInfoBox.line2"
619+
components={[<span style={{ fontWeight: 700 }} key="0" />]}
620+
/>
621+
</Typography>
622+
<Link
623+
href="https://docs.gov.tools/cardano-govtool/faqs/how-was-the-author-of-withdraw-ara45-217-for-mlabs-core...-ga-verified"
624+
target="_blank"
625+
rel="noopener noreferrer"
626+
sx={{ fontSize: "14px" }}
627+
>
628+
{t("govActions.safeModeInfoBox.link")}
629+
</Link>
630+
</Box>
631+
</Box>
632+
);
633+
};

govtool/frontend/src/i18n/locales/en.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,12 @@
482482
"additionalInformationAboutYourVote": "Additional information about your vote",
483483
"provideNewContextAboutYourVote": "Provide new context about your vote",
484484
"rationale": "Rationale",
485+
"safeModeInfoBox": {
486+
"title": "How this Author got verified?",
487+
"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.",
488+
"line2": "<0>Govtool have manually verified the signature confirming this Treasury action is genuinely coming from Intersect</0> and has marked it accordingly to make it explicit to DReps.",
489+
"link": "More details"
490+
},
485491
"seeExternalData": "See external data",
486492
"selectDifferentOption": "Select a different option to change your vote",
487493
"showVotes": "Show votes",

0 commit comments

Comments
 (0)