ORP landing: change link button text to link this product to

Search Advanced: smaller remove filter buttons
Search: when there are no numbers in filter hide sorting options
Cookie law: change session cookie(default) to expire in 3 months
Metrics: change string to numbers to be able to use > or ==



git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@52824 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2018-07-26 10:09:06 +00:00
parent 19a26a399b
commit 0c0147f408
6 changed files with 21 additions and 16 deletions

View File

@ -152,7 +152,7 @@
<button style=" box-shadow: 0 1px 10px #444444" class=" uk-button uk-button-danger ">
<span class="uk-icon">
<svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="25" viewBox="0 0 20 20" height="25"><path d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375" fill="none" stroke="#000" stroke-width="1.1"></path><path d="M7.925,11.875 L11.925,7.975" fill="none" stroke="#000" stroke-width="1.1"></path></svg>
</span> Link this other research product to
</span> Link this product to
</button>
<div uk-dropdown="pos: top-right; mode:click" style="background: transparent !important;box-shadow: none; max-width: 70px !important; min-width: 70px !important;">

View File

@ -37,14 +37,15 @@
</span>
</td>
<td class=" " >
<span *ngIf="selectedFields.length > 1" type="button" class="uk-icon-button" (click)="removeField(i)">
<span class=""><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="minus" ratio="1"><rect height="3" width="18" y="9" x="2"></rect></svg></span>
<span *ngIf="selectedFields.length > 1" type="button" class="uk-icon-button icon-button-small" (click)="removeField(i)">
<span class=""><svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="minus" ratio="0.8"><rect height="1" width="18" y="9" x="1"></rect></svg></span>
</span>
<span *ngIf="selectedFields.length == 1" type="button" class="uk-icon-button" disabled>
<span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="minus" ratio="1"><rect height="3" width="18" y="9" x="1"></rect></svg></span>
<span *ngIf="selectedFields.length == 1" type="button" class="uk-icon-button icon-button-small" disabled>
<span class="uk-icon">
<svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="minus" ratio="0.8"><rect height="1" width="18" y="9" x="1"></rect></svg>
</span>
</span>
</td>
<td *ngIf="i == selectedFields.length-1 " class=" "><span type="button" class="uk-icon-button icon-button-small" (click)="addField()">
<span *ngIf="i == selectedFields.length-1 " type="button" class="uk-icon-button icon-button-small" (click)="addField()">
<span class="uk-icon">
<svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="plus" ratio="0.8"><rect x="9" y="1" width="1" height="17"></rect><rect x="1" y="9" width="17" height="1"></rect></svg>
</span>

View File

@ -35,7 +35,7 @@
<div *ngIf="filter.values.length >= 99" class="uk-alert uk-alert-primary uk-text-center uk-margin-right uk-margin-left">Showing top {{filter.values.length}} values. </div>
<div class="uk-grid uk-margin-left uk-margin-right">
<input class="uk-input uk-margin-small-bottom uk-width-1-2 " name="filter-keyword" placeholder="Search for {{filter.title}}" type="text" [(ngModel)]="keyword">
<select [(ngModel)]="sortBy" class="uk-select uk-margin-small-bottom uk-width-1-2 uk-padding-remove" name="select_order" (ngModelChange)="sortByChanged = true;" >
<select *ngIf = "showResultCount === true" [(ngModel)]="sortBy" class="uk-select uk-margin-small-bottom uk-width-1-2 uk-padding-remove" name="select_order" (ngModelChange)="sortByChanged = true;" >
<option value="num" >Sort by results number</option>
<option value="name" >Sort by name</option>
</select>

View File

@ -23,8 +23,8 @@ export class MetricsService {
}
parseMetrics(downloads: any, views: any, totalDownloads: string, totalViews: string,
totalOpenaireViews: string, totalOpenaireDownloads: string, pageViews: string, properties:EnvProperties): any {
parseMetrics(downloads: any, views: any, totalDownloads: number, totalViews: number,
totalOpenaireViews: number, totalOpenaireDownloads: number, pageViews: number, properties:EnvProperties): any {
this.metrics = new Metrics();
this.metrics.totalDownloads = totalDownloads;

View File

@ -51,7 +51,11 @@ export class CookieLawService {
*/
private setCookie(name: string): void {
if (typeof document !== 'undefined') {
document.cookie = encodeURIComponent(name) + '=true; path=/';
let d:Date = new Date();
d.setTime(d.getTime() + 3*30 * 24 * 60 * 60 * 1000); // in 3 months
let expires:string = `expires=${d.toUTCString()}`;
document.cookie = encodeURIComponent(name) + '=true; path=/; expires='+expires+';';
}
}
}

View File

@ -1,8 +1,8 @@
export class Metrics {
totalDownloads: string;
totalViews: string;
totalOpenaireViews: string;
totalOpenaireDownloads: string;
pageViews: string;
totalDownloads: number;
totalViews: number;
totalOpenaireViews: number;
totalOpenaireDownloads: number;
pageViews: number;
infos: Map<string, {"name": string, "url": string, "numOfDownloads": string, "numOfViews": string, "openaireDownloads": string, "openaireViews": string}>;
}