apply changes to projects and zenodo communities pages and queries

This commit is contained in:
argirok 2023-07-14 14:54:58 +03:00
parent a03d41be9c
commit f53af36929
11 changed files with 32 additions and 84 deletions

View File

@ -6,7 +6,6 @@ import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties'
import {CommunityService} from "../openaireLibrary/connect/community/community.service"; import {CommunityService} from "../openaireLibrary/connect/community/community.service";
import {ConfigurationService} from '../openaireLibrary/utils/configuration/configuration.service'; import {ConfigurationService} from '../openaireLibrary/utils/configuration/configuration.service';
import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service'; import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service';
import {SearchZenodoCommunitiesService} from '../openaireLibrary/connect/zenodoCommunities/searchZenodoCommunities.service';
import {ZenodoCommunitiesService} from '../openaireLibrary/connect/zenodoCommunities/zenodo-communities.service'; import {ZenodoCommunitiesService} from '../openaireLibrary/connect/zenodoCommunities/zenodo-communities.service';
import {Session, User} from '../openaireLibrary/login/utils/helper.class'; import {Session, User} from '../openaireLibrary/login/utils/helper.class';
import {StatisticsForDashboardComponent} from '../statistics/statistics.component'; import {StatisticsForDashboardComponent} from '../statistics/statistics.component';
@ -156,7 +155,6 @@ export class CommunityComponent {
private _searchCommunityDataprovidersService: SearchCommunityDataprovidersService, private _searchCommunityDataprovidersService: SearchCommunityDataprovidersService,
private _searchCommunityProjectsService: SearchCommunityProjectsService, private _searchCommunityProjectsService: SearchCommunityProjectsService,
private _searchResearchResultsService: SearchResearchResultsService, private _searchResearchResultsService: SearchResearchResultsService,
private _searchZenodoCommunitiesService: SearchZenodoCommunitiesService,
private _zenodoCommunitieService: ZenodoCommunitiesService, private _zenodoCommunitieService: ZenodoCommunitiesService,
private seoService: SEOService, private seoService: SEOService,
private userManagementService: UserManagementService, private userManagementService: UserManagementService,
@ -221,7 +219,7 @@ export class CommunityComponent {
this._title.setTitle(community.title); this._title.setTitle(community.title);
this.subs.push(this._piwikService.trackView(this.properties, community.title).subscribe()); this.subs.push(this._piwikService.trackView(this.properties, community.title).subscribe());
if (this.community.zenodoCommunity) { if (this.community.zenodoCommunity) {
this.subs.push(this._zenodoCommunitieService.getZenodoCommunityById(this.properties, this.properties.zenodoCommunities + this.community.zenodoCommunity, null).subscribe( this.subs.push(this._zenodoCommunitieService.getZenodoCommunityById(this.properties, this.properties.zenodoCommunities + this.community.zenodoCommunity).subscribe(
result => { result => {
this.masterZenodoCommunity = result; this.masterZenodoCommunity = result;
}, },
@ -230,14 +228,7 @@ export class CommunityComponent {
} }
)); ));
} }
this.subs.push(this._searchZenodoCommunitiesService.searchZCommunities(this.properties, this.communityId).subscribe( this.zenodoCommunityIdS = this.community.otherZenodoCommunities;
result => {
this.zenodoCommunityIdS = result;
},
error => {
this.handleError("Error getting list of zenodo communities for community with openaire id: " + this.communityId, error);
}
));
} }
})); }));

View File

@ -12,7 +12,6 @@ import {InviteModule} from '../utils/subscribe/invite/invite.module';
import {ManageModule} from '../openaireLibrary/utils/manage/manage.module'; import {ManageModule} from '../openaireLibrary/utils/manage/manage.module';
import {StatisticsModule} from "../statistics/statistics.module"; import {StatisticsModule} from "../statistics/statistics.module";
import {SearchZenodoCommunitiesServiceModule} from '../openaireLibrary/connect/zenodoCommunities/searchZenodoCommunitiesService.module';
import {ZenodoCommunitiesServiceModule} from '../openaireLibrary/connect/zenodoCommunities/zenodo-communitiesService.module'; import {ZenodoCommunitiesServiceModule} from '../openaireLibrary/connect/zenodoCommunities/zenodo-communitiesService.module';
import {SearchFormModule} from '../openaireLibrary/searchPages/searchUtils/searchForm.module'; import {SearchFormModule} from '../openaireLibrary/searchPages/searchUtils/searchForm.module';
import {SearchDataprovidersServiceModule} from "../openaireLibrary/connect/contentProviders/searchDataprovidersService.module"; import {SearchDataprovidersServiceModule} from "../openaireLibrary/connect/contentProviders/searchDataprovidersService.module";
@ -39,7 +38,7 @@ import {NoLoadPaging} from '../openaireLibrary/searchPages/searchUtils/no-load-p
imports: [ imports: [
CommonModule, FormsModule, RouterModule, CommonModule, FormsModule, RouterModule,
SubscribeModule, StatisticsModule, ManageModule, InviteModule, SubscribeModule, StatisticsModule, ManageModule, InviteModule,
SearchZenodoCommunitiesServiceModule, ZenodoCommunitiesServiceModule, SearchFormModule, SearchDataprovidersServiceModule, SearchProjectsServiceModule, ZenodoCommunitiesServiceModule, SearchFormModule, SearchDataprovidersServiceModule, SearchProjectsServiceModule,
SearchResearchResultsServiceModule, SearchResultsModule, CuratorsModule, AffiliationsModule, SearchResearchResultsServiceModule, SearchResultsModule, CuratorsModule, AffiliationsModule,
SEOServiceModule, MatSelectModule, EntitiesSelectionModule, SEOServiceModule, MatSelectModule, EntitiesSelectionModule,
TabsModule, SearchTabModule, ErrorMessagesModule, SafeHtmlPipeModule, ErrorModule, TabsModule, SearchTabModule, ErrorMessagesModule, SafeHtmlPipeModule, ErrorModule,

View File

@ -6,9 +6,6 @@ import {ZenodoInformationClass} from "../openaireLibrary/deposit/utils/zenodoInf
import {FetchZenodoInformation} from "./utils/fetchZenodoInformation.class"; import {FetchZenodoInformation} from "./utils/fetchZenodoInformation.class";
import {ZenodoCommunitiesService} from "../openaireLibrary/connect/zenodoCommunities/zenodo-communities.service"; import {ZenodoCommunitiesService} from "../openaireLibrary/connect/zenodoCommunities/zenodo-communities.service";
import {CommunityService} from "../openaireLibrary/connect/community/community.service"; import {CommunityService} from "../openaireLibrary/connect/community/community.service";
import {
SearchZenodoCommunitiesService
} from "../openaireLibrary/connect/zenodoCommunities/searchZenodoCommunities.service";
import {Subscriber, Subscription} from "rxjs"; import {Subscriber, Subscription} from "rxjs";
import {properties} from "../../environments/environment"; import {properties} from "../../environments/environment";
@ -33,9 +30,8 @@ export class OpenaireDepositComponent {
constructor(private route: ActivatedRoute, constructor(private route: ActivatedRoute,
private _zenodoCommunitieService: ZenodoCommunitiesService, private _zenodoCommunitieService: ZenodoCommunitiesService,
private _communityService: CommunityService, private _communityService: CommunityService) {
private _searchZenodoCommunitiesService: SearchZenodoCommunitiesService) { this.fetchZenodoInformation = new FetchZenodoInformation(this._zenodoCommunitieService);
this.fetchZenodoInformation = new FetchZenodoInformation(this._zenodoCommunitieService, this._searchZenodoCommunitiesService);
} }
public ngOnInit() { public ngOnInit() {

View File

@ -9,7 +9,6 @@ import {DepositRoutingModule} from "./deposit-routing.module";
import {DepositFirstPageModule} from "../openaireLibrary/deposit/depositFirstPage.module"; import {DepositFirstPageModule} from "../openaireLibrary/deposit/depositFirstPage.module";
import {ZenodoCommunitiesService} from "../openaireLibrary/connect/zenodoCommunities/zenodo-communities.service"; import {ZenodoCommunitiesService} from "../openaireLibrary/connect/zenodoCommunities/zenodo-communities.service";
import {SearchZenodoCommunitiesService} from "../openaireLibrary/connect/zenodoCommunities/searchZenodoCommunities.service";
@NgModule({ @NgModule({
imports: [ imports: [
@ -23,6 +22,6 @@ import {SearchZenodoCommunitiesService} from "../openaireLibrary/connect/zenodoC
OpenaireDepositComponent, OpenaireDepositComponent,
], ],
providers: [PreviousRouteRecorder, IsRouteEnabled, providers: [PreviousRouteRecorder, IsRouteEnabled,
ZenodoCommunitiesService, SearchZenodoCommunitiesService] ZenodoCommunitiesService]
}) })
export class LibDepositModule { } export class LibDepositModule { }

View File

@ -3,9 +3,6 @@ import {ActivatedRoute} from '@angular/router';
import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties'; import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
import {ZenodoCommunitiesService} from '../openaireLibrary/connect/zenodoCommunities/zenodo-communities.service'; import {ZenodoCommunitiesService} from '../openaireLibrary/connect/zenodoCommunities/zenodo-communities.service';
import {
SearchZenodoCommunitiesService
} from '../openaireLibrary/connect/zenodoCommunities/searchZenodoCommunities.service';
import {CommunityService} from '../openaireLibrary/connect/community/community.service'; import {CommunityService} from '../openaireLibrary/connect/community/community.service';
import {ZenodoInformationClass} from '../openaireLibrary/deposit/utils/zenodoInformation.class'; import {ZenodoInformationClass} from '../openaireLibrary/deposit/utils/zenodoInformation.class';
@ -31,8 +28,8 @@ export class OpenaireSearchDataprovidersToDepositComponent {
constructor(private route: ActivatedRoute, constructor(private route: ActivatedRoute,
private _zenodoCommunitieService: ZenodoCommunitiesService, private _zenodoCommunitieService: ZenodoCommunitiesService,
private _communityService: CommunityService, private _searchZenodoCommunitiesService: SearchZenodoCommunitiesService) { private _communityService: CommunityService) {
this.fetchZenodoInformation = new FetchZenodoInformation(this._zenodoCommunitieService, this._searchZenodoCommunitiesService); this.fetchZenodoInformation = new FetchZenodoInformation(this._zenodoCommunitieService);
} }
public ngOnInit() { public ngOnInit() {

View File

@ -9,14 +9,13 @@ import {SearchDataprovidersToDepositModule} from '../openaireLibrary/deposit/sea
import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
import {IsRouteEnabled} from '../openaireLibrary/error/isRouteEnabled.guard'; import {IsRouteEnabled} from '../openaireLibrary/error/isRouteEnabled.guard';
import {ZenodoCommunitiesServiceModule} from '../openaireLibrary/connect/zenodoCommunities/zenodo-communitiesService.module'; import {ZenodoCommunitiesServiceModule} from '../openaireLibrary/connect/zenodoCommunities/zenodo-communitiesService.module';
import {SearchZenodoCommunitiesServiceModule} from '../openaireLibrary/connect/zenodoCommunities/searchZenodoCommunitiesService.module';
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, FormsModule, CommonModule, FormsModule,
SearchDataprovidersToDepositModule, SearchDataprovidersToDepositModule,
SearchDataprovidersToDepositRoutingModule, SearchDataprovidersToDepositRoutingModule,
ZenodoCommunitiesServiceModule, SearchZenodoCommunitiesServiceModule ZenodoCommunitiesServiceModule
], ],
declarations: [ declarations: [
OpenaireSearchDataprovidersToDepositComponent OpenaireSearchDataprovidersToDepositComponent

View File

@ -1,6 +1,5 @@
import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properties'; import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properties';
import {ZenodoCommunitiesService} from '../../openaireLibrary/connect/zenodoCommunities/zenodo-communities.service'; import {ZenodoCommunitiesService} from '../../openaireLibrary/connect/zenodoCommunities/zenodo-communities.service';
import {SearchZenodoCommunitiesService} from '../../openaireLibrary/connect/zenodoCommunities/searchZenodoCommunities.service';
import {ZenodoInformationClass} from '../../openaireLibrary/deposit/utils/zenodoInformation.class'; import {ZenodoInformationClass} from '../../openaireLibrary/deposit/utils/zenodoInformation.class';
import {Subscriber} from "rxjs"; import {Subscriber} from "rxjs";
@ -11,8 +10,7 @@ import {Injectable} from "@angular/core";
}) })
export class FetchZenodoInformation { export class FetchZenodoInformation {
private subscriptions = []; private subscriptions = [];
constructor ( private _zenodoCommunitieService: ZenodoCommunitiesService, constructor ( private _zenodoCommunitieService: ZenodoCommunitiesService ) { }
private _searchZenodoCommunitiesService: SearchZenodoCommunitiesService ) { }
public ngOnDestroy() { public ngOnDestroy() {
this.clearSubscriptions(); this.clearSubscriptions();
@ -26,7 +24,7 @@ export class FetchZenodoInformation {
}); });
} }
public getZenodoCommunityNameAndUrlById(masterZenodoCommunityId: string, properties:EnvProperties, zenodoInformation: ZenodoInformationClass){ public getZenodoCommunityNameAndUrlById(masterZenodoCommunityId: string, properties:EnvProperties, zenodoInformation: ZenodoInformationClass){
this.subscriptions.push(this._zenodoCommunitieService.getZenodoCommunityById(properties, properties.zenodoCommunities+masterZenodoCommunityId, null).subscribe( this.subscriptions.push(this._zenodoCommunitieService.getZenodoCommunityById(properties, properties.zenodoCommunities+masterZenodoCommunityId).subscribe(
result => { result => {
console.info("getZenodoCommunityNameAndUrlById", result); console.info("getZenodoCommunityNameAndUrlById", result);
var masterZenodoCommunity = result; var masterZenodoCommunity = result;
@ -38,22 +36,4 @@ export class FetchZenodoInformation {
} }
)); ));
} }
public searchNumberOfZCommunities(communityId: string, properties: EnvProperties, zenodoInformation: ZenodoInformationClass) {
this.subscriptions.push(this._searchZenodoCommunitiesService.searchZCommunities(properties,communityId).subscribe (
result => {
console.info("searchNumberOfZCommunities", result);
var CommunityIds = result;
var totalResults = CommunityIds.length;
if(totalResults > 0) {
zenodoInformation.shareInZenodoUrl = properties.shareInZenodoPage;
console.info(zenodoInformation.shareInZenodoUrl);
}
},
error => {
console.error("list of zenodo communities couldn't be loaded");
}
));
}
} }

View File

@ -95,36 +95,36 @@
<div *ngIf="communityIds && communityIds.length > 0" class="uk-grid uk-grid-medium uk-grid-match uk-child-width-1-2@m uk-margin-top" uk-grid <div *ngIf="communityIds && communityIds.length > 0" class="uk-grid uk-grid-medium uk-grid-match uk-child-width-1-2@m uk-margin-top" uk-grid
uk-height-match="target: .header, .body"> uk-height-match="target: .header, .body">
<ng-template ngFor let-item [ngForOf]="communityIds" let-i="index"> <ng-template ngFor let-item [ngForOf]="communityIds" let-i="index">
<div *ngIf="i>=((page-1)*size) && i < communityIds.length && i< this.page * this.size && communities[this.communityIds[i]['zenodoid']]" <div *ngIf="i>=((page-1)*size) && i < communityIds.length && i< this.page * this.size && communities[this.communityIds[i]]"
class="uk-animation-fade"> class="uk-animation-fade">
<div class="uk-card uk-card-default"> <div class="uk-card uk-card-default">
<div class="uk-card-body"> <div class="uk-card-body">
<div class="header uk-grid uk-grid-medium uk-flex-middle" uk-grid> <div class="header uk-grid uk-grid-medium uk-flex-middle" uk-grid>
<div class="uk-width-auto" *ngIf="communities[this.communityIds[i]['zenodoid']].logoUrl"> <div class="uk-width-auto" *ngIf="communities[this.communityIds[i]].logoUrl">
<a target="_blank" [href]="communities[this.communityIds[i]['zenodoid']].link"> <a target="_blank" [href]="communities[this.communityIds[i]].link">
<img *ngIf="communities[this.communityIds[i]['zenodoid']].logoUrl" <img *ngIf="communities[this.communityIds[i]].logoUrl"
src="{{communities[this.communityIds[i]['zenodoid']].logoUrl}}" width="80" height="80" alt="{{communities[this.communityIds[i]['zenodoid']].title}}"> src="{{communities[this.communityIds[i]].logoUrl}}" width="80" height="80" alt="{{communities[this.communityIds[i]].title}}">
</a> </a>
</div> </div>
<div class="uk-width-expand"> <div class="uk-width-expand">
<h2 class="uk-margin-remove uk-text-break uk-inline-block uk-h6"> <h2 class="uk-margin-remove uk-text-break uk-inline-block uk-h6">
<a class="custom-external uk-link uk-link-heading uk-width-expand" target="_blank" <a class="custom-external uk-link uk-link-heading uk-width-expand" target="_blank"
href="{{communities[this.communityIds[i]['zenodoid']].link}}"> href="{{communities[this.communityIds[i]].link}}">
<span *ngIf="communities[this.communityIds[i]['zenodoid']].title">{{communities[this.communityIds[i]['zenodoid']].title}}</span> <span *ngIf="communities[this.communityIds[i]].title">{{communities[this.communityIds[i]].title}}</span>
<span *ngIf="!communities[this.communityIds[i]['zenodoid']].title">[no name available]</span> <span *ngIf="!communities[this.communityIds[i]].title">[no name available]</span>
</a> </a>
</h2> </h2>
<div class="uk-text-small uk-margin-small-top"> <div class="uk-text-small uk-margin-small-top">
<span class="uk-text-meta">Last update: </span>{{communities[this.communityIds[i]['zenodoid']].date | date:'yyyy/MM/dd'}} <span class="uk-text-meta">Last update: </span>{{communities[this.communityIds[i]].date | date:'yyyy/MM/dd'}}
</div> </div>
</div> </div>
</div> </div>
<div class="body uk-margin-top uk-margin-bottom uk-text-small multi-line-ellipsis lines-3"> <!-- uk-height-max-small uk-overflow-auto --> <div class="body uk-margin-top uk-margin-bottom uk-text-small multi-line-ellipsis lines-3"> <!-- uk-height-max-small uk-overflow-auto -->
<p *ngIf="communities[this.communityIds[i]['zenodoid']].description" class="uk-margin-remove" [innerHtml]="communities[this.communityIds[i]['zenodoid']].description"></p> <p *ngIf="communities[this.communityIds[i]].description" class="uk-margin-remove" [innerHtml]="communities[this.communityIds[i]].description"></p>
</div> </div>
<div> <div>
<span class="uk-width-expand uk-flex-right"> <span class="uk-width-expand uk-flex-right">
<a [href]="depositLink + communities[this.communityIds[i]['zenodoid']].id" target="_blank" type="submit" <a [href]="depositLink + communities[this.communityIds[i]].id" target="_blank" type="submit"
class="uk-float-right uk-margin-small-left uk-display-inline-block uk-text-uppercase uk-button uk-button-text"> class="uk-float-right uk-margin-small-left uk-display-inline-block uk-text-uppercase uk-button uk-button-text">
<span class="uk-flex uk-flex-middle"> <span class="uk-flex uk-flex-middle">
<icon name="file_upload" type="outlined" [flex]="true" class="uk-margin-small-right"></icon> <icon name="file_upload" type="outlined" [flex]="true" class="uk-margin-small-right"></icon>

View File

@ -3,9 +3,6 @@ import {ActivatedRoute, Router} from '@angular/router';
import {Meta, Title} from '@angular/platform-browser'; import {Meta, Title} from '@angular/platform-browser';
import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properties'; import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properties';
import {ZenodoCommunitiesService} from '../../openaireLibrary/connect/zenodoCommunities/zenodo-communities.service'; import {ZenodoCommunitiesService} from '../../openaireLibrary/connect/zenodoCommunities/zenodo-communities.service';
import {
SearchZenodoCommunitiesService
} from '../../openaireLibrary/connect/zenodoCommunities/searchZenodoCommunities.service';
import {CommunityService} from '../../openaireLibrary/connect/community/community.service'; import {CommunityService} from '../../openaireLibrary/connect/community/community.service';
import {CommunityInfo} from '../../openaireLibrary/connect/community/communityInfo'; import {CommunityInfo} from '../../openaireLibrary/connect/community/communityInfo';
import {SearchUtilsClass} from '../../openaireLibrary/searchPages/searchUtils/searchUtils.class'; import {SearchUtilsClass} from '../../openaireLibrary/searchPages/searchUtils/searchUtils.class';
@ -58,7 +55,6 @@ export class ShareInZenodoComponent {
private _title: Title, private _title: Title,
private _zenodoCommunitieService: ZenodoCommunitiesService, private _zenodoCommunitieService: ZenodoCommunitiesService,
private _communityService: CommunityService, private _communityService: CommunityService,
private _searchZenodoCommunitiesService: SearchZenodoCommunitiesService,
private helper: HelperService, private helper: HelperService,
private _piwikService: PiwikService, private _piwikService: PiwikService,
private seoService: SEOService) { private seoService: SEOService) {
@ -86,7 +82,7 @@ export class ShareInZenodoComponent {
this.community = community; this.community = community;
this.masterZenodoCommunityId = this.community.zenodoCommunity; this.masterZenodoCommunityId = this.community.zenodoCommunity;
if (this.masterZenodoCommunityId) { if (this.masterZenodoCommunityId) {
this.subs.push(this._zenodoCommunitieService.getZenodoCommunityById(this.properties, this.properties.zenodoCommunities + this.masterZenodoCommunityId, null).subscribe( this.subs.push(this._zenodoCommunitieService.getZenodoCommunityById(this.properties, this.properties.zenodoCommunities + this.masterZenodoCommunityId).subscribe(
result => { result => {
this.masterZenodoCommunity = result; this.masterZenodoCommunity = result;
@ -98,22 +94,14 @@ export class ShareInZenodoComponent {
)); ));
} }
this.zenodoSearchUtils.status = this.errorCodes.LOADING; this.zenodoSearchUtils.status = this.errorCodes.LOADING;
this.subs.push(this._searchZenodoCommunitiesService.searchZCommunities(this.properties, this.communityId).subscribe( this.communityIds = this.community.otherZenodoCommunities;
result => {
this.communityIds = result;
this.zenodoSearchUtils.totalResults = this.communityIds.length; this.zenodoSearchUtils.totalResults = this.communityIds.length;
if (this.communityIds.length == 0) { if (this.communityIds.length == 0) {
this.zenodoSearchUtils.status = this.errorCodes.NONE; this.zenodoSearchUtils.status = this.errorCodes.NONE;
} }
this.getCommunities() this.getCommunities()
},
error => {
//console.error("list of zenodo communities couldn't be loaded");
this.handleError("Error getting list of zenodo communities for community with openaire id: " + this.communityId, error);
this.zenodoSearchUtils.status = this.errorCodes.ERROR;
} //this.handleError('System error retrieving community profile', error)
));
} }
})); }));
@ -154,8 +142,8 @@ export class ShareInZenodoComponent {
})); }));
} }
getZenodoCommunityById(zenodoid, openaireId) { getZenodoCommunityById(zenodoid) {
this.subs.push(this._zenodoCommunitieService.getZenodoCommunityById(this.properties, this.properties.zenodoCommunities + zenodoid, openaireId).subscribe( this.subs.push(this._zenodoCommunitieService.getZenodoCommunityById(this.properties, this.properties.zenodoCommunities + zenodoid).subscribe(
result => { result => {
this.communities[zenodoid] = result; this.communities[zenodoid] = result;
this.zenodoCommunitiesLoadedCount++; this.zenodoCommunitiesLoadedCount++;
@ -176,7 +164,7 @@ export class ShareInZenodoComponent {
this.zenodoSearchUtils.status = this.errorCodes.DONE; this.zenodoSearchUtils.status = this.errorCodes.DONE;
} }
//console.error("Zenodo community'"+zenodoid+"' couldn't be loaded"); //console.error("Zenodo community'"+zenodoid+"' couldn't be loaded");
this.handleError("Error getting Zenodo community with id: " + zenodoid + " and openaire id: " + openaireId, error); this.handleError("Error getting Zenodo community with id: " + zenodoid, error);
} }
)); ));
@ -190,7 +178,7 @@ export class ShareInZenodoComponent {
this.page = $event.value; this.page = $event.value;
for (let i = (this.page - 1) * this.size; i < this.communityIds.length && i < this.page * this.size; i++) { for (let i = (this.page - 1) * this.size; i < this.communityIds.length && i < this.page * this.size; i++) {
if (!this.communities[this.communityIds[i]["zenodoid"]]) { if (!this.communities[this.communityIds[i]["zenodoid"]]) {
this.getZenodoCommunityById(this.communityIds[i]["zenodoid"], this.communityIds[i]["id"]); this.getZenodoCommunityById(this.communityIds[i]);
} }
} }
} }

