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

Bugfix #2892 #91

Merged
merged 51 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
137f682
Merge pull request #37 from IntersectMBO/dev
nebojsact Dec 2, 2024
fc1746b
Merge pull request #38 from IntersectMBO/qa
nebojsact Dec 2, 2024
f3d78af
Merge pull request #39 from IntersectMBO/pre-prod
nebojsact Dec 2, 2024
c927c35
Merge pull request #41 from IntersectMBO/dev
nebojsact Dec 4, 2024
9ca831b
Merge pull request #42 from IntersectMBO/qa
nebojsact Dec 4, 2024
99057e9
Merge pull request #43 from IntersectMBO/pre-prod
nebojsact Dec 4, 2024
228c7e8
Merge pull request #45 from IntersectMBO/dev
nebojsact Dec 5, 2024
e5f0eaf
Merge pull request #46 from IntersectMBO/qa
nebojsact Dec 5, 2024
8502302
Merge pull request #47 from IntersectMBO/pre-prod
nebojsact Dec 5, 2024
d5fc225
Merge pull request #50 from IntersectMBO/dev
nebojsact Dec 5, 2024
907d64a
Merge pull request #51 from IntersectMBO/qa
nebojsact Dec 5, 2024
67b048b
Merge pull request #52 from IntersectMBO/pre-prod
teske00 Dec 5, 2024
500aedc
Merge pull request #54 from IntersectMBO/dev
nebojsact Dec 6, 2024
0303db3
Merge pull request #55 from IntersectMBO/qa
nebojsact Dec 6, 2024
cb7af3a
Merge pull request #56 from IntersectMBO/pre-prod
nebojsact Dec 6, 2024
5c471f8
Merge pull request #58 from IntersectMBO/BugFix--#2544
nebojsact Dec 25, 2024
40d1911
Merge pull request #59 from IntersectMBO/dev
nebojsact Dec 25, 2024
16bec6a
Merge pull request #60 from IntersectMBO/qa
nebojsact Dec 25, 2024
09db0cb
Merge pull request #61 from IntersectMBO/BugFix-2495
nebojsact Jan 9, 2025
d10be52
Merge pull request #63 from IntersectMBO/dev
nebojsact Jan 9, 2025
c29dbd8
Merge pull request #64 from IntersectMBO/qa
nebojsact Jan 9, 2025
d76b517
Merge pull request #65 from IntersectMBO/pre-prod
nebojsact Jan 9, 2025
688180f
Update publish-to-npm.yaml
nebojsact Jan 9, 2025
cb4d829
Update publish-to-npm.yaml
nebojsact Jan 9, 2025
63c74cf
Update publish-to-npm.yaml
nebojsact Jan 9, 2025
7bc8bcb
Update publish-to-npm.yaml
nebojsact Jan 10, 2025
a8d5e15
Update publish-to-npm.yaml
nebojsact Jan 10, 2025
97d058b
Update publish-to-npm.yaml
nebojsact Jan 10, 2025
2bd2f84
Update publish-to-npm.yaml
nebojsact Jan 10, 2025
1610d1a
Merge pull request #67 from IntersectMBO/dev
nebojsact Jan 19, 2025
c8e897a
Merge pull request #68 from IntersectMBO/qa
nebojsact Jan 19, 2025
2e8061d
Merge pull request #69 from IntersectMBO/pre-prod
nebojsact Jan 19, 2025
e51b3b1
Merge pull request #71 from IntersectMBO/dev
nebojsact Jan 27, 2025
1942c00
Merge pull request #72 from IntersectMBO/qa
nebojsact Jan 27, 2025
973baed
Merge pull request #73 from IntersectMBO/pre-prod
nebojsact Jan 27, 2025
47faef3
Merge pull request #74 from IntersectMBO/dev
nebojsact Jan 27, 2025
5c5971a
Merge pull request #75 from IntersectMBO/qa
nebojsact Jan 27, 2025
fea539f
Merge pull request #76 from IntersectMBO/pre-prod
nebojsact Jan 27, 2025
0fdd8ed
Merge pull request #79 from IntersectMBO/dev
nebojsact Jan 28, 2025
445053e
Merge pull request #80 from IntersectMBO/qa
nebojsact Jan 28, 2025
f0af2e4
Merge pull request #81 from IntersectMBO/pre-prod
nebojsact Jan 28, 2025
7b4a0a5
Merge pull request #82 from IntersectMBO/dev
nebojsact Jan 29, 2025
660f4a2
Merge pull request #83 from IntersectMBO/qa
nebojsact Jan 29, 2025
c6e44f6
Merge pull request #84 from IntersectMBO/pre-prod
nebojsact Jan 29, 2025
c9029df
Merge pull request #85 from IntersectMBO/dev
nebojsact Jan 29, 2025
ba6986f
Merge pull request #86 from IntersectMBO/qa
nebojsact Jan 29, 2025
d6c0dcb
Merge pull request #87 from IntersectMBO/pre-prod
nebojsact Jan 29, 2025
1ec68df
Merge pull request #88 from IntersectMBO/dev
nebojsact Jan 30, 2025
333ab8d
Merge pull request #89 from IntersectMBO/qa
nebojsact Jan 30, 2025
c9a60c8
Merge pull request #90 from IntersectMBO/pre-prod
nebojsact Jan 30, 2025
ed2df66
Bugfix for display drafts
nebojsajsimic Feb 5, 2025
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
19 changes: 16 additions & 3 deletions .github/workflows/publish-to-npm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,25 @@ jobs:
registry-url: "https://registry.npmjs.org"
scope: "@intersect.mbo"

