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

adjust publish repo

This commit is contained in:
Michael An
2019-04-22 18:21:25 +08:00
parent 19a6f20098
commit b0790ab3e2
2 changed files with 17 additions and 8 deletions

View File

@@ -35,7 +35,6 @@ class WikiSelectDialog extends React.Component {
onChange = (repo) => { onChange = (repo) => {
this.setState({ this.setState({
name: repo.repo_name,
repoID: repo.repo_id, repoID: repo.repo_id,
}); });
} }
@@ -53,15 +52,15 @@ class WikiSelectDialog extends React.Component {
render() { render() {
return ( return (
<Modal isOpen={true}> <Modal isOpen={true}>
<ModalHeader toggle={this.toggle}>{gettext('Publish a library')}</ModalHeader> <ModalHeader toggle={this.toggle}>{gettext('Publish a Library')}</ModalHeader>
<ModalBody className="dialog-list-container"> <ModalBody className="dialog-list-container">
<table> <table>
<thead> <thead>
<tr> <tr>
<th width='12%'>{/* select */}</th> <th width='6%'>{/* select */}</th>
<th width='13%'>{/* icon */}</th> <th width='9%'>{/* icon */}</th>
<th width='50%'>{gettext('Name')}</th> <th width='55%'>{gettext('Name')}</th>
<th width='25%'>{gettext('Last Update')}</th> <th width='30%'>{gettext('Last Update')}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@@ -80,7 +79,10 @@ class WikiSelectDialog extends React.Component {
</ModalBody> </ModalBody>
<ModalFooter> <ModalFooter>
<Button color="secondary" onClick={this.toggle}>{gettext('Cancel')}</Button> <Button color="secondary" onClick={this.toggle}>{gettext('Cancel')}</Button>
<Button color="primary" onClick={this.handleSubmit}>{gettext('Submit')}</Button> {this.state.repoID ?
<Button color="primary" onClick={this.handleSubmit}>{gettext('Submit')}</Button>:
<Button color="primary" disabled>{gettext('Submit')}</Button>
}
</ModalFooter> </ModalFooter>
</Modal> </Modal>
); );

View File

@@ -1,4 +1,5 @@
import React, { Component, Fragment } from 'react'; import React, { Component, Fragment } from 'react';
import PropTypes from 'prop-types';
import { Button } from 'reactstrap'; import { Button } from 'reactstrap';
import { seafileAPI } from '../../utils/seafile-api'; import { seafileAPI } from '../../utils/seafile-api';
import { gettext, loginUrl } from '../../utils/constants'; import { gettext, loginUrl } from '../../utils/constants';
@@ -9,6 +10,10 @@ import NewWikiDialog from '../../components/dialog/new-wiki-dialog';
import WikiSelectDialog from '../../components/dialog/wiki-select-dialog'; import WikiSelectDialog from '../../components/dialog/wiki-select-dialog';
import WikiListView from '../../components/wiki-list-view/wiki-list-view'; import WikiListView from '../../components/wiki-list-view/wiki-list-view';
const propTypes = {
onShowSidePanel: PropTypes.func.isRequired,
onSearchedClick: PropTypes.func.isRequired,
};
class Wikis extends Component { class Wikis extends Component {
constructor(props) { constructor(props) {
@@ -124,7 +129,7 @@ class Wikis extends Component {
<span className="sf2-icon-menu side-nav-toggle hidden-md-up d-md-none" title="Side Nav Menu" onClick={this.props.onShowSidePanel}></span> <span className="sf2-icon-menu side-nav-toggle hidden-md-up d-md-none" title="Side Nav Menu" onClick={this.props.onShowSidePanel}></span>
<div className="operation"> <div className="operation">
<Button className="btn btn-secondary operation-item" onClick={this.onSelectToggle}> <Button className="btn btn-secondary operation-item" onClick={this.onSelectToggle}>
<i className="fa fa-plus-square text-secondary mr-1"></i>{gettext('Publish a Library')} {gettext('Publish a Library')}
</Button> </Button>
</div> </div>
</div> </div>
@@ -175,4 +180,6 @@ class Wikis extends Component {
} }
} }
Wikis.propTypes = propTypes;
export default Wikis; export default Wikis;