diff --git a/blocks/adp-asset-details-modal/adp-asset-details-modal.js b/blocks/adp-asset-details-modal/adp-asset-details-modal.js index f8b47391..36d923a0 100644 --- a/blocks/adp-asset-details-modal/adp-asset-details-modal.js +++ b/blocks/adp-asset-details-modal/adp-asset-details-modal.js @@ -9,7 +9,7 @@ import { import { closeModal } from '../../scripts/shared.js'; import { authorizeURL, getAssetMetadata } from '../../scripts/polaris.js'; import { - getAssetName, getAssetMimeType, getAssetTitle, + getAssetName, getAssetMimeType, getAssetTitle, isLicensedContent, } from '../../scripts/metadata.js'; // eslint-disable-next-line import/no-cycle import { disableActionButtons } from '../adp-asset-details-panel/adp-asset-details-panel.js'; @@ -96,7 +96,8 @@ function createHeaderPanel(modal) { // ensure express button only shows for valid asset types const expressBtn = modal.querySelector('.action-edit-asset'); const validCheck = fileValidity(format); - if (isCCEConfigured() && validCheck.isValid) { + if (isCCEConfigured() && validCheck.isValid && !isLicensedContent(assetJSON)) { + //Only show express button for content that is not licensed. expressBtn.classList.remove('hidden'); } else if (!expressBtn.classList.contains('hidden')) { expressBtn.classList.add('hidden'); diff --git a/blocks/adp-asset-details-panel/adp-asset-details-panel.js b/blocks/adp-asset-details-panel/adp-asset-details-panel.js index 4e35bb06..45b693fd 100644 --- a/blocks/adp-asset-details-panel/adp-asset-details-panel.js +++ b/blocks/adp-asset-details-panel/adp-asset-details-panel.js @@ -6,7 +6,7 @@ import { openDownloadModal } from '../adp-download-modal/adp-download-modal.js'; import { openAssetDetailsModal } from '../adp-asset-details-modal/adp-asset-details-modal.js'; import { fetchMetadataAndCreateHTML } from '../../scripts/metadata-html-builder.js'; import { - getAssetMimeType, getAssetTitle, getAssetName, getAssetHeight, getAssetWidth, + getAssetMimeType, getAssetTitle, getAssetName, getAssetHeight, getAssetWidth, isLicensedContent, } from '../../scripts/metadata.js'; import { getAssetMetadata, @@ -74,7 +74,8 @@ export async function openAssetDetailsPanel(assetId, resultsManagerObj) { // ensure express button only shows for valid asset types const expressBtn = assetDetailsPanel.querySelector('.action-edit-asset'); const validCheck = fileValidity(fileFormat); - if (isCCEConfigured() && validCheck.isValid) { + if (isCCEConfigured() && validCheck.isValid && !isLicensedContent(assetJSON)) { + //Only show express button for content that is not licensed. expressBtn.classList.remove('hidden'); } else if (!expressBtn.classList.contains('hidden')) { expressBtn.classList.add('hidden'); diff --git a/scripts/metadata.js b/scripts/metadata.js index b9e42091..bbd3684c 100644 --- a/scripts/metadata.js +++ b/scripts/metadata.js @@ -180,6 +180,14 @@ export function getAssetSize(assetJSON) { return getMetadataValue('size', assetJSON); } +/** + * Is licensed content + * Returns true for gmo:licensedContent != 'no' + */ +export function isLicensedContent(assetJSON) { + return getMetadataValue('gmo:licensedContent', assetJSON) !== 'no'; +} + /** * Predefined metadata fields that have special handling, can have compound values and a * special formatter.