diff --git a/console/src/app/app-routing.module.ts b/console/src/app/app-routing.module.ts index 2efb7bfd57..5eb260c94f 100644 --- a/console/src/app/app-routing.module.ts +++ b/console/src/app/app-routing.module.ts @@ -4,154 +4,157 @@ import { QuicklinkStrategy } from 'ngx-quicklink'; import { AuthGuard } from './guards/auth.guard'; import { RoleGuard } from './guards/role.guard'; +import { OrgCreateComponent } from './pages/org-create/org-create.component'; const routes: Routes = [ - { - path: '', - loadChildren: () => import('./pages/home/home.module').then(m => m.HomeModule), - canActivate: [AuthGuard], - }, - { - path: 'firststeps', - loadChildren: () => import('./modules/onboarding/onboarding.module') - .then(m => m.OnboardingModule), - canActivate: [AuthGuard, RoleGuard], - data: { - roles: ['iam.write'], - }, - }, - { - path: 'granted-projects', - loadChildren: () => import('./pages/projects/granted-projects/granted-projects.module') - .then(m => m.GrantedProjectsModule), - canActivate: [AuthGuard, RoleGuard], - data: { - roles: ['project.grant.read'], - }, - }, - { - path: 'projects', - loadChildren: () => import('./pages/projects/owned-projects/owned-projects.module') - .then(m => m.OwnedProjectsModule), - canActivate: [AuthGuard, RoleGuard], - data: { - roles: ['project.read'], - }, - }, - { - path: 'users', - canActivate: [AuthGuard], - children: [ - { - path: 'list', - loadChildren: () => import('src/app/pages/users/user-list/user-list.module') - .then(m => m.UserListModule), - canActivate: [RoleGuard], - data: { - roles: ['user.read'], - }, - }, - { - path: '', - loadChildren: () => import('src/app/pages/users/user-detail/user-detail.module') - .then(m => m.UserDetailModule), - }, - ], - }, - { - path: 'iam', - loadChildren: () => import('./pages/iam/iam.module').then(m => m.IamModule), - canActivate: [AuthGuard, RoleGuard], - data: { - roles: ['iam.read', 'iam.write'], - }, - }, - { - path: 'org', - loadChildren: () => import('./pages/orgs/orgs.module').then(m => m.OrgsModule), - canActivate: [AuthGuard, RoleGuard], - data: { - roles: ['org.read'], - }, - }, - { - path: 'actions', - loadChildren: () => import('./pages/actions/actions.module').then(m => m.ActionsModule), - canActivate: [AuthGuard, RoleGuard], - data: { - roles: ['org.read'], - }, + { + path: '', + loadChildren: () => import('./pages/home/home.module').then((m) => m.HomeModule), + canActivate: [AuthGuard], }, - { - path: 'grants', - loadChildren: () => import('./pages/grants/grants.module').then(m => m.GrantsModule), - canActivate: [AuthGuard, RoleGuard], + { + path: 'firststeps', + loadChildren: () => import('./modules/onboarding/onboarding.module').then((m) => m.OnboardingModule), + canActivate: [AuthGuard, RoleGuard], + data: { + roles: ['iam.write'], + }, + }, + { + path: 'granted-projects', + loadChildren: () => + import('./pages/projects/granted-projects/granted-projects.module').then((m) => m.GrantedProjectsModule), + canActivate: [AuthGuard, RoleGuard], + data: { + roles: ['project.grant.read'], + }, + }, + { + path: 'projects', + loadChildren: () => import('./pages/projects/owned-projects/owned-projects.module').then((m) => m.OwnedProjectsModule), + canActivate: [AuthGuard, RoleGuard], + data: { + roles: ['project.read'], + }, + }, + { + path: 'users', + canActivate: [AuthGuard], + children: [ + { + path: 'list', + loadChildren: () => import('src/app/pages/users/user-list/user-list.module').then((m) => m.UserListModule), + canActivate: [RoleGuard], data: { - roles: ['user.grant.read'], + roles: ['user.read'], }, + }, + { + path: '', + loadChildren: () => import('src/app/pages/users/user-detail/user-detail.module').then((m) => m.UserDetailModule), + }, + ], + }, + { + path: 'iam', + loadChildren: () => import('./pages/iam/iam.module').then((m) => m.IamModule), + canActivate: [AuthGuard, RoleGuard], + data: { + roles: ['iam.read', 'iam.write'], }, - { - path: 'grant-create', - canActivate: [AuthGuard], - children: [ - { - path: 'project/:projectid/grant/:grantid', - loadChildren: () => import('src/app/pages/user-grant-create/user-grant-create.module') - .then(m => m.UserGrantCreateModule), - canActivate: [RoleGuard], - data: { - roles: ['user.grant.write'], - }, - }, - { - path: 'project/:projectid', - loadChildren: () => import('src/app/pages/user-grant-create/user-grant-create.module') - .then(m => m.UserGrantCreateModule), - canActivate: [RoleGuard], - data: { - roles: ['user.grant.write'], - }, - }, - { - path: 'user/:userid', - loadChildren: () => import('src/app/pages/user-grant-create/user-grant-create.module') - .then(m => m.UserGrantCreateModule), - canActivate: [RoleGuard], - data: { - roles: ['user.grant.write'], - }, - }, - { - path: '', - loadChildren: () => import('src/app/pages/user-grant-create/user-grant-create.module') - .then(m => m.UserGrantCreateModule), - canActivate: [RoleGuard], - data: { - roles: ['user.grant.write'], - }, - }, - ], + }, + { + path: 'org', + loadChildren: () => import('./pages/orgs/orgs.module').then((m) => m.OrgsModule), + canActivate: [AuthGuard, RoleGuard], + data: { + roles: ['org.read'], }, - { - path: 'signedout', - loadChildren: () => import('./pages/signedout/signedout.module').then(m => m.SignedoutModule), + }, + { + path: 'org/create', + component: OrgCreateComponent, + canActivate: [RoleGuard], + data: { + roles: ['(org.create)?(iam.write)?'], }, - { - path: '**', - redirectTo: '/', + loadChildren: () => import('./pages/org-create/org-create.module').then((m) => m.OrgCreateModule), + }, + { + path: 'actions', + loadChildren: () => import('./pages/actions/actions.module').then((m) => m.ActionsModule), + canActivate: [AuthGuard, RoleGuard], + data: { + roles: ['org.read'], }, + }, + { + path: 'grants', + loadChildren: () => import('./pages/grants/grants.module').then((m) => m.GrantsModule), + canActivate: [AuthGuard, RoleGuard], + data: { + roles: ['user.grant.read'], + }, + }, + { + path: 'grant-create', + canActivate: [AuthGuard], + children: [ + { + path: 'project/:projectid/grant/:grantid', + loadChildren: () => + import('src/app/pages/user-grant-create/user-grant-create.module').then((m) => m.UserGrantCreateModule), + canActivate: [RoleGuard], + data: { + roles: ['user.grant.write'], + }, + }, + { + path: 'project/:projectid', + loadChildren: () => + import('src/app/pages/user-grant-create/user-grant-create.module').then((m) => m.UserGrantCreateModule), + canActivate: [RoleGuard], + data: { + roles: ['user.grant.write'], + }, + }, + { + path: 'user/:userid', + loadChildren: () => + import('src/app/pages/user-grant-create/user-grant-create.module').then((m) => m.UserGrantCreateModule), + canActivate: [RoleGuard], + data: { + roles: ['user.grant.write'], + }, + }, + { + path: '', + loadChildren: () => + import('src/app/pages/user-grant-create/user-grant-create.module').then((m) => m.UserGrantCreateModule), + canActivate: [RoleGuard], + data: { + roles: ['user.grant.write'], + }, + }, + ], + }, + { + path: 'signedout', + loadChildren: () => import('./pages/signedout/signedout.module').then((m) => m.SignedoutModule), + }, + { + path: '**', + redirectTo: '/', + }, ]; @NgModule({ - imports: [ - RouterModule.forRoot( - routes, - { - preloadingStrategy: QuicklinkStrategy, - relativeLinkResolution: 'legacy', - }, - ), - ], - exports: [RouterModule], + imports: [ + RouterModule.forRoot(routes, { + preloadingStrategy: QuicklinkStrategy, + relativeLinkResolution: 'legacy', + }), + ], + exports: [RouterModule], }) -export class AppRoutingModule { } +export class AppRoutingModule {} diff --git a/console/src/app/pages/orgs/org-create/org-create-routing.module.ts b/console/src/app/pages/org-create/org-create-routing.module.ts similarity index 100% rename from console/src/app/pages/orgs/org-create/org-create-routing.module.ts rename to console/src/app/pages/org-create/org-create-routing.module.ts diff --git a/console/src/app/pages/orgs/org-create/org-create.component.html b/console/src/app/pages/org-create/org-create.component.html similarity index 100% rename from console/src/app/pages/orgs/org-create/org-create.component.html rename to console/src/app/pages/org-create/org-create.component.html diff --git a/console/src/app/pages/orgs/org-create/org-create.component.scss b/console/src/app/pages/org-create/org-create.component.scss similarity index 100% rename from console/src/app/pages/orgs/org-create/org-create.component.scss rename to console/src/app/pages/org-create/org-create.component.scss diff --git a/console/src/app/pages/orgs/org-create/org-create.component.spec.ts b/console/src/app/pages/org-create/org-create.component.spec.ts similarity index 100% rename from console/src/app/pages/orgs/org-create/org-create.component.spec.ts rename to console/src/app/pages/org-create/org-create.component.spec.ts diff --git a/console/src/app/pages/orgs/org-create/org-create.component.ts b/console/src/app/pages/org-create/org-create.component.ts similarity index 100% rename from console/src/app/pages/orgs/org-create/org-create.component.ts rename to console/src/app/pages/org-create/org-create.component.ts diff --git a/console/src/app/pages/orgs/org-create/org-create.module.ts b/console/src/app/pages/org-create/org-create.module.ts similarity index 100% rename from console/src/app/pages/orgs/org-create/org-create.module.ts rename to console/src/app/pages/org-create/org-create.module.ts diff --git a/console/src/app/pages/orgs/orgs-routing.module.ts b/console/src/app/pages/orgs/orgs-routing.module.ts index d7ae1e4342..3d27cee32f 100644 --- a/console/src/app/pages/orgs/orgs-routing.module.ts +++ b/console/src/app/pages/orgs/orgs-routing.module.ts @@ -4,25 +4,15 @@ import { RoleGuard } from 'src/app/guards/role.guard'; import { FeatureServiceType } from 'src/app/modules/features/features.component'; import { PolicyComponentServiceType, PolicyComponentType } from 'src/app/modules/policies/policy-component-types.enum'; -import { OrgCreateComponent } from './org-create/org-create.component'; import { OrgDetailComponent } from './org-detail/org-detail.component'; const routes: Routes = [ - { - path: 'create', - component: OrgCreateComponent, - canActivate: [RoleGuard], - data: { - roles: ['(org.create)?(iam.write)?'], - }, - loadChildren: () => import('./org-create/org-create.module').then(m => m.OrgCreateModule), - }, { path: 'idp', children: [ { path: 'create', - loadChildren: () => import('src/app/modules/idp-create/idp-create.module').then(m => m.IdpCreateModule), + loadChildren: () => import('src/app/modules/idp-create/idp-create.module').then((m) => m.IdpCreateModule), canActivate: [RoleGuard], data: { roles: ['org.idp.write'], @@ -31,7 +21,7 @@ const routes: Routes = [ }, { path: ':id', - loadChildren: () => import('src/app/modules/idp/idp.module').then(m => m.IdpModule), + loadChildren: () => import('src/app/modules/idp/idp.module').then((m) => m.IdpModule), canActivate: [RoleGuard], data: { roles: ['org.idp.read'], @@ -42,7 +32,7 @@ const routes: Routes = [ }, { path: 'features', - loadChildren: () => import('src/app/modules/features/features.module').then(m => m.FeaturesModule), + loadChildren: () => import('src/app/modules/features/features.module').then((m) => m.FeaturesModule), canActivate: [RoleGuard], data: { roles: ['features.read'], @@ -57,78 +47,86 @@ const routes: Routes = [ data: { serviceType: PolicyComponentServiceType.MGMT, }, - loadChildren: () => import('src/app/modules/policies/password-age-policy/password-age-policy.module') - .then(m => m.PasswordAgePolicyModule), + loadChildren: () => + import('src/app/modules/policies/password-age-policy/password-age-policy.module').then( + (m) => m.PasswordAgePolicyModule, + ), }, { path: PolicyComponentType.LOCKOUT, data: { serviceType: PolicyComponentServiceType.MGMT, }, - loadChildren: () => import('src/app/modules/policies/password-lockout-policy/password-lockout-policy.module') - .then(m => m.PasswordLockoutPolicyModule), + loadChildren: () => + import('src/app/modules/policies/password-lockout-policy/password-lockout-policy.module').then( + (m) => m.PasswordLockoutPolicyModule, + ), }, { path: PolicyComponentType.PRIVATELABEL, data: { serviceType: PolicyComponentServiceType.MGMT, }, - loadChildren: () => import('src/app/modules/policies/private-labeling-policy/private-labeling-policy.module') - .then(m => m.PrivateLabelingPolicyModule), + loadChildren: () => + import('src/app/modules/policies/private-labeling-policy/private-labeling-policy.module').then( + (m) => m.PrivateLabelingPolicyModule, + ), }, { path: PolicyComponentType.COMPLEXITY, data: { serviceType: PolicyComponentServiceType.MGMT, }, - loadChildren: () => import('src/app/modules/policies/password-complexity-policy/password-complexity-policy.module') - .then(m => m.PasswordComplexityPolicyModule), + loadChildren: () => + import('src/app/modules/policies/password-complexity-policy/password-complexity-policy.module').then( + (m) => m.PasswordComplexityPolicyModule, + ), }, { path: PolicyComponentType.IAM, data: { serviceType: PolicyComponentServiceType.MGMT, }, - loadChildren: () => import('src/app/modules/policies/org-iam-policy/org-iam-policy.module') - .then(m => m.OrgIamPolicyModule), + loadChildren: () => + import('src/app/modules/policies/org-iam-policy/org-iam-policy.module').then((m) => m.OrgIamPolicyModule), }, { path: PolicyComponentType.LOGIN, data: { serviceType: PolicyComponentServiceType.MGMT, }, - loadChildren: () => import('src/app/modules/policies/login-policy/login-policy.module') - .then(m => m.LoginPolicyModule), + loadChildren: () => + import('src/app/modules/policies/login-policy/login-policy.module').then((m) => m.LoginPolicyModule), }, { path: PolicyComponentType.MESSAGETEXTS, data: { serviceType: PolicyComponentServiceType.MGMT, }, - loadChildren: () => import('src/app/modules/policies/message-texts/message-texts.module') - .then(m => m.MessageTextsPolicyModule), + loadChildren: () => + import('src/app/modules/policies/message-texts/message-texts.module').then((m) => m.MessageTextsPolicyModule), }, { path: PolicyComponentType.LOGINTEXTS, data: { serviceType: PolicyComponentServiceType.MGMT, }, - loadChildren: () => import('src/app/modules/policies/login-texts/login-texts.module') - .then(m => m.LoginTextsPolicyModule), + loadChildren: () => + import('src/app/modules/policies/login-texts/login-texts.module').then((m) => m.LoginTextsPolicyModule), }, { path: PolicyComponentType.PRIVACYPOLICY, data: { serviceType: PolicyComponentServiceType.MGMT, }, - loadChildren: () => import('src/app/modules/policies/privacy-policy/privacy-policy.module') - .then(m => m.PrivacyPolicyModule), + loadChildren: () => + import('src/app/modules/policies/privacy-policy/privacy-policy.module').then((m) => m.PrivacyPolicyModule), }, ], }, { path: 'members', - loadChildren: () => import('./org-members/org-members.module').then(m => m.OrgMembersModule), + loadChildren: () => import('./org-members/org-members.module').then((m) => m.OrgMembersModule), }, { path: '', @@ -136,7 +134,7 @@ const routes: Routes = [ }, { path: 'overview', - loadChildren: () => import('./org-list/org-list.module').then(m => m.OrgListModule), + loadChildren: () => import('./org-list/org-list.module').then((m) => m.OrgListModule), }, ]; @@ -144,4 +142,4 @@ const routes: Routes = [ imports: [RouterModule.forChild(routes)], exports: [RouterModule], }) -export class OrgsRoutingModule { } +export class OrgsRoutingModule {}