mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-01 15:09:14 +00:00
[eslint] updated eslintrc and improved the code (#4702)
This commit is contained in:
@@ -56,7 +56,7 @@ class SetQuotaDialog extends React.Component {
|
||||
type="text"
|
||||
className="form-control"
|
||||
value={quota}
|
||||
onKeyPress={this.handleKeyPress}
|
||||
onKeyPress={this.handleKeyPress}
|
||||
onChange={this.handleQuotaChange}
|
||||
/>
|
||||
<InputGroupAddon addonType="append">
|
||||
|
@@ -57,7 +57,7 @@ class AddDepartDialog extends React.Component {
|
||||
|
||||
handleChange = (e) => {
|
||||
this.setState({
|
||||
departName: e.target.value,
|
||||
departName: e.target.value,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -77,10 +77,10 @@ class AddDepartDialog extends React.Component {
|
||||
<Form>
|
||||
<FormGroup>
|
||||
<Label for="departName">{gettext('Name')}</Label>
|
||||
<Input
|
||||
id="departName"
|
||||
onKeyPress={this.handleKeyPress}
|
||||
value={this.state.departName}
|
||||
<Input
|
||||
id="departName"
|
||||
onKeyPress={this.handleKeyPress}
|
||||
value={this.state.departName}
|
||||
onChange={this.handleChange}
|
||||
innerRef={input => {this.newInput = input;}}
|
||||
/>
|
||||
|
@@ -22,7 +22,7 @@ class SysAdminAddInstitutionDialog extends React.Component {
|
||||
const value = e.target.value;
|
||||
this.setState({
|
||||
value: value,
|
||||
isSubmitBtnActive: value.trim() != ''
|
||||
isSubmitBtnActive: value.trim() != ''
|
||||
});
|
||||
}
|
||||
|
||||
|
@@ -25,7 +25,7 @@ class AddMemberDialog extends React.Component {
|
||||
handleSubmit = () => {
|
||||
if (!this.state.selectedOption) return;
|
||||
const emails = this.state.selectedOption.map(item => item.email);
|
||||
this.props.addUser(emails)
|
||||
this.props.addUser(emails);
|
||||
}
|
||||
|
||||
render() {
|
||||
|
@@ -139,7 +139,7 @@ class AddOrUpdateTermDialog extends React.Component {
|
||||
</ModalFooter>
|
||||
</Modal>
|
||||
{this.state.isConditionsEditorDialogShow && (
|
||||
<TermsEditorDialog
|
||||
<TermsEditorDialog
|
||||
content={this.state.text}
|
||||
onCommit={this.onUpdateContent}
|
||||
onCloseEditorDialog={this.onCloseEditorDialog}
|
||||
|
@@ -17,7 +17,7 @@ class SysAdminAddOrgDialog extends React.Component {
|
||||
password: '',
|
||||
passwordAgain: '',
|
||||
errorMsg: '',
|
||||
isSubmitBtnActive: false
|
||||
isSubmitBtnActive: false
|
||||
};
|
||||
}
|
||||
|
||||
@@ -93,14 +93,14 @@ class SysAdminAddOrgDialog extends React.Component {
|
||||
<Form autoComplete="off">
|
||||
<FormGroup>
|
||||
<Label>{gettext('Name')}</Label>
|
||||
<Input value={name} onChange={this.inputName} />
|
||||
<Input value={name} onChange={this.inputName} />
|
||||
</FormGroup>
|
||||
<FormGroup>
|
||||
<Label>
|
||||
{gettext('Owner')}
|
||||
<span className="small text-secondary ml-1 fas fa-question-circle" title={gettext('Owner can use admin panel in an organization, must be a new account.')}></span>
|
||||
</Label>
|
||||
<Input value={email} onChange={this.inputEmail} />
|
||||
<Input value={email} onChange={this.inputEmail} />
|
||||
</FormGroup>
|
||||
<FormGroup>
|
||||
<Label>{gettext('Password')}</Label>
|
||||
|
@@ -72,10 +72,10 @@ class AddRepoDialog extends React.Component {
|
||||
<Form>
|
||||
<FormGroup>
|
||||
<Label for="repoName">{gettext('Name')}</Label>
|
||||
<Input
|
||||
id="repoName"
|
||||
onKeyPress={this.handleKeyPress}
|
||||
value={this.state.repoName}
|
||||
<Input
|
||||
id="repoName"
|
||||
onKeyPress={this.handleKeyPress}
|
||||
value={this.state.repoName}
|
||||
onChange={this.handleChange}
|
||||
innerRef={input => {this.newInput = input;}}
|
||||
/>
|
||||
|
@@ -35,10 +35,10 @@ class SysAdminAddUserDialog extends React.Component {
|
||||
btnActive = true;
|
||||
} else {
|
||||
btnActive = false;
|
||||
}
|
||||
}
|
||||
this.setState({
|
||||
isSubmitBtnActive: btnActive
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
toggle = () => {
|
||||
@@ -90,8 +90,8 @@ class SysAdminAddUserDialog extends React.Component {
|
||||
updateRole = (role) => {
|
||||
this.setState({
|
||||
role: role
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
handleSubmit = () => {
|
||||
const { email, password, passwordAgain, name, role } = this.state;
|
||||
@@ -113,9 +113,9 @@ class SysAdminAddUserDialog extends React.Component {
|
||||
|
||||
render() {
|
||||
const { dialogTitle, showRole } = this.props;
|
||||
const {
|
||||
errorMsg, isPasswordVisible,
|
||||
email, name, role, password, passwordAgain,
|
||||
const {
|
||||
errorMsg, isPasswordVisible,
|
||||
email, name, role, password, passwordAgain,
|
||||
isSubmitBtnActive
|
||||
} = this.state;
|
||||
return (
|
||||
@@ -125,13 +125,13 @@ class SysAdminAddUserDialog extends React.Component {
|
||||
<Form autoComplete="off">
|
||||
<FormGroup>
|
||||
<Label>{gettext('Email')}</Label>
|
||||
<Input value={email} onChange={this.inputEmail} />
|
||||
<Input value={email} onChange={this.inputEmail} />
|
||||
</FormGroup>
|
||||
<FormGroup>
|
||||
<Label>{gettext('Name(optional)')}</Label>
|
||||
<Input type="text" value={name} onChange={this.inputName} />
|
||||
<Input type="text" value={name} onChange={this.inputName} />
|
||||
</FormGroup>
|
||||
{showRole &&
|
||||
{showRole &&
|
||||
<FormGroup>
|
||||
<Label>
|
||||
{gettext('Role')}
|
||||
@@ -143,7 +143,7 @@ class SysAdminAddUserDialog extends React.Component {
|
||||
currentRole={role}
|
||||
roleOptions={this.props.availableRoles}
|
||||
onRoleChanged={this.updateRole}
|
||||
/>
|
||||
/>
|
||||
</FormGroup>
|
||||
}
|
||||
<FormGroup>
|
||||
|
@@ -51,7 +51,7 @@ class SysAdminBatchAddAdminDialog extends React.Component {
|
||||
className="reviewer-select"
|
||||
placeholder={gettext('Search users...')}
|
||||
onSelectChange={this.handleSelectChange}
|
||||
/>
|
||||
/>
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
<Button color="secondary" onClick={this.toggle}>{gettext('Cancel')}</Button>
|
||||
|
@@ -68,11 +68,11 @@ class SysAdminCreateGroupDialog extends React.Component {
|
||||
<Form>
|
||||
<FormGroup>
|
||||
<Label for="groupName">{gettext('Name')}</Label>
|
||||
<Input
|
||||
<Input
|
||||
id="groupName"
|
||||
onKeyPress={this.handleKeyPress}
|
||||
innerRef={input => {this.newInput = input;}}
|
||||
value={this.state.groupName}
|
||||
onKeyPress={this.handleKeyPress}
|
||||
innerRef={input => {this.newInput = input;}}
|
||||
value={this.state.groupName}
|
||||
onChange={this.handleRepoNameChange}
|
||||
/>
|
||||
<Label className="mt-2">
|
||||
|
@@ -66,11 +66,11 @@ class SysAdminCreateRepoDialog extends React.Component {
|
||||
<Form>
|
||||
<FormGroup>
|
||||
<Label for="repoName">{gettext('Name')}</Label>
|
||||
<Input
|
||||
<Input
|
||||
id="repoName"
|
||||
onKeyPress={this.handleKeyPress}
|
||||
innerRef={input => {this.newInput = input;}}
|
||||
value={this.state.repoName}
|
||||
onKeyPress={this.handleKeyPress}
|
||||
innerRef={input => {this.newInput = input;}}
|
||||
value={this.state.repoName}
|
||||
onChange={this.handleRepoNameChange}
|
||||
/>
|
||||
</FormGroup>
|
||||
|
@@ -30,7 +30,7 @@ class SysAdminGroupAddMemberDialog extends React.Component {
|
||||
let emails = this.state.selectedOptions.map(item => item.email);
|
||||
this.props.addMembers(emails);
|
||||
this.props.toggle();
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const { isSubmitBtnDisabled } = this.state;
|
||||
@@ -44,7 +44,7 @@ class SysAdminGroupAddMemberDialog extends React.Component {
|
||||
className="reviewer-select"
|
||||
placeholder={gettext('Search users...')}
|
||||
onSelectChange={this.handleSelectChange}
|
||||
/>
|
||||
/>
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
<Button color="secondary" onClick={this.props.toggle}>{gettext('Cancel')}</Button>
|
||||
|
@@ -24,7 +24,7 @@ class SysAdminTransferGroupDialog extends React.Component {
|
||||
handleSelectChange = (option) => {
|
||||
this.setState({
|
||||
selectedOption: option,
|
||||
submitBtnDisabled: option == null
|
||||
submitBtnDisabled: option == null
|
||||
});
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ class SysAdminTransferGroupDialog extends React.Component {
|
||||
const receiver = this.state.selectedOption.email;
|
||||
this.props.transferGroup(receiver);
|
||||
this.props.toggleDialog();
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const { submitBtnDisabled } = this.state;
|
||||
@@ -50,7 +50,7 @@ class SysAdminTransferGroupDialog extends React.Component {
|
||||
className="reviewer-select"
|
||||
placeholder={gettext('Select a user')}
|
||||
onSelectChange={this.handleSelectChange}
|
||||
/>
|
||||
/>
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
<Button color="secondary" onClick={this.props.toggleDialog}>{gettext('Cancel')}</Button>
|
||||
|
@@ -35,7 +35,7 @@ class SysAdminLibHistorySettingDialog extends React.Component {
|
||||
noHistory: res.data.keep_days === 0 ? true : false,
|
||||
autoHistory: res.data.keep_days > 0 ? true : false,
|
||||
disabled: res.data.keep_days > 0 ? false : true,
|
||||
expireDays: res.data.keep_days > 0 ? res.data.keep_days : 30,
|
||||
expireDays: res.data.keep_days > 0 ? res.data.keep_days : 30,
|
||||
});
|
||||
}).catch(error => {
|
||||
let errMessage = Utils.getErrorMsg(error);
|
||||
@@ -51,7 +51,7 @@ class SysAdminLibHistorySettingDialog extends React.Component {
|
||||
let repoID = this.props.repoID;
|
||||
let reg = /^-?\d+$/;
|
||||
let flag = reg.test(days);
|
||||
if (flag) {
|
||||
if (flag) {
|
||||
let message = gettext('Successfully set library history.');
|
||||
seafileAPI.sysAdminUpdateRepoHistorySetting(repoID, days).then(res => {
|
||||
toaster.success(message);
|
||||
@@ -94,7 +94,7 @@ class SysAdminLibHistorySettingDialog extends React.Component {
|
||||
});
|
||||
} else {
|
||||
this.setState({
|
||||
disabled: false
|
||||
disabled: false
|
||||
});
|
||||
}
|
||||
|
||||
@@ -126,11 +126,11 @@ class SysAdminLibHistorySettingDialog extends React.Component {
|
||||
<FormGroup check>
|
||||
<Input type="radio" name="radio1" checked={this.state.autoHistory} onChange={() =>{this.setLimitDays('autoHistory');}}/>{' '}
|
||||
<Label>{gettext('Only keep a period of history:')}</Label>
|
||||
<Input
|
||||
type="text"
|
||||
className="expire-input"
|
||||
<Input
|
||||
type="text"
|
||||
className="expire-input"
|
||||
value={this.state.expireDays}
|
||||
onChange={this.onChange}
|
||||
onChange={this.onChange}
|
||||
disabled={this.state.disabled}
|
||||
onKeyDown={this.handleKeyPress}
|
||||
/>{' '}
|
||||
|
@@ -71,7 +71,7 @@ class LogsExportExcelDialog extends React.Component {
|
||||
|
||||
handleEndChange = (e) => {
|
||||
const endDateStr = e.target.value.trim();
|
||||
this.setState({
|
||||
this.setState({
|
||||
endDateStr: endDateStr,
|
||||
errMsg: '',
|
||||
});
|
||||
|
@@ -26,7 +26,7 @@ class SysAdminRepoTransferDialog extends React.Component {
|
||||
submit = () => {
|
||||
let user = this.state.selectedOption;
|
||||
this.props.submit(user);
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const repoName = this.props.repoName;
|
||||
@@ -45,7 +45,7 @@ class SysAdminRepoTransferDialog extends React.Component {
|
||||
className="reviewer-select"
|
||||
placeholder={gettext('Search users...')}
|
||||
onSelectChange={this.handleSelectChange}
|
||||
/>
|
||||
/>
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
<Button color="secondary" onClick={this.props.toggle}>{gettext('Cancel')}</Button>
|
||||
|
@@ -44,7 +44,7 @@ class SetGroupQuotaDialog extends React.Component {
|
||||
} else {
|
||||
const err = gettext('Quota is invalid.');
|
||||
this.setState({ errMessage: err });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
handleChange = (e) => {
|
||||
@@ -66,8 +66,8 @@ class SetGroupQuotaDialog extends React.Component {
|
||||
<ModalBody>
|
||||
<InputGroup>
|
||||
<Input
|
||||
onKeyPress={this.handleKeyPress}
|
||||
value={this.state.quota}
|
||||
onKeyPress={this.handleKeyPress}
|
||||
value={this.state.quota}
|
||||
onChange={this.handleChange}
|
||||
innerRef={input => {this.newInput = input;}}
|
||||
/>
|
||||
|
@@ -51,13 +51,13 @@ class SysAdminSetOrgMaxUserNumberDialog extends React.Component {
|
||||
<ModalBody>
|
||||
<Form>
|
||||
<FormGroup>
|
||||
<Input
|
||||
type="text"
|
||||
className="form-control"
|
||||
value={value}
|
||||
onKeyPress={this.handleKeyPress}
|
||||
onChange={this.handleInputChange}
|
||||
/>
|
||||
<Input
|
||||
type="text"
|
||||
className="form-control"
|
||||
value={value}
|
||||
onKeyPress={this.handleKeyPress}
|
||||
onChange={this.handleInputChange}
|
||||
/>
|
||||
</FormGroup>
|
||||
</Form>
|
||||
</ModalBody>
|
||||
|
@@ -51,12 +51,12 @@ class SysAdminSetOrgNameDialog extends React.Component {
|
||||
<ModalBody>
|
||||
<Form>
|
||||
<FormGroup>
|
||||
<Input
|
||||
type="text"
|
||||
value={name}
|
||||
onKeyPress={this.handleKeyPress}
|
||||
onChange={this.handleInputChange}
|
||||
/>
|
||||
<Input
|
||||
type="text"
|
||||
value={name}
|
||||
onKeyPress={this.handleKeyPress}
|
||||
onChange={this.handleInputChange}
|
||||
/>
|
||||
</FormGroup>
|
||||
</Form>
|
||||
</ModalBody>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import React, { Fragment } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Modal, ModalHeader, ModalBody, TabContent, TabPane, Nav, NavItem, NavLink } from 'reactstrap';
|
||||
import { Modal, ModalHeader, ModalBody, TabContent, TabPane, Nav, NavItem, NavLink } from 'reactstrap';
|
||||
import { gettext } from '../../../utils/constants';
|
||||
import SysAdminShareToUser from './sysadmin-share-to-user';
|
||||
import SysAdminShareToGroup from './sysadmin-share-to-group';
|
||||
|
@@ -17,7 +17,7 @@ class GroupItem extends React.Component {
|
||||
isOperationShow: false
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
onMouseEnter = () => {
|
||||
this.setState({isOperationShow: true});
|
||||
}
|
||||
@@ -43,7 +43,7 @@ class GroupItem extends React.Component {
|
||||
<tr onMouseEnter={this.onMouseEnter} onMouseLeave={this.onMouseLeave}>
|
||||
<td className='name'>{item.group_name}</td>
|
||||
<td>
|
||||
<SharePermissionEditor
|
||||
<SharePermissionEditor
|
||||
isTextMode={true}
|
||||
isEditIconShow={this.state.isOperationShow}
|
||||
currentPermission={currentPermission}
|
||||
@@ -54,7 +54,7 @@ class GroupItem extends React.Component {
|
||||
<td>
|
||||
<span
|
||||
className={`sf2-icon-x3 action-icon ${this.state.isOperationShow ? '' : 'hide'}`}
|
||||
onClick={this.deleteShareItem}
|
||||
onClick={this.deleteShareItem}
|
||||
title={gettext('Delete')}
|
||||
>
|
||||
</span>
|
||||
@@ -72,9 +72,9 @@ class GroupList extends React.Component {
|
||||
<tbody>
|
||||
{items.map((item, index) => {
|
||||
return (
|
||||
<GroupItem
|
||||
key={index}
|
||||
item={item}
|
||||
<GroupItem
|
||||
key={index}
|
||||
item={item}
|
||||
permissions={this.props.permissions}
|
||||
deleteShareItem={this.props.deleteShareItem}
|
||||
onChangeUserPermission={this.props.onChangeUserPermission}
|
||||
@@ -143,7 +143,7 @@ class SysAdminShareToGroup extends React.Component {
|
||||
}
|
||||
|
||||
listSharedGroups = () => {
|
||||
let repoID = this.props.repoID;
|
||||
let repoID = this.props.repoID;
|
||||
seafileAPI.sysAdminListRepoSharedItems(repoID, 'group').then((res) => {
|
||||
if(res.data.length !== 0) {
|
||||
this.setState({
|
||||
@@ -162,7 +162,7 @@ class SysAdminShareToGroup extends React.Component {
|
||||
|
||||
shareToGroup = () => {
|
||||
let groups = [];
|
||||
let repoID = this.props.repoID;
|
||||
let repoID = this.props.repoID;
|
||||
if (this.state.selectedOption && this.state.selectedOption.length > 0 ) {
|
||||
for (let i = 0; i < this.state.selectedOption.length; i ++) {
|
||||
groups[i] = this.state.selectedOption[i].id;
|
||||
@@ -189,10 +189,10 @@ class SysAdminShareToGroup extends React.Component {
|
||||
}
|
||||
|
||||
deleteShareItem = (groupID) => {
|
||||
let repoID = this.props.repoID;
|
||||
let repoID = this.props.repoID;
|
||||
seafileAPI.sysAdminDeleteRepoSharedItem(repoID, 'group', groupID).then(() => {
|
||||
this.setState({
|
||||
sharedItems: this.state.sharedItems.filter(item => { return item.group_id !== groupID; })
|
||||
sharedItems: this.state.sharedItems.filter(item => { return item.group_id !== groupID; })
|
||||
});
|
||||
}).catch(error => {
|
||||
let errMessage = Utils.getErrorMsg(error);
|
||||
@@ -210,7 +210,7 @@ class SysAdminShareToGroup extends React.Component {
|
||||
toaster.danger(errMessage);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
updateSharedItems = (item, permission) => {
|
||||
let groupID = item.group_id;
|
||||
let sharedItems = this.state.sharedItems.map(sharedItem => {
|
||||
@@ -251,7 +251,7 @@ class SysAdminShareToGroup extends React.Component {
|
||||
/>
|
||||
</td>
|
||||
<td>
|
||||
<SharePermissionEditor
|
||||
<SharePermissionEditor
|
||||
isTextMode={false}
|
||||
isEditIconShow={false}
|
||||
currentPermission={this.state.permission}
|
||||
@@ -263,7 +263,7 @@ class SysAdminShareToGroup extends React.Component {
|
||||
<Button onClick={this.shareToGroup}>{gettext('Submit')}</Button>
|
||||
</td>
|
||||
</tr>
|
||||
{this.state.errorMsg.length > 0 &&
|
||||
{this.state.errorMsg.length > 0 &&
|
||||
this.state.errorMsg.map((item, index) => {
|
||||
let errMessage = item.group_name + ': ' + item.error_msg;
|
||||
return (
|
||||
@@ -271,7 +271,7 @@ class SysAdminShareToGroup extends React.Component {
|
||||
<td colSpan={3}><p className="error">{errMessage}</p></td>
|
||||
</tr>
|
||||
);
|
||||
})
|
||||
})
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -284,10 +284,10 @@ class SysAdminShareToGroup extends React.Component {
|
||||
<th width="15%"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<GroupList
|
||||
<GroupList
|
||||
items={this.state.sharedItems}
|
||||
permissions={this.permissions}
|
||||
deleteShareItem={this.deleteShareItem}
|
||||
deleteShareItem={this.deleteShareItem}
|
||||
onChangeUserPermission={this.onChangeUserPermission}
|
||||
/>
|
||||
</table>
|
||||
|
@@ -16,7 +16,7 @@ class UserItem extends React.Component {
|
||||
isOperationShow: false
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
onMouseEnter = () => {
|
||||
this.setState({isOperationShow: true});
|
||||
}
|
||||
@@ -29,7 +29,7 @@ class UserItem extends React.Component {
|
||||
let item = this.props.item;
|
||||
this.props.deleteShareItem(item.user_email);
|
||||
}
|
||||
|
||||
|
||||
onChangeUserPermission = (permission) => {
|
||||
let item = this.props.item;
|
||||
this.props.onChangeUserPermission(item, permission);
|
||||
@@ -42,7 +42,7 @@ class UserItem extends React.Component {
|
||||
<tr onMouseEnter={this.onMouseEnter} onMouseLeave={this.onMouseLeave}>
|
||||
<td className="name">{item.user_name}</td>
|
||||
<td>
|
||||
<SharePermissionEditor
|
||||
<SharePermissionEditor
|
||||
isTextMode={true}
|
||||
isEditIconShow={this.state.isOperationShow}
|
||||
currentPermission={currentPermission}
|
||||
@@ -53,7 +53,7 @@ class UserItem extends React.Component {
|
||||
<td>
|
||||
<span
|
||||
className={`sf2-icon-x3 action-icon ${this.state.isOperationShow ? '' : 'hide'}`}
|
||||
onClick={this.deleteShareItem}
|
||||
onClick={this.deleteShareItem}
|
||||
title={gettext('Delete')}
|
||||
>
|
||||
</span>
|
||||
@@ -71,9 +71,9 @@ class UserList extends React.Component {
|
||||
<tbody>
|
||||
{items.map((item, index) => {
|
||||
return (
|
||||
<UserItem
|
||||
key={index}
|
||||
item={item}
|
||||
<UserItem
|
||||
key={index}
|
||||
item={item}
|
||||
permissions={this.props.permissions}
|
||||
deleteShareItem={this.props.deleteShareItem}
|
||||
onChangeUserPermission={this.props.onChangeUserPermission}
|
||||
@@ -164,13 +164,13 @@ class SysAdminShareToUser extends React.Component {
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
deleteShareItem = (useremail) => {
|
||||
let repoID = this.props.repoID;
|
||||
seafileAPI.sysAdminDeleteRepoSharedItem(repoID, 'user', useremail).then(res => {
|
||||
this.setState({
|
||||
sharedItems: this.state.sharedItems.filter( item => { return item.user_email !== useremail; })
|
||||
sharedItems: this.state.sharedItems.filter( item => { return item.user_email !== useremail; })
|
||||
});
|
||||
}).catch(error => {
|
||||
let errMessage = Utils.getErrorMsg(error);
|
||||
@@ -188,7 +188,7 @@ class SysAdminShareToUser extends React.Component {
|
||||
toaster.danger(errMessage);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
updateSharedItems = (item, permission) => {
|
||||
let username = item.user_name;
|
||||
let sharedItems = this.state.sharedItems.map(sharedItem => {
|
||||
@@ -226,7 +226,7 @@ class SysAdminShareToUser extends React.Component {
|
||||
/>
|
||||
</td>
|
||||
<td>
|
||||
<SharePermissionEditor
|
||||
<SharePermissionEditor
|
||||
isTextMode={false}
|
||||
isEditIconShow={false}
|
||||
currentPermission={this.state.permission}
|
||||
@@ -264,10 +264,10 @@ class SysAdminShareToUser extends React.Component {
|
||||
<th width="15%"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<UserList
|
||||
<UserList
|
||||
items={sharedItems}
|
||||
permissions={this.permissions}
|
||||
deleteShareItem={this.deleteShareItem}
|
||||
deleteShareItem={this.deleteShareItem}
|
||||
onChangeUserPermission={this.onChangeUserPermission}
|
||||
/>
|
||||
</table>
|
||||
|
@@ -12,14 +12,14 @@ class SysAdminUnlinkDevice extends React.Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
this.state = {
|
||||
inputChecked: false
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
handleInputChange = (e) => {
|
||||
this.setState({
|
||||
inputChecked: e.target.checked
|
||||
inputChecked: e.target.checked
|
||||
});
|
||||
}
|
||||
|
||||
|
@@ -47,12 +47,12 @@ class UpdateUser extends React.Component {
|
||||
<ModalBody>
|
||||
<Form>
|
||||
<FormGroup>
|
||||
<Input
|
||||
type="text"
|
||||
value={this.state.value}
|
||||
onKeyPress={this.handleKeyPress}
|
||||
onChange={this.handleInputChange}
|
||||
/>
|
||||
<Input
|
||||
type="text"
|
||||
value={this.state.value}
|
||||
onKeyPress={this.handleKeyPress}
|
||||
onChange={this.handleInputChange}
|
||||
/>
|
||||
</FormGroup>
|
||||
</Form>
|
||||
</ModalBody>
|
||||
|
Reference in New Issue
Block a user