Merge pull request #9581 from bashofmann/fix-about-dialog

Fix broken about dialog on sign in page
This commit is contained in:
jwangyangls 2019-11-22 14:55:48 +08:00 committed by GitHub
commit cfff0b6aaa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 2 deletions

View File

@ -1,6 +1,6 @@
<clr-main-container>
<global-message [isAppLevel]="true"></global-message>
<navigator></navigator>
<navigator (showPwdChangeModal)="openModal($event)"></navigator>
<search-result></search-result>
<div class="login-wrapper" [ngStyle]="{'background-image': customLoginBgImg? 'url(/images/' + customLoginBgImg + ')': ''}">
<form #signInForm="ngForm" class="login">
@ -45,4 +45,5 @@
</div>
</clr-main-container>
<sign-up #signupDialog (userCreation)="handleUserCreation($event)"></sign-up>
<forgot-password #forgotPwdDialog></forgot-password>
<forgot-password #forgotPwdDialog></forgot-password>
<about-dialog></about-dialog>

View File

@ -29,6 +29,9 @@ import { User } from '../user/user';
import { CookieService, CookieOptions } from 'ngx-cookie';
import { SkinableConfig } from "../skinable-config.service";
import {ModalEvent} from "../base/modal-event";
import {modalEvents} from "../base/modal-events.const";
import {AboutDialogComponent} from "../shared/about-dialog/about-dialog.component";
// Define status flags for signing in states
export const signInStatusNormal = 0;
@ -57,6 +60,7 @@ export class SignInComponent implements AfterViewChecked, OnInit {
@ViewChild('signInForm', {static: true}) currentForm: NgForm;
@ViewChild('signupDialog', {static: false}) signUpDialog: SignUpComponent;
@ViewChild('forgotPwdDialog', {static: false}) forgotPwdDialog: ForgotPasswordComponent;
@ViewChild(AboutDialogComponent, {static: false}) aboutDialog: AboutDialogComponent;
// Status flag
signInStatus: number = signInStatusNormal;
@ -283,6 +287,16 @@ export class SignInComponent implements AfterViewChecked, OnInit {
this.forgotPwdDialog.open();
}
// Open modal dialog
openModal(event: ModalEvent): void {
switch (event.modalName) {
case modalEvents.ABOUT:
this.aboutDialog.open();
break;
default:
break;
}
}
}