diff --git a/CHANGELOG.md b/CHANGELOG.md index fb48ee04f..4196934b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,9 @@ changes. - Fix missing DRep name whitespace validation [Issue 1873](https://github.com/IntersectMBO/govtool/issues/1873) - Fix displaying wrongly formatted Governance Action ID [Issue 1866](https://github.com/IntersectMBO/govtool/issues/1866k) - Make payment address optional in DRep registration and edit form [Issue 1871](https://github.com/IntersectMBO/govtool/issues/1871) +- Fix displaying wrongly formatted Governance Action ID [Issue 1866](https://github.com/IntersectMBO/govtool/issues/1866) +- Fix displaying the proper Governance Action Details on renavigating between pages +- Fix displaying protocol params Governance Action details when metadata validation fails [Issue 1889](https://github.com/IntersectMBO/govtool/issues/1889) ### Changed diff --git a/govtool/frontend/src/components/molecules/GovernanceActionDetailsDiffView.tsx b/govtool/frontend/src/components/molecules/GovernanceActionDetailsDiffView.tsx index f15b202c8..22f1c6aab 100644 --- a/govtool/frontend/src/components/molecules/GovernanceActionDetailsDiffView.tsx +++ b/govtool/frontend/src/components/molecules/GovernanceActionDetailsDiffView.tsx @@ -1,6 +1,9 @@ import { diffLines, formatLines } from "unidiff"; import { parseDiff, Diff, Hunk } from "react-diff-view"; import "react-diff-view/style/index.css"; +import { Box, Typography } from "@mui/material"; +import { useTranslation } from "react-i18next"; + import "./react-diff-view.overrides.css"; type Props = { @@ -12,6 +15,7 @@ export const GovernanceActionDetailsDiffView = ({ oldJson, newJson, }: Props) => { + const { t } = useTranslation(); const diffText = formatLines( diffLines( JSON.stringify(oldJson, null, 2), @@ -24,19 +28,50 @@ export const GovernanceActionDetailsDiffView = ({ if (!oldJson && !newJson) return; return ( - - {(hunks) => - hunks.map((hunk) => ( - // Hunk component does not allow to pass children as a prop - // but that is the typing issue as passing the children - // is recommended by documentation approach. - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-expect-error - - {hunk.content} - - )) - } - + + + + {t("govActions.protocolParamsDetails.existing")} + + + {t("govActions.protocolParamsDetails.proposed")} + + + + {(hunks) => + hunks.map((hunk) => ( + // Hunk component does not allow to pass children as a prop + // but that is the typing issue as passing the children + // is recommended by documentation approach. + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-expect-error + + {hunk.content} + + )) + } + + ); }; diff --git a/govtool/frontend/src/components/organisms/DashboardGovernanceActions.tsx b/govtool/frontend/src/components/organisms/DashboardGovernanceActions.tsx index d2a2619e6..45b466475 100644 --- a/govtool/frontend/src/components/organisms/DashboardGovernanceActions.tsx +++ b/govtool/frontend/src/components/organisms/DashboardGovernanceActions.tsx @@ -134,7 +134,7 @@ export const DashboardGovernanceActions = () => { value={content} indicatorColor="secondary" onChange={handleChange} - aria-label="basic tabs example" + aria-label="Governance Actions tabs" > { const { dRepID } = useCardano(); const { data, isLoading, refetch, isRefetching } = useQuery( - [QUERY_KEYS.useGetProposalKey, dRepID], + [QUERY_KEYS.useGetProposalKey, dRepID, proposalId], () => getProposal(proposalId, dRepID), { staleTime: Infinity, diff --git a/govtool/frontend/src/i18n/locales/en.ts b/govtool/frontend/src/i18n/locales/en.ts index 1e1cb4410..4618a7d5a 100644 --- a/govtool/frontend/src/i18n/locales/en.ts +++ b/govtool/frontend/src/i18n/locales/en.ts @@ -416,6 +416,10 @@ export const en = { governanceActionId: "Governance Action ID:", governanceActionType: "Governance Action Type:", goToVote: "Go to Vote", + protocolParamsDetails: { + existing: "Existing", + proposed: "Proposed", + }, hardforkDetails: { currentVersion: "Current version", proposedVersion: "Proposed version",