feat: show view license link at all levels (#157)

This commit is contained in:
Kristin Aoki
2022-12-05 12:43:14 -05:00
committed by GitHub
parent 0b199b1f5d
commit 6368ccf5ac
4 changed files with 19 additions and 15 deletions

View File

@@ -10,7 +10,7 @@ import {
Hyperlink,
} from '@edx/paragon';
import { LicenseLevel, LicenseTypes } from '../../../../../../data/constants/licenses';
import { LicenseTypes } from '../../../../../../data/constants/licenses';
import LicenseBlurb from './LicenseBlurb';
import { messages } from './messages';
@@ -19,7 +19,6 @@ export const LicenseDisplay = ({
license,
details,
licenseDescription,
level,
}) => {
if (license !== LicenseTypes.select) {
return (
@@ -29,15 +28,13 @@ export const LicenseDisplay = ({
<LicenseBlurb license={license} details={details} />
<div className="x-small">{licenseDescription}</div>
</div>
{level !== LicenseLevel.course ? (
<Hyperlink
className="text-primary-500 x-small"
destination="https://creativecommons.org/about"
target="_blank"
>
<FormattedMessage {...messages.viewLicenseDetailsLabel} />
</Hyperlink>
) : null }
<Hyperlink
className="text-primary-500 x-small"
destination="https://creativecommons.org/about"
target="_blank"
>
<FormattedMessage {...messages.viewLicenseDetailsLabel} />
</Hyperlink>
</Stack>
);
}

View File

@@ -26,6 +26,17 @@ exports[`LicenseDisplay snapshots snapshots: renders as expected with default pr
FormattedMessage component with license description
</div>
</div>
<Hyperlink
className="text-primary-500 x-small"
destination="https://creativecommons.org/about"
target="_blank"
>
<FormattedMessage
defaultMessage="View license details"
description="Label for view license details button"
id="authoring.videoeditor.license.viewLicenseDetailsLabel.label"
/>
</Hyperlink>
</Stack>
`;

View File

@@ -35,7 +35,6 @@ exports[`LicenseWidget snapshots snapshots: renders as expected with default pro
/>
<injectIntl(ShimmedIntlComponent)
details={Object {}}
level="course"
license="all-rights-reserved"
licenseDescription={
<FormattedMessage
@@ -99,7 +98,6 @@ exports[`LicenseWidget snapshots snapshots: renders as expected with isLibrary t
/>
<injectIntl(ShimmedIntlComponent)
details={Object {}}
level="library"
license="all-rights-reserved"
licenseDescription={
<FormattedMessage
@@ -148,7 +146,6 @@ exports[`LicenseWidget snapshots snapshots: renders as expected with licenseType
/>
<injectIntl(ShimmedIntlComponent)
details={Object {}}
level="block"
license="all-rights-reserved"
licenseDescription={
<FormattedMessage

View File

@@ -63,7 +63,6 @@ export const LicenseWidget = ({
license={license}
details={details}
licenseDescription={licenseDescription}
level={level}
/>
</>
) : null }