This repository was archived by the owner on Jan 14, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
[ORCT-192] update legacy endpoint to handle migrated flags #233
Merged
xsalonx
merged 30 commits into
master
from
improvement/ORCT-192/update-legacy-endpoint-to-handle-migrated-flags
Oct 11, 2023
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
e5588f0
update get_run_det_data function
xsalonx 1c6c914
adjust forntend to new api
xsalonx 4f06acd
refactor flags view
xsalonx 0c07959
refactor
xsalonx 6334293
amend escaping
xsalonx b3c70d5
verification display amendment
xsalonx f409f9a
remove dead code
xsalonx 029df9c
Merge branch 'master' into improvement/ORCT-192/update-legacy-endpoin…
xsalonx cd25622
structurize flags summary
xsalonx b4a80ae
return correct timestamps for entire qcf's
xsalonx d377c9b
add timestamp for flags_view
xsalonx c7660d0
add color for good
xsalonx c1f8d30
handle no qc data
xsalonx 693a783
display no qc data
xsalonx a9bdf43
differentiate between synchronous and asynchronus flags
xsalonx dc3cc47
Merge branch 'master' into improvement/ORCT-192/update-legacy-endpoin…
xsalonx 3278fef
refactor
xsalonx 2ce9228
Merge branch 'master' into improvement/ORCT-192/update-legacy-endpoin…
xsalonx bf73d13
replace shortcuts
xsalonx 89b001e
remove problematic data
xsalonx d37a4d4
amend invalid date
xsalonx e94f90e
apply the same formatting for verification time:
xsalonx fd752e2
use css instead of text objects
xsalonx 31ce9d4
css
xsalonx bdb8310
refactor
xsalonx e6eca24
refactor
xsalonx 72fd3e1
refactor
xsalonx f427ff9
simplify method and add docs
xsalonx eb69693
Merge branch 'master' into improvement/ORCT-192/update-legacy-endpoin…
xsalonx cb7abb0
refactor ternary operator
xsalonx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
58 changes: 49 additions & 9 deletions
58
database/stored-sql-functionalities/functions/get_run_det_data.sql
This file contains hidden or 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 |
|---|---|---|
| @@ -1,17 +1,57 @@ | ||
| CREATE or REPLACE FUNCTION get_run_det_data( | ||
| _run_number bigint, | ||
| _detector_name varchar | ||
| _detector_name varchar, | ||
| _data_pass_name varchar | ||
| ) | ||
| returns varchar | ||
|
|
||
| returns json | ||
| LANGUAGE plpgsql | ||
| AS $body$ | ||
| DECLARE ret varchar:= null; | ||
| DECLARE ret json:= null; | ||
|
|
||
| BEGIN | ||
| SELECT rd.quality INTO ret -- TODO | ||
| FROM runs_detectors AS rd | ||
| INNER JOIN detectors_subsystems AS ds | ||
| ON rd.detector_id = ds.id | ||
| WHERE rd.run_number = _run_number AND ds.name = _detector_name; | ||
| return ret::varchar; | ||
|
|
||
| raise notice 'data: % % %', _data_pass_name, _run_number, _detector_name; | ||
|
|
||
| SELECT json_build_object( | ||
| 'qcf', qcf, | ||
| 'qcf_bkp', qcf_bkp | ||
| ) INTO ret FROM (SELECT | ||
|
|
||
| (SELECT json_build_object( | ||
| 'id', qcf.id, | ||
| 'quality', lower(ftd.name) | ||
| ) | ||
| FROM | ||
| quality_control_flags AS qcf | ||
| INNER JOIN flag_types_dictionary AS ftd | ||
| ON ftd.id = qcf.flag_type_id | ||
| INNER JOIN data_passes as dp | ||
| ON dp.id = qcf.data_pass_id | ||
| INNER JOIN detectors_subsystems as ds | ||
| ON ds.id = qcf.detector_id | ||
| WHERE | ||
| dp.name = _data_pass_name AND | ||
| ds.name = _detector_name AND | ||
| qcf.run_number = _run_number | ||
| ORDER BY qcf.updated_at DESC | ||
| LIMIT 1 | ||
| ) as qcf | ||
| , | ||
|
|
||
| (SELECT json_build_object( | ||
| 'quality', rd.quality | ||
| ) | ||
| FROM runs_detectors AS rd | ||
| INNER JOIN detectors_subsystems AS ds | ||
| ON rd.detector_id = ds.id | ||
| WHERE | ||
| rd.run_number = _run_number AND | ||
| ds.name = _detector_name | ||
| ) as qcf_bkp | ||
|
|
||
| ) as subq; | ||
|
|
||
| return ret; | ||
| END; | ||
| $body$; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.