diff --git a/npm/ng-packs/angular.json b/npm/ng-packs/angular.json index 69119cdb64..a64022a0a8 100644 --- a/npm/ng-packs/angular.json +++ b/npm/ng-packs/angular.json @@ -541,6 +541,44 @@ } } } + }, + "account-core": { + "projectType": "library", + "root": "packages/account-core", + "sourceRoot": "packages/account-core/src", + "prefix": "lib", + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:ng-packagr", + "options": { + "tsConfig": "packages/account-core/tsconfig.lib.json", + "project": "packages/account-core/ng-package.json" + }, + "configurations": { + "production": { + "tsConfig": "packages/account-core/tsconfig.lib.prod.json" + } + } + }, + "test": { + "builder": "@angular-builders/jest:run", + "options": { + "tsConfig": "tsconfig.json", + "coverage": true, + "passWithNoTests": true + } + }, + "lint": { + "builder": "@angular-devkit/build-angular:tslint", + "options": { + "tsConfig": [ + "packages/account-core/tsconfig.lib.json", + "packages/account-core/tsconfig.spec.json" + ], + "exclude": ["**/node_modules/**"] + } + } + } } }, "cli": { diff --git a/npm/ng-packs/packages/account-core/README.md b/npm/ng-packs/packages/account-core/README.md new file mode 100644 index 0000000000..43d7f7e1dc --- /dev/null +++ b/npm/ng-packs/packages/account-core/README.md @@ -0,0 +1,3 @@ +# @abp/ng.account.core + +Visit the [ABP documentation](https://docs.abp.io) diff --git a/npm/ng-packs/packages/account-core/jest.config.js b/npm/ng-packs/packages/account-core/jest.config.js new file mode 100644 index 0000000000..e5400c57cd --- /dev/null +++ b/npm/ng-packs/packages/account-core/jest.config.js @@ -0,0 +1,6 @@ +const jestConfig = require('../../jest.config'); + +module.exports = { + ...jestConfig, + name: 'account-core', +}; diff --git a/npm/ng-packs/packages/account-core/ng-package.json b/npm/ng-packs/packages/account-core/ng-package.json new file mode 100644 index 0000000000..2091a3f0d0 --- /dev/null +++ b/npm/ng-packs/packages/account-core/ng-package.json @@ -0,0 +1,7 @@ +{ + "$schema": "../../node_modules/ng-packagr/ng-package.schema.json", + "dest": "../../dist/account-core", + "lib": { + "entryFile": "src/public-api.ts" + } +} diff --git a/npm/ng-packs/packages/account-core/package.json b/npm/ng-packs/packages/account-core/package.json new file mode 100644 index 0000000000..5c1a2ebb0d --- /dev/null +++ b/npm/ng-packs/packages/account-core/package.json @@ -0,0 +1,18 @@ +{ + "name": "@abp/ng.account.core", + "version": "0.0.1", + "homepage": "https://abp.io", + "repository": { + "type": "git", + "url": "https://github.com/abpframework/abp.git" + }, + "peerDependencies": { + "@angular/common": ">=11.1.2", + "@angular/core": ">=11.1.2", + "@abp/ng.core": "~4.3.3", + "@abp/ng.theme.shared": "~4.3.3" + }, + "dependencies": { + "tslib": "^2.0.0" + } +} diff --git a/npm/ng-packs/packages/account-core/src/lib/auth-wrapper.service.spec.ts b/npm/ng-packs/packages/account-core/src/lib/auth-wrapper.service.spec.ts new file mode 100644 index 0000000000..c09dfff769 --- /dev/null +++ b/npm/ng-packs/packages/account-core/src/lib/auth-wrapper.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { AuthWrapperService } from './auth-wrapper.service'; + +describe('AuthWrapperService', () => { + let service: AuthWrapperService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(AuthWrapperService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/npm/ng-packs/packages/account/src/lib/components/auth-wrapper/auth-wrapper.component.ts b/npm/ng-packs/packages/account-core/src/lib/auth-wrapper.service.ts similarity index 67% rename from npm/ng-packs/packages/account/src/lib/components/auth-wrapper/auth-wrapper.component.ts rename to npm/ng-packs/packages/account-core/src/lib/auth-wrapper.service.ts index b436d23e95..44f53c7eef 100644 --- a/npm/ng-packs/packages/account/src/lib/components/auth-wrapper/auth-wrapper.component.ts +++ b/npm/ng-packs/packages/account-core/src/lib/auth-wrapper.service.ts @@ -1,17 +1,11 @@ -import { ConfigStateService, MultiTenancyService, SubscriptionService } from '@abp/ng.core'; -import { Component, Injector } from '@angular/core'; +import { Injectable, Injector } from '@angular/core'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { eAccountComponents } from '../../enums/components'; import { ActivatedRoute } from '@angular/router'; +import { ConfigStateService, MultiTenancyService } from '@abp/ng.core'; -@Component({ - selector: 'abp-auth-wrapper', - templateUrl: './auth-wrapper.component.html', - exportAs: 'abpAuthWrapper', - providers: [SubscriptionService], -}) -export class AuthWrapperComponent { +@Injectable() +export class AuthWrapperService { isMultiTenancyEnabled$ = this.configState.getDeep$('multiTenancy.isEnabled'); get enableLocalLogin$(): Observable { @@ -20,7 +14,7 @@ export class AuthWrapperComponent { .pipe(map(value => value?.toLowerCase() !== 'false')); } - tenantBoxKey = eAccountComponents.TenantBox; + tenantBoxKey = 'Account.TenantBoxComponent'; route: ActivatedRoute; private _tenantBoxVisible = true; diff --git a/npm/ng-packs/packages/account-core/src/lib/tenant-box.service.spec.ts b/npm/ng-packs/packages/account-core/src/lib/tenant-box.service.spec.ts new file mode 100644 index 0000000000..521623f116 --- /dev/null +++ b/npm/ng-packs/packages/account-core/src/lib/tenant-box.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { TenantBoxService } from './tenant-box.service'; + +describe('TenantBoxService', () => { + let service: TenantBoxService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(TenantBoxService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/npm/ng-packs/packages/account/src/lib/components/tenant-box/tenant-box.component.ts b/npm/ng-packs/packages/account-core/src/lib/tenant-box.service.ts similarity index 84% rename from npm/ng-packs/packages/account/src/lib/components/tenant-box/tenant-box.component.ts rename to npm/ng-packs/packages/account-core/src/lib/tenant-box.service.ts index 81819b9e95..ef0a71a245 100644 --- a/npm/ng-packs/packages/account/src/lib/components/tenant-box/tenant-box.component.ts +++ b/npm/ng-packs/packages/account-core/src/lib/tenant-box.service.ts @@ -1,3 +1,5 @@ +import { Injectable } from '@angular/core'; +import { ToasterService } from '@abp/ng.theme.shared'; import { AbpApplicationConfigurationService, AbpTenantService, @@ -5,17 +7,10 @@ import { CurrentTenantDto, SessionStateService, } from '@abp/ng.core'; -import { ToasterService } from '@abp/ng.theme.shared'; -import { Component } from '@angular/core'; import { finalize } from 'rxjs/operators'; -import { Account } from '../../models/account'; -@Component({ - selector: 'abp-tenant-box', - templateUrl: './tenant-box.component.html', -}) -export class TenantBoxComponent - implements Account.TenantBoxComponentInputs, Account.TenantBoxComponentOutputs { +@Injectable() +export class TenantBoxService { currentTenant$ = this.sessionState.getTenant$(); name: string; diff --git a/npm/ng-packs/packages/account-core/src/public-api.ts b/npm/ng-packs/packages/account-core/src/public-api.ts new file mode 100644 index 0000000000..b9aacd8a89 --- /dev/null +++ b/npm/ng-packs/packages/account-core/src/public-api.ts @@ -0,0 +1,6 @@ +/* + * Public API Surface of account-core + */ + +export * from './lib/auth-wrapper.service'; +export * from './lib/tenant-box.service'; diff --git a/npm/ng-packs/packages/account-core/src/test.ts b/npm/ng-packs/packages/account-core/src/test.ts new file mode 100644 index 0000000000..303b32a220 --- /dev/null +++ b/npm/ng-packs/packages/account-core/src/test.ts @@ -0,0 +1,26 @@ +// This file is required by karma.conf.js and loads recursively all the .spec and framework files + +import 'zone.js/dist/zone'; +import 'zone.js/dist/zone-testing'; +import { getTestBed } from '@angular/core/testing'; +import { + BrowserDynamicTestingModule, + platformBrowserDynamicTesting +} from '@angular/platform-browser-dynamic/testing'; + +declare const require: { + context(path: string, deep?: boolean, filter?: RegExp): { + keys(): string[]; + (id: string): T; + }; +}; + +// First, initialize the Angular testing environment. +getTestBed().initTestEnvironment( + BrowserDynamicTestingModule, + platformBrowserDynamicTesting() +); +// Then we find all the tests. +const context = require.context('./', true, /\.spec\.ts$/); +// And load the modules. +context.keys().map(context); diff --git a/npm/ng-packs/packages/account-core/tsconfig.lib.json b/npm/ng-packs/packages/account-core/tsconfig.lib.json new file mode 100644 index 0000000000..e837bdcce7 --- /dev/null +++ b/npm/ng-packs/packages/account-core/tsconfig.lib.json @@ -0,0 +1,20 @@ +/* To learn more about this file see: https://angular.io/config/tsconfig. */ +{ + "extends": "../../tsconfig.prod.json", + "compilerOptions": { + "outDir": "../../out-tsc/lib", + "target": "es2015", + "declaration": true, + "inlineSources": true, + "types": [], + "lib": ["dom", "es2018"] + }, + "angularCompilerOptions": { + "skipTemplateCodegen": true, + "strictMetadataEmit": true, + "fullTemplateTypeCheck": true, + "strictInjectionParameters": true, + "enableResourceInlining": true + }, + "exclude": ["src/test.ts", "**/*.spec.ts"] +} diff --git a/npm/ng-packs/packages/account-core/tsconfig.lib.prod.json b/npm/ng-packs/packages/account-core/tsconfig.lib.prod.json new file mode 100644 index 0000000000..cbae794224 --- /dev/null +++ b/npm/ng-packs/packages/account-core/tsconfig.lib.prod.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig.lib.json", + "angularCompilerOptions": { + "enableIvy": false + } +} diff --git a/npm/ng-packs/packages/account-core/tsconfig.spec.json b/npm/ng-packs/packages/account-core/tsconfig.spec.json new file mode 100644 index 0000000000..715dd0a5d2 --- /dev/null +++ b/npm/ng-packs/packages/account-core/tsconfig.spec.json @@ -0,0 +1,17 @@ +/* To learn more about this file see: https://angular.io/config/tsconfig. */ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "../../out-tsc/spec", + "types": [ + "jasmine" + ] + }, + "files": [ + "src/test.ts" + ], + "include": [ + "**/*.spec.ts", + "**/*.d.ts" + ] +} diff --git a/npm/ng-packs/packages/account-core/tslint.json b/npm/ng-packs/packages/account-core/tslint.json new file mode 100644 index 0000000000..124133f849 --- /dev/null +++ b/npm/ng-packs/packages/account-core/tslint.json @@ -0,0 +1,17 @@ +{ + "extends": "../../tslint.json", + "rules": { + "directive-selector": [ + true, + "attribute", + "lib", + "camelCase" + ], + "component-selector": [ + true, + "element", + "lib", + "kebab-case" + ] + } +} diff --git a/npm/ng-packs/packages/account/config/src/enums/route-names.ts b/npm/ng-packs/packages/account/config/src/enums/route-names.ts index 320ff97802..b4aa41df7b 100644 --- a/npm/ng-packs/packages/account/config/src/enums/route-names.ts +++ b/npm/ng-packs/packages/account/config/src/enums/route-names.ts @@ -3,4 +3,6 @@ export const enum eAccountRouteNames { Login = 'AbpAccount::Login', Register = 'AbpAccount::Register', ManageProfile = 'AbpAccount::MyAccount', + ForgotPassword = 'AbpAccount::ForgotPassword', + ResetPassword = 'AbpAccount::ResetPassword', } 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..6b2f016c66 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: eAccountRouteNames.ForgotPassword, + invisible: true, + }, + { + path: '/account/reset-password', + parentName: eAccountRouteNames.Account, + name: eAccountRouteNames.ResetPassword, + 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'; diff --git a/npm/ng-packs/packages/theme-basic/src/lib/components/account-layout/account-layout.component.html b/npm/ng-packs/packages/theme-basic/src/lib/components/account-layout/account-layout.component.html new file mode 100644 index 0000000000..076cf83c7f --- /dev/null +++ b/npm/ng-packs/packages/theme-basic/src/lib/components/account-layout/account-layout.component.html @@ -0,0 +1,62 @@ + + + +
+ + + + +
diff --git a/npm/ng-packs/packages/theme-basic/src/lib/components/account-layout/account-layout.component.ts b/npm/ng-packs/packages/theme-basic/src/lib/components/account-layout/account-layout.component.ts index 56851c6d27..510e2a8f72 100644 --- a/npm/ng-packs/packages/theme-basic/src/lib/components/account-layout/account-layout.component.ts +++ b/npm/ng-packs/packages/theme-basic/src/lib/components/account-layout/account-layout.component.ts @@ -1,14 +1,21 @@ -import { Component } from '@angular/core'; -import { eLayoutType } from '@abp/ng.core'; +import { AfterViewInit, Component } from '@angular/core'; +import { eLayoutType, SubscriptionService } from '@abp/ng.core'; +import { LayoutService } from '../../services/layout.service'; @Component({ selector: 'abp-layout-account', - template: ` - - - `, + templateUrl: './account-layout.component.html', + providers: [LayoutService, SubscriptionService], }) -export class AccountLayoutComponent { +export class AccountLayoutComponent implements AfterViewInit { // required for dynamic component static type = eLayoutType.account; + + authWrapperKey = 'Account.AuthWrapperComponent'; + + constructor(public service: LayoutService) {} + + ngAfterViewInit() { + this.service.subscribeWindowSize(); + } } diff --git a/npm/ng-packs/packages/account/src/lib/components/auth-wrapper/auth-wrapper.component.html b/npm/ng-packs/packages/theme-basic/src/lib/components/account-layout/auth-wrapper/auth-wrapper.component.html similarity index 61% rename from npm/ng-packs/packages/account/src/lib/components/auth-wrapper/auth-wrapper.component.html rename to npm/ng-packs/packages/theme-basic/src/lib/components/account-layout/auth-wrapper/auth-wrapper.component.html index decf6a54b6..5a4e2e6039 100644 --- a/npm/ng-packs/packages/account/src/lib/components/auth-wrapper/auth-wrapper.component.html +++ b/npm/ng-packs/packages/theme-basic/src/lib/components/account-layout/auth-wrapper/auth-wrapper.component.html @@ -1,16 +1,18 @@
- - + + diff --git a/npm/ng-packs/packages/theme-basic/src/lib/components/account-layout/auth-wrapper/auth-wrapper.component.spec.ts b/npm/ng-packs/packages/theme-basic/src/lib/components/account-layout/auth-wrapper/auth-wrapper.component.spec.ts new file mode 100644 index 0000000000..a5c69d2301 --- /dev/null +++ b/npm/ng-packs/packages/theme-basic/src/lib/components/account-layout/auth-wrapper/auth-wrapper.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { AuthWrapperComponent } from './auth-wrapper.component'; + +describe('AuthWrapperComponent', () => { + let component: AuthWrapperComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ AuthWrapperComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(AuthWrapperComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/npm/ng-packs/packages/theme-basic/src/lib/components/account-layout/auth-wrapper/auth-wrapper.component.ts b/npm/ng-packs/packages/theme-basic/src/lib/components/account-layout/auth-wrapper/auth-wrapper.component.ts new file mode 100644 index 0000000000..0023c74e78 --- /dev/null +++ b/npm/ng-packs/packages/theme-basic/src/lib/components/account-layout/auth-wrapper/auth-wrapper.component.ts @@ -0,0 +1,13 @@ +import { Component, OnInit } from '@angular/core'; +import { AuthWrapperService } from '@abp/ng.account.core'; + +@Component({ + selector: 'abp-auth-wrapper', + templateUrl: './auth-wrapper.component.html', + providers: [AuthWrapperService], +}) +export class AuthWrapperComponent implements OnInit { + constructor(public service: AuthWrapperService) {} + + ngOnInit(): void {} +} diff --git a/npm/ng-packs/packages/account/src/lib/components/tenant-box/tenant-box.component.html b/npm/ng-packs/packages/theme-basic/src/lib/components/account-layout/tenant-box/tenant-box.component.html similarity index 82% rename from npm/ng-packs/packages/account/src/lib/components/tenant-box/tenant-box.component.html rename to npm/ng-packs/packages/theme-basic/src/lib/components/account-layout/tenant-box/tenant-box.component.html index 91e68d9a0a..e4381b7b05 100644 --- a/npm/ng-packs/packages/account/src/lib/components/tenant-box/tenant-box.component.html +++ b/npm/ng-packs/packages/theme-basic/src/lib/components/account-layout/tenant-box/tenant-box.component.html @@ -1,4 +1,4 @@ - +
@@ -16,7 +16,7 @@ id="AbpTenantSwitchLink" href="javascript:void(0);" class="btn btn-sm mt-3 btn-outline-primary" - (click)="onSwitch()" + (click)="service.onSwitch()" >{{ 'AbpUiMultiTenancy::Switch' | abpLocalization }}
@@ -24,17 +24,17 @@
- +
Switch Tenant
-
+
{{ 'AbpTenantManagement::Save' | abpLocalization }} diff --git a/npm/ng-packs/packages/theme-basic/src/lib/components/account-layout/tenant-box/tenant-box.component.spec.ts b/npm/ng-packs/packages/theme-basic/src/lib/components/account-layout/tenant-box/tenant-box.component.spec.ts new file mode 100644 index 0000000000..86dd8a0cf5 --- /dev/null +++ b/npm/ng-packs/packages/theme-basic/src/lib/components/account-layout/tenant-box/tenant-box.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TenantBoxComponent } from './tenant-box.component'; + +describe('TenantBoxComponent', () => { + let component: TenantBoxComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ TenantBoxComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(TenantBoxComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/npm/ng-packs/packages/theme-basic/src/lib/components/account-layout/tenant-box/tenant-box.component.ts b/npm/ng-packs/packages/theme-basic/src/lib/components/account-layout/tenant-box/tenant-box.component.ts new file mode 100644 index 0000000000..1aba2fbc6c --- /dev/null +++ b/npm/ng-packs/packages/theme-basic/src/lib/components/account-layout/tenant-box/tenant-box.component.ts @@ -0,0 +1,13 @@ +import { Component, OnInit } from '@angular/core'; +import { TenantBoxService } from '@abp/ng.account.core'; + +@Component({ + selector: 'abp-tenant-box', + templateUrl: './tenant-box.component.html', + providers: [TenantBoxService], +}) +export class TenantBoxComponent implements OnInit { + constructor(public service: TenantBoxService) {} + + ngOnInit(): void {} +} diff --git a/npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.html b/npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.html index 7892d43a00..c41cfb3d31 100644 --- a/npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.html +++ b/npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.html @@ -4,37 +4,37 @@ style="min-height: 4rem" >
- + -