Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

From Pre prod to main #65

Merged
merged 9 commits into from
Jan 9, 2025
33 changes: 33 additions & 0 deletions .github/workflows/publish-to-npm.yaml
Original file line number Diff line number Diff line change
@@ -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}}
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
Loading