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 Dev to QA #25

Merged
merged 20 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
11c55d3
workflows
djordje-git Sep 18, 2024
93f96f1
Merge pull request #7 from IntersectMBO/qa
vpaunovic Sep 19, 2024
6655705
Merge pull request #8 from IntersectMBO/pre-prod
vpaunovic Sep 20, 2024
56a21b2
Merge pull request #9 from IntersectMBO/docs/add-missing-files
teske00 Oct 1, 2024
8455f6d
Merge pull request #12 from IntersectMBO/qa
vpaunovic Nov 6, 2024
e8c7bf3
Merge pull request #13 from IntersectMBO/pre-prod
vpaunovic Nov 6, 2024
9637ea7
Merge pull request #16 from IntersectMBO/qa
nebojsajsimic Nov 12, 2024
6cd1f0f
Merge pull request #17 from IntersectMBO/pre-prod
nebojsajsimic Nov 12, 2024
1e85545
Merge pull request #20 from IntersectMBO/dev
nebojsajsimic Nov 14, 2024
83d81c0
Merge pull request #21 from IntersectMBO/pre-prod
nebojsajsimic Nov 14, 2024
5692d97
This change allows users to add up to 10 different addresses when sub…
nebojsajsimic Nov 25, 2024
7e1ffb4
Version changed to 5.0
nebojsajsimic Nov 25, 2024
7bc54d3
Fix coments and console log
nebojsajsimic Nov 25, 2024
c8c8520
Merge pull request #22 from IntersectMBO/Bugfix-(change-request)-#2378
teske00 Nov 26, 2024
77b5c23
Bugfix (change request) #2378 Backend step 1
nebojsajsimic Nov 26, 2024
28b8f25
Merge pull request #23 from IntersectMBO/Bugfix-(change-request)-#2378
teske00 Nov 26, 2024
a7908b1
Migration script 2
nebojsajsimic Nov 26, 2024
65c0065
Merge pull request #24 from IntersectMBO/Bugfix-(change-request)-#2378
teske00 Nov 26, 2024
3f8a184
Merge branch 'qa' into dev
nebojsact Nov 26, 2024
9411677
Delete backend/database/migrations/20241121_2_WithdrawalsRestoreDataA…
nebojsact Nov 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// This script must be run wih first start on old source database
// this is just to copy data to new schema that will not be synced with main schema
module.exports = {
async up(knex) {
try {
let trx = await knex.transaction();
let result = await trx.raw( `SELECT id, prop_receiving_address, prop_amount
FROM proposal_contents
WHERE prop_receiving_address IS NOT NULL;`);
await trx.raw('CREATE SCHEMA IF NOT EXISTS temp');
await trx.raw(`
CREATE TABLE IF NOT EXISTS temp.temp_migrate_data (
id int4 PRIMARY KEY,
prop_receiving_address VARCHAR(255),
prop_amount DECIMAL
);
`);
result = await trx.raw(`
INSERT INTO temp.temp_migrate_data (id, prop_receiving_address, prop_amount)
SELECT id, prop_receiving_address, prop_amount
FROM proposal_contents
WHERE prop_receiving_address IS NOT NULL;
`);
console.log("Data coppied to temp table temp_migrate_data");
await trx.raw('ALTER TABLE proposal_contents DROP COLUMN prop_receiving_address');
console.log("Columns prop_receiving_address dropped successfully");
await trx.raw('ALTER TABLE proposal_contents DROP COLUMN prop_amount');
console.log("Columns prop_amount dropped successfully");
trx.commit();
}
catch(error)
{
console.error('Error copping data:', error);
}
console.log('Migration 20241121_1 completed!');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,33 +20,24 @@
"default": false
},
"prop_abstract": {
"type": "text",
"maxLength": 2500
},
"type": "text",
"maxLength": 2500
},
"prop_motivation": {
"type": "text",
"maxLength": 12000
},
"type": "text",
"maxLength": 12000
},
"prop_rationale": {
"type": "text",
"maxLength": 12000
},
"type": "text",
"maxLength": 12000
},
"gov_action_type_id": {
"type": "string"
},
"prop_name": {
"type": "string",
"required": true,
"maxLength": 80
},
"prop_receiving_address": {
"type": "string",
"required": false,
"maxLength": 200
},
"prop_amount": {
"type": "float",
"required": false
"required": true,
"maxLength": 80
},
"proposal_links": {
"type": "component",
Expand All @@ -71,6 +62,12 @@
},
"prop_submission_date": {
"type": "date"
},
"proposal_withdrawals": {
"displayName": "proposal_withdrawals",
"type": "component",
"repeatable": true,
"component": "proposal.proposal-withdrawals"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ module.exports = createCoreController(
if (!sanitizedQueryParams?.populate?.includes("proposal_links")) {
sanitizedQueryParams.populate.push("proposal_links");
}

if (!sanitizedQueryParams?.populate?.includes("proposal_withdrawals")) {
sanitizedQueryParams.populate.push("proposal_withdrawals");
}
const { results, pagination } = await strapi
.service("api::proposal-content.proposal-content")
.find(sanitizedQueryParams);
Expand Down
18 changes: 18 additions & 0 deletions backend/src/components/proposal/proposal-withdrawals.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"collectionName": "components_proposal_proposal_withdrawals",
"info": {
"displayName": "proposal_withdrawals",
"description": ""
},
"options": {},
"attributes": {
"prop_receiving_address": {
"type": "string",
"maxLength": 200
},
"prop_amount": {
"type": "float",
"min": 0
}
}
}
Loading
Loading