1. Organization Landing page: Added COMMENTED (currently not used) code for 'Research Data' tab.

2. searchDatasets.service, fetchDatasets.class: Added cases for getting dataset results/count for organization entity (currently not used - possible usage from organization landing page).


git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@52871 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2018-08-02 10:02:31 +00:00
parent deffcceed8
commit a211cc0713
5 changed files with 54 additions and 3 deletions

View File

@ -41,6 +41,31 @@
</div>
</li>
<!-- <li (click)="activeTab='Research Data'; searchDatasetsInit()">
<a class="uk-accordion-title" href="#">
Research Data
<span class="uk-badge uk-badge-notification">
{{fetchDatasets.searchUtils.totalResults | number}}
</span>
</a>
<div class="uk-accordion-content">
<errorMessages [status]="[fetchDatasets.searchUtils.status]" [type]="'publications'" tab_error_class=true></errorMessages>
<div *ngIf="fetchDatasets.searchUtils.status == errorCodes.DONE">
<div class = "uk-text-right" *ngIf = "fetchDatasets.searchUtils.totalResults > 10">
<a [queryParams]="routerHelper.createQueryParams(['organization', 'og'], [organizationId, 'and'])"
routerLinkActive="router-link-active" [routerLink]="linkToSearchDatasets" class="uk-button uk-button-text">
View all {{fetchDatasets.searchUtils.totalResults | number}} results
</a>
</div>
<tab-result [(results)]="fetchDatasets.results"
[(status)]= "fetchDatasets.status"
type="dataset" urlParam="datasetId">
</tab-result>
</div>
</div>
</li> -->
<li (click)="activeTab='Projects'; projectsClicked=true;">
<a class="uk-accordion-title" href="#">
Projects

View File

@ -10,9 +10,11 @@ import {OrganizationService} from '../../services/organization.servic
import {OrganizationInfo} from '../../utils/entities/organizationInfo';
import {ReportsService} from '../../services/reports.service';
import {FetchPublications} from '../../utils/fetchEntitiesClasses/fetchPublications.class';
// import {FetchDatasets} from '../../utils/fetchEntitiesClasses/fetchDatasets.class';
import {FetchProjects} from '../../utils/fetchEntitiesClasses/fetchProjects.class';
import {FetchDataproviders} from '../../utils/fetchEntitiesClasses/fetchDataproviders.class';
import {SearchPublicationsService} from '../../services/searchPublications.service';
// import {SearchDatasetsService} from '../../services/searchDatasets.service';
import {SearchDataprovidersService} from '../../services/searchDataproviders.service';
import {SearchProjectsService} from '../../services/searchProjects.service';
import {ErrorCodes} from '../../utils/properties/errorCodes';
@ -49,9 +51,11 @@ export class OrganizationComponent {
// Active tab variable for responsiveness
public activeTab: string = "Publications";
// Variables for publications, projects, dataproviders tabs
// Variables for publications, research data, projects, dataproviders tabs
public fetchPublications: FetchPublications;
public linkToSearchPublications: string = "";
// public fetchDatasets: FetchDatasets;
// public linkToSearchDatasets: string = "";
public fetchProjects: FetchProjects;
public fetchDataproviders : FetchDataproviders;
public linkToSearchDataproviders:string = "";
@ -74,8 +78,9 @@ export class OrganizationComponent {
//private fundersSet: Set<string>;
//private emptyFundersSet: boolean = true;
// Request results for publications and content providers only the one time (first time tab is clicked)
// Request results for publications, research data and content providers only the one time (first time tab is clicked)
private reloadPublications: boolean = true;
// private reloadDatasets: boolean = true;
private reloadDataproviders: boolean = true;
// Helper variables to specify funder in downloadPublicationsFile function
@ -100,12 +105,14 @@ export class OrganizationComponent {
private _searchDataprovidersService: SearchDataprovidersService,
private _reportsService: ReportsService,
private _searchPublicationsService: SearchPublicationsService,
// private _searchDatasetsService: SearchDatasetsService,
private _searchProjectsService: SearchProjectsService,
private _meta: Meta,
private _title: Title,
private _router: Router) {
this.fetchPublications = new FetchPublications(this._searchPublicationsService);
// this.fetchDatasets = new FetchDatasets(this._searchDatasetsService);
this.fetchProjects = new FetchProjects(this._searchProjectsService);
this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService);
}
@ -202,7 +209,8 @@ export class OrganizationComponent {
//this.searchPublications();
this.fetchPublications.getNumForEntity("organization", this.organizationId, this.properties);
this.fetchProjects.getResultsForOrganizations(this.organizationId, "", 1, 0,refineFields,this.properties);
// this.fetchDatasets.getNumForEntity("organization", this.organizationId, this.properties);
this.fetchProjects.getResultsForOrganizations(this.organizationId, "", 1, 0,refineFields,this.properties);
this.fetchDataproviders.getNumForEntity("organization", this.organizationId,this.properties);
@ -268,6 +276,12 @@ export class OrganizationComponent {
//}
}
// private searchDatasets() {
// this.fetchDatasets.getResultsForEntity("organization", this.organizationId, 1, 10,this.properties);
// this.linkToSearchPublications = this.properties.searchLinkToAdvancedDatasets;
// this.reloadDatasets = false;
// }
private searchDataproviders() {
this.fetchDataproviders.getResultsForEntity("organization", this.organizationId, 1, 10,this.properties);
this.linkToSearchDataproviders = this.properties.searchLinkToAdvancedDataProviders;
@ -286,6 +300,12 @@ export class OrganizationComponent {
}
}
// public searchDatasetsInit() {
// if(this.reloadDatasets && this.fetchDatasets.searchUtils.totalResults > 0) {
// this.searchDatasets();
// }
// }
public searchDataprovidersInit() {
if(this.reloadDataproviders && this.fetchDataproviders.searchUtils.totalResults > 0) {
this.searchDataproviders();

View File

@ -17,6 +17,7 @@ import {TabResultModule } from '../../searchPages/searchUtils/tabResult.module';
import {DataProvidersServiceModule} from '../../services/dataProvidersService.module';
import {ReportsServiceModule} from '../../services/reportsService.module';
import {PublicationsServiceModule} from '../../services/publicationsService.module';
// import {DatasetsServiceModule} from '../../services/datasetsService.module';
import {ProjectsServiceModule} from '../../services/projectsService.module';
import { SearchingProjectsTabModule} from '../landing-utils/searchingProjectsInTab.module';
@ -35,6 +36,7 @@ import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
SearchingProjectsTabModule,
OrganizationServiceModule,
PublicationsServiceModule,
// DatasetsServiceModule,
ProjectsServiceModule
],

View File

@ -343,6 +343,8 @@ export class SearchDatasetsService {
if(entity == "project") {
parameters = "projects/"+id+"/datasets/count";
} else if(entity == "organization") {
parameters = "organizations/"+id+"/datasets/count";
}
let url = properties.searchAPIURLLAst+parameters+"?format=json";

View File

@ -131,6 +131,8 @@ public getResultsForEntity(entity:string, id:string, page: number, size: number,
if(entity == "project") {
parameters = "projects/"+id;
} else if(entity == "organization") {
parameters = "organizations/"+id;
}
if(parameters != "") {