Removed modal for loading in Pages for Data providers - Entity Registries 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@47341 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2017-05-24 10:17:41 +00:00
parent d3245a1a3c
commit 3e74bc8d16
2 changed files with 22 additions and 8 deletions

View File

@ -21,7 +21,8 @@ import {ExportCSVComponent} from '../../utils/exportCSV.class';
[baseUrl] = "baseUrl" [showResultCount]=false [baseUrl] = "baseUrl" [showResultCount]=false
(queryChange)="queryChanged($event)" (queryChange)="queryChanged($event)"
(downloadClick)="downloadClicked($event)" (downloadClick)="downloadClicked($event)"
[csvParams]="csvParams" csvPath="resources"> [csvParams]="csvParams" csvPath="resources"
[disableForms]="disableForms">
</search-page> </search-page>
<!--table-view [(datasources)] = results></table-view--> <!--table-view [(datasources)] = results></table-view-->
@ -48,6 +49,7 @@ export class SearchCompatibleDataprovidersComponent {
public CSVDownloaded = false; public CSVDownloaded = false;
public resourcesQuery = "&query=((oaftype exact datasource) not(datasourcecompatibilityid = UNKNOWN) not(datasourcecompatibilityid = hostedBy) not(datasourcecompatibilityid = notCompatible) not(datasourcetypeuiid = other))"; public resourcesQuery = "&query=((oaftype exact datasource) not(datasourcecompatibilityid = UNKNOWN) not(datasourcecompatibilityid = hostedBy) not(datasourcecompatibilityid = notCompatible) not(datasourcetypeuiid = other))";
public csvParams: string; public csvParams: string;
public disableForms: boolean = false;
@ViewChild (SearchPageComponent) searchPage : SearchPageComponent ; @ViewChild (SearchPageComponent) searchPage : SearchPageComponent ;
@ -89,7 +91,10 @@ export class SearchCompatibleDataprovidersComponent {
var errorCodes:ErrorCodes = new ErrorCodes(); var errorCodes:ErrorCodes = new ErrorCodes();
this.searchUtils.status = errorCodes.LOADING; this.searchUtils.status = errorCodes.LOADING;
this.searchPage.openLoading(); //this.searchPage.openLoading();
this.disableForms = true;
this.results = [];
this.searchUtils.totalResults = 0;
this.subResults = this._searchDataprovidersService.searchCompatibleDataproviders(parameters,(refine)?this.searchPage.getRefineFieldsQuery():null, page, size, []).subscribe( this.subResults = this._searchDataprovidersService.searchCompatibleDataproviders(parameters,(refine)?this.searchPage.getRefineFieldsQuery():null, page, size, []).subscribe(
data => { data => {
@ -103,7 +108,8 @@ export class SearchCompatibleDataprovidersComponent {
if(this.searchUtils.totalResults == 0 ){ if(this.searchUtils.totalResults == 0 ){
this.searchUtils.status = errorCodes.NONE; this.searchUtils.status = errorCodes.NONE;
} }
this.searchPage.closeLoading(); //this.searchPage.closeLoading();
this.disableForms = false;
}, },
err => { err => {
@ -114,7 +120,8 @@ export class SearchCompatibleDataprovidersComponent {
// } // }
var errorCodes:ErrorCodes = new ErrorCodes(); var errorCodes:ErrorCodes = new ErrorCodes();
this.searchUtils.status = errorCodes.ERROR; this.searchUtils.status = errorCodes.ERROR;
this.searchPage.closeLoading(); //this.searchPage.closeLoading();
this.disableForms = false;
} }
); );

View File

@ -21,7 +21,8 @@ import {ExportCSVComponent} from '../../utils/exportCSV.class';
[baseUrl] = "baseUrl" [showResultCount]=false [baseUrl] = "baseUrl" [showResultCount]=false
(queryChange)="queryChanged($event)" (queryChange)="queryChanged($event)"
(downloadClick)="downloadClicked($event)" (downloadClick)="downloadClicked($event)"
[csvParams]="csvParams" csvPath="resources"> [csvParams]="csvParams" csvPath="resources"
[disableForms]="disableForms">
</search-page> </search-page>
` `
@ -46,6 +47,7 @@ export class SearchEntityRegistriesComponent {
"export":[] "export":[]
}; };
public CSVDownloaded = false; public CSVDownloaded = false;
public disableForms: boolean = false;
@ViewChild (SearchPageComponent) searchPage : SearchPageComponent ; @ViewChild (SearchPageComponent) searchPage : SearchPageComponent ;
public resourcesQuery = "&query=((oaftype exact datasource) and(datasourcetypeuiid = other))"; public resourcesQuery = "&query=((oaftype exact datasource) and(datasourcetypeuiid = other))";
@ -90,7 +92,10 @@ export class SearchEntityRegistriesComponent {
var errorCodes:ErrorCodes = new ErrorCodes(); var errorCodes:ErrorCodes = new ErrorCodes();
this.searchUtils.status = errorCodes.LOADING; this.searchUtils.status = errorCodes.LOADING;
this.searchPage.openLoading(); //this.searchPage.openLoading();
this.disableForms = true;
this.results = [];
this.searchUtils.totalResults = 0;
this.subResults = this._searchDataprovidersService.searchEntityRegistries(parameters,(refine)?this.searchPage.getRefineFieldsQuery():null, page, size, []).subscribe( this.subResults = this._searchDataprovidersService.searchEntityRegistries(parameters,(refine)?this.searchPage.getRefineFieldsQuery():null, page, size, []).subscribe(
data => { data => {
@ -104,7 +109,8 @@ export class SearchEntityRegistriesComponent {
if(this.searchUtils.totalResults == 0 ){ if(this.searchUtils.totalResults == 0 ){
this.searchUtils.status = errorCodes.NONE; this.searchUtils.status = errorCodes.NONE;
} }
this.searchPage.closeLoading(); //this.searchPage.closeLoading();
this.disableForms = false;
}, },
err => { err => {
@ -115,7 +121,8 @@ export class SearchEntityRegistriesComponent {
// } // }
var errorCodes:ErrorCodes = new ErrorCodes(); var errorCodes:ErrorCodes = new ErrorCodes();
this.searchUtils.status = errorCodes.ERROR; this.searchUtils.status = errorCodes.ERROR;
this.searchPage.closeLoading(); //this.searchPage.closeLoading();
this.disableForms = false;
} }
); );