-
-
Notifications
You must be signed in to change notification settings - Fork 471
feat: add copy button for package versions #1447
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
Changes from 1 commit
868828e
cf17853
c3f5621
676e301
c5fce83
cdc7f39
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -246,6 +246,12 @@ const { copied: copiedPkgName, copy: copyPkgName } = useClipboard({ | |
| copiedDuring: 2000, | ||
| }) | ||
|
|
||
| //copy package name | ||
| const { copied: copiedVersion, copy: copyVersion } = useClipboard({ | ||
| source: resolvedVersion.value ?? '', | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In which case there is no value? Maybe we should just not show the copy button when it happens.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought this was already the case? This is why I encapsulated it in the version span .
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh right |
||
| copiedDuring: 2000, | ||
| }) | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
|
|
||
| // Fetch dependency analysis (lazy, client-side) | ||
| // This is the same composable used by PackageVulnerabilityTree and PackageDeprecatedTree | ||
| const { data: vulnTree, status: vulnTreeStatus } = useDependencyAnalysis( | ||
|
|
@@ -716,7 +722,17 @@ const showSkeleton = shallowRef(false) | |
| dir="ltr" | ||
| >{{ resolvedVersion }}</LinkBase | ||
| > | ||
| <span dir="ltr" v-else>v{{ resolvedVersion }}</span> | ||
| <span dir="ltr" v-else class="inline-flex items-center gap-1" | ||
| >v{{ resolvedVersion }} | ||
|
|
||
| <ButtonBase | ||
| size="small" | ||
| class="opacity-50 hover:opacity-100 transition-opacity" | ||
| :classicon="copiedVersion ? 'i-carbon:checkmark' : 'i-carbon:copy'" | ||
| :title="copiedVersion ? $t('common.copied') : $t('package.copy_version')" | ||
| @click="copyVersion()" | ||
| /> | ||
| </span> | ||
|
|
||
| <template v-if="hasProvenance(displayVersion)"> | ||
| <TooltipApp | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.