Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove the postfix License after the license name in AdditionalInfo #2573

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { Meta, StoryObj } from '@storybook/react';

import { AdditionalInfo } from './AdditionalInfo';

const meta: Meta<typeof AdditionalInfo> = {
title: `Internal/Docs/AdditionalInfo`,
component: AdditionalInfo,
};

export default meta;
type Story = StoryObj<typeof AdditionalInfo>;

export const LicenseNameAndURL: Story = {
name: 'License Name with URL',
args: {
id: 'id',
license: {
name: 'MIT License',
url: 'https://mit.edu/license.html',
},
},
};

export const LicenseNameAndIdentifier: Story = {
name: 'License Name and Identifier',
args: {
id: 'id',
license: {
name: 'MIT License',
identifier: `MIT`,
},
},
};

export const LicenseIdentifierAndNameAndUrl: Story = {
name: 'License Identifier, Name and URL',
args: {
id: 'id',
license: {
name: 'MIT License',
identifier: 'MIT',
url: 'https://mit.edu/license.html',
},
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const AdditionalInfo: React.FC<AdditionalInfoProps> = ({ id, termsOfServi

//use spdx to look up url for license identifier if available
const licenseUrl = license?.url || `https://spdx.org/licenses/${license?.identifier}.html`;
const licenseLink = license?.name && licenseUrl ? `[${license.name} License](${licenseUrl})` : '';
const licenseLink = license?.name ? `[${license.name}](${licenseUrl})` : `[${license?.identifier}](${licenseUrl})`;
const tosLink = termsOfService ? `[Terms of Service](${termsOfService})` : '';

return contactLink || licenseLink || tosLink ? (
Expand Down