Skip to content

Commit 5af6dce

Browse files
Merge pull request #329 from IntersectMBO/feat/Support-IPFS-Links-for-Governance-Action-Submissions-(3851)
Feat/support ipfs links for governance action submissions (3851)
2 parents 4ebf569 + 1f9b87a commit 5af6dce

File tree

9 files changed

+225
-140
lines changed

9 files changed

+225
-140
lines changed

pdf-ui/CHANGELOG.md

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,58 +8,85 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
As a minor extension, we also keep a semantic version for the `UNRELEASED`
99
changes.
1010

11-
## [v1.0.3-alfa](https://www.npmjs.com/package/@intersect.mbo/pdf-ui/v/1.0.3-beta) 2025-06-19
12-
- Fix Vote link visibility
11+
## [v1.0.8-beta](https://www.npmjs.com/package/@intersect.mbo/pdf-ui/v/1.0.8-beta) 2025-06-30
12+
- Align Vote link
13+
14+
## [v1.0.7-beta](https://www.npmjs.com/package/@intersect.mbo/pdf-ui/v/1.0.7-beta) 2025-06-30
15+
- Align Vote link
16+
- Fix: "Verify Yourself to submit" Message Displayed on Already Submitted Proposals #3857
17+
18+
## [v1.0.6-beta](https://www.npmjs.com/package/@intersect.mbo/pdf-ui/v/1.0.6-beta) 2025-06-30
19+
- Align Vote link
20+
21+
## [v1.0.5-beta](https://www.npmjs.com/package/@intersect.mbo/pdf-ui/v/1.0.5-beta) 2025-06-30
22+
- Align Vote link
23+
24+
## [v1.0.4-beta](https://www.npmjs.com/package/@intersect.mbo/pdf-ui/v/1.0.4-beta) 2025-06-30
25+
26+
- Align Vote link
27+
- Add conditional statement for visibility of poll header text
1328

1429
## [v1.0.3-alfa](https://www.npmjs.com/package/@intersect.mbo/pdf-ui/v/1.0.3-alfa) 2025-06-19
30+
1531
- Fix removed voting button for non drep on budget proposal
1632

1733
## [v1.0.2-beta](https://www.npmjs.com/package/@intersect.mbo/pdf-ui/v/1.0.2-beta) 2025-06-19
18-
- Fix submit to ga button
34+
35+
- Fix submit to ga button
1936
- Added pointer to links
2037

2138
## [v1.0.2-alfa](https://www.npmjs.com/package/@intersect.mbo/pdf-ui/v/1.0.2-alfa) 2025-06-18
39+
2240
- Change login
2341

2442
## [v1.0.0-beta](https://www.npmjs.com/package/@intersect.mbo/pdf-ui/v/1.0.1-beta) 2025-06-18
43+
2544
- Change login
2645
- Fix Invalid Link Validation Bypassed in Proposal Creation via UI and API #3715
2746

2847
## [v1.0.1-alfa](https://www.npmjs.com/package/@intersect.mbo/pdf-ui/v/1.0.1-alfa) 2025-06-12
29-
- Change: User verification mechanism changed to follow process
48+
49+
- Change: User verification mechanism changed to follow process
3050

3151
## [v1.0.0-beta](https://www.npmjs.com/package/@intersect.mbo/pdf-ui/v/1.0.0-beta) 2025-06-11
52+
3253
- Fix Hard Fork Proposal type
3354

3455
## [v1.0.0-alfa](https://www.npmjs.com/package/@intersect.mbo/pdf-ui/v/1.0.0-alfa) 2025-06-05
56+
3557
- Added Hard Fork Proposal type
3658

3759
## [v0.7.0-beta-36](https://www.npmjs.com/package/@intersect.mbo/pdf-ui/v/0.7.0-beta-36) 2025-06-04
60+
3861
- Fix data-testIds
3962

4063
## [v0.7.0-beta-35](https://www.npmjs.com/package/@intersect.mbo/pdf-ui/v/0.7.0-beta-35) 2025-06-03
64+
4165
- Fix data-testIds
4266

