[Trunk | Library]:

1. searchResult.component: Removed field 'dividerNotCard' added to show results in card or not (added in r58717) - result-preview is used instead.
2. tabs.component.ts: Removed class 'uk-width-3-4' from 'main-tabs'.
3. project.component: [Landing redesign]:
        a. Add field 'public searchNuumber: number = 5;' to set how many results to search and display.
        b. Use '<result-preview' instead of 'search-result'.
        c. Fix margins and paddings in page to align app box with right column in tabs.
        d. Show open access mandate (not in labels) only for 'No'.
        e. Move update date next to openaire graph.
        f. Add class 'user-actions' in ul in app box (right box of page) and set margins.
	g. Add class 'basic-info' in ul for basic information (set margin).
	h. Get indexUpdateDate from service if available.


git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@58724 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2020-05-19 15:59:20 +00:00
parent 95a3ae82e8
commit 6a94908622
6 changed files with 67 additions and 51 deletions

View File

@ -98,23 +98,29 @@
<div *ngIf="fetch.searchUtils.status == errorCodes.DONE"> <div *ngIf="fetch.searchUtils.status == errorCodes.DONE">
<div class="uk-inline uk-flex uk-flex-right"> <div class="uk-inline uk-flex uk-flex-right">
<span class="uk-text-uppercase uk-position-left uk-text-middle uk-flex-middle uk-flex"> <span class="uk-text-uppercase uk-position-left uk-text-middle uk-flex-middle uk-flex">
<span>Top 10</span><span class="space uk-text-muted">{{getEntityName(type, true, true)}}</span> <span>Top {{searchNuumber}}</span><span class="space uk-text-muted">{{getEntityName(type, true, true)}}</span>
</span> </span>
<a [queryParams]="routerHelper.createQueryParams(['f0', 'fv0', 'type', 'qf'], ['relprojectid', projectId, getEntityName(type, true, false), 'false'])" <a [queryParams]="routerHelper.createQueryParams(['f0', 'fv0', 'type', 'qf'], ['relprojectid', projectId, getEntityName(type, true, false), 'false'])"
[routerLink]="properties.searchLinkToAdvancedResults" target="_blank"> [routerLink]="properties.searchLinkToAdvancedResults" target="_blank">
<button *ngIf="fetch.searchUtils.totalResults > 10" <button *ngIf="fetch.searchUtils.totalResults > 10"
class="uk-button uk-button-small portal-button"> class="uk-button uk-button-small portal-button">
<span uk-icon="search"></span> <span uk-icon="search"></span>
View more View all
</button> </button>
</a> </a>
</div> </div>
<search-result [results]="fetch.results"
[status]="fetch.searchUtils.status" <ul class="uk-list-divider uk-list uk-margin uk-margin-top">
[type]="type" urlParam="articleId" <errorMessages [status]="[fetch.searchUtils.status]" [type]="'results'"></errorMessages>
dividerNotCard="true"> <li *ngFor="let result of fetch.results" class="uk-animation-fade">
</search-result> <div>
<result-preview [properties]="properties" [showOrganizations]="true"
[showSubjects]="true" [result]="getResultPreview(result, type)">
</result-preview>
</div>
</li>
</ul>
</div> </div>
</ng-template> </ng-template>
@ -132,8 +138,8 @@
class="loading-gif uk-align-center"></span></div> class="loading-gif uk-align-center"></span></div>
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0" <helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
[texts]="pageContents['top']"></helper> [texts]="pageContents['top']"></helper>
<div *ngIf="projectInfo != null" class="uk-grid"> <div *ngIf="projectInfo != null" class="uk-grid uk-margin-remove-left uk-margin-medium-bottom">
<div class="uk-width-2-3@m uk-width-1-1@s uk-margin-bottom"> <div class="uk-width-2-3@m uk-width-1-1@s uk-margin-bottom uk-padding uk-padding-remove-left uk-padding-remove-vertical">
<schema2jsonld *ngIf="projectInfo" [data]=projectInfo <schema2jsonld *ngIf="projectInfo" [data]=projectInfo
[URL]="properties.baseLink+properties.searchLinkToProject+projectId" [URL]="properties.baseLink+properties.searchLinkToProject+projectId"
type="project"></schema2jsonld> type="project"></schema2jsonld>
@ -167,7 +173,7 @@
Special Clause 39 Special Clause 39
</span>{{" "}} </span>{{" "}}
</div> </div>
<ul class="uk-list uk-margin-bottom left-border"> <ul class="basic-info uk-list uk-margin-bottom left-border">
<li *ngIf="projectInfo.funding"> <li *ngIf="projectInfo.funding">
<span *ngIf="projectInfo.funding.funderName" class="uk-margin-right"> <span *ngIf="projectInfo.funding.funderName" class="uk-margin-right">
<span class="uk-text-muted">Funder: </span> <span class="uk-text-muted">Funder: </span>
@ -230,18 +236,20 @@
</li> </li>
</ul> </ul>
<ul class="uk-list uk-margin-bottom"> <ul class="uk-list uk-margin-bottom">
<li *ngIf="projectInfo.openAccessMandatePublications != undefined || projectInfo.openAccessMandateDatasets != undefined"> <li *ngIf="(projectInfo.openAccessMandatePublications != undefined && !projectInfo.openAccessMandatePublications)
|| (projectInfo.openAccessMandateDatasets != undefined && !projectInfo.openAccessMandateDatasets)">
<div>Open Access mandate</div> <div>Open Access mandate</div>
<div> <div>
<span *ngIf="projectInfo.openAccessMandatePublications != undefined" class="uk-margin-right"> <span *ngIf="projectInfo.openAccessMandatePublications != undefined && !projectInfo.openAccessMandatePublications"
class="uk-margin-right">
<span class="uk-text-muted">Publications: </span> <span class="uk-text-muted">Publications: </span>
<span *ngIf="projectInfo.openAccessMandatePublications">Yes</span> <!-- <span *ngIf="projectInfo.openAccessMandatePublications">Yes</span>-->
<span *ngIf="!projectInfo.openAccessMandatePublications">No</span> <span>No</span>
</span> </span>
<span *ngIf="projectInfo.openAccessMandateDatasets != undefined"> <span *ngIf="projectInfo.openAccessMandateDatasets != undefined && !projectInfo.openAccessMandateDatasets">
<span class="uk-text-muted">Research Data: </span> <span class="uk-text-muted">Research Data: </span>
<span *ngIf="projectInfo.openAccessMandateDatasets">Yes</span> <!-- <span *ngIf="projectInfo.openAccessMandateDatasets">Yes</span>-->
<span *ngIf="!projectInfo.openAccessMandateDatasets">No</span> <span>No</span>
</span> </span>
</div> </div>
</li> </li>
@ -438,8 +446,8 @@
<!-- </ul>--> <!-- </ul>-->
</div> </div>
<div class="uk-width-1-3@m uk-width-1-1@s"> <div class="uk-width-1-3@m uk-width-1-1@s uk-padding-remove">
<ul class="uk-list uk-card uk-card-default uk-padding-small"> <ul class="user-actions uk-list uk-card uk-card-default uk-padding">
<!-- <div *ngIf="isRouteAvailable('participate/direct-claim')">--> <!-- <div *ngIf="isRouteAvailable('participate/direct-claim')">-->
<!-- <div class="uk-margin-auto uk-width-3-4">--> <!-- <div class="uk-margin-auto uk-width-3-4">-->
<!-- <button class="uk-button uk-width-1-1 portal-button">--> <!-- <button class="uk-button uk-width-1-1 portal-button">-->
@ -598,7 +606,7 @@
<li *ngIf="isRouteAvailable('participate/direct-claim')"> <li *ngIf="isRouteAvailable('participate/direct-claim')">
<a class="uk-link-text uk-text-bold uk-text-uppercase" (click)="openLinkProjectModal()"> <a class="uk-link-text uk-text-bold uk-text-uppercase" (click)="openLinkProjectModal()">
<span class="uk-icon-button portal-button" uk-icon="link"></span> <span class="uk-icon-button portal-button" uk-icon="link"></span>
Link this project to... <span class="uk-margin-small-left">Link this project to...</span>
</a> </a>
<modal-alert #linkProjectModal> <modal-alert #linkProjectModal>
<div class="uk-grid uk-child-width-1-3 uk-width-large "> <div class="uk-grid uk-child-width-1-3 uk-width-large ">
@ -629,18 +637,18 @@
<line fill="none" stroke="#000" x1="9.5" y1="15" x2="9.5" y2="4"></line> <line fill="none" stroke="#000" x1="9.5" y1="15" x2="9.5" y2="4"></line>
</svg> </svg>
</span> </span>
Deposit your research <span class="uk-margin-small-left">Deposit your research</span>
</a> </a>
</li> </li>
<li> <li>
<a class="uk-link-text uk-text-bold uk-text-uppercase" (click)="openShareResultsModal()"> <a class="uk-link-text uk-text-bold uk-text-uppercase" (click)="openShareResultsModal()">
<span class="uk-icon uk-icon-button uk-button-default"> <span class="uk-icon uk-icon-button uk-button-primary">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="code" ratio="1"> <svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="code" ratio="1">
<polyline fill="none" stroke="#000" stroke-width="1.01" points="13,4 19,10 13,16"></polyline> <polyline fill="none" stroke="#000" stroke-width="1.01" points="13,4 19,10 13,16"></polyline>
<polyline fill="none" stroke="#000" stroke-width="1.01" points="7,4 1,10 7,16"></polyline> <polyline fill="none" stroke="#000" stroke-width="1.01" points="7,4 1,10 7,16"></polyline>
</svg> </svg>
</span> </span>
Share results <span class="uk-margin-small-left">Share results</span>
</a> </a>
<modal-alert #shareResultsModal> <modal-alert #shareResultsModal>
<div class="app-box uk-padding-small uk-margin-small-left uk-margin-small-right"> <div class="app-box uk-padding-small uk-margin-small-left uk-margin-small-right">
@ -670,14 +678,14 @@
</li> </li>
<li> <li>
<a class="uk-link-text uk-text-bold uk-text-uppercase" (click)="openDownloadReportModal()"> <a class="uk-link-text uk-text-bold uk-text-uppercase" (click)="openDownloadReportModal()">
<span class="uk-icon uk-icon-button uk-button-secondary"> <span class="uk-icon uk-icon-button uk-button-primary">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="download" ratio="1"> <svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="download" ratio="1">
<polyline fill="none" stroke="#000" points="14,10 9.5,14.5 5,10"></polyline> <polyline fill="none" stroke="#000" points="14,10 9.5,14.5 5,10"></polyline>
<rect x="3" y="17" width="13" height="1"></rect> <rect x="3" y="17" width="13" height="1"></rect>
<line fill="none" stroke="#000" x1="9.5" y1="13.91" x2="9.5" y2="3"></line> <line fill="none" stroke="#000" x1="9.5" y1="13.91" x2="9.5" y2="3"></line>
</svg> </svg>
</span> </span>
Download report <span class="uk-margin-small-left">Download report</span>
</a> </a>
<modal-alert #downloadReportModal> <modal-alert #downloadReportModal>
<div class="app-box uk-padding-small uk-margin-small-left uk-margin-small-right"> <div class="app-box uk-padding-small uk-margin-small-left uk-margin-small-right">
@ -757,9 +765,9 @@
</ul> </ul>
<div class="uk-margin-small-top uk-text-muted uk-text-small uk-text-right"> <!-- <div class="uk-margin-small-top uk-text-muted uk-text-small uk-text-right">-->
Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}} <!-- Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}-->
</div> <!-- </div>-->
<modal-loading></modal-loading> <modal-loading></modal-loading>
<modal-alert #AlertModalCsvError></modal-alert> <modal-alert #AlertModalCsvError></modal-alert>
@ -957,6 +965,9 @@
<div class="uk-margin-small-top uk-flex uk-flex-bottom"> <div class="uk-margin-small-top uk-flex uk-flex-bottom">
<img src="assets/common-assets/graph.svg" style="opacity: 0.4"> <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">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>
</div> </div>

