mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-19 01:20:32 +00:00
Group to department (#6411)
* change group to department * update group quota * admin change group * optimize code * Update change-group-dialog.js * update * code-optimize * code-optimize * Update groups.py * update * fix group-name --------- Co-authored-by: 孙永强 <11704063+s-yongqiang@user.noreply.gitee.com> Co-authored-by: r350178982 <32759763+r350178982@users.noreply.github.com>
This commit is contained in:
49
frontend/src/components/dialog/change-group-dialog.js
Normal file
49
frontend/src/components/dialog/change-group-dialog.js
Normal file
@@ -0,0 +1,49 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Button, Modal, ModalHeader, ModalFooter, ModalBody } from 'reactstrap';
|
||||
import { Utils } from '../../utils/utils';
|
||||
import { gettext } from '../../utils/constants';
|
||||
|
||||
const propTypes = {
|
||||
groupName: PropTypes.string.isRequired,
|
||||
changeGroup2Department: PropTypes.func.isRequired,
|
||||
toggleDialog: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
class ChangeGroupDialog extends React.Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
selectedOption: null
|
||||
};
|
||||
}
|
||||
|
||||
submit = () => {
|
||||
this.props.changeGroup2Department();
|
||||
this.props.toggleDialog();
|
||||
};
|
||||
|
||||
render() {
|
||||
const groupName = '<span class="op-target">' + Utils.HTMLescape(this.props.groupName) + '</span>';
|
||||
const msg = gettext('Are you sure to change Group {placeholder} to Department ?').replace('{placeholder}', groupName);
|
||||
return (
|
||||
<Modal isOpen={true} toggle={this.props.toggleDialog}>
|
||||
<ModalHeader toggle={this.props.toggleDialog}>
|
||||
{gettext('Change group to departmen')}
|
||||
</ModalHeader>
|
||||
<ModalBody>
|
||||
<p dangerouslySetInnerHTML={{ __html: msg }}></p>
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
<Button color="secondary" onClick={this.props.toggleDialog}>{gettext('Cancel')}</Button>
|
||||
<Button color="primary" onClick={this.submit}>{gettext('Submit')}</Button>
|
||||
</ModalFooter>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
ChangeGroupDialog.propTypes = propTypes;
|
||||
|
||||
export default ChangeGroupDialog;
|
Reference in New Issue
Block a user