Skip to content

Commit

Permalink
Merge pull request #61 from IntersectMBO/BugFix-2495
Browse files Browse the repository at this point in the history
IPFS URL Format support
  • Loading branch information
nebojsact authored Jan 9, 2025
2 parents cb7af3a + 5ab4599 commit 09db0cb
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 14 deletions.
6 changes: 2 additions & 4 deletions backend/src/api/poll-vote/controllers/poll-vote.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ module.exports = createCoreController(
async create(ctx) {
const { data } = ctx?.request?.body;
const { vote_result: voteResult, poll_id: pollId } = data;

const user = ctx?.state?.user;

if (!user) {
return ctx.badRequest(null, 'User is required');
}
Expand Down Expand Up @@ -51,7 +49,7 @@ module.exports = createCoreController(
user_id: user?.id
},
{
poll_Id: pollId
poll_id: pollId
}
]}
})
Expand Down Expand Up @@ -261,4 +259,4 @@ module.exports = createCoreController(
}
},
})
);
);
6 changes: 5 additions & 1 deletion backend/src/api/poll/controllers/poll.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ module.exports = createCoreController('api::poll.poll', ({ strapi }) => ({
{
return ctx.badRequest(null, 'User is not owner of this proposal');
}

const currentActivePool = await strapi.entityService.findMany("api::poll.poll",{filters:{$and:[{proposal_id:data.proposal_id},{is_poll_active:true}]},limit:1});
if(currentActivePool.length > 0)
{
return ctx.badRequest(null, 'There is already an active pool for this proposal');
}
const newPool = await strapi.entityService.create("api::poll.poll",{data:data});
return this.transformResponse(newPool);
}
Expand Down
10 changes: 10 additions & 0 deletions pdf-ui/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
As a minor extension, we also keep a semantic version for the `UNRELEASED`
changes.

## [v0.5.6](https://www.npmjs.com/package/@intersect.mbo/pdf-ui/v/0.5.6) 2025-01-09
### Added -
### Fixed
- Changed copy on landing page [Issue #2438](https://github.com/IntersectMBO/govtool/issues/2544)
- Fixed support for IPFS [Issue #2438](https://github.com/IntersectMBO/govtool/issues/2495)

### Changed -
### Removed -


## [v0.5.5](https://www.npmjs.com/package/@intersect.mbo/pdf-ui/v/0.5.5) 2024-12-06

### Added -
Expand Down
4 changes: 2 additions & 2 deletions pdf-ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pdf-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@intersect.mbo/pdf-ui",
"version": "0.5.5",
"version": "0.5.6",
"description": "Proposal discussion ui",
"main": "./src/index.js",
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion pdf-ui/src/lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
} from '@emurgo/cardano-serialization-lib-asmjs';

export const URL_REGEX =
/^(?:(?:https?:\/\/)?(?:\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,})(?:\/[^\s]*)?)|(?:ipfs:\/\/[a-f0-9]+(?:\/[a-zA-Z0-9_]+)*)$|^$/;
/^(?:(?:https?:\/\/)?(?:\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,})(?:\/[^\s]*)?)|(?:ipfs:\/\/(?:[a-zA-Z0-9]+(?:\/[a-zA-Z0-9._-]+)*))$|^$/;

export const formatIsoDate = (isoDate) => {
if (!isoDate) return '';
Expand Down
5 changes: 0 additions & 5 deletions pdf-ui/src/pages/IdentificationPage/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ const IdentificationPage = ({ handleLogin }) => {
alignItems={'center'}
>
<Box textAlign={'center'} width={'100%'}>
<Typography variant='body1'>
This is a pre-release of the Proposal Discussion section of
Govtool.
</Typography>

<Typography
variant='body1'
sx={{
Expand Down

0 comments on commit 09db0cb

Please sign in to comment.