diff --git a/src/forge/Newfile/UserSubmitComponent.js b/src/forge/Newfile/UserSubmitComponent.js
index aa4bba6e9..e67597cb2 100644
--- a/src/forge/Newfile/UserSubmitComponent.js
+++ b/src/forge/Newfile/UserSubmitComponent.js
@@ -63,13 +63,13 @@ class UserSubmitComponent extends Component {
// 提交变更
subMitFrom = () => {
- const { filepath, content, editor_type } = this.props;
+ const { filepath, content, editor_type , checkName} = this.props;
const { branch, projectsId , owner } = this.props.match.params;
const { submitType, filename } = this.state;
this.setState({ isSpin: true });
let path = editor_type === "upload" ? filepath : filepath.substr(1);
this.props.form.validateFieldsAndScroll((err, values) => {
- if (!err) {
+ if (!err && !checkName) {
const url = `/${owner}/${projectsId}/create_file.json`;
axios.post(url, {
filepath: filename ? filename : path,
@@ -103,13 +103,13 @@ class UserSubmitComponent extends Component {
// 确认修改文件
UpdateFile = () => {
this.setState({ isSpin: true });
- const { branch, detail, content , currentBranch } = this.props;
+ const { branch, detail, content , currentBranch ,checkName } = this.props;
const { projectsId , owner } = this.props.match.params;
const { submitType } = this.state;
const url = `/${owner}/${projectsId}/update_file.json`;
let b = currentBranch || branch;
this.props.form.validateFieldsAndScroll((err, values) => {
- if (!err) {
+ if (!err && !checkName) {
axios
.put(url, {
filepath: detail.path,
diff --git a/src/forge/Newfile/index.css b/src/forge/Newfile/index.css
index 0bda4711a..60156a348 100644
--- a/src/forge/Newfile/index.css
+++ b/src/forge/Newfile/index.css
@@ -9,6 +9,7 @@
.setInputAddon{
width: 350px;
margin-right: 20px;
+ position: relative;
}
.setInputAddon .ant-input-group-addon{
height: 30px;
@@ -16,6 +17,13 @@
border: 1px solid #d9d9d9!important;
border-right: none!important;
}
+.setInputAddon.red .ant-input-group-addon{
+ border-color: red!important;
+}
+.setInputAddon.red .ant-input-group > .ant-input:last-child{
+ border-color: red!important;
+ border-left-color: #d9d9d9!important;
+}
.editorBorder .editorBorderBox{
border:1px solid #d0d0d0;
border-radius: 2px;
diff --git a/src/forge/Newfile/m_editor.js b/src/forge/Newfile/m_editor.js
index d4446e3f2..58a79403e 100644
--- a/src/forge/Newfile/m_editor.js
+++ b/src/forge/Newfile/m_editor.js
@@ -34,7 +34,7 @@ class m_editor extends Component {
render() {
const { editorValue , changeValue } = this.state;
- const { readOnly, editorType, currentBranch , descName } = this.props;
+ const { readOnly, editorType, currentBranch , descName , checkName } = this.props;
const editor_options = {
lineNumbers: "on",
lineWrapping: true, //强制换行
@@ -76,6 +76,7 @@ class m_editor extends Component {
editor_type={editorType}
currentBranch={currentBranch}
descName={descName}
+ checkName={checkName}
>