[Library | develop & EOSC Explore | master]: Redirect to eosc search for any page except landing | If property adminToolsPortalType is eosc, open search links to OpenAIRE Explore in a new tab.

1. home.component.html: Commented everything.
2. home.component.ts: Commented everything and added redirect to EOSC search.
3. app.component.ts: Commented <navbar>.
4. app-routing.module.ts: Removed unused routes | For any route other than landing, redirect to home page.
5. index.html: Removed BETA badge | Updated title from "Search OpenAIRE" to "Search EOSC".
6. errorPage.component.ts & relatedDatasourcesTab.component.ts & showAuthors.component.ts & search-tab.component.ts: If property adminToolsPortalType is eosc, open search page in OpenAIRE Explore in a new tab.
7. fos.component.ts & sdg.component.ts: If property adminToolsPortalType is eosc, open search page in OpenAIRE Explore in a new tab | If property adminToolsPortalType is eosc, do not show "feedback/suggest" link.
8. open-aire-jsonld-converter.service.ts: If property adminToolsPortalType is eosc, do not add fos and sdgs as doc.isPartOf.
This commit is contained in:
Konstantina Galouni 2023-03-09 10:54:03 +02:00
parent 1d2a0effa8
commit b25c6dd2f7
7 changed files with 75 additions and 24 deletions

View File

