mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-07 09:51:26 +00:00
fix transfer repo to department (#6936)
This commit is contained in:
@@ -28,9 +28,11 @@ const propTypes = {
|
|||||||
canTransferToDept: PropTypes.bool,
|
canTransferToDept: PropTypes.bool,
|
||||||
isOrgAdmin: PropTypes.bool,
|
isOrgAdmin: PropTypes.bool,
|
||||||
isSysAdmin: PropTypes.bool,
|
isSysAdmin: PropTypes.bool,
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const TRANS_USER = 'transUser';
|
||||||
|
const TRANS_DEPART = 'transDepart';
|
||||||
|
|
||||||
class TransferDialog extends React.Component {
|
class TransferDialog extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
@@ -39,7 +41,7 @@ class TransferDialog extends React.Component {
|
|||||||
errorMsg: [],
|
errorMsg: [],
|
||||||
transferToUser: true,
|
transferToUser: true,
|
||||||
transferToGroup: false,
|
transferToGroup: false,
|
||||||
activeTab: 'transUser'
|
activeTab: TRANS_USER
|
||||||
};
|
};
|
||||||
this.options = [];
|
this.options = [];
|
||||||
}
|
}
|
||||||
@@ -49,11 +51,17 @@ class TransferDialog extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
submit = () => {
|
submit = () => {
|
||||||
|
const { activeTab } = this.state;
|
||||||
|
if (activeTab === TRANS_DEPART) {
|
||||||
|
let department = this.state.selectedOption;
|
||||||
|
this.props.submit(department);
|
||||||
|
} else if (activeTab === TRANS_USER) {
|
||||||
let selectedOption = this.state.selectedOption;
|
let selectedOption = this.state.selectedOption;
|
||||||
if (selectedOption && selectedOption[0]) {
|
if (selectedOption && selectedOption[0]) {
|
||||||
let user = selectedOption[0];
|
let user = selectedOption[0];
|
||||||
this.props.submit(user);
|
this.props.submit(user);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
@@ -123,14 +131,24 @@ class TransferDialog extends React.Component {
|
|||||||
<Fragment>
|
<Fragment>
|
||||||
<div className="transfer-dialog-side">
|
<div className="transfer-dialog-side">
|
||||||
<Nav pills>
|
<Nav pills>
|
||||||
<NavItem role="tab" aria-selected={activeTab === 'transUser'} aria-controls="transfer-user-panel">
|
<NavItem role="tab" aria-selected={activeTab === TRANS_USER} aria-controls="transfer-user-panel">
|
||||||
<NavLink className={activeTab === 'transUser' ? 'active' : ''} onClick={(this.toggle.bind(this, 'transUser'))} tabIndex="0" onKeyDown={this.onTabKeyDown}>
|
<NavLink
|
||||||
|
className={activeTab === TRANS_USER ? 'active' : ''}
|
||||||
|
onClick={(this.toggle.bind(this, TRANS_USER))}
|
||||||
|
tabIndex="0"
|
||||||
|
onKeyDown={this.onTabKeyDown}
|
||||||
|
>
|
||||||
{gettext('Transfer to user')}
|
{gettext('Transfer to user')}
|
||||||
</NavLink>
|
</NavLink>
|
||||||
</NavItem>
|
</NavItem>
|
||||||
{isPro &&
|
{isPro &&
|
||||||
<NavItem role="tab" aria-selected={activeTab === 'transDepart'} aria-controls="transfer-depart-panel">
|
<NavItem role="tab" aria-selected={activeTab === TRANS_DEPART} aria-controls="transfer-depart-panel">
|
||||||
<NavLink className={activeTab === 'transDepart' ? 'active' : ''} onClick={this.toggle.bind(this, 'transDepart')} tabIndex="0" onKeyDown={this.onTabKeyDown}>
|
<NavLink
|
||||||
|
className={activeTab === TRANS_DEPART ? 'active' : ''}
|
||||||
|
onClick={this.toggle.bind(this, TRANS_DEPART)}
|
||||||
|
tabIndex="0"
|
||||||
|
onKeyDown={this.onTabKeyDown}
|
||||||
|
>
|
||||||
{gettext('Transfer to department')}
|
{gettext('Transfer to department')}
|
||||||
</NavLink>
|
</NavLink>
|
||||||
</NavItem>}
|
</NavItem>}
|
||||||
|
Reference in New Issue
Block a user