mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-08 10:22:46 +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 = {
|
const propTypes = {
|
||||||
repoID: PropTypes.string.isRequired,
|
repoID: PropTypes.string.isRequired,
|
||||||
|
onRepoTagCreated: PropTypes.func,
|
||||||
toggleCancel: PropTypes.func.isRequired,
|
toggleCancel: PropTypes.func.isRequired,
|
||||||
onClose: PropTypes.func.isRequired
|
onClose: PropTypes.func.isRequired
|
||||||
};
|
};
|
||||||
@@ -38,7 +39,9 @@ class CreateTagDialog extends React.Component {
|
|||||||
let name = this.state.tagName;
|
let name = this.state.tagName;
|
||||||
let color = this.state.tagColor;
|
let color = this.state.tagColor;
|
||||||
let repoID = this.props.repoID;
|
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();
|
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() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<Modal isOpen={true} toggle={this.props.toggleCancel}>
|
<Modal isOpen={true} toggle={this.props.toggleCancel}>
|
||||||
@@ -200,6 +207,7 @@ class EditFileTagDialog extends React.Component {
|
|||||||
repoID={this.props.repoID}
|
repoID={this.props.repoID}
|
||||||
onClose={this.props.toggleCancel}
|
onClose={this.props.toggleCancel}
|
||||||
toggleCancel={this.createNewTag}
|
toggleCancel={this.createNewTag}
|
||||||
|
onRepoTagCreated={this.onRepoTagCreated}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
</Modal>
|
</Modal>
|
||||||
|
Reference in New Issue
Block a user