1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-24 04:48:03 +00:00

Sys department (#5471)

* [system admin - department] redesigned it (split it into 3 tabs/pages)

* [system admin - department] fixup & improvements; code cleanup
This commit is contained in:
llj
2023-05-15 10:57:46 +08:00
committed by GitHub
parent 57a135b9d5
commit 495141c287
19 changed files with 773 additions and 598 deletions

View File

@@ -8,7 +8,7 @@ import { Utils } from '../../../utils/utils';
const propTypes = {
toggle: PropTypes.func.isRequired,
groupID: PropTypes.string.isRequired,
onRepoChanged: PropTypes.func.isRequired,
onAddNewRepo: PropTypes.func.isRequired
};
class AddRepoDialog extends React.Component {
@@ -26,7 +26,7 @@ class AddRepoDialog extends React.Component {
if (isValid) {
seafileAPI.sysAdminAddRepoInDepartment(this.props.groupID, this.state.repoName.trim()).then((res) => {
this.props.toggle();
this.props.onRepoChanged();
this.props.onAddNewRepo(res.data);
}).catch(error => {
let errorMsg = Utils.getErrorMsg(error);
this.setState({ errMessage: errorMsg });
@@ -78,6 +78,7 @@ class AddRepoDialog extends React.Component {
{this.state.errMessage && <p className="error">{this.state.errMessage}</p> }
</ModalBody>
<ModalFooter>
<Button color="secondary" onClick={this.props.toggle}>{gettext('Cancel')}</Button>
<Button color="primary" onClick={this.handleSubmit}>{gettext('Submit')}</Button>
</ModalFooter>
</Modal>