[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 <navbar> 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().
This commit is contained in:
Konstantina Galouni 2022-07-01 11:27:47 +03:00
parent ffd997dfcb
commit 0839b6df60
2 changed files with 5 additions and 2 deletions

View File

@ -56,6 +56,7 @@ export class CommunityService {
async getCommunityAsync() {
await this.promise;
this.clearSubscriptions();
return this.community.getValue();
}

View File

@ -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++) {