diff --git a/claims/claim-utils/displayClaims/displayClaims.component.html b/claims/claim-utils/displayClaims/displayClaims.component.html index 38d7c2aa..51d6ce0b 100644 --- a/claims/claim-utils/displayClaims/displayClaims.component.html +++ b/claims/claim-utils/displayClaims/displayClaims.component.html @@ -1,4 +1,4 @@ - +
diff --git a/claims/claim-utils/displayClaims/displayClaims.component.ts b/claims/claim-utils/displayClaims/displayClaims.component.ts index 20743152..14138343 100644 --- a/claims/claim-utils/displayClaims/displayClaims.component.ts +++ b/claims/claim-utils/displayClaims/displayClaims.component.ts @@ -14,6 +14,8 @@ import {IndexInfoService} from "../../../utils/indexInfo.service"; import {ClaimDBRecord} from "../claimHelper.class"; import {Dates} from "../../../utils/string-utils.class"; import {HelperService} from "../../../utils/helper/helper.service"; +import {Meta, Title} from "@angular/platform-browser"; +import {PiwikService} from "../../../utils/piwik/piwik.service"; @Component({ @@ -23,6 +25,10 @@ import {HelperService} from "../../../utils/helper/helper.service"; }) export class DisplayClaimsComponent { + @Input() piwikSiteId = null; + @Input() title: string = ""; + piwiksub:any; + properties: EnvProperties; public searchTermStream = new Subject(); sub: any; @@ -77,6 +83,7 @@ export class DisplayClaimsComponent { public pageContents = null; constructor(private _claimService: ClaimsService, private route: ActivatedRoute, private _router: Router, private location: Location, + private _meta: Meta, private _title: Title, private _piwikService:PiwikService, private seoService: SEOService, private indexInfoService:IndexInfoService, private helper: HelperService) { } @@ -85,6 +92,16 @@ export class DisplayClaimsComponent { .subscribe((data: { envSpecific: EnvProperties }) => { this.properties = data.envSpecific; this.url = data.envSpecific.baseLink + this._router.url; + + var description = "Openaire, linking, claim, publication, research data, software, other research product, project, community"; + this.updateTitle(this.title); + this.updateDescription(description); + this.updateUrl(this.url); + + if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){ + this.piwiksub = this._piwikService.trackView(this.properties, this.title, this.piwikSiteId).subscribe(); + } + this.helper.getPageHelpContents(this._router.url, this.properties, this.communityId).subscribe(contents => { this.pageContents = contents; }); @@ -92,7 +109,7 @@ export class DisplayClaimsComponent { this.lastIndexDate = res; }); this.sub = this.route.queryParams.subscribe(params => { - this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this._router.url, false); + this.seoService.createLinkForCanonicalURL(this.url, false); if (this.myClaims) { this.fetchBy = "User"; @@ -132,6 +149,9 @@ export class DisplayClaimsComponent { ngOnDestroy() { this.sub.unsubscribe(); + if(this.piwiksub){ + this.piwiksub.unsubscribe(); + } //this.searchTermStreamSub.unsubscribe(); } @@ -587,4 +607,21 @@ export class DisplayClaimsComponent { } return totalPages; } + + private updateDescription(description:string) { + this._meta.updateTag({content:description},"name='description'"); + this._meta.updateTag({content:description},"property='og:description'"); + } + private updateTitle(title:string) { + var _prefix =""; + if(!this.communityId) { + _prefix ="OpenAIRE | "; + } + var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title); + this._title.setTitle(_title); + this._meta.updateTag({content:_title},"property='og:title'"); + } + private updateUrl(url:string) { + this._meta.updateTag({content:url},"property='og:url'"); + } } diff --git a/claims/claim-utils/displayClaims/displayClaims.module.ts b/claims/claim-utils/displayClaims/displayClaims.module.ts index 2eb0197c..2f8850b5 100644 --- a/claims/claim-utils/displayClaims/displayClaims.module.ts +++ b/claims/claim-utils/displayClaims/displayClaims.module.ts @@ -12,11 +12,13 @@ import {HelperModule} from '../../../utils/helper/helper.module'; import {Schema2jsonldModule} from '../../../sharedComponents/schema2jsonld/schema2jsonld.module'; import { SEOServiceModule } from '../../../sharedComponents/SEO/SEOService.module'; import {IndexInfoServiceModule} from "../../../utils/indexInfoService.module"; +import {PiwikServiceModule} from "../../../utils/piwik/piwikService.module"; @NgModule({ imports: [ CommonModule, FormsModule, RouterModule, ClaimServiceModule, LoadingModalModule, AlertModalModule, -ClaimEntityFormatterModule, PagingModule, HelperModule, Schema2jsonldModule, SEOServiceModule, IndexInfoServiceModule + ClaimEntityFormatterModule, PagingModule, HelperModule, Schema2jsonldModule, SEOServiceModule, PiwikServiceModule, + IndexInfoServiceModule ], declarations: [ diff --git a/claims/directLinking/directLinking.component.html b/claims/directLinking/directLinking.component.html index 22906a27..8ed083e7 100644 --- a/claims/directLinking/directLinking.component.html +++ b/claims/directLinking/directLinking.component.html @@ -1,5 +1,6 @@ + [communityId]="communityId" [inlineEntity]="inlineEntity" [showOptions]="showOptions" + [piwikSiteId]="piwikSiteId" title="Direct Linking">
@@ -14,7 +15,7 @@
diff --git a/claims/directLinking/directLinking.component.ts b/claims/directLinking/directLinking.component.ts index 2faf7fb1..25525622 100644 --- a/claims/directLinking/directLinking.component.ts +++ b/claims/directLinking/directLinking.component.ts @@ -9,7 +9,6 @@ import {SearchPublicationsService} from '../../services/searchPublications.servi import {SearchDatasetsService} from '../../services/searchDatasets.service'; import {SearchSoftwareService} from '../../services/searchSoftware.service'; import {SearchOrpsService} from '../../services/searchOrps.service'; -import {SEOService} from '../../sharedComponents/SEO/SEO.service'; import {LinkingGenericComponent} from "../linking/linkingGeneric.component"; import {ClaimResultSearchFormComponent} from "../claim-utils/claimResultSearchForm.component"; @@ -19,6 +18,8 @@ import {ClaimResultSearchFormComponent} from "../claim-utils/claimResultSearchFo templateUrl: 'directLinking.component.html' }) export class DirectLinkingComponent { + @Input() piwikSiteId = null; + @ViewChild(LinkingGenericComponent) linking: LinkingGenericComponent; results: ClaimEntity[] = []; @@ -40,22 +41,13 @@ export class DirectLinkingComponent { localStoragePrefix: string = ""; constructor(private _router: Router, private route: ActivatedRoute,private entitySearch:EntitiesSearchService, private publicationsSearch: SearchPublicationsService, private datasetsSearch: SearchDatasetsService, - private softwareSearch: SearchSoftwareService, private ORPSearch: SearchOrpsService, - private _meta: Meta, private _title: Title, private seoService: SEOService) { - - let title = "OpenAIRE | Direct Linking"; - this._meta.updateTag({content: title}, "property='og:title'"); - this._title.setTitle(title); - + private softwareSearch: SearchSoftwareService, private ORPSearch: SearchOrpsService) { } ngOnInit() { this.route.data .subscribe((data: { envSpecific: EnvProperties }) => { this.properties = data.envSpecific; - let url = data.envSpecific.baseLink + this._router.url; - this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this._router.url, false); - }); this.sub = this.route.queryParams.subscribe(params => { diff --git a/claims/linking/linkingGeneric.component.ts b/claims/linking/linkingGeneric.component.ts index 83a4550a..1b9615dc 100644 --- a/claims/linking/linkingGeneric.component.ts +++ b/claims/linking/linkingGeneric.component.ts @@ -10,6 +10,7 @@ import {SEOService} from '../../sharedComponents/SEO/SEO.service'; import {AlertModal} from "../../utils/modal/alert"; import {HelperFunctions} from "../../utils/HelperFunctions.class"; import {HelperService} from "../../utils/helper/helper.service"; +import {PiwikService} from "../../utils/piwik/piwik.service"; declare var UIkit:any; @@ -19,6 +20,10 @@ declare var UIkit:any; }) export class LinkingGenericComponent { + @Input() piwikSiteId = null; + @Input() title: string = null; + piwiksub:any; + @Input() communityId:string= null; sourceType:string; targetType:string; @@ -43,14 +48,8 @@ export class LinkingGenericComponent { constructor (private _router: Router, private route: ActivatedRoute, private entitySearch:EntitiesSearchService, private publicationsSearch:SearchPublicationsService, private datasetsSearch:SearchDatasetsService, - private _meta: Meta, private _title: Title, - private seoService: SEOService, private helper: HelperService ) { - - let title = "OpenAIRE | Linking"; - this._meta.updateTag({content:title},"property='og:title'"); - this._title.setTitle(title); - - + private _meta: Meta, private _title: Title, private _piwikService:PiwikService, + private seoService: SEOService, private helper: HelperService ) { } ngOnInit() { this.showOptions.show = 'source'; @@ -63,7 +62,18 @@ export class LinkingGenericComponent { .subscribe((data: { envSpecific: EnvProperties }) => { this.properties = data.envSpecific; this.url = data.envSpecific.baseLink+this._router.url; - this.seoService.createLinkForCanonicalURL(this.properties.baseLink+this._router.url, false); + + var description = "Openaire, linking, claim, publication, research data, software, other research product, project, community"; + this.updateTitle(this.title); + this.updateDescription(description); + this.updateUrl(this.url); + + this.seoService.createLinkForCanonicalURL(this.url, false); + + if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){ + this.piwiksub = this._piwikService.trackView(this.properties, this.title, this.piwikSiteId).subscribe(); + } + this.helper.getPageHelpContents(this._router.url, this.properties, this.communityId).subscribe(contents => { this.pageContents = contents; }) @@ -81,6 +91,12 @@ export class LinkingGenericComponent { } } + ngOnDestroy() { + if(this.piwiksub){ + this.piwiksub.unsubscribe(); + } + } + openSelectionModal() { this.alert.cancelButton = false; this.alert.okButton = false; @@ -105,6 +121,23 @@ export class LinkingGenericComponent { } scrollUp(){ HelperFunctions.scroll(); + } + + private updateDescription(description:string) { + this._meta.updateTag({content:description},"name='description'"); + this._meta.updateTag({content:description},"property='og:description'"); + } + private updateTitle(title:string) { + var _prefix =""; + if(!this.communityId) { + _prefix ="OpenAIRE | "; + } + var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title); + this._title.setTitle(_title); + this._meta.updateTag({content:_title},"property='og:title'"); + } + private updateUrl(url:string) { + this._meta.updateTag({content:url},"property='og:url'"); } } diff --git a/claims/linking/linkingGeneric.module.ts b/claims/linking/linkingGeneric.module.ts index 606b16aa..1e588150 100644 --- a/claims/linking/linkingGeneric.module.ts +++ b/claims/linking/linkingGeneric.module.ts @@ -20,6 +20,7 @@ import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module'; import {MetadataPreviewModule} from './selected/metadataPreview.module'; import {ClaimEntitiesMetadataModule} from "./selected/ClaimEntitiesMetadata.module"; import {AlertModalModule} from '../../utils/modal/alertModal.module'; +import {PiwikServiceModule} from "../../utils/piwik/piwikService.module"; @NgModule({ imports: [ @@ -27,7 +28,8 @@ import {AlertModalModule} from '../../utils/modal/alertModal.module'; SelectedPublicationsModule, StartOverModule, ClaimContextSearchFormModule, ClaimProjectsSearchFormModule, BulkClaimModule, ClaimResultSearchFormModule, - HelperModule, Schema2jsonldModule, SEOServiceModule, MetadataPreviewModule, ClaimEntitiesMetadataModule, AlertModalModule + HelperModule, Schema2jsonldModule, SEOServiceModule, MetadataPreviewModule, ClaimEntitiesMetadataModule, AlertModalModule, + PiwikServiceModule ], providers:[LoginGuard, PreviousRouteRecorder, IsRouteEnabled], declarations: [ diff --git a/claims/myClaims/myClaims.component.ts b/claims/myClaims/myClaims.component.ts index eacb7794..ed8b1e32 100644 --- a/claims/myClaims/myClaims.component.ts +++ b/claims/myClaims/myClaims.component.ts @@ -17,9 +17,10 @@ import {Meta, Title} from '@angular/platform-browser'; Manage your links in OpenAIRE
- + +
@@ -31,15 +32,10 @@ import {Meta, Title} from '@angular/platform-browser'; export class MyClaimsComponent { @Input() claimsInfoURL: string; @Input() communityId:string; - constructor(private _meta: Meta, private _title: Title) { - let title = "OpenAIRE | My links"; + @Input() piwikSiteId = null; - this._meta.updateTag({content: title}, "property='og:title'"); - this._title.setTitle(title); - } + constructor() {} - ngOnInit() { - - } + ngOnInit() {} } diff --git a/deposit/depositFirstPage.component.ts b/deposit/depositFirstPage.component.ts index ee2c1bfb..9f2e6abc 100644 --- a/deposit/depositFirstPage.component.ts +++ b/deposit/depositFirstPage.component.ts @@ -5,10 +5,14 @@ import {ActivatedRoute, Router} from "@angular/router"; import {PiwikService} from "../utils/piwik/piwik.service"; import {HelperService} from "../utils/helper/helper.service"; import {RouterHelper} from "../utils/routerHelper.class"; +import {SEOService} from "../sharedComponents/SEO/SEO.service"; +import {Meta, Title} from "@angular/platform-browser"; @Component({ selector: 'deposit-first-page', template: ` + +
@@ -147,6 +151,9 @@ import {RouterHelper} from "../utils/routerHelper.class"; }) export class DepositFirstPageComponent { + public url: string = null; + public title: string = "Deposit your research - Learn How"; + @Input() public zenodoInformation: ZenodoInformationClass = new ZenodoInformationClass(); @Input() piwikSiteId = null; piwiksub:any; @@ -164,13 +171,24 @@ export class DepositFirstPageComponent { constructor (private route: ActivatedRoute, private _piwikService:PiwikService, private helper: HelperService, - private _router: Router) {} + private _router: Router, + private _meta: Meta, private _title: Title, + private seoService: SEOService) { + } ngOnInit() { this.route.data .subscribe((data: { envSpecific: EnvProperties }) => { this.properties = data.envSpecific; + this.url = this.properties.baseLink+this._router.url; + this.seoService.createLinkForCanonicalURL(this.url, false); + + var description = "Openaire, Zenodo, repositories, open access, content provider, compatibility, deposit"; + this.updateTitle(this.title); + this.updateDescription(description); + this.updateUrl(this.url); + this.depositRoute = this.properties.depositSearchPage; //this.getDivContents(); this.getPageContents(); @@ -185,7 +203,7 @@ export class DepositFirstPageComponent { } if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){ - this.piwiksub = this._piwikService.trackView(this.properties, "Deposit your research (first page)", this.piwikSiteId).subscribe(); + this.piwiksub = this._piwikService.trackView(this.properties, this.title, this.piwikSiteId).subscribe(); } }); } @@ -207,4 +225,21 @@ export class DepositFirstPageComponent { this.piwiksub.unsubscribe(); } } + + private updateDescription(description:string) { + this._meta.updateTag({content:description},"name='description'"); + this._meta.updateTag({content:description},"property='og:description'"); + } + private updateTitle(title:string) { + var _prefix =""; + if(!this.communityId) { + _prefix ="OpenAIRE | "; + } + var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title); + this._title.setTitle(_title); + this._meta.updateTag({content:_title},"property='og:title'"); + } + private updateUrl(url:string) { + this._meta.updateTag({content:url},"property='og:url'"); + } } diff --git a/deposit/searchDataprovidersToDeposit.component.ts b/deposit/searchDataprovidersToDeposit.component.ts index 21863534..5cd5d93b 100644 --- a/deposit/searchDataprovidersToDeposit.component.ts +++ b/deposit/searchDataprovidersToDeposit.component.ts @@ -6,11 +6,10 @@ import {ErrorCodes} from '../utils/properties/errorCodes'; import {ErrorMessagesComponent} from '../utils/errorMessages.component'; import {SearchFields} from '../utils/properties/searchFields'; import {SearchPageComponent } from '../searchPages/searchUtils/searchPage.component'; -import {SearchCustomFilter, SearchUtilsClass} from '../searchPages/searchUtils/searchUtils.class'; +import {SearchUtilsClass} from '../searchPages/searchUtils/searchUtils.class'; import {EnvProperties} from '../utils/properties/env-properties'; import {StringUtils} from "../utils/string-utils.class"; import {ZenodoInformationClass} from "./utils/zenodoInformation.class"; -import {PiwikService} from "../utils/piwik/piwik.service"; import {RouterHelper} from "../utils/routerHelper.class"; @Component({ @@ -30,7 +29,7 @@ import {RouterHelper} from "../utils/routerHelper.class";
- 50) ? title.substring(0, 50) : title); this._title.setTitle(_title); this._meta.updateTag({content: _title}, "property='og:title'"); diff --git a/landingPages/dataset/dataset.component.ts b/landingPages/dataset/dataset.component.ts index 40b2d334..6d85e18c 100644 --- a/landingPages/dataset/dataset.component.ts +++ b/landingPages/dataset/dataset.component.ts @@ -210,7 +210,10 @@ export class DatasetComponent { } private updateTitle(title: string) { - var _prefix = "OpenAIRE | "; + var _prefix = ""; + if(!this.communityId) { + _prefix = "OpenAIRE | "; + } var _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title); this._title.setTitle(_title); this._meta.updateTag({content: _title}, "property='og:title'"); diff --git a/landingPages/htmlProjectReport/htmlProjectReport.component.ts b/landingPages/htmlProjectReport/htmlProjectReport.component.ts index a59d5fe4..3e787950 100644 --- a/landingPages/htmlProjectReport/htmlProjectReport.component.ts +++ b/landingPages/htmlProjectReport/htmlProjectReport.component.ts @@ -289,7 +289,10 @@ export class HtmlProjectReportComponent { } private updateTitle(title: string) { - var _prefix = "OpenAIRE | "; + var _prefix = ""; + if(!this.communityId) { + _prefix = "OpenAIRE | "; + } var _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title); this._title.setTitle(_title); this._meta.updateTag({content: _title}, "property='og:title'"); diff --git a/landingPages/organization/organization.component.ts b/landingPages/organization/organization.component.ts index 7d4ab666..3737b214 100644 --- a/landingPages/organization/organization.component.ts +++ b/landingPages/organization/organization.component.ts @@ -487,7 +487,10 @@ export class OrganizationComponent { } private updateTitle(title: string) { - var _prefix = "OpenAIRE | "; + var _prefix = ""; + if(!this.communityId) { + _prefix = "OpenAIRE | "; + } var _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title); this._title.setTitle(_title); this._meta.updateTag({content: _title}, "property='og:title'"); diff --git a/landingPages/orp/orp.component.ts b/landingPages/orp/orp.component.ts index 0da8d889..939e4ff2 100644 --- a/landingPages/orp/orp.component.ts +++ b/landingPages/orp/orp.component.ts @@ -196,7 +196,10 @@ export class OrpComponent { } private updateTitle(title: string) { - var _prefix = "OpenAIRE | "; + var _prefix = ""; + if(!this.communityId) { + _prefix = "OpenAIRE | "; + } var _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title); this._title.setTitle(_title); this._meta.updateTag({content: _title}, "property='og:title'"); diff --git a/landingPages/project/project.component.ts b/landingPages/project/project.component.ts index a020904c..24f6452f 100644 --- a/landingPages/project/project.component.ts +++ b/landingPages/project/project.component.ts @@ -488,7 +488,10 @@ export class ProjectComponent { } private updateTitle(title: string) { - var _prefix = "OpenAIRE | "; + var _prefix = ""; + if(!this.communityId) { + _prefix = "OpenAIRE | "; + } var _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title); this._title.setTitle(_title); this._meta.updateTag({content: _title}, "property='og:title'"); diff --git a/landingPages/publication/publication.component.ts b/landingPages/publication/publication.component.ts index ad68d0f8..80157ebf 100644 --- a/landingPages/publication/publication.component.ts +++ b/landingPages/publication/publication.component.ts @@ -272,10 +272,13 @@ export class PublicationComponent { } private updateTitle(title: string) { - var _prefix = "OpenAIRE | "; + var _prefix = ""; + if(!this.communityId) { + _prefix = "OpenAIRE | "; + } var _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title); - this._title.setTitle(title); - this._meta.updateTag({content: title}, "property='og:title'"); + this._title.setTitle(_title); + this._meta.updateTag({content: _title}, "property='og:title'"); } private updateUrl(url: string) { diff --git a/landingPages/software/software.component.ts b/landingPages/software/software.component.ts index 2be94d1c..0fd8590c 100644 --- a/landingPages/software/software.component.ts +++ b/landingPages/software/software.component.ts @@ -203,7 +203,10 @@ export class SoftwareComponent { } private updateTitle(title: string) { - var _prefix = "OpenAIRE | "; + var _prefix = ""; + if(!this.communityId) { + _prefix = "OpenAIRE | "; + } var _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title); this._title.setTitle(_title); this._meta.updateTag({content: _title}, "property='og:title'"); diff --git a/searchPages/advanced/advancedSearchDatasets.component.ts b/searchPages/advanced/advancedSearchDatasets.component.ts index 8ef58246..12188fea 100644 --- a/searchPages/advanced/advancedSearchDatasets.component.ts +++ b/searchPages/advanced/advancedSearchDatasets.component.ts @@ -24,7 +24,8 @@ import{EnvProperties} from '../../utils/properties/env-properties'; [csvParams]="csvParams" csvPath="datasets" simpleSearchLink="/search/find/datasets" [disableForms]="disableForms" [loadPaging]="loadPaging" - [oldTotalResults]="oldTotalResults" [piwikSiteId]=piwikSiteId + [oldTotalResults]="oldTotalResults" + [piwikSiteId]=piwikSiteId [hasPrefix]="hasPrefix" searchFormClass="datasetsSearchForm" [(sort)]=sort > @@ -37,6 +38,7 @@ export class AdvancedSearchDatasetsComponent { private errorMessages: ErrorMessagesComponent; properties:EnvProperties; @Input() piwikSiteId = null; + @Input() hasPrefix: boolean = true; @Input() customFilter:SearchCustomFilter= null; public results =[]; diff --git a/searchPages/advanced/advancedSearchOrps.component.ts b/searchPages/advanced/advancedSearchOrps.component.ts index 59838364..801994b1 100644 --- a/searchPages/advanced/advancedSearchOrps.component.ts +++ b/searchPages/advanced/advancedSearchOrps.component.ts @@ -24,7 +24,8 @@ import{EnvProperties} from '../../utils/properties/env-properties'; [csvParams]="csvParams" csvPath="other" simpleSearchLink="/search/find/other" [disableForms]="disableForms" [loadPaging]="loadPaging" - [oldTotalResults]="oldTotalResults" [piwikSiteId]=piwikSiteId + [oldTotalResults]="oldTotalResults" + [piwikSiteId]=piwikSiteId [hasPrefix]="hasPrefix" searchFormClass="orpsSearchForm" [(sort)]=sort > @@ -36,7 +37,8 @@ export class AdvancedSearchOrpsComponent { private errorCodes: ErrorCodes; private errorMessages: ErrorMessagesComponent; properties:EnvProperties; -@Input() piwikSiteId = null; + @Input() piwikSiteId = null; + @Input() hasPrefix: boolean = true; @Input() customFilter:SearchCustomFilter= null; public results =[]; diff --git a/searchPages/advanced/advancedSearchPublications.component.ts b/searchPages/advanced/advancedSearchPublications.component.ts index 51749284..80322f3d 100644 --- a/searchPages/advanced/advancedSearchPublications.component.ts +++ b/searchPages/advanced/advancedSearchPublications.component.ts @@ -26,7 +26,7 @@ import{EnvProperties} from '../../utils/properties/env-properties'; [loadPaging]="loadPaging" [oldTotalResults]="oldTotalResults" [(openaireLink)]=openaireLink - [piwikSiteId]=piwikSiteId + [piwikSiteId]=piwikSiteId [hasPrefix]="hasPrefix" searchFormClass="publicationsSearchForm" [(sort)]=sort > @@ -36,7 +36,8 @@ import{EnvProperties} from '../../utils/properties/env-properties'; export class AdvancedSearchPublicationsComponent { private errorCodes: ErrorCodes; private errorMessages: ErrorMessagesComponent; -@Input() piwikSiteId = null; + @Input() piwikSiteId = null; + @Input() hasPrefix: boolean = true; public results =[]; public filters =[]; diff --git a/searchPages/advanced/advancedSearchSoftware.component.ts b/searchPages/advanced/advancedSearchSoftware.component.ts index d8ae0f6e..f6a18296 100644 --- a/searchPages/advanced/advancedSearchSoftware.component.ts +++ b/searchPages/advanced/advancedSearchSoftware.component.ts @@ -24,7 +24,8 @@ import{EnvProperties} from '../../utils/properties/env-properties'; [csvParams]="csvParams" csvPath="software" simpleSearchLink="/search/find/software" [disableForms]="disableForms" [loadPaging]="loadPaging" - [oldTotalResults]="oldTotalResults" [piwikSiteId]=piwikSiteId + [oldTotalResults]="oldTotalResults" + [piwikSiteId]=piwikSiteId [hasPrefix]="hasPrefix" searchFormClass="softwareSearchForm" [(sort)]=sort > @@ -35,7 +36,8 @@ import{EnvProperties} from '../../utils/properties/env-properties'; export class AdvancedSearchSoftwareComponent { private errorCodes: ErrorCodes; private errorMessages: ErrorMessagesComponent; -@Input() piwikSiteId = null; + @Input() piwikSiteId = null; + @Input() hasPrefix: boolean = true; @Input() customFilter:SearchCustomFilter= null; public results =[]; public filters =[]; diff --git a/searchPages/searchUtils/advancedSearchPage.component.ts b/searchPages/searchUtils/advancedSearchPage.component.ts index 025882c1..c74e7d24 100644 --- a/searchPages/searchUtils/advancedSearchPage.component.ts +++ b/searchPages/searchUtils/advancedSearchPage.component.ts @@ -21,6 +21,7 @@ import {HelperService} from "../../utils/helper/helper.service"; }) export class AdvancedSearchPageComponent { @Input() piwikSiteId = null; + @Input() hasPrefix: boolean = true; @Input() pageTitle = ""; @Input() results = []; @Input() type; @@ -89,10 +90,9 @@ export class AdvancedSearchPageComponent { } }); - var title = "Advanced search " + this.pageTitle; var description = "Openaire, search, repositories, open access, type, content provider, funder, project, " + this.pageTitle; - this.updateTitle(title); + this.updateTitle(this.pageTitle); this.updateDescription(description); this.searchUtils.baseUrl = "/" + this.searchUtils.baseUrl; @@ -128,7 +128,10 @@ export class AdvancedSearchPageComponent { } updateTitle(title: string) { - var _prefix = "OpenAIRE | "; + var _prefix = ""; + if(this.hasPrefix) { + _prefix = "OpenAIRE | "; + } var _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title); this._title.setTitle(_title); this._meta.updateTag({content: _title}, "property='og:title'"); diff --git a/searchPages/searchUtils/searchPage.component.ts b/searchPages/searchUtils/searchPage.component.ts index dc4dab0f..56161421 100644 --- a/searchPages/searchUtils/searchPage.component.ts +++ b/searchPages/searchUtils/searchPage.component.ts @@ -147,7 +147,7 @@ export class SearchPageComponent { updateTitle(title:string) { let _title: string; - if(this.hasPrefix) { + if(this.hasPrefix && !this.customFilter) { let _prefix ="OpenAIRE | "; _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title); } else { diff --git a/searchPages/searchUtils/searchPageTableView.component.ts b/searchPages/searchUtils/searchPageTableView.component.ts index 7fd46340..797a2d48 100644 --- a/searchPages/searchUtils/searchPageTableView.component.ts +++ b/searchPages/searchUtils/searchPageTableView.component.ts @@ -39,6 +39,7 @@ import { SEOService } from '../../sharedComponents/SEO/SEO.service'; }) export class SearchPageTableViewComponent implements OnInit, AfterViewInit { @Input() piwikSiteId = null; + @Input() hasPrefix: boolean = true; @Input() pageTitle = ""; @Input() results; @Input() filters = []; @@ -165,7 +166,10 @@ export class SearchPageTableViewComponent implements OnInit, AfterViewInit { this._meta.updateTag({content:description},"property='og:description'"); } updateTitle(title:string) { - var _prefix ="OpenAIRE | "; + var _prefix: string = ""; + if(this.hasPrefix) { + _prefix = "OpenAIRE | "; + } var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title); this._title.setTitle(_title); this._meta.updateTag({content:_title},"property='og:title'"); diff --git a/searchPages/simple/searchDatasets.component.ts b/searchPages/simple/searchDatasets.component.ts index f7291ed4..33e47749 100644 --- a/searchPages/simple/searchDatasets.component.ts +++ b/searchPages/simple/searchDatasets.component.ts @@ -30,7 +30,7 @@ import{EnvProperties} from '../../utils/properties/env-properties'; 'communityPanelBackground' : 'datasetsSearchForm'" [(openaireLink)]=openaireLink [(advancedSearchParameters)]=advancedSearchParameters - [piwikSiteId]=piwikSiteId + [piwikSiteId]=piwikSiteId [hasPrefix]="hasPrefix" [(sort)]=sort > @@ -40,7 +40,8 @@ import{EnvProperties} from '../../utils/properties/env-properties'; export class SearchDatasetsComponent { private errorCodes: ErrorCodes; private errorMessages: ErrorMessagesComponent; -@Input() piwikSiteId = null; + @Input() piwikSiteId = null; + @Input() hasPrefix: boolean = true; public results =[]; public filters: Filter[] =[]; // public totalResults:number = 0 ; diff --git a/searchPages/simple/searchOrps.component.ts b/searchPages/simple/searchOrps.component.ts index 13b23536..e2437729 100644 --- a/searchPages/simple/searchOrps.component.ts +++ b/searchPages/simple/searchOrps.component.ts @@ -30,7 +30,7 @@ import{EnvProperties} from '../../utils/properties/env-properties'; 'communityPanelBackground' : 'orpsSearchForm'" [(openaireLink)]=openaireLink [(advancedSearchParameters)]=advancedSearchParameters - [piwikSiteId]=piwikSiteId + [piwikSiteId]=piwikSiteId [hasPrefix]="hasPrefix" [(sort)]=sort > ` @@ -40,6 +40,7 @@ export class SearchOrpsComponent { private errorCodes: ErrorCodes; private errorMessages: ErrorMessagesComponent; @Input() piwikSiteId = null; + @Input() hasPrefix: boolean = true; public results =[]; public filters: Filter[] =[]; public baseUrl:string; diff --git a/searchPages/simple/searchPublications.component.ts b/searchPages/simple/searchPublications.component.ts index d07d1f30..596ce68c 100644 --- a/searchPages/simple/searchPublications.component.ts +++ b/searchPages/simple/searchPublications.component.ts @@ -31,7 +31,7 @@ import {EnvProperties} from '../../utils/properties/env-properties'; 'communityPanelBackground' : 'publicationsSearchForm'" [(openaireLink)]=openaireLink [(advancedSearchParameters)]=advancedSearchParameters - [piwikSiteId]=piwikSiteId + [piwikSiteId]=piwikSiteId [hasPrefix]="hasPrefix" [(sort)]=sort > @@ -41,7 +41,8 @@ import {EnvProperties} from '../../utils/properties/env-properties'; export class SearchPublicationsComponent { private errorCodes: ErrorCodes; private errorMessages: ErrorMessagesComponent; -@Input() piwikSiteId = null; + @Input() piwikSiteId = null; + @Input() hasPrefix: boolean = true; public results =[]; public filters =[]; public searchUtils:SearchUtilsClass = new SearchUtilsClass(); diff --git a/searchPages/simple/searchSoftware.component.ts b/searchPages/simple/searchSoftware.component.ts index 5146cda5..0b82a2d1 100644 --- a/searchPages/simple/searchSoftware.component.ts +++ b/searchPages/simple/searchSoftware.component.ts @@ -30,7 +30,7 @@ import{EnvProperties} from '../../utils/properties/env-properties'; 'communityPanelBackground' : 'softwareSearchForm'" [(openaireLink)]=openaireLink [(advancedSearchParameters)]=advancedSearchParameters - [piwikSiteId]=piwikSiteId + [piwikSiteId]=piwikSiteId [hasPrefix]="hasPrefix" [(sort)]=sort > ` @@ -43,6 +43,7 @@ export class SearchSoftwareComponent { @Input() customFilter:SearchCustomFilter= null; @Input() advancedSearchParameters ; @Input() piwikSiteId = null; + @Input() hasPrefix: boolean = true; public results =[]; public filters: Filter[] =[]; // public totalResults:number = 0 ;