From b2a50237a9f71460e18d5b557f1d2ac293c7cf2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Sza=C5=82owski?= Date: Thu, 5 Dec 2024 12:57:57 +0100 Subject: [PATCH 1/3] chore: add github workflow to publish package to npm --- .github/workflows/publish-to-npm.yaml | 33 +++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/publish-to-npm.yaml diff --git a/.github/workflows/publish-to-npm.yaml b/.github/workflows/publish-to-npm.yaml new file mode 100644 index 0000000..2775b6b --- /dev/null +++ b/.github/workflows/publish-to-npm.yaml @@ -0,0 +1,33 @@ +name: Build and publish new version of @intersect.mbo/pdf-ui package +run-name: Publish by @${{ github.actor }} + +on: + workflow_dispatch: + +jobs: + publish: + runs-on: ubuntu-latest + defaults: + run: + working-directory: pdf-ui + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "20" + registry-url: "https://registry.npmjs.org" + scope: "@intersect.mbo" + + - name: Install dependencies + run: npm ci + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + + - name: Publish to npm + run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} 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 2/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 3/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. - -