[Library|Trunk]

Update Search page to show funders:
	update communitySearchResults.component to get also funders


git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@57791 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2019-12-03 10:45:28 +00:00
parent c6186bb738
commit ed0f47ad72
6 changed files with 50 additions and 19 deletions

View File

@ -2,7 +2,7 @@
<errorMessages [status]="[status]" [type]="'results'"></errorMessages>
<li *ngFor="let result of results" class="uk-animation-fade uk-margin-auto" uk-grid>
<a *ngIf="directLink" [href]="getCommunityPageUrl(result.communityId)" target="_blank"
<a *ngIf="directLink" [href]="getCommunityPageUrl(result)" target="_blank"
class="uk-width-1-5 uk-height-small uk-card uk-card-default uk-card-small communityCard uk-padding-remove-horizontal uk-inline">
<div *ngIf="result.isSubscribed"
class="uk-position-top-right uk-card-badge portal-card-badge uk-width-1-2 uk-text-small uk-text-center">
@ -11,7 +11,7 @@
<div class="uk-card-body uk-position-center uk-flex uk-flex-middle uk-flex-center">
<img *ngIf="result.logoUrl != null && result.logoUrl != '' " src="{{result.logoUrl}}"
alt="{{(result.title)?result.title:result.shortTitle}} logo">
<span *ngIf="result.logoUrl == null || result.logoUrl == '' " class="uk-icon">
<span *ngIf="result.logoUrl == null || result.logoUrl == '' && result.type != 'funder'" class="uk-icon">
<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="2.5"> <circle fill="none"
stroke="#000"
stroke-width="1.1"
@ -23,6 +23,8 @@
stroke-width="1.1"
d="M11.4,4 C12.8,2.4 15.4,2.8 16.3,4.7 C17.2,6.6 15.7,8.9 13.6,8.9 C16.5,8.9 18.8,11.3 19.2,14.1"></path></svg>
</span>
<div *ngIf="(result.logoUrl == null || result.logoUrl == '' ) && result.type == 'funder' "
[class]="'funderLogo ' + result['jurisdictionLogo'] "></div>
</div>
<div *ngIf="result.status == 'manager'"
class="uk-card-badge private-card-badge uk-width-2-5 uk-position-top-left uk-text-small uk-text-center ">
@ -39,7 +41,7 @@
<div class="uk-card-body uk-position-center uk-flex uk-flex-middle uk-flex-center">
<img *ngIf="result.logoUrl != null && result.logoUrl != '' " src="{{result.logoUrl}}"
alt="{{(result.title)?result.title:result.shortTitle}} logo">
<span *ngIf="result.logoUrl == null || result.logoUrl == '' " class="uk-icon">
<span *ngIf="(result.logoUrl == null || result.logoUrl == '' ) && result.type != 'funder' " class="uk-icon">
<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="2.5"> <circle fill="none"
stroke="#000"
stroke-width="1.1"
@ -51,6 +53,8 @@
stroke-width="1.1"
d="M11.4,4 C12.8,2.4 15.4,2.8 16.3,4.7 C17.2,6.6 15.7,8.9 13.6,8.9 C16.5,8.9 18.8,11.3 19.2,14.1"></path></svg>
</span>
<div *ngIf="(result.logoUrl == null || result.logoUrl == '' ) && result.type == 'funder' "
[class]="'funderLogo ' + result['jurisdictionLogo'] "></div>
</div>
<div *ngIf="result.status == 'manager'"
class="uk-card-badge private-card-badge uk-width-2-5 uk-position-top-left uk-text-small uk-text-center ">
@ -59,7 +63,7 @@
</a>
<div class="uk-width-expand">
<div [title]=result.shortTitle class="uk-text-large uk-grid">
<a *ngIf="directLink" [href]="getCommunityPageUrl(result.communityId)" target="_blank"
<a *ngIf="directLink" [href]="getCommunityPageUrl(result)" target="_blank"
[class]="(result.isManager)?'uk-width-3-4':''">
{{(result.title) ? result.title : result.shortTitle}}
</a>
@ -84,6 +88,11 @@
<span
*ngIf="result.type && result.type != ''">{{(result.type == 'ri') ? 'Research Initiative' : 'Research Community'}}</span>
</div>
<div *ngIf="result['jurisdiction'] && result['jurisdiction']!=''"
class="uk-width-expand uk-align-right uk-margin-auto-right">
<span><b> Jurisdiction: </b></span>
<span>{{result['jurisdiction']}}</span>
</div>
</div>
</div>
</li>

View File

