[Library|Trunk]

Display claims fixes:
	initialize and preview keyword
	correct communities filter 


git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@60664 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2021-03-18 08:51:09 +00:00
parent 1f55667499
commit 4e7a8cd474
2 changed files with 13 additions and 1 deletions

View File

@ -13,6 +13,7 @@
<form class="">
<div class="uk-width-1-1 uk-flex uk-flex-right@m uk-flex-center uk-flex-wrap uk-flex-middle uk-grid" uk-grid>
<div search-input [control]="filterForm.controls.keyword" [showSearch]="false" placeholder="Search links"
[selected]="inputkeyword" (closeEmitter)="onSearchClose()" (resetEmitter)="resetInput()"
[bordered]="true" colorClass="uk-text-secondary"></div>
</div>
<div class=" uk-grid uk-flex-middle">

View File

@ -19,6 +19,7 @@ import {PiwikService} from '../../../utils/piwik/piwik.service';
import {properties} from '../../../../../environments/environment';
import {FormArray, FormBuilder, FormGroup} from '@angular/forms';
import {Option} from '../../../sharedComponents/input/input.component';
import {SearchInputComponent} from '../../../sharedComponents/search-input/search-input.component';
declare var UIkit;
@Component({
@ -44,6 +45,7 @@ export class DisplayClaimsComponent {
sizes = [10, 20, 30, 50];
keyword: string; // the keyword string to give to the request as parameter
inputkeyword: string; // the string written in the input field (keyword=inputkeyword when its length is bigger than 3 and the user stops typing)
@ViewChild('searchInputComponent') searchInputComponent: SearchInputComponent;
types = ["All", "Project", "Context", "Result", "User"];
pageLoading:boolean = false;
@Input() fetchBy: string;
@ -60,7 +62,7 @@ export class DisplayClaimsComponent {
public entitiesCtrl: FormArray;
allOptions: Option[] = [{label: "Projects", value: {id:"project", label: "Projects"}},{label: "Publications", value:{id:"publication", label: "Publications"}},{label: "Research data", value: {id:"dataset", label: "Research data"}},
{label: "Software", value: {id:"software", label: "Software"}},{label: "Other reserch products", value: {id:"other", label: "Other reserch products"}},{label: "Communities", value: {id:"community", label: "Communities"}}];
{label: "Software", value: {id:"software", label: "Software"}},{label: "Other reserch products", value: {id:"other", label: "Other reserch products"}},{label: "Communities", value: {id:"context", label: "Communities"}}];
sortOptions: Option[] = [
{label:"Date (recent) ", value:{ sort: "date", descending: true }}, {label:"Date (oldest) ", value:{ sort: "date",descending:false }},
@ -140,6 +142,7 @@ export class DisplayClaimsComponent {
let size = (params['size'] === undefined) ? this.defaultSize : +params['size'];
this.keyword = (params['keyword'] ? params['keyword'] : "");
this.filterForm.get('keyword').setValue(this.keyword);
this.inputkeyword = this.keyword;
this.page = (page <= 0) ? 1 : page;
this.size = (size <= 0) ? this.defaultSize : size;
@ -513,4 +516,12 @@ export class DisplayClaimsComponent {
private updateUrl(url: string) {
this._meta.updateTag({content: url}, "property='og:url'");
}
public onSearchClose() {
this.inputkeyword = this.filterForm.get('keyword').value;
}
public resetInput() {
this.inputkeyword = null;
this.searchInputComponent.reset()
}
}