[plugins-functionality | WIP] add graph info

This commit is contained in:
argirok 2024-03-11 13:29:29 +02:00
parent 2a27c1caf7
commit ed512f6f05
6 changed files with 15 additions and 14 deletions

@ -1 +1 @@
Subproject commit a260ed17bd28e0cff2ab1504aea7937ebc211ca8 Subproject commit e2b34b13ee3cf7e360e02fe85f79cea99954e78f

View File

@ -164,11 +164,6 @@ sidebarItems = [{name:"Identity", id : "identity", icon: "desktop_windows" },
return JSON.stringify(object1) != JSON.stringify(object2); return JSON.stringify(object1) != JSON.stringify(object2);
} }
saveLayout() { saveLayout() {
if (!Session.isLoggedIn()) {
this._router.navigate(['/user-info'], {
queryParams: {'errorCode': LoginErrorCodes.NOT_VALID, 'redirectUrl': this._router.url}
});
}
this.publishedLayout.layoutOptions = this.copyObject(this.draftCustomizationOptions); this.publishedLayout.layoutOptions = this.copyObject(this.draftCustomizationOptions);
this.publishedCustomizationOptions = this.copyObject(this.publishedLayout.layoutOptions) this.publishedCustomizationOptions = this.copyObject(this.publishedLayout.layoutOptions)
this.publishedLayout.date = new Date(); this.publishedLayout.date = new Date();

View File

@ -83,7 +83,7 @@ type Tab = 'all' | 'communities' | 'ris';
<div class="uk-card uk-card-default uk-card-body uk-position-relative"> <div class="uk-card uk-card-default uk-card-body uk-position-relative">
<div class="uk-position-top-right uk-margin-small-right uk-margin-small-top"> <div class="uk-position-top-right uk-margin-small-right uk-margin-small-top">
<div class="uk-flex uk-flex-middle"> <div class="uk-flex uk-flex-middle">
<icon [flex]="true" [name]="community.status == 'all'?'earth':(community.status == 'manager'?'restricted':'incognito')" ratio="0.6"></icon> <icon [flex]="true" [name]="community.isPublic()?'earth':(community.isRestricted()?'restricted':'incognito')" ratio="0.6"></icon>
</div> </div>
</div> </div>
<a class="uk-display-block uk-text-center uk-link-reset" [routerLink]="community.communityId"> <a class="uk-display-block uk-text-center uk-link-reset" [routerLink]="community.communityId">

View File

@ -22,6 +22,7 @@
<div *ngIf="searchUtils.status == errorCodes.LOADING" class="uk-position-center"> <div *ngIf="searchUtils.status == errorCodes.LOADING" class="uk-position-center">
<loading></loading> <loading></loading>
</div> </div>
{{selectedCommunities.length}} {{previewCommunities.length}}
<div *ngIf="searchUtils.status !== errorCodes.LOADING"> <div *ngIf="searchUtils.status !== errorCodes.LOADING">
<div *ngIf="previewCommunities.length == 0" <div *ngIf="previewCommunities.length == 0"
class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-bottom uk-text-bold"> class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-bottom uk-text-bold">

View File

@ -5,7 +5,7 @@ import {
Input, Input,
OnDestroy, OnDestroy,
OnInit, OnInit,
Output, Output, SimpleChanges,
ViewChild, ViewChild,
ViewEncapsulation ViewEncapsulation
} from '@angular/core'; } from '@angular/core';
@ -33,8 +33,8 @@ export class ManageZenodoCommunitiesComponent implements OnInit, OnDestroy {
@Input() searchUtils: SearchUtilsClass = null; @Input() searchUtils: SearchUtilsClass = null;
errorCodes: ErrorCodes; errorCodes: ErrorCodes;
public rowsOnPage = 10; public rowsOnPage = 10;
@Input() masterCommunity = null; @Input() masterCommunity;
@Input() selectedCommunities = []; @Input() selectedCommunities;
previewCommunities = []; previewCommunities = [];
@ViewChild('AlertModalDeleteCommunity') alertModalDeleteCommunity; @ViewChild('AlertModalDeleteCommunity') alertModalDeleteCommunity;
selectedToDelete = null; selectedToDelete = null;
@ -53,12 +53,12 @@ export class ManageZenodoCommunitiesComponent implements OnInit, OnDestroy {
private _manageZenodoCommunitiesService: ManageZenodoCommunitiesService) { private _manageZenodoCommunitiesService: ManageZenodoCommunitiesService) {
this.errorCodes = new ErrorCodes(); this.errorCodes = new ErrorCodes();
} }
ngOnInit() { ngOnInit() {
this.init(); this.init();
} }
ngOnDestroy() { ngOnDestroy() {
this.subscriptions.forEach(subscription => { this.subscriptions.forEach(subscription => {
if (subscription instanceof Subscription) { if (subscription instanceof Subscription) {
subscription.unsubscribe(); subscription.unsubscribe();
@ -67,6 +67,7 @@ export class ManageZenodoCommunitiesComponent implements OnInit, OnDestroy {
} }
private init() { private init() {
console.log(this.selectedCommunities.length)
this.filterForm = this._fb.control(''); this.filterForm = this._fb.control('');
this.filterPreviewCommunities(""); this.filterPreviewCommunities("");
this.subscriptions.push(this.filterForm.valueChanges.subscribe(value => { this.subscriptions.push(this.filterForm.valueChanges.subscribe(value => {
@ -75,15 +76,18 @@ export class ManageZenodoCommunitiesComponent implements OnInit, OnDestroy {
})); }));
this.searchUtils.keyword = ""; this.searchUtils.keyword = "";
this.searchUtils.totalResults = this.selectedCommunities.length; this.searchUtils.totalResults = this.selectedCommunities.length;
console.log(this.selectedCommunities.length, this.previewCommunities.length)
} }
public filterPreviewCommunities(value: string) { public filterPreviewCommunities(value: string) {
this.previewCommunities = this.selectedCommunities.filter(community => { this.previewCommunities = this.selectedCommunities.filter(community => {
return !value || community.title.toLowerCase().indexOf(value.toLowerCase()) != -1 return !value || community.title.toLowerCase().indexOf(value.toLowerCase()) != -1
}); });
console.log("filter", this.previewCommunities.length)
if (this.previewCommunities.slice((this.page - 1) * this.rowsOnPage, this.page * this.rowsOnPage).length == 0) { if (this.previewCommunities.slice((this.page - 1) * this.rowsOnPage, this.page * this.rowsOnPage).length == 0) {
this.page = 1; this.page = 1;
} }
console.log("filter - slice", this.previewCommunities.length)
this.cdr.detectChanges(); this.cdr.detectChanges();
} }

View File

@ -37,7 +37,7 @@ export class ZenodoCommunitiesComponent implements OnInit, OnDestroy {
masterZenodoCommunity = null; masterZenodoCommunity = null;
public properties: EnvProperties = null; public properties: EnvProperties = null;
selectedCommunityIds = null; selectedCommunityIds = null;
selectedCommunities = []; selectedCommunities = null;
zenodocommunitiesloadedCount = 0; zenodocommunitiesloadedCount = 0;
zenodoSearchUtils: SearchUtilsClass = new SearchUtilsClass(); zenodoSearchUtils: SearchUtilsClass = new SearchUtilsClass();
public errorCodes: ErrorCodes = new ErrorCodes(); public errorCodes: ErrorCodes = new ErrorCodes();
@ -60,6 +60,7 @@ export class ZenodoCommunitiesComponent implements OnInit, OnDestroy {
this.community = community; this.community = community;
this.title.setTitle(this.community.shortTitle.toUpperCase() + ' | Zenodo Communities'); this.title.setTitle(this.community.shortTitle.toUpperCase() + ' | Zenodo Communities');
this.masterZenodoCommunityId = this.community.zenodoCommunity; this.masterZenodoCommunityId = this.community.zenodoCommunity;
this.selectedCommunities = [];
if (this.masterZenodoCommunityId) { if (this.masterZenodoCommunityId) {
this.subscriptions.push(this._zenodoCommunitieService.getZenodoCommunityById(this.properties, this.subscriptions.push(this._zenodoCommunitieService.getZenodoCommunityById(this.properties,
this.masterZenodoCommunityId).subscribe( this.masterZenodoCommunityId).subscribe(