@ -55,11 +55,11 @@ export class CommunitySearchResultsComponent {
}
public confirmModalOpen(community: CommunityInfo) {
this.selectedCommunityId = community.communityId;
this.selectedCommunityId = (this.type == 'community')? community.communityId:community['alias'];
this.modal.cancelButton = true;
this.modal.okButton = true;
this.modal.alertTitle = 'You are going to visit ' +
((community.title) ? community.title : community.shortTitle) + ' Gateway';
((community.title) ? community.title : community.shortTitle) + (this.type == 'community')? ' Gateway':' Monitor Dashboard';
this.modal.alertMessage = false;
this.modal.okButtonLeft = false;
this.modal.okButtonText = 'Yes';
@ -68,15 +68,18 @@ export class CommunitySearchResultsComponent {
this.modal.open();
}
public getCommunityPageUrl(communityId: string): string {
public getCommunityPageUrl(entity): string {
let url = '';
if (this.isProduction()) {
url = 'https://' + this.getProductionPrefix() + communityId + '.openaire.eu';
url = 'https://' + this.getProductionPrefix() + entity.communityId + '.openaire.eu';
} else {
url = this.router.createUrlTree(['/'], {
queryParams: {'communityId': communityId}
queryParams: {'communityId': entity.communityId}
}).toString();
}
if(this.type == 'funder'){
url = "http://dl170.madgik.di.uoa.gr/monitor/dashboard/"+entity.alias;
}
return url;
}
@ -91,6 +94,10 @@ export class CommunitySearchResultsComponent {
queryParams: {'communityId': this.selectedCommunityId}
}).toString();
}
if(this.type == 'funder'){
url = "http://dl170.madgik.di.uoa.gr/monitor/dashboard/"+this.selectedCommunityId;
}
console.log(url)
window.open(url, '_blank');
}
}

View File

@ -35,7 +35,7 @@
</a>
<search-form [isDisabled]="disableForms" [(keyword)]="searchUtils.keyword" (keywordChange)="keywordChanged($event)" [placeholderText]="formPlaceholderText"></search-form>
</div>
<div *ngIf="entityType === 'community'" class="uk-position-center-right-out">
<div *ngIf="entityType === 'community' ||entityType === 'funder' " class="uk-position-center-right-out">
<img src="assets/connect-assets/banner/search.png" class="uk-align-center" width="141" height="171">
</div>
</div>
@ -69,7 +69,8 @@
</span>
<search-dataprovider-map *ngIf= "!showUnknownFilters" [loadPaging]="loadPaging" [oldTotalResults]="oldTotalResults" [(searchUtils)] = "searchUtils" [mapUrl]="mapUrl" [mapTooltipType]="mapTooltipType"></search-dataprovider-map>
</span>
<search-download *ngIf= "!showUnknownFilters && searchUtils.totalResults > 0 && entityType != 'community' && usedBy == 'search'"
<search-download *ngIf= "!showUnknownFilters && searchUtils.totalResults > 0 && ( entityType !=
'community' && entityType != 'funder') && usedBy == 'search'"
class="uk-width-1-2" [loadPaging]="loadPaging" [oldTotalResults]="oldTotalResults" [(searchUtils)] = "searchUtils" [type]="csvPath" [csvParams]="csvParams" [totalResults]="searchUtils.totalResults">
</search-download>
@ -131,7 +132,8 @@
</span>
<search-dataprovider-map *ngIf= "!showUnknownFilters" [loadPaging]="loadPaging" [oldTotalResults]="oldTotalResults" [(searchUtils)] = "searchUtils" [mapUrl]="mapUrl" [mapTooltipType]="mapTooltipType"></search-dataprovider-map>
</span>
<search-download *ngIf= "!showUnknownFilters && searchUtils.totalResults > 0 && entityType != 'community' && usedBy == 'search'"
<search-download *ngIf= "!showUnknownFilters && searchUtils.totalResults > 0 && ( entityType !=
'community' && entityType != 'funder') && usedBy == 'search'"
class="uk-width-1-2" [loadPaging]="loadPaging" [oldTotalResults]="oldTotalResults" [(searchUtils)] = "searchUtils" [type]="csvPath" [csvParams]="csvParams" [totalResults]="searchUtils.totalResults">
</search-download>
@ -191,7 +193,8 @@
<search-paging *ngIf="searchUtils.totalResults == 1" [type]="entityType" [loadPaging]="loadPaging" [oldTotalResults]="oldTotalResults" [(searchUtils)] = "searchUtils" [(results)] = "results" [(baseUrl)] = "baseUrl" [(parameterNames)] = "parameterNames" [(parameterValues)] = "parameterValues"></search-paging>
</div>
<div *ngIf="(searchUtils.page <= pagingLimit)" class="">
<search-result *ngIf="entityType != 'community' && !tableView && usedBy == 'search'"
<search-result *ngIf="(entityType != 'community' && entityType != 'funder' ) && !tableView &&
usedBy == 'search'"
[results]="results"
[status]="searchUtils.status"
[type]="entityType"
@ -204,7 +207,8 @@
[zenodoInformation]="zenodoInformation"
[properties]=properties>
</deposit-result>
<community-search-result *ngIf="entityType == 'community' && !tableView && usedBy == 'search'"
<community-search-result *ngIf="(entityType == 'community' || entityType == 'funder') && !tableView &&
usedBy == 'search'"
[results]="results"
[status]="searchUtils.status"
[type]="entityType"

