fix issue of package.json

This commit is contained in:
Steven Zou 2017-03-31 16:07:06 +08:00
parent 77ca1e9b42
commit 9947d1f4bc
5 changed files with 22 additions and 13 deletions

View File

@ -37,6 +37,7 @@
"zone.js": "^0.7.2" "zone.js": "^0.7.2"
}, },
"devDependencies": { "devDependencies": {
"@angular/compiler-cli": "^2.4.1",
"@angular/cli": "^1.0.0", "@angular/cli": "^1.0.0",
"@types/core-js": "^0.9.34", "@types/core-js": "^0.9.34",
"@types/jasmine": "^2.2.30", "@types/jasmine": "^2.2.30",

View File

@ -7,10 +7,10 @@
<section class="form-block"> <section class="form-block">
<div class="form-group form-group-override"> <div class="form-group form-group-override">
<label for="reset_pwd_email" class="required form-group-label-override">{{'RESET_PWD.EMAIL' | translate}}</label> <label for="reset_pwd_email" class="required form-group-label-override">{{'RESET_PWD.EMAIL' | translate}}</label>
<label for="reset_pwd_email" aria-haspopup="true" role="tooltip" class="tooltip tooltip-validation tooltip-md tooltip-bottom-left" [class.invalid]="validationState === false"> <label for="reset_pwd_email" aria-haspopup="true" role="tooltip" class="tooltip tooltip-validation tooltip-md tooltip-bottom-left" [class.invalid]="!validationState">
<input name="reset_pwd_email" type="text" #eamilInput="ngModel" [(ngModel)]="email" <input [disabled]="isSuccess" name="reset_pwd_email" type="text" #eamilInput="ngModel" [(ngModel)]="email"
required required
pattern='^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$' email
id="reset_pwd_email" id="reset_pwd_email"
size="40" size="40"
(input)="handleValidation(true)" (input)="handleValidation(true)"
@ -25,7 +25,7 @@
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<span class="spinner spinner-inline" style="top:8px;" [hidden]="showProgress === false"></span> <span class="spinner spinner-inline" style="top:8px;" [hidden]="showProgress === false"></span>
<button type="button" class="btn btn-outline" (click)="close()">{{'BUTTON.CANCEL' | translate}}</button> <button type="button" class="btn btn-outline" (click)="close()">{{btnCancelCaption | translate}}</button>
<button type="button" class="btn btn-primary" [disabled]="!isValid || showProgress" (click)="send()">{{'BUTTON.SEND' | translate}}</button> <button *ngIf="!isSuccess" type="button" class="btn btn-primary" [disabled]="!isValid || showProgress" (click)="send()">{{'BUTTON.SEND' | translate}}</button>
</div> </div>
</clr-modal> </clr-modal>

View File

@ -15,7 +15,7 @@ export class ForgotPasswordComponent {
private onGoing: boolean = false; private onGoing: boolean = false;
private email: string = ""; private email: string = "";
private validationState: boolean = true; private validationState: boolean = true;
private forceValid: boolean = true; private isSuccess: boolean = false;
@ViewChild("forgotPasswordFrom") forgotPwdForm: NgForm; @ViewChild("forgotPasswordFrom") forgotPwdForm: NgForm;
@ViewChild(InlineAlertComponent) @ViewChild(InlineAlertComponent)
@ -28,13 +28,21 @@ export class ForgotPasswordComponent {
} }
public get isValid(): boolean { public get isValid(): boolean {
return this.forgotPwdForm && this.forgotPwdForm.valid && this.forceValid; return this.forgotPwdForm && this.forgotPwdForm.valid ;
}
public get btnCancelCaption(): string {
if(this.isSuccess){
return "BUTTON.CLOSE";
}
return "BUTTON.CANCEL";
} }
public open(): void { public open(): void {
//Clear state data //Clear state data
this.validationState = true; this.validationState = true;
this.forceValid = true; this.isSuccess = false;
this.onGoing = false; this.onGoing = false;
this.email = ""; this.email = "";
this.forgotPwdForm.resetForm(); this.forgotPwdForm.resetForm();
@ -61,7 +69,7 @@ export class ForgotPasswordComponent {
this.pwdService.sendResetPasswordMail(this.email) this.pwdService.sendResetPasswordMail(this.email)
.then(response => { .then(response => {
this.onGoing = false; this.onGoing = false;
this.forceValid = false;//diable the send button this.isSuccess = true;
this.inlineAlert.showInlineSuccess({ this.inlineAlert.showInlineSuccess({
message: "RESET_PWD.SUCCESS" message: "RESET_PWD.SUCCESS"
}); });

View File

@ -320,13 +320,13 @@
"COPY": "Copy" "COPY": "Copy"
}, },
"ALERT": { "ALERT": {
"FORM_CHANGE_CONFIRMATION": "Some changes are not saved yet, do you want to cancel?" "FORM_CHANGE_CONFIRMATION": "Some changes are not saved yet. Do you want to cancel?"
}, },
"RESET_PWD": { "RESET_PWD": {
"TITLE": "Reset Password", "TITLE": "Reset Password",
"CAPTION": "Enter your email to reset your password", "CAPTION": "Enter your email to reset your password",
"EMAIL": "Email", "EMAIL": "Email",
"SUCCESS": "Mail of resetting password is successfully send to your mail box", "SUCCESS": "Mail with password resetting is successfully sent. You can close this dialog and check your mailbox now.",
"CAPTION2": "Enter your new password", "CAPTION2": "Enter your new password",
"RESET_OK": "Password has been successfully reset. Click OK to login with new password" "RESET_OK": "Password has been successfully reset. Click OK to login with new password"
}, },
@ -387,7 +387,7 @@
"TEST_MAIL_FAILED": "Failed to verify mail server with error: {{param}}", "TEST_MAIL_FAILED": "Failed to verify mail server with error: {{param}}",
"TEST_LDAP_FAILED": "Failed to verify LDAP server with error: {{param}}", "TEST_LDAP_FAILED": "Failed to verify LDAP server with error: {{param}}",
"LEAVING_CONFIRMATION_TITLE": "Confirm to leave", "LEAVING_CONFIRMATION_TITLE": "Confirm to leave",
"LEAVING_CONFIRMATION_SUMMARY": "Changes have not been saved yet, do you want to leave currnet page?" "LEAVING_CONFIRMATION_SUMMARY": "Changes have not been saved yet. Do you want to leave currnet page?"
}, },
"PAGE_NOT_FOUND": { "PAGE_NOT_FOUND": {
"MAIN_TITLE": "Page not found", "MAIN_TITLE": "Page not found",

View File

@ -326,7 +326,7 @@
"TITLE": "重置密码", "TITLE": "重置密码",
"CAPTION": "输入用来重置密码的邮箱", "CAPTION": "输入用来重置密码的邮箱",
"EMAIL": "邮箱", "EMAIL": "邮箱",
"SUCCESS": "重置密码邮件已成功发送", "SUCCESS": "重置密码邮件已成功发送. 请关闭对话框并检查邮箱",
"CAPTION2": "请输入您的新密码", "CAPTION2": "请输入您的新密码",
"RESET_OK": "密码重置成功,点击确定按钮前往登录页登录" "RESET_OK": "密码重置成功,点击确定按钮前往登录页登录"
}, },