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

Preview the output data in tabular format before downloading fixing (Issue#76) #97

Closed
wants to merge 3 commits into from

Conversation

mkalal6
Copy link
Collaborator

@mkalal6 mkalal6 commented Nov 11, 2024

Fixes #76

What was changed?

The preview functionality was added to the /temp page of the application, specifically within the DraftOrcaDashboard component. A new "Preview" button was introduced before the "Download Output" button to allow users to view a preview of the output data before downloading. A modal window was also implemented to display the preview content when the user clicks "Preview."

Why was it changed?

This change addresses a need for users to preview data before downloading it, ensuring they can verify the output format and content. The addition of this preview functionality improves user experience by reducing the need to repeatedly download files to check their contents.

How was it changed?

The following modifications were made:

- In DraftOrcaDashboard.js, added a new state variable showPreviewModal to manage the display of the modal window.
- Implemented the fetchDocumentPreview function, which sends a POST request to the /preview endpoint with appropriate parameters (e.g., file_path, search_terms, sections, and specify_lines).
- Added a "Preview" button in the JSX return statement, right before the "Download Output" button.
- Created a modal layout that appears when showPreviewModal is set to true. This modal displays the preview content in a formatted manner, using the previewContent state to hold the data returned by the /preview endpoint.

This change required modifying DraftOrcaDashboard.js to integrate the new button and modal display, along with adjustments to the data formatting to align with backend expectations, ensuring compatibility with the /preview endpoint.

Note
This issue is still in progress

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.

Ensure that all the main changes have been pulled into the new branch and rerun to test if it fixes error.

@mkalal6
Copy link
Collaborator Author

mkalal6 commented Nov 18, 2024

This PR can be closed as a new one was made with a new branch to complete this task.

@mkalal6 mkalal6 marked this pull request as ready for review November 18, 2024 21:45
@SiriChandanaGarimella
Copy link
Collaborator

Closing this PR as it is a duplicate of #101

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.

Preview the output data in tabular format before downloading
2 participants