Skip to content

Commit 3d7d799

Browse files
authored
Merge branch 'main' into fix-compare-deps
2 parents 3a536fa + 74f04e9 commit 3d7d799

File tree

5 files changed

+27
-12
lines changed

5 files changed

+27
-12
lines changed

app/components/Package/Versions.vue

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,18 @@ function getTagVersions(tag: string): VersionDisplay[] {
306306
:title="$t('package.versions.title')"
307307
id="versions"
308308
>
309+
<template #actions>
310+
<a
311+
:href="`https://majors.nullvoxpopuli.com/q?packages=${packageName}`"
312+
target="_blank"
313+
rel="noopener noreferrer"
314+
class="text-fg-subtle hover:text-fg transition-colors duration-200 inline-flex items-center justify-center min-w-6 min-h-6 -m-1 p-1"
315+
:title="$t('package.downloads.community_distribution')"
316+
>
317+
<span class="i-carbon:load-balancer-network w-3.5 h-3.5" aria-hidden="true" />
318+
<span class="sr-only">{{ $t('package.downloads.community_distribution') }}</span>
319+
</a>
320+
</template>
309321
<div class="space-y-0.5 min-w-0">
310322
<!-- Dist-tag rows (limited to MAX_VISIBLE_TAGS) -->
311323
<div v-for="row in visibleTagRows" :key="row.id">

i18n/locales/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@
272272
"date_range": "{start} to {end}",
273273
"date_range_multiline": "{start}\nto {end}",
274274
"analyze": "Analyze downloads",
275+
"community_distribution": "View community adoption distribution",
275276
"modal_title": "Downloads",
276277
"granularity": "Granularity",
277278
"granularity_daily": "Daily",

lunaria/files/en-GB.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@
272272
"date_range": "{start} to {end}",
273273
"date_range_multiline": "{start}\nto {end}",
274274
"analyze": "Analyze downloads",
275+
"community_distribution": "View community adoption distribution",
275276
"modal_title": "Downloads",
276277
"granularity": "Granularity",
277278
"granularity_daily": "Daily",

lunaria/files/en-US.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@
272272
"date_range": "{start} to {end}",
273273
"date_range_multiline": "{start}\nto {end}",
274274
"analyze": "Analyze downloads",
275+
"community_distribution": "View community adoption distribution",
275276
"modal_title": "Downloads",
276277
"granularity": "Granularity",
277278
"granularity_daily": "Daily",

test/nuxt/components/PackageVersions.spec.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ describe('PackageVersions', () => {
7373
},
7474
})
7575

76-
// Find version links (exclude anchor links that start with #)
76+
// Find version links (exclude anchor links that start with # and external links)
7777
const versionLinks = component
7878
.findAll('a')
79-
.filter(a => !a.attributes('href')?.startsWith('#'))
79+
.filter(a => !a.attributes('href')?.startsWith('#') && a.attributes('target') !== '_blank')
8080
expect(versionLinks.length).toBeGreaterThan(0)
8181
expect(versionLinks[0]?.text()).toBe('2.0.0')
8282
})
@@ -93,10 +93,10 @@ describe('PackageVersions', () => {
9393
},
9494
})
9595

96-
// Find version links (exclude anchor links that start with #)
96+
// Find version links (exclude anchor links that start with # and external links)
9797
const versionLinks = component
9898
.findAll('a')
99-
.filter(a => !a.attributes('href')?.startsWith('#'))
99+
.filter(a => !a.attributes('href')?.startsWith('#') && a.attributes('target') !== '_blank')
100100
expect(versionLinks.length).toBeGreaterThan(0)
101101
expect(versionLinks[0]?.text()).toBe('1.0.0')
102102
})
@@ -187,10 +187,10 @@ describe('PackageVersions', () => {
187187
},
188188
})
189189

190-
// Find version links (exclude anchor links that start with #)
190+
// Find version links (exclude anchor links that start with # and external links)
191191
const versionLinks = component
192192
.findAll('a')
193-
.filter(a => !a.attributes('href')?.startsWith('#'))
193+
.filter(a => !a.attributes('href')?.startsWith('#') && a.attributes('target') !== '_blank')
194194
const versions = versionLinks.map(l => l.text())
195195
// Should be sorted by version descending
196196
expect(versions[0]).toBe('2.0.0')
@@ -210,10 +210,10 @@ describe('PackageVersions', () => {
210210
},
211211
})
212212

213-
// Find version links (exclude anchor links that start with #)
213+
// Find version links (exclude anchor links that start with # and external links)
214214
const versionLinks = component
215215
.findAll('a')
216-
.filter(a => !a.attributes('href')?.startsWith('#'))
216+
.filter(a => !a.attributes('href')?.startsWith('#') && a.attributes('target') !== '_blank')
217217
expect(versionLinks.length).toBeGreaterThan(0)
218218
expect(versionLinks[0]?.classes()).toContain('text-red-400')
219219
})
@@ -230,10 +230,10 @@ describe('PackageVersions', () => {
230230
},
231231
})
232232

233-
// Find version links (exclude anchor links that start with #)
233+
// Find version links (exclude anchor links that start with # and external links)
234234
const versionLinks = component
235235
.findAll('a')
236-
.filter(a => !a.attributes('href')?.startsWith('#'))
236+
.filter(a => !a.attributes('href')?.startsWith('#') && a.attributes('target') !== '_blank')
237237
expect(versionLinks.length).toBeGreaterThan(0)
238238
expect(versionLinks[0]?.attributes('title')).toContain('deprecated')
239239
})
@@ -562,10 +562,10 @@ describe('PackageVersions', () => {
562562
},
563563
})
564564

565-
// Count visible version links (excluding anchor links that start with #)
565+
// Count visible version links (excluding anchor links that start with # and external links)
566566
const visibleLinks = component
567567
.findAll('a')
568-
.filter(a => !a.attributes('href')?.startsWith('#'))
568+
.filter(a => !a.attributes('href')?.startsWith('#') && a.attributes('target') !== '_blank')
569569
// Should have max 10 visible links in the main section
570570
expect(visibleLinks.length).toBeLessThanOrEqual(10)
571571
})

0 commit comments

Comments
 (0)