4367
## [v0.7.0-beta-34](https://www.npmjs.com/package/@intersect.mbo/pdf-ui/v/0.7.0-beta-34) 2025-06-03
68+
4469
- Fix data-testIds
4570
- Adjust link validation in proposal
4671

47-
4872
## [v0.7.0-beta-33](https://www.npmjs.com/package/@intersect.mbo/pdf-ui/v/0.7.0-beta-33) 2025-06-02
73+
4974
- Remove CSS Rounded Edges on Creating Governance Action Pages on background
5075
- Fix data-testIds
5176

52-
53-
5477
## [v0.7.0-beta-32](https://www.npmjs.com/package/@intersect.mbo/pdf-ui/v/0.7.0-beta-32) 2025-05-29
78+
5579
- fix: Update data-testid attributes for improved accessibility in form…
56-
- Hardware Wallet warning #2575 wording updated
80+
- Hardware Wallet warning #2575 wording updated
5781
- fix: Refactor sorting mechanism
5882
- fix: Fix display cards in Proposal Discussion
5983

6084
### Fixed
85+
6186
## [v0.7.0-beta-31](https://www.npmjs.com/package/@intersect.mbo/pdf-ui/v/0.7.0-beta-31) 2025-05-28
87+
6288
### Fixed
89+
6390
- feat: Enhanced Markdown rendering to support additional tags and styl…
6491
- fix: Update data-testid attributes for improved accessibility in form…
6592
- Hardware Wallet warning #2575
@@ -72,7 +99,6 @@ changes.
7299
- Fix labeling for USD to ADA conversation rate #3692
73100
- feat: Enhance sorting functionality in ProposalsList and ProposedGove…
74101

75-
76102
## [v0.7.0-beta-28](https://www.npmjs.com/package/@intersect.mbo/pdf-ui/v/0.7.0-beta-30) 2025-05-26
77103

78104
### Fixed
@@ -85,6 +111,7 @@ changes.
85111
- fix: Remove unnecessary optional chaining for content attribute in BudgetDiscussionReviewVersions component
86112

87113
### Added
114+
88115
- feat/ Implement Infinite Scroll for Proposal Discussion Forum Section…
89116

90117
## [v0.7.0-beta-28](https://www.npmjs.com/package/@intersect.mbo/pdf-ui/v/0.7.0-beta-29) 2025-05-15

pdf-ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@intersect.mbo/pdf-ui",
3-
"version": "1.0.3-beta",
3+
"version": "1.0.8-beta",
44
"description": "Proposal discussion ui",
55
"main": "./src/index.js",
66
"exports": {

pdf-ui/src/components/CreateGovernanceActionDialog/index.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@ const CreateGovernanceActionDialog = ({ open = false, onClose = false }) => {
168168
linksErrors,
169169
withdrawalsErrors,
170170
constitutionErrors,
171-
]); // proposalData is a dependency
171+
]);
172+
172173
// useEffect(() => {
173174
// handleIsContinueDisabled()
174175
// },[proposalData])

pdf-ui/src/components/CreationGoveranceAction/LinkManager.jsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,6 @@ const LinkManager = ({
108108
});
109109
};
110110

