[Trunk | Explore]: home.component: Bug fix (after merging research results): Use one common service for research results (SearchResearchResultsService).
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@57035 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
00ebb40083
commit
16b5a1c0fd
|
@ -5,11 +5,9 @@ import {Location} from '@angular/common';
|
|||
import "rxjs/add/observable/zip";
|
||||
import {Title, Meta} from '@angular/platform-browser';
|
||||
import {ConfigurationService} from '../openaireLibrary/utils/configuration/configuration.service';
|
||||
import { SearchPublicationsService} from '../openaireLibrary/services/searchPublications.service';
|
||||
import { FetchDataproviders} from '../openaireLibrary/utils/fetchEntitiesClasses/fetchDataproviders.class';
|
||||
import { SearchDataprovidersService} from '../openaireLibrary/services/searchDataproviders.service';
|
||||
import { SearchProjectsService} from '../openaireLibrary/services/searchProjects.service';
|
||||
import { SearchDatasetsService} from '../openaireLibrary/services/searchDatasets.service';
|
||||
import { SearchOrganizationsService} from '../openaireLibrary/services/searchOrganizations.service';
|
||||
import { RefineFieldResultsService} from '../openaireLibrary/services/refineFieldResults.service';
|
||||
import { SearchFields} from '../openaireLibrary/utils/properties/searchFields';
|
||||
|
@ -20,8 +18,7 @@ import { EnvProperties} from '../openaireLibrary/utils/properties/env-properties
|
|||
import { ErrorCodes} from '../openaireLibrary/utils/properties/errorCodes';
|
||||
import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service';
|
||||
import { SEOService } from '../openaireLibrary/sharedComponents/SEO/SEO.service';
|
||||
import {SearchSoftwareService} from "../openaireLibrary/services/searchSoftware.service";
|
||||
import {SearchOrpsService} from "../openaireLibrary/services/searchOrps.service";
|
||||
import {SearchResearchResultsService} from "../openaireLibrary/services/searchResearchResults.service";
|
||||
|
||||
@Component({
|
||||
selector: 'home',
|
||||
|
@ -62,12 +59,9 @@ public subPub;public subData;public subProjects;public subOrg; public subDataPr;
|
|||
constructor (
|
||||
private route: ActivatedRoute,
|
||||
private _router: Router,
|
||||
private _searchPublicationsService: SearchPublicationsService,
|
||||
private _searchSoftwareService: SearchSoftwareService,
|
||||
private _searchOrpsService: SearchOrpsService,
|
||||
private _searchResearchResultsService: SearchResearchResultsService,
|
||||
private _searchDataprovidersService: SearchDataprovidersService,
|
||||
private _searchProjectsService: SearchProjectsService,
|
||||
private _searchDatasetsService: SearchDatasetsService,
|
||||
private _searchOrganizationsService: SearchOrganizationsService,
|
||||
private _refineFieldResultsService:RefineFieldResultsService,
|
||||
private location: Location, private _piwikService:PiwikService,
|
||||
|
@ -151,7 +145,7 @@ public subPub;public subData;public subProjects;public subOrg; public subDataPr;
|
|||
|
||||
private getNumbers() {
|
||||
if(this.showPublications){
|
||||
this.subPub = this._searchPublicationsService.numOfSearchPublications("", this.properties).subscribe(
|
||||
this.subPub = this._searchResearchResultsService.numOfSearchResults("publication", "", this.properties).subscribe(
|
||||
data => {
|
||||
if(data && data != null && data > 0 ){
|
||||
this.publicationsSize = NumberUtils.roundNumber(data);
|
||||
|
@ -165,7 +159,7 @@ public subPub;public subData;public subProjects;public subOrg; public subDataPr;
|
|||
);
|
||||
}
|
||||
if(this.showDatasets){
|
||||
this.subData = this._searchDatasetsService.numOfSearchDatasets("", this.properties).subscribe(
|
||||
this.subData = this._searchResearchResultsService.numOfSearchResults("dataset", "", this.properties).subscribe(
|
||||
data => {
|
||||
if(data && data != null && data > 0 ){
|
||||
this.datasetsSize = NumberUtils.roundNumber(data);
|
||||
|
@ -178,7 +172,7 @@ public subPub;public subData;public subProjects;public subOrg; public subDataPr;
|
|||
);
|
||||
}
|
||||
if (this.showSoftware) {
|
||||
this.subSoft = this._searchSoftwareService.numOfSearchSoftware("", this.properties).subscribe(
|
||||
this.subSoft = this._searchResearchResultsService.numOfSearchResults("software", "", this.properties).subscribe(
|
||||
data => {
|
||||
if (data && data > 0) {
|
||||
this.softwareSize = NumberUtils.roundNumber(data);
|
||||
|
@ -192,7 +186,7 @@ public subPub;public subData;public subProjects;public subOrg; public subDataPr;
|
|||
);
|
||||
}
|
||||
if (this.showOrp) {
|
||||
this.subOrp = this._searchOrpsService.numOfSearchOrps("", this.properties).subscribe(
|
||||
this.subOrp = this._searchResearchResultsService.numOfSearchResults("other", "", this.properties).subscribe(
|
||||
data => {
|
||||
if (data && data > 0) {
|
||||
this.otherSize = NumberUtils.roundNumber(data);
|
||||
|
|
|
@ -3,16 +3,15 @@ import { CommonModule } from '@angular/common';
|
|||
import { FormsModule } from '@angular/forms';
|
||||
import { RouterModule } from '@angular/router';
|
||||
|
||||
import{HomeRoutingModule} from './home-routing.module';
|
||||
import{HomeComponent} from './home.component';
|
||||
import {HomeRoutingModule} from './home-routing.module';
|
||||
import {HomeComponent} from './home.component';
|
||||
|
||||
import { DataProvidersServiceModule} from '../openaireLibrary/services/dataProvidersService.module';
|
||||
import { DatasetsServiceModule} from '../openaireLibrary/services/datasetsService.module';
|
||||
import { SearchResearchResultsServiceModule} from '../openaireLibrary/services/searchResearchResultsService.module';
|
||||
import { ProjectsServiceModule} from '../openaireLibrary/services/projectsService.module';
|
||||
import { PublicationsServiceModule} from '../openaireLibrary/services/publicationsService.module';
|
||||
import { OrganizationsServiceModule} from '../openaireLibrary/services/organizationsService.module';
|
||||
import { SearchFormModule} from '../openaireLibrary/searchPages/searchUtils/searchForm.module';
|
||||
import {PiwikServiceModule} from '../openaireLibrary/utils/piwik/piwikService.module';
|
||||
import { PiwikServiceModule} from '../openaireLibrary/utils/piwik/piwikService.module';
|
||||
|
||||
import {HelperModule} from '../openaireLibrary/utils/helper/helper.module';
|
||||
|
||||
|
@ -24,17 +23,14 @@ import {Schema2jsonldModule} from '../openaireLibrary/sharedComponents/schema2js
|
|||
import { SEOServiceModule } from '../openaireLibrary/sharedComponents/SEO/SEOService.module';
|
||||
|
||||
import {ErrorMessagesModule} from '../openaireLibrary/utils/errorMessages.module';
|
||||
import {OrpsServiceModule} from "../openaireLibrary/services/orpsService.module";
|
||||
import {SoftwareServiceModule} from "../openaireLibrary/services/softwareService.module";
|
||||
import {OtherPortalsModule} from "../openaireLibrary/sharedComponents/other-portals/other-portals.module";
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule, FormsModule, RouterModule,
|
||||
RefineFieldResultsServiceModule,
|
||||
DataProvidersServiceModule, DatasetsServiceModule, ProjectsServiceModule,
|
||||
PublicationsServiceModule, SoftwareServiceModule, OrpsServiceModule,
|
||||
OrganizationsServiceModule,
|
||||
DataProvidersServiceModule, SearchResearchResultsServiceModule,
|
||||
ProjectsServiceModule, OrganizationsServiceModule,
|
||||
SearchFormModule,
|
||||
PiwikServiceModule,
|
||||
HomeRoutingModule,
|
||||
|
|
Loading…
Reference in New Issue