View File

@ -22,6 +22,10 @@ import {HelperService} from "../../utils/helper/helper.service";
import {Location} from "@angular/common"; import {Location} from "@angular/common";
import {HtmlProjectReportService} from "../htmlProjectReport/htmlProjectReport.service"; import {HtmlProjectReportService} from "../htmlProjectReport/htmlProjectReport.service";
import {StringUtils} from "../../utils/string-utils.class"; import {StringUtils} from "../../utils/string-utils.class";
import {ResultLandingInfo} from "../../utils/entities/resultLandingInfo";
import {ResultPreview} from "../../utils/result-preview/result-preview";
import {SearchResult} from "../../utils/entities/searchResult";
import {IndexInfoService} from "../../utils/indexInfo.service";
@Component({ @Component({
selector: 'project', selector: 'project',
@ -89,13 +93,10 @@ export class ProjectComponent {
// Variables for publications, research data, software tabs // Variables for publications, research data, software tabs
public fetchPublications: FetchResearchResults; public fetchPublications: FetchResearchResults;
public linkToSearchPublications = "";
public fetchDatasets: FetchResearchResults; public fetchDatasets: FetchResearchResults;
public linkToSearchDatasets = "";
public fetchSoftware: FetchResearchResults; public fetchSoftware: FetchResearchResults;
public linkToSearchSoftware = "";
public fetchOrps: FetchResearchResults; public fetchOrps: FetchResearchResults;
public linkToSearchOrps = ""; public searchNuumber: number = 5;
public routerHelper: RouterHelper = new RouterHelper(); public routerHelper: RouterHelper = new RouterHelper();
public errorCodes: ErrorCodes = new ErrorCodes(); public errorCodes: ErrorCodes = new ErrorCodes();
@ -140,15 +141,20 @@ export class ProjectComponent {
private _projectService: ProjectService, private _projectService: ProjectService,
private _searchResearchResultsService: SearchResearchResultsService, private _searchResearchResultsService: SearchResearchResultsService,
private _reportsService: ReportsService, private _reportsService: ReportsService,
private htmlService: HtmlProjectReportService) {} private htmlService: HtmlProjectReportService,
private indexInfoService: IndexInfoService) {}
ngOnInit() { ngOnInit() {
this.route.data this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => { .subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific; this.properties = data.envSpecific;
if(this.properties.lastIndexUpdate) { this.indexInfoService.getLastIndexDate(this.properties).subscribe(lastIndexUpdate => {
this.indexUpdateDate = new Date(this.properties.lastIndexUpdate); if(lastIndexUpdate) {
} this.indexUpdateDate = new Date(lastIndexUpdate);
} else if(this.properties.lastIndexUpdate) {
this.indexUpdateDate = new Date(this.properties.lastIndexUpdate);
}
});
//this.getDivContents(); //this.getDivContents();
this.getPageContents(); this.getPageContents();
this.updateUrl(data.envSpecific.baseLink + this._router.url); this.updateUrl(data.envSpecific.baseLink + this._router.url);
@ -277,28 +283,23 @@ export class ProjectComponent {
} }
private searchPublications() { private searchPublications() {
this.fetchPublications.getResultsForEntity("publication", "project", this.projectId, 1, 10, this.properties); this.fetchPublications.getResultsForEntity("publication", "project", this.projectId, 1, this.searchNuumber, this.properties);
this.linkToSearchPublications = this.properties.searchLinkToAdvancedPublications;// + "?project=" + this.projectId+"&pr=and";
this.reloadPublications = false; this.reloadPublications = false;
} }
private searchDatasets() { private searchDatasets() {
this.fetchDatasets.getResultsForEntity("dataset", "project", this.projectId, 1, 10, this.properties); this.fetchDatasets.getResultsForEntity("dataset", "project", this.projectId, 1, this.searchNuumber, this.properties);
this.linkToSearchDatasets = this.properties.searchLinkToAdvancedDatasets;// + "?project=" + this.projectId+"&pr=and";
this.reloadDatasets = false; this.reloadDatasets = false;
//this.activeTab = "Research Data"; //this.activeTab = "Research Data";
} }
private searchSoftware() { private searchSoftware() {
this.fetchSoftware.getResultsForEntity("software", "project", this.projectId, 1, 10, this.properties); this.fetchSoftware.getResultsForEntity("software", "project", this.projectId, 1, this.searchNuumber, this.properties);
this.linkToSearchSoftware = this.properties.searchLinkToAdvancedSoftware;
this.reloadSoftware = false; this.reloadSoftware = false;
} }
private searchOrps() { private searchOrps() {
this.fetchOrps.getResultsForEntity("other", "project", this.projectId, 1, 10, this.properties); this.fetchOrps.getResultsForEntity("other", "project", this.projectId, 1, this.searchNuumber, this.properties);
this.linkToSearchOrps = this.properties.searchLinkToAdvancedOrps;
this.reloadOrps = false; this.reloadOrps = false;
} }
@ -761,4 +762,8 @@ export class ProjectComponent {
return entityType + (plural ? "s" : ""); return entityType + (plural ? "s" : "");
} }
} }
public getResultPreview(result: SearchResult, type: string): ResultPreview {
return ResultPreview.searchResultConvert(result, type);
}
} }

View File

@ -29,6 +29,7 @@ import {FeedbackModule} from "../feedback/feedback.module";
import {AltMetricsModule} from "../../utils/altmetrics.module"; import {AltMetricsModule} from "../../utils/altmetrics.module";
import {TabsModule} from "../../utils/tabs/tabs.module"; import {TabsModule} from "../../utils/tabs/tabs.module";
import {SearchResultsModule} from "../../searchPages/searchUtils/searchResults.module"; import {SearchResultsModule} from "../../searchPages/searchUtils/searchResults.module";
import {ResultPreviewModule} from "../../utils/result-preview/result-preview.module";
@NgModule({ @NgModule({
imports: [ imports: [
@ -38,7 +39,7 @@ import {SearchResultsModule} from "../../searchPages/searchUtils/searchResults.m
SearchResearchResultsServiceModule, ProjectServiceModule, SearchResearchResultsServiceModule, ProjectServiceModule,
Schema2jsonldModule, SEOServiceModule, HelperModule, Schema2jsonldModule, SEOServiceModule, HelperModule,
LandingHeaderModule, MatSelectModule, FeedbackModule, AltMetricsModule, LandingHeaderModule, MatSelectModule, FeedbackModule, AltMetricsModule,
TabsModule, SearchResultsModule TabsModule, ResultPreviewModule
], ],
declarations: [ declarations: [
ProjectComponent ProjectComponent

View File

@ -1,7 +1,7 @@
<ul [class]="(dividerNotCard ? 'uk-list-divider ' : '')+'uk-list uk-margin uk-margin-top '+custom_class"> <ul [class]="'uk-list uk-margin uk-margin-top '+custom_class">
<errorMessages [status]="[status]" [type]="'results'"></errorMessages> <errorMessages [status]="[status]" [type]="'results'"></errorMessages>
<li *ngFor="let result of previewResults" class="uk-animation-fade"> <li *ngFor="let result of previewResults" class="uk-animation-fade">
<div [class]="dividerNotCard ? '' : 'uk-card uk-card-default uk-padding uk-card-hover'"> <div class="uk-card uk-card-default uk-padding uk-card-hover">
<result-preview [properties]="properties" [showOrganizations]="showOrganizations" <result-preview [properties]="properties" [showOrganizations]="showOrganizations"
[showSubjects]="showSubjects" [result]="result"> [showSubjects]="showSubjects" [result]="result">
</result-preview> </result-preview>

View File

@ -19,8 +19,7 @@ export class SearchResultComponent implements OnInit, OnChanges {
@Input() custom_class: string = "search-results"; @Input() custom_class: string = "search-results";
@Input() properties: EnvProperties; @Input() properties: EnvProperties;
@Input() showImpactFactors: boolean = false; @Input() showImpactFactors: boolean = false;
@Input() dividerNotCard: boolean = false;
constructor( private http: HttpClient/*ATHENA CODE*/) { constructor( private http: HttpClient/*ATHENA CODE*/) {
} }

View File

@ -15,7 +15,7 @@ import { TabComponent } from './tab.component';
@Component({ @Component({
selector: 'my-tabs', selector: 'my-tabs',
template: ` template: `
<ul uk-tab class="uk-tab uk-text-truncate main-tabs uk-margin-remove uk-child-width-expand uk-width-3-4" uk-switcher="connect: .main-tabs-content"> <ul uk-tab class="uk-tab uk-text-truncate main-tabs uk-margin-remove uk-child-width-expand" uk-switcher="connect: .main-tabs-content">
<!-- + (tab.active ? ' uk-active' : '')--> <!-- + (tab.active ? ' uk-active' : '')-->
<li *ngFor="let tab of tabs" (click)="selectTab(tab)" [class.active]="tab.active" [class]="'uk-padding-remove '+(tab.statistics ? ' statistics ' : '')"> <li *ngFor="let tab of tabs" (click)="selectTab(tab)" [class.active]="tab.active" [class]="'uk-padding-remove '+(tab.statistics ? ' statistics ' : '')">
<a class="uk-width-1-1 uk-height-1-1"> <a class="uk-width-1-1 uk-height-1-1">