- name: Authenticate with Scoped NPM
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
registry-url: "https://registry.npmjs.org"
scope: "@intersect.mbo"
run: |
npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN
npm config set scope "@intersect.mbo"
npm whoami

- name: Check NPM Authentication
run: npm whoami

- name: Install dependencies
run: npm ci
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NODE_OPTIONS: --max_old_space_size=8192

- name: Publish to npm
run: npm publish
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NODE_OPTIONS: --max_old_space_size=8192
29 changes: 16 additions & 13 deletions backend/src/api/proposal/controllers/proposal.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ module.exports = createCoreController(
"api::proposal.proposal",
({ strapi }) => ({
async find(ctx) {
const sanitizedQueryParams = ctx.query


const sanitizedQueryParams = ctx.query;
if (!sanitizedQueryParams.filters) {
sanitizedQueryParams.filters = {};
}
Expand All @@ -31,10 +31,11 @@ module.exports = createCoreController(
}

/////GOV ACTION TYPE///////////

const hasGovActionTypeIDFilter = sanitizedQueryParams.filters["$and"]?.find(
(elem) => elem?.hasOwnProperty("gov_action_type_id")
);

if (hasGovActionTypeIDFilter) {
const hasGovActionTypeIDFilterInSanitize =
sanitizedQueryParams?.filters["$and"]?.some((elem) =>
Expand All @@ -47,7 +48,6 @@ module.exports = createCoreController(
}
}
//////////////////////////

/////PROPOSAL NAME///////////
const hasPropNameFilter = ctx?.query?.filters["$and"]?.find((elem) =>
elem?.hasOwnProperty("prop_name")
Expand All @@ -64,7 +64,6 @@ module.exports = createCoreController(
}
}
//////////////////////////////

/////PROPOSAL SUBMITTED///////////
const hasPropSubmitedFilter = ctx?.query?.filters["$and"]?.find((elem) =>
elem?.hasOwnProperty("prop_submitted")
Expand Down Expand Up @@ -96,7 +95,6 @@ module.exports = createCoreController(
}
}
//////////////////////////////

/////PROPOSAL ID///////////
const hasPropIdFilter = ctx?.query?.filters["$and"]?.find((elem) =>
elem?.hasOwnProperty("prop_id")
Expand All @@ -122,17 +120,14 @@ module.exports = createCoreController(
});
}
//////////////////////////////

/////IS DRAFT///////////
const hasIsDraftFilter = ctx?.query?.filters["$and"]?.find((elem) =>
elem?.hasOwnProperty("is_draft")
);

if (hasIsDraftFilter) {
if (!ctx?.state?.user) {
return ctx.badRequest(null, "User is required");
}

if (!ctx?.state?.user) {
return ctx.badRequest(null, "User is required");
}
const hasIsDraftFilterInSanitize = sanitizedQueryParams?.filters[
"$and"
]?.some((elem) => elem?.hasOwnProperty("is_draft"));
Expand All @@ -142,6 +137,14 @@ module.exports = createCoreController(
user_id: ctx?.state?.user?.id,
});
}
const hasUserFilterInSanitize = sanitizedQueryParams?.filters[
"$and"
]?.some((elem) => elem?.hasOwnProperty("user_id"));
if(!hasUserFilterInSanitize){
sanitizedQueryParams.filters["$and"].push({
user_id: ctx?.state?.user?.id,
})
};
} else {
sanitizedQueryParams.filters["$and"].push({
is_draft: false,
Expand Down Expand Up @@ -176,7 +179,7 @@ module.exports = createCoreController(
proposal.content = transformedProposalContent?.data;
proposalsList.push(proposal);
}

console.log(JSON.stringify(sanitizedQueryParams), "params");
return this.transformResponse(proposalsList, { pagination });
},
async findOne(ctx) {
Expand Down