From e083e5f88782063e3a9e7a82b006dcf617c694e1 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Wed, 23 May 2018 13:29:07 +0000 Subject: [PATCH] 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 --- .../simple/searchDataproviders.component.ts | 15 ++++++++++----- .../simple/searchProjects.component.ts | 13 +++++++++---- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/app/searchPages/simple/searchDataproviders.component.ts b/src/app/searchPages/simple/searchDataproviders.component.ts index f97c2e3..3c09685 100644 --- a/src/app/searchPages/simple/searchDataproviders.component.ts +++ b/src/app/searchPages/simple/searchDataproviders.component.ts @@ -23,6 +23,7 @@ import {PiwikHelper} from '../../utils/piwikHelper'; [columnNames]="columnNames" [showResultCount]=false [disableForms]="disableForms" + [enableSearchView]="enableSearchView" searchFormClass="datasourcesTableSearchForm" formPlaceholderText="Search for Content Providers"> @@ -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; } ); } diff --git a/src/app/searchPages/simple/searchProjects.component.ts b/src/app/searchPages/simple/searchProjects.component.ts index ffa114f..cfa8527 100644 --- a/src/app/searchPages/simple/searchProjects.component.ts +++ b/src/app/searchPages/simple/searchProjects.component.ts @@ -23,6 +23,7 @@ import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper'; [columnNames]="columnNames" [showResultCount]=false [disableForms]="disableForms" + [enableSearchView]="enableSearchView" searchFormClass="projectsTableSearchForm" formPlaceholderText="Search for Projects"> @@ -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; } ); }