From 31e217dc7f03372ef33bf95324e0fb96a30e45f4 Mon Sep 17 00:00:00 2001 From: argirok Date: Fri, 30 Aug 2024 10:13:14 +0300 Subject: [PATCH] [develop | DONE | CHANGED ] Change the sidebar menu divide menu items to community profile and content config --- src/app/app.component.ts | 20 +++++++++++-------- .../community-info-routing.module.ts | 7 +------ src/app/pages/community-routing.module.ts | 4 ++++ ...community-content-config-routing.module.ts | 19 ++++++++++++++++++ 4 files changed, 36 insertions(+), 14 deletions(-) create mode 100644 src/app/pages/content-config/community-content-config-routing.module.ts diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 93a6fa2..4c5ce08 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -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'})); diff --git a/src/app/pages/community-info/community-info-routing.module.ts b/src/app/pages/community-info/community-info-routing.module.ts index 6ed33a6..4e03349 100644 --- a/src/app/pages/community-info/community-info-routing.module.ts +++ b/src/app/pages/community-info/community-info-routing.module.ts @@ -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] diff --git a/src/app/pages/community-routing.module.ts b/src/app/pages/community-routing.module.ts index c8fec18..704cea8 100644 --- a/src/app/pages/community-routing.module.ts +++ b/src/app/pages/community-routing.module.ts @@ -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) diff --git a/src/app/pages/content-config/community-content-config-routing.module.ts b/src/app/pages/content-config/community-content-config-routing.module.ts new file mode 100644 index 0000000..3595c38 --- /dev/null +++ b/src/app/pages/content-config/community-content-config-routing.module.ts @@ -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 { +}