-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into 913-add-search-by-name-and-email
- Loading branch information
Showing
16 changed files
with
274 additions
and
20 deletions.
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
apps/backend/db_patches/0163_ExcludeExpiredProposalsFromReviewProposalView.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
DO | ||
$$ | ||
BEGIN | ||
IF register_patch('0163_ExcludeExpiredProposalsFromReviewProposalView.sql', 'Thomas Cottee Meldrum', 'Exclude expired proposals from view', '2024-09-05') THEN | ||
|
||
CREATE OR REPLACE VIEW review_data AS | ||
SELECT proposal.proposal_pk, | ||
proposal.proposal_id, | ||
proposal.title, | ||
proposal.instrument_name, | ||
proposal.availability_time, | ||
proposal.time_allocation, | ||
proposal.fap_id, | ||
proposal.rank_order, | ||
proposal.call_id, | ||
proposal.proposer_id, | ||
proposal.instrument_id, | ||
proposal.fap_time_allocation, | ||
proposal.questionary_id, | ||
grade.avg AS average_grade, | ||
proposal.comment | ||
from ( | ||
Select | ||
fp.proposal_pk, | ||
p.proposal_id, | ||
p.title, | ||
i.name as instrument_name, | ||
chi.availability_time, | ||
tr.time_allocation, | ||
f.fap_id, | ||
fmd.rank_order, | ||
c.call_id, | ||
p.proposer_id, | ||
i.instrument_id, | ||
fp.fap_time_allocation, | ||
p.questionary_id, | ||
tr.comment | ||
from fap_proposals as fp | ||
join faps as f on f.fap_id = fp.fap_id | ||
join call c on c.call_id = fp.call_id | ||
join proposals p on p.proposal_pk = fp.proposal_pk | ||
join technical_review tr on tr.proposal_pk = p.proposal_pk and tr.instrument_id = fp.instrument_id | ||
left join fap_meeting_decisions as fmd on fmd.proposal_pk = p.proposal_pk | ||
join call_has_instruments as chi on chi.instrument_id = fp.instrument_id and chi.call_id = c.call_id | ||
join instruments as i on i.instrument_id = chi.instrument_id | ||
where p.status_id <> 9 and p.status_id <> 1 /* EXPIRED OR DRAFT*/ | ||
) as proposal | ||
left join ( | ||
Select fr.proposal_pk, AVG(fr.grade) from | ||
fap_proposals as fp | ||
join fap_reviews as fr on fr.proposal_pk = fp.proposal_pk | ||
group by fr.proposal_pk | ||
) as grade on grade.proposal_pk = proposal.proposal_pk; | ||
END IF; | ||
END; | ||
$$ | ||
LANGUAGE plpgsql; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
DO | ||
$$ | ||
BEGIN | ||
IF register_patch('AllowSecsEditTechReview.sql', 'TCMeldrum', 'Allow Fap Secretaries to Edit Tech Reviews', '2024-10-07') THEN | ||
BEGIN | ||
|
||
INSERT INTO settings(settings_id, description) | ||
VALUES ('FAP_SECS_EDIT_TECH_REVIEWS', | ||
'Allows Fap secretaries to edit technical reviews' | ||
); | ||
|
||
END; | ||
END IF; | ||
END; | ||
$$ | ||
LANGUAGE plpgsql; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[ | ||
{ | ||
"Proposal Reference Number": "567122", | ||
"Proposal Title": "lumen proofread hertz", | ||
"Principal Investigator": "Carl Carlsson", | ||
"Instrument": "Central lavender", | ||
"Instrument available time": 20, | ||
"Technical review allocated time": 25, | ||
"Fap allocated time": 25, | ||
"Average Score": 3, | ||
"Current rank": "<missing>", | ||
"Is in availability zone": "no" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.