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

chore: bump @intersect.mbo/[email protected] #1461

Merged
merged 45 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
babcd05
Comment auth setup for proposal wallet
NabinKawan Jun 21, 2024
cb6eeb9
fix(#1436): fix 404 on navigating back on proposal discussion
MSzalowski Jun 28, 2024
858f8c9
Merge pull request #1444 from IntersectMBO/fix/1436-pdf-show-all-back…
MSzalowski Jul 1, 2024
1334732
chore: bump @intersect.mbo/[email protected]
MSzalowski Jul 1, 2024
e582b5d
Merge pull request #1449 from IntersectMBO/chore/bump-pdf-ui
MSzalowski Jul 1, 2024
f7c1902
[#1234] Add reddis support for storing metadata validation results
jankun4 Jun 11, 2024
c31cdc2
feat: provide redis configuration
MSzalowski Jun 24, 2024
45cc8aa
[#1234] modify redis config
jankun4 Jun 26, 2024
3db9567
Merge pull request #1256 from IntersectMBO/1234-provide-workers-to-fe…
MSzalowski Jul 1, 2024
ae9ebd7
[#1235] add /transaction/watch endpoint & background tx status process
jankun4 Jun 16, 2024
bf8834c
[#1234] Add reddis support for storing metadata validation results
jankun4 Jun 11, 2024
58f13b8
[#1235] merge with #1234 branch
jankun4 Jun 17, 2024
ac356d6
[#1235] add lifetime for websocket connections
jankun4 Jun 23, 2024
fdfc7d2
[#1235] minor refactor
jankun4 Jun 23, 2024
3d4f165
fix missing comma in config
jankun4 Jul 1, 2024
409467d
Merge pull request #1304 from IntersectMBO/1235-tech-debt-provide-eve…
MSzalowski Jul 1, 2024
47d9c12
Revert "Merge pull request #1304 from IntersectMBO/1235-tech-debt-pro…
MSzalowski Jul 1, 2024
c0a51dc
Merge pull request #1400 from IntersectMBO/disable-pdf-tests-auth
NabinKawan Jul 2, 2024
10afc07
Merge pull request #1453 from IntersectMBO/chore/revert-transaction-w…
MSzalowski Jul 2, 2024
2ce6360
Revert "Merge pull request #1256 from IntersectMBO/1234-provide-worke…
MSzalowski Jul 2, 2024
81f0387
Merge pull request #1454 from IntersectMBO/revert/1256
MSzalowski Jul 2, 2024
10aa715
chore: Bump version of cardano-test-wallet to 1.2.0
NabinKawan Jul 2, 2024
d1f7dcf
chore: bump @intersect.mbo/pdf-ui to v0.2.4
MSzalowski Jul 2, 2024
dda14e7
fix: Auth setup issue due to page-reload
NabinKawan Jul 2, 2024
a824b49
Merge pull request #1457 from IntersectMBO/bugfix/remove-login-page-r…
NabinKawan Jul 2, 2024
b3d6df6
Merge pull request #1455 from IntersectMBO/feat/signData-cardano-test…
NabinKawan Jul 2, 2024
7e43f4a
fix Sentry catch exceptions
Sworzen1 Jul 1, 2024
75ee295
fix: fix capturing sentry events details
MSzalowski Jul 2, 2024
6c27b1d
Merge pull request #1445 from IntersectMBO/fix/sentry-catch-exception…
MSzalowski Jul 2, 2024
e4eae0b
Merge pull request #1456 from IntersectMBO/chore/bump-pdf-ui
MSzalowski Jul 2, 2024
f7a8044
chore: Update wallet (fixtures, helper) to support cardano-test-walle…
NabinKawan Jul 3, 2024
aeff16d
fix: Test(1E) incompatible wallets
NabinKawan Jul 3, 2024
db60f0f
feat: Enable create proposal 01 auth
NabinKawan Jul 3, 2024
20f1b63
chore: Add type for ProposalCreateRequest
NabinKawan Jul 3, 2024
3b12b54
Merge pull request #1458 from IntersectMBO/develop
MSzalowski Jul 3, 2024
48d871c
Merge pull request #1459 from IntersectMBO/bugfix/test-icompatible-wa…
NabinKawan Jul 3, 2024
f69f8d8
Merge pull request #1460 from IntersectMBO/feat/enable-proposal-auth-…
NabinKawan Jul 3, 2024
dc53ebc
chore: unsafe-inline csp script-src directive
MSzalowski Jul 4, 2024
fc90e0f
chore: Add st,nd,rd also on date regex
kneerose Jul 1, 2024
a601d5b
chore: Remove GA learn more action test in disconnect state
kneerose Jul 1, 2024
68b8374
Chore: Ensure exact text match 'In Progress' in test 3I
kneerose Jul 1, 2024
7514ae9
Merge pull request #1475 from IntersectMBO/fix/test-3I-6D-4H
kneerose Jul 5, 2024
c71843a
broader sentry.io domain for connect-src csp
j-dyczka Jul 5, 2024
76b0459
Merge pull request #1478 from IntersectMBO/chore/unsafe-inline-csp
jdyczka Jul 5, 2024
4de6bd2
Merge pull request #1485 from IntersectMBO/develop
pmbinapps Jul 5, 2024
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ changes.
- Fix displaying the GA Markdowns [Issue 1244](https://github.com/IntersectMBO/govtool/issues/1244)
- Fix app crash on voting on the GA without the connected wallet before [Issue 1313](https://github.com/IntersectMBO/govtool/issues/1313)
- Fix the navigation to Home from Proposal pillar on disconnected wallet [Issue 1355](https://github.com/IntersectMBO/govtool/issues/1355)
- Fix navigation over Proposal discussion forum pillar [Issue 1436](https://github.com/IntersectMBO/govtool/issues/1436)

### Changed

Expand Down
14,214 changes: 5,146 additions & 9,068 deletions govtool/frontend/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion govtool/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@emurgo/cardano-serialization-lib-asmjs": "12.0.0-alpha.29",
"@hookform/resolvers": "^3.3.1",
"@intersect.mbo/intersectmbo.org-icons-set": "^1.0.8",
"@intersect.mbo/pdf-ui": "^0.2.1",
"@intersect.mbo/pdf-ui": "^0.2.4",
"@mui/icons-material": "^5.14.3",
"@mui/material": "^5.14.4",
"@rollup/plugin-babel": "^6.0.4",
Expand Down
21 changes: 2 additions & 19 deletions govtool/frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,23 +80,6 @@ export default () => {
checkTheWalletIsActive();
}, [checkTheWalletIsActive]);

// Proposal Discussion Pillar doesn't export pages or react router routes
// so we need to handle the routing here
useEffect(() => {
if (!isProposalDiscussionForumEnabled) return;
if (
window.location.pathname.includes(PDF_PATHS.proposalDiscussion) &&
!window.location.pathname.includes(PATHS.proposalPillar.replace("/*", ""))
) {
navigate(
`${(isEnabled
? PATHS.connectedProposalPillar
: PATHS.proposalPillar
).replace("/*", "")}${window.location.pathname}`,
);
}
}, [window.location.pathname]);

return (
<>
<ScrollToTop />
Expand All @@ -113,15 +96,15 @@ export default () => {
/>
{isProposalDiscussionForumEnabled && !isEnabled && (
<Route
path={PATHS.proposalPillar}
path={`${PDF_PATHS.proposalDiscussion}/*`}
element={<ProposalDiscussionPillar />}
/>
)}
<Route element={<Dashboard />}>
<Route path={PATHS.dashboard} element={<DashboardCards />} />
{isProposalDiscussionForumEnabled && (
<Route
path={PATHS.connectedProposalPillar}
path={`${PDF_PATHS.proposalDiscussion}/*`}
element={<ProposalDiscussionPillar />}
/>
)}
Expand Down
87 changes: 34 additions & 53 deletions govtool/frontend/src/components/atoms/DrawerLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { FC } from "react";
import { NavLink } from "react-router-dom";

import { theme } from "@/theme";
import { PATHS, PDF_PATHS } from "@/consts";

type LinkProps = {
label: string;
Expand All @@ -14,16 +13,6 @@ type LinkProps = {
onClick?: () => void;
};

const isRouteActive = (isActive: boolean, route: string) =>
isActive ||
(route ===
`${PATHS.proposalPillar.replace("/*", "")}${
PDF_PATHS.proposalDiscussion
}` &&
Object.values(PDF_PATHS).some((pdfPath) =>
window.location.pathname.includes(pdfPath),
));

export const DrawerLink: FC<LinkProps> = ({ ...props }) => {
const { dataTestId, label, navTo, icon, activeIcon, onClick } = props;
const {
Expand All @@ -37,49 +26,41 @@ export const DrawerLink: FC<LinkProps> = ({ ...props }) => {
onClick={() => {
if (onClick) onClick();
}}
style={({ isActive: routeIsActive }) => {
// Workaround for the PDF routes not being handled by react-router
const isActive = isRouteActive(routeIsActive, navTo);
return {
textDecoration: "none",
backgroundColor: isActive ? highlightBlue : "transparent",
padding: "8px 16px",
display: "block",
borderRadius: 100,
};
}}
style={({ isActive }) => ({
textDecoration: "none",
backgroundColor: isActive ? highlightBlue : "transparent",
padding: "8px 16px",
display: "block",
borderRadius: 100,
})}
>
{({ isActive: routeIsActive }) => {
// Workaround for the PDF routes not being handled by react-router
const isActive = isRouteActive(routeIsActive, navTo);
return (
<Box display="flex">
{activeIcon &&
icon &&
typeof icon === "string" &&
typeof activeIcon === "string" ? (
<img
alt="icon"
src={isActive ? activeIcon : icon}
style={{ marginRight: "12px" }}
/>
) : (
<Box marginRight="12px" height="20px" width="20px">
{isActive ? activeIcon : icon}
</Box>
)}
<Typography
fontSize={14}
lineHeight="20px"
sx={{
fontWeight: isActive ? 500 : 400,
}}
>
{label}
</Typography>
</Box>
);
}}
{({ isActive }) => (
<Box display="flex">
{activeIcon &&
icon &&
typeof icon === "string" &&
typeof activeIcon === "string" ? (
<img
alt="icon"
src={isActive ? activeIcon : icon}
style={{ marginRight: "12px" }}
/>
) : (
<Box marginRight="12px" height="20px" width="20px">
{isActive ? activeIcon : icon}
</Box>
)}
<Typography
fontSize={14}
lineHeight="20px"
sx={{
fontWeight: isActive ? 500 : 400,
}}
>
{label}
</Typography>
</Box>
)}
</NavLink>
);
};
17 changes: 12 additions & 5 deletions govtool/frontend/src/components/molecules/WalletInfoCard.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useLocation, useNavigate } from "react-router-dom";
import { Box, Button, Typography } from "@mui/material";

import { PATHS, gray } from "@consts";
import { PDF_PATHS, PATHS, gray } from "@consts";
import { useCardano } from "@context";
import { useTranslation } from "@hooks";
import { Card } from "./Card";
Expand All @@ -14,11 +14,18 @@ export const WalletInfoCard = () => {

const onClickDisconnect = async () => {
await disconnectWallet();
navigate(
pathname.includes("/connected")
? `${pathname.replace("/connected", "")}${hash ?? ""}`
: PATHS.home,
const isProposalDiscussionForum = window.location.pathname.includes(
PDF_PATHS.proposalDiscussion.replace("/", ""),
);

if (!isProposalDiscussionForum) {
navigate(
pathname.includes("/connected")
? `${pathname.replace("/connected", "")}${hash ?? ""}`
: PATHS.home,
);
}

window.location.reload();
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { FC, useCallback } from "react";
import { To, useNavigate, useLocation } from "react-router-dom";
import { Box, CircularProgress, Typography } from "@mui/material";

import { PATHS } from "@consts";
import { PATHS, PDF_PATHS } from "@consts";
import { useCardano } from "@context";
import { theme } from "@/theme";

Expand Down Expand Up @@ -32,8 +32,14 @@ export const WalletOptionButton: FC<WalletOption> = ({

const enableByWalletName = useCallback(async () => {
if (isEnableLoading) return;
const isProposalDiscussionForum = window.location.pathname.includes(
PDF_PATHS.proposalDiscussion.replace("/", ""),
);

const result = await enable(name);

if (result?.stakeKey) {
if (isProposalDiscussionForum) return;
navigate(
// eslint-disable-next-line no-unneeded-ternary
pathToNavigate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ export const ProposeGovActionDashboardCard = ({

navigate(
isProposalDiscussionForumEnabled
? `${PATHS.proposalPillar.replace("/*", "")}${
PDF_PATHS.proposalDiscussion
}`
? PDF_PATHS.proposalDiscussion
: PATHS.createGovernanceAction,
);
}, [deposit, votingPower, isProposalDiscussionForumEnabled]);
Expand Down
7 changes: 1 addition & 6 deletions govtool/frontend/src/components/organisms/HomeCards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,7 @@ export const HomeCards = () => {
);

const navigateToProposalDiscussionPillar = useCallback(
() =>
navigate(
`${PATHS.connectedProposalPillar.replace("/*", "")}${
PDF_PATHS.proposalDiscussion
}`,
),
() => navigate(PDF_PATHS.proposalDiscussion),
[navigate],
);

Expand Down
57 changes: 0 additions & 57 deletions govtool/frontend/src/components/organisms/PDFWrapper.tsx

This file was deleted.

20 changes: 10 additions & 10 deletions govtool/frontend/src/components/organisms/TopNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ export const TopNav = ({ isConnectButton = true }) => {
setIsDrawerOpen(true);
};

const onClickConnectButton = () => {
if (isEnabled && stakeKey) {
navigate(PATHS.dashboard);
} else {
openModal({ type: "chooseWallet" });
}
};

return (
<Box position="relative" py={isMobile ? 5 : 6}>
<AppBar
Expand Down Expand Up @@ -125,13 +133,7 @@ export const TopNav = ({ isConnectButton = true }) => {
<Grid item>
<Button
data-testid="connect-wallet-button"
onClick={() => {
if (isEnabled && stakeKey) {
navigate(PATHS.dashboard);
} else {
openModal({ type: "chooseWallet" });
}
}}
onClick={onClickConnectButton}
size="extraLarge"
variant="contained"
>
Expand All @@ -147,9 +149,7 @@ export const TopNav = ({ isConnectButton = true }) => {
{isConnectButton ? (
<Button
data-testid="connect-wallet-button"
onClick={() => {
openModal({ type: "chooseWallet" });
}}
onClick={onClickConnectButton}
size="small"
sx={{
marginRight: screenWidth >= 768 ? 3 : 1,
Expand Down
7 changes: 2 additions & 5 deletions govtool/frontend/src/consts/navItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ export const NAV_ITEMS = [
},
{
dataTestId: "proposed-governance-actions-link",
navTo:
PATHS.proposalPillar.replace("/*", "") + PDF_PATHS.proposalDiscussion,
navTo: PDF_PATHS.proposalDiscussion,
label: i18n.t("proposalDiscussion.title"),
newTabLink: null,
},
Expand Down Expand Up @@ -71,9 +70,7 @@ export const CONNECTED_NAV_ITEMS = [
{
dataTestId: "proposal-discussion-link",
label: i18n.t("proposalDiscussion.title"),
navTo: `${PATHS.connectedProposalPillar.replace("/*", "")}${
PDF_PATHS.proposalDiscussion
}`,
navTo: PDF_PATHS.proposalDiscussion,
activeIcon: (
<IconAcademicCap
width="20"
Expand Down
2 changes: 0 additions & 2 deletions govtool/frontend/src/consts/paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ export const PATHS = {
retireAsDrep: "/retire_drep",
retireAsDirectVoter: "/retire_direct_voter",
stakeKeys: "/stake_keys",
proposalPillar: "/proposal_pillar/*",
connectedProposalPillar: "/connected/proposal_pillar/*",
};

export const PDF_PATHS = {
Expand Down
Loading
Loading