Skip to content

Commit cdd8d19

Browse files
fix: show "none" if package has no license (#656)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 4c545ba commit cdd8d19

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -735,12 +735,13 @@ function handleClick(event: MouseEvent) {
735735
<dl
736736
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"
737737
>
738-
<div v-if="pkg.license" class="space-y-1 sm:col-span-2">
738+
<div class="space-y-1 sm:col-span-2">
739739
<dt class="text-xs text-fg-subtle uppercase tracking-wider">
740740
{{ $t('package.stats.license') }}
741741
</dt>
742742
<dd class="font-mono text-sm text-fg">
743-
<LicenseDisplay :license="pkg.license" />
743+
<LicenseDisplay v-if="pkg.license" :license="pkg.license" />
744+
<span v-else>{{ $t('package.license.none') }}</span>
744745
</dd>
745746
</div>
746747

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)