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

File path handling in search query input on /temp route Fixes (#62) #94

Merged
merged 8 commits into from
Nov 4, 2024

Conversation

mkalal6
Copy link
Collaborator

@mkalal6 mkalal6 commented Oct 27, 2024

Fixes #62

What was changed?

The changes were made in the file upload within the DraftOrcaDashboard component. Specifically, the onUpload and onSubmit functions were modified to capture and use the full file path for uploaded files rather than just the file name. Adjustments were also made to ensure that the specify_lines parameter is correctly formatted for the request payload.

Why was it changed?

This update was intended to address an issue where the system was incorrectly using only the file name instead of the full file path, causing discrepancies in file handling between routes. By ensuring the full file path is stored and used, this change aims to improve consistency and accuracy in file handling, especially in cases where the file path is essential for backend processing.

How was it changed?

onFileSelected: Modified this function to set fileName with the full file path and ensured it was compatible with windows.

onUpload: Updated onUpload to set fileName to the full path returned by the backend (response.data.filename). This change allows fileName to store the full path, which is required in the payload.

onSubmit: Updated the onSubmit function to use fileName (now containing the full file path) in the file_path field of the request payload.

Copy link
Collaborator Author

@mkalal6 mkalal6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should have only committed the DraftOrcaDashboard file. Good completion of the issue but can make sure that two of the lines are also compatible with windows.

client-app/src/components/DraftOrcaDashboard.js Outdated Show resolved Hide resolved
client-app/src/components/DraftOrcaDashboard.js Outdated Show resolved Hide resolved
server/ven/bin/Activate.ps1 Outdated Show resolved Hide resolved
server/ven/bin/pytest Outdated Show resolved Hide resolved
server/ven/bin/Activate.ps1 Outdated Show resolved Hide resolved
server/ven/pyvenv.cfg Outdated Show resolved Hide resolved
@mkalal6 mkalal6 changed the title File path handling in search query input on /temp route Fixing (#62) File path handling in search query input on /temp route Fixes (#62) Oct 29, 2024
Copy link
Collaborator

@SiriChandanaGarimella SiriChandanaGarimella left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mkalal6 - Great work! As discussed, I updated the /upload API response to provide file_name and file_path. Here’s the updated sample response:

{
    "message": "Success",
    "file_name": "Styrene-H.txt",
    "file_path": "/Users/.../esp/server/instance/uploads/Styrene-H.txt"
}

Added the inline comments wherever it is necessary to update the code. Please review and update accordingly.

client-app/src/components/DraftOrcaDashboard.js Outdated Show resolved Hide resolved
client-app/src/components/DraftOrcaDashboard.js Outdated Show resolved Hide resolved
client-app/src/components/DraftOrcaDashboard.js Outdated Show resolved Hide resolved
@SiriChandanaGarimella SiriChandanaGarimella marked this pull request as ready for review November 4, 2024 20:43
Copy link
Collaborator

@SiriChandanaGarimella SiriChandanaGarimella left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm;

@SiriChandanaGarimella
Copy link
Collaborator

This fixes the issue #73 as well

@SiriChandanaGarimella SiriChandanaGarimella merged commit 27eb448 into main Nov 4, 2024
2 checks passed
@mkalal6 mkalal6 deleted the Issue#62 branch November 11, 2024 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix file path handling in search query input on /temp route
3 participants