Skip to content

Commit

Permalink
Merge pull request #2903 from IntersectMBO/staging
Browse files Browse the repository at this point in the history
GovTool - v2.0.11
  • Loading branch information
MSzalowski authored Feb 4, 2025
2 parents b17b0bd + 0b75dff commit 026b486
Show file tree
Hide file tree
Showing 18 changed files with 85 additions and 46 deletions.
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,37 @@ changes.

### Fixed

-

### Changed

-

### Removed

-

## [v2.0.11](https://github.com/IntersectMBO/govtool/releases/tag/v2.0.11) 2025-02-04

### Added

-

### Fixed

- Fix displaying DRep with doNotList property as string
- Handle exception when no index is provided to /proposal/get endpoint [Issue 1841](https://github.com/IntersectMBO/govtool/issues/1841)
- Fix displaying vote pill on voted on cards
- Fix incorrect link to learn more about direct voters [Issue 2647](https://github.com/IntersectMBO/govtool/issues/2647)
- Fix missing No DRep found message on DRep Directory [Issue 2889](https://github.com/IntersectMBO/govtool/issues/2889)
- Fix displaying givenName placeholder instead of actual value on DRep card [Issue 2888](https://github.com/IntersectMBO/govtool/issues/2888)
- Fix executing insertBefore on undefined node [Issue 2878](https://github.com/IntersectMBO/govtool/issues/2878)

### Changed

- Change votes representation on Governance Actions [Issue 2880](https://github.com/IntersectMBO/govtool/issues/2880)
- Change vote rationale character limit to 10000 [Issue 2891](https://github.com/IntersectMBO/govtool/issues/2891)
- Move ratification threshold label below the voter type [Issue 2893](https://github.com/IntersectMBO/govtool/issues/2893)

### Removed

Expand Down Expand Up @@ -79,6 +103,7 @@ changes.
- Fix usage of trim on missing label
- Fix blank screen when registering as a DRep [Issue 2408](https://github.com/IntersectMBO/govtool/issues/2408)
- Fix type mismatch between sql and haskell code for stake key address
- Handle missing api key exception [Issue 2683](https://github.com/IntersectMBO/govtool/issues/2683)

### Changed

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.10/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.11/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.10/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.11/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: 2.0.10
version: 2.0.11

-- A short (one-line) description of the package.
-- synopsis:
Expand Down
6 changes: 5 additions & 1 deletion govtool/frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@
s = d.getElementsByTagName("script")[0];
g.async = true;
g.src = u + "matomo.js";
s.parentNode.insertBefore(g, s);
if (s && s.parentNode) {
s.parentNode.insertBefore(g, s);
} else {
d.head.appendChild(g);
}
})();
</script>
<div id="root"></div>
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.

2 changes: 1 addition & 1 deletion 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.10",
"version": "2.0.11",
"type": "module",
"scripts": {
"build": "vite build",
Expand Down
42 changes: 21 additions & 21 deletions govtool/frontend/src/components/molecules/VotesSubmitted.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,27 +226,6 @@ const VotesGroup = ({
>
{t(`govActions.${type}`)}
</Typography>
<Vote
type={type}
vote="yes"
percentage={yesVotesPercentage}
value={yesVotes}
/>
<Vote type={type} vote="abstain" value={abstainVotes} />
<Vote
type={type}
vote="no"
percentage={noVotesPercentage}
value={noVotes}
/>
{typeof notVotedVotes === "number" && (
<Vote
type={type}
vote="notVoted"
percentage={notVotedPercentage}
value={notVotedVotes}
/>
)}
{threshold !== undefined && threshold !== null && (
<Box
display="flex"
Expand Down Expand Up @@ -279,6 +258,27 @@ const VotesGroup = ({
</Typography>
</Box>
)}
<Vote
type={type}
vote="yes"
percentage={yesVotesPercentage}
value={yesVotes}
/>
<Vote type={type} vote="abstain" value={abstainVotes} />
<Vote
type={type}
vote="no"
percentage={noVotesPercentage}
value={noVotes}
/>
{typeof notVotedVotes === "number" && (
<Vote
type={type}
vote="notVoted"
percentage={notVotedPercentage}
value={notVotedVotes}
/>
)}
</Box>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const DRepDashboardCard = ({
i18nKey="dashboard.cards.drep.retirementInProgressWithGivenName"
values={{
deposit: correctAdaFormat(voter?.deposit),
name: voter?.givenName,
givenName: voter?.givenName,
}}
/>
) : (
Expand Down Expand Up @@ -140,7 +140,7 @@ export const DRepDashboardCard = ({
description: voter?.givenName ? (
<Trans
i18nKey="dashboard.cards.drep.notRegisteredWasRegisteredDescriptionWithGivenName"
values={{ name: voter?.givenName }}
values={{ givenName: voter?.givenName ?? "DRep" }}
/>
) : (
<Trans i18nKey="dashboard.cards.drep.notRegisteredWasRegisteredDescription" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ type VoteContextTextProps = {
setStep: Dispatch<SetStateAction<number>>;
onCancel: () => void;
};
const MAX_LENGTH = 10000;

export const VoteContextText = ({
setStep,
Expand All @@ -31,9 +32,9 @@ export const VoteContextText = ({
message: t("createGovernanceAction.fields.validations.required"),
},
maxLength: {
value: 500,
value: MAX_LENGTH,
message: t("createGovernanceAction.fields.validations.maxLength", {
maxLength: 500,
maxLength: MAX_LENGTH,
}),
},
},
Expand Down Expand Up @@ -64,13 +65,13 @@ export const VoteContextText = ({
{t("govActions.provideContextAboutYourVote")}
</Typography>
<Typography variant="body1" sx={{ fontWeight: 400, mb: 2 }}>
{/* TODO: Update text when design is finalised */}
Additional information about your vote
{t("govActions.additionalInformationAboutYourVote")}
</Typography>
<ControlledField.TextArea
{...{ control, errors }}
{...fieldProps}
isModifiedLayout
maxLength={MAX_LENGTH}
data-testid="provide-context-input"
/>
</VoteContextWrapper>
Expand Down
18 changes: 13 additions & 5 deletions govtool/frontend/src/context/usersnapContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,19 @@ export const UsersnapProvider = ({
}, [usersnapApi]);

useEffect(() => {
loadSpace(API_KEY).then((api) => {
api.init(initParams);
setUsersnapApi(api);
});
}, [initParams]);
const initUsersnapSpace = async () => {
if (API_KEY) {
try {
const api = await loadSpace(API_KEY);
api.init(initParams);
setUsersnapApi(api);
} catch (error) {
console.error(error);
}
}
};
initUsersnapSpace();
}, [initParams, API_KEY]);

const value = useMemo(() => ({ openFeedbackWindow }), [openFeedbackWindow]);

Expand Down
1 change: 1 addition & 0 deletions govtool/frontend/src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@
"optional": "(optional)",
"provideContext": "Provide context",
"provideContextAboutYourVote": "Provide context about your vote",
"additionalInformationAboutYourVote": "Additional information about your vote",
"provideNewContextAboutYourVote": "Provide new context about your vote",
"rationale": "Rationale",
"seeExternalData": "See external data",
Expand Down
2 changes: 1 addition & 1 deletion govtool/frontend/src/pages/DRepDirectoryContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export const DRepDirectoryContent: FC<DRepDirectoryContentProps> = ({
flex: 1,
}}
>
{dRepList?.length === 0 && <EmptyStateDrepDirectory />}
{dRepListToDisplay?.length === 0 && <EmptyStateDrepDirectory />}
{dRepListToDisplay?.map((dRep) => (
<Box key={dRep.view} component="li" sx={{ listStyle: "none" }}>
<DRepCard
Expand Down
2 changes: 1 addition & 1 deletion govtool/frontend/src/pages/RegisterAsDirectVoter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export const RegisterAsDirectVoter = () => {
values={{ deposit: correctAdaFormat(epochParams?.drep_deposit) }}
components={[
<Link
onClick={() => openInNewTab("https://sancho.network/")}
onClick={() => openInNewTab("https://docs.gov.tools/cardano-govtool/faqs/direct-voter-vs-drep")}
sx={{ cursor: "pointer" }}
key="0"
/>,
Expand Down
2 changes: 1 addition & 1 deletion govtool/frontend/src/pages/RetireAsDirectVoter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export const RetireAsDirectVoter = () => {
values={{ deposit: correctAdaFormat(voter?.deposit) }}
components={[
<Link
onClick={() => openInNewTab("https://sancho.network/")}
onClick={() => openInNewTab("https://docs.gov.tools/cardano-govtool/faqs/direct-voter-vs-drep")}
sx={{ cursor: "pointer", textDecoration: "none" }}
key="0"
/>,
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": "2.0.10",
"version": "2.0.11",
"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.10')
.setVersion('2.0.11')
.build();

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

0 comments on commit 026b486

Please sign in to comment.