diff --git a/frontend/src/components/dialog/create-department-repo-dialog.js b/frontend/src/components/dialog/create-department-repo-dialog.js index 6864ddab59..86a4265de7 100644 --- a/frontend/src/components/dialog/create-department-repo-dialog.js +++ b/frontend/src/components/dialog/create-department-repo-dialog.js @@ -38,7 +38,7 @@ class CreateDepartmentRepoDialog extends React.Component { } }; - handleKeyPress = (e) => { + handleKeyDown = (e) => { if (e.key === 'Enter') { this.handleSubmit(); e.preventDefault(); @@ -81,7 +81,7 @@ class CreateDepartmentRepoDialog extends React.Component { { + handleKeyDown = (e) => { if (e.key === 'Enter') { this.handleSubmit(); e.preventDefault(); @@ -151,7 +151,7 @@ class CreateFile extends React.Component { { + handleKeyDown = (e) => { if (e.key === 'Enter') { this.handleSubmit(); e.preventDefault(); @@ -87,7 +87,7 @@ class CreateForder extends React.Component { diff --git a/frontend/src/components/dialog/create-repo-dialog.js b/frontend/src/components/dialog/create-repo-dialog.js index 1d1e74b0e1..691e1a3b40 100644 --- a/frontend/src/components/dialog/create-repo-dialog.js +++ b/frontend/src/components/dialog/create-repo-dialog.js @@ -57,7 +57,7 @@ class CreateRepoDialog extends React.Component { } }; - handleKeyPress = (e) => { + handleKeyDown = (e) => { if (e.key === 'Enter') { this.handleSubmit(); e.preventDefault(); @@ -180,7 +180,7 @@ class CreateRepoDialog extends React.Component { { + handleKeyDown = (e) => { if (e.key === 'Enter') { this.createTag(); } @@ -77,7 +77,7 @@ class CreateTagDialog extends React.Component {
- +
{this.state.errorMsg}
diff --git a/frontend/src/components/dialog/lib-decrypt-dialog.js b/frontend/src/components/dialog/lib-decrypt-dialog.js index edd7482ace..fd01139617 100644 --- a/frontend/src/components/dialog/lib-decrypt-dialog.js +++ b/frontend/src/components/dialog/lib-decrypt-dialog.js @@ -35,7 +35,7 @@ class LibDecryptDialog extends React.Component { e.preventDefault(); }; - handleKeyPress = (e) => { + handleKeyDown = (e) => { if (e.key == 'Enter') { this.handleSubmit(e); } @@ -63,7 +63,7 @@ class LibDecryptDialog extends React.Component { {this.state.showError &&

{gettext('Wrong password')}

} - +

{'* '}{gettext('The password will be kept in the server for only 1 hour.')}

diff --git a/frontend/src/components/dialog/lib-history-setting-dialog.js b/frontend/src/components/dialog/lib-history-setting-dialog.js index d16b56547f..2361a50371 100644 --- a/frontend/src/components/dialog/lib-history-setting-dialog.js +++ b/frontend/src/components/dialog/lib-history-setting-dialog.js @@ -68,7 +68,7 @@ class LibHistorySetting extends React.Component { } }; - handleKeyPress = (e) => { + handleKeyDown = (e) => { if (e.key === 'Enter') { this.submit(); e.preventDefault(); @@ -139,7 +139,7 @@ class LibHistorySetting extends React.Component { value={this.state.expireDays} onChange={this.onChange} disabled={this.state.disabled} - onKeyDown={this.handleKeyPress} + onKeyDown={this.handleKeyDown} />{' '} diff --git a/frontend/src/components/dialog/lib-old-files-auto-del-dialog.js b/frontend/src/components/dialog/lib-old-files-auto-del-dialog.js index 72923f5b96..3ba5c93937 100644 --- a/frontend/src/components/dialog/lib-old-files-auto-del-dialog.js +++ b/frontend/src/components/dialog/lib-old-files-auto-del-dialog.js @@ -65,7 +65,7 @@ class LibOldFilesAutoDelDialog extends React.Component { }); }; - handleKeyPress = (e) => { + handleKeyDown = (e) => { if (e.key === 'Enter') { this.submit(); e.preventDefault(); @@ -112,7 +112,7 @@ class LibOldFilesAutoDelDialog extends React.Component { value={this.state.autoDelDays} disabled={!this.state.isAutoDel} onChange={this.onChange} - onKeyDown={this.handleKeyPress} + onKeyDown={this.handleKeyDown} />{' '} diff --git a/frontend/src/components/dialog/new-wiki-dialog.js b/frontend/src/components/dialog/new-wiki-dialog.js index 1f8d251b58..d8fb431394 100644 --- a/frontend/src/components/dialog/new-wiki-dialog.js +++ b/frontend/src/components/dialog/new-wiki-dialog.js @@ -32,7 +32,7 @@ class NewWikiDialog extends React.Component { }); }; - handleKeyPress = (e) => { + handleKeyDown = (e) => { if (e.key === 'Enter') { this.handleSubmit(); } @@ -54,7 +54,7 @@ class NewWikiDialog extends React.Component { {gettext('New Wiki')} - + diff --git a/frontend/src/components/dialog/org-add-department-dialog.js b/frontend/src/components/dialog/org-add-department-dialog.js index 751e9b3f72..93d0ea8ee6 100644 --- a/frontend/src/components/dialog/org-add-department-dialog.js +++ b/frontend/src/components/dialog/org-add-department-dialog.js @@ -55,7 +55,7 @@ class AddDepartDialog extends React.Component { }); }; - handleKeyPress = (e) => { + handleKeyDown = (e) => { if (e.key === 'Enter') { this.handleSubmit(); e.preventDefault(); @@ -73,7 +73,7 @@ class AddDepartDialog extends React.Component { { + handleKeyDown = (e) => { if (e.key === 'Enter') { this.handleSubmit(); e.preventDefault(); @@ -68,7 +68,7 @@ class AddRepoDialog extends React.Component { { - e.preventDefault(); - if (e.key == 'Enter') { - this.handleSubmit(e); - } - }; - togglePasswordVisible = () => { this.setState({isPasswordVisible: !this.state.isPasswordVisible}, () => { if (this.state.isPasswordVisible) { diff --git a/frontend/src/components/dialog/org-rename-department-dialog.js b/frontend/src/components/dialog/org-rename-department-dialog.js index 64322ca0b6..6de29d5aa3 100644 --- a/frontend/src/components/dialog/org-rename-department-dialog.js +++ b/frontend/src/components/dialog/org-rename-department-dialog.js @@ -63,7 +63,7 @@ class RenameDepartmentDialog extends React.Component { }); }; - handleKeyPress = (e) => { + handleKeyDown = (e) => { if (e.key === 'Enter') { this.handleSubmit(); e.preventDefault(); @@ -87,7 +87,7 @@ class RenameDepartmentDialog extends React.Component { { + handleKeyDown = (e) => { if (e.key === 'Enter') { this.setGroupQuota(); e.preventDefault(); @@ -60,7 +60,7 @@ class SetGroupQuotaDialog extends React.Component { { + handleKeyDown = (e) => { if (e.key === 'Enter') { this.handleSubmit(); } @@ -121,7 +121,7 @@ class Rename extends React.Component { {type === 'file' ? gettext('Rename File') : gettext('Rename Folder') }

{type === 'file' ? gettext('New file name'): gettext('New folder name')}

- + {this.state.errMessage && {this.state.errMessage}}
diff --git a/frontend/src/components/dialog/rename-dirent.js b/frontend/src/components/dialog/rename-dirent.js index 61a45cb298..865994b90b 100644 --- a/frontend/src/components/dialog/rename-dirent.js +++ b/frontend/src/components/dialog/rename-dirent.js @@ -63,7 +63,7 @@ class Rename extends React.Component { } }; - handleKeyPress = (e) => { + handleKeyDown = (e) => { if (e.key === 'Enter') { this.handleSubmit(); } @@ -123,7 +123,7 @@ class Rename extends React.Component { {type === 'file' ? gettext('Rename File') : gettext('Rename Folder') }

{type === 'file' ? gettext('New file name'): gettext('New folder name')}

- + {this.state.errMessage && {this.state.errMessage}}
diff --git a/frontend/src/components/dialog/sysadmin-dialog/set-quota.js b/frontend/src/components/dialog/sysadmin-dialog/set-quota.js index cd08cea927..5be4f0c6ea 100644 --- a/frontend/src/components/dialog/sysadmin-dialog/set-quota.js +++ b/frontend/src/components/dialog/sysadmin-dialog/set-quota.js @@ -30,7 +30,7 @@ class SetQuotaDialog extends React.Component { }); }; - handleKeyPress = (e) => { + handleKeyDown = (e) => { if (e.key == 'Enter') { this.handleSubmit(); e.preventDefault(); @@ -55,7 +55,7 @@ class SetQuotaDialog extends React.Component { type="text" className="form-control" value={quota} - onKeyPress={this.handleKeyPress} + onKeyDown={this.handleKeyDown} onChange={this.handleQuotaChange} /> diff --git a/frontend/src/components/dialog/sysadmin-dialog/set-upload-download-rate-limit.js b/frontend/src/components/dialog/sysadmin-dialog/set-upload-download-rate-limit.js index 22b09a78bd..88b0ec4a73 100644 --- a/frontend/src/components/dialog/sysadmin-dialog/set-upload-download-rate-limit.js +++ b/frontend/src/components/dialog/sysadmin-dialog/set-upload-download-rate-limit.js @@ -31,7 +31,7 @@ class SysAdminSetUploadDownloadRateLimitDialog extends React.Component { }); }; - handleKeyPress = (e) => { + handleKeyDown = (e) => { if (e.key == 'Enter') { this.handleSubmit(); e.preventDefault(); @@ -56,7 +56,7 @@ class SysAdminSetUploadDownloadRateLimitDialog extends React.Component { type="text" className="form-control" value={rateLimit} - onKeyPress={this.handleKeyPress} + onKeyDown={this.handleKeyDown} onChange={this.handleRateLimitChange} /> diff --git a/frontend/src/components/dialog/sysadmin-dialog/sysadmin-add-department-dialog.js b/frontend/src/components/dialog/sysadmin-dialog/sysadmin-add-department-dialog.js index 769000d3d5..b2c843439b 100644 --- a/frontend/src/components/dialog/sysadmin-dialog/sysadmin-add-department-dialog.js +++ b/frontend/src/components/dialog/sysadmin-dialog/sysadmin-add-department-dialog.js @@ -55,7 +55,7 @@ class AddDepartDialog extends React.Component { }); }; - handleKeyPress = (e) => { + handleKeyDown = (e) => { if (e.key === 'Enter') { this.handleSubmit(); e.preventDefault(); @@ -73,7 +73,7 @@ class AddDepartDialog extends React.Component { { + handleKeyDown = (e) => { if (e.key === 'Enter') { this.handleSubmit(); e.preventDefault(); @@ -68,7 +68,7 @@ class AddRepoDialog extends React.Component { { - if (e.key === 'Enter') { - this.handleSubmit(); - e.preventDefault(); - } - }; - render() { return ( diff --git a/frontend/src/components/dialog/sysadmin-dialog/sysadmin-create-group-dialog.js b/frontend/src/components/dialog/sysadmin-dialog/sysadmin-create-group-dialog.js index fcf78ff798..41ca3d2a74 100644 --- a/frontend/src/components/dialog/sysadmin-dialog/sysadmin-create-group-dialog.js +++ b/frontend/src/components/dialog/sysadmin-dialog/sysadmin-create-group-dialog.js @@ -44,7 +44,7 @@ class SysAdminCreateGroupDialog extends React.Component { }); }; - handleKeyPress = (e) => { + handleKeyDown = (e) => { if (e.key === 'Enter') { this.handleSubmit(); e.preventDefault(); @@ -65,7 +65,7 @@ class SysAdminCreateGroupDialog extends React.Component { { + handleKeyDown = (e) => { if (e.key === 'Enter') { this.handleSubmit(); e.preventDefault(); @@ -63,7 +63,7 @@ class SysAdminCreateRepoDialog extends React.Component { { + handleKeyDown = (e) => { if (e.key === 'Enter') { this.submit(); e.preventDefault(); @@ -132,7 +132,7 @@ class SysAdminLibHistorySettingDialog extends React.Component { value={this.state.expireDays} onChange={this.onChange} disabled={this.state.disabled} - onKeyDown={this.handleKeyPress} + onKeyDown={this.handleKeyDown} />{' '} diff --git a/frontend/src/components/dialog/sysadmin-dialog/sysadmin-rename-department-dialog.js b/frontend/src/components/dialog/sysadmin-dialog/sysadmin-rename-department-dialog.js index ccf21d8c0d..ef521fcb4b 100644 --- a/frontend/src/components/dialog/sysadmin-dialog/sysadmin-rename-department-dialog.js +++ b/frontend/src/components/dialog/sysadmin-dialog/sysadmin-rename-department-dialog.js @@ -58,7 +58,7 @@ class RenameDepartmentDialog extends React.Component { }); }; - handleKeyPress = (e) => { + handleKeyDown = (e) => { if (e.key === 'Enter') { this.handleSubmit(); e.preventDefault(); @@ -82,7 +82,7 @@ class RenameDepartmentDialog extends React.Component { { + handleKeyDown = (e) => { if (e.key === 'Enter') { this.setGroupQuota(); e.preventDefault(); @@ -60,7 +60,7 @@ class SetGroupQuotaDialog extends React.Component { { + handleKeyDown = (e) => { if (e.key == 'Enter') { this.handleSubmit(); e.preventDefault(); @@ -55,7 +55,7 @@ class SysAdminSetOrgMaxUserNumberDialog extends React.Component { type="text" className="form-control" value={value} - onKeyPress={this.handleKeyPress} + onKeyDown={this.handleKeyDown} onChange={this.handleInputChange} /> diff --git a/frontend/src/components/dialog/sysadmin-dialog/sysadmin-set-org-name-dialog.js b/frontend/src/components/dialog/sysadmin-dialog/sysadmin-set-org-name-dialog.js index 4a9ad650cd..ed2c98bb76 100644 --- a/frontend/src/components/dialog/sysadmin-dialog/sysadmin-set-org-name-dialog.js +++ b/frontend/src/components/dialog/sysadmin-dialog/sysadmin-set-org-name-dialog.js @@ -31,7 +31,7 @@ class SysAdminSetOrgNameDialog extends React.Component { }); }; - handleKeyPress = (e) => { + handleKeyDown = (e) => { if (e.key == 'Enter') { this.handleSubmit(); e.preventDefault(); @@ -54,7 +54,7 @@ class SysAdminSetOrgNameDialog extends React.Component { diff --git a/frontend/src/components/dialog/sysadmin-dialog/update-user.js b/frontend/src/components/dialog/sysadmin-dialog/update-user.js index bbabd40b9e..438da85998 100644 --- a/frontend/src/components/dialog/sysadmin-dialog/update-user.js +++ b/frontend/src/components/dialog/sysadmin-dialog/update-user.js @@ -27,7 +27,7 @@ class UpdateUser extends React.Component { }); }; - handleKeyPress = (e) => { + handleKeyDown = (e) => { if (e.key == 'Enter') { this.handleSubmit(); e.preventDefault(); @@ -50,7 +50,7 @@ class UpdateUser extends React.Component { diff --git a/frontend/src/pages/org-admin/org-groups.js b/frontend/src/pages/org-admin/org-groups.js index 1c4fa30760..583a7f87cd 100644 --- a/frontend/src/pages/org-admin/org-groups.js +++ b/frontend/src/pages/org-admin/org-groups.js @@ -24,7 +24,7 @@ class Search extends React.Component { }); }; - handleKeyPress = (e) => { + handleKeyDown = (e) => { if (e.key == 'Enter') { e.preventDefault(); this.handleSubmit(); @@ -50,7 +50,7 @@ class Search extends React.Component { placeholder={this.props.placeholder} value={this.state.value} onChange={this.handleInputChange} - onKeyPress={this.handleKeyPress} + onKeyDown={this.handleKeyDown} autoComplete="off" />
diff --git a/frontend/src/pages/org-admin/org-users-users.js b/frontend/src/pages/org-admin/org-users-users.js index 9f17e1756b..5aa3513852 100644 --- a/frontend/src/pages/org-admin/org-users-users.js +++ b/frontend/src/pages/org-admin/org-users-users.js @@ -29,7 +29,7 @@ class Search extends React.Component { }); }; - handleKeyPress = (e) => { + handleKeyDown = (e) => { if (e.key == 'Enter') { e.preventDefault(); this.handleSubmit(); @@ -55,7 +55,7 @@ class Search extends React.Component { placeholder={this.props.placeholder} value={this.state.value} onChange={this.handleInputChange} - onKeyPress={this.handleKeyPress} + onKeyDown={this.handleKeyDown} autoComplete="off" />
diff --git a/frontend/src/pages/sys-admin/search.js b/frontend/src/pages/sys-admin/search.js index a651c75520..a97b52e7c7 100644 --- a/frontend/src/pages/sys-admin/search.js +++ b/frontend/src/pages/sys-admin/search.js @@ -21,7 +21,7 @@ class Search extends React.Component { }); }; - handleKeyPress = (e) => { + handleKeyDown = (e) => { if (e.key == 'Enter') { e.preventDefault(); this.handleSubmit(); @@ -47,7 +47,7 @@ class Search extends React.Component { placeholder={this.props.placeholder} value={this.state.value} onChange={this.handleInputChange} - onKeyPress={this.handleKeyPress} + onKeyDown={this.handleKeyDown} autoComplete="off" />