mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-02 07:27:04 +00:00
[system admin] fixup for 'input space' (#4270)
This commit is contained in:
@@ -24,10 +24,10 @@ class SetQuotaDialog extends React.Component {
|
||||
}
|
||||
|
||||
handleQuotaChange = (e) => {
|
||||
const value = e.target.value.trim();
|
||||
const value = e.target.value;
|
||||
this.setState({
|
||||
quota: value,
|
||||
isSubmitBtnActive: value != ''
|
||||
isSubmitBtnActive: value.trim() != ''
|
||||
});
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ class SetQuotaDialog extends React.Component {
|
||||
}
|
||||
|
||||
handleSubmit = () => {
|
||||
this.props.updateQuota(this.state.quota);
|
||||
this.props.updateQuota(this.state.quota.trim());
|
||||
this.toggle();
|
||||
}
|
||||
|
||||
|
@@ -20,13 +20,10 @@ class SysAdminAddInstitutionDialog extends React.Component {
|
||||
|
||||
handleChange = (e) => {
|
||||
const value = e.target.value;
|
||||
if (!value.trim()) {
|
||||
this.setState({isSubmitBtnActive: false});
|
||||
} else {
|
||||
this.setState({isSubmitBtnActive: true});
|
||||
}
|
||||
|
||||
this.setState({value: value});
|
||||
this.setState({
|
||||
value: value,
|
||||
isSubmitBtnActive: value.trim() != ''
|
||||
});
|
||||
}
|
||||
|
||||
handleSubmit = () => {
|
||||
|
@@ -24,10 +24,10 @@ class SysAdminAddOrgDialog extends React.Component {
|
||||
checkSubmitBtnActive = () => {
|
||||
const { name, email, password, passwordAgain } = this.state;
|
||||
let btnActive = true;
|
||||
if (name !='' &&
|
||||
email != '' &&
|
||||
password != '' &&
|
||||
passwordAgain != '') {
|
||||
if (name.trim() !='' &&
|
||||
email.trim() != '' &&
|
||||
password.trim() != '' &&
|
||||
passwordAgain.trim() != '') {
|
||||
btnActive = true;
|
||||
} else {
|
||||
btnActive = false;
|
||||
@@ -42,28 +42,28 @@ class SysAdminAddOrgDialog extends React.Component {
|
||||
}
|
||||
|
||||
inputPassword = (e) => {
|
||||
let passwd = e.target.value.trim();
|
||||
let passwd = e.target.value;
|
||||
this.setState({
|
||||
password: passwd
|
||||
}, this.checkSubmitBtnActive);
|
||||
}
|
||||
|
||||
inputPasswordAgain = (e) => {
|
||||
let passwd = e.target.value.trim();
|
||||
let passwd = e.target.value;
|
||||
this.setState({
|
||||
passwordAgain: passwd
|
||||
}, this.checkSubmitBtnActive);
|
||||
}
|
||||
|
||||
inputEmail = (e) => {
|
||||
let email = e.target.value.trim();
|
||||
let email = e.target.value;
|
||||
this.setState({
|
||||
email: email
|
||||
}, this.checkSubmitBtnActive);
|
||||
}
|
||||
|
||||
inputName = (e) => {
|
||||
let name = e.target.value.trim();
|
||||
let name = e.target.value;
|
||||
this.setState({
|
||||
name: name
|
||||
}, this.checkSubmitBtnActive);
|
||||
@@ -76,9 +76,9 @@ class SysAdminAddOrgDialog extends React.Component {
|
||||
return;
|
||||
}
|
||||
const data = {
|
||||
orgName: name,
|
||||
ownerEmail: email,
|
||||
password: password
|
||||
orgName: name.trim(),
|
||||
ownerEmail: email.trim(),
|
||||
password: password.trim()
|
||||
};
|
||||
this.props.addOrg(data);
|
||||
this.toggle();
|
||||
|
@@ -81,7 +81,7 @@ class AddRepoDialog extends React.Component {
|
||||
/>
|
||||
</FormGroup>
|
||||
</Form>
|
||||
{ this.state.errMessage && <p className="error">{this.state.errMessage}</p> }
|
||||
{this.state.errMessage && <p className="error">{this.state.errMessage}</p> }
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
<Button color="primary" onClick={this.handleSubmit}>{gettext('Submit')}</Button>
|
||||
|
@@ -20,13 +20,10 @@ class SysAdminAddSysNotificationDialog extends React.Component {
|
||||
|
||||
handleChange = (e) => {
|
||||
const value = e.target.value;
|
||||
if (!value.trim()) {
|
||||
this.setState({isSubmitBtnActive: false});
|
||||
} else {
|
||||
this.setState({isSubmitBtnActive: true});
|
||||
}
|
||||
|
||||
this.setState({value: value});
|
||||
this.setState({
|
||||
value: value,
|
||||
isSubmitBtnActive: value.trim() != ''
|
||||
});
|
||||
}
|
||||
|
||||
handleSubmit = () => {
|
||||
|
@@ -23,13 +23,11 @@ class SysAdminCreateRepoDialog extends React.Component {
|
||||
}
|
||||
|
||||
handleRepoNameChange = (e) => {
|
||||
if (!e.target.value.trim()) {
|
||||
this.setState({isSubmitBtnActive: false});
|
||||
} else {
|
||||
this.setState({isSubmitBtnActive: true});
|
||||
}
|
||||
|
||||
this.setState({repoName: e.target.value});
|
||||
const value = e.target.value;
|
||||
this.setState({
|
||||
repoName: value,
|
||||
isSubmitBtnActive: value.trim()
|
||||
});
|
||||
}
|
||||
|
||||
handleSubmit = () => {
|
||||
|
@@ -24,10 +24,10 @@ class SysAdminSetOrgMaxUserNumberDialog extends React.Component {
|
||||
}
|
||||
|
||||
handleInputChange = (e) => {
|
||||
const value = e.target.value.trim();
|
||||
const value = e.target.value;
|
||||
this.setState({
|
||||
value: value,
|
||||
isSubmitBtnActive: value != ''
|
||||
isSubmitBtnActive: value.trim() != ''
|
||||
});
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ class SysAdminSetOrgMaxUserNumberDialog extends React.Component {
|
||||
}
|
||||
|
||||
handleSubmit = () => {
|
||||
this.props.updateValue(this.state.value);
|
||||
this.props.updateValue(this.state.value.trim());
|
||||
this.toggle();
|
||||
}
|
||||
|
||||
|
@@ -24,10 +24,10 @@ class SysAdminSetOrgNameDialog extends React.Component {
|
||||
}
|
||||
|
||||
handleInputChange = (e) => {
|
||||
const value = e.target.value.trim();
|
||||
const value = e.target.value;
|
||||
this.setState({
|
||||
name: value,
|
||||
isSubmitBtnActive: value != ''
|
||||
isSubmitBtnActive: value.trim() != ''
|
||||
});
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ class SysAdminSetOrgNameDialog extends React.Component {
|
||||
}
|
||||
|
||||
handleSubmit = () => {
|
||||
this.props.updateName(this.state.name);
|
||||
this.props.updateName(this.state.name.trim());
|
||||
this.toggle();
|
||||
}
|
||||
|
||||
|
@@ -21,7 +21,7 @@ class UpdateUser extends React.Component {
|
||||
}
|
||||
|
||||
handleInputChange = (e) => {
|
||||
const value = e.target.value.trim();
|
||||
const value = e.target.value;
|
||||
this.setState({
|
||||
value: value
|
||||
});
|
||||
@@ -35,7 +35,7 @@ class UpdateUser extends React.Component {
|
||||
}
|
||||
|
||||
handleSubmit = () => {
|
||||
this.props.updateValue(this.state.value);
|
||||
this.props.updateValue(this.state.value.trim());
|
||||
this.props.toggleDialog();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user