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

Release 05.23.2024.2 #91

Merged
merged 5 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion blocks/adp-collection-header/adp-collection-header.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { getCollection, getCollectionIdFromURL, deleteCollection } from '../../s
import createConfirmDialog from '../../scripts/confirm-dialog.js';
import { decorateIcons } from '../../scripts/lib-franklin.js';
import { createLinkHref, navigateTo } from '../../scripts/shared.js';
import { getBaseConfigPath } from '../../scripts/site-config.js';

import {
selectAllAssets, deselectAllAssets,
Expand All @@ -13,7 +14,7 @@ function createCollectionInfoHeader(collectionInfoHeader, collection) {
collectionInfoHeader.innerHTML = `
<div class="adp-collection-header-left">
<div class="back-button">
<a href="/collections"><span class="icon icon-back"></span></a>
<a href="${getBaseConfigPath()}/collections"><span class="icon icon-back"></span></a>
</div>
<div class="adp-collection-header-collection-info">
<div class="adp-collection-title"></div>
Expand Down
21 changes: 7 additions & 14 deletions contenthub/hydration/hydration-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ export function formIsComplete(metadataSchema, formValues) {

if(incomplete) return false;

if(formValues['gmo:campaignName']){
if(!formValues['gmo:programName']) return false;
}

if(formValues['gmo:licensedContent'] !== 'no'){
if(!formValues['gmo:usageTerms']) return false;
if(formValues['gmo:licensedContent'] === 'yes-expires' && !formValues['gmo:licenseExpiryDate']) return false;
Expand Down Expand Up @@ -116,7 +112,8 @@ export function getMetadataSchema(facetOptions){
label: 'Product',
placeholder: 'Select one or more',
required: true,
element: 'tags',
element: 'dropdown',
multipleSelection: true,
dropdownOptions: [
{ name: 'N/A', id: 'na' },
{ name: 'Acrobat Export PDF', id: 'acrobat-export-pdf' },
Expand Down Expand Up @@ -217,13 +214,7 @@ export function getMetadataSchema(facetOptions){
return value.toLowerCase().split(' ').every((val) => name.includes(val));
}
)
},
required: true,
requires: [{
property: 'gmo:campaignName',
expectedValue: '',
operator: '!=='
}]
}
},
{
mapToProperty: 'gmo:deliverableType',
Expand Down Expand Up @@ -360,7 +351,8 @@ export function getMetadataSchema(facetOptions){
mapToProperty: 'gmo:ddomStage',
label: 'DDOM Stage',
placeholder: 'Select one or more',
element: 'tags',
element: 'dropdown',
multipleSelection: true,
dropdownOptions: [
{
id: 'discover',
Expand Down Expand Up @@ -388,7 +380,8 @@ export function getMetadataSchema(facetOptions){
mapToProperty: 'gmo:p0TargetMarketGeo',
label: 'Target Market',
placeholder: 'Select one or more',
element: 'tags',
element: 'dropdown',
multipleSelection: true,
dropdownOptions: [
{
id: 'apac',
Expand Down
6 changes: 6 additions & 0 deletions scripts/metadata-html-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@ export async function fetchMetadataAndCreateHTML(metadataViewConfig, assetData,
if (assetData === undefined || assetJSON === undefined) {
assetJSON = await getAssetMetadata(getAssetIdFromURL());
}
// Remove "urn:aaid:aem:" prefix from displayed 'assetId' value
if (assetJSON.assetId) {
// A deep copy of the assetJSON object is created to avoid modifying the original object
assetJSON = JSON.parse(JSON.stringify(assetJSON));
assetJSON.assetId = assetJSON.assetId.replace('urn:aaid:aem:', '');
}

const metadataContainer = document.createElement('div');
metadataContainer.classList.add('metadata-container');
Expand Down
6 changes: 1 addition & 5 deletions scripts/metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { fetchCached } from './fetch-util.js';
import { getBaseConfigPath, getMetadataConfigs } from './site-config.js';

const SEARCH_FIELD_TO_POLARIS_API_MAP = {
uuid: 'assetId',
'dc-format': 'repositoryMetadata.dc:format',
'repo-name': 'repositoryMetadata.repo:name',
'repo-createDate': 'repositoryMetadata.repo:createDate',
Expand Down Expand Up @@ -386,11 +387,6 @@ export function formatAssetMetadata(propertyName, metadataValue) {
return DATA_TYPES.tags(metadataValue, propertyName);
}

// file types
if (['dc-format'].includes(propertyName)) {
return PREDEFINED_METADATA_FIELDS.format.format(metadataValue);
}

// dates
if (isDate(propertyName, metadataValue)) {
return formatDate(metadataValue);
Expand Down
Loading