Skip to content

Remove download when html file#11227

Merged
Siedlerchr merged 8 commits into
mainfrom
fixhtmldownload
Apr 29, 2024
Merged

Remove download when html file#11227
Siedlerchr merged 8 commits into
mainfrom
fixhtmldownload

Conversation

@Siedlerchr

@Siedlerchr Siedlerchr commented Apr 20, 2024

Copy link
Copy Markdown
Member

Fixes #10149

Mandatory checks

  • Change in CHANGELOG.md described in a way that is understandable for the average user (if applicable)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

@Siedlerchr Siedlerchr added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Apr 20, 2024
@Siedlerchr Siedlerchr enabled auto-merge April 20, 2024 16:05
dialogService.notify(Localization.lang("Download was a HTML file. Not adding it."));
List<LinkedFile> newFiles = new ArrayList<>(entry.getFiles());
newFiles.remove(linkedFile);
entry.setFiles(newFiles);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am not sure about this one if there are multiple files attached and only one leads to HTML. Need to see the full source.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm only removing the current linked File from he current download.
I am getting all existing files from the entry and just remove the current one
To trigger change detection I have to reassign the list

@koppor

koppor commented Apr 24, 2024

Copy link
Copy Markdown
Member

This is a hard issue.

Test entry:

@Article{,
  file = {https://github.com/JabRef/jabref/issues/10149},
}

Click on "download File"

image

Then, the whole link is removed:

image


When executing the steps from #10149 (comment), there are two URLs shown in the file dialog:

image

They are removed shortly after.


I am working on a fix.

@koppor koppor removed the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Apr 24, 2024
@koppor

koppor commented Apr 24, 2024

Copy link
Copy Markdown
Member

Fixed 8398d8e (#11227)

@koppor koppor added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Apr 24, 2024
@Siedlerchr Siedlerchr added this pull request to the merge queue Apr 29, 2024
@github-actions

github-actions Bot commented Apr 29, 2024

Copy link
Copy Markdown
Contributor

The build for this PR is no longer available. Please visit https://builds.jabref.org/main/ for the latest build.

Merged via the queue into main with commit 9f2418b Apr 29, 2024
@Siedlerchr Siedlerchr deleted the fixhtmldownload branch April 29, 2024 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Download linked file" option creates an html file instead of downloading the pdf on Windows 10.

2 participants