Skip to content

Commit

Permalink
chore: remove record schema.org retrieval (#2113)
Browse files Browse the repository at this point in the history
  • Loading branch information
rwd authored Nov 2, 2023
1 parent 2d381ab commit 7dc760f
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 49 deletions.
3 changes: 0 additions & 3 deletions packages/portal/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,6 @@ OAUTH_CLIENT="YOUR_CLIENT"
# JIRA_API_SERVICE_DESK_GALLERIES_CUSTOM_FIELD_SET_ID='customfield_10841'
# JIRA_API_SERVICE_DESK_GALLERIES_CUSTOM_FIELD_SET_CREATOR_NICKNAME='customfield_10842'

# Dataset ID for which to enable schema.org on item pages
# SCHEMA_ORG_DATASET_ID=2021672

# Comma-separated list of two-letter language codes for which to enable search
# translation.
# APP_SEARCH_TRANSLATE_LOCALES=es,de
Expand Down
1 change: 0 additions & 1 deletion packages/portal/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ export default {
featureNotificationExpiration: featureNotificationExpiration(process.env.APP_FEATURE_NOTIFICATION_EXPIRATION),
internalLinkDomain: process.env.INTERNAL_LINK_DOMAIN,
notificationBanner: process.env.APP_NOTIFICATION_BANNER,
schemaOrgDatasetId: process.env.SCHEMA_ORG_DATASET_ID,
siteName: APP_SITE_NAME,
search: {
collections: {
Expand Down
10 changes: 0 additions & 10 deletions packages/portal/src/pages/item/_.vue
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,6 @@
</client-only>
</b-container>
</template>
<client-only>
<!-- eslint-disable vue/no-v-html -->
<script
v-if="schemaOrg"
type="application/ld+json"
v-html="schemaOrg"
/>
<!-- eslint-enable vue/no-v-html -->
</client-only>
</div>
</template>

Expand Down Expand Up @@ -208,7 +199,6 @@
organizations: [],
places: [],
relatedCollections: [],
schemaOrg: null,
showItemLanguageSelector: true,
timespans: [],
title: null,
Expand Down
11 changes: 0 additions & 11 deletions packages/portal/src/plugins/europeana/record.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ export default class EuropeanaRecordApi extends EuropeanaApi {
organizations,
places,
title: proxies.dcTitle,
schemaOrg: data.schemaOrg ? Object.freeze(JSON.stringify(data.schemaOrg)) : undefined,
metadataLanguage: prefLang,
iiifPresentationManifest: item.iiifPresentationManifest
};
Expand All @@ -224,16 +223,6 @@ export default class EuropeanaRecordApi extends EuropeanaApi {
params.profile = 'translate';
params.lang = options.metadataLanguage;
}
} else {
// No point in switching on experimental schema.org with item translations.
// The profiles would interfere with each other.
let schemaOrgDatasetId;
if (this.context?.$config?.app?.schemaOrgDatasetId) {
schemaOrgDatasetId = this.context?.$config.app.schemaOrgDatasetId;
}
if (schemaOrgDatasetId && europeanaId.startsWith(`/${schemaOrgDatasetId}/`)) {
params.profile = 'schemaOrg';
}
}

return this.axios.get(`${path}${europeanaId}.json`, { params })
Expand Down
24 changes: 0 additions & 24 deletions packages/portal/tests/unit/plugins/europeana/record.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,30 +356,6 @@ describe('plugins/europeana/record', () => {
expect(nock.isDone()).toBe(true);
});

describe('profile parameter', () => {
it('is "schemaOrg" for configured dataset items', async() => {
nock(record.BASE_URL)
.get(apiEndpoint)
.query(query => query.profile === 'schemaOrg')
.reply(200, apiResponse);

await (new record({ $config: { app: { schemaOrgDatasetId: '123' } } })).getRecord(europeanaId);

expect(nock.isDone()).toBe(true);
});

it('is omitted for other dataset items', async() => {
nock(record.BASE_URL)
.get(apiEndpoint)
.query(query => !Object.keys(query).includes('profile'))
.reply(200, apiResponse);

await (new record({ $config: { app: { schemaOrgDatasetId: '456' } } })).getRecord(europeanaId);

expect(nock.isDone()).toBe(true);
});
});

describe('API response', () => {
describe('with "Invalid record identifier: ..." error', () => {
const errorMessage = `Invalid record identifier: ${europeanaId}`;
Expand Down

0 comments on commit 7dc760f

Please sign in to comment.