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

Missing "onClick" prop in @verdaccio/ui-components Link component preventing handleDownload call in Package.tsx #3988

Closed
1 task done
moglerdev opened this issue Aug 24, 2023 · 4 comments

Comments

@moglerdev
Copy link
Contributor

Your Environment

  • verdaccio version: 7.x.x (see PR)
  • node version: 18.x.x
  • package manager: pnpm@8
  • os: linux
  • platform: other

Describe the bug

At present, attempting to download the "tar" file from the Package List on the homepage does not work as expected. Clicking on the link only opens a new tab, but no download action occurs.

The root cause of this problem lies in the Link Component within @verdaccio/ui-components. It lacks a necessary onClick prop, preventing the execution of the handleDownload function in Package.tsx.

To Reproduce

  • Step 1: After publishing a package (if the list is empty) and potentially reloading the page, you navigate to a package's details page.
  • Step 2: On this page, you click the "Download tar" (Download Icon)
  • Step 3: Instead of initiating the download, a new tab opens, and the URL has a "#" appended to it.

Expected behavior

Should download the latest tar file of the selected package.

Screenshots, server logs, package manager log

Package.tsx try to create the Component Link with property onClick

image

Problem, there is nor supported prop onClick in Link

image

Configuration File (cat ~/.config/verdaccio/config.yaml)

Environment information

Debugging output

  • $ NODE_DEBUG=request verdaccio display request calls (verdaccio <--> uplinks)
  • $ DEBUG=verdaccio* verdaccio enable extreme verdaccio debug mode (verdaccio api)
  • $ npm -ddd prints:
  • $ npm config get registry prints:

Contribute to Verdaccio

  • I'm willing to fix this bug 🥇
@moglerdev
Copy link
Contributor Author

#3989 PR to fix this issue

juanpicado pushed a commit that referenced this issue Aug 24, 2023
…venting handleDownload call in Package.tsx #3988 (#3989)

* fix: Add onClick handler in Link component
In the "Link" component, the onClick handler was not provided,
leading to the absence of a download action in the Package.tsx
renderDownloadLink component.

* Removed "external" attribute from "renderDownloadLink"
The "external" attribute is unnecessary in this context
since the download action is triggered by the "handleDownload" callback.

* added changeset for @verdaccio/ui-components
@moglerdev
Copy link
Contributor Author

Hey @juanpicado,
At the moment, the fix is functional exclusively for version 7.x, with versions 5.x and 6.x remaining unaffected. Should the dependency be adjusted for broader compatibility?

6.x "@verdaccio/ui-theme": "6.0.0-6-next.74",
5.x "@verdaccio/ui-theme": "6.0.0-6-next.74",

current version 7.0.0-next.1

@juanpicado
Copy link
Member

I will update all versions this weekend. 6.x is same as 5.x just need it to bump up to get rid of node 12

juanpicado added a commit that referenced this issue Aug 26, 2023
update core dependencies (7.x) no breaking changes, just internal bump up to prepare a major release (6.x)
🐛 fix fix: local search keyword undefined errors #3992
🐛 fix Missing "onClick" prop in @verdaccio/ui-components Link component preventing handleDownload call in Package.tsx #3988 #3989
@juanpicado
Copy link
Member

v5.26.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants