diff --git a/landingPages/dataProvider/dataProvider.component.html b/landingPages/dataProvider/dataProvider.component.html index b02652d8..65243f2b 100644 --- a/landingPages/dataProvider/dataProvider.component.html +++ b/landingPages/dataProvider/dataProvider.component.html @@ -78,6 +78,9 @@ {{fetchDatasets.searchUtils.totalResults}} + + {{fetchSoftware.searchUtils.totalResults}} + {{fetchProjects.searchUtils.totalResults}} @@ -108,6 +111,9 @@ {{fetchDatasets.searchUtils.totalResults}} + + {{fetchSoftware.searchUtils.totalResults}} + {{fetchProjects.searchUtils.totalResults}} @@ -136,6 +142,10 @@ [paramsForSearchLink]="paramsForSearchLink" [fetchDatasets]="fetchDatasets" [(properties)]=properties> + + 0) { this.reloadPublications = true; this.reloadDatasets = true; + this.reloadSoftware = true; this.reloadProjects = true; this.reloadDataproviders = true; this.reloadRelatedDatasources = true; @@ -256,7 +263,9 @@ export class DataProviderComponent { this.countPublications(page, size); } else if(content=='datasetsTab') { this.countDatasets(page, size); - } else if(content=='projectsTab') { + } else if(content=='softwareTab') { + this.countSoftware(page, size); + } else if(content=='projectsTab') { this.countProjects(page, size); } else if(content=='datasourcesTab') { this.countDatasources(page, size); @@ -271,7 +280,9 @@ export class DataProviderComponent { this.searchPublications(page, size); } else if(content=='datasetsTab') { this.searchDatasets(page, size); - } else if(content=='projectsTab') { + } else if(content=='softwareTab') { + this.searchSoftware(page, size); + } else if(content=='projectsTab') { this.searchProjects(page, size); } else if(content=='datasourcesTab') { this.searchDatasources(page, size); @@ -310,6 +321,19 @@ export class DataProviderComponent { this.fetchDatasets.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties); } + private searchSoftware(page: number, size: number) { + if( this.reloadSoftware && + ( this.fetchSoftware.searchUtils.status == this.errorCodes.LOADING || + this.fetchSoftware.searchUtils.status == this.errorCodes.DONE ) ) { + this.fetchSoftware.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties); + } + this.reloadSoftware = false; + } + + private countSoftware(page: number, size: number) { + this.fetchSoftware.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties); + } + private searchProjects(page: number, size: number) { if( this.reloadProjects && ( this.fetchProjects.searchUtils.status == this.errorCodes.LOADING || diff --git a/landingPages/dataProvider/dataProvider.module.ts b/landingPages/dataProvider/dataProvider.module.ts index 61f42205..6c817d91 100644 --- a/landingPages/dataProvider/dataProvider.module.ts +++ b/landingPages/dataProvider/dataProvider.module.ts @@ -13,6 +13,7 @@ import {PagingModule} from '../../utils/paging.module'; import {PublicationsTabComponent} from './publicationsTab.component'; import {DatasetsTabComponent} from './datasetsTab.component'; +import {SoftwareTabComponent} from './softwareTab.component'; import {StatisticsTabComponent} from './statisticsTab.component'; import {ProjectsTabComponent} from './projectsTab.component'; import {DatasourcesTabComponent} from './datasourcesTab.component'; @@ -26,6 +27,7 @@ import {DataProvidersServiceModule} from '../../services/dataProvidersService.mo import {DatasetsServiceModule} from '../../services/datasetsService.module'; import {ProjectsServiceModule} from '../../services/projectsService.module'; import {PublicationsServiceModule} from '../../services/publicationsService.module'; +import {SoftwareServiceModule} from '../../services/softwareService.module'; // import { DataProviderRoutingModule } from './dataProvider-routing.module'; import {FreeGuard} from'../../login/freeGuard.guard'; @@ -36,10 +38,10 @@ import {IsRouteEnabled} from '../../error/isRouteEnabled.guard'; [CommonModule, FormsModule, RouterModule, TabResultModule, IFrameModule, ErrorMessagesModule, MetricsModule, LandingModule, DataProvidersServiceModule, DatasetsServiceModule, ProjectsServiceModule, PublicationsServiceModule, - PagingModule], + SoftwareServiceModule, PagingModule], declarations: [PublicationsTabComponent, DatasetsTabComponent, StatisticsTabComponent, ProjectsTabComponent, DatasourcesTabComponent, OrganizationsTabComponent, - RelatedDatasourcesTabComponent, DataProviderComponent + RelatedDatasourcesTabComponent, DataProviderComponent, SoftwareTabComponent ], providers:[ DataProviderService, FreeGuard, IsRouteEnabled], diff --git a/landingPages/dataProvider/dataProvider.service.ts b/landingPages/dataProvider/dataProvider.service.ts index dafb74b0..9f9146fe 100644 --- a/landingPages/dataProvider/dataProvider.service.ts +++ b/landingPages/dataProvider/dataProvider.service.ts @@ -94,6 +94,14 @@ export class DataProviderService { this.dataProviderInfo.tabs.push({"name": "Statistics", "content": "statisticsTab"}); } + if(this.dataProviderInfo.tabsInTypes.softwareTab.has(data[1].classid)) { + this.dataProviderInfo.tabs.push({"name": "Software", "content": "softwareTab"}); + } + + /*if(this.dataProviderInfo.tabsInTypes.otherTab.has(data[1].classid)) { + this.dataProviderInfo.tabs.push({"name": "Other", "content": "otherTab"}); + }*/ + this.dataProviderInfo.tabs.push({"name": "Metrics", "content": "metricsTab"}); if(this.dataProviderInfo.resultTypes.collectedFrom.has(data[1].classid)) { diff --git a/landingPages/dataProvider/softwareTab.component.ts b/landingPages/dataProvider/softwareTab.component.ts new file mode 100644 index 00000000..bc0bfa4a --- /dev/null +++ b/landingPages/dataProvider/softwareTab.component.ts @@ -0,0 +1,50 @@ +import {Component, Input} from '@angular/core'; +import { FetchSoftware } from '../../utils/fetchEntitiesClasses/fetchSoftware.class'; + +import {ErrorCodes} from '../../utils/properties/errorCodes'; +import{EnvProperties} from '../../utils/properties/env-properties'; + +@Component({ + selector: 'softwareTab', + template: ` + + + + + +
+ + + +
+ ` +}) + +export class SoftwareTabComponent { + @Input() paramsForSearchLink = {}; + @Input() fetchSoftware : FetchSoftware; + @Input() properties:EnvProperties ; + public linkToSearchSoftware = ""; + public errorCodes:ErrorCodes = new ErrorCodes(); + + constructor () {} + + ngOnInit() { + this.linkToSearchSoftware = this.properties.searchLinkToAdvancedSoftware; + } + + ngOnDestroy() {} +} diff --git a/utils/entities/dataProviderInfo.ts b/utils/entities/dataProviderInfo.ts index 6d6eb174..6cbb4f96 100644 --- a/utils/entities/dataProviderInfo.ts +++ b/utils/entities/dataProviderInfo.ts @@ -25,7 +25,8 @@ export class DataProviderInfo { "aggregator::datarepository", "crissystem", - "datarepository::unknown" + "datarepository::unknown", + "orprepository" ]), "datasetsTab": new Set( [ "aggregator::pubsrepository::institutional", @@ -42,7 +43,8 @@ export class DataProviderInfo { "aggregator::datarepository", "crissystem", - "datarepository::unknown" + "datarepository::unknown", + "orprepository" ]), "statisticsTab": new Set( [ "aggregator::datarepository", @@ -56,6 +58,7 @@ export class DataProviderInfo { "pubsrepository::unknown", "pubsrepository::thematic", "pubscatalogue::unknown", + "orprepository" ]), // "organizationsTab": new Set( // [ "entityregistry::projects", @@ -68,7 +71,41 @@ export class DataProviderInfo { "aggregator::pubsrepository::journals", "aggregator::pubsrepository::institutional", "aggregator::datarepository" + ]), + "softwareTab": new Set( + [ + "aggregator::datarepository", + "aggregator::pubsrepository::institutional", + "aggregator::pubsrepository::unknown", + "aggregator::pubsrepository::journals", + "infospace", + "pubsrepository::institutional", + "pubsrepository::journal", + "pubsrepository::unknown", + "scholarcomminfra", + "pubsrepository::thematic", + "softwarerepository", + "aggregator::softwarerepository", + "orprepository" ])/*, + "otherTab": new Set( + [ + "aggregator::datarepository", + "aggregator::pubsrepository::institutional", + "aggregator::pubsrepository::unknown", + "aggregator::pubsrepository::journals", + "infospace", + "pubsrepository::institutional", + "pubsrepository::journal", + "pubsrepository::unknown", + "scholarcomminfra", + "pubsrepository::thematic", + "softwarerepository", + "aggregator::softwarerepository", + "orprepository" + ])*/ + /* + , "metricsTab": new Set( [ "aggregator::datarepository", "aggregator::pubsrepository::institutional", @@ -87,7 +124,8 @@ export class DataProviderInfo { "entityregistry", "entityregistry::projects", "entityregistry::repositories" - ])*/ + ]) + */ }; resultsBy: string; @@ -101,7 +139,8 @@ export class DataProviderInfo { "entityregistry::repositories", "infospace", "scholarcomminfra", - "pubscatalogue::unknown" + "pubscatalogue::unknown", + "aggregator::softwarerepository" ]), "hostedBy": new Set( [ "crissystem", @@ -109,7 +148,9 @@ export class DataProviderInfo { "pubsrepository::institutional", "pubsrepository::journal", "pubsrepository::unknown", - "pubsrepository::thematic" + "pubsrepository::thematic", + "softwarerepository", + "orprepository" ]) };