[Library | Trunk]: Projects in modal change result-preview to search-results

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@58786 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
k.triantafyllou 2020-05-26 15:42:02 +00:00
parent 3154babcaa
commit f7bf1fcbc0
3 changed files with 41 additions and 46 deletions

View File

@ -15,16 +15,18 @@ import {AlertModal} from "../../utils/modal/alert";
@Component({
selector: 'projectsInModal',
template: `
<div *ngIf="fetchProjects.funders.length > 1" class="uk-margin-small-bottom uk-text-muted">Filter by Funder:</div>
<ul *ngIf="fetchProjects.funders.length > 1" class="uk-list uk-list-divider uk-margin-remove">
<li *ngFor="let filter of fetchProjects.filters ">
<span *ngFor="let value of filter.values" class="uk-animation-fade uk-margin-small-right">
<input [(ngModel)]="value.selected" type="checkbox"
(ngModelChange)="filterChange(value.selected)"/>
<span class="uk-text-bold"> {{value.name}}</span>
</span>
</li>
</ul>
<div *ngIf="fetchProjects.funders.length > 1" class="uk-margin-bottom">
<div class="uk-margin-small-bottom uk-text-muted">Filter by Funder:</div>
<ul class="uk-list uk-list-divider uk-margin-remove">
<li *ngFor="let filter of fetchProjects.filters ">
<span *ngFor="let value of filter.values" class="uk-animation-fade uk-margin-small-right">
<input [(ngModel)]="value.selected" type="checkbox"
(ngModelChange)="filterChange(value.selected)"/>
<span class="uk-text-bold"> {{value.name}}</span>
</span>
</li>
</ul>
</div>
<errorMessages [status]="[fetchProjects.searchUtils.status]" [type]="'projects'"
tab_error_class=true></errorMessages>
<div *ngIf="fetchProjects.searchUtils.status == errorCodes.DONE">
@ -33,11 +35,11 @@ import {AlertModal} from "../../utils/modal/alert";
[page]="page" [pageSize]="size"
[totalResults]="fetchProjects.searchUtils.totalResults">
</no-load-paging>
<ul class="uk-list uk-list-divider uk-margin">
<li *ngFor="let result of fetchProjects.results">
<result-preview [properties]="properties" [modal]="modal" [result]="getResultPreview(result)"></result-preview>
</li>
</ul>
<search-result [results]="fetchProjects.results"
[status]="fetchProjects.searchUtils.status"
[type]="'project'"
[showLoading]="true" [properties]="properties">
</search-result>
<no-load-paging *ngIf="fetchProjects.searchUtils.totalResults > size" [type]="'projects'"
(pageChange)="pageChange($event)"
[page]="page" [pageSize]="size"
@ -54,7 +56,6 @@ export class ProjectsInModalComponent {
@Input() modal: AlertModal;
public page: number = 1;
public size: number = 10;
public linkToSearchProjects: string;
public routerHelper: RouterHelper = new RouterHelper();
public errorCodes: ErrorCodes = new ErrorCodes();
@ -68,17 +69,12 @@ export class ProjectsInModalComponent {
ngOnInit() {
if (this.organizationId) {
this.linkToSearchProjects = this.properties.searchLinkToAdvancedProjects;//+"?organization="+this.organizationId+"or=and";;
if (this.fetchProjects.searchUtils.totalResults > 0) {
this.search(false, "");
}
}
}
public getResultPreview(result: SearchResult): ResultPreview {
return ResultPreview.searchResultConvert(result, 'project');
}
private search(refine: boolean, filterQuery: string) {
var refineFields: string [] = ["funder"];
this.fetchProjects.getResultsForOrganizations(this.organizationId, filterQuery, this.page, this.size, (refine) ? refineFields : [], this.properties);

View File

@ -1,33 +1,32 @@
/* This module contains all common components for all landing pages */
import { NgModule} from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms';
import {RouterModule} from '@angular/router';
import { ProjectsServiceModule} from '../../services/projectsService.module';
import { TabResultModule } from '../../searchPages/searchUtils/tabResult.module';
import { ProjectsInModalComponent} from './projects-in-modal.component';
import {ProjectsServiceModule} from '../../services/projectsService.module';
import {TabResultModule} from '../../searchPages/searchUtils/tabResult.module';
import {ProjectsInModalComponent} from './projects-in-modal.component';
import {PagingModule } from '../../utils/paging.module';
import {PagingModule} from '../../utils/paging.module';
import {ErrorMessagesModule} from '../../utils/errorMessages.module';
import {NoLoadPaging} from "../../searchPages/searchUtils/no-load-paging.module";
import {ResultPreviewModule} from "../../utils/result-preview/result-preview.module";
import {SearchResultsModule} from "../../searchPages/searchUtils/searchResults.module";
@NgModule({
imports: [
RouterModule, CommonModule, FormsModule,
ProjectsServiceModule, TabResultModule,
PagingModule, ErrorMessagesModule, NoLoadPaging, ResultPreviewModule
PagingModule, ErrorMessagesModule, NoLoadPaging, SearchResultsModule
],
declarations: [
ProjectsInModalComponent
],
providers:[
],
exports: [
ProjectsInModalComponent
]
],
providers: [],
exports: [
ProjectsInModalComponent
]
})
export class ProjectsInModalModule { }
export class ProjectsInModalModule {
}

View File

@ -185,15 +185,15 @@
</div>
<div class="uk-margin-small-top uk-flex">
<!-- Last Index Info-->
<div class="uk-flex uk-flex-bottom uk-width-2-3">
<div class="uk-width-2-3@m uk-width-1-2">
<img src="assets/common-assets/graph.svg" style="opacity: 0.4">
<span class="uk-margin-small-left uk-text-small uk-text-baseline uk-text-muted">Powered by OpenAIRE Open Research Graph</span>
<span class="uk-margin-small-left uk-text-small uk-text-baseline uk-text-muted">
Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}
<span class="uk-margin-small-left uk-text-baseline uk-text-muted">Powered by OpenAIRE Open Research Graph</span>
<span class="uk-text-baseline uk-text-muted">
. Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}
</span>
</div>
<!--Feedback-->
<div class="uk-width-1-3 uk-text-right uk-text-small">
<div class="uk-width-expand uk-text-right">
<span class="uk-text-muted">Any information missing or wrong?</span>
<a (click)="showFeedback = true; scroll()" class="portal-link space">Report an Issue</a>
</div>
@ -213,8 +213,8 @@
<modal-alert *ngIf="organizationInfo && organizationInfo.deletedByInferenceIds"
#AlertModalDeletedByInference classBody="uk-width-xxlarge uk-padding-remove-right">
<landing-header [properties]="properties" [title]="organizationInfo.title.name"
[subTitle]="(organizationInfo.name
&& organizationInfo.title.name !== organizationInfo.name)?organizationInfo.name:null"
[subTitle]="(organizationInfo.name && organizationInfo.title.name !== organizationInfo.name)?organizationInfo.name:null"
titleClass="title-grey-background"
[entityType]="'organization'"></landing-header>
<div class="uk-margin-medium-top uk-margin-medium-right">
<organizationsDeletedByInference *ngIf="deleteByInferenceOpened"