-
Notifications
You must be signed in to change notification settings - Fork 14
[OGUI-1783] Backend download post request #3139
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
base: dev
Are you sure you want to change the base?
Conversation
|
Writing more tests and licenses.... |
|
The GitHub actions is back to the point where I need to run it three times for it to succeed... It has trouble with the runsmode tests. |
|
look at: QualityControl/common/library/typedef/TabObject.js existing typedefs |
| export async function download(downloadLayout, downloadConfiguration, runNumber, res) { | ||
| switch (downloadConfiguration.downloadMode) { | ||
| case DownloadMode.object: | ||
| let file = new File([], ''); |
Check warning
Code scanning / CodeQL
Useless assignment to local variable Warning
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 1 month ago
To fix the issue, simply remove the unnecessary initial assignment to file at line 49. The variable file can be declared with let but without initializing to any value, since both branches immediately assign to it before use. Specifically, change let file = new File([], ''); to let file;. No further changes are required. No new imports or definitions are necessary.
*File to edit: QualityControl/lib/utils/download/downloadEngine.js
*Region to edit: line 49, inside the DownloadMode.object case, where file is declared.
-
Copy modified line R49
| @@ -46,7 +46,7 @@ | ||
| export async function download(downloadLayout, downloadConfiguration, runNumber, res) { | ||
| switch (downloadConfiguration.downloadMode) { | ||
| case DownloadMode.object: | ||
| let file = new File([], ''); | ||
| let file; | ||
| const objects = downloadLayout.tabs.flatMap((tab) => tab.objects.filter((object) => downloadConfiguration.objectIds.includes(object.id))); | ||
| if (objects.length > 1) { | ||
| // Multiple objects requested |
I have JIRA issue created
Add one controller endpoint for handling a post request containing the json skelaton of the layout. This data can then be used to download the right objects/tabs in a later pull request containing the other endpoint (GET for the download).
This is needed because we need the data the user is seeing on their screen at the moment they click the download button. The domain models contain all data I need from the layout excluding the data in the query parameters of the GET request. This can be seen in DownloadConfigDomain.js
This pr does not contain the code needed to do the actual downloading of the objects/tabs.