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