diff --git a/landingPages/result/resultLanding.component.ts b/landingPages/result/resultLanding.component.ts index 9af4dbda..28319fa8 100644 --- a/landingPages/result/resultLanding.component.ts +++ b/landingPages/result/resultLanding.component.ts @@ -22,6 +22,7 @@ import {Subscriber} from "rxjs"; import {Session} from "../../login/utils/helper.class"; import {AnnotationComponent} from "../annotation/annotation.component"; import {ParsingFunctions} from "../landing-utils/parsingFunctions.class"; +import {ConnectHelper} from "../../connect/connectHelper"; @Component({ @@ -643,6 +644,8 @@ export class ResultLandingComponent { if(!(this.properties.environment == "production" || this.properties.environment == "development") ) { return ; }else { + /* + //comment out poor content filters let allow = !!(!this.resultLandingInfo.underCurationMessage && ((this.resultLandingInfo.fundedByProjects && this.resultLandingInfo.fundedByProjects.length > 0) || this.resultLandingInfo.journal @@ -658,10 +661,11 @@ export class ResultLandingComponent { || (this.resultLandingInfo.supplementaryResearchResults && this.resultLandingInfo.supplementaryResearchResults.length > 0) || (this.resultLandingInfo.supplementedByResearchResults && this.resultLandingInfo.supplementedByResearchResults.length > 0) ) - ); + );*/ + let allow = true; // console.log("rich content " + allow) //spam words to exclude - let title_authors_words = ["movie","hd","film","kimetsu", "1080p","4k","call of duty", "mobile hack", "TUBYDI", "电影","電影"]; + let title_authors_words = ["movie","hd","film","kimetsu", "1080p","4k","call of duty", "mobile hack", "TUBYDI", "电影","電影","download ebook","download [ebook]"]; let abstract_words = ["operacao-feliz-natal.blogspot.com", "moviedouban.site", "hack-expert-solution.link"]; allow = allow && !( (this.hasKeyword(this.resultLandingInfo.title,title_authors_words) || (this.resultLandingInfo.authors && this.hasKeyword(this.resultLandingInfo.authors.map(o => o.fullName).join(" "),title_authors_words)) @@ -679,6 +683,15 @@ export class ResultLandingComponent { (this.resultLandingInfo.authors && this.hasKeyword("_"+this.resultLandingInfo.authors.map(o => o.fullName).join("_")+"_",common_authors, "_")) ); // console.log("common content " + allow) + //community filter + allow = allow && ((properties.adminToolsPortalType == 'explore' && (!this.resultLandingInfo.contexts || this.resultLandingInfo.contexts.length == 0)) || + (properties.adminToolsPortalType != 'explore' && properties.adminToolsPortalType != 'community') || + (properties.adminToolsPortalType == 'community' && (!!this.resultLandingInfo.contexts && + this.resultLandingInfo.contexts.filter( context => { return ConnectHelper.getCommunityFromDomain(properties.domain) == context.idContext }).length > 0) + ) + ); + // console.log("community " + allow ) + if(!allow) { this._meta.updateTag({content: 'noindex'}, "name='robots'"); } diff --git a/landingPages/result/resultLanding.service.ts b/landingPages/result/resultLanding.service.ts index 224fd8e2..df5b8c97 100644 --- a/landingPages/result/resultLanding.service.ts +++ b/landingPages/result/resultLanding.service.ts @@ -6,7 +6,7 @@ import {EnvProperties} from '../../utils/properties/env-properties'; import {ParsingFunctions} from '../landing-utils/parsingFunctions.class'; import {map} from "rxjs/operators"; import {HostedByCollectedFrom, Organization} from "../../utils/result-preview/result-preview"; -import {Dates, Identifier} from "../../utils/string-utils.class"; +import {Dates, Identifier, StringUtils} from "../../utils/string-utils.class"; import {properties} from "../../../../environments/environment"; @Injectable() @@ -143,6 +143,9 @@ export class ResultLandingService { //this.resultLandingInfo.description = String(data[0].description[0]); this.resultLandingInfo.description = (data[0] && data[0].description[0]) ? String(data[0].description[0]) : ""; } + try{ + this.resultLandingInfo.description = StringUtils.HTMLToString(this.resultLandingInfo.description); + } catch (e) {} this.resultLandingInfo.embargoEndDate = data[0].embargoenddate?Dates.getDate(data[0].embargoenddate):null; } diff --git a/services/searchResearchResults.service.ts b/services/searchResearchResults.service.ts index f8345497..92b0a2d8 100644 --- a/services/searchResearchResults.service.ts +++ b/services/searchResearchResults.service.ts @@ -349,7 +349,9 @@ export class SearchResearchResultsService { } else { result.description = (resData.description[0]) ? String(resData.description[0]) : ""; } - + try{ + result.description = StringUtils.HTMLToString(result.description); + } catch (e) {} if (result.description && result.description.length > this.sizeOfDescription) { result.description = result.description.substring(0, this.sizeOfDescription) + "..."; } diff --git a/sharedComponents/bottom.component.html b/sharedComponents/bottom.component.html index 52b30a61..96424bcb 100644 --- a/sharedComponents/bottom.component.html +++ b/sharedComponents/bottom.component.html @@ -6,7 +6,7 @@
flag black white low + alt="flag black white low" width="50px" height="33px" loading="lazy">
@@ -24,8 +24,8 @@
OpenAIRE + width="126px" + height="30px" class="el-image" alt="OpenAIRE" loading="lazy">
@@ -41,8 +41,8 @@
OpenAIRE + width="126px" + height="30px" class="el-image" alt="OpenAIRE" loading="lazy">
@@ -61,7 +61,7 @@
flag black white low + alt="flag black white low" width="50px" height="33px" loading="lazy">