[Library |Trunk]

dashboard - admin-tools:
- add checks for main portals explore, connect +   monitor and put the proper portal type




git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@60532 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2021-03-01 17:27:45 +00:00
parent 57d4983341
commit 61a50fbf69
5 changed files with 15 additions and 6 deletions

View File

@ -90,7 +90,7 @@ export class CommunityService {
/*.map(res => res.json())*/
}
private parseCommunity(data: any): CommunityInfo {
public parseCommunity(data: any): CommunityInfo {
const resData = Array.isArray(data) ? data[0] : data;

View File

@ -37,6 +37,8 @@ export class ConnectHelper {
properties.adminToolsPortalType = "explore";
} else if(pid == "connect") {
properties.adminToolsPortalType = "connect";
} else if(pid == "monitor") {
properties.adminToolsPortalType = "monitor";
} else {
properties.adminToolsPortalType = "community";
}

View File

@ -74,7 +74,7 @@ export class EntitiesComponent implements OnInit {
}));
this.userManagementService.getUserInfo().subscribe(user => {
this.portal = (this.route.snapshot.data.portal) ? this.route.snapshot.data.portal : this.route.snapshot.params[this.route.snapshot.data.param];
if(this.portal === 'connect' || this.portal === 'explore') {
if(this.portal === 'connect' || this.portal === 'openaire' || this.portal === 'monitor') {
ConnectHelper.setPortalTypeFromPid(this.portal);
}
this.applyPortalFilter(this.portal);

View File

@ -17,6 +17,7 @@ import {Subscriber} from "rxjs";
import {properties} from "../../../../environments/environment";
import {DomSanitizer} from '@angular/platform-browser';
import {SearchInputComponent} from '../../sharedComponents/search-input/search-input.component';
import {ConnectHelper} from '../../connect/connectHelper';
@Component({
@ -78,6 +79,12 @@ export class PageHelpContentsComponent implements OnInit {
this.properties = properties;
this.subscriptions.push(this.route.params.subscribe(params => {
this.selectedCommunityPid = params['community'];
if(!this.selectedCommunityPid) {
this.selectedCommunityPid = (this.route.snapshot.data.portal) ? this.route.snapshot.data.portal : this.route.snapshot.params[this.route.snapshot.data.param];
if (this.selectedCommunityPid === 'connect' || this.selectedCommunityPid === 'openaire' || this.selectedCommunityPid === 'monitor') {
ConnectHelper.setPortalTypeFromPid(this.selectedCommunityPid);
}
}
this.subscriptions.push(this.route.queryParams.subscribe(params => {
HelperFunctions.scroll();
this.selectedPageId = params['pageId'];
@ -89,8 +96,6 @@ export class PageHelpContentsComponent implements OnInit {
}
}));
}));
// this.myForm = this.formComponent.form;
}
constructor(private element: ElementRef, private route: ActivatedRoute, private router: Router, private _helpService: HelpContentService, private _fb: FormBuilder, private sanitizer: DomSanitizer) {

View File

@ -91,7 +91,7 @@ export class PagesComponent implements OnInit {
this.filterForm.get('type').setValue(params['type']);
}
this.portal = (this.route.snapshot.data.portal) ? this.route.snapshot.data.portal : this.route.snapshot.params[this.route.snapshot.data.param];
if (this.portal === 'connect' || this.portal === 'explore') {
if (this.portal === 'connect' || this.portal === 'openaire' || this.portal === 'monitor') {
ConnectHelper.setPortalTypeFromPid(this.portal);
}
this.keyword = '';
@ -111,7 +111,9 @@ export class PagesComponent implements OnInit {
});
},
error => this.handleError('System error retrieving pages', error)));
this.getPageHelpContents(this.portal);
if(this.portal) {
this.getPageHelpContents(this.portal);
}
}