From 541bf9bb296dd7b4157e4b29c7bdd5c9a95c27ed Mon Sep 17 00:00:00 2001 From: nebojsajsimic <6024893+nebojsajsimic@users.noreply.github.com> Date: Wed, 25 Dec 2024 14:47:46 +0100 Subject: [PATCH 1/3] - Added check for already existing active pool [Bug #2507] https://github.com/IntersectMBO/govtool/issues/2507 - Fixed buf #2508 Unable to vote after opening new voting pool --- backend/src/api/poll-vote/controllers/poll-vote.js | 6 ++---- backend/src/api/poll/controllers/poll.js | 6 +++++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/backend/src/api/poll-vote/controllers/poll-vote.js b/backend/src/api/poll-vote/controllers/poll-vote.js index 92e3f6a..8e82cc1 100644 --- a/backend/src/api/poll-vote/controllers/poll-vote.js +++ b/backend/src/api/poll-vote/controllers/poll-vote.js @@ -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'); } @@ -51,7 +49,7 @@ module.exports = createCoreController( user_id: user?.id }, { - poll_Id: pollId + poll_id: pollId } ]} }) @@ -261,4 +259,4 @@ module.exports = createCoreController( } }, }) -); +); \ No newline at end of file diff --git a/backend/src/api/poll/controllers/poll.js b/backend/src/api/poll/controllers/poll.js index 8fb9887..af5413f 100644 --- a/backend/src/api/poll/controllers/poll.js +++ b/backend/src/api/poll/controllers/poll.js @@ -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); } From e37ef0d849a2984efcc560097b221fdfc57daf7e Mon Sep 17 00:00:00 2001 From: nebojsajsimic <6024893+nebojsajsimic@users.noreply.github.com> Date: Wed, 25 Dec 2024 14:51:46 +0100 Subject: [PATCH 2/3] - Change copy of the proposal discussion forum landing page #2544 --- pdf-ui/CHANGELOG.md | 9 +++++++++ pdf-ui/package-lock.json | 4 ++-- pdf-ui/package.json | 2 +- pdf-ui/src/pages/IdentificationPage/index.jsx | 5 ----- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/pdf-ui/CHANGELOG.md b/pdf-ui/CHANGELOG.md index c2fc4c0..c48bec5 100644 --- a/pdf-ui/CHANGELOG.md +++ b/pdf-ui/CHANGELOG.md @@ -8,6 +8,15 @@ 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) 2024-12-28 +### Added - +### Fixed += Changed copy on landing page [Issue #2438](https://github.com/IntersectMBO/govtool/issues/2544) + +### Changed - +### Removed - + + ## [v0.5.5](https://www.npmjs.com/package/@intersect.mbo/pdf-ui/v/0.5.5) 2024-12-06 ### Added - diff --git a/pdf-ui/package-lock.json b/pdf-ui/package-lock.json index 32b2cd4..a28e9ec 100644 --- a/pdf-ui/package-lock.json +++ b/pdf-ui/package-lock.json @@ -1,12 +1,12 @@ { "name": "@intersect.mbo/pdf-ui", - "version": "0.5.5", + "version": "0.5.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@intersect.mbo/pdf-ui", - "version": "0.5.4", + "version": "0.5.6", "dependencies": { "@emurgo/cardano-serialization-lib-asmjs": "^12.0.0-beta.2", "@fontsource/poppins": "^5.0.14", diff --git a/pdf-ui/package.json b/pdf-ui/package.json index ba2a921..fc2f043 100644 --- a/pdf-ui/package.json +++ b/pdf-ui/package.json @@ -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": { diff --git a/pdf-ui/src/pages/IdentificationPage/index.jsx b/pdf-ui/src/pages/IdentificationPage/index.jsx index 83849b2..e5d2a68 100644 --- a/pdf-ui/src/pages/IdentificationPage/index.jsx +++ b/pdf-ui/src/pages/IdentificationPage/index.jsx @@ -12,11 +12,6 @@ const IdentificationPage = ({ handleLogin }) => { alignItems={'center'} > - - This is a pre-release of the Proposal Discussion section of - Govtool. - - Date: Thu, 9 Jan 2025 13:25:50 +0100 Subject: [PATCH 3/3] Changed Regex to allow IPFS url to be used --- pdf-ui/CHANGELOG.md | 5 +++-- pdf-ui/src/lib/utils.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pdf-ui/CHANGELOG.md b/pdf-ui/CHANGELOG.md index c48bec5..86adbe7 100644 --- a/pdf-ui/CHANGELOG.md +++ b/pdf-ui/CHANGELOG.md @@ -8,10 +8,11 @@ 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) 2024-12-28 +## [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) +- 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 - diff --git a/pdf-ui/src/lib/utils.js b/pdf-ui/src/lib/utils.js index 292d77b..c405b47 100644 --- a/pdf-ui/src/lib/utils.js +++ b/pdf-ui/src/lib/utils.js @@ -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 '';