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:
parent
deffcceed8
commit
a211cc0713
|
@ -41,6 +41,31 @@
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</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;">
|
<li (click)="activeTab='Projects'; projectsClicked=true;">
|
||||||
<a class="uk-accordion-title" href="#">
|
<a class="uk-accordion-title" href="#">
|
||||||
Projects
|
Projects
|
||||||
|
|
|
@ -10,9 +10,11 @@ import {OrganizationService} from '../../services/organization.servic
|
||||||
import {OrganizationInfo} from '../../utils/entities/organizationInfo';
|
import {OrganizationInfo} from '../../utils/entities/organizationInfo';
|
||||||
import {ReportsService} from '../../services/reports.service';
|
import {ReportsService} from '../../services/reports.service';
|
||||||
import {FetchPublications} from '../../utils/fetchEntitiesClasses/fetchPublications.class';
|
import {FetchPublications} from '../../utils/fetchEntitiesClasses/fetchPublications.class';
|
||||||
|
// import {FetchDatasets} from '../../utils/fetchEntitiesClasses/fetchDatasets.class';
|
||||||
import {FetchProjects} from '../../utils/fetchEntitiesClasses/fetchProjects.class';
|
import {FetchProjects} from '../../utils/fetchEntitiesClasses/fetchProjects.class';
|
||||||
import {FetchDataproviders} from '../../utils/fetchEntitiesClasses/fetchDataproviders.class';
|
import {FetchDataproviders} from '../../utils/fetchEntitiesClasses/fetchDataproviders.class';
|
||||||
import {SearchPublicationsService} from '../../services/searchPublications.service';
|
import {SearchPublicationsService} from '../../services/searchPublications.service';
|
||||||
|
// import {SearchDatasetsService} from '../../services/searchDatasets.service';
|
||||||
import {SearchDataprovidersService} from '../../services/searchDataproviders.service';
|
import {SearchDataprovidersService} from '../../services/searchDataproviders.service';
|
||||||
import {SearchProjectsService} from '../../services/searchProjects.service';
|
import {SearchProjectsService} from '../../services/searchProjects.service';
|
||||||
import {ErrorCodes} from '../../utils/properties/errorCodes';
|
import {ErrorCodes} from '../../utils/properties/errorCodes';
|
||||||
|
@ -49,9 +51,11 @@ export class OrganizationComponent {
|
||||||
// Active tab variable for responsiveness
|
// Active tab variable for responsiveness
|
||||||
public activeTab: string = "Publications";
|
public activeTab: string = "Publications";
|
||||||
|
|
||||||
// Variables for publications, projects, dataproviders tabs
|
// Variables for publications, research data, projects, dataproviders tabs
|
||||||
public fetchPublications: FetchPublications;
|
public fetchPublications: FetchPublications;
|
||||||
public linkToSearchPublications: string = "";
|
public linkToSearchPublications: string = "";
|
||||||
|
// public fetchDatasets: FetchDatasets;
|
||||||
|
// public linkToSearchDatasets: string = "";
|
||||||
public fetchProjects: FetchProjects;
|
public fetchProjects: FetchProjects;
|
||||||
public fetchDataproviders : FetchDataproviders;
|
public fetchDataproviders : FetchDataproviders;
|
||||||
public linkToSearchDataproviders:string = "";
|
public linkToSearchDataproviders:string = "";
|
||||||
|
@ -74,8 +78,9 @@ export class OrganizationComponent {
|
||||||
//private fundersSet: Set<string>;
|
//private fundersSet: Set<string>;
|
||||||
//private emptyFundersSet: boolean = true;
|
//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 reloadPublications: boolean = true;
|
||||||
|
// private reloadDatasets: boolean = true;
|
||||||
private reloadDataproviders: boolean = true;
|
private reloadDataproviders: boolean = true;
|
||||||
|
|
||||||
// Helper variables to specify funder in downloadPublicationsFile function
|
// Helper variables to specify funder in downloadPublicationsFile function
|
||||||
|
@ -100,12 +105,14 @@ export class OrganizationComponent {
|
||||||
private _searchDataprovidersService: SearchDataprovidersService,
|
private _searchDataprovidersService: SearchDataprovidersService,
|
||||||
private _reportsService: ReportsService,
|
private _reportsService: ReportsService,
|
||||||
private _searchPublicationsService: SearchPublicationsService,
|
private _searchPublicationsService: SearchPublicationsService,
|
||||||
|
// private _searchDatasetsService: SearchDatasetsService,
|
||||||
private _searchProjectsService: SearchProjectsService,
|
private _searchProjectsService: SearchProjectsService,
|
||||||
private _meta: Meta,
|
private _meta: Meta,
|
||||||
private _title: Title,
|
private _title: Title,
|
||||||
private _router: Router) {
|
private _router: Router) {
|
||||||
|
|
||||||
this.fetchPublications = new FetchPublications(this._searchPublicationsService);
|
this.fetchPublications = new FetchPublications(this._searchPublicationsService);
|
||||||
|
// this.fetchDatasets = new FetchDatasets(this._searchDatasetsService);
|
||||||
this.fetchProjects = new FetchProjects(this._searchProjectsService);
|
this.fetchProjects = new FetchProjects(this._searchProjectsService);
|
||||||
this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService);
|
this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService);
|
||||||
}
|
}
|
||||||
|
@ -202,7 +209,8 @@ export class OrganizationComponent {
|
||||||
|
|
||||||
//this.searchPublications();
|
//this.searchPublications();
|
||||||
this.fetchPublications.getNumForEntity("organization", this.organizationId, this.properties);
|
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);
|
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() {
|
private searchDataproviders() {
|
||||||
this.fetchDataproviders.getResultsForEntity("organization", this.organizationId, 1, 10,this.properties);
|
this.fetchDataproviders.getResultsForEntity("organization", this.organizationId, 1, 10,this.properties);
|
||||||
this.linkToSearchDataproviders = this.properties.searchLinkToAdvancedDataProviders;
|
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() {
|
public searchDataprovidersInit() {
|
||||||
if(this.reloadDataproviders && this.fetchDataproviders.searchUtils.totalResults > 0) {
|
if(this.reloadDataproviders && this.fetchDataproviders.searchUtils.totalResults > 0) {
|
||||||
this.searchDataproviders();
|
this.searchDataproviders();
|
||||||
|
|
|
@ -17,6 +17,7 @@ import {TabResultModule } from '../../searchPages/searchUtils/tabResult.module';
|
||||||
import {DataProvidersServiceModule} from '../../services/dataProvidersService.module';
|
import {DataProvidersServiceModule} from '../../services/dataProvidersService.module';
|
||||||
import {ReportsServiceModule} from '../../services/reportsService.module';
|
import {ReportsServiceModule} from '../../services/reportsService.module';
|
||||||
import {PublicationsServiceModule} from '../../services/publicationsService.module';
|
import {PublicationsServiceModule} from '../../services/publicationsService.module';
|
||||||
|
// import {DatasetsServiceModule} from '../../services/datasetsService.module';
|
||||||
import {ProjectsServiceModule} from '../../services/projectsService.module';
|
import {ProjectsServiceModule} from '../../services/projectsService.module';
|
||||||
|
|
||||||
import { SearchingProjectsTabModule} from '../landing-utils/searchingProjectsInTab.module';
|
import { SearchingProjectsTabModule} from '../landing-utils/searchingProjectsInTab.module';
|
||||||
|
@ -35,6 +36,7 @@ import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
|
||||||
SearchingProjectsTabModule,
|
SearchingProjectsTabModule,
|
||||||
OrganizationServiceModule,
|
OrganizationServiceModule,
|
||||||
PublicationsServiceModule,
|
PublicationsServiceModule,
|
||||||
|
// DatasetsServiceModule,
|
||||||
ProjectsServiceModule
|
ProjectsServiceModule
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
|
@ -343,6 +343,8 @@ export class SearchDatasetsService {
|
||||||
|
|
||||||
if(entity == "project") {
|
if(entity == "project") {
|
||||||
parameters = "projects/"+id+"/datasets/count";
|
parameters = "projects/"+id+"/datasets/count";
|
||||||
|
} else if(entity == "organization") {
|
||||||
|
parameters = "organizations/"+id+"/datasets/count";
|
||||||
}
|
}
|
||||||
|
|
||||||
let url = properties.searchAPIURLLAst+parameters+"?format=json";
|
let url = properties.searchAPIURLLAst+parameters+"?format=json";
|
||||||
|
|
|
@ -131,6 +131,8 @@ public getResultsForEntity(entity:string, id:string, page: number, size: number,
|
||||||
|
|
||||||
if(entity == "project") {
|
if(entity == "project") {
|
||||||
parameters = "projects/"+id;
|
parameters = "projects/"+id;
|
||||||
|
} else if(entity == "organization") {
|
||||||
|
parameters = "organizations/"+id;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(parameters != "") {
|
if(parameters != "") {
|
||||||
|
|
Loading…
Reference in New Issue