[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 cf95075ae4
commit 1e71eafa45
7 changed files with 77 additions and 14 deletions

View File

@ -4,8 +4,9 @@
<div *ngIf="loading == false">
<div class="sidebar_main_swipe" [class.sidebar_main_active]="open && hasSidebar" [class.sidebar_mini]="!open && hasSidebar">
<div id="modal-container"></div>
<navbar *ngIf="hasHeader" portal="connect-admin" [header]="menuHeader"
[userMenuItems]=userMenuItems [menuItems]="menuItems" [user]="user" [offCanvasFlip]="true"></navbar>
<navbar *ngIf="hasHeader" portal="connect-admin" [header]="menuHeader" [communityId]="community ? community.communityId : null"
[userMenuItems]=userMenuItems [menuItems]="menuItems" [user]="user" [offCanvasFlip]="true"
[detectCommunityIdChanges]="true"></navbar>
<div>
<dashboard-sidebar *ngIf="hasSidebar" [headerUrl]="headerUrl" [items]="sideBarItems" [headerLogoUrl]="headerLogoUrl" [specialMenuItem]="specialSideBarMenuItem"></dashboard-sidebar>
<main>

View File

@ -14,6 +14,7 @@ import {SmoothScroll} from "./openaireLibrary/utils/smooth-scroll";
import {ConnectHelper} from './openaireLibrary/connect/connectHelper';
import {ConfigurationService} from './openaireLibrary/utils/configuration/configuration.service';
import {StringUtils} from "./openaireLibrary/utils/string-utils.class";
import {OpenaireEntities} from "./openaireLibrary/utils/properties/searchFields";
@Component({
selector: 'app-root',
@ -50,7 +51,7 @@ export class AppComponent implements OnInit {
private subscriptions: any[] = [];
headerLogoUrl: string;
headerUrl: string;
constructor(private route: ActivatedRoute,
private communityService: CommunityService,
private router: Router,
@ -192,7 +193,11 @@ export class AppComponent implements OnInit {
this.userMenuItems.push(new MenuItem("exploreOptions", "Explore portal options", "", "/openaire/admin-tools/pages", false, [], [], {}));
}
this.userMenuItems.push(new MenuItem("", "User information", "", "/user-info", false, [], [], {}));
if (this.community) {
this.userMenuItems.push(new MenuItem("", "User information", "", "/"+this.community.communityId+"/user-info", false, [], [], {}));
} else {
this.userMenuItems.push(new MenuItem("", "User information", "", "/user-info", false, [], [], {}));
}
}
if (this.community) {
this.headerLogoUrl = StringUtils.getLogoUrl(this.community);
@ -200,10 +205,10 @@ export class AppComponent implements OnInit {
this.menuHeader = {
route: "/" + this.community.communityId,
url: null,
title: 'Admin - ' + this.community.shortTitle,
logoUrl: null,
logoSmallUrl: null,
position: 'center',
title: this.community.shortTitle,
logoUrl: this.headerLogoUrl,
logoSmallUrl: this.headerLogoUrl,
position: 'left',
badge: false,
stickyAnimation: false
};
@ -215,13 +220,63 @@ export class AppComponent implements OnInit {
this.sideBarItems.push(new MenuItem("mining", "Mining", "", "/" + this.community.communityId + "/mining/manage-profiles", false, [], [], {}, null, null, null, "/" + this.community.communityId + "/mining"));
}
this.specialSideBarMenuItem = new MenuItem("back", "Manage communities", "", "/", false, [], null, {}, {name: 'search', class: 'uk-text-secondary'});
this.menuItems = [];
this.menuItems.push({
rootItem: new MenuItem("dashboard", "Dashboard",
"https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/", "", false, [], null, null
, null, null, null, null, "_self"), items: []
});
this.menuItems.push({
rootItem: new MenuItem("deposit", "Deposit", "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/participate/participate/deposit/learn-how", "", false, [], ['/participate/deposit/learn-how'], null, null, null, null, null, "_self"),
items: []
});
this.menuItems.push(
{
rootItem: new MenuItem("link", "Link", "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/participate/claim", "", false, [], ['/participate/claim'], null, null, null, null, null, "_self"),
items: [
new MenuItem("", "Start linking", "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/participate/claim", "", false, [], ['/participate/claim'], null, null, null, null, null, "_self"),
new MenuItem("", "Learn more", this.properties.claimsInformationLink, "", false, [], [], null),
]
});
this.menuItems.push(
{
rootItem: new MenuItem("search", "Search", "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/search/find", "", false, [], ["/search/find"], null, null, null, null, null, "_self"),
items: [
new MenuItem("", OpenaireEntities.RESULTS, "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/search/find/research-outcomes?resultbestaccessright=\"" + encodeURIComponent("Open Access") + '"', "", false, [], ["/search/find/research-outcomes"], null, null, null, null, null, "_self"),
new MenuItem("", OpenaireEntities.PROJECTS, "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/search/find/projects", "", false, [], ["/search/find/projects"], null, null, null, null, null, "_self"),
new MenuItem("", OpenaireEntities.DATASOURCES, "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/search/find/dataproviders", "", false, [], ["/search/find/dataproviders"], null, null, null, null, null, "_self")
]
});
this.menuItems.push(
{
rootItem: new MenuItem("about", "About", "", "", false, [], [], {}),
items: [
new MenuItem("", "Supporting organizations", "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/organizations", "", false, [], ["/organizations"], null, null, null, null, null, "_self"),
new MenuItem("", "Curators", "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/curators", "", false, [], ["/organizations"], null, null, null, null, null, "_self"),
new MenuItem("", "Sources and methodology", "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/content", "", false, [], ["/content"], null, null, null, null, null, "_self"),
new MenuItem("", "National Bulletins", "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/national-bulletins", "", false, [], ["/national-bulletins"], null, null, null, null, null, "_self"),
new MenuItem("", "Subjects", "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/subjects", "", false, [], ["/subjects"], null, null, null, null, null, "_self"),
new MenuItem("", "Projects and funding Opportunities", "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/projects", "", false, [], ["/projects"], null, null, null, null, null, "_self")
]
});
// if (this.isManager) {
this.menuItems.push(
{
// rootItem: new MenuItem("manage", "Manage", "", "/"+this.community.communityId, false, [], [], {}),
// items: []
rootItem: new MenuItem("manage", "Manage",
"", "/"+this.community.communityId, false, [], null, {}
, null, null, null, "/"+this.community.communityId), items: []
});
// }
} else {
this.headerLogoUrl = null;
this.headerUrl = 'https://' + ((properties.environment !== 'production')?'beta.':'') + 'connect.openaire.eu';
this.menuHeader = {
route: null,
url: null,
title: 'Admin - Research Community Dashboard',
title: 'Research Community Dashboard',
logoUrl: null,
logoSmallUrl: null,
position: 'center',

View File

@ -20,7 +20,7 @@ const routes: Routes = [
{
path: 'user-info',
loadChildren: () => import('./login/libUser.module').then(m => m.LibUserModule),
data: {hasSidebar: false}
data: {hasSidebar: true}
},
{ path: 'error',
pathMatch: 'full',

View File

@ -31,7 +31,11 @@ import {ConnectRIGuard} from "../openaireLibrary/connect/communityGuard/connectR
{
path: 'customize-layout',
loadChildren: () => import('./customization/customization.module').then(m => m.CustomizationModule),
}
},
{
path: 'user-info',
loadChildren: () => import('../login/libUser.module').then(m => m.LibUserModule),
},
])]
})
export class CommunityRoutingModule {}

View File

@ -85,5 +85,6 @@ export let properties: EnvProperties = {
lastIndexUpdate: "2020-05-06",
indexInfoAPI: "https://beta.services.openaire.eu/openaire/info/",
admins: ["rcd@openaire.eu"],
adminPortalURL: "https://beta.admin.connect.openaire.eu"
adminPortalURL: "https://beta.admin.connect.openaire.eu",
errorLink: '/error'
};

View File

@ -85,5 +85,6 @@ export let properties: EnvProperties = {
lastIndexUpdate: "2020-12-17",
indexInfoAPI: "https://services.openaire.eu/openaire/info/",
admins: ["rcd@openaire.eu"],
adminPortalURL: "https://admin.connect.openaire.eu"
adminPortalURL: "https://admin.connect.openaire.eu",
errorLink: '/error'
};

View File

@ -90,5 +90,6 @@ export let properties: EnvProperties = {
lastIndexUpdate: '2019-05-16',
indexInfoAPI: 'http://beta.services.openaire.eu/openaire/info/',
admins: ['kostis30fylloy@gmail.com'],
adminPortalURL: 'https://beta.admin.connect.openaire.eu'
adminPortalURL: 'https://beta.admin.connect.openaire.eu',
errorLink: '/error'
};