Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
f1f4621
feat: add proposal submission authentication setup
kneerose May 9, 2025
a274f1a
chore: move balance dependent test to proposal submission tests with …
kneerose May 9, 2025
17481f5
test: prompt for insufficient balance when balance is low
kneerose May 9, 2025
b68f080
chore: update project structure and architecture for proposal discussion
kneerose May 9, 2025
81057b8
fix: reply testId
kneerose May 9, 2025
08386b2
chore: move 8U test to 7P as it is balance dependent test
kneerose May 9, 2025
aa8fb96
fix: check identity verification button before proposal deletion
kneerose May 9, 2025
6c145b7
Merge pull request #3606 from IntersectMBO/fix/insufficient-proposal-…
kneerose May 12, 2025
615599b
feat: add script to remove oldest report on CI
kneerose May 13, 2025
fcf41a6
Merge pull request #3618 from IntersectMBO/feat/remove-oldest-allure-…
kneerose May 13, 2025
c603e84
fix(#3560): allow empty image in register drep form
Ciabas May 12, 2025
70e17de
fix(#3560): add precise types to UncontrolledImageInput component for…
Ciabas May 13, 2025
1d1d231
fix(#3560): improve validation in UncontrolledImageInput by checking …
Ciabas May 13, 2025
ed0dc38
feat: update README with Allure report instructions
kneerose May 14, 2025
285a35a
Merge pull request #3626 from IntersectMBO/feat/test-backend-allure-r…
kneerose May 14, 2025
23da493
fix(#3123): fix blank screen on unhandled wallet error
MSzalowski May 12, 2025
ab3d897
Merge pull request #3613 from IntersectMBO/fix/3123-blank-screen-on-v…
MSzalowski May 14, 2025
a3ca508
fix(#2712): preserve new lines in markdown text
MSzalowski May 13, 2025
9a9b0fd
Merge pull request #3624 from IntersectMBO/fix/2712-markdown-renderin…
MSzalowski May 14, 2025
37c4338
fix(#3615): add scroll to markdown tables
MSzalowski May 14, 2025
a207f56
Merge pull request #3627 from IntersectMBO/fix/3615-bug-markdown-tabl…
MSzalowski May 14, 2025
5e4920e
Merge branch 'develop' into fix/3560-allow-empty-image-in-drep-form
Ciabas May 14, 2025
b1b55d0
Merge pull request #3621 from IntersectMBO/fix/3560-allow-empty-image…
MSzalowski May 14, 2025
9ce8eef
fix(#3615): wrap the markdown table styles around markdown class
MSzalowski May 14, 2025
0cf10b7
Merge pull request #3630 from IntersectMBO/fix/3615-bug-markdown-tabl…
MSzalowski May 14, 2025
47d7fe4
chore: update @intersect.mbo/govtool-outcomes-pillar-ui to v1.4.2
github-actions[bot] May 14, 2025
6616e04
chore: update @intersect.mbo/pdf-ui to 0.7.0-beta-27
github-actions[bot] May 14, 2025
ad53d41
Merge pull request #3632 from IntersectMBO/chore/@intersect.mbo/pdf-u…
bosko-m May 14, 2025
50ff9e9
Merge pull request #3631 from IntersectMBO/chore/@intersect.mbo/govto…
MSzalowski May 15, 2025
9188f88
chore: update GovTool to v2.0.22
github-actions[bot] May 15, 2025
27353c7
Merge pull request #3633 from IntersectMBO/chore/update-govtool-to-v2…
MSzalowski May 15, 2025
a97d50d
chore: update @intersect.mbo/pdf-ui to 0.7.0-beta-28
github-actions[bot] May 15, 2025
a980133
Merge pull request #3634 from IntersectMBO/chore/@intersect.mbo/pdf-u…
MSzalowski May 15, 2025
e94ccab
chore: update @intersect.mbo/pdf-ui to 0.7.0-beta-29
github-actions[bot] May 15, 2025
c5ff31e
Merge pull request #3638 from IntersectMBO/chore/@intersect.mbo/pdf-u…
MSzalowski May 15, 2025
4b1ac25
Merge pull request #3636 from IntersectMBO/develop
bosko-m May 15, 2025
bf53ba6
Merge pull request #3639 from IntersectMBO/test
bosko-m May 15, 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
16 changes: 16 additions & 0 deletions .github/scripts/remove_oldest_report.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

if [ -d "gh-pages/$REPORT_NAME" ]; then
cd gh-pages/$REPORT_NAME
# Find the oldest numerical directory
oldest_dir=$(find . -maxdepth 1 -type d -regex './[0-9]+' | sort -n | head -1)
if [ -n "$oldest_dir" ]; then
echo "Removing oldest report directory: $oldest_dir"
rm -rf "$oldest_dir"
else
echo "No report directories found to remove"
fi
cd ../../
else
echo "Report directory does not exist yet"
fi
6 changes: 6 additions & 0 deletions .github/workflows/test_backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ jobs:
path: gh-pages
repository: ${{vars.GH_PAGES}}
ssh-key: ${{ secrets.DEPLOY_KEY }}

- name: Remove oldest report to save space
if: ${{success()}}
run: |
chmod +x .github/scripts/remove_oldest_report.sh
.github/scripts/remove_oldest_report.sh

- name: Register report
id: register-project
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/test_integration_playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ on:
workflow_run:
workflows: ["Build and deploy GovTool test stack"]
types: [completed]
branches:
branches:
- test
- infra/test-chores

Expand Down Expand Up @@ -153,12 +153,19 @@ jobs:
repository: ${{vars.GH_PAGES}}
ssh-key: ${{ secrets.DEPLOY_KEY }}

- name: Remove oldest report to save space
if: ${{success()}}
run: |
chmod +x .github/scripts/remove_oldest_report.sh
.github/scripts/remove_oldest_report.sh

- name: Register report
id: register-project
if: ${{success()}}
run: |
chmod +x .github/scripts/register_report.sh
.github/scripts/register_report.sh

- if: steps.register-project.outputs.project_exists != 'true'
uses: JamesIves/github-pages-deploy-action@v4
with:
Expand Down
17 changes: 16 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,23 @@ changes.

### Removed

## [v2.0.21](https://github.com/IntersectMBO/govtool/releases/tag/v2.0.21) 2025-05-09
## [v2.0.22](https://github.com/IntersectMBO/govtool/releases/tag/v2.0.22) 2025-05-15


### Added

### Fixed

- Fix an issue where the submit button remained disabled after removing an invalid value from the IMAGE input field on DRrep form [Issue 3560](https://github.com/IntersectMBO/govtool/issues/3560)
- Fix app crash on unhandled wallet error [Issue 3123](https://github.com/IntersectMBO/govtool/issues/3123)
- Preserve new lines in markdown text [Issue 2712](https://github.com/IntersectMBO/govtool/issues/2712)
- Add scroll to markdown tables [Issue 3615](https://github.com/IntersectMBO/govtool/issues/3615)

### Changed

### Removed

## [v2.0.21](https://github.com/IntersectMBO/govtool/releases/tag/v2.0.21) 2025-05-09

### 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-2.0.21/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.22/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.21/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.22/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.21
version: 2.0.22

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

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

7 changes: 3 additions & 4 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.21",
"version": "2.0.22",
"type": "module",
"scripts": {
"build": "vite build",
Expand All @@ -27,9 +27,9 @@
"@emotion/styled": "^11.11.0",
"@emurgo/cardano-serialization-lib-asmjs": "^14.1.1",
"@hookform/resolvers": "^3.3.1",
"@intersect.mbo/govtool-outcomes-pillar-ui": "1.4.1",
"@intersect.mbo/govtool-outcomes-pillar-ui": "v1.4.2",
"@intersect.mbo/intersectmbo.org-icons-set": "^1.0.8",
"@intersect.mbo/pdf-ui": "0.7.0-beta-26",
"@intersect.mbo/pdf-ui": "0.7.0-beta-29",
"@mui/icons-material": "^5.14.3",
"@mui/material": "^5.14.4",
"@rollup/plugin-babel": "^6.0.4",
Expand Down Expand Up @@ -57,7 +57,6 @@
"react-query": "^3.39.3",
"react-router-dom": "^6.13.0",
"rehype-katex": "^7.0.1",
"remark-breaks": "^4.0.0",
"remark-gfm": "^4.0.1",
"remark-math": "^6.0.0",
"storybook-addon-manual-mocks": "^1.0.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import Markdown from "react-markdown";
import remarkMath from "remark-math";
import remarkGfm from "remark-gfm";
import rehypeKatex from "rehype-katex";
import remarkBreaks from "remark-breaks";
import "katex/dist/katex.min.css";
import "./tableMarkdown.css";

Expand Down Expand Up @@ -120,29 +119,43 @@ export const GovernanceActionCardElement = ({
fontWeight: 400,
lineHeight: "24px",
maxWidth: "auto",
whiteSpace: "pre-wrap",
}}
>
{children}
</Typography>
);

const markdownComponents = {
p: (props: PropsWithChildren) => {
const { children } = props;
return renderMarkdownText({ children });
},
p: ({ children }: PropsWithChildren) => renderMarkdownText({ children }),
br: () => <br />,
};

const renderMarkdown = () => (
<Markdown
components={markdownComponents}
remarkPlugins={[remarkMath, remarkBreaks, remarkGfm]}
rehypePlugins={[rehypeKatex]}
>
{text.toString()}
</Markdown>
);
const renderMarkdown = () => {
const formattedText = text
.toString()
.replace(/\r\n|\r/g, "\n")
.replace(
/\n\n+/g,
(match) =>
`\n\n${Array(match.length - 1)
.fill("&nbsp; \n")
.join("")}\n`,
)
.split("\n")
.map((line) => `${line} `)
.join("\n");

return (
<Markdown
className="markdown"
components={markdownComponents}
remarkPlugins={[remarkMath, remarkGfm]}
rehypePlugins={[rehypeKatex]}
>
{formattedText}
</Markdown>
);
};

const renderCopyButton = () =>
isCopyButton && (
Expand Down
41 changes: 23 additions & 18 deletions govtool/frontend/src/components/molecules/tableMarkdown.css
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
table {
margin: 32px 0;
border-spacing: 0;
border-collapse: collapse;
}
.markdown {
& table {
display: block;
overflow-x: auto;
margin: 32px 0;
border-spacing: 0;
border-collapse: collapse;
max-width: 100%;

table thead {
background-color: #d6e2ff80;
}
& thead {
background-color: #d6e2ff80;
}

table th,
table td {
padding: 6px 13px;
border: 1px solid #d6e2ff;
}
& th,
& td {
padding: 6px 13px;
border: 1px solid #d6e2ff;
}

table td > :last-child {
margin-bottom: 0;
}
& td > :last-child {
margin-bottom: 0;
}

table tr:nth-child(2n) {
background-color: #d6e2ff80;
& tr:nth-child(2n) {
background-color: #d6e2ff80;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const StatusModal = forwardRef<HTMLDivElement>((_, ref) => {
whiteSpace: "pre-line",
}}
>
{state?.message}{" "}
{typeof state?.message === "string" && state?.message}
{state?.link && (
<Link
onClick={() => openInNewTab(state?.link || "")}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { useRef } from "react";
import { useController } from "react-hook-form";
import {
Control,
FieldPath,
FieldValues,
RegisterOptions,
useController,
} from "react-hook-form";
import { FormErrorMessage } from "../atoms";

type UncontrolledImageInputProps = {
name: string;
control: any;
rules?: any;
type UncontrolledImageInputProps<
TFieldValues extends FieldValues = FieldValues,
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
> = {
name: TName;
control: Control<TFieldValues>;
rules?: RegisterOptions<TFieldValues, TName>;
placeholder?: string;
dataTestId?: string;
};

export const UncontrolledImageInput = ({
export const UncontrolledImageInput = <T extends FieldValues>({
name,
control,
rules,
placeholder,
dataTestId,
}: UncontrolledImageInputProps) => {
}: UncontrolledImageInputProps<T>) => {
const {
field: { onChange },
fieldState,
Expand Down Expand Up @@ -49,8 +57,8 @@ export const UncontrolledImageInput = ({
borderRadius: "50px",
height: "50px",
border: "1px solid",
borderColor: fieldState.error?.message ? "red" : "#6F99FF",
backgroundColor: fieldState.error?.message ? "#FAEAEB" : "white",
borderColor: fieldState.error ? "red" : "#6F99FF",
backgroundColor: fieldState.error ? "#FAEAEB" : "white",
boxSizing: "border-box",
margin: 0,
display: "block",
Expand Down
2 changes: 1 addition & 1 deletion govtool/frontend/src/consts/dRepActions/fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@ export const Rules = {
value: IMAGE_REGEX,
message: i18n.t("registration.fields.validations.image"),
},
validate: isValidImageUrl,
validate: (value: unknown) => isValidImageUrl(value, { optional: true }),
},
};
5 changes: 4 additions & 1 deletion govtool/frontend/src/hooks/useWalletErrorModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ export const useWalletErrorModal = () => {
buttonText,
dataTestId,
}: WalletErrorModalProps) => {
const errorMessage = (error && typeof error === 'object' && 'info' in error) ? error.info : error;
const errorMessage =
error && typeof error === "object" && "info" in error
? error.info
: JSON.stringify(error, Object.getOwnPropertyNames(error));

openModal({
type: "statusModal",
Expand Down
3 changes: 2 additions & 1 deletion govtool/frontend/src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,8 @@
"tooLongUrl": "Url must be less than 128 bytes",
"mustBeStakeAddress": "It must be reward address in bech32 format",
"mustBeReceivingAddress": "Invalid payment address",
"couldNotGenerateImageSha": "Could not generate image sha"
"couldNotGenerateImageSha": "Could not generate image sha",
"invalidValueType": "Invalid value type"
}
},
"proposalDiscussion": {
Expand Down
Loading