mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-03 07:55:36 +00:00
create a tag and checked by default (#3226)
* create a tag and checked by default * repair code
This commit is contained in:
@@ -6,6 +6,7 @@ import { seafileAPI } from '../../utils/seafile-api';
|
||||
|
||||
const propTypes = {
|
||||
repoID: PropTypes.string.isRequired,
|
||||
onRepoTagCreated: PropTypes.func,
|
||||
toggleCancel: PropTypes.func.isRequired,
|
||||
onClose: PropTypes.func.isRequired
|
||||
};
|
||||
@@ -38,7 +39,9 @@ class CreateTagDialog extends React.Component {
|
||||
let name = this.state.tagName;
|
||||
let color = this.state.tagColor;
|
||||
let repoID = this.props.repoID;
|
||||
seafileAPI.createRepoTag(repoID, name, color).then(() =>{
|
||||
seafileAPI.createRepoTag(repoID, name, color).then((res) => {
|
||||
let repoTagID = res.data.repo_tag.repo_tag_id;
|
||||
this.props.onRepoTagCreated(repoTagID);
|
||||
this.props.toggleCancel();
|
||||
});
|
||||
}
|
||||
|
@@ -182,6 +182,13 @@ class EditFileTagDialog extends React.Component {
|
||||
});
|
||||
}
|
||||
|
||||
onRepoTagCreated = (repoTagID) => {
|
||||
let {repoID, filePath} = this.props;
|
||||
seafileAPI.addFileTag(repoID, filePath, repoTagID).then(() => {
|
||||
this.props.onFileTagChanged();
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Modal isOpen={true} toggle={this.props.toggleCancel}>
|
||||
@@ -200,6 +207,7 @@ class EditFileTagDialog extends React.Component {
|
||||
repoID={this.props.repoID}
|
||||
onClose={this.props.toggleCancel}
|
||||
toggleCancel={this.createNewTag}
|
||||
onRepoTagCreated={this.onRepoTagCreated}
|
||||
/>
|
||||
}
|
||||
</Modal>
|
||||
|
Reference in New Issue
Block a user