[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:
parent
1f55667499
commit
4e7a8cd474
|
@ -13,6 +13,7 @@
|
||||||
<form class="">
|
<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 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"
|
<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>
|
[bordered]="true" colorClass="uk-text-secondary"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class=" uk-grid uk-flex-middle">
|
<div class=" uk-grid uk-flex-middle">
|
||||||
|
|
|
@ -19,6 +19,7 @@ import {PiwikService} from '../../../utils/piwik/piwik.service';
|
||||||
import {properties} from '../../../../../environments/environment';
|
import {properties} from '../../../../../environments/environment';
|
||||||
import {FormArray, FormBuilder, FormGroup} from '@angular/forms';
|
import {FormArray, FormBuilder, FormGroup} from '@angular/forms';
|
||||||
import {Option} from '../../../sharedComponents/input/input.component';
|
import {Option} from '../../../sharedComponents/input/input.component';
|
||||||
|
import {SearchInputComponent} from '../../../sharedComponents/search-input/search-input.component';
|
||||||
|
|
||||||
declare var UIkit;
|
declare var UIkit;
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -44,6 +45,7 @@ export class DisplayClaimsComponent {
|
||||||
sizes = [10, 20, 30, 50];
|
sizes = [10, 20, 30, 50];
|
||||||
keyword: string; // the keyword string to give to the request as parameter
|
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)
|
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"];
|
types = ["All", "Project", "Context", "Result", "User"];
|
||||||
pageLoading:boolean = false;
|
pageLoading:boolean = false;
|
||||||
@Input() fetchBy: string;
|
@Input() fetchBy: string;
|
||||||
|
@ -60,7 +62,7 @@ export class DisplayClaimsComponent {
|
||||||
public entitiesCtrl: FormArray;
|
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"}},
|
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[] = [
|
sortOptions: Option[] = [
|
||||||
{label:"Date (recent) ", value:{ sort: "date", descending: true }}, {label:"Date (oldest) ", value:{ sort: "date",descending:false }},
|
{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'];
|
let size = (params['size'] === undefined) ? this.defaultSize : +params['size'];
|
||||||
|
|
||||||
this.keyword = (params['keyword'] ? params['keyword'] : "");
|
this.keyword = (params['keyword'] ? params['keyword'] : "");
|
||||||
|
this.filterForm.get('keyword').setValue(this.keyword);
|
||||||
this.inputkeyword = this.keyword;
|
this.inputkeyword = this.keyword;
|
||||||
this.page = (page <= 0) ? 1 : page;
|
this.page = (page <= 0) ? 1 : page;
|
||||||
this.size = (size <= 0) ? this.defaultSize : size;
|
this.size = (size <= 0) ? this.defaultSize : size;
|
||||||
|
@ -513,4 +516,12 @@ export class DisplayClaimsComponent {
|
||||||
private updateUrl(url: string) {
|
private updateUrl(url: string) {
|
||||||
this._meta.updateTag({content: url}, "property='og:url'");
|
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()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue