#2637 新建文件前端去掉/的限制(可新建文件夹)
This commit is contained in:
parent
6a8dfae5a2
commit
7e06435ded
|
|
@ -59,7 +59,7 @@ function Datas({checkbox ,item , projectsId,owner}){
|
|||
<span className="mr20">{item.updated_at}更新</span>
|
||||
{item.blockchain_token_num && <span className="mr30"><img src={gold} alt="" width="13px" className="mr3"/>{item.blockchain_token_num}</span>}
|
||||
{item.milestone_name &&
|
||||
<Link to={`/${owner}/${projectsId}/milestones/${item.milestone_id}`} style={{maxWidth:item.blockchain_token_num ? "261px":"340px",color:"#898d9d"}} title={item.milestone_name} className="task-hide">
|
||||
<Link to={`/${owner}/${projectsId}/milestones/${item.milestone_id}`} onClick={()=>{window.scrollTo(0,0)}} style={{maxWidth:item.blockchain_token_num ? "261px":"340px",color:"#898d9d"}} title={item.milestone_name} className="task-hide">
|
||||
<i className="iconfont icon-lichengbeiicon1 font-12 mr3"></i>
|
||||
{item.milestone_name}
|
||||
</Link>
|
||||
|
|
|
|||
|
|
@ -295,6 +295,7 @@ function CoderDepot(props){
|
|||
let checkvalue = turnbar(enBranch);
|
||||
let enPath = turnbar(path);
|
||||
setType(type);
|
||||
window.scrollTo(0,0)
|
||||
props.history.push(`/${owner}/${projectsId}${`/tree/${checkvalue}`}${enPath?`/${enPath}`:""}`);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,11 +32,11 @@ function CoderDepotCatalogue({item , goToSubRoot , owner , projectsId , platform
|
|||
(
|
||||
item.submodule_git_url ?
|
||||
<React.Fragment>
|
||||
<a href={`${item.submodule_git_url.slice(0,item.submodule_git_url.length-4)}`} target="_self">
|
||||
<a href={`${item.submodule_git_url.slice(0,item.submodule_git_url.length-4)}`} onClick={()=>{window.scrollTo(0,0)}} target="_self">
|
||||
<i className={`iconfont ${typeIco[`${item.type}`]} mr8`}></i>{item.name}
|
||||
</a>
|
||||
<span className="ml2">@</span>
|
||||
<a href={`${item.submodule_git_url.slice(0,item.submodule_git_url.length-4)}/commits/${truncateCommitId(item.sha)}`} title={item.sha}>{truncateCommitId(item.sha)}</a>
|
||||
<a href={`${item.submodule_git_url.slice(0,item.submodule_git_url.length-4)}/commits/${truncateCommitId(item.sha)}`} onClick={()=>{window.scrollTo(0,0)}} title={item.sha}>{truncateCommitId(item.sha)}</a>
|
||||
</React.Fragment>
|
||||
:
|
||||
<React.Fragment>
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ class Index extends Component {
|
|||
checkFileName=(e)=>{
|
||||
let value = (e.target.value);
|
||||
//\需要单独判断
|
||||
const str = '!!@/::"“”<《》>||??%';
|
||||
const str = '!!@::"“”<《》>||??%';
|
||||
let reg = /\\/g;
|
||||
if(reg.test(value)){
|
||||
this.setState({
|
||||
|
|
@ -102,7 +102,7 @@ class Index extends Component {
|
|||
placeholder="命名文件..."
|
||||
onBlur={this.checkFileName}
|
||||
/>
|
||||
{checkName ? <p style={{color:"red",position:'absolute'}}>文件名不能包含下列任何字符:\{`!@/:"<>|?%`}</p>:"" }
|
||||
{checkName ? <p style={{color:"red",position:'absolute'}}>文件名不能包含下列任何字符:\{`!@:"<>|?%`}</p>:"" }
|
||||
</div>
|
||||
<a onClick={this.CancelAddFile} className="color-blue">
|
||||
取消
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ class UserSubmitComponent extends Component {
|
|||
const { getDetail } = this.props;
|
||||
getDetail && getDetail();
|
||||
}
|
||||
window.scrollTo(0,0);
|
||||
let url = `/${owner}/${projectsId}${values.branchname ? `/tree/${turnbar(values.branchname)}`: (branch ? `/tree/${turnbar(branch)}` : "")}`;
|
||||
this.props.history.push(url);
|
||||
}
|
||||
|
|
@ -112,6 +113,7 @@ class UserSubmitComponent extends Component {
|
|||
this.setState({ isSpin: false });
|
||||
if (result.data && result.data.status === 1) {
|
||||
let b = currentBranch || branch;
|
||||
window.scrollTo(0,0);
|
||||
let url = `/${owner}/${projectsId}${(values.branchname ? `/tree/${turnbar(values.branchname)}` : (b ? `/tree/${turnbar(b)}`:""))}`;
|
||||
this.props.history.push(url);
|
||||
this.props.showNotification("文件修改成功!");
|
||||
|
|
@ -267,6 +269,7 @@ class UserSubmitComponent extends Component {
|
|||
type="primary grey"
|
||||
onClick={() => {
|
||||
this.props.history.push(`/${owner}/${projectsId}`);
|
||||
window.scrollTo(0,0);
|
||||
}}
|
||||
className="mr20"
|
||||
>
|
||||
|
|
|
|||
Loading…
Reference in New Issue