From 50f91f7f566c75cf7cbe80a19c7a4379703dd698 Mon Sep 17 00:00:00 2001 From: muhammedaltug Date: Tue, 22 Jun 2021 16:10:00 +0300 Subject: [PATCH] - remove auth-wrapper and tenant-box components from account package - configure route providers --- .../config/src/providers/route.provider.ts | 15 ++- .../account/src/lib/account-routing.module.ts | 91 ++++++++----------- .../account/src/lib/account.module.ts | 4 - .../account/src/lib/components/index.ts | 1 - 4 files changed, 53 insertions(+), 58 deletions(-) diff --git a/npm/ng-packs/packages/account/config/src/providers/route.provider.ts b/npm/ng-packs/packages/account/config/src/providers/route.provider.ts index 9cc8f6fe82..3eb3364855 100644 --- a/npm/ng-packs/packages/account/config/src/providers/route.provider.ts +++ b/npm/ng-packs/packages/account/config/src/providers/route.provider.ts @@ -13,7 +13,7 @@ export function configureRoutes(routes: RoutesService) { path: undefined, name: eAccountRouteNames.Account, invisible: true, - layout: eLayoutType.application, + layout: eLayoutType.account, order: 1, }, { @@ -32,8 +32,21 @@ export function configureRoutes(routes: RoutesService) { path: '/account/manage', name: eAccountRouteNames.ManageProfile, parentName: eAccountRouteNames.Account, + layout: eLayoutType.application, order: 3, }, + { + path: '/account/forgot-password', + parentName: eAccountRouteNames.Account, + name: 'AbpAccount::Forgot', + invisible: true, + }, + { + path: '/account/reset-password', + parentName: eAccountRouteNames.Account, + name: 'AbpAccount::Reset', + invisible: true, + }, ]); }; } diff --git a/npm/ng-packs/packages/account/src/lib/account-routing.module.ts b/npm/ng-packs/packages/account/src/lib/account-routing.module.ts index c2bba2189e..016666ccaf 100644 --- a/npm/ng-packs/packages/account/src/lib/account-routing.module.ts +++ b/npm/ng-packs/packages/account/src/lib/account-routing.module.ts @@ -6,7 +6,6 @@ import { } from '@abp/ng.core'; import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; -import { AuthWrapperComponent } from './components/auth-wrapper/auth-wrapper.component'; import { ForgotPasswordComponent } from './components/forgot-password/forgot-password.component'; import { LoginComponent } from './components/login/login.component'; import { ManageProfileComponent } from './components/manage-profile/manage-profile.component'; @@ -22,61 +21,49 @@ const routes: Routes = [ component: DynamicLayoutComponent, children: [ { - path: '', + path: 'login', component: ReplaceableRouteContainerComponent, + canActivate: [AuthenticationFlowGuard], data: { replaceableComponent: { - key: eAccountComponents.AuthWrapper, - defaultComponent: AuthWrapperComponent, - } as ReplaceableComponents.RouteData, + key: eAccountComponents.Login, + defaultComponent: LoginComponent, + } as ReplaceableComponents.RouteData, + }, + }, + { + path: 'register', + component: ReplaceableRouteContainerComponent, + canActivate: [AuthenticationFlowGuard], + data: { + replaceableComponent: { + key: eAccountComponents.Register, + defaultComponent: RegisterComponent, + } as ReplaceableComponents.RouteData, + }, + }, + { + path: 'forgot-password', + component: ReplaceableRouteContainerComponent, + canActivate: [AuthenticationFlowGuard], + data: { + replaceableComponent: { + key: eAccountComponents.ForgotPassword, + defaultComponent: ForgotPasswordComponent, + } as ReplaceableComponents.RouteData, + }, + }, + { + path: 'reset-password', + component: ReplaceableRouteContainerComponent, + canActivate: [], + data: { + tenantBoxVisible: false, + replaceableComponent: { + key: eAccountComponents.ResetPassword, + defaultComponent: ResetPasswordComponent, + } as ReplaceableComponents.RouteData, }, - children: [ - { - path: 'login', - component: ReplaceableRouteContainerComponent, - canActivate: [AuthenticationFlowGuard], - data: { - replaceableComponent: { - key: eAccountComponents.Login, - defaultComponent: LoginComponent, - } as ReplaceableComponents.RouteData, - }, - }, - { - path: 'register', - component: ReplaceableRouteContainerComponent, - canActivate: [AuthenticationFlowGuard], - data: { - replaceableComponent: { - key: eAccountComponents.Register, - defaultComponent: RegisterComponent, - } as ReplaceableComponents.RouteData, - }, - }, - { - path: 'forgot-password', - component: ReplaceableRouteContainerComponent, - canActivate: [AuthenticationFlowGuard], - data: { - replaceableComponent: { - key: eAccountComponents.ForgotPassword, - defaultComponent: ForgotPasswordComponent, - } as ReplaceableComponents.RouteData, - }, - }, - { - path: 'reset-password', - component: ReplaceableRouteContainerComponent, - canActivate: [AuthenticationFlowGuard], - data: { - tenantBoxVisible: false, - replaceableComponent: { - key: eAccountComponents.ResetPassword, - defaultComponent: ResetPasswordComponent, - } as ReplaceableComponents.RouteData, - }, - }, - ], }, { path: 'manage', diff --git a/npm/ng-packs/packages/account/src/lib/account.module.ts b/npm/ng-packs/packages/account/src/lib/account.module.ts index 2d36961b97..bfa37d4bfa 100644 --- a/npm/ng-packs/packages/account/src/lib/account.module.ts +++ b/npm/ng-packs/packages/account/src/lib/account.module.ts @@ -4,13 +4,11 @@ import { ModuleWithProviders, NgModule, NgModuleFactory } from '@angular/core'; import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; import { NgxValidateCoreModule } from '@ngx-validate/core'; import { AccountRoutingModule } from './account-routing.module'; -import { AuthWrapperComponent } from './components/auth-wrapper/auth-wrapper.component'; import { ChangePasswordComponent } from './components/change-password/change-password.component'; import { LoginComponent } from './components/login/login.component'; import { ManageProfileComponent } from './components/manage-profile/manage-profile.component'; import { PersonalSettingsComponent } from './components/personal-settings/personal-settings.component'; import { RegisterComponent } from './components/register/register.component'; -import { TenantBoxComponent } from './components/tenant-box/tenant-box.component'; import { AccountConfigOptions } from './models/config-options'; import { ACCOUNT_CONFIG_OPTIONS } from './tokens/config-options.token'; import { accountConfigOptionsFactory } from './utils/factory-utils'; @@ -19,10 +17,8 @@ import { ForgotPasswordComponent } from './components/forgot-password/forgot-pas import { ResetPasswordComponent } from './components/reset-password/reset-password.component'; const declarations = [ - AuthWrapperComponent, LoginComponent, RegisterComponent, - TenantBoxComponent, ChangePasswordComponent, ManageProfileComponent, PersonalSettingsComponent, diff --git a/npm/ng-packs/packages/account/src/lib/components/index.ts b/npm/ng-packs/packages/account/src/lib/components/index.ts index 458f0623a6..098ee8a202 100644 --- a/npm/ng-packs/packages/account/src/lib/components/index.ts +++ b/npm/ng-packs/packages/account/src/lib/components/index.ts @@ -5,4 +5,3 @@ export * from './manage-profile/manage-profile.component'; export * from './register/register.component'; export * from './personal-settings/personal-settings.component'; export * from './reset-password/reset-password.component'; -export * from './tenant-box/tenant-box.component';