Skip to content

Commit 4abce3a

Browse files
Merge branch 'develop' into dependabot/npm_and_yarn/apps/frontend/multi-c22e25d29b
2 parents 6db01a3 + fb276ef commit 4abce3a

25 files changed

Lines changed: 327 additions & 97 deletions
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
DO
2+
$$
3+
BEGIN
4+
IF register_patch('DropUsersUsernameKey.sql', 'jekabskarklins', 'Deprecate username constraint. This fix is needed for the broken integration that is underway', '2025-12-11') THEN
5+
BEGIN
6+
ALTER TABLE IF EXISTS public.users
7+
DROP CONSTRAINT users_username_key;
8+
END;
9+
END IF;
10+
END;
11+
$$

apps/backend/docker-compose-stfc.e2e.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
clam-antivirus:
3-
image: clamav/clamav:0.104
3+
image: clamav/clamav:1.5.1
44
ports:
55
- "3310:3310"
66

@@ -40,13 +40,13 @@ services:
4040
- "4500:4500"
4141
cap_add:
4242
- SYS_ADMIN
43-
43+
4444
mockServer:
4545
image: mockserver/mockserver:5.13.0
4646
command: -logLevel ERROR -serverPort 1080
4747
ports:
4848
- 1080:1080
49-
49+
5050
mockserver-client:
5151
image: "ghcr.io/userofficeproject/stfc-mockserver-client:master"
5252
command: sh -c "sleep 5 && node src/mockserver.js"

apps/backend/package-lock.json

Lines changed: 122 additions & 41 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"dataloader": "^2.2.2",
6060
"dotenv": "^16.4.5",
6161
"email-templates": "^11.1.1",
62-
"express": "^4.21.1",
62+
"express": "^4.22.1",
6363
"express-jwt": "^6.1.2",
6464
"graphql": "^16.8.1",
6565
"graphql-request": "^6.1.0",

apps/backend/src/datasources/ReviewDataSource.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,16 @@ export interface ReviewDataSource {
2121
userId?: number,
2222
callId?: number,
2323
instrumentId?: number,
24-
submitted?: number
24+
submitted?: number,
25+
active?: boolean
2526
): Promise<Review[]>;
2627
getAllUsersReviews(
2728
fapIds: number[],
2829
userId?: number,
2930
callId?: number,
3031
instrumentId?: number,
31-
submitted?: number
32+
submitted?: number,
33+
active?: boolean
3234
): Promise<Review[]>;
3335
getAssignmentReview(
3436
fapId: number,

apps/backend/src/datasources/postgres/ReviewDataSource.ts

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,8 @@ export default class PostgresReviewDataSource implements ReviewDataSource {
349349
userId?: number,
350350
callId?: number,
351351
instrumentId?: number,
352-
status?: ReviewStatus
352+
status?: ReviewStatus,
353+
active?: boolean
353354
): Promise<Review[]> {
354355
return database
355356
.select()
@@ -378,6 +379,16 @@ export default class PostgresReviewDataSource implements ReviewDataSource {
378379
if (status !== undefined && status !== null) {
379380
qb.where('fap_reviews.status', status);
380381
}
382+
383+
if (active) {
384+
qb.join('proposals', {
385+
'proposals.proposal_pk': 'fap_reviews.proposal_pk',
386+
});
387+
qb.join('call', {
388+
'call.call_id': 'proposals.call_id',
389+
});
390+
qb.where('call.call_fap_review_ended', false);
391+
}
381392
})
382393
.whereIn('fap_id', fapIds)
383394
.distinctOn('fap_reviews.proposal_pk')
@@ -414,7 +425,8 @@ export default class PostgresReviewDataSource implements ReviewDataSource {
414425
userId?: number,
415426
callId?: number,
416427
instrumentId?: number,
417-
status?: ReviewStatus
428+
status?: ReviewStatus,
429+
active?: boolean
418430
): Promise<Review[]> {
419431
return database
420432
.select('fapReviewsTemp.*')
@@ -440,6 +452,16 @@ export default class PostgresReviewDataSource implements ReviewDataSource {
440452
if (status !== null && status !== undefined) {
441453
qb.where('fap_reviews.status', status);
442454
}
455+
456+
if (active) {
457+
qb.join('proposals', {
458+
'proposals.proposal_pk': 'fap_reviews.proposal_pk',
459+
});
460+
qb.join('call', {
461+
'call.call_id': 'proposals.call_id',
462+
});
463+
qb.where('call.call_fap_review_ended', false);
464+
}
443465
})
444466
.whereIn('fap_id', fapIds)
445467
.as('fapReviewsTemp')

apps/backend/src/datasources/stfc/StfcUserDataSource.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,6 +779,8 @@ export class StfcUserDataSource implements UserDataSource {
779779
async getApprovedProposalVisitorsWithInstitution(
780780
proposalPk: number
781781
): Promise<{ user: User; institution: Institution; country: Country }[]> {
782-
throw new Error('Method not implemented.');
782+
return await postgresUserDataSource.getApprovedProposalVisitorsWithInstitution(
783+
proposalPk
784+
);
783785
}
784786
}

apps/backend/src/eventHandlers/messageBroker.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ export const getProposalMessageData = async (proposal: Proposal) => {
130130

131131
const proposalUsersWithInstitution =
132132
await userDataSource.getProposalUsersWithInstitution(proposal.primaryKey);
133-
134133
const dataAccessUsersWithInstitution =
135134
await dataAccessUsersDataSource.getDataAccessUsersWithInstitution(
136135
proposal.primaryKey

0 commit comments

Comments
 (0)