diff --git a/CHANGELOG.md b/CHANGELOG.md
index b34236d5d..e77f1fb49 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -26,6 +26,26 @@ changes.
-
+## [v2.0.2](https://github.com/IntersectMBO/govtool/releases/tag/v2.0.2) 2024-12-20
+
+### Added
+
+- Add preprod adjustments [Issue 2547](https://github.com/IntersectMBO/govtool/issues/2547)
+
+### Fixed
+
+- Move matomo initalization out of the react code
+- Fix some non-ipfs related errors while fetching the DRep images [Issue 2546](https://github.com/IntersectMBO/govtool/issues/2546)
+- Remaining mobile responsiveness issue [Issue 2493](https://github.com/IntersectMBO/govtool/issues/2493)
+
+### Changed
+
+-
+
+### Removed
+
+-
+
## [v2.0.1](https://github.com/IntersectMBO/govtool/releases/tag/v2.0.1) 2024-12-16
### Added
diff --git a/govtool/backend/Dockerfile b/govtool/backend/Dockerfile
index 65a5b97ee..a8104ebfd 100644
--- a/govtool/backend/Dockerfile
+++ b/govtool/backend/Dockerfile
@@ -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.1/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.2/x/vva-be/build/vva-be/vva-be /usr/local/bin
diff --git a/govtool/backend/Dockerfile.qovery b/govtool/backend/Dockerfile.qovery
index c5845a2bd..4afcdc862 100644
--- a/govtool/backend/Dockerfile.qovery
+++ b/govtool/backend/Dockerfile.qovery
@@ -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.1/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.2/x/vva-be/build/vva-be/vva-be /usr/local/bin
# Expose the necessary port
EXPOSE 9876
diff --git a/govtool/backend/vva-be.cabal b/govtool/backend/vva-be.cabal
index ea1cb50d1..1e1d9b802 100644
--- a/govtool/backend/vva-be.cabal
+++ b/govtool/backend/vva-be.cabal
@@ -1,6 +1,6 @@
cabal-version: 3.6
name: vva-be
-version: 2.0.1
+version: 2.0.2
-- A short (one-line) description of the package.
-- synopsis:
diff --git a/govtool/frontend/index.html b/govtool/frontend/index.html
index cb8734a1b..d50aa332b 100644
--- a/govtool/frontend/index.html
+++ b/govtool/frontend/index.html
@@ -25,18 +25,27 @@
diff --git a/govtool/frontend/package.json b/govtool/frontend/package.json
index 4bbc7adea..24171d4e7 100644
--- a/govtool/frontend/package.json
+++ b/govtool/frontend/package.json
@@ -1,7 +1,7 @@
{
"name": "@govtool/frontend",
"private": true,
- "version": "2.0.1",
+ "version": "2.0.2",
"type": "module",
"scripts": {
"build": "vite build",
@@ -113,5 +113,5 @@
"nth-check": "^2.0.1",
"postcss": "^8.4.31"
},
- "_id": "govtool@2.0.1"
+ "_id": "govtool@2.0.2"
}
diff --git a/govtool/frontend/src/App.tsx b/govtool/frontend/src/App.tsx
index 7745ceefb..553d5295f 100644
--- a/govtool/frontend/src/App.tsx
+++ b/govtool/frontend/src/App.tsx
@@ -39,10 +39,8 @@ import {
import { PublicRoute } from "./pages/PublicRoute";
import { TopBanners } from "./components/organisms/TopBanners";
import { DashboardHome } from "./pages/DashboardHome";
-import { useMatomo } from "./hooks/useMatomo";
export default () => {
- useMatomo();
const { isProposalDiscussionForumEnabled } = useFeatureFlag();
const { enable, isEnabled } = useCardano();
const navigate = useNavigate();
diff --git a/govtool/frontend/src/components/molecules/DataActionsFilters.tsx b/govtool/frontend/src/components/molecules/DataActionsFilters.tsx
index 98ec187e3..16e7b2e5e 100644
--- a/govtool/frontend/src/components/molecules/DataActionsFilters.tsx
+++ b/govtool/frontend/src/components/molecules/DataActionsFilters.tsx
@@ -43,7 +43,7 @@ export const DataActionsFilters = ({
[chosenFilters, setChosenFilters],
);
- const { isMobile, screenWidth } = useScreenDimension();
+ const { isMobile } = useScreenDimension();
const wrapperRef = useRef(null);
useOnClickOutside(wrapperRef, closeFilters);
@@ -58,7 +58,10 @@ export const DataActionsFilters = ({
boxShadow: "1px 2px 11px 0px #00123D5E",
borderRadius: "10px",
padding: "12px 0px",
- width: screenWidth < 850 ? "315px" : "415px",
+ width: {
+ xxs: "250px",
+ md: "415px",
+ },
zIndex: "1",
right: isMobile ? "59px" : "115px",
top: "53px",
diff --git a/govtool/frontend/src/components/molecules/DataActionsSorting.tsx b/govtool/frontend/src/components/molecules/DataActionsSorting.tsx
index 65487da1d..f72bb0454 100644
--- a/govtool/frontend/src/components/molecules/DataActionsSorting.tsx
+++ b/govtool/frontend/src/components/molecules/DataActionsSorting.tsx
@@ -41,7 +41,10 @@ export const DataActionsSorting = ({
boxShadow: "1px 2px 11px 0px #00123D5E",
borderRadius: "10px",
padding: "12px 0px",
- width: "315px",
+ width: {
+ xxs: "250px",
+ md: "415px",
+ },
zIndex: "1",
right: "3px",
top: "53px",
diff --git a/govtool/frontend/src/components/molecules/DataMissingHeader.tsx b/govtool/frontend/src/components/molecules/DataMissingHeader.tsx
index ef6e278b4..c715b7117 100644
--- a/govtool/frontend/src/components/molecules/DataMissingHeader.tsx
+++ b/govtool/frontend/src/components/molecules/DataMissingHeader.tsx
@@ -33,11 +33,11 @@ export const DataMissingHeader = ({
diff --git a/govtool/frontend/src/components/organisms/DRepCard.tsx b/govtool/frontend/src/components/organisms/DRepCard.tsx
index c396f8f46..ed044d0ba 100644
--- a/govtool/frontend/src/components/organisms/DRepCard.tsx
+++ b/govtool/frontend/src/components/organisms/DRepCard.tsx
@@ -106,7 +106,15 @@ export const DRepCard = ({
src={image || ICONS.defaultDRepIcon}
data-testid="drep-image"
/>
-
+
@@ -124,7 +132,10 @@ export const DRepCard = ({
sx={{
gap: 1,
width: "250px",
- maxWidth: "100%",
+ maxWidth: {
+ xxs: "200px",
+ xs: "100%",
+ },
"&:hover": {
opacity: 0.6,
transition: "opacity 0.3s",
@@ -195,12 +206,15 @@ export const DRepCard = ({
{type === "DRep" && (
@@ -251,4 +265,5 @@ const ellipsisStyles = {
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
+ maxWidth: { xxs: "200px", xs: "100%" },
} as const;
diff --git a/govtool/frontend/src/components/organisms/DRepDetailsCard.tsx b/govtool/frontend/src/components/organisms/DRepDetailsCard.tsx
index 29d2a0716..90518a64a 100644
--- a/govtool/frontend/src/components/organisms/DRepDetailsCard.tsx
+++ b/govtool/frontend/src/components/organisms/DRepDetailsCard.tsx
@@ -239,8 +239,19 @@ const DRepDetailsInfoItem = ({
if (!children && !text) return null;
const dataTestIdInfoItemCategoryPrefix = "info-item";
return (
-
-
+
+
-
+
);
};
@@ -306,7 +317,17 @@ const ReferencesGroup = ({ references }: { references: ReferenceItem[] }) => (
);
const ReferencesLink = ({ label, uri }: ReferenceItem) => (
-
+
{label}
-
+
+
+
-
+
+
+
setIsDrawerOpen(false)}
diff --git a/govtool/frontend/src/consts/index.ts b/govtool/frontend/src/consts/index.ts
index 153f557a5..f07ea2941 100644
--- a/govtool/frontend/src/consts/index.ts
+++ b/govtool/frontend/src/consts/index.ts
@@ -16,23 +16,19 @@ export const NETWORK_NAMES = {
sanchonet: "SanchoNet",
preview: "Preview",
testnet: "TestNet",
+ preprod: "PreProd",
mainnet: "MainNet",
};
export const CEXPLORER_BASE_URLS = {
sanchonet: "https://sancho.cexplorer.io",
preview: "https://preview.cexplorer.io",
testnet: "https://testnet.cexplorer.io",
+ preprod: "https://preprod.cexplorer.io",
mainnet: "https://cexplorer.io",
};
-export const COMPILED_GUARDRAIL_SCRIPTS = {
- sanchonet:
- "5908545908510101003232323232323232323232323232323232323232323232323232323232323232323232323232323232259323255333573466e1d20000011180098111bab357426ae88d55cf00104554ccd5cd19b87480100044600422c6aae74004dd51aba1357446ae88d55cf1baa3255333573466e1d200a35573a002226ae84d5d11aab9e00111637546ae84d5d11aba235573c6ea800642b26006003149a2c8a4c301f801c0052000c00e0070018016006901e4070c00e003000c00d20d00fc000c0003003800a4005801c00e003002c00d20c09a0c80e1801c006001801a4101b5881380018000600700148013003801c006005801a410100078001801c006001801a4101001f8001800060070014801b0038018096007001800600690404002600060001801c0052008c00e006025801c006001801a41209d8001800060070014802b003801c006005801a410112f501c3003800c00300348202b7881300030000c00e00290066007003800c00b003482032ad7b806038403060070014803b00380180960003003800a4021801c00e003002c00d20f40380e1801c006001801a41403f800100a0c00e0029009600f0030078040c00e002900a600f003800c00b003301a483403e01a600700180060066034904801e00060001801c0052016c01e00600f801c006001801980c2402900e30000c00e002901060070030128060c00e00290116007003800c00b003483c0ba03860070018006006906432e00040283003800a40498003003800a404d802c00e00f003800c00b003301a480cb0003003800c003003301a4802b00030001801c01e0070018016006603490605c0160006007001800600660349048276000600030000c00e0029014600b003801c00c04b003800c00300348203a2489b00030001801c00e006025801c006001801a4101b11dc2df80018000c0003003800a4055802c00e007003012c00e003000c00d2080b8b872c000c0006007003801809600700180060069040607e4155016000600030000c00e00290166007003012c00e003000c00d2080c001c000c0003003800a405d801c00e003002c00d20c80180e1801c006001801a412007800100a0c00e00290186007003013c0006007001480cb005801801e006003801800e00600500403003800a4069802c00c00f003001c00c007003803c00e003002c00c05300333023480692028c0004014c00c00b003003c00c00f003003c00e00f003800c00b00301480590052008003003800a406d801c00e003002c00d2000c00d2006c00060070018006006900a600060001801c0052038c00e007001801600690006006901260003003800c003003483281300020141801c005203ac00e006027801c006001801a403d800180006007001480f3003801804e00700180060069040404af3c4e302600060001801c005203ec00e006013801c006001801a4101416f0fd20b80018000600700148103003801c006005801a403501c3003800c0030034812b00030000c00e0029021600f003800c00a01ac00e003000c00ccc08d20d00f4800b00030000c0000000000803c00c016008401e006009801c006001801807e0060298000c000401e006007801c0060018018074020c000400e00f003800c00b003010c000802180020070018006006019801805e0003000400600580180760060138000800c00b00330134805200c400e00300080330004006005801a4001801a410112f58000801c00600901260008019806a40118002007001800600690404a75ee01e00060008018046000801801e000300c4832004c025201430094800a0030028052003002c00d2002c000300648010c0092002300748028c0312000300b48018c0292012300948008c0212066801a40018000c0192008300a2233335573e00250002801994004d55ce800cd55cf0008d5d08014c00cd5d10011263009222532900389800a4d2219002912c80344c01526910c80148964cc04cdd68010034564cc03801400626601800e0071801226601800e01518010096400a3000910c008600444002600244004a664600200244246466004460044460040064600444600200646a660080080066a00600224446600644b20051800484ccc02600244666ae68cdc3801000c00200500a91199ab9a33710004003000801488ccd5cd19b89002001800400a44666ae68cdc4801000c00a00122333573466e20008006005000912a999ab9a3371200400222002220052255333573466e2400800444008440040026eb400a42660080026eb000a4264666015001229002914801c8954ccd5cd19b8700400211333573466e1c00c006001002118011229002914801c88cc044cdc100200099b82002003245200522900391199ab9a3371066e08010004cdc1001001c002004403245200522900391199ab9a3371266e08010004cdc1001001c00a00048a400a45200722333573466e20cdc100200099b820020038014000912c99807001000c40062004912c99807001000c400a2002001199919ab9a357466ae880048cc028dd69aba1003375a6ae84008d5d1000934000dd60010a40064666ae68d5d1800c0020052225933006003357420031330050023574400318010600a444aa666ae68cdc3a400000222c22aa666ae68cdc4000a4000226600666e05200000233702900000088994004cdc2001800ccdc20010008cc010008004c01088954ccd5cd19b87480000044400844cc00c004cdc300100091119803112c800c60012219002911919806912c800c4c02401a442b26600a004019130040018c008002590028c804c8888888800d1900991111111002a244b267201722222222008001000c600518000001112a999ab9a3370e004002230001155333573466e240080044600823002229002914801c88ccd5cd19b893370400800266e0800800e00100208c8c0040048c0088cc008008005",
- preview:
- "5908545908510101003232323232323232323232323232323232323232323232323232323232323232323232323232323232259323255333573466e1d20000011180098111bab357426ae88d55cf00104554ccd5cd19b87480100044600422c6aae74004dd51aba1357446ae88d55cf1baa3255333573466e1d200a35573a002226ae84d5d11aab9e00111637546ae84d5d11aba235573c6ea800642b26006003149a2c8a4c301f801c0052000c00e0070018016006901e4070c00e003000c00d20d00fc000c0003003800a4005801c00e003002c00d20c09a0c80e1801c006001801a4101b5881380018000600700148013003801c006005801a410100078001801c006001801a4101001f8001800060070014801b0038018096007001800600690404002600060001801c0052008c00e006025801c006001801a41209d8001800060070014802b003801c006005801a410112f501c3003800c00300348202b7881300030000c00e00290066007003800c00b003482032ad7b806038403060070014803b00380180960003003800a4021801c00e003002c00d20f40380e1801c006001801a41403f800100a0c00e0029009600f0030078040c00e002900a600f003800c00b003301a483403e01a600700180060066034904801e00060001801c0052016c01e00600f801c006001801980c2402900e30000c00e002901060070030128060c00e00290116007003800c00b003483c0ba03860070018006006906432e00040283003800a40498003003800a404d802c00e00f003800c00b003301a480cb0003003800c003003301a4802b00030001801c01e0070018016006603490605c0160006007001800600660349048276000600030000c00e0029014600b003801c00c04b003800c00300348203a2489b00030001801c00e006025801c006001801a4101b11dc2df80018000c0003003800a4055802c00e007003012c00e003000c00d2080b8b872c000c0006007003801809600700180060069040607e4155016000600030000c00e00290166007003012c00e003000c00d2080c001c000c0003003800a405d801c00e003002c00d20c80180e1801c006001801a412007800100a0c00e00290186007003013c0006007001480cb005801801e006003801800e00600500403003800a4069802c00c00f003001c00c007003803c00e003002c00c05300333023480692028c0004014c00c00b003003c00c00f003003c00e00f003800c00b00301480590052008003003800a406d801c00e003002c00d2000c00d2006c00060070018006006900a600060001801c0052038c00e007001801600690006006901260003003800c003003483281300020141801c005203ac00e006027801c006001801a403d800180006007001480f3003801804e00700180060069040404af3c4e302600060001801c005203ec00e006013801c006001801a4101416f0fd20b80018000600700148103003801c006005801a403501c3003800c0030034812b00030000c00e0029021600f003800c00a01ac00e003000c00ccc08d20d00f4800b00030000c0000000000803c00c016008401e006009801c006001801807e0060298000c000401e006007801c0060018018074020c000400e00f003800c00b003010c000802180020070018006006019801805e0003000400600580180760060138000800c00b00330134805200c400e00300080330004006005801a4001801a410112f58000801c00600901260008019806a40118002007001800600690404a75ee01e00060008018046000801801e000300c4832004c025201430094800a0030028052003002c00d2002c000300648010c0092002300748028c0312000300b48018c0292012300948008c0212066801a40018000c0192008300a2233335573e00250002801994004d55ce800cd55cf0008d5d08014c00cd5d10011263009222532900389800a4d2219002912c80344c01526910c80148964cc04cdd68010034564cc03801400626601800e0071801226601800e01518010096400a3000910c008600444002600244004a664600200244246466004460044460040064600444600200646a660080080066a00600224446600644b20051800484ccc02600244666ae68cdc3801000c00200500a91199ab9a33710004003000801488ccd5cd19b89002001800400a44666ae68cdc4801000c00a00122333573466e20008006005000912a999ab9a3371200400222002220052255333573466e2400800444008440040026eb400a42660080026eb000a4264666015001229002914801c8954ccd5cd19b8700400211333573466e1c00c006001002118011229002914801c88cc044cdc100200099b82002003245200522900391199ab9a3371066e08010004cdc1001001c002004403245200522900391199ab9a3371266e08010004cdc1001001c00a00048a400a45200722333573466e20cdc100200099b820020038014000912c99807001000c40062004912c99807001000c400a2002001199919ab9a357466ae880048cc028dd69aba1003375a6ae84008d5d1000934000dd60010a40064666ae68d5d1800c0020052225933006003357420031330050023574400318010600a444aa666ae68cdc3a400000222c22aa666ae68cdc4000a4000226600666e05200000233702900000088994004cdc2001800ccdc20010008cc010008004c01088954ccd5cd19b87480000044400844cc00c004cdc300100091119803112c800c60012219002911919806912c800c4c02401a442b26600a004019130040018c008002590028c804c8888888800d1900991111111002a244b267201722222222008001000c600518000001112a999ab9a3370e004002230001155333573466e240080044600823002229002914801c88ccd5cd19b893370400800266e0800800e00100208c8c0040048c0088cc008008005",
- mainnet:
- "5908545908510101003232323232323232323232323232323232323232323232323232323232323232323232323232323232259323255333573466e1d20000011180098111bab357426ae88d55cf00104554ccd5cd19b87480100044600422c6aae74004dd51aba1357446ae88d55cf1baa3255333573466e1d200a35573a002226ae84d5d11aab9e00111637546ae84d5d11aba235573c6ea800642b26006003149a2c8a4c301f801c0052000c00e0070018016006901e4070c00e003000c00d20d00fc000c0003003800a4005801c00e003002c00d20c09a0c80e1801c006001801a4101b5881380018000600700148013003801c006005801a410100078001801c006001801a4101001f8001800060070014801b0038018096007001800600690404002600060001801c0052008c00e006025801c006001801a41209d8001800060070014802b003801c006005801a410112f501c3003800c00300348202b7881300030000c00e00290066007003800c00b003482032ad7b806038403060070014803b00380180960003003800a4021801c00e003002c00d20f40380e1801c006001801a41403f800100a0c00e0029009600f0030078040c00e002900a600f003800c00b003301a483403e01a600700180060066034904801e00060001801c0052016c01e00600f801c006001801980c2402900e30000c00e002901060070030128060c00e00290116007003800c00b003483c0ba03860070018006006906432e00040283003800a40498003003800a404d802c00e00f003800c00b003301a480cb0003003800c003003301a4802b00030001801c01e0070018016006603490605c0160006007001800600660349048276000600030000c00e0029014600b003801c00c04b003800c00300348203a2489b00030001801c00e006025801c006001801a4101b11dc2df80018000c0003003800a4055802c00e007003012c00e003000c00d2080b8b872c000c0006007003801809600700180060069040607e4155016000600030000c00e00290166007003012c00e003000c00d2080c001c000c0003003800a405d801c00e003002c00d20c80180e1801c006001801a412007800100a0c00e00290186007003013c0006007001480cb005801801e006003801800e00600500403003800a4069802c00c00f003001c00c007003803c00e003002c00c05300333023480692028c0004014c00c00b003003c00c00f003003c00e00f003800c00b00301480590052008003003800a406d801c00e003002c00d2000c00d2006c00060070018006006900a600060001801c0052038c00e007001801600690006006901260003003800c003003483281300020141801c005203ac00e006027801c006001801a403d800180006007001480f3003801804e00700180060069040404af3c4e302600060001801c005203ec00e006013801c006001801a4101416f0fd20b80018000600700148103003801c006005801a403501c3003800c0030034812b00030000c00e0029021600f003800c00a01ac00e003000c00ccc08d20d00f4800b00030000c0000000000803c00c016008401e006009801c006001801807e0060298000c000401e006007801c0060018018074020c000400e00f003800c00b003010c000802180020070018006006019801805e0003000400600580180760060138000800c00b00330134805200c400e00300080330004006005801a4001801a410112f58000801c00600901260008019806a40118002007001800600690404a75ee01e00060008018046000801801e000300c4832004c025201430094800a0030028052003002c00d2002c000300648010c0092002300748028c0312000300b48018c0292012300948008c0212066801a40018000c0192008300a2233335573e00250002801994004d55ce800cd55cf0008d5d08014c00cd5d10011263009222532900389800a4d2219002912c80344c01526910c80148964cc04cdd68010034564cc03801400626601800e0071801226601800e01518010096400a3000910c008600444002600244004a664600200244246466004460044460040064600444600200646a660080080066a00600224446600644b20051800484ccc02600244666ae68cdc3801000c00200500a91199ab9a33710004003000801488ccd5cd19b89002001800400a44666ae68cdc4801000c00a00122333573466e20008006005000912a999ab9a3371200400222002220052255333573466e2400800444008440040026eb400a42660080026eb000a4264666015001229002914801c8954ccd5cd19b8700400211333573466e1c00c006001002118011229002914801c88cc044cdc100200099b82002003245200522900391199ab9a3371066e08010004cdc1001001c002004403245200522900391199ab9a3371266e08010004cdc1001001c00a00048a400a45200722333573466e20cdc100200099b820020038014000912c99807001000c40062004912c99807001000c400a2002001199919ab9a357466ae880048cc028dd69aba1003375a6ae84008d5d1000934000dd60010a40064666ae68d5d1800c0020052225933006003357420031330050023574400318010600a444aa666ae68cdc3a400000222c22aa666ae68cdc4000a4000226600666e05200000233702900000088994004cdc2001800ccdc20010008cc010008004c01088954ccd5cd19b87480000044400844cc00c004cdc300100091119803112c800c60012219002911919806912c800c4c02401a442b26600a004019130040018c008002590028c804c8888888800d1900991111111002a244b267201722222222008001000c600518000001112a999ab9a3370e004002230001155333573466e240080044600823002229002914801c88ccd5cd19b893370400800266e0800800e00100208c8c0040048c0088cc008008005",
-};
+export const COMPILED_GUARDRAIL_SCRIPT =
+ "5908545908510101003232323232323232323232323232323232323232323232323232323232323232323232323232323232259323255333573466e1d20000011180098111bab357426ae88d55cf00104554ccd5cd19b87480100044600422c6aae74004dd51aba1357446ae88d55cf1baa3255333573466e1d200a35573a002226ae84d5d11aab9e00111637546ae84d5d11aba235573c6ea800642b26006003149a2c8a4c301f801c0052000c00e0070018016006901e4070c00e003000c00d20d00fc000c0003003800a4005801c00e003002c00d20c09a0c80e1801c006001801a4101b5881380018000600700148013003801c006005801a410100078001801c006001801a4101001f8001800060070014801b0038018096007001800600690404002600060001801c0052008c00e006025801c006001801a41209d8001800060070014802b003801c006005801a410112f501c3003800c00300348202b7881300030000c00e00290066007003800c00b003482032ad7b806038403060070014803b00380180960003003800a4021801c00e003002c00d20f40380e1801c006001801a41403f800100a0c00e0029009600f0030078040c00e002900a600f003800c00b003301a483403e01a600700180060066034904801e00060001801c0052016c01e00600f801c006001801980c2402900e30000c00e002901060070030128060c00e00290116007003800c00b003483c0ba03860070018006006906432e00040283003800a40498003003800a404d802c00e00f003800c00b003301a480cb0003003800c003003301a4802b00030001801c01e0070018016006603490605c0160006007001800600660349048276000600030000c00e0029014600b003801c00c04b003800c00300348203a2489b00030001801c00e006025801c006001801a4101b11dc2df80018000c0003003800a4055802c00e007003012c00e003000c00d2080b8b872c000c0006007003801809600700180060069040607e4155016000600030000c00e00290166007003012c00e003000c00d2080c001c000c0003003800a405d801c00e003002c00d20c80180e1801c006001801a412007800100a0c00e00290186007003013c0006007001480cb005801801e006003801800e00600500403003800a4069802c00c00f003001c00c007003803c00e003002c00c05300333023480692028c0004014c00c00b003003c00c00f003003c00e00f003800c00b00301480590052008003003800a406d801c00e003002c00d2000c00d2006c00060070018006006900a600060001801c0052038c00e007001801600690006006901260003003800c003003483281300020141801c005203ac00e006027801c006001801a403d800180006007001480f3003801804e00700180060069040404af3c4e302600060001801c005203ec00e006013801c006001801a4101416f0fd20b80018000600700148103003801c006005801a403501c3003800c0030034812b00030000c00e0029021600f003800c00a01ac00e003000c00ccc08d20d00f4800b00030000c0000000000803c00c016008401e006009801c006001801807e0060298000c000401e006007801c0060018018074020c000400e00f003800c00b003010c000802180020070018006006019801805e0003000400600580180760060138000800c00b00330134805200c400e00300080330004006005801a4001801a410112f58000801c00600901260008019806a40118002007001800600690404a75ee01e00060008018046000801801e000300c4832004c025201430094800a0030028052003002c00d2002c000300648010c0092002300748028c0312000300b48018c0292012300948008c0212066801a40018000c0192008300a2233335573e00250002801994004d55ce800cd55cf0008d5d08014c00cd5d10011263009222532900389800a4d2219002912c80344c01526910c80148964cc04cdd68010034564cc03801400626601800e0071801226601800e01518010096400a3000910c008600444002600244004a664600200244246466004460044460040064600444600200646a660080080066a00600224446600644b20051800484ccc02600244666ae68cdc3801000c00200500a91199ab9a33710004003000801488ccd5cd19b89002001800400a44666ae68cdc4801000c00a00122333573466e20008006005000912a999ab9a3371200400222002220052255333573466e2400800444008440040026eb400a42660080026eb000a4264666015001229002914801c8954ccd5cd19b8700400211333573466e1c00c006001002118011229002914801c88cc044cdc100200099b82002003245200522900391199ab9a3371066e08010004cdc1001001c002004403245200522900391199ab9a3371266e08010004cdc1001001c00a00048a400a45200722333573466e20cdc100200099b820020038014000912c99807001000c40062004912c99807001000c400a2002001199919ab9a357466ae880048cc028dd69aba1003375a6ae84008d5d1000934000dd60010a40064666ae68d5d1800c0020052225933006003357420031330050023574400318010600a444aa666ae68cdc3a400000222c22aa666ae68cdc4000a4000226600666e05200000233702900000088994004cdc2001800ccdc20010008cc010008004c01088954ccd5cd19b87480000044400844cc00c004cdc300100091119803112c800c60012219002911919806912c800c4c02401a442b26600a004019130040018c008002590028c804c8888888800d1900991111111002a244b267201722222222008001000c600518000001112a999ab9a3370e004002230001155333573466e240080044600823002229002914801c88ccd5cd19b893370400800266e0800800e00100208c8c0040048c0088cc008008005";
export const SECURITY_RELEVANT_PARAMS_MAP: Record = {
maxBlockBodySize: "max_block_size",
diff --git a/govtool/frontend/src/context/wallet.tsx b/govtool/frontend/src/context/wallet.tsx
index 71a65a8cc..a698f5ae5 100644
--- a/govtool/frontend/src/context/wallet.tsx
+++ b/govtool/frontend/src/context/wallet.tsx
@@ -71,7 +71,7 @@ import { Link } from "@mui/material";
import * as Sentry from "@sentry/react";
import { Trans } from "react-i18next";
-import { PATHS, COMPILED_GUARDRAIL_SCRIPTS } from "@consts";
+import { PATHS, COMPILED_GUARDRAIL_SCRIPT } from "@consts";
import { CardanoApiWallet, VoterInfo } from "@models";
import type { StatusModalState } from "@organisms";
import {
@@ -250,12 +250,6 @@ const CardanoContext = createContext(
CardanoContext.displayName = "CardanoContext";
const CardanoProvider = (props: Props) => {
- const { network: networkKey } = useAppContext();
- const guardrailScript =
- COMPILED_GUARDRAIL_SCRIPTS[
- networkKey as keyof typeof COMPILED_GUARDRAIL_SCRIPTS
- ];
-
const [isEnabled, setIsEnabled] = useState(false);
const isGuardrailScriptUsed = useRef(false);
const redeemers = useRef([]);
@@ -576,7 +570,9 @@ const CardanoProvider = (props: Props) => {
try {
const scripts = PlutusScripts.new();
scripts.add(
- PlutusScript.from_bytes_v3(Buffer.from(guardrailScript, "hex")),
+ PlutusScript.from_bytes_v3(
+ Buffer.from(COMPILED_GUARDRAIL_SCRIPT, "hex"),
+ ),
);
transactionWitnessSet.set_plutus_scripts(scripts);
@@ -732,7 +728,6 @@ const CardanoProvider = (props: Props) => {
walletApi,
t,
updateTransaction,
- guardrailScript,
epochParams?.cost_model?.costs,
disconnectWallet,
registeredStakeKeysListState,
@@ -1046,7 +1041,7 @@ const CardanoProvider = (props: Props) => {
);
});
const guardrailPlutusScript = PlutusScript.from_bytes_v3(
- Buffer.from(guardrailScript, "hex"),
+ Buffer.from(COMPILED_GUARDRAIL_SCRIPT, "hex"),
);
const treasuryAction = TreasuryWithdrawalsAction.new_with_policy_hash(
treasuryWithdrawals,
@@ -1085,7 +1080,6 @@ const CardanoProvider = (props: Props) => {
addVotingProposalToBuilder,
epochParams?.gov_action_deposit,
getRewardAddress,
- guardrailScript,
],
);
@@ -1108,7 +1102,7 @@ const CardanoProvider = (props: Props) => {
}
const guardrailPlutusScript = PlutusScript.from_bytes_v3(
- Buffer.from(guardrailScript, "hex"),
+ Buffer.from(COMPILED_GUARDRAIL_SCRIPT, "hex"),
);
let protocolParamChangeAction;
if (prevGovernanceActionHash && prevGovernanceActionIndex) {
@@ -1163,7 +1157,6 @@ const CardanoProvider = (props: Props) => {
addVotingProposalToBuilder,
epochParams?.gov_action_deposit,
getRewardAddress,
- guardrailScript,
],
);
diff --git a/govtool/frontend/src/hooks/useMatomo.ts b/govtool/frontend/src/hooks/useMatomo.ts
deleted file mode 100644
index 5c323e78c..000000000
--- a/govtool/frontend/src/hooks/useMatomo.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-/* eslint-disable func-names */
-/* eslint-disable no-multi-assign */
-/* eslint-disable prefer-template */
-/* eslint-disable no-underscore-dangle */
-/* eslint-disable wrap-iife */
-import { useEffect } from "react";
-
-export const useMatomo = () => {
- useEffect(() => {
- const isSancho = window.location.href.includes("sancho");
- if (isSancho) return;
-
- const network = import.meta.env.VITE_NETWORK_FLAG;
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-expect-error
- const _paq = (window._paq = window._pag || []);
- _paq.push(["trackPageView"]);
- _paq.push(["enableLinkTracking"]);
- (function () {
- const u = "//analytics.gov.tools/";
- _paq.push(["setTrackerUrl", u + "matomo.php"]);
- _paq.push(["setSiteId", network === 1 ? "1" : "2"]);
- const d = document;
- const g = d.createElement("script");
- const s = d.getElementsByTagName("script")[0];
- g.async = true;
- g.src = u + "matomo.js";
- s.parentNode?.insertBefore(g, s);
- })();
- }, []);
-};
diff --git a/govtool/frontend/src/pages/DRepDirectoryContent.tsx b/govtool/frontend/src/pages/DRepDirectoryContent.tsx
index bef54617c..441f3fbc2 100644
--- a/govtool/frontend/src/pages/DRepDirectoryContent.tsx
+++ b/govtool/frontend/src/pages/DRepDirectoryContent.tsx
@@ -14,7 +14,7 @@ import {
} from "@hooks";
import { DataActionsBar, EmptyStateDrepDirectory } from "@molecules";
import { AutomatedVotingOptions, DRepCard } from "@organisms";
-import { correctAdaFormat, isSameDRep } from "@utils";
+import { correctAdaFormat, isSameDRep, uniqBy } from "@utils";
import { DRepData, DRepListSort, DRepStatus } from "@models";
import {
AutomatedVotingOptionCurrentDelegation,
@@ -106,8 +106,9 @@ export const DRepDirectoryContent: FC = ({
const ada = correctAdaFormat(votingPower);
- const listedDRepsWithoutYourself = dRepList?.filter(
- (dRep) => !dRep.doNotList && !isSameDRep(dRep, myDRepId),
+ const listedDRepsWithoutYourself = uniqBy(
+ dRepList?.filter((dRep) => !dRep.doNotList && !isSameDRep(dRep, myDRepId)),
+ "view",
);
const dRepListToDisplay =
yourselfDRep && showYourselfDRep
@@ -212,7 +213,7 @@ export const DRepDirectoryContent: FC = ({
>
{dRepList?.length === 0 && }
{dRepListToDisplay?.map((dRep) => (
-
+
=> {
const emptyMetadata = {
paymentAddress: null,
@@ -34,9 +38,13 @@ export const mapDtoToDrep = async (dto: DrepDataDTO): Promise => {
: dto.imageUrl,
isIPFSImage
? {
+ ...imageFetchDefaultOptions,
headers: { project_id: import.meta.env.VITE_IPFS_PROJECT_ID },
}
- : {},
+ : // set request mode no-cors
+ {
+ ...imageFetchDefaultOptions,
+ },
)
.then(async (res) => {
const blob = await res.blob();
@@ -46,8 +54,10 @@ export const mapDtoToDrep = async (dto: DrepDataDTO): Promise => {
base64Image = reader.result;
};
})
- .catch((e) => {
- console.error("Fetching the DRep image failed, reason: ", e);
+ .catch((error) => {
+ if (import.meta.env.VITE_IS_DEV) {
+ console.error("Error fetching image", error);
+ }
});
}
diff --git a/govtool/frontend/src/utils/tests/uniqBy.test.ts b/govtool/frontend/src/utils/tests/uniqBy.test.ts
new file mode 100644
index 000000000..a8d8fa472
--- /dev/null
+++ b/govtool/frontend/src/utils/tests/uniqBy.test.ts
@@ -0,0 +1,26 @@
+import { uniqBy } from "../uniqBy";
+
+describe("uniqBy", () => {
+ it("should return an array of unique elements based on the specified key", () => {
+ const arr = [
+ { id: 1, name: "John" },
+ { id: 2, name: "Jane" },
+ { id: 3, name: "John" },
+ { id: 4, name: "Jane" },
+ ];
+
+ const result = uniqBy(arr, "name");
+ expect(result).toEqual([
+ { id: 3, name: "John" },
+ { id: 4, name: "Jane" },
+ ]);
+ });
+
+ it("should handle empty input array", () => {
+ const arr: never[] = [];
+
+ const result = uniqBy(arr, "name");
+
+ expect(result).toEqual([]);
+ });
+});
diff --git a/govtool/frontend/src/utils/uniqBy.ts b/govtool/frontend/src/utils/uniqBy.ts
new file mode 100644
index 000000000..34a84802a
--- /dev/null
+++ b/govtool/frontend/src/utils/uniqBy.ts
@@ -0,0 +1,14 @@
+/**
+ * Returns an array of unique elements from the input array based on the specified key.
+ * @param arr - The input array.
+ * @param key - The key to determine uniqueness.
+ * @returns An array of unique elements.
+ * @template T - The type of elements in the array.
+ */
+export const uniqBy = (arr: T[], key: keyof T): T[] => {
+ const map = new Map();
+ arr.forEach((item) => {
+ map.set(item[key], item);
+ });
+ return Array.from(map.values());
+};
diff --git a/govtool/metadata-validation/package.json b/govtool/metadata-validation/package.json
index 1a4ead29a..58c67fd93 100644
--- a/govtool/metadata-validation/package.json
+++ b/govtool/metadata-validation/package.json
@@ -1,6 +1,6 @@
{
"name": "@govtool/metadata-validation",
- "version": "2.0.0",
+ "version": "2.0.2",
"description": "",
"author": "",
"private": true,
diff --git a/govtool/metadata-validation/src/main.ts b/govtool/metadata-validation/src/main.ts
index 24c6de032..e68112e3a 100644
--- a/govtool/metadata-validation/src/main.ts
+++ b/govtool/metadata-validation/src/main.ts
@@ -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.1')
+ .setVersion('2.0.2')
.build();
const document = SwaggerModule.createDocument(app, config);
diff --git a/tests/govtool-frontend/playwright/lib/fixtures/proposal.ts b/tests/govtool-frontend/playwright/lib/fixtures/proposal.ts
index 1ac776878..b52d043b6 100644
--- a/tests/govtool-frontend/playwright/lib/fixtures/proposal.ts
+++ b/tests/govtool-frontend/playwright/lib/fixtures/proposal.ts
@@ -22,7 +22,8 @@ export const test = base.extend({
const proposalCreationPage = new ProposalSubmissionPage(proposalPage);
await proposalCreationPage.goto();
- const proposalId = await proposalCreationPage.createProposal();
+ const proposalId =
+ await proposalCreationPage.createProposal(proposal01Wallet);
const proposalDetailsPage = new ProposalDiscussionDetailsPage(proposalPage);
diff --git a/tests/govtool-frontend/playwright/lib/pages/proposalDiscussionPage.ts b/tests/govtool-frontend/playwright/lib/pages/proposalDiscussionPage.ts
index fd7bbc3fa..1734518e0 100644
--- a/tests/govtool-frontend/playwright/lib/pages/proposalDiscussionPage.ts
+++ b/tests/govtool-frontend/playwright/lib/pages/proposalDiscussionPage.ts
@@ -76,39 +76,6 @@ export default class ProposalDiscussionPage {
await this.page.getByTestId("close-button").click();
}
- async createProposal(): Promise {
- const receivingAddr = generateWalletAddress();
- const proposalRequest: ProposalCreateRequest = {
- proposal_links: [
- {
- prop_link: faker.internet.url(),
- prop_link_text: faker.internet.displayName(),
- },
- ],
- gov_action_type_id: 1,
- prop_name: faker.company.name(),
- prop_abstract: faker.lorem.paragraph(2),
- prop_motivation: faker.lorem.paragraph(2),
- prop_rationale: faker.lorem.paragraph(2),
- prop_receiving_address: receivingAddr,
- prop_amount: faker.number.int({ min: 100, max: 1000 }).toString(),
- is_draft: false,
- };
- await this.proposalCreateBtn.click();
- await this.continueBtn.click();
-
- await this.fillForm(proposalRequest);
-
- await this.continueBtn.click();
- await this.page.getByTestId("submit-button").click();
-
- // Wait for redirection to `proposal-discussion-details` page
- await this.page.waitForTimeout(2_000);
-
- const currentPageUrl = this.page.url();
- return extractProposalIdFromUrl(currentPageUrl);
- }
-
private async fillForm(data: ProposalCreateRequest) {
await this.page.getByTestId("governance-action-type").click();
await this.page.getByTestId("info-button").click();
diff --git a/tests/govtool-frontend/playwright/lib/pages/proposalSubmissionPage.ts b/tests/govtool-frontend/playwright/lib/pages/proposalSubmissionPage.ts
index ce6d5977f..1689016ba 100644
--- a/tests/govtool-frontend/playwright/lib/pages/proposalSubmissionPage.ts
+++ b/tests/govtool-frontend/playwright/lib/pages/proposalSubmissionPage.ts
@@ -9,7 +9,12 @@ import { extractProposalIdFromUrl } from "@helpers/string";
import { invalid } from "@mock/index";
import { Download, Locator, Page, expect } from "@playwright/test";
import metadataBucketService from "@services/metadataBucketService";
-import { ProposalCreateRequest, ProposalLink, ProposalType } from "@types";
+import {
+ ProposalCreateRequest,
+ ProposalLink,
+ ProposalType,
+ StaticWallet,
+} from "@types";
const formErrors = {
proposalTitle: "title-input-error",
@@ -339,12 +344,11 @@ export default class ProposalSubmissionPage {
}
async createProposal(
+ wallet: StaticWallet,
proposalType: ProposalType = ProposalType.treasury
): Promise {
await this.addLinkBtn.click();
- const receivingAddr = (await ShelleyWallet.generate()).rewardAddressBech32(
- 0
- );
+ const receivingAddr = ShelleyWallet.fromJson(wallet).rewardAddressBech32(0);
const proposalRequest: ProposalCreateRequest =
this.generateValidProposalFormFields(
diff --git a/tests/govtool-frontend/playwright/tests/7-proposal-submission/proposalSubmission.ga.spec.ts b/tests/govtool-frontend/playwright/tests/7-proposal-submission/proposalSubmission.ga.spec.ts
index 8273eae19..b70e938d2 100644
--- a/tests/govtool-frontend/playwright/tests/7-proposal-submission/proposalSubmission.ga.spec.ts
+++ b/tests/govtool-frontend/playwright/tests/7-proposal-submission/proposalSubmission.ga.spec.ts
@@ -38,7 +38,10 @@ Object.values(ProposalType).forEach((proposalType, index) => {
await proposalSubmissionPage.proposalCreateBtn.click();
await proposalDiscussionPage.continueBtn.click();
- await proposalSubmissionPage.createProposal(proposalType);
+ await proposalSubmissionPage.createProposal(
+ proposalFaucetWallet,
+ proposalType
+ );
await userPage.getByTestId("submit-as-GA-button").click();