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 1.0.17-test #1954

Merged
merged 11 commits into from
Sep 5, 2024
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
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,25 @@ changes.

-

## [sancho-v1.0.17](https://github.com/IntersectMBO/govtool/releases/tag/sancho-v1.0.17) 2024-09-05

### Added

-

### Fixed

- Make testIds for link and identity references in drep form unique [Issue 1928](https://github.com/IntersectMBO/govtool/issues/1928)
- Fix saving the Do Not List checkbox value on DRep registration [Issue 1940](https://github.com/IntersectMBO/govtool/issues/1940)

### Changed

- Make displaying own DRep in DRep directory available [Issue 1934](https://github.com/IntersectMBO/govtool/issues/1934)

### Removed

-

## [sancho-v1.0.16](https://github.com/IntersectMBO/govtool/releases/tag/sancho-v1.0.16) 2024-09-04

### Fixed
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.16/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.17/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.16/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.17/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.16
version: 1.0.17

-- 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.16",
"version": "1.0.17",
"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": "govtool@1.0.16"
"_id": "govtool@1.0.17"
}
18 changes: 7 additions & 11 deletions govtool/frontend/src/components/atoms/StakeRadio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@ import { Dispatch, FC, SetStateAction } from "react";
import { Box, IconButton, Typography } from "@mui/material";

import { ICONS } from "@consts";
import {
useGetAdaHolderVotingPowerQuery,
useScreenDimension,
useTranslation,
} from "@hooks";
import { useScreenDimension } from "@hooks";
import { theme } from "@/theme";
import { correctAdaFormat } from "@/utils/adaFormat";

type StakeRadioProps = {
isChecked?: boolean;
Expand All @@ -23,9 +18,9 @@ export const StakeRadio: FC<StakeRadioProps> = ({ ...props }) => {
palette: { boxShadow1 },
} = theme;
const { isMobile } = useScreenDimension();
const { powerIsLoading, votingPower } =
useGetAdaHolderVotingPowerQuery(stakeKey);
const { t } = useTranslation();
// const { powerIsLoading, votingPower } =
// useGetAdaHolderVotingPowerQuery(stakeKey);
// const { t } = useTranslation();

return (
<Box
Expand Down Expand Up @@ -68,7 +63,8 @@ export const StakeRadio: FC<StakeRadioProps> = ({ ...props }) => {
/>
</IconButton>
</Box>
<Box alignItems="center" display="flex">
{/* TODO uncomment when voting power value s correct */}
{/* <Box alignItems="center" display="flex">
<Typography color={isChecked ? "white" : "#8E908E"} variant="body2">
{t("votingPower")}
:
Expand All @@ -86,7 +82,7 @@ export const StakeRadio: FC<StakeRadioProps> = ({ ...props }) => {
₳ {correctAdaFormat(votingPower) ?? 0}
</Typography>
)}
</Box>
</Box> */}
</Box>
</Box>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box, Divider } from "@mui/material";
import { Box } from "@mui/material";

import { Button, Typography } from "@atoms";
import { primaryBlue } from "@consts";
Expand All @@ -19,7 +19,6 @@ export const AutomatedVotingCard = ({
onClickDelegate,
onClickInfo,
title,
votingPower,
transactionId,
}: AutomatedVotingCardProps) => {
const { cExplorerBaseUrl } = useAppContext();
Expand Down Expand Up @@ -84,7 +83,8 @@ export const AutomatedVotingCard = ({
</Box>
{!inProgress && !isSelected && (
<>
<Divider
{/* TODO uncomment when voting power value s correct */}
{/* <Divider
flexItem
orientation={screenWidth < 1024 ? "horizontal" : "vertical"}
sx={{ ml: screenWidth < 1024 ? 0 : 1 }}
Expand Down Expand Up @@ -113,7 +113,7 @@ export const AutomatedVotingCard = ({
orientation={screenWidth < 1024 ? "horizontal" : "vertical"}
sx={{ mr: screenWidth < 1024 ? 0 : 1 }}
variant={screenWidth < 1024 ? "fullWidth" : "middle"}
/>
/> */}
<Box
sx={{
display: "flex",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ const ReferencesSection = ({
label={t("forms.dRepData.referenceDescription")}
name={`${fieldName}.${index}.label`}
helpfulText={t("forms.dRepData.referenceDescriptionHelpfulText")}
dataTestId={`${type}-reference-description-${index + 1}-input`}
rules={Rules.LINK_DESCRIPTION}
/>
<ControlledField.Input
Expand All @@ -250,13 +251,14 @@ const ReferencesSection = ({
label={t("forms.dRepData.referenceURL")}
layoutStyles={{ mb: 3 }}
name={`${fieldName}.${index}.uri`}
dataTestId={`${type}-reference-url-${index + 1}-input`}
rules={Rules.LINK_URL}
/>
</Fragment>
))}
{references?.length < MAX_NUMBER_OF_LINKS ? (
<Button
data-testid="add-link-button"
data-testid={`add-${type}-reference-button`}
onClick={addLink}
size="extraLarge"
variant="text"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,9 @@ const ReferencesLink = ({ label, uri }: ReferenceItem) => (
sx={{
overflow: "hidden",
textOverflow: "ellipsis",
display: "flex",
gap: 1,
alignItems: "center",
}}
>
<Typography
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export const useRegisterAsdRepForm = (
"qualifications",
"paymentAddress",
"references",
"doNotList",
],
standardReference: CIP_119,
});
Expand Down
24 changes: 11 additions & 13 deletions govtool/frontend/src/i18n/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export const en = {
},
directVoter: {
isRegisteredDescription:
"Your Voting Power of ₳<strong>{{votingPower}}</strong> can be used to vote.",
"Your Voting Power can be used to vote.",
register: "Register",
registerDescription:
"Register to Vote on Governance Actions using your own voting power of ₳<strong>{{votingPower}}</strong>.",
Expand All @@ -120,7 +120,7 @@ export const en = {
retirementInProgress:
"The retirement process is ongoing. This may take several minutes.",
wasRegisteredDescription:
"You cannot vote on Governance Actions using your own voting power of ₳<strong>{{votingPower}}</strong>. until you re-register.",
"You cannot vote on Governance Actions using your own voting power until you re-register.",
youAreDirectVoterTitle: "You are a Direct Voter",
},
delegation: {
Expand All @@ -129,18 +129,18 @@ export const en = {
noDelegationDescription: "Find a DRep to vote on your behalf.",
noDelegationActionButton: "View DRep Directory",
dRepDelegationTitle:
"Your Voting Power of <strong>₳{{ada}}</strong>\nis Delegated to:",
"Your Voting Power is delegated to:",
noConfidenceDelegationTitle:
"You have delegated <strong>₳{{ada}}</strong>\nto “No Confidence”",
"You have delegated your voting power to “No Confidence”",
abstainDelegationTitle:
"You have delegated <strong>₳{{ada}}</strong>\nto “Abstain”",
"You have delegated your voting power to “Abstain”",
abstainDescription:
"You have selected to apply your Voting Power to Abstain on every vote.",
noDescription:
"You have selected to apply your Voting Power to No Confidence on every vote.",
inProgress: {
title: "Delegation",
dRep: "Your voting power of ₳<strong>{{ada}}</strong> is being delegated to:",
dRep: "Your voting power is being delegated to:",
abstain:
"You have selected to apply your Voting Power to Abstain on every vote.",
no: "You have selected to apply your Voting Power to No Confidence on every vote.",
Expand Down Expand Up @@ -254,9 +254,9 @@ export const en = {
abstainCardDefaultTitle: "Abstain from Every Vote",
automatedVotingOptions: "Automated Voting Options",
editBtn: "Edit DRep data",
delegatedToAbstainTitle: "You have delegated ₳{{ada}} to “Abstain”",
delegatedToAbstainTitle: "You have delegated your voting power to “Abstain”",
delegatedToNoConfidenceTitle:
"You have delegated ₳{{ada}} to “No Confidence”",
"You have delegated your voting power to “No Confidence”",
delegatedToAbstainDescription:
"You have selected to apply your Voting Power to Abstain on every vote.",
delegatedToNoConfidenceDescription:
Expand All @@ -266,10 +266,8 @@ export const en = {
filterTitle: "DRep Status",
goToDRepDirectory: "Go to DRep Directory",
meAsDRep: "This DRep ID is connected to your wallet",
myDelegation: "You have delegated <strong>₳ {{ada}}</strong> to:",
myDelegationToYourself:
"You have delegated <strong>₳ {{ada}}</strong> to yourself:",
myDRep: "You have delegated ₳{{ada}} to this DRep.",
myDelegation: "You have delegated your voting power to:",
myDRep: "You have delegated your voting power to this DRep.",
listTitle: "Find a DRep",
noConfidenceDefaultDescription:
"Select this to signal no confidence in the current constitutional committee by voting NO on every proposal and voting YES to no confidence proposals",
Expand Down Expand Up @@ -742,7 +740,7 @@ export const en = {
"Looks like you cannot retire, because currently you are not a Direct Voter.",
},
registerDescription:
"A Direct Voter is someone that can vote on any Governance Action with their own Voting Power, which is equal to the balance of Ada in their connected wallet. <0>Learn More</0> about Direct Voter.\n\nBecoming a Direct Voter will require a refundable deposit of <strong>₳{{deposit}}</strong>.\n\nYour deposit will be refunded if you either retire or delegate your voting power to someone else (a DRep)",
"A Direct Voter is someone that can vote on any Governance Action with their own Voting Power, which is equal to the balance of Ada in their connected wallet. <0>Learn More</0> about Direct Voter.\n\nBecoming a Direct Voter will require a refundable deposit equal to your voting power.\n\nYour deposit will be refunded if you either retire or delegate your voting power to someone else (a DRep)",
registerHeading: "What this Means",
retirementDescription:
"By Retiring you are giving up your Voting Power. You will not be able to vote on any Governance Actions. Your deposit of {{deposit}} ada will be refunded.\n\nYou can at any time in the future re-register to become a Direct Voter, or you can delegate your Voting Power to someone else, or become a DRep.\n\nThese options are listed in our Guides here: <0>Voting options and Roles</0>",
Expand Down
34 changes: 13 additions & 21 deletions govtool/frontend/src/pages/DRepDirectoryContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,27 +208,19 @@ export const DRepDirectoryContent: FC<DRepDirectoryContentProps> = ({
}}
>
{dRepList?.length === 0 && <EmptyStateDrepDirectory />}
{dRepListToDisplay?.map((dRep) => {
if (
isSameDRep(dRep, myDrep?.view) ||
isSameDRep(dRep, inProgressDelegation)
) {
return null;
}
return (
<Box key={dRep.drepId} component="li" sx={{ listStyle: "none" }}>
<DRepCard
dRep={dRep}
isConnected={!!isConnected}
isDelegationLoading={
isDelegating === dRep.view || isDelegating === dRep.drepId
}
isMe={isSameDRep(dRep, myDRepId)}
onDelegate={() => delegate(dRep.drepId)}
/>
</Box>
);
})}
{dRepListToDisplay?.map((dRep) => (
<Box key={dRep.drepId} component="li" sx={{ listStyle: "none" }}>
<DRepCard
dRep={dRep}
isConnected={!!isConnected}
isDelegationLoading={
isDelegating === dRep.view || isDelegating === dRep.drepId
}
isMe={isSameDRep(dRep, myDRepId)}
onDelegate={() => delegate(dRep.drepId)}
/>
</Box>
))}
</Box>
</>
{dRepListHasNextPage && dRepList.length >= 10 && (
Expand Down
4 changes: 2 additions & 2 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": "1.0.16",
"version": "1.0.17",
"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('1.0.16')
.setVersion('1.0.17')
.build();

const document = SwaggerModule.createDocument(app, config);
Expand Down
4 changes: 2 additions & 2 deletions tests/govtool-frontend/playwright/package-lock.json

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

Loading