Compare commits

..

26 Commits

Author SHA1 Message Date
Konstantina Galouni d1392adc2d Merge pull request 'Production release May 2024 [EXPLORE]' (#40) from develop into master
Reviewed-on: #40
2024-05-23 18:26:50 +02:00
Konstantina Galouni 43990dc582 [develop | DONE | FIXED]: [BUG FIX] showAuthors.component.ts: Remove non existing field from the condition. 2024-05-23 18:16:07 +03:00
Konstantina Galouni 632d11c82c [develop | DONE | FIXED]: showAuthors.component.ts: On destroy of component, delete all elements with "orcid-dropdown" class from "modal-container". 2024-05-22 16:50:58 +03:00
argirok 7a517e49ed [develop | DONE | CHANGED ] Claims: add 2 steps in Projects form,step 1 to select funder, step 2 search by keyword 2024-05-22 14:48:13 +03:00
argirok 79b723e75c [develop | DONE | ADDED ] add coins icon 2024-05-22 14:40:42 +03:00
Konstantinos Triantafyllou 5a912f02b7 [Develop]: Advanced search input add on changes reinitialize input style 2024-05-22 12:42:21 +03:00
Konstantinos Triantafyllou dede290a52 [develop | DONE | MOVED]: Add browse-stakeholder-base component implemented in Irish. 2024-05-21 13:36:12 +03:00
Konstantina Galouni d6a2ba004a Merge pull request 'Merge on-push-strategy branch into develop (on push strategy in result-preview component, i.e. search result cards)' (#39) from on-push-strategy into develop
Reviewed-on: #39
2024-05-21 12:14:59 +02:00
Konstantinos Triantafyllou 44e821b1f1 Merge pull request 'Production release March 2024 [Monitor Dashboard]' (#38) from develop into master
Reviewed-on: #38
2024-04-01 18:02:04 +02:00
Konstantina Galouni 6ab50b04cc Merge pull request 'Production release March 2024 [EXPLORE]' (#35) from develop into master
Reviewed-on: #35
2024-03-04 17:44:23 +01:00
Konstantina Galouni e30672043b Merge pull request 'Production release February 2024 [CONNECT]' (#34) from develop into master
Reviewed-on: #34
2024-02-15 11:04:19 +01:00
Konstantina Galouni c3cb2d56ca Merge pull request 'Production release February 2024' (#31) from develop into master
Reviewed-on: #31
2024-02-08 18:03:26 +01:00
Konstantina Galouni 0757b7a98f Merge pull request 'Production release February 2024' (#30) from develop into master
Reviewed-on: #30
2024-02-07 21:37:50 +01:00
Konstantina Galouni d9465d5d05 Merge remote-tracking branch 'origin/develop' 2024-02-01 21:50:22 +02:00
Konstantina Galouni 7b8ca9ca66 Merge pull request 'Production release January 2024' (#29) from develop into master
Reviewed-on: #29
2024-02-01 20:07:59 +01:00
Konstantinos Triantafyllou 9fc6d0c0a0 Merge pull request 'Production release December 2023' (#27) from develop into master
Reviewed-on: #27
2023-12-21 13:46:37 +01:00
Konstantina Galouni c12cadf0f1 Merge pull request 'Production release (for EOSC EXPLORE) December 2023' (#24) from develop into master
Reviewed-on: #24
2023-12-12 11:43:47 +01:00
Konstantinos Triantafyllou 1a7624eed1 Merge pull request 'Production release November 2023 v3' (#23) from develop into master
Reviewed-on: #23
2023-11-28 09:45:06 +01:00
Konstantina Galouni e8ed5da8ba Merge pull request 'Production release November 2023 v2' (#21) from develop into master
Reviewed-on: #21
2023-11-10 18:27:47 +01:00
Konstantina Galouni e63d61b469 Merge remote-tracking branch 'origin/develop' 2023-11-07 13:34:30 +02:00
Argiro Kokogiannaki f42d160308 Merge pull request 'Production release November 2023' (#20) from develop into master
Reviewed-on: #20
2023-11-07 09:48:31 +01:00
Konstantina Galouni b06e41c9a3 Merge pull request 'Merging develop branch into master for PROD Explore October 2023 release' (#10) from develop into master
Reviewed-on: #10
2023-10-16 12:38:55 +02:00
argirok 1a030e2a0d Merge branch 'develop' 2023-10-06 17:55:08 +03:00
Konstantina Galouni 9b2524c1c7 Merge remote-tracking branch 'origin/develop' 2023-09-11 18:18:09 +03:00
Konstantinos Triantafyllou 31f42cfc71 Merge remote-tracking branch 'origin/develop' 2023-09-05 13:24:11 +03:00
Konstantinos Triantafyllou c292215ada Merge pull request 'Connect Admin release 30th August 2023' (#8) from develop into master
Reviewed-on: #8
2023-08-30 12:47:45 +02:00
15 changed files with 275 additions and 173 deletions

View File

@ -1,6 +1,7 @@
//Classes used in linking / inlinelinking when selecting an entity
import {HelperFunctions} from "../../utils/HelperFunctions.class";
import {OpenaireEntities} from "../../utils/properties/searchFields";
import {ClaimsProperties} from "./claims.properties";
export class ClaimResult {
public source: string;
@ -189,17 +190,18 @@ export class ShowOptions {
}
initSelectOptions(){
initSelectOptions(claimProperties:ClaimsProperties){
let options =[];
if(this.linkToEntities.indexOf('result')!=-1){
options.push({value: 'result',label: OpenaireEntities.RESULTS})
}
if(this.linkToEntities.indexOf('project')!=-1){
options.push({value: 'project',label: OpenaireEntities.PROJECTS})
options.push({value: 'project',label: claimProperties.SELECT_ENTITIES.projects})
}
if(this.linkToEntities.indexOf('context')!=-1){
options.push({value: 'context',label: OpenaireEntities.COMMUNITIES})
}
this.selectOptions = options;
console.log(options, claimProperties.SELECT_ENTITIES.projects)
}
}

View File

@ -1,69 +1,25 @@
<div class="uk-width-xlarge@l uk-width-large" [ngClass]="centerAlign ? 'uk-align-center':''">
<advanced-search-input (searchEmitter)="search(page,size)">
<div input type="select" [(value)]="showOptions.show" placeholder="Type" hint="Select..."
[options]="showOptions.selectOptions" class="uk-width-2-5"></div>
<div class="uk-width-expand" input type="text" [(value)]="keyword" [searchable]="true" placeholder="Entities to link"
[hint]="'Search for ' + openaireEntities.PROJECTS + '...'" tooltip="true"></div>
[options]="showOptions.selectOptions" class="uk-width-auto "></div>
<div *ngIf="funderOptions && funderOptions.length > 0" input type="select" [(value)]="selectedFunder" placeholder="Funder" hint="Select Funder..."
[options]="funderOptions" class="uk-width-expand" (valueChange)="funderChanged($event)"></div>
<div *ngIf="selectedFunder && selectedFunder.number > 1" class="uk-width-expand" input type="text" [(value)]="keyword" [searchable]="true" placeholder="Projects to link"
[hint]="'Search for ' + openaireEntities.PROJECTS + '...'" tooltip="true" [disabled]="!selectedFunder"></div>
</advanced-search-input>
</div>
<div *ngIf="!showResults">
<div *ngIf=" openaireResultsStatus != errorCodes.LOADING && !isNoProjectFunder && this.selectedFunder && openaireResults.length == 0">
<div class="uk-text-center uk-text-large uk-text-meta uk-margin-large-top">No {{openaireEntities.PROJECT.toLowerCase()}} results yet... <br>Start
searching for {{openaireEntities.PROJECTS.toLowerCase()}} to add them in the Basket
</div>
</div>
<div *ngIf="showResults" class="uk-margin-top">
<div *ngIf=" openaireResultsStatus != errorCodes.LOADING && this.funderOptions.length > 1 && !this.selectedFunder">
<div class="uk-text-center uk-text-large uk-text-meta uk-margin-large-top">Select funder to proceed
</div>
</div>
<div class="uk-margin-top">
<div class="uk-grid" uk-grid>
<div class="search-filters uk-width-1-1">
<!--<div *ngIf="countFilters()>0 && openaireResultsNum > 0" class="uk-grid uk-flex uk-flex-bottom">
<div class="uk-grid">
<h6 class="uk-text-bold">Filters</h6>
<a *ngIf="countFilters()>1" (click)="clearFilters()"
[class]="((openaireResultsStatus ==
errorCodes.LOADING)?'uk-disabled uk-link-muted':'')+' portal-link '">
Clear All
</a>
</div>
<div *ngIf="countFilters()>0" class="uk-grid uk-grid-small uk-text-small uk-margin-small-top " uk-grid>
<ng-container *ngFor="let filter of rangeFilters " >
<ng-container *ngIf = "filter.selectedFromAndToValues">
<span [title]="'Remove '+ filter.selectedFromAndToValues" (click) = "removeRangeFilter(filter) " >
<span class="selectedFilterLabel ">
<a [class]="((openaireResultsStatus ==
errorCodes.LOADING)?' uk-disabled':' ')+' uk-link-text '">
<span class=" clickable" aria-hidden="true">
<span class="uk-icon">
<svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="close" ratio="0.8"><path fill="none" stroke="#000" stroke-width="1.6" d="M16,16 L4,4"></path><path fill="none" stroke="#000" stroke-width="1.6" d="M16,4 L4,16"></path></svg>
</span>
</span>
<span class="uk-margin-small-left">{{filter.selectedFromAndToValues}}</span>
</a>
</span>
</span>
</ng-container>
</ng-container>
<ng-container *ngFor="let filter of filters " >
<ng-container *ngIf = "filter.countSelectedValues > 0">
<span *ngFor="let value of getSelectedValues(filter); let i = index; let end = last; "
[title]="'Remove '+value.name" (click) = "removeFilter(value, filter) " >
&lt;!&ndash; if no grid on the div above, remove it and move class 'selectedFilterLabel' on top span &ndash;&gt;
<span class="selectedFilterLabel ">
<a [class]="((openaireResultsStatus ==
errorCodes.LOADING)?' uk-disabled':' ')+' uk-link-text '">
<span class=" clickable" aria-hidden="true">
<span class="uk-icon">
<svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="close" ratio="0.8"><path fill="none" stroke="#000" stroke-width="1.6" d="M16,16 L4,4"></path><path fill="none" stroke="#000" stroke-width="1.6" d="M16,4 L4,16"></path></svg>
</span>
</span>
<span class="uk-margin-small-left" [innerHtml]="(value.name.length > 34)?value.name.substring(0,34)+'...':value.name"></span>
</a>
</span>
</span>
</ng-container>
</ng-container>
</div>
</div>-->
<!-- <ng-container *ngIf="openaireResultsNum > 0">-->
<div *ngIf="!isNoProjectFunder && openaireResultsStatus != errorCodes.LOADING && openaireResultsNum > 1 " class="search-filters uk-width-1-1">
<div class="uk-grid uk-grid-small" uk-grid>
<ng-container *ngFor="let filter of rangeFilters">
<div>
@ -104,9 +60,12 @@
role="alert">Service not available
</div>
<div *ngIf="openaireResultsStatus == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1"
role="alert"><span class="loading-gif uk-align-center"></span></div>
role="alert">
<loading></loading>
</div>
<claim-results [localStoragePrefix]="localStoragePrefix" [results]=openaireResults
[selectedResults]=selectedProjects [basketLimit]="basketLimit"></claim-results>
<div *ngIf="isNoProjectFunder && openaireResultsStatus != errorCodes.LOADING " class="uk-alert uk-alert-default"><span class=" uk-text-bold">{{selectedFunder.name}}</span> has no projects. Proceed to next step. </div>
<div *ngIf="openaireResultsNum != null && openaireResultsNum > 0 && openaireResultsStatus != errorCodes.LOADING " class="uk-flex uk-flex-center ">
<paging-no-load [currentPage]="openaireResultsPage"
[totalResults]="openaireResultsNum" [term]="keyword"

View File

@ -1,4 +1,4 @@
import {Component, ElementRef, EventEmitter, Input, Output} from '@angular/core';
import {Component, ElementRef, EventEmitter, Input, Output, ViewChild} from '@angular/core';
import {SearchProjectsService} from '../../services/searchProjects.service';
import {ProjectService} from '../../landingPages/project/project.service';
import {ClaimEntity, ClaimProject} from './claimHelper.class';
@ -10,6 +10,8 @@ import {RangeFilter} from "../../utils/rangeFilter/rangeFilterHelperClasses.clas
import {OpenaireEntities, SearchFields} from "../../utils/properties/searchFields";
import {NewSearchPageComponent} from "../../searchPages/searchUtils/newSearchPage.component";
import {Subscriber} from "rxjs";
import { properties } from 'src/environments/environment';
import {error} from "protractor";
declare var UIkit:any;
@ -26,12 +28,11 @@ export class ClaimProjectsSearchFormComponent {
public elementRef;
@Output() projectSelected = new EventEmitter();
@Input() public properties:EnvProperties;
public properties:EnvProperties = properties;
@Input() public inlineClaim:boolean=false;
@Input() localStoragePrefix:string = "";
@Input() basketLimit;
@Input() showOptions;
public errorCodes:ErrorCodes = new ErrorCodes();
public projects:string[];
public warningMessage = "";
@ -53,29 +54,61 @@ export class ClaimProjectsSearchFormComponent {
public rangeFields:string[][] = this.searchFields.PROJECT_RANGE_FIELDS;
openaireEntities = OpenaireEntities;
sub;
selectedFunder = null;
funderOptions = [];
isNoProjectFunder = false;
constructor(private _service: ProjectService, private _projectService: SearchProjectsService, myElement: ElementRef) {
this.elementRef = myElement;
this.rangeFilters = RangeFilter.parse(this.rangeFields,"project");
this.rangeFilters = RangeFilter.parse(this.rangeFields,"project");
this.getFunders();
}
ngOnDestroy() {
if (this.sub instanceof Subscriber) {
this.sub.unsubscribe();
}
}
getFunders(){
this.openaireResultsStatus = this.errorCodes.LOADING;
this.showResults = true;
this.sub = this._projectService.advancedSearchProjects("", 1, 0, this.properties,
this.refineFieldsQuery, this.refineFields, "&type=projects&sf=funder").subscribe(
data => {
for(let v of data[2][0].values){
let option = {value : v, label: v.name};
this.funderOptions.push(option);
}
this.openaireResultsStatus = this.errorCodes.DONE;
}, error =>{
this.openaireResultsStatus = this.errorCodes.ERROR;
})
}
funderChanged(value){
this.keyword = ""
this.selectedFunder = value;
this.isNoProjectFunder = this.selectedFunder && this.selectedFunder.number == 1;
this.openaireResults = [];
if(this.isNoProjectFunder){
this.showResults = true;
this.search(1,1);
}else{
this.openaireResults = [];
}
}
search(page,size) {
if (this.keyword.length == 0) {
/* if (this.keyword.length == 0) {
this.showResults = false;
return;
}
}*/
this.showResults = true;
this.openaireResults = [];
this.openaireResultsStatus = this.errorCodes.LOADING;
this.prevFilters = this.filters;
//searchProjects (params: string, refineParams:string, page: number, size: number, refineFields:string[] , properties:EnvProperties ):any {
this.sub = this._projectService.advancedSearchProjects(this.createOpenaireQueryParams(), page, size, this.properties, (page == 1) ? this.refineFieldsQuery : null, (page == 1) ? this.refineFields : [], this.createOpenaireRefineQuery()).subscribe(
this.sub = this._projectService.advancedSearchProjects(this.createOpenaireQueryParams(), page, size, this.properties, null, [], this.createOpenaireRefineQuery()).subscribe(
// this.sub = this._projectService.searchProjects(this.createOpenaireQueryParams(),(page==1)? this.refineFieldsQuery:null, page, size, (page==1)?this.refineFields:[], this.properties).subscribe(
data => {
if (data != null) {
@ -91,6 +124,9 @@ export class ClaimProjectsSearchFormComponent {
this.openaireResultsStatus = this.errorCodes.NONE;
this.filters = this.checkSelectedFilters([], this.prevFilters);
}
/* if(this.isNoProjectFunder && this.claimResultsComponent){
this.claimResultsComponent.add(this.openaireResults[0])
}*/
} else {
this.openaireResultsStatus = this.errorCodes.ERROR;
}
@ -102,77 +138,14 @@ export class ClaimProjectsSearchFormComponent {
}
);
}
// select(entity){
// if(this.selectedProjects.length > 50){
// UIkit.notification({
// message : 'Your basket exceeds the number of allowed projects (50)',
// status : 'warning',
// timeout : 1500,
// pos : 'top-center'
// });
// return;
// }
// this.query = "";
// // this.searchTermStream.next(this.query); //clear
// entity = entity.value;
// // var project: ClaimProject = new ClaimProject();
// // project.funderId = entity.funderId;
// // project.funderName = entity.funderName;
// // project.id = entity.id;
// // project.projectName = entity.projectName;
// // project.projectAcronym = entity.projectAcronym;
// // project.startDate = entity.startDate;
// // project.endDate = entity.endDate;
// // project.code = entity.code;
// // project.jurisdiction = entity.jurisdiction;
// // project.fundingLevel0 = entity.fundingLevel0;
//
//
// var index:number =this.selectedProjects.indexOf(entity);
// var found:boolean = false;
// this.warningMessage = "";
//
// for (var _i = 0; _i < this.selectedProjects.length; _i++) {
// let project = this.selectedProjects[_i];
// if(entity.id == project.id){
// found=true;
// this.warningMessage = "Project already in your basket";
// }
// }
//
// if (!found) {
// this.selectedProjects.push(entity);
// if(this.selectedProjects != null){
// localStorage.setItem(this.localStoragePrefix + "projects", JSON.stringify(this.selectedProjects));
// }
// this.projectSelected.emit({
// value: true
// });
//
// }
// }
/* static showItem(item):string{
return ((item.field[1]['@value'])?item.field[1]['@value']+" - ":"" ) + item.field[3]['@value'];
}*/
remove(item){
remove(item){
let index:number =this.selectedProjects.indexOf(item);
if (index > -1) {
this.selectedProjects.splice(index, 1);
}
}
/* handleClick(event){
var clickedComponent = event.target;
var inside = false;
do {
if (clickedComponent === this.elementRef.nativeElement) {
inside = true;
}
clickedComponent = clickedComponent.parentNode;
} while (clickedComponent);
}*/
static openaire2ClaimEntity(items, properties:EnvProperties){
static openaire2ClaimEntity(items, properties:EnvProperties){
const projects: ClaimEntity[] = [];
for(const item of items){
const entity: ClaimEntity = new ClaimEntity();
@ -237,6 +210,9 @@ export class ClaimProjectsSearchFormComponent {
}
}
}
if(this.isNoProjectFunder){
allFqs += "&fq=" + StringUtils.URIEncode( "funder exact " + (StringUtils.quote(this.selectedFunder.id))); ;
}
for (let i = 0; i < this.rangeFilters.length; i++) {
let filter = this.rangeFilters[i];
//selectedFromValue, selectedToValue, equalityOp, equalityOpFrom, equalityOpTo, filterOp ){

View File

@ -17,14 +17,15 @@ import {RangeFilterModule} from "../../utils/rangeFilter/rangeFilter.module";
import {AdvancedSearchInputModule} from "../../sharedComponents/advanced-search-input/advanced-search-input.module";
import {InputModule} from "../../sharedComponents/input/input.module";
import {DropdownFilterModule} from "../../utils/dropdown-filter/dropdown-filter.module";
import {LoadingModule} from "../../utils/loading/loading.module";
@NgModule({
imports: [
SharedModule, CommonModule,
// LoadingModalModule,
ProjectServiceModule, ProjectsServiceModule, EntitiesAutocompleteModule, HelperModule,
PagingModule, SearchFilterModule, ClaimResultsModule, RangeFilterModule, AdvancedSearchInputModule, InputModule, DropdownFilterModule
],
imports: [
SharedModule, CommonModule,
// LoadingModalModule,
ProjectServiceModule, ProjectsServiceModule, EntitiesAutocompleteModule, HelperModule,
PagingModule, SearchFilterModule, ClaimResultsModule, RangeFilterModule, AdvancedSearchInputModule, InputModule, DropdownFilterModule, LoadingModule
],
providers:[
],
declarations: [

View File

@ -51,7 +51,9 @@
</div>
</div>
<div *ngIf="crossrefStatus === errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1"
role="alert"><span class="loading-gif uk-align-center"></span></div>
role="alert">
<loading></loading>
</div>
<div>
<claim-results [localStoragePrefix]=localStoragePrefix [results]=crossrefResults
@ -114,7 +116,7 @@
<div *ngIf="openaireResultsStatus === errorCodes.LOADING"
class="uk-animation-fade uk-margin-top uk-width-1-1"
role="alert"><span class="loading-gif uk-align-center">Loading...</span></div>
role="alert"><loading></loading></div>
<claim-results [localStoragePrefix]=localStoragePrefix
[results]=openaireResults [selectedResults]=selectedResults [basketLimit]="basketLimit"></claim-results>
<div class="uk-flex uk-flex-center" *ngIf=" openaireResultsStatus != errorCodes.LOADING && openaireResultsNum != null && openaireResultsNum > 0" >
@ -177,7 +179,7 @@
</div>
</div>
<div *ngIf="orcidStatus == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert">
<span class="loading-gif uk-align-center"></span></div>
<loading></loading></div>
</div>
</div>
<div *ngIf="activeTab == 'datacite'" id="datacite" class="uk-animation-fade">
@ -190,7 +192,7 @@
<div class="uk-margin-top">
<div *ngIf="dataciteStatus == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1"
role="alert"><span class="loading-gif uk-align-center"></span></div>
role="alert"><loading></loading></div>
<div>
<claim-results [localStoragePrefix]=localStoragePrefix *ngIf="dataciteResults.length > 0 "
[results]=dataciteResults [selectedResults]=selectedResults [basketLimit]="basketLimit"></claim-results>

View File

@ -22,10 +22,11 @@ import {AdvancedSearchInputModule} from "../../sharedComponents/advanced-search-
import {InputModule} from "../../sharedComponents/input/input.module";
import {SearchInputModule} from "../../sharedComponents/search-input/search-input.module";
import {DropdownFilterModule} from "../../utils/dropdown-filter/dropdown-filter.module";
import {LoadingModule} from "../../utils/loading/loading.module";
@NgModule({
imports: [SharedModule, CommonModule, SearchResearchResultsServiceModule, PagingModule, SearchCrossrefServiceModule,
SearchDataciteServiceModule, HelperModule, SearchFilterModule, ClaimResultsModule, MatSelectModule, QuickSelectionsModule, RangeFilterModule, ClaimProjectsSearchFormModule, AdvancedSearchInputModule, InputModule, SearchInputModule, DropdownFilterModule],
SearchDataciteServiceModule, HelperModule, SearchFilterModule, ClaimResultsModule, MatSelectModule, QuickSelectionsModule, RangeFilterModule, ClaimProjectsSearchFormModule, AdvancedSearchInputModule, InputModule, SearchInputModule, DropdownFilterModule, LoadingModule],
providers:[
SearchOrcidService
],

View File

@ -1,5 +1,8 @@
export class ClaimsProperties{
ALLOW_ORGANIZATION_LINKING:boolean = false;
SELECT_ENTITIES = {
projects:"Funding"
}
INLINE_ENTITY = {
show: true,
guideText : null

View File

@ -42,7 +42,7 @@ export class LinkingGenericComponent {
// show linkToEntities /values: result, project, context
@Input() sources:ClaimEntity[] =[];
properties:EnvProperties;
properties:EnvProperties = properties;
public openaireEntities = OpenaireEntities;
@Input() localStoragePrefix:string = "linking_";
url=null;
@ -72,14 +72,13 @@ export class LinkingGenericComponent {
this.breadcrumbs.push({name: "Link", route: null});
}
this.showOptions.show = 'source';
this.showOptions.initSelectOptions();
this.showOptions.initSelectOptions(this.claimsProperties);
if(this.inlineEntity){
this.showOptions.showLinkTo();
// this.showOptions.basketShowLinksTo = true;
this.showOptions.show = this.showOptions.linkTo;
}
this.properties = properties;
this.url = this.properties.domain + this.properties.baseLink+this._router.url;
var description = "Linking is a functionality provided by OpenAIRE, in order to link research results with a project, a research community or other research results.";

View File

@ -3,13 +3,21 @@ import {SharedModule} from '../../../../openaireLibrary/shared/shared.module';
import {ClaimEntityTitleComponent} from "./ClaimEntityTitle.component";
import {ClaimEntityResultMetadataComponent} from "./ClaimEntityResultMetadata.component";
import {ClaimEntityProjectMetadataComponent} from "./ClaimEntityProjectMetadata.component";
import {IconsService} from "../../../utils/icons/icons.service";
import {coins} from "../../../utils/icons/icons";
import {IconsModule} from "../../../utils/icons/icons.module";
@NgModule({
imports: [
SharedModule
SharedModule,
IconsModule
],
declarations: [
ClaimEntityTitleComponent, ClaimEntityResultMetadataComponent, ClaimEntityProjectMetadataComponent
], exports:[ ClaimEntityTitleComponent, ClaimEntityResultMetadataComponent, ClaimEntityProjectMetadataComponent]
})
export class ClaimEntitiesMetadataModule { }
export class ClaimEntitiesMetadataModule {
constructor(private _iconsService:IconsService) {
this._iconsService.registerIcons([coins])
}
}

View File

@ -8,20 +8,28 @@ import {ClaimEntity} from '../../claim-utils/claimHelper.class';
<div *ngIf="!shortVersion" class="claim-entity-metadata uk-flex-inline uk-flex-wrap uk-text-xsmall uk-text-emphasis"
[class.uk-margin-xsmall-top]="!shortVersion">
<span class="uk-text-capitalize">
{{entity.type}}
{{entity.type == 'project' && entity.project.code == 'unidentified'?'funder':entity.type}}
</span>
<span *ngIf="entity.project.startDate || entity.project.endDate">
{{(entity.project.startDate) ? entity.project.startDate : 'Unknown'}}{{'-' + ((entity.project.endDate) ? entity.project.endDate : 'Unknown')}}
</span>
</div>
<div class="uk-text-small uk-flex uk-flex-wrap" [style.grid-gap]="shortVersion?'10px':'20px'"
<div *ngIf="shortVersion && entity.type == 'project' && entity.project.code == 'unidentified'" class="claim-entity-metadata uk-flex-inline uk-flex-wrap uk-text-xsmall uk-text-emphasis"
[class.uk-margin-xsmall-top]="!shortVersion">
<span class="uk-text-capitalize">
funder
</span>
</div>
<div *ngIf="entity.project.code!='unidentified'" class="uk-text-small uk-flex uk-flex-wrap" [style.grid-gap]="shortVersion?'0px':'10px'"
[class.uk-margin-small-top]="!shortVersion">
<div *ngIf="entity.project.funderName || entity.project.funderShortname">
<span class="uk-text-meta">Funder: </span>{{entity.project.funderName?entity.project.funderName:entity.project.funderShortname}}
</div>
<div *ngIf="entity.project.code && entity.project.code!='unidentified'">
<div *ngIf="entity.project.code">
<span class="uk-text-meta">Project Code: </span>{{entity.project.code}}
</div>
</div>
<div *ngIf="entity.project.funderName || entity.project.funderShortname">
<span class="uk-text-meta">Funding: </span>{{entity.project.funderName?entity.project.funderName:entity.project.funderShortname}}
</div>
</div>
</ng-container>
`,

View File

@ -5,19 +5,18 @@ import {ClaimEntity} from '../../claim-utils/claimHelper.class';
selector: 'claim-title',
template: `
<div class="uk-grid uk-flex uk-flex-middle">
<span *ngIf="showIcon" class="uk-flex">
<span *ngIf="entity.result" class="material-icons uk-text-small uk-text-meta">
insert_drive_file
</span>
<span *ngIf="entity.project" class="material-icons uk-text-small uk-text-meta">
assignment_turned_in
</span>
<span *ngIf="entity.organization" class="material-icons uk-text-small uk-text-meta">
account_balance
</span>
<span *ngIf="entity.type=='community'" class="material-icons uk-text-small uk-text-meta" style="margin-right: 2px;">
people
</span>
<span *ngIf="showIcon" class="uk-flex uk-margin-xsmall-right">
<icon *ngIf="entity.result" class=" uk-text-small uk-text-meta" name="insert_drive_file">
</icon>
<icon *ngIf="entity.project && entity.project.code !='unidentified'" class=" uk-text-small uk-text-meta" name="assignment_turned_in">
</icon>
<icon *ngIf="entity.project && entity.project.code =='unidentified'" class="uk-text-small uk-text-meta" name="coins" [ratio]="1.4">
</icon>
<icon *ngIf="entity.organization" class=" uk-text-small uk-text-meta" name="account_balance">
</icon>
<icon *ngIf="entity.type=='community'" class=" uk-text-small uk-text-meta" style="margin-right: 2px;" name="people">
</icon>
</span>
<div class="uk-width-expand multi-line-ellipsis lines-3" style="word-break: break-word;"
[class.uk-padding-remove-left]="showIcon" [class.uk-text-truncate]="shortVersion">
@ -30,7 +29,15 @@ import {ClaimEntity} from '../../claim-utils/claimHelper.class';
<span *ngIf="(entity.result && !entity.result.url)">
{{entity.title ? sliceString(entity.title) : '[No title available]'}}
</span>
<span *ngIf="entity.type=='project' && entity.project">
<span *ngIf="entity.type=='project' && entity.project && entity.project.code =='unidentified'">
<span *ngIf="!shortVersion">
{{(entity.project.funderShortname ? '[' + entity.project.funderShortname + '] ' : '') + entity.project.funderName}}
</span>
<span *ngIf="shortVersion">
{{sliceString(entity.project.funderName)}}
</span>
</span>
<span *ngIf="entity.type=='project' && entity.project && entity.project.code!='unidentified'">
<a *ngIf="entity.project && entity.project.url" target="_blank" [href]="entity.project.url"
class="uk-link uk-text-decoration-none uk-width-expand">
<span *ngIf="!shortVersion">

View File

@ -0,0 +1,113 @@
import {ChangeDetectorRef, Directive, OnInit} from "@angular/core";
import {StakeholderBaseComponent} from "../../monitor-admin/utils/stakeholder-base.component";
import {OpenaireEntities} from "../../utils/properties/searchFields";
import {StakeholderType} from "../entities/stakeholder";
import {Option} from "../../sharedComponents/input/input.component";
import {FormBuilder, FormControl} from "@angular/forms";
import {LayoutService} from "../../dashboard/sharedComponents/sidebar/layout.service";
import {HelperFunctions} from "../../utils/HelperFunctions.class";
import {debounceTime, distinctUntilChanged} from "rxjs/operators";
@Directive()
export class BrowseStakeholderBaseComponent<T> extends StakeholderBaseComponent implements OnInit {
openaireEntities = OpenaireEntities;
stakeholderType: StakeholderType;
stakeholders: T[] = [];
filteredStakeholders: T[] = [];
showLoading: boolean = true;
isMobile: boolean = false;
gridView: boolean = true;
sortOptions: Option[] = [
{value: 'alphAsc', label: 'Alphabetically Asc. (A-Z)'},
{value: 'alphDsc', label: 'Alphabetically Dsc. (Z-A)'},
];
pageOptions: number[] = [10, 20, 30, 40];
sortBy: string = null;
currentPage: number = 1;
pageSize: number = 10;
parameters = {};
keywordControl: FormControl;
hasPublications: boolean = true;
/* Services */
protected layoutService: LayoutService;
protected cdr: ChangeDetectorRef;
protected fb: FormBuilder;
constructor() {
super();
}
ngOnInit() {
this.keywordControl = this.fb.control(this._route.snapshot.queryParams.keyword);
this.subscriptions.push(this.layoutService.isMobile.subscribe(isMobile => {
this.isMobile = isMobile;
this.cdr.detectChanges();
}));
this.stakeholderType = this._route.snapshot.data.type;
if (!this.stakeholderType) {
this.navigateToError();
}
this.init();
this.subscriptions.push(this.keywordControl.valueChanges.pipe(debounceTime(200), distinctUntilChanged()).subscribe(value => {
this.filtering(value);
if (value?.length > 0) {
this.parameters['keyword'] = value;
} else {
delete this.parameters['keyword']
}
this._router.navigate([], {queryParams: this.parameters});
}));
}
init() {
this.stakeholders = [];
this.filteredStakeholders = [];
}
protected filtering(value) {
if (!value) {
this.filteredStakeholders = this.stakeholders;
} else {
this.filteredStakeholders = this.stakeholders.filter(item => (item['name'] && item['name'].toLowerCase().includes(value.toLowerCase())) || (item['alias'] && item['alias'].toLowerCase().includes(value.toLowerCase())));
}
this.afterStakeholdersInitialized();
this.currentPage = 1;
}
sortByChanged() {
switch (this.sortBy) {
case 'alphAsc':
this.stakeholders = this.stakeholders.sort((a, b) => a['name'].localeCompare(b['name']));
break;
case 'alphDsc':
this.stakeholders = this.stakeholders.sort((a, b) => b['name'].localeCompare(a['name']));
break;
default:
break;
}
}
sizeChanged($event) {
this.pageSize = $event;
this.currentPage = 1;
this.afterStakeholdersInitialized();
}
updateCurrentPage($event) {
this.currentPage = $event.value;
HelperFunctions.scrollToId('target');
this.afterStakeholdersInitialized();
}
get typeAsLabel() {
return this.stakeholderUtils.types.find(type => type.value === this.stakeholderType).label;
}
afterStakeholdersInitialized() {
// this is a method that will be overriden from the components extending this base component, if needed
this.showLoading = false;
}
}

View File

@ -58,15 +58,22 @@ export class AdvancedSearchInputComponent implements AfterContentInit, OnDestroy
}
ngAfterContentInit() {
this.inputs.forEach(input => {
input.inputClass = 'advanced-search';
input.selectArrow = null;
this.init();
this.inputs.changes.subscribe(input => {
this.init();
});
}
ngOnDestroy() {
}
init() {
this.inputs.forEach(input => {
input.inputClass = 'advanced-search';
input.selectArrow = null;
});
}
focusNext(input: InputComponent | EntitiesSelectionComponent, event: any = null) {
if(!event || !event.init) {
setTimeout(() => {

View File

@ -170,6 +170,17 @@ export class ShowAuthorsComponent {
ngOnInit() {}
ngOnDestroy() {
if(typeof document !== 'undefined') {
let modal_container = document.getElementById("modal-container");
modal_container.childNodes.forEach(c=> {
if (c['className'] && c['className'].includes("orcid-dropdown")) {
modal_container.removeChild(c);
}
});
}
}
public onClick() {
if (this.modal) {
this.modal.cancel();

View File

@ -161,3 +161,8 @@ export const unknown_access: Icon = {
name: 'unknown_access',
data: '<svg xmlns="http://www.w3.org/2000/svg" width="373.336" height="490.004" viewBox="0 0 373.336 490.004"><g id="noun-lock-question-mark-250128" transform="translate(-163.328 -34.992)"><path id="Path_119172" data-name="Path 119172" d="M490,198.33H466.668V151.662a116.67,116.67,0,0,0-233.34,0V198.33H210A46.8,46.8,0,0,0,163.328,245v233.33A46.8,46.8,0,0,0,210,525H490a46.8,46.8,0,0,0,46.668-46.668V245A46.8,46.8,0,0,0,490,198.33ZM365.55,469.78H334.441V438.671H365.55ZM397.441,350l-14,14c-10.891,11.668-17.891,20.223-17.891,43.555H334.441v-7.777a61.712,61.712,0,0,1,17.891-43.555l19.445-19.445A30.98,30.98,0,1,0,318.891,315H287.782a62.223,62.223,0,0,1,124.446,0,49.983,49.983,0,0,1-14.785,35Zm24.887-151.67H277.668V151.662c0-39.668,32.668-72.332,72.332-72.332S422.332,112,422.332,151.662Z"/></g></svg>'
}
export const coins: Icon = {
name: 'coins',
data: '<?xml version="1.0" encoding="UTF-8"?><svg id="Layer_2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 315.47 315.47"><g id="Layer_1-2"><g><g><ellipse class="" cx="116.85" cy="98.6" rx="63.94" ry="37.92"/><ellipse class="" cx="199.59" cy="167.66" rx="63.94" ry="37.92"/><path class="cls-3" d="M260.39,185.84c1.25-1.88,2.51-3.76,3.13-5.95-.31,13.48,1.25,14.42-.94,21.63-5.01,17.24-38.86,29.77-64.25,29.15-21.63-.31-39.18-2.82-54.85-15.98-4.39-3.76-9.4-7.52-9.72-12.85,0-10.03,0-11.6,.31-23.82,10.34,38.86,102.8,41.37,126.31,7.84Z"/><path class="cls-3" d="M262.58,209.66c.94,8.78-1.57,13.79-1.88,20.06-.94,14.73-35.1,24.76-61.43,25.07-31.34,.31-63.62-12.22-64.25-24.76-.63-11.28,0-5.33-.94-20.06,21.31,32.28,105.31,31.97,128.5-.31Z"/><path class="cls-3" d="M116.85,140.71c38.55,.31,57.67-17.86,61.74-25.07,1.88-3.45-.31,12.85-.94,13.16-14.1,4.07-31.03,10.03-40.43,21.94-2.82,3.45-3.76,7.52-5.01,12.54,0,.31-13.48-.31-14.42-.31-28.21,0-61.12-13.48-65.82-35.73-.63-4.39,0-8.15,0-17.55,10.03,19.75,36.67,30.71,64.88,31.03Z"/><path class="cls-3" d="M116.85,166.72c5.01,.31,15.04,0,15.04,0-.94,8.78-.63,12.85-1.25,23.19,0,.31-71.15,3.76-78.67-33.85-.63-4.07,0-7.84,0-17.55,15.67,21.31,42.94,27.27,64.88,28.21Z"/><path class="cls-3" d="M130.01,194.3s.94,12.54,.63,21.94c0,.31-68.95,1.88-78.04-27.58l-.63-21.31c16.92,23.51,52.65,27.58,78.04,26.95Z"/></g></g></g></svg>'
}