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.11 #2901

Merged
merged 16 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
1f56690
fix(#2891): change vote rationale character limit to 10000
MSzalowski Feb 4, 2025
57d2d96
Merge pull request #2895 from IntersectMBO/fix/2891-drep-vote-rationa…
MSzalowski Feb 4, 2025
f9350e3
feat(#2893): move ratification threshold label below voters title
MSzalowski Feb 4, 2025
0fea59f
Merge pull request #2894 from IntersectMBO/feat/2893-move-ratificatio…
MSzalowski Feb 4, 2025
2042793
fix: incorrect link to docs for direct voters
Ryun1 Feb 4, 2025
ef73715
Merge pull request #2898 from IntersectMBO/2647-fix-incorrec-lean-mor…
MSzalowski Feb 4, 2025
80bff9c
fix(#2889): missing "No DRep found" on DRep directory
MSzalowski Feb 4, 2025
8d734da
Merge pull request #2899 from IntersectMBO/fix/2889-missing-no-drep-f…
MSzalowski Feb 4, 2025
c2bfcd1
fix(#2888): fix displaying givenName placeholder instead of value
MSzalowski Feb 4, 2025
21b701f
Merge pull request #2896 from IntersectMBO/fix/2888-placeholder-given…
MSzalowski Feb 4, 2025
669fd1a
fix(#2878): Fix executing insert on undefined node
MSzalowski Feb 3, 2025
7dfeed9
Merge pull request #2886 from IntersectMBO/fix/2878-notfounderror-fai…
MSzalowski Feb 4, 2025
394c6cb
fix(#2683): handle missing usersnap api key exception
MSzalowski Feb 3, 2025
33b25d4
Merge pull request #2885 from IntersectMBO/fix/2683-error-wrong-api-k…
MSzalowski Feb 4, 2025
803ad6e
chore: bump GovTool to v2.0.11
MSzalowski Feb 4, 2025
fa9bea2
Merge pull request #2900 from IntersectMBO/chore/bump-govtool-to-v.2.…
MSzalowski Feb 4, 2025
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
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
Loading