diff --git a/package.json b/package.json index 6a7fcc8..b8d0bdd 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,6 @@ }, "license": "MIT", "dependencies": { - "@financial-times/n-display-metadata": "^1.0.0-beta.2", "date-fns": "^1.29.0" }, "devDependencies": { diff --git a/src/data-model/es.js b/src/data-model/es.js index f922f80..e983eae 100644 --- a/src/data-model/es.js +++ b/src/data-model/es.js @@ -21,8 +21,6 @@ module.exports = [ 'mainImage.height', 'mainImage.ratio', - 'annotations', - 'displayConcept.id', 'displayConcept.prefLabel', 'displayConcept.relativeUrl', diff --git a/src/data-model/fragments.js b/src/data-model/fragments.js index ef80b4f..f34af71 100644 --- a/src/data-model/fragments.js +++ b/src/data-model/fragments.js @@ -25,13 +25,6 @@ module.exports = { isEditorsChoice canBeSyndicated isOpinion - annotations { - id - types - predicate - prefLabel - relativeUrl - } genre { id prefLabel diff --git a/src/presenters/teaser-presenter.js b/src/presenters/teaser-presenter.js index 0c76382..6e7b82a 100644 --- a/src/presenters/teaser-presenter.js +++ b/src/presenters/teaser-presenter.js @@ -1,6 +1,5 @@ 'use strict'; -const nDisplayMetadata = require('@financial-times/n-display-metadata'); const dateFnsformat = require('date-fns/format'); const hyphenatePascalCase = require('../utils/hyphenate-pascal-case'); const ONE_HOUR = 1000 * 60 * 60; @@ -172,23 +171,6 @@ class TeaserPresenter { //returns concept to be displayed get teaserConcept () { - // HACK: Testing new teaser metadata provided by n-display-metadata - if (Array.isArray(this.data.annotations) && this.data.flags && this.data.flags.newDisplayMetadata) { - const { link, altLink } = nDisplayMetadata.teaser(this.data); - - if (this.data.streamProperties && link) { - const { id, prefLabel } = this.data.streamProperties; - const sameId = id && id === link.id; - const sameLabel = prefLabel && prefLabel === link.prefLabel; - - if (sameId || sameLabel) { - return altLink; - } - } - - return link; - } - //use package title as display concept if article belongs to package let packageArticle = this.data.containedIn; @@ -239,17 +221,6 @@ class TeaserPresenter { return 'Video'; } - // Testing new teaser metadata provided by n-display-metadata - if (Array.isArray(this.data.annotations) && this.data.flags && this.data.flags.newDisplayMetadata) { - const { prefixText } = nDisplayMetadata.teaser(this.data); - - if (this.data.streamProperties && this.data.streamProperties.prefLabel === prefixText) { - return; - } else { - return prefixText; - } - } - if (this.brandAuthorDouble) { // dedupe authors who are also brands and where Author = stream if (this.brandConcept &&