View File

@ -5,13 +5,13 @@ import {Component, Input, Output, EventEmitter} from '@angular/core';
template: `
<span class="uk-width-2-3@m uk-width-1-1@s uk-float-right">
<span class="uk-width-1-4"> Sort by:</span>
<select *ngIf="entityType != 'community'" class="uk-select uk-width-3-4@m uk-width-auto" id="form-horizontal-select" name="select_results_per_page"
<select *ngIf="(entityType != 'community' && entityType != 'funder' )" class="uk-select uk-width-3-4@m uk-width-auto" id="form-horizontal-select" name="select_results_per_page"
[(ngModel)]="sortBy" (ngModelChange)="sortByChanged()">
<option value="">Relevance</option>
<option value="resultdateofacceptance,descending">Date (most recent)</option>
<option value="resultdateofacceptance,ascending">Date (least recent)</option>
</select>
<select *ngIf="entityType == 'community'" class="uk-select uk-width-3-4@m uk-width-auto" id="form-horizontal-select" name="select_results_per_page"
<select *ngIf="(entityType == 'community' || entityType == 'funder')" class="uk-select uk-width-3-4@m uk-width-auto" id="form-horizontal-select" name="select_results_per_page"
[(ngModel)]="sortBy" (ngModelChange)="sortByChanged()">
<option value="">Title</option>
<option value="creationdate,descending">Creation Date (most recent)</option>

View File

@ -22,7 +22,8 @@ export class EnvironmentSpecificService {
public envSpecificNull: EnvProperties = null;
testBrowser: boolean;
private envSpecificSubject: BehaviorSubject<EnvProperties> = new BehaviorSubject<EnvProperties>(null);
private propertiesUrl = "/assets/env-properties.json?v=2";
private propertiesPrefix = "";
private propertiesPath = "/assets/env-properties.json?v=2";
constructor(private http: HttpClient, @Inject(PLATFORM_ID) private platformId: string, /*private injector: Injector,*/
@Optional() @Inject(REQUEST) private request: Request) {
@ -38,6 +39,7 @@ export class EnvironmentSpecificService {
if (this.envSpecific === null || this.envSpecific === undefined) {
var domain = this.getDomain();
var location = this.getFullUrl();
// location = "http://dl170.madgik.di.uoa.gr/monitor/assets/env-properties.json";
// console.log('loadEnvironment: Loading '+ location);
return this.http.get<EnvProperties>(location)
.pipe(map((data) => {
@ -77,9 +79,9 @@ export class EnvironmentSpecificService {
//let req = this.injector.get('request');
//let req: Request = this.injector.get(REQUEST_TOKEN);
domain = this.request.get('host').split(":")[0];
location = (domain.indexOf(".openaire.eu")!=-1?"https://":"http://")+ this.request.get('host') + this.propertiesUrl;
location = (domain.indexOf(".openaire.eu")!=-1?"https://":"http://")+ this.request.get('host') + this.propertiesPrefix + this.propertiesPath;
}else{
location = document.location.protocol +"//" + document.location.host+this.propertiesUrl;
location = document.location.protocol +"//" + document.location.host + this.propertiesPrefix + this.propertiesPath;
domain = document.location.hostname;
}
return location;

View File

@ -144,4 +144,13 @@ export class StringUtils{
})
return path;
}
public static isEuropeanCountry(country:string){
let countries =["Albania", "Andorra", "Armenia", "Austria", "Azerbaijan", "Belarus", "Belgium", "Bosnia and Herzegovina",
"Bulgaria", "Croatia", "Cyprus", "Czech Republic", "Denmark", "Estonia", "Finland", "France", "Georgia", "Germany", "Greece", "Hungary", "Iceland", "Ireland",
"Italy", "Kosovo", "Latvia", "Liechtenstein", "Lithuania", "Luxembourg", "Macedonia", "Malta", "Moldova", "Monaco", "Montenegro", "The Netherlands", "Norway","Poland",
"Portugal", "Romania", "Russia", "San Marino", "Serbia", "Slovakia","Slovenia", "Spain", "Sweden", "Switzerland", "Turkey", "Ukraine", "United Kingdom", "Vatican City",
];
return (country && countries.indexOf(country)!= -1);
}
}