Commit d6f175c4 authored by Maxime Chaillet's avatar Maxime Chaillet

Define a logo for the ESRF as publisher. It fixes #79.

parent f5cfb7a5
This diff is collapsed.
......@@ -175,6 +175,7 @@ DOIController.prototype.getDataForGoogleSearch = function (doi) {
googleMetadataObject = new GoogleMetadataObject(data);
googleMetadataObject.setDescription();
googleMetadataObject.setLicense();
googleMetadataObject.setPublisherLogo();
_this.view.addDOIMetadataToHead(JSON.stringify(googleMetadataObject.getMetadata()));
} else {
......
......@@ -44,3 +44,12 @@ GoogleMetadataObject.prototype.setDescription = function () {
console.log("[GoogleMetadataObject] - The data required by Google is missing the 'name' field. This is required by Google for indexing.");
}
};
/**
* Set the ESRF logo in the publisher's section
*/
GoogleMetadataObject.prototype.setPublisherLogo = function () {
if (this.data.publisher) {
this.data.publisher.logo = 'https://doi.esrf.fr/src/images/esrfLogoBlue.png';
}
};
......@@ -33,4 +33,15 @@ describe("googleMetadataObject unit tests", () => {
next();
})
})
describe("setPublisherLogo", () => {
it.each(resources.setPublisherLogo, '[setPublisherLogo: %s ]', ['aboutThisTest'],
function (element, next) {
let gmo = new GoogleMetadataObject(element.data);
gmo.setPublisherLogo();
expect(gmo.getMetadata()).toEqual(element.expected);
next();
})
})
})
\ No newline at end of file
......@@ -171,5 +171,69 @@ module.exports = {
"description": "High resolution 3-D structure of Thyroglobulin.; Didier NURIZZO; There is currently no additional information regarding the description of this DOI."
}
}
],
setPublisherLogo: [
{
aboutThisTest: 'set publisher s logo',
data: library.googleMetadata1,
expected: {
"@context": "http://schema.org",
"@type": "Dataset",
"@id": "https://doi.org/10.15151/esrf-es-47877949",
"identifier": {
"@type": "PropertyValue",
"propertyID": "DOI",
"value": "https://doi.org/10.15151/esrf-es-47877949"
},
"url": "https://doi.esrf.fr/10.15151/ESRF-ES-47877949",
"additionalType": "Experiment Session",
"name": "Nanoscopic Metal Composition of Phagosomal Compartments during Engulfment of E. coli by Professional Phagocytes.",
"author": [
{
"name": "Björn DE SAMBER",
"givenName": "Björn DE",
"familyName": "SAMBER",
"@type": "Person"
},
{
"name": "Constantin URBAN",
"givenName": "Constantin",
"familyName": "URBAN",
"@type": "Person"
},
{
"name": "Bart VEKEMANS",
"givenName": "Bart",
"familyName": "VEKEMANS",
"@type": "Person"
},
{
"name": "Gerald FALKENBERG",
"givenName": "Gerald",
"familyName": "FALKENBERG",
"@type": "Person"
},
{
"name": "Ella DE PAUW",
"givenName": "Ella DE",
"familyName": "PAUW",
"@type": "Person"
}
],
"keywords": "Life Sciences, LS-2550, id16a",
"inLanguage": "eng",
"datePublished": "2020",
"schemaVersion": "http://datacite.org/schema/kernel-3",
"publisher": {
"@type": "Organization",
"name": "European Synchrotron Radiation Facility",
"logo": "https://doi.esrf.fr/src/images/esrfLogoBlue.png"
},
"provider": {
"@type": "Organization",
"name": "DataCite"
},
}
},
]
};
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment