Skip to content

Commit 54360d1

Browse files
authored
Merge pull request #3295 from IntersectMBO/feat/handle-budget-discussion-route
feat: handle budget discussion route
2 parents 69eda0e + 9eae5ae commit 54360d1

File tree

5 files changed

+51
-9
lines changed

5 files changed

+51
-9
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ changes.
1212

1313
### Added
1414

15+
- Add budget discussion paths in the wrapper
16+
1517
### Fixed
1618

1719
### Changed

govtool/frontend/src/App.tsx

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@ import { useCallback, useEffect } from "react";
22
import { Route, Routes, useNavigate } from "react-router-dom";
33

44
import { Modal, ScrollToTop } from "@atoms";
5-
import { PATHS, PDF_PATHS, OUTCOMES_PATHS, USER_PATHS } from "@consts";
5+
import {
6+
PATHS,
7+
PDF_PATHS,
8+
OUTCOMES_PATHS,
9+
USER_PATHS,
10+
BUDGET_DISCUSSION_PATHS,
11+
} from "@consts";
612
import { useCardano, useFeatureFlag, useModal } from "@context";
713
import { useWalletConnectionListener } from "@hooks";
814
import {
@@ -102,10 +108,16 @@ export default () => {
102108
element={<GovernanceActionDetails />}
103109
/>
104110
{isProposalDiscussionForumEnabled && !isEnabled && (
105-
<Route
106-
path={`${PDF_PATHS.proposalDiscussion}/*`}
107-
element={<ProposalDiscussionPillar />}
108-
/>
111+
<>
112+
<Route
113+
path={`${PDF_PATHS.proposalDiscussion}/*`}
114+
element={<ProposalDiscussionPillar />}
115+
/>
116+
<Route
117+
path={`${BUDGET_DISCUSSION_PATHS.budgetDiscussion}/*`}
118+
element={<ProposalDiscussionPillar />}
119+
/>
120+
</>
109121
)}
110122
{isGovernanceOutcomesPillarEnabled && !isEnabled && (
111123
<>
@@ -122,10 +134,16 @@ export default () => {
122134
<Route element={<Dashboard />}>
123135
<Route path={PATHS.dashboard} element={<DashboardHome />} />
124136
{isProposalDiscussionForumEnabled && (
125-
<Route
126-
path={`${PDF_PATHS.proposalDiscussion}/*`}
127-
element={<ProposalDiscussionPillar />}
128-
/>
137+
<>
138+
<Route
139+
path={`${PDF_PATHS.proposalDiscussion}/*`}
140+
element={<ProposalDiscussionPillar />}
141+
/>
142+
<Route
143+
path={`${BUDGET_DISCUSSION_PATHS.budgetDiscussion}/*`}
144+
element={<ProposalDiscussionPillar />}
145+
/>
146+
</>
129147
)}
130148
{isGovernanceOutcomesPillarEnabled && (
131149
<>

govtool/frontend/src/consts/navItems.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
PATHS,
99
PDF_PATHS,
1010
OUTCOMES_PATHS,
11+
BUDGET_DISCUSSION_PATHS,
1112
// TODO: This will be uncommented when the page has been bootstrapped in the outcomes Pillar
1213
// USER_PATHS
1314
} from "./paths";
@@ -73,6 +74,14 @@ export const CONNECTED_NAV_ITEMS = [
7374
icon: ICONS.dRepDirectoryIcon,
7475
newTabLink: null,
7576
},
77+
{
78+
dataTestId: "budget-discussion-link",
79+
label: i18n.t("budgetDiscussion.title"),
80+
navTo: BUDGET_DISCUSSION_PATHS.budgetDiscussion,
81+
activeIcon: ICONS.dRepDirectoryActiveIcon,
82+
icon: ICONS.dRepDirectoryIcon,
83+
newTabLink: null,
84+
},
7685
{
7786
dataTestId: "governance-actions-link",
7887
label: i18n.t("govActions.title"),

govtool/frontend/src/consts/paths.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ export const PDF_PATHS = {
3232
proposalDiscussionPropose: "/proposal_discussion/propose",
3333
};
3434

35+
export const BUDGET_DISCUSSION_PATHS = {
36+
budgetDiscussion: "/budget_discussion",
37+
budgetDiscussionProposal: "/budget_discussion/:id",
38+
budgetDiscussionPropose: "/budget_discussion/propose",
39+
budgetDiscussionAction: "/budget_discussion/:proposalId",
40+
budgetDiscussionCategory: "/budget_discussion/category/:category",
41+
budgetDiscussionCategoryAction:
42+
"/budget_discussion/category/:category/:proposalId",
43+
};
44+
3545
export const USER_PATHS = {
3646
governanceActionsVotedByMe: "/my/votes_and_favorites",
3747
};

govtool/frontend/src/i18n/locales/en.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,9 @@
395395
"title": "Proposals",
396396
"proposeAGovernanceAction": "Propose a Governance Action"
397397
},
398+
"budgetDiscussion": {
399+
"title": "Budget Discussion"
400+
},
398401
"govActions": {
399402
"about": "About",
400403
"abstract": "Abstract",

0 commit comments

Comments
 (0)