111-
console.log('linksErrors', linksErrors);
112-
113111
return (
114112
<Box>
115113
{proposalData?.proposal_links?.map((link, index) => (

pdf-ui/src/components/ProposalsList/index.jsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const ProposalsList = ({
4343
const [pageCount, setPageCount] = useState(0);
4444
const [currentPage, setCurrentPage] = useState(1);
4545
const [mounted, setMounted] = useState(false);
46-
const debouncedSearchValue = useDebounce(searchText.trim());
46+
// const debouncedSearchValue = useDebounce(searchText.trim());
4747
const [shouldRefresh, setShouldRefresh] = useState(false);
4848
const isXs = useMediaQuery(theme.breakpoints.only('xs'));
4949
const isSm = useMediaQuery(theme.breakpoints.only('sm'));
@@ -69,6 +69,7 @@ const ProposalsList = ({
6969
));
7070

7171
const fetchProposals = async (reset = true, page) => {
72+
console.log('Fetching proposals');
7273
const haveSubmittedFilter = statusList?.some(
7374
(filter) => filter === 'submitted'
7475
);
@@ -87,14 +88,14 @@ const ProposalsList = ({
8788
query = `filters[$and][0][gov_action_type_id]=${
8889
governanceAction?.id
8990
}&filters[$and][1][prop_name][$containsi]=${
90-
debouncedSearchValue || ''
91+
searchText || ''
9192
}&pagination[page]=${page}&pagination[pageSize]=25&sort[${sortType.fieldId}]=${sortType.type}&populate[0]=proposal_links&populate[1]=proposal_withdrawals&populate[2]=proposal_constitution_content&populate[3]=proposal`;
9293
} else {
9394
const isSubmitted = haveSubmittedFilter ? 'true' : 'false';
9495
query = `filters[$and][0][gov_action_type_id]=${
9596
governanceAction?.id
9697
}&filters[$and][1][prop_name][$containsi]=${
97-
debouncedSearchValue || ''
98+
searchText || ''
9899
}&filters[$and][2][prop_submitted]=${isSubmitted}&pagination[page]=${page}&pagination[pageSize]=25&sort[${sortType.fieldId}]=${sortType.type}&populate[0]=proposal_links&populate[1]=proposal_withdrawals&populate[2]=proposal_constitution_content&populate[3]=proposal`;
99100
}
100101
}
@@ -128,7 +129,8 @@ const ProposalsList = ({
128129
}
129130
}, [
130131
mounted,
131-
debouncedSearchValue,
132+
// debouncedSearchValue,
133+
searchText,
132134
sortTypeString,
133135
isDraft ? null : statusListString,
134136
showAllActivated,

pdf-ui/src/lib/utils.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ export function isValidURLLength(s) {
6464
}
6565

6666
export const openInNewTab = (url) => {
67-
if (!url.startsWith('http://') && !url.startsWith('https://')) {
67+
if (url.startsWith('ipfs://')) {
68+
url = url.replace('ipfs://', 'https://ipfs.io/ipfs/');
69+
} else if (!url.startsWith('http://') && !url.startsWith('https://')) {
6870
url = 'https://' + url;
6971
}
7072
const newWindow = window.open(url, '_blank', 'noopener,noreferrer');
@@ -177,4 +179,4 @@ export const correctVoteAdaFormat = (
177179
});
178180
}
179181
return '0';
180-
};
182+
};

pdf-ui/src/pages/BudgetDiscussion/SingleBudgetDiscussion/index.jsx

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,7 @@ const SingleBudgetDiscussion = ({ id }) => {
906906
handleOpenReviewVersions()
907907
}
908908
data-testid='review-version'
909-
sx={{ cursor: 'pointer' }}
909+
sx={{ cursor: 'pointer' }}
910910
>
911911
Review Versions
912912
</Link>
@@ -1844,17 +1844,20 @@ const SingleBudgetDiscussion = ({ id }) => {
18441844
</CardContent>
18451845
</Card>
18461846
</Box>
1847-
1848-
<Box
1849-
mt={4}
1850-
display='flex'
1851-
alignItems='center'
1852-
justifyContent='space-between'
1853-
>
1854-
<Typography variant='h4' component='h3'>
1855-
Poll of DRep sentiment
1856-
</Typography>
1857-
</Box>
1847+
{activePoll &&
1848+
proposal?.attributes?.submitted_for_vote ===
1849+
null && (
1850+
<Box
1851+
mt={4}
1852+
display='flex'
1853+
alignItems='center'
1854+
justifyContent='space-between'
1855+
>
1856+
<Typography variant='h4' component='h3'>
1857+
Poll of DRep sentiment
1858+
</Typography>
1859+
</Box>
1860+
)}
18581861

18591862
{activePoll &&
18601863
proposal?.attributes?.submitted_for_vote ===

0 commit comments

Comments
 (0)