View File

@ -7,7 +7,6 @@ import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard'
import {ShareInZenodoComponent} from './shareInZenodo.component'; import {ShareInZenodoComponent} from './shareInZenodo.component';
import {ShareInZenodoRoutingModule} from './shareInZenodo-routing.module'; import {ShareInZenodoRoutingModule} from './shareInZenodo-routing.module';
import {ZenodoCommunitiesServiceModule} from '../../openaireLibrary/connect/zenodoCommunities/zenodo-communitiesService.module'; import {ZenodoCommunitiesServiceModule} from '../../openaireLibrary/connect/zenodoCommunities/zenodo-communitiesService.module';
import {SearchZenodoCommunitiesServiceModule} from '../../openaireLibrary/connect/zenodoCommunities/searchZenodoCommunitiesService.module';
import {RouterModule} from "@angular/router"; import {RouterModule} from "@angular/router";
import {HelperModule} from "../../openaireLibrary/utils/helper/helper.module"; import {HelperModule} from "../../openaireLibrary/utils/helper/helper.module";
@ -21,7 +20,7 @@ import {LoadingModule} from 'src/app/openaireLibrary/utils/loading/loading.modul
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, ShareInZenodoRoutingModule, ZenodoCommunitiesServiceModule, SearchZenodoCommunitiesServiceModule, CommonModule, ShareInZenodoRoutingModule, ZenodoCommunitiesServiceModule,
RouterModule, HelperModule, LoadingModule, RouterModule, HelperModule, LoadingModule,
PiwikServiceModule, Schema2jsonldModule, SEOServiceModule, BreadcrumbsModule, NoLoadPaging, IconsModule PiwikServiceModule, Schema2jsonldModule, SEOServiceModule, BreadcrumbsModule, NoLoadPaging, IconsModule
], ],

View File

@ -122,8 +122,8 @@ export class OpenaireSearchProjectsComponent {
if(this.allResults) { if(this.allResults) {
this.subscriptions.push(this._searchProjectsService.searchProjects(this.properties, this.communityId).subscribe( this.subscriptions.push(this._searchProjectsService.searchProjects(this.properties, this.communityId).subscribe(
data => { data => {
this.originalFilters = this.createFilters(data).slice(); //copy array this.originalFilters = this.createFilters(data.content).slice(); //copy array
this.allResults = this.parseResults(data); this.allResults = this.parseResults(data.content);
this.filters = this.searchPage.prepareFiltersToShow(this.originalFilters, this.allResults.length); this.filters = this.searchPage.prepareFiltersToShow(this.originalFilters, this.allResults.length);
this.filterResults(); this.filterResults();
}, },