From 0839b6df609314fcc7bfd8a58e0363125a73f0aa Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Fri, 1 Jul 2022 11:27:47 +0300 Subject: [PATCH] [Connect Admin | Library | new-theme]: Match menu for communities in admin & dashboard | Added missing property "adminPortalURL". 1. environments/: [Bug fix] Added missing property "adminPortalURL". 2. community-routing.module.ts: Added "user-info" path for each community. 3. app.routing.ts: Set "hasSidebar" to true for "user-info" path. 4. app.component.ts: a. Set "user-info" path in userMenuItems under community if any selected. b. In menuHeader for community set logoUrl and logoSmallUrl to headerLogoUrl (community logo). c. When community is selected, added in menu all items of dashboard too (menu same in admin and dashboard). 5. app.component.html: In added input parameter "communityId". 6. navigationBar.component.ts: On "initialize()" method, clear "showEntity" and "showPage" fields before filling them again and subscribe to communityInformationState if there is a community and adminToolsAPIURL OR if adminToolsPortalType is community (admin & dashboard). 7. community.service.ts: On getCommunityAsync() method, after await call clearSubscriptions(). --- connect/community/community.service.ts | 1 + sharedComponents/navigationBar.component.ts | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/connect/community/community.service.ts b/connect/community/community.service.ts index 3d328f2f..d3f60084 100644 --- a/connect/community/community.service.ts +++ b/connect/community/community.service.ts @@ -56,6 +56,7 @@ export class CommunityService { async getCommunityAsync() { await this.promise; + this.clearSubscriptions(); return this.community.getValue(); } diff --git a/sharedComponents/navigationBar.component.ts b/sharedComponents/navigationBar.component.ts index 5f7c8bff..06dc9d15 100644 --- a/sharedComponents/navigationBar.component.ts +++ b/sharedComponents/navigationBar.component.ts @@ -1,4 +1,4 @@ -import {Component, Input, OnDestroy, OnInit, ViewChild} from '@angular/core'; +import {Component, Input, OnDestroy, OnInit} from '@angular/core'; import {ActivatedRoute, Router} from '@angular/router'; import {Session, User} from '../login/utils/helper.class'; import {ConfigurationService} from '../utils/configuration/configuration.service'; @@ -91,10 +91,12 @@ export class NavigationBarComponent implements OnInit, OnDestroy { }; } this.isAuthorized = Session.isClaimsCurator(this.user) || Session.isPortalAdministrator(this.user); - if (this.properties.adminToolsAPIURL && this.communityId) { + if ((this.properties.adminToolsAPIURL && this.communityId) || properties.adminToolsPortalType == "community") { //this.config.getCommunityInformation(this.properties, this.communityId).subscribe(data => { this.subs.push(this.config.communityInformationState.subscribe(data => { if (data) { + this.showEntity = {}; + this.showPage = {}; if (data['entities']) { for (let i = 0; i < data['entities'].length; i++) {