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

feat!: Implementing OS-specific download buttons #2581

Open
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

plvzfq-rit
Copy link

@plvzfq-rit plvzfq-rit commented Nov 12, 2024

🔗 Linked issue

Partially fixes #2176

📚 Description

This pull request changes the download interface of the website. To detail, the old Download JabRef button is now changes based on the OS of the system (e.g., Windows, Mac, Linux). Windows should have buttons for .msi and .zip. For Linux, .deb, .rpm, and .tar.gz. For Mac (both arm64 and x86_64), .dmg and .pkg. Consequently, changes in the /download/[[os]] path was necessary to implement redirection (expansion from just ['win', 'mac', 'linux']

This pull request solves a user problem in which the web site automatically downloads a file which might not be apt for their package manager and or system architecture.

Original Implementation for Windows

image

New Implementation for Windows

image

New Implementation for Mac

image

New Implementation for Linux

image

@plvzfq-rit plvzfq-rit marked this pull request as ready for review November 12, 2024 15:28
@Siedlerchr
Copy link
Member

Sorry for the delay, looks good from my side!°

@koppor
Copy link
Member

koppor commented Dec 23, 2024

@tobiasdiez What is the status here? This PR seems to be a good preparation for a download-button for JabRef 6.0-alpha.

@koppor
Copy link
Member

koppor commented Dec 23, 2024

@plvzfq-rit I couldn't test. Can one download a macOS version on Windows? I didn't see an overview page on the screenshots.

@@ -22,15 +22,21 @@ definePageMeta({
middleware: async (to) => {
let downloadUrl = 'https://www.fosshub.com/JabRef.html'
const os = to.params.os as string | undefined
if (os && ['win', 'mac', 'linux'].includes(os)) {
if (os && ['win_msi', 'win_zip', 'mac_arm64_dmg', 'mac_arm64_pkg', 'mac_x86_64_dmg', 'mac_x86_64_pkg', 'linux_deb', 'linux_rpm', 'linux_tar_gz'].includes(os)) {
const { data } = await useFetch('/api/getLatestRelease')
Copy link
Member

Choose a reason for hiding this comment

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

We are in the process of phasing out fosshub, can you change it to github release?

Copy link
Author

Choose a reason for hiding this comment

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

I'll see what I could do+

Copy link
Author

Choose a reason for hiding this comment

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

Hi @Siedlerchr, just finished migrating the links from Fosshub to GitHub Release. There have been troubles on my end though with the useFetch function for some reason that I'm not sure of; this hinders me from fully checking if the implementation's good or not. Using it at the moment in my branch yields an undefined value. I checked the response attained by the function and it said that I had bad credentials. Investigating further led me to see that I do not have a GITHUB_REPO_TOKEN attribute in my .env file. Should I perhaps put a personal GitHub token in the .env file for testing purposes?

For now though, I'll try to work on the overview page. Much thanks!

@plvzfq-rit
Copy link
Author

@koppor, unfortunately, as far as I have implemented it, there would not be a way for a Windows user to download a macOS package, aside from downloading it directly from the fosshub page upon redirect (will be changing it to the GitHub in the coming days). I was planning on adding that functionality more explicitly in a later pull request (creating an overview page / a page listing download links for the latest version of each OS/architecture), as I had discussed with @tobiasdiez . Should I perhaps include it within this pull request or continue to have it be in a different one?

@plvzfq-rit
Copy link
Author

Just found a bug which affected the href's in the buttons. Should be fixed now though. Apologies for the inconvenience;;;

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.

The download link on Linux automatically downloads a Debian package, whether the user wants it or not
3 participants