[Library | trunk]

result  landing: updates on method and filtering rules for  noindex tag



git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@60158 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2020-12-17 11:54:38 +00:00
parent e8ae23983b
commit d738597882
1 changed files with 27 additions and 4 deletions

View File

@ -319,10 +319,7 @@ export class ResultLandingComponent {
if ((this.type == "publication") && (this.properties.environment == "beta" || this.properties.environment == "development") && (typeof document !== 'undefined')) {
this.getOpenCitations();
}
if(this.resultLandingInfo.underCurationMessage && this.properties == "production"){
//set noindex for newly added records
this._meta.updateTag({content: 'noindex'}, "name='robots'");
}
this.addNoIndexFilter();
if (this.resultLandingInfo.title) {
this.updateTitle(this.resultLandingInfo.title);
this.updateDescription((this.resultLandingInfo.description ? (this.resultLandingInfo.description) : ("," + this.resultLandingInfo.title)));
@ -573,4 +570,30 @@ export class ResultLandingComponent {
this.citeModal.alertTitle = "Cite this " + this.getTypeName() + " to";
this.citeModal.open();
}
addNoIndexFilter() {
try {
if(this.properties.environment != "production") {
return ;
}else {
let addFilter = !(!this.resultLandingInfo.underCurationMessage &&
((this.resultLandingInfo.fundedByProjects && this.resultLandingInfo.fundedByProjects.length > 0)
|| this.resultLandingInfo.journal
|| (this.resultLandingInfo.otherSubjects && this.resultLandingInfo.otherSubjects.size > 0)
|| (this.resultLandingInfo.classifiedSubjects && this.resultLandingInfo.classifiedSubjects.size > 0)
|| (this.resultLandingInfo.organizations && this.resultLandingInfo.organizations.length > 0)
|| this.resultLandingInfo.bioentities || (this.resultLandingInfo.references && this.resultLandingInfo.references.length > 0)
|| (this.resultLandingInfo.relatedResearchResults && this.resultLandingInfo.relatedResearchResults.length > 0)
|| (this.resultLandingInfo.similarResearchResults && this.resultLandingInfo.similarResearchResults.length > 0)
|| (this.resultLandingInfo.supplementaryResearchResults && this.resultLandingInfo.supplementaryResearchResults.length > 0)
|| (this.resultLandingInfo.supplementedByResearchResults && this.resultLandingInfo.supplementedByResearchResults.length > 0)
));
if(addFilter) {
this._meta.updateTag({content: 'noindex'}, "name='robots'");
}
}
} catch (e) {
console.error("Error in passNoIndexFilter()", this.resultLandingInfo.relcanId, e);
return false;
}
}
}