Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GovTool - v2.0.10 #2819

Merged
merged 7 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,34 @@ changes.

### Added

-

### Fixed

-

### Changed

-

### Removed

-

## [v2.0.10](https://github.com/IntersectMBO/govtool/releases/tag/v2.0.10) 2025-01-29

### Added

- Add exception handler on stake key voting power query execution [Issue 2757](https://github.com/IntersectMBO/govtool/issues/2757)
- Add script hash to new consitution governance action [Issue 2745](https://github.com/IntersectMBO/govtool/issues/2745)

### Fixed

-

### Changed

- Bump @intersect.mbo/pdf-ui to v0.5.10
- Bump @intersect.mbo/pdf-ui to v0.5.11

### Removed

Expand Down
2 changes: 1 addition & 1 deletion govtool/backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ FROM $BASE_IMAGE_REPO:$BASE_IMAGE_TAG
WORKDIR /src
COPY . .
RUN cabal build
RUN cp dist-newstyle/build/x86_64-linux/ghc-9.2.7/vva-be-2.0.9/x/vva-be/build/vva-be/vva-be /usr/local/bin
RUN cp dist-newstyle/build/x86_64-linux/ghc-9.2.7/vva-be-2.0.10/x/vva-be/build/vva-be/vva-be /usr/local/bin
2 changes: 1 addition & 1 deletion govtool/backend/Dockerfile.qovery
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM $BASE_IMAGE_REPO:$BASE_IMAGE_TAG
WORKDIR /src
COPY . .
RUN cabal build
RUN cp dist-newstyle/build/x86_64-linux/ghc-9.2.7/vva-be-2.0.9/x/vva-be/build/vva-be/vva-be /usr/local/bin
RUN cp dist-newstyle/build/x86_64-linux/ghc-9.2.7/vva-be-2.0.10/x/vva-be/build/vva-be/vva-be /usr/local/bin

# Expose the necessary port
EXPOSE 9876
Expand Down
3 changes: 2 additions & 1 deletion govtool/backend/sql/list-proposals.sql
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ SELECT

WHEN gov_action_proposal.type::text = 'NewConstitution' THEN
json_build_object(
'anchor', gov_action_proposal.description->'contents'->1->'anchor'
'anchor', gov_action_proposal.description->'contents'->1->'anchor',
'script', gov_action_proposal.description->'contents'->1->'script'
)
WHEN gov_action_proposal.type::text = 'NewCommittee' THEN
(
Expand Down
2 changes: 1 addition & 1 deletion govtool/backend/vva-be.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 3.6
name: vva-be
version: 2.0.9
version: 2.0.10

-- A short (one-line) description of the package.
-- synopsis:
Expand Down
12 changes: 6 additions & 6 deletions govtool/frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions govtool/frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@govtool/frontend",
"private": true,
"version": "2.0.9",
"version": "2.0.10",
"type": "module",
"scripts": {
"build": "vite build",
Expand Down Expand Up @@ -29,7 +29,7 @@
"@hookform/resolvers": "^3.3.1",
"@intersect.mbo/govtool-outcomes-pillar-ui": "^1.0.0-beta.1",
"@intersect.mbo/intersectmbo.org-icons-set": "^1.0.8",
"@intersect.mbo/pdf-ui": "^0.5.10",
"@intersect.mbo/pdf-ui": "^0.5.11",
"@mui/icons-material": "^5.14.3",
"@mui/material": "^5.14.4",
"@rollup/plugin-babel": "^6.0.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ type DataMissingHeaderProps = {
titleStyle?: SxProps;
isDRep?: boolean;
image?: string | null;
shareLink?: string;
};

export const DataMissingHeader = ({
Expand All @@ -24,6 +25,7 @@ export const DataMissingHeader = ({
titleStyle,
isDRep,
image,
shareLink,
}: DataMissingHeaderProps) => {
const base64Image = getBase64ImageDetails(image ?? "");
const { screenWidth } = useScreenDimension();
Expand Down Expand Up @@ -81,7 +83,9 @@ export const DataMissingHeader = ({
title}
</Typography>
</Box>
{screenWidth >= 1020 && <Share link={window.location.href} />}
{screenWidth >= 1020 && (
<Share link={shareLink || window.location.href} />
)}
</Box>
);
};
Original file line number Diff line number Diff line change
@@ -1,30 +1,38 @@
import { Box } from "@mui/material";

import { NewConstitutionAnchor, ProposalData } from "@/models";
import { useScreenDimension } from "@/hooks";
import { useScreenDimension, useTranslation } from "@/hooks";

import { GovernanceActionCardElement } from "./GovernanceActionCardElement";

export const GovernanceActionNewConstitutionDetailsTabContent = ({
details,
}: Pick<ProposalData, "details">) => {
const { screenWidth } = useScreenDimension();
const { t } = useTranslation();
return (
<Box>
<GovernanceActionCardElement
isLinkButton
label="New constitution link"
label={t("govActions.newConstitution.url")}
text={(details?.anchor as NewConstitutionAnchor)?.url as string}
dataTestId="new-constitution-url"
textVariant={screenWidth > 1600 ? "longText" : "oneLine"}
/>
<GovernanceActionCardElement
isCopyButton
label="New constitution hash"
label={t("govActions.newConstitution.hash")}
text={(details?.anchor as NewConstitutionAnchor)?.dataHash as string}
dataTestId="new-constitution-data-hash"
textVariant={screenWidth > 1600 ? "longText" : "oneLine"}
/>
<GovernanceActionCardElement
isCopyButton
label={t("govActions.newConstitution.scriptHash")}
text={details?.script as string}
dataTestId="new-constitution-script-hash"
textVariant={screenWidth > 1600 ? "longText" : "oneLine"}
/>
</Box>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ import { useScreenDimension } from "@hooks";
import {
GovernanceActionCardStatePill,
GovernanceActionDetailsCardVotes,
Share,
} from "@molecules";
import { GovernanceActionDetailsCardData } from "@organisms";
import { MetadataValidationStatus, ProposalData, ProposalVote } from "@models";
import { useLocation } from "react-router-dom";

type GovernanceActionDetailsCardProps = {
isDashboard?: boolean;
Expand All @@ -32,13 +30,6 @@ export const GovernanceActionDetailsCard = ({
const { screenWidth, isMobile } = useScreenDimension();

const isOneColumn = (isDashboard && screenWidth < 1036) ?? isMobile;
const { pathname, hash } = useLocation();

const govActionLinkToShare = `${window.location.protocol}//${
window.location.hostname
}${window.location.port ? `:${window.location.port}` : ""}${pathname}${
hash ?? ""
}`;

return (
<Box
Expand Down Expand Up @@ -82,9 +73,6 @@ export const GovernanceActionDetailsCard = ({
isInProgress={isInProgress}
proposal={proposal}
/>
<Box position="absolute" right={40} top={40}>
<Share link={govActionLinkToShare} />
</Box>
</Box>
);
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useMemo, useState } from "react";
import { Box, Tabs, Tab, styled } from "@mui/material";
import { useLocation } from "react-router-dom";

import { CopyButton, ExternalModalButton, Typography } from "@atoms";
import {
Expand Down Expand Up @@ -95,6 +96,7 @@ export const GovernanceActionDetailsCardData = ({
const { t } = useTranslation();
const { screenWidth } = useScreenDimension();
const { isMobile } = useScreenDimension();
const { pathname, hash } = useLocation();

const mappedArraysToObjectsProtocolParams = useMemo(
() =>
Expand Down Expand Up @@ -147,6 +149,12 @@ export const GovernanceActionDetailsCardData = ({
? getFullGovActionId(prevGovActionTxHash, prevGovActionIndex)
: null;

const govActionLinkToShare = `${window.location.protocol}//${
window.location.hostname
}${window.location.port ? `:${window.location.port}` : ""}${pathname}${
hash ?? ""
}`;

const tabs = useMemo(
() =>
[
Expand Down Expand Up @@ -232,7 +240,11 @@ export const GovernanceActionDetailsCardData = ({
overflow: "hidden",
}}
>
<DataMissingHeader isDataMissing={isDataMissing} title={title} />
<DataMissingHeader
isDataMissing={isDataMissing}
title={title}
shareLink={govActionLinkToShare}
/>
<DataMissingInfoBox
isDataMissing={isDataMissing}
isInProgress={isInProgress}
Expand Down Expand Up @@ -319,20 +331,25 @@ export const GovernanceActionDetailsCardData = ({
amount={withdrawal.amount}
/>
))}
<GovernanceActionCardElement
label={t("govActions.anchorURL")}
text={url}
textVariant="longText"
dataTestId="anchor-url"
isLinkButton
/>
<GovernanceActionCardElement
label={t("govActions.anchorHash")}
text={metadataHash}
textVariant="longText"
dataTestId="anchor-hash"
isCopyButton
/>
{/* NewConstitution metadata hash and url is visible in details tab */}
{type !== GovernanceActionType.NewConstitution && (
<>
<GovernanceActionCardElement
label={t("govActions.anchorURL")}
text={url}
textVariant="longText"
dataTestId="anchor-url"
isLinkButton
/>
<GovernanceActionCardElement
label={t("govActions.anchorHash")}
text={metadataHash}
textVariant="longText"
dataTestId="anchor-hash"
isCopyButton
/>
</>
)}

<GovernanceActionDetailsCardLinks links={references} />
</Box>
Expand Down
5 changes: 5 additions & 0 deletions govtool/frontend/src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,11 @@
"proposedVersion": "Proposed version",
"previousGAId": "Previous Governance Action ID"
},
"newConstitution": {
"url": "New constitution link",
"hash": "New constitution hash",
"scriptHash": "New constitution script hash"
},
"motivation": "Motivation",
"myVote": "My Vote:",
"noResultsForTheSearch": "No results for the search.",
Expand Down
8 changes: 4 additions & 4 deletions govtool/frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1501,10 +1501,10 @@
resolved "https://registry.npmjs.org/@intersect.mbo/intersectmbo.org-icons-set/-/intersectmbo.org-icons-set-1.1.0.tgz"
integrity sha512-sjKEtnK9eLYH/8kCD0YRQCms3byFA/tnSsei9NHTZbBYX9sBpeX6ErfR0sKYjOSxQOxl4FumX9D0X+vHIqxo8g==

"@intersect.mbo/pdf-ui@^0.5.10":
version "0.5.10"
resolved "https://registry.npmjs.org/@intersect.mbo/pdf-ui/-/pdf-ui-0.5.10.tgz"
integrity sha512-haXdbnddRCl3rLsKWw96tGoaEFdxZOyPIYxSR7ZsiROBCp4xZQsAneMGBaH2X3TxkRHnfc8XetmYdrxy1G+ALQ==
"@intersect.mbo/pdf-ui@^0.5.11":
version "0.5.11"
resolved "https://registry.npmjs.org/@intersect.mbo/pdf-ui/-/pdf-ui-0.5.11.tgz"
integrity sha512-LchrkbU2cbNP3zajkVoFy/+ZcqBDAt9AnF9weYGQPU0qD2ryj93JNeKzUctsYsWfGLy5d7TslNdnpx0zGVcc9A==
dependencies:
"@emurgo/cardano-serialization-lib-asmjs" "^12.0.0-beta.2"
"@fontsource/poppins" "^5.0.14"
Expand Down
10 changes: 5 additions & 5 deletions govtool/metadata-validation/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion govtool/metadata-validation/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@govtool/metadata-validation",
"version": "2.0.9",
"version": "2.0.10",
"description": "",
"author": "",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion govtool/metadata-validation/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ async function bootstrap() {
const config = new DocumentBuilder()
.setTitle('Metadata Validation Tool')
.setDescription('The Metadata Validation Tool API description')
.setVersion('2.0.9')
.setVersion('2.0.10')
.build();

const document = SwaggerModule.createDocument(app, config);
Expand Down
Loading