2
0
Эх сурвалжийг харах

124062 show spinner while sending email

soumaeda 2 жил өмнө
parent
commit
24668bee4c

+ 3 - 0
apps/app/public/static/locales/ja_JP/admin.json

@@ -4,6 +4,9 @@
   },
   "Update": "更新",
   "Delete": "削除",
+  "Send": "送信",
+  "Close": "閉じる",
+  "Done": "完了",
   "User": "ユーザー",
   "Name": "名前",
   "Page": "ページ",

+ 3 - 0
apps/app/public/static/locales/zh_CN/admin.json

@@ -4,6 +4,9 @@
   },
   "Update": "更新",
   "Delete": "删除",
+  "Send": "发送",
+  "Close": "关闭",
+  "Done": "完成",
   "User": "用户",
   "Name": "姓名",
   "Created": "创建",

+ 2 - 1
apps/app/src/components/Admin/Users/PasswordResetModal.jsx

@@ -49,6 +49,7 @@ class PasswordResetModal extends React.Component {
       <>
         <button type="submit" className={`btn ${isEmailSent ? 'btn-secondary' : 'btn-primary'}`}
           onClick={isEmailSent ? undefined : this.onClickSendNewPasswordButton} disabled={!isMailerSetup || isEmailSending || isEmailSent}>
+          {isEmailSending && <i className='fa fa-spinner fa-pulse mr-1'/>}
           {isEmailSent ? t('Done') : t('Send')}
         </button>
         <button type="submit" className="btn btn-danger" onClick={this.props.onClose}>
@@ -164,7 +165,7 @@ class PasswordResetModal extends React.Component {
 
     try {
       await apiv3Put('/users/reset-password-email', { id: userForPasswordResetModal._id, newPassword: this.state.temporaryPassword });
-      this.setState({ isEmailSent: true });
+      this.setState({ isEmailSent: true, isEmailSending: false });
     }
     catch (err) {
       this.setState({ isEmailSending: false, isEmailSent: false });