Removed modal for loading in Search Pages and added an alert message (while loading all forms, inputs, buttons are disabled)
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@47340 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
cb6c2654c1
commit
d3245a1a3c
|
@ -20,7 +20,8 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
|||
[(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields"
|
||||
[(searchUtils)] = "searchUtils"
|
||||
(queryChange)="queryChanged($event)"
|
||||
[csvParams]="csvParams" csvPath="resources" simpleSearchLink="/search/find/dataproviders">
|
||||
[csvParams]="csvParams" csvPath="resources" simpleSearchLink="/search/find/dataproviders"
|
||||
[disableForms]="disableForms">
|
||||
</advanced-search-page>
|
||||
|
||||
`
|
||||
|
@ -39,6 +40,7 @@ export class AdvancedSearchDataProvidersComponent {
|
|||
@ViewChild (AdvancedSearchPageComponent) searchPage : AdvancedSearchPageComponent ;
|
||||
public resourcesQuery = "(oaftype exact datasource)";
|
||||
public csvParams: string;
|
||||
public disableForms: boolean = false;
|
||||
|
||||
constructor (private route: ActivatedRoute, private _searchDataProvidersService: SearchDataprovidersService ) {
|
||||
|
||||
|
@ -75,7 +77,10 @@ export class AdvancedSearchDataProvidersComponent {
|
|||
|
||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = errorCodes.LOADING;
|
||||
this.searchPage.openLoading();
|
||||
//this.searchPage.openLoading();
|
||||
this.disableForms = true;
|
||||
this.results = [];
|
||||
this.searchUtils.totalResults = 0;
|
||||
|
||||
console.info("Advanced Search Publications: Execute search query "+parameters);
|
||||
this._searchDataProvidersService.advancedSearchDataproviders(parameters, page, size).subscribe(
|
||||
|
@ -89,8 +94,8 @@ export class AdvancedSearchDataProvidersComponent {
|
|||
if(this.searchUtils.totalResults == 0 ){
|
||||
this.searchUtils.status = errorCodes.NONE;
|
||||
}
|
||||
this.searchPage.closeLoading();
|
||||
|
||||
//this.searchPage.closeLoading();
|
||||
this.disableForms = false;
|
||||
},
|
||||
err => {
|
||||
console.log(err);
|
||||
|
@ -101,8 +106,8 @@ export class AdvancedSearchDataProvidersComponent {
|
|||
// }
|
||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = errorCodes.NOT_AVAILABLE;
|
||||
this.searchPage.closeLoading();
|
||||
|
||||
//this.searchPage.closeLoading();
|
||||
this.disableForms = false;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
@ -19,7 +19,8 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
|||
[(searchUtils)] = "searchUtils"
|
||||
[(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields"
|
||||
(queryChange)="queryChanged($event)"
|
||||
[csvParams]="csvParams" csvPath="resources" simpleSearchLink="/search/find/datasets">
|
||||
[csvParams]="csvParams" csvPath="resources" simpleSearchLink="/search/find/datasets"
|
||||
[disableForms]="disableForms">
|
||||
</advanced-search-page>
|
||||
|
||||
`
|
||||
|
@ -41,6 +42,7 @@ export class AdvancedSearchDatasetsComponent {
|
|||
@ViewChild (AdvancedSearchPageComponent) searchPage : AdvancedSearchPageComponent ;
|
||||
public resourcesQuery = "( (oaftype exact result) and (resulttypeid exact dataset) )";
|
||||
public csvParams: string;
|
||||
public disableForms: boolean = false;
|
||||
|
||||
constructor (private route: ActivatedRoute, private _searchDatasetsService: SearchDatasetsService ) {
|
||||
|
||||
|
@ -80,7 +82,10 @@ export class AdvancedSearchDatasetsComponent {
|
|||
|
||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = errorCodes.LOADING;
|
||||
this.searchPage.openLoading();
|
||||
//this.searchPage.openLoading();
|
||||
this.disableForms = true;
|
||||
this.results = [];
|
||||
this.searchUtils.totalResults = 0;
|
||||
|
||||
console.info("Advanced Search Datasets: Execute search query "+parameters);
|
||||
this._searchDatasetsService.advancedSearchDatasets(parameters, page, size).subscribe(
|
||||
|
@ -94,8 +99,8 @@ export class AdvancedSearchDatasetsComponent {
|
|||
if(this.searchUtils.totalResults == 0 ){
|
||||
this.searchUtils.status = errorCodes.NONE;
|
||||
}
|
||||
this.searchPage.closeLoading();
|
||||
|
||||
//this.searchPage.closeLoading();
|
||||
this.disableForms = false;
|
||||
},
|
||||
err => {
|
||||
console.log(err);
|
||||
|
@ -106,8 +111,8 @@ export class AdvancedSearchDatasetsComponent {
|
|||
// }
|
||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = errorCodes.NOT_AVAILABLE;
|
||||
this.searchPage.closeLoading();
|
||||
|
||||
//this.searchPage.closeLoading();
|
||||
this.disableForms = false;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
@ -19,7 +19,8 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
|||
[(searchUtils)] = "searchUtils"
|
||||
[(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields"
|
||||
(queryChange)="queryChanged($event)"
|
||||
[csvParams]="csvParams" csvPath="resources" simpleSearchLink="/search/find/organizations">
|
||||
[csvParams]="csvParams" csvPath="resources" simpleSearchLink="/search/find/organizations"
|
||||
[disableForms]="disableForms">
|
||||
</advanced-search-page>
|
||||
|
||||
`
|
||||
|
@ -35,6 +36,7 @@ export class AdvancedSearchOrganizationsComponent {
|
|||
public fieldIdsMap = this.searchFields.ORGANIZATION_FIELDS;
|
||||
public selectedFields:AdvancedField[] = [];
|
||||
public csvParams: string;
|
||||
public disableForms: boolean = false;
|
||||
|
||||
@ViewChild (AdvancedSearchPageComponent) searchPage : AdvancedSearchPageComponent ;
|
||||
|
||||
|
@ -78,7 +80,10 @@ public resourcesQuery = "(oaftype exact organization)";
|
|||
|
||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = errorCodes.LOADING;
|
||||
this.searchPage.openLoading();
|
||||
//this.searchPage.openLoading();
|
||||
this.disableForms = true;
|
||||
this.results = [];
|
||||
this.searchUtils.totalResults = 0;
|
||||
|
||||
console.info("Advanced Search Organizations: Execute search query "+parameters);
|
||||
this._searchOrganizationsService.advancedSearchOrganizations(parameters, page, size).subscribe(
|
||||
|
@ -92,7 +97,8 @@ public resourcesQuery = "(oaftype exact organization)";
|
|||
if(this.searchUtils.totalResults == 0 ){
|
||||
this.searchUtils.status = errorCodes.NONE;
|
||||
}
|
||||
this.searchPage.closeLoading();
|
||||
//this.searchPage.closeLoading();
|
||||
this.disableForms = false;
|
||||
|
||||
},
|
||||
err => {
|
||||
|
@ -104,8 +110,8 @@ public resourcesQuery = "(oaftype exact organization)";
|
|||
// }
|
||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = errorCodes.NOT_AVAILABLE;
|
||||
this.searchPage.closeLoading();
|
||||
|
||||
//this.searchPage.closeLoading();
|
||||
this.disableForms = false;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
@ -19,7 +19,8 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
|||
[(searchUtils)] = "searchUtils"
|
||||
[(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields"
|
||||
(queryChange)="queryChanged($event)"
|
||||
[csvParams]="csvParams" csvPath="resources" simpleSearchLink="/search/find/people">
|
||||
[csvParams]="csvParams" csvPath="resources" simpleSearchLink="/search/find/people"
|
||||
[disableForms]="disableForms">
|
||||
</advanced-search-page>
|
||||
|
||||
`
|
||||
|
@ -40,6 +41,7 @@ export class AdvancedSearchPeopleComponent {
|
|||
@ViewChild (AdvancedSearchPageComponent) searchPage : AdvancedSearchPageComponent ;
|
||||
public resourcesQuery = "(oaftype exact person)";
|
||||
public csvParams: string;
|
||||
public disableForms: boolean = false;
|
||||
|
||||
constructor (private route: ActivatedRoute, private _searchPeopleService: SearchPeopleService ) {
|
||||
|
||||
|
@ -79,7 +81,10 @@ export class AdvancedSearchPeopleComponent {
|
|||
|
||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = errorCodes.LOADING;
|
||||
this.searchPage.openLoading();
|
||||
//this.searchPage.openLoading();
|
||||
this.disableForms = true;
|
||||
this.results = [];
|
||||
this.searchUtils.totalResults = 0;
|
||||
|
||||
console.info("Advanced Search People: Execute search query "+parameters);
|
||||
this._searchPeopleService.advancedSearchPeople(parameters, page, size).subscribe(
|
||||
|
@ -93,7 +98,8 @@ export class AdvancedSearchPeopleComponent {
|
|||
if(this.searchUtils.totalResults == 0 ){
|
||||
this.searchUtils.status = errorCodes.NONE;
|
||||
}
|
||||
this.searchPage.closeLoading();
|
||||
//this.searchPage.closeLoading();
|
||||
this.disableForms = false;
|
||||
|
||||
},
|
||||
err => {
|
||||
|
@ -105,8 +111,8 @@ export class AdvancedSearchPeopleComponent {
|
|||
// }
|
||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = errorCodes.NOT_AVAILABLE;
|
||||
this.searchPage.closeLoading();
|
||||
|
||||
//this.searchPage.closeLoading();
|
||||
this.disableForms = false;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
@ -18,7 +18,8 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
|||
[(searchUtils)] = "searchUtils"
|
||||
[(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields"
|
||||
(queryChange)="queryChanged($event)"
|
||||
[csvParams]="csvParams" csvPath="resources" simpleSearchLink="/search/find/projects">
|
||||
[csvParams]="csvParams" csvPath="resources" simpleSearchLink="/search/find/projects"
|
||||
[disableForms]="disableForms">
|
||||
</advanced-search-page>
|
||||
|
||||
`
|
||||
|
@ -39,6 +40,7 @@ export class AdvancedSearchProjectsComponent {
|
|||
@ViewChild (AdvancedSearchPageComponent) searchPage : AdvancedSearchPageComponent ;
|
||||
public resourcesQuery = "(oaftype exact project)";
|
||||
public csvParams: string;
|
||||
public disableForms: boolean = false;
|
||||
|
||||
constructor (private route: ActivatedRoute, private _searchProjectsService: SearchProjectsService ) {
|
||||
|
||||
|
@ -78,7 +80,10 @@ export class AdvancedSearchProjectsComponent {
|
|||
|
||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = errorCodes.LOADING;
|
||||
this.searchPage.openLoading();
|
||||
//this.searchPage.openLoading();
|
||||
this.disableForms = true;
|
||||
this.results = [];
|
||||
this.searchUtils.totalResults = 0;
|
||||
|
||||
console.info("Advanced Search Publications: Execute search query "+parameters);
|
||||
this._searchProjectsService.advancedSearchProjects(parameters, page, size).subscribe(
|
||||
|
@ -92,7 +97,8 @@ export class AdvancedSearchProjectsComponent {
|
|||
if(this.searchUtils.totalResults == 0 ){
|
||||
this.searchUtils.status = errorCodes.NONE;
|
||||
}
|
||||
this.searchPage.closeLoading();
|
||||
//this.searchPage.closeLoading();
|
||||
this.disableForms = false;
|
||||
|
||||
},
|
||||
err => {
|
||||
|
@ -104,7 +110,8 @@ export class AdvancedSearchProjectsComponent {
|
|||
// }
|
||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = errorCodes.NOT_AVAILABLE;
|
||||
this.searchPage.closeLoading();
|
||||
//this.searchPage.closeLoading();
|
||||
this.disableForms = false;
|
||||
|
||||
}
|
||||
);
|
||||
|
|
|
@ -19,7 +19,8 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
|||
[(searchUtils)] = "searchUtils"
|
||||
[(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields"
|
||||
(queryChange)="queryChanged($event)"
|
||||
[csvParams]="csvParams" csvPath="resources" simpleSearchLink="/search/find/publications">
|
||||
[csvParams]="csvParams" csvPath="resources" simpleSearchLink="/search/find/publications"
|
||||
[disableForms]="disableForms">
|
||||
</advanced-search-page>
|
||||
`
|
||||
})
|
||||
|
@ -36,6 +37,7 @@ export class AdvancedSearchPublicationsComponent {
|
|||
public selectedFields:AdvancedField[] = [];
|
||||
public resourcesQuery = "((oaftype exact result) and (resulttypeid exact publication))";
|
||||
public csvParams: string;
|
||||
public disableForms: boolean = false;
|
||||
|
||||
@ViewChild (AdvancedSearchPageComponent) searchPage : AdvancedSearchPageComponent ;
|
||||
|
||||
|
@ -79,7 +81,10 @@ export class AdvancedSearchPublicationsComponent {
|
|||
|
||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = errorCodes.LOADING;
|
||||
this.searchPage.openLoading();
|
||||
//this.searchPage.openLoading();
|
||||
this.disableForms = true;
|
||||
this.results = [];
|
||||
this.searchUtils.totalResults = 0;
|
||||
|
||||
console.info("Advanced Search Publications: Execute search query "+parameters);
|
||||
this._searchPublicationsService.advancedSearchPublications(parameters, page, size).subscribe(
|
||||
|
@ -93,7 +98,8 @@ export class AdvancedSearchPublicationsComponent {
|
|||
if(this.searchUtils.totalResults == 0 ){
|
||||
this.searchUtils.status = errorCodes.NONE;
|
||||
}
|
||||
this.searchPage.closeLoading();
|
||||
//this.searchPage.closeLoading();
|
||||
this.disableForms = false;
|
||||
|
||||
},
|
||||
err => {
|
||||
|
@ -105,7 +111,8 @@ export class AdvancedSearchPublicationsComponent {
|
|||
// }
|
||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = errorCodes.NOT_AVAILABLE;
|
||||
this.searchPage.closeLoading();
|
||||
//this.searchPage.closeLoading();
|
||||
this.disableForms = false;
|
||||
|
||||
}
|
||||
);
|
||||
|
|
|
@ -9,7 +9,7 @@ import {Dates} from '../../utils/string-utils.class';
|
|||
@Component({
|
||||
selector: 'advanced-search-form',
|
||||
template: `
|
||||
<form class="">
|
||||
<form [class]="(isDisabled)?'uk-disabled':''">
|
||||
<table >
|
||||
<tr *ngFor="let selectedField of selectedFields; let i = index" class="-row ">
|
||||
<td *ngIf ="i==0 " class="">Search for:</td>
|
||||
|
@ -72,6 +72,8 @@ export class AdvancedSearchFormComponent {
|
|||
@Input() fieldIds: string[];
|
||||
@Input() fieldIdsMap;
|
||||
@Input() selectedFields:AdvancedField[];
|
||||
@Input() isDisabled: boolean = false;
|
||||
|
||||
@Output() queryChange = new EventEmitter();
|
||||
newFieldId:string;
|
||||
newFieldName:string;
|
||||
|
|
|
@ -19,13 +19,14 @@ import { Meta} from '../../../angular2-meta';
|
|||
<h1>{{pageTitle}}</h1>
|
||||
</div>
|
||||
<div>
|
||||
<a *ngIf = "simpleSearchLink && simpleSearchLink.length > 0" routerLinkActive="router-link-active" [routerLink]=simpleSearchLink class="uk-float-right" >Simple search <span uk-icon="icon: chevron-right"></span></a>
|
||||
<a *ngIf = "simpleSearchLink && simpleSearchLink.length > 0" routerLinkActive="router-link-active" [routerLink]=simpleSearchLink [class]="(disableForms)?'uk-float-right uk-disabled uk-link-muted':'uk-float-right'" >Simple search <span uk-icon="icon: chevron-right"></span></a>
|
||||
<advanced-search-form
|
||||
[entityType] = "entityType"
|
||||
[(fieldIds)]="fieldIds"
|
||||
[(fieldIdsMap)]="fieldIdsMap"
|
||||
[(selectedFields)]="selectedFields"
|
||||
(queryChange)="queryChanged($event)">
|
||||
(queryChange)="queryChanged($event)"
|
||||
[isDisabled]="disableForms">
|
||||
</advanced-search-form>
|
||||
<search-paging [type]="type" [(searchUtils)] = "searchUtils" [(results)] = "results" [(baseUrl)] = "searchUtils.baseUrl" [(parameterNames)] = "parameterNames" [(parameterValues)] = "parameterValues" ></search-paging>
|
||||
<search-download [type]="csvPath" [csvParams]="csvParams" [totalResults]="searchUtils.totalResults" ></search-download>
|
||||
|
@ -33,13 +34,14 @@ import { Meta} from '../../../angular2-meta';
|
|||
<div>
|
||||
<search-result [results]="results"
|
||||
[status]=searchUtils.status
|
||||
[type]="entityType" [urlParam]="urlParam">
|
||||
[type]="entityType" [urlParam]="urlParam"
|
||||
[showLoading]="true">
|
||||
</search-result>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<modal-loading [message]= "'Loading results...'"></modal-loading>
|
||||
<!--modal-loading [message]= "'Loading results...'"></modal-loading-->
|
||||
|
||||
`
|
||||
})
|
||||
|
@ -57,8 +59,7 @@ export class AdvancedSearchPageComponent {
|
|||
@Input() csvParams: string;
|
||||
@Input() csvPath: string;
|
||||
@Input() simpleSearchLink: string = "";
|
||||
|
||||
|
||||
@Input() disableForms:boolean = false;
|
||||
|
||||
public parameterNames:string[] =[];
|
||||
public parameterValues:string[] =[];
|
||||
|
|
|
@ -16,18 +16,22 @@ import {Open} from '../../utils/modal/open.component';
|
|||
<div *ngFor = "let value of getSelectedValues(filter)" class = "uk-animation-fade filterItem">
|
||||
|
||||
<span class="filterName"><div title = "{{value.name}}">
|
||||
<input [(ngModel)]="value.selected" type="checkbox" (ngModelChange)="filterChange(value.selected)" />
|
||||
<input [disabled]="isDisabled" [(ngModel)]="value.selected" type="checkbox" (ngModelChange)="filterChange(value.selected)" />
|
||||
{{_formatName(value)}} </div></span><span class="filterNumber" *ngIf = "showResultCount === true" > ({{value.number}})</span>
|
||||
</div>
|
||||
<!--div class="uk-grid-divider uk-margin-remove"></div-->
|
||||
<hr *ngIf="getSelectedValues(filter).length > 0 && getNotSelectedValues(filter).length > 0" class="uk-grid-divider uk-margin-remove">
|
||||
<div *ngFor = "let value of getNotSelectedValues(filter).slice(0,5-getSelectedValues(filter).length)" class = "uk-animation-fade filterItem">
|
||||
|
||||
<span class="filterName"><div title = "{{value.name}}"> <input [(ngModel)]="value.selected" type="checkbox" (ngModelChange)="filterChange(value.selected)" />
|
||||
<span class="filterName"><div title = "{{value.name}}"> <input [disabled]="isDisabled" [(ngModel)]="value.selected" type="checkbox" (ngModelChange)="filterChange(value.selected)" />
|
||||
{{_formatName(value)}} </div></span><span class="filterNumber" *ngIf = "showResultCount === true" > ({{value.number}})</span>
|
||||
</div>
|
||||
|
||||
<a *ngIf="(getSelectedValues(filter).length + getNotSelectedValues(filter).length) > 5" (click)="toggle()">Show More</a>
|
||||
<a *ngIf="(getSelectedValues(filter).length + getNotSelectedValues(filter).length) > 5" (click)="toggle()" [class]="(isDisabled)?'uk-disabled uk-link-muted':''">Show More</a>
|
||||
<!--button *ngIf="(getSelectedValues(filter).length + getNotSelectedValues(filter).length) > 5"
|
||||
class="uk-button uk-button-link" (click)="toggle()" [disabled]="isDisabled">
|
||||
Show More
|
||||
</button-->
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
@ -37,9 +41,10 @@ import {Open} from '../../utils/modal/open.component';
|
|||
})
|
||||
|
||||
export class SearchFilterComponent {
|
||||
|
||||
|
||||
@Input() filter:Filter;
|
||||
@Input() showResultCount:boolean = true;
|
||||
@Input() isDisabled:boolean = false;
|
||||
public showAll:boolean = false;
|
||||
public _maxCharacters:number =28;
|
||||
|
||||
|
|
|
@ -41,6 +41,7 @@ import { Filter} from './searchHelperClasses.class';
|
|||
*/
|
||||
export class SearchFilterModalComponent{
|
||||
@Input() filter: Filter;
|
||||
@Input() showResultCount:boolean = true;
|
||||
@Output() modalChange = new EventEmitter();
|
||||
|
||||
public isOpen:boolean=false;
|
||||
|
|
|
@ -4,7 +4,7 @@ import {Observable} from 'rxjs/Observable';
|
|||
@Component({
|
||||
selector: 'search-form',
|
||||
template: `
|
||||
<form class = " uk-margin uk-text-center uk-margin-top">
|
||||
<form [class]="(isDisabled)?'uk-margin uk-text-center uk-margin-top uk-disabled':'uk-margin uk-text-center uk-margin-top'">
|
||||
<input type="text" class="uk-input uk-width-1-2" placeholder="Type keywords..." aria-describedby="sizing-addon2" [(ngModel)]="keyword" name="keyword" >
|
||||
<button (click)="keywordChanged()" type="submit" class=" uk-button uk-button-default">Search</button>
|
||||
</form>
|
||||
|
@ -12,6 +12,7 @@ import {Observable} from 'rxjs/Observable';
|
|||
})
|
||||
|
||||
export class SearchFormComponent {
|
||||
@Input() isDisabled: boolean = false;
|
||||
@Input() keyword: string = '';
|
||||
|
||||
@Output() keywordChange = new EventEmitter();
|
||||
|
|
|
@ -22,13 +22,13 @@ import {SearchFilterModalComponent} from './searchFilterModal.component';
|
|||
<div>
|
||||
<div *ngIf="showRefine" >
|
||||
<div class="uk-width-1-1 uk-margin uk-padding uk-panel uk-background-muted">
|
||||
<search-form [(keyword)]="searchUtils.keyword" (keywordChange)="keywordChanged($event)"></search-form>
|
||||
<search-form [isDisabled]="disableForms" [(keyword)]="searchUtils.keyword" (keywordChange)="keywordChanged($event)"></search-form>
|
||||
<div *ngIf="isFiltered()" class = " uk-text-center ">
|
||||
<span *ngIf = "searchUtils.keyword.length > 0">Keywords: <span>{{searchUtils.keyword}}<a (click) = "clearKeywords() " class="uk-icon-button" ><span class=" clickable " aria-hidden="true"><span uk-icon="icon: close"></span></span></a></span>
|
||||
<span *ngIf = "searchUtils.keyword.length > 0">Keywords: <span>{{searchUtils.keyword}}<a (click) = "clearKeywords() " [class]="(disableForms)?'uk-icon-button uk-disabled':'uk-icon-button'"><span class=" clickable " aria-hidden="true"><span uk-icon="icon: close"></span></span></a></span>
|
||||
</span>
|
||||
<span *ngFor="let filter of filters " >
|
||||
<span *ngIf = "filter.countSelectedValues > 0"> {{filter.title}}:
|
||||
<span *ngFor="let value of getSelectedValues(filter); let i = index; let end = last; " >{{value.name}}<a (click) = "removeFilter(value, filter) " class="uk-icon-button"><span class=" clickable" aria-hidden="true"><span uk-icon="icon: close"></span></span></a>
|
||||
<span *ngFor="let value of getSelectedValues(filter); let i = index; let end = last; " >{{value.name}}<a (click) = "removeFilter(value, filter) " [class]="(disableForms)?'uk-icon-button uk-disabled':'uk-icon-button'"><span class=" clickable" aria-hidden="true"><span uk-icon="icon: close"></span></span></a>
|
||||
<span *ngIf="!end">, </span>
|
||||
</span>
|
||||
</span>
|
||||
|
@ -36,15 +36,15 @@ import {SearchFilterModalComponent} from './searchFilterModal.component';
|
|||
<!--span>
|
||||
Clear All
|
||||
<a (click)="clearFilters()" class="uk-icon-button uk-text-right"><span uk-icon="icon: close"></span></a></span-->
|
||||
<a (click)="clearFilters()">
|
||||
<a (click)="clearFilters()" [class]="(disableForms)?'uk-disabled uk-link-muted':''">
|
||||
Clear All
|
||||
</a>
|
||||
</div>
|
||||
<a *ngIf = "advancedSearchLink && advancedSearchLink.length > 0" routerLinkActive="router-link-active" class="uk-float-right" [routerLink]=advancedSearchLink >More search options <span uk-icon="icon: chevron-right"></span></a>
|
||||
<a *ngIf = "advancedSearchLink && advancedSearchLink.length > 0" routerLinkActive="router-link-active" [class]="(disableForms)?'uk-float-right uk-disabled uk-link-muted':'uk-float-right'" [routerLink]=advancedSearchLink >More search options <span uk-icon="icon: chevron-right"></span></a>
|
||||
</div>
|
||||
<div class="uk-grid uk-width-1-1 uk-margin">
|
||||
<div class=" search-filters uk-width-1-4@l uk-width-1-4@m uk-width-1-1@s ">
|
||||
<search-filter *ngFor="let filter of filters " [filter]="filter" [showResultCount]=showResultCount (change)="filterChanged($event)" (toggleModal)="toggleModal($event)"></search-filter>
|
||||
<search-filter *ngFor="let filter of filters " [isDisabled]="disableForms" [filter]="filter" [showResultCount]=showResultCount (change)="filterChanged($event)" (toggleModal)="toggleModal($event)"></search-filter>
|
||||
</div>
|
||||
|
||||
<div class="uk-width-3-4@m uk-width-3-4@l uk-width-1-1@s uk-first-column" >
|
||||
|
@ -52,7 +52,8 @@ import {SearchFilterModalComponent} from './searchFilterModal.component';
|
|||
<search-download [type]="csvPath" [csvParams]="csvParams" [totalResults]="searchUtils.totalResults" (downloadClick)="downloadClicked($event)"></search-download>
|
||||
<search-result [results]="results"
|
||||
[status]=searchUtils.status
|
||||
[type]="entityType" [urlParam]="urlParam">
|
||||
[type]="entityType" [urlParam]="urlParam"
|
||||
[showLoading]="true">
|
||||
</search-result>
|
||||
</div>
|
||||
|
||||
|
@ -62,20 +63,21 @@ import {SearchFilterModalComponent} from './searchFilterModal.component';
|
|||
|
||||
|
||||
<div *ngIf="!showRefine" >
|
||||
<search-form [(keyword)]="searchUtils.keyword" (keywordChange)="keywordChanged($event)"></search-form>
|
||||
<search-form [isDisabled]="disableForms" [(keyword)]="searchUtils.keyword" (keywordChange)="keywordChanged($event)"></search-form>
|
||||
<search-paging [type]="type" [(searchUtils)] = "searchUtils" [(results)] = "results" [(baseUrl)] = "baseUrl" [(parameterNames)] = "parameterNames" [(parameterValues)] = "parameterValues"></search-paging>
|
||||
<search-download [type]="csvPath" [csvParams]="csvParams" [totalResults]="searchUtils.totalResults" (downloadClick)="downloadClicked($event)"></search-download>
|
||||
<search-result [results]="results"
|
||||
[status]=searchUtils.status
|
||||
[type]="entityType" [urlParam]="urlParam">
|
||||
[type]="entityType" [urlParam]="urlParam"
|
||||
[showLoading]="true">
|
||||
</search-result>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<modal-loading [message]= "'Loading results...'"></modal-loading>
|
||||
<!--modal-loading [message]= "'Loading results...'"></modal-loading-->
|
||||
|
||||
<modal-search-filter [filter]="currentFilter" (modalChange)="filterChanged($event)"></modal-search-filter>
|
||||
<modal-search-filter [filter]="currentFilter" [showResultCount]=showResultCount (modalChange)="filterChanged($event)"></modal-search-filter>
|
||||
|
||||
`
|
||||
})
|
||||
|
@ -95,6 +97,8 @@ export class SearchPageComponent {
|
|||
@Input() csvParams: string;
|
||||
@Input() csvPath: string;
|
||||
@Input() advancedSearchLink: string = "";
|
||||
@Input() disableForms:boolean = false;
|
||||
|
||||
@ViewChild (ModalLoading) loading : ModalLoading ;
|
||||
public fieldIdsMap;//: { [key:string]:{ name:string, operator:string, type:string, indexField:string, equalityOperator:string }};
|
||||
private searchFieldsHelper:SearchFields = new SearchFields();
|
||||
|
@ -109,7 +113,6 @@ export class SearchPageComponent {
|
|||
@ViewChild (SearchFilterModalComponent) searchFilterModal : SearchFilterModalComponent ;
|
||||
public currentFilter: Filter;
|
||||
|
||||
|
||||
constructor (private location: Location , private _meta: Meta) {
|
||||
}
|
||||
|
||||
|
|
|
@ -17,8 +17,9 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
|||
<search-page pageTitle="Search Dataproviders"
|
||||
type="data providers" entityType="dataprovider" [(filters)] = "filters"
|
||||
[(results)] = "results" [(searchUtils)] = "searchUtils" [baseUrl] = "baseUrl"
|
||||
(queryChange)="queryChanged($event)" (downloadClick)="downloadClicked($event)"
|
||||
[csvParams]="csvParams" csvPath="datasources" advancedSearchLink="/search/advanced/dataproviders">
|
||||
(queryChange)="queryChanged($event)" (downloadClick)="downloadClicked($event)"
|
||||
[csvParams]="csvParams" csvPath="datasources" advancedSearchLink="/search/advanced/dataproviders"
|
||||
[disableForms]="disableForms">
|
||||
</search-page>
|
||||
|
||||
`
|
||||
|
@ -40,6 +41,8 @@ export class SearchDataprovidersComponent {
|
|||
public CSVDownloaded = false;
|
||||
public csvParams: string;
|
||||
|
||||
public disableForms: boolean = false;
|
||||
|
||||
@ViewChild (SearchPageComponent) searchPage : SearchPageComponent ;
|
||||
|
||||
constructor (private route: ActivatedRoute, private _searchDataprovidersService: SearchDataprovidersService ) {
|
||||
|
@ -231,7 +234,10 @@ public getResultsForDeposit(id:string, type:string, page: number, size: number)
|
|||
var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = errorCodes.LOADING;
|
||||
|
||||
this.searchPage.openLoading();
|
||||
//this.searchPage.openLoading();
|
||||
this.disableForms = true;
|
||||
this.results = [];
|
||||
this.searchUtils.totalResults = 0;
|
||||
|
||||
this.subResults = this._searchDataprovidersService.searchDataproviders(parameters,(refine)?this.searchPage.getRefineFieldsQuery():null, page, size, this.searchPage.getFields()).subscribe(
|
||||
data => {
|
||||
|
@ -249,7 +255,8 @@ public getResultsForDeposit(id:string, type:string, page: number, size: number)
|
|||
if(this.searchUtils.totalResults == 0 ){
|
||||
this.searchUtils.status = errorCodes.NONE;
|
||||
}
|
||||
this.searchPage.closeLoading();
|
||||
//this.searchPage.closeLoading();
|
||||
this.disableForms = false;
|
||||
},
|
||||
err => {
|
||||
console.log(err);
|
||||
|
@ -259,7 +266,8 @@ public getResultsForDeposit(id:string, type:string, page: number, size: number)
|
|||
// }
|
||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = errorCodes.ERROR;
|
||||
this.searchPage.closeLoading();
|
||||
//this.searchPage.closeLoading();
|
||||
this.disableForms = false;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
@ -19,7 +19,8 @@ import {DOI} from '../../utils/string-utils.class';
|
|||
type="datasets" entityType="dataset" [(filters)] = "filters"
|
||||
[(results)] = "results" [(searchUtils)] = "searchUtils"
|
||||
[baseUrl] = "baseUrl" (queryChange)="queryChanged($event)"
|
||||
[csvParams]="csvParams" csvPath="datasets" advancedSearchLink="/search/advanced/datasets">
|
||||
[csvParams]="csvParams" csvPath="datasets" advancedSearchLink="/search/advanced/datasets"
|
||||
[disableForms]="disableForms">
|
||||
</search-page>
|
||||
`
|
||||
})
|
||||
|
@ -39,6 +40,7 @@ export class SearchDatasetsComponent {
|
|||
private urlParams : Map<string, string>;
|
||||
private _location:Location;
|
||||
public csvParams: string;
|
||||
public disableForms: boolean = false;
|
||||
|
||||
@ViewChild (SearchPageComponent) searchPage : SearchPageComponent ;
|
||||
constructor (private route: ActivatedRoute, private _searchDatasetsService: SearchDatasetsService ) {
|
||||
|
@ -175,7 +177,10 @@ private _getResults(parameters:string,refine:boolean, page: number, size: number
|
|||
// }
|
||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = errorCodes.LOADING;
|
||||
this.searchPage.openLoading();
|
||||
//this.searchPage.openLoading();
|
||||
this.disableForms = true;
|
||||
this.results = [];
|
||||
this.searchUtils.totalResults = 0;
|
||||
|
||||
this.subResults = this._searchDatasetsService.searchDatasets(parameters,(refine)?this.searchPage.getRefineFieldsQuery():null, page, size, this.searchPage.getFields()).subscribe(
|
||||
data => {
|
||||
|
@ -192,7 +197,8 @@ private _getResults(parameters:string,refine:boolean, page: number, size: number
|
|||
if(this.searchUtils.totalResults == 0 ){
|
||||
this.searchUtils.status = errorCodes.NONE;
|
||||
}
|
||||
this.searchPage.closeLoading();
|
||||
//this.searchPage.closeLoading();
|
||||
this.disableForms = false;
|
||||
},
|
||||
err => {
|
||||
console.log(err);
|
||||
|
@ -202,7 +208,8 @@ private _getResults(parameters:string,refine:boolean, page: number, size: number
|
|||
// }
|
||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = errorCodes.ERROR;
|
||||
this.searchPage.closeLoading();
|
||||
//this.searchPage.closeLoading();
|
||||
this.disableForms = false;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
@ -17,7 +17,8 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
|||
type="organizations" entityType="organization" [(filters)] = "filters"
|
||||
[(results)] = "results" [(searchUtils)] = "searchUtils"
|
||||
[baseUrl] = "baseUrl" (queryChange)="queryChanged($event)"
|
||||
[csvParams]="csvParams" csvPath="organizations" advancedSearchLink="/search/advanced/organizations">
|
||||
[csvParams]="csvParams" csvPath="organizations" advancedSearchLink="/search/advanced/organizations"
|
||||
[disableForms]="disableForms">
|
||||
</search-page>
|
||||
|
||||
`
|
||||
|
@ -36,6 +37,7 @@ export class SearchOrganizationsComponent {
|
|||
public urlParams : Map<string, string>;
|
||||
public _location:Location;
|
||||
public csvParams: string;
|
||||
public disableForms: boolean = false;
|
||||
|
||||
@ViewChild (SearchPageComponent) searchPage : SearchPageComponent ;
|
||||
|
||||
|
@ -92,7 +94,10 @@ export class SearchOrganizationsComponent {
|
|||
// }
|
||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = errorCodes.LOADING;
|
||||
this.searchPage.openLoading();
|
||||
//this.searchPage.openLoading();
|
||||
this.disableForms = true;
|
||||
this.results = [];
|
||||
this.searchUtils.totalResults = 0;
|
||||
|
||||
this.subResults = this._searchOrganizationsService.searchOrganizations(parameters,(refine)?this.searchPage.getRefineFieldsQuery():null, page, size, this.searchPage.getFields()).subscribe(
|
||||
data => {
|
||||
|
@ -109,7 +114,8 @@ export class SearchOrganizationsComponent {
|
|||
if(this.searchUtils.totalResults == 0 ){
|
||||
this.searchUtils.status = errorCodes.NONE;
|
||||
}
|
||||
this.searchPage.closeLoading();
|
||||
//this.searchPage.closeLoading();
|
||||
this.disableForms = false;
|
||||
},
|
||||
err => {
|
||||
console.log(err);
|
||||
|
@ -119,7 +125,8 @@ export class SearchOrganizationsComponent {
|
|||
// }
|
||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = errorCodes.ERROR;
|
||||
this.searchPage.closeLoading();
|
||||
//this.searchPage.closeLoading();
|
||||
this.disableForms = false;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
@ -19,7 +19,8 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
|||
type="people" entityType="person" [(filters)] = "filters"
|
||||
[(results)] = "results" [(searchUtils)] = "searchUtils"
|
||||
[baseUrl] = "baseUrl" (queryChange)="queryChanged($event)" [showRefine]=false
|
||||
[csvParams]="csvParams" csvPath="people" advancedSearchLink="/search/advanced/people">
|
||||
[csvParams]="csvParams" csvPath="people" advancedSearchLink="/search/advanced/people"
|
||||
[disableForms]="disableForms">
|
||||
</search-page>
|
||||
|
||||
`
|
||||
|
@ -35,6 +36,7 @@ export class SearchPeopleComponent {
|
|||
public searchFields:SearchFields = new SearchFields();
|
||||
public refineFields = this.searchFields.PERSON_REFINE_FIELDS;
|
||||
public csvParams: string;
|
||||
public disableForms: boolean = false;
|
||||
|
||||
@ViewChild (SearchPageComponent) searchPage : SearchPageComponent ;
|
||||
|
||||
|
@ -78,7 +80,10 @@ private _getResults(parameters:string,refine:boolean, page: number, size: number
|
|||
|
||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = errorCodes.LOADING;
|
||||
this.searchPage.openLoading();
|
||||
//this.searchPage.openLoading();
|
||||
this.disableForms = true;
|
||||
this.results = [];
|
||||
this.searchUtils.totalResults = 0;
|
||||
|
||||
this._searchPeopleService.searchPeople(parameters,(refine)?this.searchPage.getRefineFieldsQuery():null, page, size, this.searchPage.getFields()).subscribe(
|
||||
data => {
|
||||
|
@ -92,7 +97,8 @@ private _getResults(parameters:string,refine:boolean, page: number, size: number
|
|||
if(this.searchUtils.totalResults == 0 ){
|
||||
this.searchUtils.status = errorCodes.NONE;
|
||||
}
|
||||
this.searchPage.closeLoading();
|
||||
//this.searchPage.closeLoading();
|
||||
this.disableForms = false;
|
||||
},
|
||||
err => {
|
||||
console.log(err);
|
||||
|
@ -102,7 +108,8 @@ private _getResults(parameters:string,refine:boolean, page: number, size: number
|
|||
// }
|
||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = errorCodes.ERROR;
|
||||
this.searchPage.closeLoading();
|
||||
//this.searchPage.closeLoading();
|
||||
this.disableForms = false;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
@ -17,7 +17,8 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
|||
type="projects" entityType="project" [(filters)] = "filters"
|
||||
[(results)] = "results" [(searchUtils)] = "searchUtils"
|
||||
[baseUrl] = "baseUrl" (queryChange)="queryChanged($event)"
|
||||
[csvParams]="csvParams" csvPath="projects" advancedSearchLink="/search/advanced/projects">
|
||||
[csvParams]="csvParams" csvPath="projects" advancedSearchLink="/search/advanced/projects"
|
||||
[disableForms]="disableForms">
|
||||
</search-page>
|
||||
`
|
||||
|
||||
|
@ -35,6 +36,7 @@ export class SearchProjectsComponent {
|
|||
public urlParams : Map<string, string>;
|
||||
public _location:Location;
|
||||
public csvParams: string;
|
||||
public disableForms: boolean = false;
|
||||
|
||||
@ViewChild (SearchPageComponent) searchPage : SearchPageComponent ;
|
||||
|
||||
|
@ -96,7 +98,10 @@ export class SearchProjectsComponent {
|
|||
|
||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = errorCodes.LOADING;
|
||||
this.searchPage.openLoading();
|
||||
//this.searchPage.openLoading();
|
||||
this.disableForms = true;
|
||||
this.results = [];
|
||||
this.searchUtils.totalResults = 0;
|
||||
|
||||
this.subResults = this._searchProjectsService.searchProjects(parameters,(refine)?this.searchPage.getRefineFieldsQuery():null, page, size, this.searchPage.getFields()).subscribe(
|
||||
data => {
|
||||
|
@ -114,7 +119,8 @@ export class SearchProjectsComponent {
|
|||
if(this.searchUtils.totalResults == 0 ){
|
||||
this.searchUtils.status = errorCodes.NONE;
|
||||
}
|
||||
this.searchPage.closeLoading();
|
||||
//this.searchPage.closeLoading();
|
||||
this.disableForms = false;
|
||||
},
|
||||
err => {
|
||||
console.log(err);
|
||||
|
@ -124,7 +130,8 @@ export class SearchProjectsComponent {
|
|||
// }
|
||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = errorCodes.ERROR;
|
||||
this.searchPage.closeLoading();
|
||||
//this.searchPage.closeLoading();
|
||||
this.disableForms = false;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
@ -22,7 +22,8 @@ import {DOI} from '../../utils/string-utils.class';
|
|||
[(filters)] = "filters" [(results)] = "results"
|
||||
[(searchUtils)] = "searchUtils" [(baseUrl)] = baseUrl
|
||||
(queryChange)="queryChanged($event)" (downloadClick)="downloadClicked($event)"
|
||||
[csvParams]="csvParams" csvPath="publications" advancedSearchLink="/search/advanced/publications">
|
||||
[csvParams]="csvParams" csvPath="publications" advancedSearchLink="/search/advanced/publications"
|
||||
[disableForms]="disableForms">
|
||||
</search-page>
|
||||
|
||||
`
|
||||
|
@ -50,6 +51,7 @@ export class SearchPublicationsComponent {
|
|||
};
|
||||
public CSVDownloaded = false;
|
||||
public csvParams: string;
|
||||
public disableForms: boolean = false;
|
||||
|
||||
constructor (private route: ActivatedRoute, private _searchPublicationsService: SearchPublicationsService ) {
|
||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
|
@ -185,7 +187,10 @@ private _getResults(parameters:string,refine:boolean, page: number, size: number
|
|||
|
||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = errorCodes.LOADING;
|
||||
this.searchPage.openLoading();
|
||||
//this.searchPage.openLoading();
|
||||
this.disableForms = true;
|
||||
this.results = [];
|
||||
this.searchUtils.totalResults = 0;
|
||||
|
||||
this.subResults = this._searchPublicationsService.searchPublications(parameters,(refine)?this.searchPage.getRefineFieldsQuery():null, page, size, this.searchPage.getFields()).subscribe(
|
||||
data => {
|
||||
|
@ -202,7 +207,8 @@ private _getResults(parameters:string,refine:boolean, page: number, size: number
|
|||
if(this.searchUtils.totalResults == 0 ){
|
||||
this.searchUtils.status = errorCodes.NONE;
|
||||
}
|
||||
this.searchPage.closeLoading();
|
||||
//this.searchPage.closeLoading();
|
||||
this.disableForms = false;
|
||||
},
|
||||
err => {
|
||||
console.log(err);
|
||||
|
@ -212,7 +218,8 @@ private _getResults(parameters:string,refine:boolean, page: number, size: number
|
|||
// }
|
||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = errorCodes.ERROR;
|
||||
this.searchPage.closeLoading();
|
||||
//this.searchPage.closeLoading();
|
||||
this.disableForms = false;
|
||||
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue