-
Notifications
You must be signed in to change notification settings - Fork 16
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
238 - Integration single file download #240
238 - Integration single file download #240
Conversation
@MellyGray Please, can you resolve conflicts? |
…into feature/238-integration-single-file-download
@GPortas conflicts resolved, there's an e2e test failing but it's the one that it's going to be fixed with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tabular files work well for both original and archival formats. But when selecting RData the following error appears: {"status":"ERROR","code":404,"message":"datafile access error: requested optional service (image scaling, format conversion, etc.) could not be performed on this datafile."} Here is a recording: tabular.mov |
@GPortas The same error appears in JSF when trying to download a tabular file in RData format. I found this in the documentation:
I think we need to install R in the dev-env if we want to test that feature, although I don't think it's necessary since if the users install that option, it should work as expected |
@MellyGray In my opinion the download option in R format should not be rendered if R is not configured in Dataverse. To do this we could use a public setting that allows the SPA to know if R is configured in the Dataverse instance. It certainly happens that when testing JSF on my localhost, I see that the R option is available, although clicking it does nothing. I think this behavior should not be expected for the user. Even though JSF handles it this way, I think the SPA should use the approach I described above (conditional rendering based on a public setting). Maybe @scolapasta, @jggautier or @pdurbin can share their thoughts on this and if there is a reason that explains why it is done that way in JSF. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the way, I think the conditional rendering solution I described above should not block the PR at all. Whatever solution we propose, I would implement it in another issue.
For this PR I think we should catch the error that occurs (black screen) when clicking the R option, so that it does nothing (like in JSF) but doesn't break. @MellyGray
@GPortas I can't handle the error since it's an href. Besides, the same black screen behavior is happening in JSF, so I think it should be okay like this until we decide to implement hiding the RData option if R is not installed. Grabacion.de.pantalla.2023-12-12.a.las.14.08.49.movExtensive explanation: The way the download buttons are working now is that the frontend only adds an href property to the buttons, and the API is the one triggering the browser download because of the headers. So, if the API response doesn't contain the headers to trigger the download, the hyperlink works as a normal hyperlink and navigates the user to that API URI (black screen error). When I was reading the API docs there was something about 'errors to be downloaded as a file' so maybe the API should trigger the browser download and download the error message |
Yes, @BPeuch and probably others agree with you. That's almost exactly how he worded it: |
…file-download 238 - Integration single file download
What this PR does / why we need it:
This pull request establishes a connection between the file download buttons in the files table rows and the access API for downloading files.
Which issue(s) this PR closes:
Special notes for your reviewer:
The integration of files tabular data is currently under review:
As a result, the tabular files' download options won't appear identical to those in the JSF frontend until the aforementioned pull request is merged. Ideally, PR #227 should be merged into the develop branch before this one so that the tabular download options align with the JSF frontend.
Suggestions on how to test this:
Step 1: Run the development environment
npm I
cd packages/design-system && npm run build
cd ../../
.env
file such as the .env.example, with theVITE_DATAVERSE_BACKEND_URL=http://localhost:8000
variablecd dev-env
./run-env.sh unstable
Step 2: Test Dataset View mode with the implemented changes to download the files
?persistentId=doi:10.5072/FK2/LHGRHP&version=DRAFT
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
No
Is there a release notes update needed for this change?:
No
Additional documentation: