Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

Commit

Permalink
Merge pull request #200 from Financial-Times/matth/remove-n-display-m…
Browse files Browse the repository at this point in the history
…etadata

Remove code behind expired newDisplayMetadata flag
  • Loading branch information
i-like-robots committed Dec 6, 2018
2 parents aff7a9a + 75f6dfa commit bd81b68
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 39 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
},
"license": "MIT",
"dependencies": {
"@financial-times/n-display-metadata": "^1.0.0-beta.2",
"date-fns": "^1.29.0"
},
"devDependencies": {
Expand Down
2 changes: 0 additions & 2 deletions src/data-model/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ module.exports = [
'mainImage.height',
'mainImage.ratio',

'annotations',

'displayConcept.id',
'displayConcept.prefLabel',
'displayConcept.relativeUrl',
Expand Down
7 changes: 0 additions & 7 deletions src/data-model/fragments.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ module.exports = {
isEditorsChoice
canBeSyndicated
isOpinion
annotations {
id
types
predicate
prefLabel
relativeUrl
}
genre {
id
prefLabel
Expand Down
29 changes: 0 additions & 29 deletions src/presenters/teaser-presenter.js
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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 &&
Expand Down

0 comments on commit bd81b68

Please sign in to comment.