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.09.2024 2 #80

Merged
merged 3 commits into from
May 9, 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
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