Skip to content

Commit

Permalink
Merge pull request #2351 from IntersectMBO/test
Browse files Browse the repository at this point in the history
GovTool - v1.0.26
  • Loading branch information
MSzalowski authored Nov 7, 2024
2 parents 343854d + ff63710 commit fbb49bc
Show file tree
Hide file tree
Showing 41 changed files with 1,203 additions and 994 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,28 @@ changes.

-

## [v1.0.26](https://github.com/IntersectMBO/govtool/releases/tag/v1.0.26) 2024-11-07

### Added

- add support for CIP-129 governance identifiers [Issue 2183](https://github.com/IntersectMBO/govtool/issues/2183)
- Add label to supporting links in Governance Action details [Issue 2305](https://github.com/IntersectMBO/govtool/issues/2305)

### Fixed

- Fix certificates order where vote delegation cert is before the DRep registration cert [Issue 2333](https://github.com/IntersectMBO/govtool/issues/2333)

### Changed

- Change multilanguage support to use json file [Issue 2325](https://github.com/IntersectMBO/govtool/issues/2325)
- Display full Governance Action IDs on desktop
- Support space on given name [Issue 2276](https://github.com/IntersectMBO/govtool/issues/2276)
- Display ADA in 'en-US' format [Issue 2305](https://github.com/IntersectMBO/govtool/issues/2305)

### Removed

-

## [v1.0.25](https://github.com/IntersectMBO/govtool/releases/tag/v1.0.25) 2024-11-04

### Added
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-1.0.25/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-1.0.26/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-1.0.25/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-1.0.26/x/vva-be/build/vva-be/vva-be /usr/local/bin

# Expose the necessary port
EXPOSE 9876
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: 1.0.25
version: 1.0.26

-- A short (one-line) description of the package.
-- synopsis:
Expand Down
4 changes: 2 additions & 2 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": "1.0.25",
"version": "1.0.26",
"type": "module",
"scripts": {
"build": "vite build",
Expand Down Expand Up @@ -109,5 +109,5 @@
"typescript": "^5.0.2"
},
"readme": "ERROR: No README data found!",
"_id": "[email protected].25"
"_id": "[email protected].26"
}
17 changes: 15 additions & 2 deletions govtool/frontend/src/components/molecules/GovernanceActionCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {

import { useScreenDimension, useTranslation } from "@hooks";
import {
encodeCIP129Identifier,
getFullGovActionId,
getProposalTypeLabel,
getProposalTypeNoEmptySpaces,
Expand Down Expand Up @@ -53,6 +54,11 @@ export const GovernanceActionCard: FC<ActionTypeProps> = ({ ...props }) => {
const { t } = useTranslation();

const govActionId = getFullGovActionId(txHash, index);
const cip129GovernanceActionId = encodeCIP129Identifier(
txHash,
index.toString(16).padStart(2, "0"),
"gov_action",
);

return (
<Box
Expand Down Expand Up @@ -113,8 +119,15 @@ export const GovernanceActionCard: FC<ActionTypeProps> = ({ ...props }) => {
/>
<GovernanceActionCardElement
label={t("govActions.governanceActionId")}
text={getFullGovActionId(txHash, index)}
dataTestId={`${getFullGovActionId(txHash, index)}-id`}
text={govActionId}
dataTestId={`${govActionId}-id`}
isCopyButton
isSliderCard
/>
<GovernanceActionCardElement
label={t("govActions.cip129GovernanceActionId")}
text={cip129GovernanceActionId}
dataTestId={`${cip129GovernanceActionId}-id`}
isCopyButton
isSliderCard
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { LinkWithIcon } from "@molecules";
export const GovernanceActionDetailsCardLinks = ({
links,
}: {
links?: string[];
links?: Reference[];
}) => {
const { isMobile } = useScreenDimension();
const { t } = useTranslation();
Expand Down Expand Up @@ -41,21 +41,31 @@ export const GovernanceActionDetailsCardLinks = ({
rowGap: 2,
}}
>
{links.map((link) => (
<LinkWithIcon
key={link}
label={link}
onClick={() => {
openModal({
type: "externalLink",
state: {
externalLink: link,
},
});
}}
icon={<img alt="link" src={ICONS.link} />}
cutWithEllipsis
/>
{links.map(({ uri, label }) => (
<Box flexDirection="column">
{label && (
<Typography
data-testid={`${label}-${uri}-label`}
sx={{ fontWeight: "500" }}
>
{label}
</Typography>
)}
<LinkWithIcon
key={uri}
label={uri}
onClick={() => {
openModal({
type: "externalLink",
state: {
externalLink: uri,
},
});
}}
icon={<img alt="link" src={ICONS.link} />}
cutWithEllipsis
/>
</Box>
))}
</Box>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Button } from "@atoms";
import { PATHS } from "@consts";
import { useScreenDimension, useTranslation } from "@hooks";
import {
encodeCIP129Identifier,
getFullGovActionId,
getProposalTypeLabel,
getProposalTypeNoEmptySpaces,
Expand Down Expand Up @@ -43,6 +44,13 @@ export const GovernanceVotedOnCard = ({ votedProposal, inProgress }: Props) => {
const { isMobile, screenWidth } = useScreenDimension();
const { t } = useTranslation();

const govActionId = getFullGovActionId(txHash, index);
const cip129GovernanceActionId = encodeCIP129Identifier(
txHash,
index.toString(16).padStart(2, "0"),
"gov_action",
);

return (
<Box
sx={{
Expand Down Expand Up @@ -101,8 +109,15 @@ export const GovernanceVotedOnCard = ({ votedProposal, inProgress }: Props) => {
/>
<GovernanceActionCardElement
label={t("govActions.governanceActionId")}
text={getFullGovActionId(txHash, index)}
dataTestId={`${getFullGovActionId(txHash, index)}-id`}
text={govActionId}
dataTestId={`${govActionId}-id`}
isCopyButton
isSliderCard
/>
<GovernanceActionCardElement
label={t("govActions.cip129GovernanceActionId")}
text={cip129GovernanceActionId}
dataTestId={`${cip129GovernanceActionId}-id`}
isCopyButton
isSliderCard
/>
Expand All @@ -120,15 +135,12 @@ export const GovernanceVotedOnCard = ({ votedProposal, inProgress }: Props) => {
>
<Button
disabled={inProgress}
data-testid={`govaction-${getFullGovActionId(
txHash,
index,
)}-change-your-vote`}
data-testid={`govaction-${govActionId}-change-your-vote`}
onClick={() =>
navigate(
PATHS.dashboardGovernanceActionsAction.replace(
":proposalId",
getFullGovActionId(txHash, index),
govActionId,
),
{
state: {
Expand Down
6 changes: 4 additions & 2 deletions govtool/frontend/src/components/molecules/VotesSubmitted.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Box } from "@mui/material";
import { IMAGES } from "@consts";
import { Typography, VotePill } from "@atoms";
import { useTranslation } from "@hooks";
import { correctAdaFormat } from "@utils";
import { correctVoteAdaFormat } from "@utils";
import { SubmittedVotesData } from "@models";

type Props = {
Expand Down Expand Up @@ -148,9 +148,11 @@ const Vote = ({ type, vote, value }: VoteProps) => (
sx={{
fontSize: 16,
wordBreak: "break-all",
lineHeight: "24px",
fontWeight: "500",
}}
>
{type !== "ccCommittee" ? `₳ ${correctAdaFormat(value)}` : value}
{type !== "ccCommittee" ? `₳ ${correctVoteAdaFormat(value)}` : value}
</Typography>
</Box>
);
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const EditDRepStorageInformation = ({
} = useEditDRepInfoForm(setStep);
const { screenWidth } = useScreenDimension();

const fileName = getValues("givenName").replace(/\s/g, "");
const fileName = getValues("givenName");
const openGuideAboutStoringInformation = () =>
openInNewTab(
"https://docs.gov.tools/using-govtool/govtool-functions/storing-information-offline",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
filterOutNullParams,
getFullGovActionId,
mapArrayToObjectByKeys,
encodeCIP129Identifier,
} from "@utils";
import { MetadataValidationStatus, ProposalData } from "@models";
import { GovernanceActionType } from "@/types/governanceAction";
Expand Down Expand Up @@ -142,6 +143,11 @@ export const GovernanceActionDetailsCardData = ({

const label = getProposalTypeLabel(type);
const govActionId = getFullGovActionId(txHash, index);
const cip129GovernanceActionId = encodeCIP129Identifier(
txHash,
index.toString(16).padStart(2, "0"),
"gov_action",
);
const prevGovActionId =
prevGovActionIndex && prevGovActionTxHash
? getFullGovActionId(prevGovActionTxHash, prevGovActionIndex)
Expand Down Expand Up @@ -243,6 +249,14 @@ export const GovernanceActionDetailsCardData = ({
text={govActionId}
isCopyButton
dataTestId={`${govActionId}-id`}
textVariant={screenWidth > 1600 ? "longText" : "oneLine"}
/>
<GovernanceActionCardElement
label={t("govActions.cip129GovernanceActionId")}
text={cip129GovernanceActionId}
dataTestId={`${cip129GovernanceActionId}-id`}
isCopyButton
textVariant={screenWidth > 1600 ? "longText" : "oneLine"}
/>

{tabs.length === 1 ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const DRepStorageInformation = ({
} = useRegisterAsdRepForm(setStep);
const { screenWidth } = useScreenDimension();

const fileName = getValues("givenName").replace(/\s/g, "");
const fileName = getValues("givenName");

const openGuideAboutStoringInformation = () =>
openInNewTab(
Expand Down
4 changes: 0 additions & 4 deletions govtool/frontend/src/consts/dRepActions/fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ export const Rules = {
maxLength: 80,
}),
},
pattern: {
value: /^[^\s]+$/,
message: i18n.t("registration.fields.validations.noSpaces"),
},
},
LINK_DESCRIPTION: {
maxLength: {
Expand Down
Loading

0 comments on commit fbb49bc

Please sign in to comment.