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"
|
[columnNames]="columnNames"
|
||||||
[showResultCount]=false
|
[showResultCount]=false
|
||||||
[disableForms]="disableForms"
|
[disableForms]="disableForms"
|
||||||
|
[enableSearchView]="enableSearchView"
|
||||||
searchFormClass="datasourcesTableSearchForm"
|
searchFormClass="datasourcesTableSearchForm"
|
||||||
formPlaceholderText="Search for Content Providers">
|
formPlaceholderText="Search for Content Providers">
|
||||||
</search-page-table>
|
</search-page-table>
|
||||||
|
@ -43,6 +44,7 @@ export class OpenaireSearchDataprovidersComponent {
|
||||||
properties:EnvProperties;
|
properties:EnvProperties;
|
||||||
|
|
||||||
public disableForms: boolean = false;
|
public disableForms: boolean = false;
|
||||||
|
public enableSearchView: boolean = true;
|
||||||
|
|
||||||
private communityId: string = '';
|
private communityId: string = '';
|
||||||
|
|
||||||
|
@ -87,6 +89,7 @@ export class OpenaireSearchDataprovidersComponent {
|
||||||
private _getResults(params){
|
private _getResults(params){
|
||||||
this.searchUtils.status = this.errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
this.disableForms = true;
|
this.disableForms = true;
|
||||||
|
this.enableSearchView = false;
|
||||||
this.results = [];
|
this.results = [];
|
||||||
this.searchUtils.totalResults = 0;
|
this.searchUtils.totalResults = 0;
|
||||||
|
|
||||||
|
@ -106,10 +109,12 @@ export class OpenaireSearchDataprovidersComponent {
|
||||||
this.searchUtils.status = this.errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = this.errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
|
} else {
|
||||||
|
this.searchPage.triggerInitialLoad();
|
||||||
|
this.searchPage.transform(this.results);
|
||||||
|
this.disableForms = false;
|
||||||
}
|
}
|
||||||
this.disableForms = false;
|
this.enableSearchView = true;
|
||||||
this.searchPage.triggerInitialLoad();
|
|
||||||
this.searchPage.transform(this.results);
|
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
|
@ -123,7 +128,7 @@ export class OpenaireSearchDataprovidersComponent {
|
||||||
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
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"
|
[columnNames]="columnNames"
|
||||||
[showResultCount]=false
|
[showResultCount]=false
|
||||||
[disableForms]="disableForms"
|
[disableForms]="disableForms"
|
||||||
|
[enableSearchView]="enableSearchView"
|
||||||
searchFormClass="projectsTableSearchForm"
|
searchFormClass="projectsTableSearchForm"
|
||||||
formPlaceholderText="Search for Projects">
|
formPlaceholderText="Search for Projects">
|
||||||
</search-page-table>
|
</search-page-table>
|
||||||
|
@ -43,6 +44,7 @@ export class OpenaireSearchProjectsComponent {
|
||||||
properties:EnvProperties;
|
properties:EnvProperties;
|
||||||
|
|
||||||
public disableForms: boolean = false;
|
public disableForms: boolean = false;
|
||||||
|
public enableSearchView: boolean = true;
|
||||||
|
|
||||||
private communityId: string = '';
|
private communityId: string = '';
|
||||||
|
|
||||||
|
@ -87,6 +89,7 @@ export class OpenaireSearchProjectsComponent {
|
||||||
private _getResults(params){
|
private _getResults(params){
|
||||||
this.searchUtils.status = this.errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
this.disableForms = true;
|
this.disableForms = true;
|
||||||
|
this.enableSearchView = false;
|
||||||
this.results = [];
|
this.results = [];
|
||||||
this.searchUtils.totalResults = 0;
|
this.searchUtils.totalResults = 0;
|
||||||
|
|
||||||
|
@ -107,10 +110,12 @@ export class OpenaireSearchProjectsComponent {
|
||||||
this.searchUtils.status = this.errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = this.errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
|
} else {
|
||||||
|
this.searchPage.triggerInitialLoad();
|
||||||
|
this.searchPage.transform(this.results);
|
||||||
|
this.disableForms = false;
|
||||||
}
|
}
|
||||||
this.disableForms = false;
|
this.enableSearchView = true;
|
||||||
this.searchPage.triggerInitialLoad();
|
|
||||||
this.searchPage.transform(this.results);
|
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
|
@ -124,7 +129,7 @@ export class OpenaireSearchProjectsComponent {
|
||||||
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.disableForms = false;
|
this.enableSearchView = true;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue