Skip to content

Commit

Permalink
🧹 Improved email validation error message (#284)
Browse files Browse the repository at this point in the history
* fix: display different error messages when feedback email is empty or invalid

* revert wrongly changes

* code clean

* clean

* use built in email validator

* clean
  • Loading branch information
cosmos-explorer committed Mar 17, 2023
1 parent f60dd6c commit ca827aa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<form nz-form [formGroup]="feedbackForm" nzLayout="vertical">
<nz-form-item>
<nz-form-label nzRequired i18n="@@common.email">Email</nz-form-label>
<nz-form-control nzHasFeedback i18n-nzErrorTip="@@common.email-cannot-be-empty" nzErrorTip="Email cannot be empty">
<nz-form-control nzHasFeedback i18n-nzErrorTip="@@common.email-invalid" nzErrorTip="Invalid Email">
<input nz-input formControlName="email" />
</nz-form-control>
</nz-form-item>
Expand Down
4 changes: 2 additions & 2 deletions modules/front-end/src/locale/messages.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -1845,8 +1845,8 @@
<context context-type="linenumber">30</context>
</context-group>
</trans-unit>
<trans-unit id="common.email-cannot-be-empty" datatype="html">
<source>Email cannot be empty</source>
<trans-unit id="common.email-invalid" datatype="html">
<source>Invalid Email</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/core/components/header/header.component.html</context>
<context context-type="linenumber">95,96</context>
Expand Down
6 changes: 3 additions & 3 deletions modules/front-end/src/locale/messages.zh.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -1973,13 +1973,13 @@
</context-group>
<target>邮箱</target>
</trans-unit>
<trans-unit id="common.email-cannot-be-empty" datatype="html">
<source>Email cannot be empty</source>
<trans-unit id="common.email-invalid" datatype="html">
<source>Invalid Email</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/core/components/header/header.component.html</context>
<context context-type="linenumber">95,96</context>
</context-group>
<target>邮箱不能为空</target>
<target>邮箱地址无效</target>
</trans-unit>
<trans-unit id="common.message" datatype="html">
<source>Message</source>
Expand Down

0 comments on commit ca827aa

Please sign in to comment.