diff --git a/app/components/v2/organization-item.js b/app/components/v2/organization-item.js index beb305cd..46f317f8 100644 --- a/app/components/v2/organization-item.js +++ b/app/components/v2/organization-item.js @@ -20,6 +20,7 @@ export default Component.extend({ lastModifiedDate: null, otherNames: null, organizationTypes: null, + configService: service('config-service'), // Convert label array into a dictionary with relationship type as key @@ -45,12 +46,14 @@ export default Component.extend({ return result; }, {}); - if (groupedNames.label) { - groupedNames.label.forEach((label) => { - if (label.lang && !label.value.includes(`(${label.lang})`)) { - label.value = `${label.value} (${label.lang})`; - } - }); + for (let key in groupedNames) { + if (groupedNames[key]) { + groupedNames[key].forEach((item) => { + if (item.lang && !item.value.includes(`(${item.lang})`)) { + item.value = `${item.value} (${item.lang})`; + } + }) + } } const values = Object.values(groupedNames).flat().map(item => item.value).join(', '); @@ -80,7 +83,7 @@ export default Component.extend({ this.set('grid', externalId.preferred); } break; - + case 'isni': if (externalId.preferred) { let displayIsni = externalId.preferred; @@ -94,7 +97,7 @@ export default Component.extend({ this.set('link_isni', linkIsni); } break; - + case 'fundref': if (externalId.preferred) { this.set('fundref', externalId.preferred); @@ -102,7 +105,7 @@ export default Component.extend({ this.set('fundref', externalId.all[0]); } break; - + case 'wikidata': if (externalId.preferred) { this.set('wikidata', externalId.preferred); @@ -110,7 +113,7 @@ export default Component.extend({ this.set('wikidata', externalId.all[0]); } break; - + default: break; } diff --git a/app/services/config-service.js b/app/services/config-service.js new file mode 100644 index 00000000..1740fb1a --- /dev/null +++ b/app/services/config-service.js @@ -0,0 +1,7 @@ +import Service from '@ember/service'; +import config from '../config/environment'; + +export default Service.extend({ + API_URL_V1: config.API_URL_V1, + API_URL_V2: config.API_URL_V2 +}); \ No newline at end of file diff --git a/app/templates/components/v2/organization-item.hbs b/app/templates/components/v2/organization-item.hbs index 3fdab904..9c50c7be 100644 --- a/app/templates/components/v2/organization-item.hbs +++ b/app/templates/components/v2/organization-item.hbs @@ -139,7 +139,7 @@ {{#link-to "organizations.show" model.id class="btn btn-sm btn-round"}}View details{{/link-to}} {{/if}} {{#if (not isSearch)}} -

Some record data is not displayed in this view. See JSON view for full record data

+

Some record data is not displayed in this view. See JSON view for full record data

{{#if lastModifiedDate}}