Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion app/pages/package/[[org]]/[name].vue
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,12 @@ const { copied: copiedPkgName, copy: copyPkgName } = useClipboard({
copiedDuring: 2000,
})

//copy package name
Comment thread
ghostdevv marked this conversation as resolved.
Outdated
const { copied: copiedVersion, copy: copyVersion } = useClipboard({
source: resolvedVersion.value ?? '',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The 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 .

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oh right

copiedDuring: 2000,
})
Comment thread
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(
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
"view_permalink": "View permalink for this version",
"navigation": "Package",
"copy_name": "Copy package name",
"copy_version": "Copy package version",
"deprecation": {
"package": "This package has been deprecated.",
"version": "This version has been deprecated.",
Expand Down
3 changes: 3 additions & 0 deletions i18n/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,9 @@
"copy_name": {
"type": "string"
},
"copy_version": {
"type": "string"
},
"deprecation": {
"type": "object",
"properties": {
Expand Down
1 change: 1 addition & 0 deletions lunaria/files/en-GB.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@
"view_permalink": "View permalink for this version",
"navigation": "Package",
"copy_name": "Copy package name",
"copy_version": "Copy package version",
"deprecation": {
"package": "This package has been deprecated.",
"version": "This version has been deprecated.",
Expand Down
1 change: 1 addition & 0 deletions lunaria/files/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@
"view_permalink": "View permalink for this version",
"navigation": "Package",
"copy_name": "Copy package name",
"copy_version": "Copy package version",
"deprecation": {
"package": "This package has been deprecated.",
"version": "This version has been deprecated.",
Expand Down
Loading