]> source.dussan.org Git - archiva.git/commitdiff
Moving route to user module
authorMartin Stockhammer <martin_s@apache.org>
Sun, 29 Nov 2020 17:57:56 +0000 (18:57 +0100)
committerMartin Stockhammer <martin_s@apache.org>
Sun, 29 Nov 2020 17:57:56 +0000 (18:57 +0100)
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/app-routing.module.ts
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/user/user-routing.module.ts [new file with mode: 0644]
archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/user/user.module.ts

index 3a7666531e46c65eb613e8cbd68955e1e5d549de..e6fef5e285d73ea07892c74364e56c370a9f241b 100644 (file)
@@ -29,13 +29,8 @@ import {BrowseComponent} from "./modules/repo/browse/browse.component";
 import {UploadComponent} from "./modules/repo/upload/upload.component";
 import {ManageRolesComponent} from "./modules/user/manage-roles/manage-roles.component";
 import {SecurityConfigurationComponent} from "./modules/user/security-configuration/security-configuration.component";
-import {ManageUsersListComponent} from "./modules/user/users/manage-users-list/manage-users-list.component";
-import {ManageUsersAddComponent} from "./modules/user/users/manage-users-add/manage-users-add.component";
-import {ManageUsersEditComponent} from "./modules/user/users/manage-users-edit/manage-users-edit.component";
 import {RoutingGuardService as Guard} from "./services/routing-guard.service";
-import {ManageUsersDeleteComponent} from "./modules/user/users/manage-users-delete/manage-users-delete.component";
 import {UserModule} from "./modules/user/user.module";
-import { ManageUsersComponent } from './modules/user/users/manage-users/manage-users.component';
 
 /**
  * You can use Guard (RoutingGuardService) for permission checking. The service needs data with one parameter 'perm',
@@ -50,19 +45,10 @@ const routes: Routes = [
     {path:'repo/upload', component: UploadComponent},
     {path:'', redirectTo:'repo/search', pathMatch:'full'},
   ]},
+  { path: 'users', loadChildren: () => import('./modules/user/user.module').then(m => m.UserModule)
+  },
   { path: 'user', component: HomeComponent,canActivate:[Guard],data:{perm: 'menu.user.section'},
     children: [
-      { path: 'users', component: ManageUsersComponent,canActivate:[Guard],
-        data: { perm: 'menu.user.manage' },
-        children: [
-          {path: 'list', component: ManageUsersListComponent},
-          {path: 'add', component: ManageUsersAddComponent},
-          {path: 'edit/:userid', component: ManageUsersEditComponent},
-          {path: 'edit', redirectTo:'edit/guest' },
-          {path: 'delete/:userid', component: ManageUsersDeleteComponent},
-          {path: '', redirectTo:'list', pathMatch:'full'}
-        ]
-      },
       { path: 'roles', component: ManageRolesComponent },
       { path: 'config', component: SecurityConfigurationComponent},
     ]
@@ -72,10 +58,16 @@ const routes: Routes = [
   { path: 'login', component: LoginComponent },
   { path: 'logout', component: HomeComponent },
   { path: '**', component: NotFoundComponent }
+  ,
+  {
+    path: '',
+    redirectTo: '',
+    pathMatch: 'full'
+  }
 ];
 
 @NgModule({
-  imports: [RouterModule.forRoot(routes)],
+  imports: [RouterModule.forRoot(routes), UserModule],
   exports: [RouterModule],
   declarations: []
 })
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/user/user-routing.module.ts b/archiva-modules/archiva-web/archiva-webapp/src/main/archiva-web/src/app/modules/user/user-routing.module.ts
new file mode 100644 (file)
index 0000000..eaada2d
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+import { ManageUsersComponent } from './users/manage-users/manage-users.component';
+import { ManageUsersListComponent } from './users/manage-users-list/manage-users-list.component';
+import { ManageUsersAddComponent } from './users/manage-users-add/manage-users-add.component';
+import { ManageUsersEditComponent } from './users/manage-users-edit/manage-users-edit.component';
+import { ManageUsersDeleteComponent } from './users/manage-users-delete/manage-users-delete.component';
+
+
+/**
+ * You can use Guard (RoutingGuardService) for permission checking. The service needs data with one parameter 'perm',
+ * that gives the path of the uiPermission map of the user service.
+ */
+
+const routes: Routes = [
+      { path: 'users', component: ManageUsersComponent,
+        data: { perm: 'menu.user.manage' },
+        children: [
+          {path: 'list', component: ManageUsersListComponent},
+          {path: 'add', component: ManageUsersAddComponent},
+          {path: 'edit/:userid', component: ManageUsersEditComponent},
+          {path: 'edit', redirectTo:'edit/guest' },
+          {path: 'delete/:userid', component: ManageUsersDeleteComponent},
+        ]
+      }
+];
+
+@NgModule({
+  imports: [RouterModule.forChild(routes)],
+  exports: [RouterModule],
+  declarations: []
+})
+export class UserRoutingModule { }
+
index 1e9cc5197612f22976d4ae64633b8651b4876a84..5757b3d9ea481fa97ad343d69d57f0409a620aa8 100644 (file)
  * under the License.
  */
 
-import { NgModule } from '@angular/core';
-import { CommonModule } from '@angular/common';
+import {NgModule} from '@angular/core';
+import {CommonModule} from '@angular/common';
 import {ManageUsersComponent} from "./users/manage-users/manage-users.component";
 import {ManageUsersListComponent} from "./users/manage-users-list/manage-users-list.component";
 import {ManageUsersAddComponent} from "./users/manage-users-add/manage-users-add.component";
 import {ManageUsersEditComponent} from "./users/manage-users-edit/manage-users-edit.component";
 import {SharedModule} from "../shared/shared.module";
 import {FormsModule, ReactiveFormsModule} from "@angular/forms";
-import { ManageUsersDeleteComponent } from './users/manage-users-delete/manage-users-delete.component';
-
+import {ManageUsersDeleteComponent} from './users/manage-users-delete/manage-users-delete.component';
+import {UserRoutingModule} from "./user-routing.module";
 
 
 @NgModule({
-  declarations: [
-      ManageUsersComponent,
-      ManageUsersListComponent,
-      ManageUsersAddComponent,
-      ManageUsersEditComponent,
-      ManageUsersDeleteComponent
-  ],
-  exports: [
-    ManageUsersComponent,
-    ManageUsersListComponent,
-    ManageUsersAddComponent,
-    ManageUsersEditComponent
-  ],
-  imports: [
-    CommonModule,
-    SharedModule,
-      FormsModule,
-      ReactiveFormsModule
-  ]
+    declarations: [
+        ManageUsersComponent,
+        ManageUsersListComponent,
+        ManageUsersAddComponent,
+        ManageUsersEditComponent,
+        ManageUsersDeleteComponent
+    ],
+    exports: [
+        ManageUsersComponent,
+        ManageUsersListComponent,
+        ManageUsersAddComponent,
+        ManageUsersEditComponent
+    ],
+    imports: [
+        CommonModule,
+        UserRoutingModule,
+        SharedModule,
+        FormsModule,
+        ReactiveFormsModule
+    ]
 })
-export class UserModule { }
+export class UserModule {
+}