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.2 #2563

Merged
merged 17 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
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.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
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.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
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.1
version: 2.0.2

-- A short (one-line) description of the package.
-- synopsis:
Expand Down
31 changes: 20 additions & 11 deletions govtool/frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,27 @@
</head>
<body>
<script>
var _paq = window._paq = window._paq || [];
var isMainnet = window.location.hostname == "gov.tools";
var isPreview = window.location.hostname == "preview.gov.tools";

var _paq = (window._paq = window._paq || []);
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//p80-zca17e2b0-z1743beba-gtw.z937eb260.rustrocks.fr/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '1']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true;
g.src=u+'matomo.js';
s.parentNode.insertBefore(g,s);
_paq.push(["trackPageView"]);
_paq.push(["enableLinkTracking"]);
(function () {
if (!isPreview && !isMainnet) {
return;
}

var u = "//analytics.gov.tools/";
_paq.push(["setTrackerUrl", u + "matomo.php"]);
_paq.push(["setSiteId", isMainnet ? "1" : "2"]);
var d = document,
g = d.createElement("script"),
s = d.getElementsByTagName("script")[0];
g.async = true;
g.src = u + "matomo.js";
s.parentNode.insertBefore(g, s);
})();
</script>
<div id="root"></div>
Expand Down
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": "2.0.1",
"version": "2.0.2",
"type": "module",
"scripts": {
"build": "vite build",
Expand Down Expand Up @@ -113,5 +113,5 @@
"nth-check": "^2.0.1",
"postcss": "^8.4.31"
},
"_id": "[email protected].1"
"_id": "[email protected].2"
}
2 changes: 0 additions & 2 deletions govtool/frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const DataActionsFilters = ({
[chosenFilters, setChosenFilters],
);

const { isMobile, screenWidth } = useScreenDimension();
const { isMobile } = useScreenDimension();

const wrapperRef = useRef<HTMLDivElement>(null);
useOnClickOutside(wrapperRef, closeFilters);
Expand All @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ export const DataMissingHeader = ({
<Box
sx={{
flexDirection: {
sm: "column",
lg: "row",
xxs: "column",
md: "row",
},
alignItems: {
lg: "center",
md: "center",
},
display: "flex",
}}
Expand All @@ -52,8 +52,8 @@ export const DataMissingHeader = ({
)}
<Typography
sx={{
...(isDRep && { ml: { lg: 3 } }),
...(isDRep && { mt: { sm: 2, lg: 0 } }),
...(isDRep && { ml: { md: 3 } }),
...(isDRep && { mt: { xxs: 2, md: 0 } }),
textOverflow: "ellipsis",
fontWeight: 600,
...(isDataMissing && { color: "errorRed" }),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ export const DataMissingInfoBox = ({
sx={{
mb: 4,
pr: 6,
maxWidth: {
xxs: "295px",
md: "100%",
},
...sx,
}}
>
Expand Down
21 changes: 18 additions & 3 deletions govtool/frontend/src/components/organisms/DRepCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,15 @@ export const DRepCard = ({
src={image || ICONS.defaultDRepIcon}
data-testid="drep-image"
/>
<Box ml={3}>
<Box
sx={{
marginLeft: {
xxs: 1,
xs: 2,
sm: 3,
},
}}
>
<Typography
sx={{ ellipsisStyles, color: metadataStatus && "errorRed" }}
>
Expand All @@ -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",
Expand Down Expand Up @@ -195,12 +206,15 @@ export const DRepCard = ({
<Box
display="flex"
gap={2.5}
minWidth={isConnected ? 233 : 310}
sx={{
"@container root (min-width: 480px)": {
justifyContent: "flex-end",
alignItems: "center",
},
minWidth: {
xxs: "233px",
xs: isConnected ? "233px" : "310px",
},
}}
>
{type === "DRep" && (
Expand Down Expand Up @@ -251,4 +265,5 @@ const ellipsisStyles = {
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
maxWidth: { xxs: "200px", xs: "100%" },
} as const;
29 changes: 25 additions & 4 deletions govtool/frontend/src/components/organisms/DRepDetailsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,19 @@ const DRepDetailsInfoItem = ({
if (!children && !text) return null;
const dataTestIdInfoItemCategoryPrefix = "info-item";
return (
<div>
<Box sx={{ mb: 0.5 }}>
<Box
sx={{
maxWidth: {
xxs: "295px",
md: "100%",
},
}}
>
<Box
sx={{
mb: 0.5,
}}
>
<Typography
color="neutralGray"
fontWeight={600}
Expand All @@ -260,7 +271,7 @@ const DRepDetailsInfoItem = ({
)}
{children}
</div>
</div>
</Box>
);
};

Expand Down Expand Up @@ -306,7 +317,17 @@ const ReferencesGroup = ({ references }: { references: ReferenceItem[] }) => (
);

const ReferencesLink = ({ label, uri }: ReferenceItem) => (
<Box sx={{ display: "flex", flexDirection: "column", gap: 0.5 }}>
<Box
sx={{
display: "flex",
flexDirection: "column",
gap: 0.5,
maxWidth: {
xxs: "295px",
md: "100%",
},
}}
>
<Typography fontWeight={400}>{label}</Typography>
<Link
data-testid={`${testIdFromLabel(label)}-link`}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Box, Grid, IconButton, SwipeableDrawer } from "@mui/material";
import { NavLink } from "react-router-dom";

import { Background, Link } from "@atoms";
import { CONNECTED_NAV_ITEMS, ICONS } from "@consts";
import { CONNECTED_NAV_ITEMS, ICONS, PATHS } from "@consts";
import { DRepInfoCard, WalletInfoCard } from "@molecules";
import { useGetVoterInfo, useScreenDimension } from "@hooks";
import { openInNewTab } from "@utils";
Expand Down Expand Up @@ -57,7 +58,13 @@ export const DashboardDrawerMobile = ({
width: screenWidth - CALCULATED_DRAWER_PADDING,
}}
>
<img alt="app-logo" src={ICONS.appLogoIcon} height={25} />
<NavLink
data-testid="logo-button"
style={{ display: "flex", justifyContent: "center" }}
to={PATHS.dashboard}
>
<img alt="app-logo" src={ICONS.appLogoIcon} height={25} />
</NavLink>
<IconButton
data-testid="close-drawer-button"
onClick={closeDrawer}
Expand Down
11 changes: 9 additions & 2 deletions govtool/frontend/src/components/organisms/DrawerMobile.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { NavLink } from "react-router-dom";
import { Box, Grid, IconButton, SwipeableDrawer } from "@mui/material";

import { Background, Button, Link, Typography } from "@atoms";
import { ICONS, IMAGES, NAV_ITEMS } from "@consts";
import { ICONS, IMAGES, NAV_ITEMS, PATHS } from "@consts";
import { useScreenDimension, useTranslation } from "@hooks";
import { useFeatureFlag, useModal } from "@context";
import { openInNewTab } from "@utils";
Expand Down Expand Up @@ -48,7 +49,13 @@ export const DrawerMobile = ({
width: screenWidth - CALCULATED_DRAWER_PADDING,
}}
>
<img alt="app-logo" height={25} src={IMAGES.appLogo} />
<NavLink
data-testid="logo-button"
style={{ display: "flex", justifyContent: "center" }}
to={PATHS.dashboard}
>
<img alt="app-logo" height={25} src={IMAGES.appLogo} />
</NavLink>
<IconButton
sx={{ padding: 0 }}
onClick={() => setIsDrawerOpen(false)}
Expand Down
Loading
Loading