Skip to content

Commit 51e7eb9

Browse files
Nadjaroemerautofix-ci[bot]
authored andcommitted
fix: show "none" if package has no license (npmx-dev#656)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 820a438 commit 51e7eb9

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

app/pages/[...package].vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -743,12 +743,13 @@ function handleClick(event: MouseEvent) {
743743
<dl
744744
class="grid grid-cols-2 sm:grid-cols-11 gap-3 sm:gap-4 py-4 sm:py-6 mt-4 sm:mt-6 border-t border-b border-border"
745745
>
746-
<div v-if="pkg.license" class="space-y-1 sm:col-span-2">
746+
<div class="space-y-1 sm:col-span-2">
747747
<dt class="text-xs text-fg-subtle uppercase tracking-wider">
748748
{{ $t('package.stats.license') }}
749749
</dt>
750750
<dd class="font-mono text-sm text-fg">
751-
<LicenseDisplay :license="pkg.license" />
751+
<LicenseDisplay v-if="pkg.license" :license="pkg.license" />
752+
<span v-else>{{ $t('package.license.none') }}</span>
752753
</dd>
753754
</div>
754755

i18n/locales/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,8 @@
298298
"no_types": "No TypeScript types"
299299
},
300300
"license": {
301-
"view_spdx": "View license text on SPDX"
301+
"view_spdx": "View license text on SPDX",
302+
"none": "None"
302303
},
303304
"vulnerabilities": {
304305
"no_description": "No description available",

lunaria/files/en-US.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,8 @@
298298
"no_types": "No TypeScript types"
299299
},
300300
"license": {
301-
"view_spdx": "View license text on SPDX"
301+
"view_spdx": "View license text on SPDX",
302+
"none": "None"
302303
},
303304
"vulnerabilities": {
304305
"no_description": "No description available",

0 commit comments

Comments
 (0)