@ -7,6 +7,7 @@ import {properties} from "../../../environments/environment";
import {RESPONSE} from '../utils/tokens'; import {RESPONSE} from '../utils/tokens';
import {Response} from 'express'; import {Response} from 'express';
import {OpenaireEntities} from "../utils/properties/searchFields"; import {OpenaireEntities} from "../utils/properties/searchFields";
import {EnvProperties} from "../utils/properties/env-properties";
@Component({ @Component({
selector: 'error', selector: 'error',
@ -23,7 +24,8 @@ import {OpenaireEntities} from "../utils/properties/searchFields";
</h3> </h3>
<h6 *ngIf="page_type" class="uk-margin-remove"> <h6 *ngIf="page_type" class="uk-margin-remove">
Not valid or missing {{page_type_name}} id. Not valid or missing {{page_type_name}} id.
<a *ngIf="page_type" routerLinkActive="router-link-active" [routerLink]="searchPage" [queryParams]="searchPagePrams">Search </a>another {{page_type_name}}? <a *ngIf="page_type && properties.adminToolsPortalType !== 'eosc'" routerLinkActive="router-link-active" [routerLink]="searchPage" [queryParams]="searchPagePrams">Search </a>another {{page_type_name}}?
<a *ngIf="page_type && properties.adminToolsPortalType == 'eosc'" [href]="searchPage" target="_blank" class="custom-external">Search </a>another {{page_type_name}} in OpenAIRE?
</h6> </h6>
<br> <br>
<div *ngIf="page !='-1'"> <div *ngIf="page !='-1'">
@ -48,7 +50,9 @@ export class ErrorPageComponent {
public page_type: string; public page_type: string;
public searchPage: string; public searchPage: string;
public searchPagePrams: {}; public searchPagePrams: {};
public searchPagePramsString: string = "";
public page_type_name: string; public page_type_name: string;
public properties: EnvProperties = properties;
constructor (private _location: Location, private _meta: Meta, constructor (private _location: Location, private _meta: Meta,
private _title: Title, private route: ActivatedRoute, private _title: Title, private route: ActivatedRoute,
@ -84,17 +88,21 @@ export class ErrorPageComponent {
if (this.page_type == "publication") { if (this.page_type == "publication") {
this.searchPage = properties.searchLinkToResults; this.searchPage = properties.searchLinkToResults;
this.searchPagePrams = {type: 'publications'} this.searchPagePrams = {type: 'publications'}
this.searchPagePramsString = "&type=publications";
this.page_type_name = OpenaireEntities.PUBLICATION.toLowerCase(); this.page_type_name = OpenaireEntities.PUBLICATION.toLowerCase();
} else if (this.page_type == "software") { } else if (this.page_type == "software") {
this.searchPage = properties.searchLinkToResults; this.searchPage = properties.searchLinkToResults;
this.searchPagePrams = {type: 'software'} this.searchPagePrams = {type: 'software'}
this.searchPagePramsString = "&type=software";
this.page_type_name = OpenaireEntities.SOFTWARE_SINGULAR.toLowerCase(); this.page_type_name = OpenaireEntities.SOFTWARE_SINGULAR.toLowerCase();
} else if (this.page_type == "dataset") { } else if (this.page_type == "dataset") {
this.searchPagePrams = {type: 'datasets'} this.searchPagePrams = {type: 'datasets'}
this.searchPagePramsString = "&type=datasets";
this.searchPage = properties.searchLinkToResults; this.searchPage = properties.searchLinkToResults;
this.page_type_name = OpenaireEntities.DATASET.toLowerCase(); this.page_type_name = OpenaireEntities.DATASET.toLowerCase();
} else if (this.page_type == "orp") { } else if (this.page_type == "orp") {
this.searchPagePrams = {type: 'orps'} this.searchPagePrams = {type: 'orps'}
this.searchPagePramsString = "&type=orps";
this.searchPage = properties.searchLinkToResults; this.searchPage = properties.searchLinkToResults;
this.page_type_name = OpenaireEntities.OTHER_SINGULAR.toLowerCase(); this.page_type_name = OpenaireEntities.OTHER_SINGULAR.toLowerCase();
} else if (this.page_type == "organization") { } else if (this.page_type == "organization") {
@ -113,6 +121,11 @@ export class ErrorPageComponent {
this.searchPage = properties.searchLinkToResults; this.searchPage = properties.searchLinkToResults;
this.page_type_name = OpenaireEntities.RESULT.toLowerCase(); this.page_type_name = OpenaireEntities.RESULT.toLowerCase();
} }
if(properties.adminToolsPortalType == 'eosc') {
this.searchPage = "https://explore.openaire.eu"+this.searchPage+this.searchPagePramsString;
}
} }
}); });
} }

View File

@ -46,10 +46,14 @@ import {OpenaireEntities} from "../../utils/properties/searchFields";
</a> </a>
</td> </td>
<td *ngIf="fetchResults.results.length > 0" class="uk-text-center"> <td *ngIf="fetchResults.results.length > 0" class="uk-text-center">
<a <a *ngIf="properties.adminToolsPortalType !== 'eosc'"
[queryParams]="routerHelper.createQueryParams(['f0', 'fv0', 'f1', 'fv1', 'f2', 'fv2', 'qf'], ['collectedfromdatasourceid', dataproviderId, 'resulthostingdatasourceid,or', dataproviderId, 'resulthostingdatasourceid', result.id, 'false'])" [queryParams]="routerHelper.createQueryParams(['f0', 'fv0', 'f1', 'fv1', 'f2', 'fv2', 'qf'], ['collectedfromdatasourceid', dataproviderId, 'resulthostingdatasourceid,or', dataproviderId, 'resulthostingdatasourceid', result.id, 'false'])"
routerLinkActive="router-link-active" [routerLink]="properties.searchLinkToAdvancedResults" routerLinkActive="router-link-active" [routerLink]="properties.searchLinkToAdvancedResults"
(click)="onLinkClick()"> (click)="onLinkClick()">
{{result.count | number}}
</a>
<a *ngIf="properties.adminToolsPortalType == 'eosc'" class="custom-external" target="_blank"
[href]="'https://explore.openaire.eu'+properties.searchLinkToAdvancedResults+'?f0=collectedfromdatasourceid&fv0='+dataproviderId+'&f1=resulthostingdatasourceid,or&fv1='+dataproviderId+'&f2=resulthostingdatasourceid&fv2='+result.id+'&qf=false'">
{{result.count | number}} {{result.count | number}}
</a> </a>
</td> </td>

View File

@ -14,17 +14,25 @@ import {StringUtils} from "../../utils/string-utils.class";
</span> </span>
<span *ngIf="!viewAll" class="uk-text-light-grey uk-text-nowrap uk-margin-small-right">{{title}}</span> <span *ngIf="!viewAll" class="uk-text-light-grey uk-text-nowrap uk-margin-small-right">{{title}}</span>
<!-- <a *ngIf="viewAll && lessBtn" (click)="viewAll = !viewAll; lessBtn=false;">View less</a>--> <!-- <a *ngIf="viewAll && lessBtn" (click)="viewAll = !viewAll; lessBtn=false;">View less</a>-->
<a *ngIf="subjects && subjects.length > threshold && !viewAll" <a *ngIf="properties.adminToolsPortalType == 'eosc' && subjects && subjects.length > threshold && !viewAll"
(click)="viewAllClick();" class="view-more-less-link uk-text-truncate" uk-tooltip="View all">
<span class="">View all</span>
</a>
<a *ngIf="properties.adminToolsPortalType !== 'eosc' && subjects && subjects.length > threshold && !viewAll"
(click)="viewAllClick();" class="view-more-less-link uk-text-truncate" uk-tooltip="View all & feedback"> (click)="viewAllClick();" class="view-more-less-link uk-text-truncate" uk-tooltip="View all & feedback">
<span class="">View all & feedback</span> <span class="">View all & feedback</span>
</a> </a>
<a *ngIf="(subjects && subjects.length <= threshold || viewAll)" class="uk-link uk-text-truncate" <a *ngIf="properties.adminToolsPortalType !== 'eosc' && (subjects && subjects.length <= threshold || viewAll)" class="uk-link uk-text-truncate"
(click)="feedbackClick();">Feedback</a> (click)="feedbackClick();">Feedback</a>
</div> </div>
<div class="uk-margin-small-top"> <div class="uk-margin-small-top">
<div *ngFor="let subject of subjects.slice(0, viewAll?subjects.length:threshold); let i=index" class="uk-text-truncate"> <div *ngFor="let subject of subjects.slice(0, viewAll?subjects.length:threshold); let i=index" class="uk-text-truncate">
<a [routerLink]="properties.searchLinkToResults" <a *ngIf="properties.adminToolsPortalType !== 'eosc'"
[queryParams]="{'fos': urlEncodeAndQuote(subject)}"> [routerLink]="properties.searchLinkToResults" [queryParams]="{'fos': urlEncodeAndQuote(subject)}">
{{subject}}
</a>
<a *ngIf="properties.adminToolsPortalType == 'eosc'" class="custom-external" target="_blank"
[href]="'https://explore.openaire.eu'+properties.searchLinkToResults+'?fos='+urlEncodeAndQuote(subject)">
{{subject}} {{subject}}
</a> </a>
</div> </div>

View File

@ -15,10 +15,13 @@ import {StringUtils} from "../../utils/string-utils.class";
</span> </span>
<span *ngIf="!viewAll" class="uk-text-light-grey uk-text-nowrap uk-margin-small-right" uk-tooltip="Sustainable Development Goals">{{title}}</span> <span *ngIf="!viewAll" class="uk-text-light-grey uk-text-nowrap uk-margin-small-right" uk-tooltip="Sustainable Development Goals">{{title}}</span>
<!-- <a *ngIf="viewAll && lessBtn" (click)="viewAll = !viewAll; lessBtn=false;">View less</a>--> <!-- <a *ngIf="viewAll && lessBtn" (click)="viewAll = !viewAll; lessBtn=false;">View less</a>-->
<a *ngIf="subjects && subjects.length > threshold && !viewAll" <a *ngIf="properties.adminToolsPortalType == 'eosc' && subjects && subjects.length > threshold && !viewAll"
(click)="viewAllClick();" class="view-more-less-link uk-text-truncate" uk-tooltip="View all">
View all</a>
<a *ngIf="properties.adminToolsPortalType !== 'eosc' && subjects && subjects.length > threshold && !viewAll"
(click)="viewAllClick();" class="view-more-less-link uk-text-truncate" uk-tooltip="View all & feedback"> (click)="viewAllClick();" class="view-more-less-link uk-text-truncate" uk-tooltip="View all & feedback">
View all & feedback</a> View all & feedback</a>
<a *ngIf="(subjects && subjects.length <= threshold || viewAll)" class="uk-link uk-text-truncate" <a *ngIf="properties.adminToolsPortalType !== 'eosc' && (subjects && subjects.length <= threshold || viewAll)" class="uk-link uk-text-truncate"
(click)="feedbackClick();">Feedback</a> (click)="feedbackClick();">Feedback</a>
</div> </div>
@ -27,8 +30,12 @@ import {StringUtils} from "../../utils/string-utils.class";
loading="lazy" alt="sdg_colors" style="width:27px; height:27px"> loading="lazy" alt="sdg_colors" style="width:27px; height:27px">
<div class="uk-margin-small-left"> <div class="uk-margin-small-left">
<div *ngFor="let subject of subjects.slice(0, viewAll?subjects.length:threshold); let i=index" class="uk-text-truncate"> <div *ngFor="let subject of subjects.slice(0, viewAll?subjects.length:threshold); let i=index" class="uk-text-truncate">
<a [routerLink]=" properties.searchLinkToResults" <a *ngIf="properties.adminToolsPortalType !== 'eosc'"
[queryParams]="{'sdg': urlEncodeAndQuote(subject)}"> [routerLink]=" properties.searchLinkToResults" [queryParams]="{'sdg': urlEncodeAndQuote(subject)}">
{{subject}}
</a>
<a *ngIf="properties.adminToolsPortalType == 'eosc'" class="custom-external" target="_blank"
[href]="'https://explore.openaire.eu'+properties.searchLinkToResults+'?sdg='+urlEncodeAndQuote(subject)">
{{subject}} {{subject}}
</a> </a>
</div> </div>

View File

@ -112,14 +112,16 @@ export class OpenAireJsonldConverterService {
doc.license = this.getLicense(result); doc.license = this.getLicense(result);
doc.keyword = this.getKeyword(result); doc.keyword = this.getKeyword(result);
doc.isPartOf = []; doc.isPartOf = [];
let fosSubjects = this.getKeyword(result,"FOS"); if(properties.adminToolsPortalType !== 'eosc') {
let sdgSubjects = this.getKeyword(result,"SDG"); let fosSubjects = this.getKeyword(result, "FOS");
for(let fos of fosSubjects?fosSubjects:[]){ let sdgSubjects = this.getKeyword(result, "SDG");
doc.isPartOf.push(URL.split('/search/')[0]+ searchActionRoute + "?fos=" + encodeURIComponent('"'+fos+'"')); for (let fos of fosSubjects ? fosSubjects : []) {
} doc.isPartOf.push(URL.split('/search/')[0] + searchActionRoute + "?fos=" + encodeURIComponent('"' + fos + '"'));
for(let sdg of sdgSubjects?sdgSubjects:[] ){ }
doc.isPartOf.push(URL.split('/search/')[0]+ searchActionRoute + "?sdg=" + encodeURIComponent('"'+sdg+'"')); for (let sdg of sdgSubjects ? sdgSubjects : []) {
} doc.isPartOf.push(URL.split('/search/')[0] + searchActionRoute + "?sdg=" + encodeURIComponent('"' + sdg + '"'));
}
}
return doc; return doc;
} }

View File

@ -60,12 +60,17 @@ import {properties} from "../../../../environments/environment";
{{author.fullName}} in OpenAIRE {{author.fullName}} in OpenAIRE
</div> </div>
<div class="uk-text-center uk-margin-top uk-margin-large-left uk-margin-large-right"> <div class="uk-text-center uk-margin-top uk-margin-large-left uk-margin-large-right">
<a class="uk-button uk-button-primary uk-text-bold uk-padding-remove-top uk-padding-remove-bottom" <a *ngIf="properties.adminToolsPortalType !== 'eosc'" class="uk-button uk-button-primary uk-text-bold uk-padding-remove-top uk-padding-remove-bottom"
(click)="onClick()" (click)="onClick()"
[queryParams]="routerHelper.createQueryParams(['orcid','oc'],[(author['orcid'] ? author['orcid'] : author['orcid_pending']),'and'])" [queryParams]="routerHelper.createQueryParams(['orcid','oc'],[(author['orcid'] ? author['orcid'] : author['orcid_pending']),'and'])"
routerLinkActive="router-link-active" [routerLink]="properties.searchLinkToAdvancedResults"> routerLinkActive="router-link-active" [routerLink]="properties.searchLinkToAdvancedResults">
<span class="space">Search</span> <span class="space">Search</span>
</a> </a>
<a *ngIf="properties.adminToolsPortalType == 'eosc'" class="uk-button uk-button-primary uk-text-bold uk-padding-remove-top uk-padding-remove-bottom uk-light"
[href]="'https://explore.openaire.eu'+properties.searchLinkToAdvancedResults+'?orcid='+(author['orcid'] ? author['orcid'] : author['orcid_pending'])+'&oc=and'"
target="_blank">
<span class="space custom-external">Search in OpenAIRE</span>
</a>
</div> </div>
</div> </div>
</div> </div>

View File

@ -7,7 +7,7 @@ import {StringUtils} from "../../string-utils.class";
@Component({ @Component({
selector: 'search-tab', selector: 'search-tab',
template: ` template: `
<a *ngIf="fetch.searchUtils.status == errorCodes.LOADING" class="uk-invisible" <a *ngIf="properties.adminToolsPortalType !== 'eosc' && fetch.searchUtils.status == errorCodes.LOADING" class="uk-invisible"
[queryParams]="params" [routerLink]="searchLinkToAdvancedPage"></a> [queryParams]="params" [routerLink]="searchLinkToAdvancedPage"></a>
<ng-container> <!-- *ngIf="fetch.searchUtils.status != errorCodes.LOADING" --> <ng-container> <!-- *ngIf="fetch.searchUtils.status != errorCodes.LOADING" -->
@ -19,10 +19,14 @@ import {StringUtils} from "../../string-utils.class";
<span *ngIf="customTitle">{{customTitle}}</span> <span *ngIf="customTitle">{{customTitle}}</span>
</div> </div>
<div *ngIf="searchLinkToAdvancedPage"> <div *ngIf="searchLinkToAdvancedPage">
<a class="el-content uk-button uk-button-text" [queryParams]="params" [routerLink]="searchLinkToAdvancedPage"> <a *ngIf="properties.adminToolsPortalType !== 'eosc'" class="el-content uk-button uk-button-text" [queryParams]="params" [routerLink]="searchLinkToAdvancedPage">
View all View all
<span *ngIf="fetch.searchUtils.totalResults <= searchNumber">in search page</span> <span *ngIf="fetch.searchUtils.totalResults <= searchNumber">in search page</span>
</a> </a>
<a *ngIf="properties.adminToolsPortalType == 'eosc'" class="el-content uk-button uk-button-text custom-external"
[href]="'https://explore.openaire.eu'+searchLinkToAdvancedPage+paramsForExternalUrl" target="_blank">
View all in OpenAIRE
</a>
</div> </div>
</div> </div>
@ -72,4 +76,12 @@ export class SearchTabComponent {
get results() { get results() {
return this.currentPage ? this.fetch.results.slice((this.currentPage - 1) * this.searchNumber, this.currentPage * this.searchNumber) : this.fetch.results; return this.currentPage ? this.fetch.results.slice((this.currentPage - 1) * this.searchNumber, this.currentPage * this.searchNumber) : this.fetch.results;
} }
get paramsForExternalUrl() {
let parameters: string = "";
Object.keys(this.params).forEach(paramKey => {
parameters += (parameters ? "&" : "?") + paramKey+"="+this.params[paramKey];
})
return parameters;
}
} }