fix: remove tenant-box from reset-password page

pull/9337/head
bnymncoskuner 4 years ago
parent 8749abdb7f
commit b36ebd8e45

@ -69,6 +69,7 @@ const routes: Routes = [
component: ReplaceableRouteContainerComponent, component: ReplaceableRouteContainerComponent,
canActivate: [AuthenticationFlowGuard], canActivate: [AuthenticationFlowGuard],
data: { data: {
tenantBoxVisible: false,
replaceableComponent: { replaceableComponent: {
key: eAccountComponents.ResetPassword, key: eAccountComponents.ResetPassword,
defaultComponent: ResetPasswordComponent, defaultComponent: ResetPasswordComponent,

@ -1,6 +1,6 @@
<div class="row"> <div class="row">
<div class="mx-auto col col-md-5"> <div class="mx-auto col col-md-5">
<ng-container *ngIf="(isMultiTenancyEnabled$ | async) && multiTenancy.isTenantBoxVisible"> <ng-container *ngIf="(isMultiTenancyEnabled$ | async) && isTenantBoxVisible">
<abp-tenant-box *abpReplaceableTemplate="{ componentKey: tenantBoxKey }"></abp-tenant-box> <abp-tenant-box *abpReplaceableTemplate="{ componentKey: tenantBoxKey }"></abp-tenant-box>
</ng-container> </ng-container>

@ -1,8 +1,9 @@
import { ConfigStateService, MultiTenancyService, SubscriptionService } from '@abp/ng.core'; import { ConfigStateService, MultiTenancyService, SubscriptionService } from '@abp/ng.core';
import { Component } from '@angular/core'; import { Component, Injector } from '@angular/core';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { map } from 'rxjs/operators'; import { map } from 'rxjs/operators';
import { eAccountComponents } from '../../enums/components'; import { eAccountComponents } from '../../enums/components';
import { ActivatedRoute } from '@angular/router';
@Component({ @Component({
selector: 'abp-auth-wrapper', selector: 'abp-auth-wrapper',
@ -20,9 +21,24 @@ export class AuthWrapperComponent {
} }
tenantBoxKey = eAccountComponents.TenantBox; tenantBoxKey = eAccountComponents.TenantBox;
route: ActivatedRoute;
private _tenantBoxVisible = true;
private setTenantBoxVisibility = () => {
this._tenantBoxVisible = this.route.snapshot.firstChild.data.tenantBoxVisible ?? true;
};
get isTenantBoxVisible() {
return this._tenantBoxVisible && this.multiTenancy.isTenantBoxVisible;
}
constructor( constructor(
public readonly multiTenancy: MultiTenancyService, public readonly multiTenancy: MultiTenancyService,
private configState: ConfigStateService, private configState: ConfigStateService,
) {} injector: Injector,
) {
this.route = injector.get(ActivatedRoute);
this.setTenantBoxVisibility();
}
} }

Loading…
Cancel
Save