diff --git a/src/forge/Main/CoderDepot.jsx b/src/forge/Main/CoderDepot.jsx index 0d4c22016..a33e02166 100644 --- a/src/forge/Main/CoderDepot.jsx +++ b/src/forge/Main/CoderDepot.jsx @@ -225,6 +225,10 @@ function CoderDepot(props){ } }) } + + let n = fileInfo && fileInfo.name; + const mdFlag = n && n.substring(n.length-3,n.length) === ".md"; + return( setOpenModal(false)} onOk={okUpdate}/> @@ -335,6 +339,7 @@ function CoderDepot(props){ {...props} detail={fileInfo} readOnly={readOnly} + md={mdFlag} onEdit={onEdit} currentBranch={branchName || (projectDetail && projectDetail.default_branch)} > diff --git a/src/forge/Main/CoderRootFileDetail.js b/src/forge/Main/CoderRootFileDetail.js index 19930155b..13939981d 100644 --- a/src/forge/Main/CoderRootFileDetail.js +++ b/src/forge/Main/CoderRootFileDetail.js @@ -24,7 +24,7 @@ class CoderRootFileDetail extends Component { } componentDidMount = () => { - const { detail } = this.props; + const { detail , mdFlag } = this.props; this.setState({ value: detail.content, }); @@ -176,9 +176,10 @@ class CoderRootFileDetail extends Component { current_user, isManager, isDeveloper, - md, currentBranch, - platform + platform, + md, + type } = this.props; const { language, languages, description } = this.state; let flag = current_user && current_user.login && (isManager || isDeveloper); @@ -197,17 +198,18 @@ class CoderRootFileDetail extends Component { {readOnly ? ( { - detail.direct_download ? - "" - : + !detail.direct_download? this.DownLoadFile(detail.download_url)} className="ml20"> - this.EditFile(false)} className="ml20"> - - - + { + type !==2 && + this.EditFile(false)} className="ml20"> + + + } + :"" } ) : ( @@ -238,18 +240,21 @@ class CoderRootFileDetail extends Component { )} - - - - - - + { + type !==2 && + + + + + + } + )}

diff --git a/src/forge/Main/Index.scss b/src/forge/Main/Index.scss index ed6b7da4b..19b52cada 100644 --- a/src/forge/Main/Index.scss +++ b/src/forge/Main/Index.scss @@ -282,6 +282,7 @@ border-radius: 4px; .ant-dropdown-menu-item{ border-radius: 8px; + text-align: left; a{ width: 350px; overflow: hidden; diff --git a/src/forge/Main/list.css b/src/forge/Main/list.css index 07991f6a1..9854a0a31 100644 --- a/src/forge/Main/list.css +++ b/src/forge/Main/list.css @@ -281,7 +281,6 @@ height:100%; } .files-md{ - border:1px solid #eee; padding:20px; } /* 详情-代码 */