1. Software tab added in dataprovider landing page.
2. 'softwarerepository', 'aggregator::softwarerepository' and 'orprepository' types added as dataprovider types (for landing page). git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@51972 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
780bd5fa07
commit
82868c0b1d
|
@ -78,6 +78,9 @@
|
|||
<span class="uk-badge uk-badge-notification" *ngIf="tab.content=='datasetsTab'">
|
||||
{{fetchDatasets.searchUtils.totalResults}}
|
||||
</span>
|
||||
<span class="uk-badge uk-badge-notification" *ngIf="tab.content=='softwareTab'">
|
||||
{{fetchSoftware.searchUtils.totalResults}}
|
||||
</span>
|
||||
<span class="uk-badge uk-badge-notification" *ngIf="tab.content=='projectsTab'">
|
||||
{{fetchProjects.searchUtils.totalResults}}
|
||||
</span>
|
||||
|
@ -108,6 +111,9 @@
|
|||
<span class="uk-badge uk-badge-notification" *ngIf="tab.content=='datasetsTab'">
|
||||
{{fetchDatasets.searchUtils.totalResults}}
|
||||
</span>
|
||||
<span class="uk-badge uk-badge-notification" *ngIf="tab.content=='softwareTab'">
|
||||
{{fetchSoftware.searchUtils.totalResults}}
|
||||
</span>
|
||||
<span class="uk-badge uk-badge-notification" *ngIf="tab.content=='projectsTab'">
|
||||
{{fetchProjects.searchUtils.totalResults}}
|
||||
</span>
|
||||
|
@ -136,6 +142,10 @@
|
|||
[paramsForSearchLink]="paramsForSearchLink"
|
||||
[fetchDatasets]="fetchDatasets" [(properties)]=properties>
|
||||
</datasetsTab>
|
||||
<softwareTab *ngIf="activeTab=='Software'"
|
||||
[paramsForSearchLink]="paramsForSearchLink"
|
||||
[fetchSoftware]="fetchSoftware" [(properties)]=properties>
|
||||
</softwareTab>
|
||||
<!--*ngIf=" tab.content=='projectsTab'"-->
|
||||
<projectsTab *ngIf="activeTab=='Projects'"
|
||||
[paramsForSearchLink]="paramsForSearchLink"
|
||||
|
|
|
@ -16,6 +16,8 @@ import {FetchPublications} from '../../utils/fetchEntitiesClass
|
|||
import {SearchPublicationsService} from '../../services/searchPublications.service';
|
||||
import {FetchDatasets} from '../../utils/fetchEntitiesClasses/fetchDatasets.class';
|
||||
import {SearchDatasetsService} from '../../services/searchDatasets.service';
|
||||
import {FetchSoftware} from '../../utils/fetchEntitiesClasses/fetchSoftware.class';
|
||||
import {SearchSoftwareService} from '../../services/searchSoftware.service';
|
||||
import {FetchProjects} from '../../utils/fetchEntitiesClasses/fetchProjects.class';
|
||||
import {SearchProjectsService} from '../../services/searchProjects.service';
|
||||
import {FetchDataproviders} from '../../utils/fetchEntitiesClasses/fetchDataproviders.class';
|
||||
|
@ -63,6 +65,7 @@ export class DataProviderComponent {
|
|||
// Variables for publications, research data, projects, content providers, related content providers tabs
|
||||
public fetchPublications : FetchPublications;
|
||||
public fetchDatasets: FetchDatasets;
|
||||
public fetchSoftware: FetchSoftware;
|
||||
public fetchProjects: FetchProjects;
|
||||
public fetchDataproviders: FetchDataproviders;
|
||||
public fetchAggregatorsPublications: FetchPublications;
|
||||
|
@ -80,6 +83,7 @@ export class DataProviderComponent {
|
|||
// Request results of each tab only the one time (first time tab is clicked)
|
||||
private reloadPublications: boolean = true;
|
||||
private reloadDatasets: boolean = true;
|
||||
private reloadSoftware: boolean = true;
|
||||
private reloadProjects: boolean = true;
|
||||
private reloadDataproviders: boolean = true;
|
||||
private reloadRelatedDatasources: boolean = true;
|
||||
|
@ -101,10 +105,12 @@ export class DataProviderComponent {
|
|||
private _router: Router,
|
||||
private _searchPublicationsService: SearchPublicationsService,
|
||||
private _searchDatasetsService: SearchDatasetsService,
|
||||
private _searchSoftwareService: SearchSoftwareService,
|
||||
private _searchProjectsService: SearchProjectsService,
|
||||
private _searchDataprovidersService: SearchDataprovidersService) {
|
||||
this.fetchPublications = new FetchPublications(this._searchPublicationsService);
|
||||
this.fetchDatasets = new FetchDatasets(this._searchDatasetsService);
|
||||
this.fetchSoftware = new FetchSoftware(this._searchSoftwareService);
|
||||
this.fetchProjects = new FetchProjects(this._searchProjectsService);
|
||||
this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService);
|
||||
|
||||
|
@ -202,6 +208,7 @@ export class DataProviderComponent {
|
|||
if(this.dataProviderInfo.tabs != undefined && this.dataProviderInfo.tabs.length > 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 ||
|
||||
|
|
|
@ -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],
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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: `
|
||||
<!--div *ngIf="fetchDatasets.searchUtils.status == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div>
|
||||
<div *ngIf="fetchDatasets.searchUtils.status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">No research data available</div>
|
||||
<div *ngIf="fetchDatasets.searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
|
||||
<div *ngIf="fetchDatasets.searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service temprorarily unavailable. Please try again later.</div>
|
||||
<div *ngIf="fetchDatasets.searchUtils.status == errorCodes.NOT_FOUND" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">No research data found</div-->
|
||||
<errorMessages [status]="[fetchSoftware.searchUtils.status]" [type]="'software'"></errorMessages>
|
||||
|
||||
<!--div *ngIf="fetchDatasets.searchUtils.totalResults == 0" class = "uk-alert">
|
||||
No research data available
|
||||
</div-->
|
||||
|
||||
<div *ngIf="fetchSoftware.searchUtils.totalResults > 0">
|
||||
<div class = "uk-text-right" *ngIf = "fetchSoftware.searchUtils.totalResults > 10" >
|
||||
<a [queryParams]="paramsForSearchLink"
|
||||
routerLinkActive="router-link-active" [routerLink]="linkToSearchSoftware" class="uk-button uk-button-text">
|
||||
View all {{fetchSoftware.searchUtils.totalResults}} results
|
||||
</a>
|
||||
</div>
|
||||
<tab-result [(results)]="fetchSoftware.results"
|
||||
[(status)]= "fetchSoftware.searchUtils.status"
|
||||
type="software" urlParam="softwareId">
|
||||
</tab-result>
|
||||
</div>
|
||||
`
|
||||
})
|
||||
|
||||
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() {}
|
||||
}
|
|
@ -25,7 +25,8 @@ export class DataProviderInfo {
|
|||
|
||||
"aggregator::datarepository",
|
||||
"crissystem",
|
||||
"datarepository::unknown"
|
||||
"datarepository::unknown",
|
||||
"orprepository"
|
||||
]),
|
||||
"datasetsTab": new Set<string>(
|
||||
[ "aggregator::pubsrepository::institutional",
|
||||
|
@ -42,7 +43,8 @@ export class DataProviderInfo {
|
|||
|
||||
"aggregator::datarepository",
|
||||
"crissystem",
|
||||
"datarepository::unknown"
|
||||
"datarepository::unknown",
|
||||
"orprepository"
|
||||
]),
|
||||
"statisticsTab": new Set<string>(
|
||||
[ "aggregator::datarepository",
|
||||
|
@ -56,6 +58,7 @@ export class DataProviderInfo {
|
|||
"pubsrepository::unknown",
|
||||
"pubsrepository::thematic",
|
||||
"pubscatalogue::unknown",
|
||||
"orprepository"
|
||||
]),
|
||||
// "organizationsTab": new Set<string>(
|
||||
// [ "entityregistry::projects",
|
||||
|
@ -68,7 +71,41 @@ export class DataProviderInfo {
|
|||
"aggregator::pubsrepository::journals",
|
||||
"aggregator::pubsrepository::institutional",
|
||||
"aggregator::datarepository"
|
||||
]),
|
||||
"softwareTab": new Set<string>(
|
||||
[
|
||||
"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<string>(
|
||||
[
|
||||
"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<string>(
|
||||
[ "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<string>(
|
||||
[ "crissystem",
|
||||
|
@ -109,7 +148,9 @@ export class DataProviderInfo {
|
|||
"pubsrepository::institutional",
|
||||
"pubsrepository::journal",
|
||||
"pubsrepository::unknown",
|
||||
"pubsrepository::thematic"
|
||||
"pubsrepository::thematic",
|
||||
"softwarerepository",
|
||||
"orprepository"
|
||||
])
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue