[develop | DONE | CHANGED ] Change the sidebar menu divide menu items to community profile and content config

This commit is contained in:
argirok 2024-08-30 10:13:14 +03:00
parent 378ea26f83
commit 31e217dc7f
4 changed files with 36 additions and 14 deletions

View File

@ -220,19 +220,23 @@ export class AppComponent implements OnInit {
position: 'left',
badge: true
};
let communityInfo = new MenuItem("community", "Community Info", "", "/" + this.community.communityId, false, [], [], {}, {name: 'badge'}, null, null, "/" + this.community.communityId + "/info");
let communityInfo = new MenuItem("communityInfo", "Community Info", "", "/" + this.community.communityId, false, [], [], {}, {name: 'badge'}, null, null, "/" + this.community.communityId + "/info");
communityInfo.items = [
new MenuItem("profile", "Profile", "", "/" + this.community.communityId + "/info/profile", false, [], [], {}, null, null, null, "/" + this.community.communityId + "/info/profile"),
new MenuItem("organizations", "Organizations", "", "/" + this.community.communityId + "/info/organizations", false, [], [], {}, null, null, null, "/" + this.community.communityId + "/info/organizations"),
new MenuItem("projects", OpenaireEntities.PROJECTS, "", "/" + this.community.communityId + "/info/projects", false, [], [], {}, null, null, null, "/" + this.community.communityId + "/info/projects"),
new MenuItem("content-providers", OpenaireEntities.DATASOURCES, "", "/" + this.community.communityId + "/info/content-providers", false, [], [], {}, null, null, null, "/" + this.community.communityId + "/info/content-providers"),
new MenuItem("zenodo-communities", "Zenodo Communities ", "", "/" + this.community.communityId + "/info/zenodo-communities", false, [], [], {}, null, null, null, "/" + this.community.communityId + "/info/zenodo-communities"),
new MenuItem("advanced-criteria", "Advanced Criteria", "", "/" + this.community.communityId + "/info/advanced-criteria", false, [], [], {}, null, null, null, "/" + this.community.communityId + "/info/advanced-criteria")
new MenuItem("organizations", "Organizations", "", "/" + this.community.communityId + "/info/organizations", false, [], [], {}, null, null, null, "/" + this.community.communityId + "/info/organizations")
]
this.sideBarItems.push(communityInfo);
let contentConfiguration = new MenuItem("contentConfiguration", "Content configuration", "", "/" + this.community.communityId +"/config", false, [], [], {}, {name: 'badge'}, null, null, "/" + this.community.communityId + "/config");
contentConfiguration.items = [
new MenuItem("projects", OpenaireEntities.PROJECTS, "", "/" + this.community.communityId + "/config/projects", false, [], [], {}, null, null, null, "/" + this.community.communityId + "/config/projects"),
new MenuItem("content-providers", OpenaireEntities.DATASOURCES, "", "/" + this.community.communityId + "/config/content-providers", false, [], [], {}, null, null, null, "/" + this.community.communityId + "/config/content-providers"),
new MenuItem("zenodo-communities", "Zenodo Communities ", "", "/" + this.community.communityId + "/config/zenodo-communities", false, [], [], {}, null, null, null, "/" + this.community.communityId + "/config/zenodo-communities"),
new MenuItem("advanced-criteria", "Advanced Criteria", "", "/" + this.community.communityId + "/config/advanced-criteria", false, [], [], {}, null, null, null, "/" + this.community.communityId + "/config/advanced-criteria")
]
if(this.community.type === 'community') {
communityInfo.items.splice(4, 0, new MenuItem("subjects", "Subjects", "", "/" + this.community.communityId + "/info/subjects", false, [], [], {}, null, null, null, "/" + this.community.communityId + "/info/subjects"))
contentConfiguration.items.splice(2, 0, new MenuItem("subjects", "Subjects", "", "/" + this.community.communityId + "/config/subjects", false, [], [], {}, null, null, null, "/" + this.community.communityId + "/config/subjects"))
}
this.sideBarItems.push(communityInfo);
this.sideBarItems.push(contentConfiguration);
this.sideBarItems.push(new MenuItem("users", "Users", "", "/" + this.community.communityId + "/users", false, [], [], {}, {name: 'group'}, null, null, "/" + this.community.communityId + "/users"));
this.sideBarItems.push(new MenuItem("admin-tools", "Pages & Menus", "", "/" + this.community.communityId + "/admin-tools/pages", false, [], [], {}, {name: 'description'}, null, null, "/" + this.community.communityId + "/admin-tools"));
this.sideBarItems.push(new MenuItem("customization", "Customization", "", "/" + this.community.communityId + "/customize-layout", false, [], [], {}, {name: 'brush'}));

