diff --git a/app/components/Package/Versions.vue b/app/components/Package/Versions.vue index 491346b1b..e9024a51b 100644 --- a/app/components/Package/Versions.vue +++ b/app/components/Package/Versions.vue @@ -306,6 +306,18 @@ function getTagVersions(tag: string): VersionDisplay[] { :title="$t('package.versions.title')" id="versions" > +
diff --git a/i18n/locales/en.json b/i18n/locales/en.json index f6712fd8e..9095a1004 100644 --- a/i18n/locales/en.json +++ b/i18n/locales/en.json @@ -272,6 +272,7 @@ "date_range": "{start} to {end}", "date_range_multiline": "{start}\nto {end}", "analyze": "Analyze downloads", + "community_distribution": "View community adoption distribution", "modal_title": "Downloads", "granularity": "Granularity", "granularity_daily": "Daily", diff --git a/lunaria/files/en-GB.json b/lunaria/files/en-GB.json index fee71b9c9..b4817583e 100644 --- a/lunaria/files/en-GB.json +++ b/lunaria/files/en-GB.json @@ -272,6 +272,7 @@ "date_range": "{start} to {end}", "date_range_multiline": "{start}\nto {end}", "analyze": "Analyze downloads", + "community_distribution": "View community adoption distribution", "modal_title": "Downloads", "granularity": "Granularity", "granularity_daily": "Daily", diff --git a/lunaria/files/en-US.json b/lunaria/files/en-US.json index f6712fd8e..9095a1004 100644 --- a/lunaria/files/en-US.json +++ b/lunaria/files/en-US.json @@ -272,6 +272,7 @@ "date_range": "{start} to {end}", "date_range_multiline": "{start}\nto {end}", "analyze": "Analyze downloads", + "community_distribution": "View community adoption distribution", "modal_title": "Downloads", "granularity": "Granularity", "granularity_daily": "Daily", diff --git a/test/nuxt/components/PackageVersions.spec.ts b/test/nuxt/components/PackageVersions.spec.ts index ef2f3e7da..0853d1b3d 100644 --- a/test/nuxt/components/PackageVersions.spec.ts +++ b/test/nuxt/components/PackageVersions.spec.ts @@ -73,10 +73,10 @@ describe('PackageVersions', () => { }, }) - // Find version links (exclude anchor links that start with #) + // Find version links (exclude anchor links that start with # and external links) const versionLinks = component .findAll('a') - .filter(a => !a.attributes('href')?.startsWith('#')) + .filter(a => !a.attributes('href')?.startsWith('#') && a.attributes('target') !== '_blank') expect(versionLinks.length).toBeGreaterThan(0) expect(versionLinks[0]?.text()).toBe('2.0.0') }) @@ -93,10 +93,10 @@ describe('PackageVersions', () => { }, }) - // Find version links (exclude anchor links that start with #) + // Find version links (exclude anchor links that start with # and external links) const versionLinks = component .findAll('a') - .filter(a => !a.attributes('href')?.startsWith('#')) + .filter(a => !a.attributes('href')?.startsWith('#') && a.attributes('target') !== '_blank') expect(versionLinks.length).toBeGreaterThan(0) expect(versionLinks[0]?.text()).toBe('1.0.0') }) @@ -187,10 +187,10 @@ describe('PackageVersions', () => { }, }) - // Find version links (exclude anchor links that start with #) + // Find version links (exclude anchor links that start with # and external links) const versionLinks = component .findAll('a') - .filter(a => !a.attributes('href')?.startsWith('#')) + .filter(a => !a.attributes('href')?.startsWith('#') && a.attributes('target') !== '_blank') const versions = versionLinks.map(l => l.text()) // Should be sorted by version descending expect(versions[0]).toBe('2.0.0') @@ -210,10 +210,10 @@ describe('PackageVersions', () => { }, }) - // Find version links (exclude anchor links that start with #) + // Find version links (exclude anchor links that start with # and external links) const versionLinks = component .findAll('a') - .filter(a => !a.attributes('href')?.startsWith('#')) + .filter(a => !a.attributes('href')?.startsWith('#') && a.attributes('target') !== '_blank') expect(versionLinks.length).toBeGreaterThan(0) expect(versionLinks[0]?.classes()).toContain('text-red-400') }) @@ -230,10 +230,10 @@ describe('PackageVersions', () => { }, }) - // Find version links (exclude anchor links that start with #) + // Find version links (exclude anchor links that start with # and external links) const versionLinks = component .findAll('a') - .filter(a => !a.attributes('href')?.startsWith('#')) + .filter(a => !a.attributes('href')?.startsWith('#') && a.attributes('target') !== '_blank') expect(versionLinks.length).toBeGreaterThan(0) expect(versionLinks[0]?.attributes('title')).toContain('deprecated') }) @@ -562,10 +562,10 @@ describe('PackageVersions', () => { }, }) - // Count visible version links (excluding anchor links that start with #) + // Count visible version links (excluding anchor links that start with # and external links) const visibleLinks = component .findAll('a') - .filter(a => !a.attributes('href')?.startsWith('#')) + .filter(a => !a.attributes('href')?.startsWith('#') && a.attributes('target') !== '_blank') // Should have max 10 visible links in the main section expect(visibleLinks.length).toBeLessThanOrEqual(10) })