1. 'enableSearchView' input parameter added in searchPageTableView.component in library's update.
(When status is not DONE, all forms and search view are disabled. When status is not LOADING or DONE, hide datatable and disable all forms but allow search view) git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@52167 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
0bb10f8261
commit
e083e5f887
|
@ -23,6 +23,7 @@ import {PiwikHelper} from '../../utils/piwikHelper';
|
|||
[columnNames]="columnNames"
|
||||
[showResultCount]=false
|
||||
[disableForms]="disableForms"
|
||||
[enableSearchView]="enableSearchView"
|
||||
searchFormClass="datasourcesTableSearchForm"
|
||||
formPlaceholderText="Search for Content Providers">
|
||||
</search-page-table>
|
||||
|
@ -43,12 +44,13 @@ export class OpenaireSearchDataprovidersComponent {
|
|||
properties:EnvProperties;
|
||||
|
||||
public disableForms: boolean = false;
|
||||
public enableSearchView: boolean = true;
|
||||
|
||||
private communityId: string = '';
|
||||
|
||||
@ViewChild (SearchPageTableViewComponent) searchPage : SearchPageTableViewComponent ;
|
||||
piwikSiteId = null;
|
||||
|
||||
|
||||
constructor (private route: ActivatedRoute, private _searchDataprovidersService: SearchCommunityDataprovidersService) {
|
||||
this.errorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
|
@ -87,6 +89,7 @@ export class OpenaireSearchDataprovidersComponent {
|
|||
private _getResults(params){
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
this.disableForms = true;
|
||||
this.enableSearchView = false;
|
||||
this.results = [];
|
||||
this.searchUtils.totalResults = 0;
|
||||
|
||||
|
@ -106,10 +109,12 @@ export class OpenaireSearchDataprovidersComponent {
|
|||
this.searchUtils.status = this.errorCodes.DONE;
|
||||
if(this.searchUtils.totalResults == 0 ){
|
||||
this.searchUtils.status = this.errorCodes.NONE;
|
||||
} else {
|
||||
this.searchPage.triggerInitialLoad();
|
||||
this.searchPage.transform(this.results);
|
||||
this.disableForms = false;
|
||||
}
|
||||
this.disableForms = false;
|
||||
this.searchPage.triggerInitialLoad();
|
||||
this.searchPage.transform(this.results);
|
||||
this.enableSearchView = true;
|
||||
},
|
||||
err => {
|
||||
console.log(err);
|
||||
|
@ -123,7 +128,7 @@ export class OpenaireSearchDataprovidersComponent {
|
|||
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||
}
|
||||
|
||||
this.disableForms = false;
|
||||
this.enableSearchView = true;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
|
|||
[columnNames]="columnNames"
|
||||
[showResultCount]=false
|
||||
[disableForms]="disableForms"
|
||||
[enableSearchView]="enableSearchView"
|
||||
searchFormClass="projectsTableSearchForm"
|
||||
formPlaceholderText="Search for Projects">
|
||||
</search-page-table>
|
||||
|
@ -43,6 +44,7 @@ export class OpenaireSearchProjectsComponent {
|
|||
properties:EnvProperties;
|
||||
|
||||
public disableForms: boolean = false;
|
||||
public enableSearchView: boolean = true;
|
||||
|
||||
private communityId: string = '';
|
||||
|
||||
|
@ -87,6 +89,7 @@ export class OpenaireSearchProjectsComponent {
|
|||
private _getResults(params){
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
this.disableForms = true;
|
||||
this.enableSearchView = false;
|
||||
this.results = [];
|
||||
this.searchUtils.totalResults = 0;
|
||||
|
||||
|
@ -107,10 +110,12 @@ export class OpenaireSearchProjectsComponent {
|
|||
this.searchUtils.status = this.errorCodes.DONE;
|
||||
if(this.searchUtils.totalResults == 0 ){
|
||||
this.searchUtils.status = this.errorCodes.NONE;
|
||||
} else {
|
||||
this.searchPage.triggerInitialLoad();
|
||||
this.searchPage.transform(this.results);
|
||||
this.disableForms = false;
|
||||
}
|
||||
this.disableForms = false;
|
||||
this.searchPage.triggerInitialLoad();
|
||||
this.searchPage.transform(this.results);
|
||||
this.enableSearchView = true;
|
||||
},
|
||||
err => {
|
||||
console.log(err);
|
||||
|
@ -124,7 +129,7 @@ export class OpenaireSearchProjectsComponent {
|
|||
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||
}
|
||||
|
||||
this.disableForms = false;
|
||||
this.enableSearchView = true;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue