data-transfer-v2 #6

Merged
konstantina.galouni merged 26 commits from data-transfer-v2 into develop 2023-06-13 16:20:04 +02:00
7 changed files with 75 additions and 24 deletions
Showing only changes of commit e02ac38b7c - Show all commits

View File

@ -7,6 +7,7 @@ import {properties} from "../../../environments/environment";
import {RESPONSE} from '../utils/tokens';
import {Response} from 'express';
import {OpenaireEntities} from "../utils/properties/searchFields";
import {EnvProperties} from "../utils/properties/env-properties";
@Component({
selector: 'error',
@ -23,7 +24,8 @@ import {OpenaireEntities} from "../utils/properties/searchFields";
</h3>
<h6 *ngIf="page_type" class="uk-margin-remove">
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>
<br>
<div *ngIf="page !='-1'">
@ -48,7 +50,9 @@ export class ErrorPageComponent {
public page_type: string;
public searchPage: string;
public searchPagePrams: {};
public searchPagePramsString: string = "";
public page_type_name: string;
public properties: EnvProperties = properties;
constructor (private _location: Location, private _meta: Meta,
private _title: Title, private route: ActivatedRoute,
@ -84,17 +88,21 @@ export class ErrorPageComponent {
if (this.page_type == "publication") {
this.searchPage = properties.searchLinkToResults;
this.searchPagePrams = {type: 'publications'}
this.searchPagePramsString = "&type=publications";
this.page_type_name = OpenaireEntities.PUBLICATION.toLowerCase();
} else if (this.page_type == "software") {
this.searchPage = properties.searchLinkToResults;
this.searchPagePrams = {type: 'software'}
this.searchPagePramsString = "&type=software";
this.page_type_name = OpenaireEntities.SOFTWARE_SINGULAR.toLowerCase();
} else if (this.page_type == "dataset") {
this.searchPagePrams = {type: 'datasets'}
this.searchPagePramsString = "&type=datasets";
this.searchPage = properties.searchLinkToResults;
this.page_type_name = OpenaireEntities.DATASET.toLowerCase();
} else if (this.page_type == "orp") {
this.searchPagePrams = {type: 'orps'}
this.searchPagePramsString = "&type=orps";
this.searchPage = properties.searchLinkToResults;
this.page_type_name = OpenaireEntities.OTHER_SINGULAR.toLowerCase();
} else if (this.page_type == "organization") {
@ -113,6 +121,11 @@ export class ErrorPageComponent {
this.searchPage = properties.searchLinkToResults;
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>
</td>
<td *ngIf="fetchResults.results.length > 0" class="uk-text-center">
<a
[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"
(click)="onLinkClick()">
<a *ngIf="properties.adminToolsPortalType !== 'eosc'"
[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"
(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}}
</a>
</td>

View File

@ -14,17 +14,25 @@ import {StringUtils} from "../../utils/string-utils.class";
</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="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">
<span class="">View all & feedback</span>
</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>
</div>
<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">
<a [routerLink]="properties.searchLinkToResults"
[queryParams]="{'fos': urlEncodeAndQuote(subject)}">
<a *ngIf="properties.adminToolsPortalType !== 'eosc'"
[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}}
</a>
</div>

View File

@ -15,10 +15,13 @@ import {StringUtils} from "../../utils/string-utils.class";
</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="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">
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>
</div>
@ -27,8 +30,12 @@ import {StringUtils} from "../../utils/string-utils.class";
loading="lazy" alt="sdg_colors" style="width:27px; height:27px">
<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">
<a [routerLink]=" properties.searchLinkToResults"
[queryParams]="{'sdg': urlEncodeAndQuote(subject)}">
<a *ngIf="properties.adminToolsPortalType !== 'eosc'"
[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}}
</a>
</div>

View File

@ -112,14 +112,16 @@ export class OpenAireJsonldConverterService {
doc.license = this.getLicense(result);
doc.keyword = this.getKeyword(result);
doc.isPartOf = [];
let fosSubjects = this.getKeyword(result,"FOS");
let sdgSubjects = this.getKeyword(result,"SDG");
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+'"'));
}
if(properties.adminToolsPortalType !== 'eosc') {
let fosSubjects = this.getKeyword(result, "FOS");
let sdgSubjects = this.getKeyword(result, "SDG");
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 + '"'));
}
}
return doc;
}

View File

@ -60,12 +60,17 @@ import {properties} from "../../../../environments/environment";
{{author.fullName}} in OpenAIRE
</div>
<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()"
[queryParams]="routerHelper.createQueryParams(['orcid','oc'],[(author['orcid'] ? author['orcid'] : author['orcid_pending']),'and'])"
routerLinkActive="router-link-active" [routerLink]="properties.searchLinkToAdvancedResults">
<span class="space">Search</span>
</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>

View File

@ -7,7 +7,7 @@ import {StringUtils} from "../../string-utils.class";
@Component({
selector: 'search-tab',
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>
<ng-container> <!-- *ngIf="fetch.searchUtils.status != errorCodes.LOADING" -->
@ -19,10 +19,14 @@ import {StringUtils} from "../../string-utils.class";
<span *ngIf="customTitle">{{customTitle}}</span>
</div>
<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
<span *ngIf="fetch.searchUtils.totalResults <= searchNumber">in search page</span>
</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>
@ -72,4 +76,12 @@ export class SearchTabComponent {
get 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;
}
}