View File

@ -7,12 +7,7 @@ import {ConnectCommunityGuard} from "../../openaireLibrary/connect/communityGuar
RouterModule.forChild([
{path: '', redirectTo: 'profile', pathMatch: 'full'},
{path: 'profile', loadChildren: () => import('./profile/profile.module').then(m => m.ProfileModule)},
{path: 'organizations', loadChildren: () => import('../affiliations/affiliations.module').then(m => m.AffiliationsModule)},
{path: 'projects', loadChildren: () => import('../projects/communityProjects.module').then(m => m.CommunityProjectsModule)},
{path: 'content-providers', loadChildren: () => import('../content-providers/communityContentProviders.module').then(m => m.CommunityContentProvidersModule)},
{path: 'zenodo-communities', loadChildren: () => import('../zenodo-communities/zenodo-communities.module').then(m => m.ZenodoCommunitiesModule)},
{path: 'advanced-criteria', loadChildren: () => import('../advanced-criteria/advanced-criteria.module').then(m => m.AdvancedCriteriaModule)},
{path: 'subjects', canActivateChild: [ConnectCommunityGuard], loadChildren: () => import('../subjects/subjects-edit-form/subjects-edit-form.module').then(m => m.SubjectsEditFormModule)},
{path: 'organizations', loadChildren: () => import('../affiliations/affiliations.module').then(m => m.AffiliationsModule)}
])
],
providers: [ConnectCommunityGuard]

View File

@ -8,6 +8,10 @@ import {ConnectRIGuard} from "../openaireLibrary/connect/communityGuard/connectR
path: 'info',
loadChildren: () => import('./community-info/community-info-routing.module').then(m => m.CommunityInfoRoutingModule),
},
{
path: 'config',
loadChildren: () => import('./content-config/community-content-config-routing.module').then(m => m.CommunityContentConfigRoutingModule),
},
{
path: 'users',
loadChildren: () => import('./users/users-routing.module').then(m => m.UsersRoutingModule)

View File

@ -0,0 +1,19 @@
import {NgModule} from '@angular/core';
import {RouterModule} from '@angular/router';
import {ConnectCommunityGuard} from "../../openaireLibrary/connect/communityGuard/connectCommunityGuard.guard";
@NgModule({
imports: [
RouterModule.forChild([
{path: '', redirectTo: 'projects', pathMatch: 'full'},
{path: 'projects', loadChildren: () => import('../projects/communityProjects.module').then(m => m.CommunityProjectsModule)},
{path: 'content-providers', loadChildren: () => import('../content-providers/communityContentProviders.module').then(m => m.CommunityContentProvidersModule)},
{path: 'zenodo-communities', loadChildren: () => import('../zenodo-communities/zenodo-communities.module').then(m => m.ZenodoCommunitiesModule)},
{path: 'advanced-criteria', loadChildren: () => import('../advanced-criteria/advanced-criteria.module').then(m => m.AdvancedCriteriaModule)},
{path: 'subjects', canActivateChild: [ConnectCommunityGuard], loadChildren: () => import('../subjects/subjects-edit-form/subjects-edit-form.module').then(m => m.SubjectsEditFormModule)}
])
],
providers: [ConnectCommunityGuard]
})
export class CommunityContentConfigRoutingModule {
}