From 258b891966310063f9ec2af4f92d7033cd3553de Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Tue, 13 Jun 2023 17:43:59 +0800 Subject: [PATCH 1/9] =?UTF-8?q?cla=20=E6=96=B0=E5=BB=BA=E5=92=8C=E4=B8=BB?= =?UTF-8?q?=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Component/Setnav.jsx | 4 +- src/forge/Team/Setting/TeamSettingIndex.jsx | 27 ++++++- src/forge/Team/Setting/cla/TeamSettingCLA.jsx | 19 +++++ .../Team/Setting/cla/TeamSettingCLAEdit.jsx | 68 ++++++++++++++++++ src/forge/Team/Setting/teamSetting.scss | 15 ++++ src/forge/Team/images/cla-icon-big.png | Bin 0 -> 743 bytes src/forge/Team/images/cla-icon.png | Bin 0 -> 2870 bytes src/forge/css/index.scss | 1 - 8 files changed, 131 insertions(+), 3 deletions(-) create mode 100644 src/forge/Team/Setting/cla/TeamSettingCLA.jsx create mode 100644 src/forge/Team/Setting/cla/TeamSettingCLAEdit.jsx create mode 100644 src/forge/Team/Setting/teamSetting.scss create mode 100644 src/forge/Team/images/cla-icon-big.png create mode 100644 src/forge/Team/images/cla-icon.png diff --git a/src/forge/Component/Setnav.jsx b/src/forge/Component/Setnav.jsx index 970121597..766081b2f 100644 --- a/src/forge/Component/Setnav.jsx +++ b/src/forge/Component/Setnav.jsx @@ -14,7 +14,9 @@ export default(({ header , nav })=>{
  • - {item.name} + {item.icon && } + {item.img && } + {item.name}

  • diff --git a/src/forge/Team/Setting/TeamSettingIndex.jsx b/src/forge/Team/Setting/TeamSettingIndex.jsx index b5f4f368c..8fb786b6a 100644 --- a/src/forge/Team/Setting/TeamSettingIndex.jsx +++ b/src/forge/Team/Setting/TeamSettingIndex.jsx @@ -2,10 +2,12 @@ import React , { useEffect , useState } from 'react'; import { Box , Long , Short , Gap } from '../../Component/layout'; import Title from '../../Component/Title'; import Setnav from '../../Component/Setnav'; +import './teamSetting.scss'; import { Route, Switch } from "react-router-dom"; import Loadable from "react-loadable"; import Loading from "../../../Loading"; +import claIcon from '../images/cla-icon.png'; const Group = Loadable({ @@ -28,6 +30,14 @@ const Hooks = Loadable({ loader: () => import("./TeamSettingHooks"), loading: Loading, }); +const CLA = Loadable({ + loader: () => import("./cla/TeamSettingCLA"), + loading: Loading, +}); +const CLANew = Loadable({ + loader: () => import("./cla/TeamSettingCLAEdit"), + loading: Loading, +}); export default (( props )=>{ const pathname = props.location.pathname; const OIdentifier = props.match.params.OIdentifier; @@ -48,7 +58,9 @@ export default (( props )=>{ a = 1; }else if(pathname === `/${OIdentifier}/setting/group`){ a = 3; - }else if(pathname === `/${OIdentifier}/setting/hooks`){ + // }else if(pathname === `/${OIdentifier}/setting/hooks`){ + // a = 4; + }else if(pathname.indexOf(`/${OIdentifier}/setting/cla`)>-1){ a = 4; } return a; @@ -60,6 +72,7 @@ export default (( props )=>{ {name:'组织成员管理',icon:"icon-zuzhichengyuan",href:`/${OIdentifier}/setting/member`}, {name:'组织团队管理',icon:"icon-zuzhixiangmu",href:`/${OIdentifier}/setting/group`}, // {name:'管理web钩子',icon:"icon-zhongqingdianxinicon10",href:`/${OIdentifier}/setting/hooks`} + {name:'CLA管理',img:claIcon,href:`/${OIdentifier}/setting/cla`} ], active } @@ -72,6 +85,18 @@ export default (( props )=>{
    + ( + + )} + > + ( + + )} + > ( diff --git a/src/forge/Team/Setting/cla/TeamSettingCLA.jsx b/src/forge/Team/Setting/cla/TeamSettingCLA.jsx new file mode 100644 index 000000000..4698ee99a --- /dev/null +++ b/src/forge/Team/Setting/cla/TeamSettingCLA.jsx @@ -0,0 +1,19 @@ +import React from 'react'; +import Title from '../../../Component/Title'; +import defaultimg from '../../images/cla-icon-big.png'; +import { Button } from 'antd'; + +function TeamSettingCLA(props){ + const OIdentifier = props.match.params.OIdentifier; + return( +
    + CLA管理 +
    + +

    CLA( Contributor License Agreement)指开源贡献者许可协议。您可以为本组织配置CLA,当非组织用户作为贡献者在组织仓库提交合并请求之前,需要签署CLA后才可正常提交合并请求

    + +
    +
    + ) +} +export default TeamSettingCLA; \ No newline at end of file diff --git a/src/forge/Team/Setting/cla/TeamSettingCLAEdit.jsx b/src/forge/Team/Setting/cla/TeamSettingCLAEdit.jsx new file mode 100644 index 000000000..14bbf8a52 --- /dev/null +++ b/src/forge/Team/Setting/cla/TeamSettingCLAEdit.jsx @@ -0,0 +1,68 @@ +import React ,{ forwardRef , useState , useEffect } from 'react'; +import Title from '../../../Component/Title'; +import MdEditor from "../../../../modules/tpm/challengesnew/tpm-md-editor"; +import { Button, Form , Input , Switch } from 'antd'; +import axios from 'axios'; + +export default Form.create()( + forwardRef(({ form , match , organizeDetail })=>{ + const { getFieldDecorator , validateFields , setFieldsValue , getFieldsValue} = form; + const [ switchBtn , setSwitchBtn ] = useState(false); + const OIdentifier = match.params.OIdentifier; + + function saveClaFunc(){ + validateFields((error,values)=>{ + if(!error){ + const url = `/organizations/${OIdentifier}/clas`; + axios.post(url,{ + pr_need:switchBtn, + ...values + }).then(response=>{ + if(response){ + + } + }).catch(error=>{}) + } + }) + } + + return( +
    + 创建CLA +
    + + {getFieldDecorator("name",{ + rules:[{ required: true, message: "请输入协议名称" }] + })( + + )} + + + {getFieldDecorator("key",{ + rules:[{ required: true, message: "请输入协议标识" }] + })( + + )} + + + {getFieldDecorator("content",{ + rules:[{ required: true, message: "请输入协议内容" }] + })( + + )} + +

    合并请求准入设置:

    + + setSwitchBtn(e)}/> + 要求 Pull Request 中所有提交者必须签署 CLA 方可合并 + + +
    +
    + ) +} +)) diff --git a/src/forge/Team/Setting/teamSetting.scss b/src/forge/Team/Setting/teamSetting.scss new file mode 100644 index 000000000..51a7088ec --- /dev/null +++ b/src/forge/Team/Setting/teamSetting.scss @@ -0,0 +1,15 @@ +.cla_default_box{ + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + min-height: 320px; + .cla_default_desc{ + width: 80%; + color:#666666; + font-size:15px; + line-height:30px; + text-align:center; + margin:20px 0px!important; + } +} \ No newline at end of file diff --git a/src/forge/Team/images/cla-icon-big.png b/src/forge/Team/images/cla-icon-big.png new file mode 100644 index 0000000000000000000000000000000000000000..c6e1ff0ad188b2b42bf5be5354028b95d9e56fe1 GIT binary patch literal 743 zcmV?P)Nkl~=K&Swy;7kXhf`baURB)ky z1k*vNfTVyV_pOmMvMoR-huF+SGamo#N^hT}Cuv&;4KJ;R<2!Hy?DzX;03UM2pBcbr zvzb%>pY?iulcuRWmr4#`6h%j!PUkOHQ3x;^G;Xa{Id=Ik-}PM^^SOw}2V&{$1OxR;y!}Ol>~{u-EH}^KbR@ z4&zH~y}^ke0cI2e;2JiPB0$=h(8dY>ANU_Dp8@xKWt&c?(_<$<&7MRD1JVD23k4{C z08cdgMHUT%R`fSScj?uq1)~rKr3%J=#MqbNCFLh9%FxP+3!t-md;o_6e2@J-K#?vz zo?Vkf_sm=De=37CDr4yf6Hhd5)F^<=$}Zq!Mal{w&$)?|lU+c9PLUwlJHE=2ekjb?+~N772CDoQ_SkVhsx!4DEuPfv1{73i!01z}cGq&B+ z#D5sZvnO>M3jZ;1;|vklYOzd;Y^)vS}rd7)X}zPV}I4!3xlNfli3e_ z(r~iTu=`np4>OAF8176|CSmI?Lw&wJuRB}^PtW0qBdX|IO)SDr-=gj!zT&&~s`S3& zB0=WIY?0?7(Aae%76ha*FoZh>2Ps3&F`cfOgN~2A*+@P_$UOPA42Eo09hSmPY`AUj zD2%i(a?&${8sl^n6!{Pe17t}V2&p1h^eHz{^twI#31Bl!=kLY>PH)^he1}7ZzqLRe zGF9zcTQVFA>fKWMJtebxw%R#^KiSQ-&aXD!PAYD;GkMGktbZ))E<);i+K^%*!L)*V zqn?GI#JCjmPg_a{Jkdm6Pyx<4F?G~nSm1e(rpXxOJP9OUc~>Q%a!RhRORiOcAL*3r zYir@XKPgoV33^1Anb=<6+HGpe!mtFZtEmf6|O~gnU+g`9z1Q*goSr7Ql{!FcQD!CWPnqcd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Ee*kaypQ?d12;FXzb_CEzC@swfPIL4?P;l$ZX!l;7m?^B9b7P z5LfbIX$k9eiW80YN|6wQ_ftb{w@1wO_ei z^sT;9R|_3%eMksB!H>blN@wrNV?YGoWB$Eu1cMj~lqz6E|M!`-fKnc!%6T&hn8`_9 z7j&bd9K~vDI)IHTzBW2G*6qr0GCO~F{->l3cl&Jf-VwCbAIQiX%zfttL^q;h^iSRH zFM`~hV{g8zb)K)Lr|FNma0$I%S zcADdBt^exR9py?oiI%w6`?7LF3=kiDG$w*o>jU;atZ? zJB#}kwbt7(KdJ_DJ{jYgIo)DN^my&-RPR^8U{KVE&ZrOSg=Lz7)=M2f)Gb^>*&C$_ zUsPdqok4|sFy;6SqkLug*1IMebP=v1& zgg~32X8LjA5R#~80ap~)Wy&tgLHhdafvyyN9%~7zJ_ktbk_mgH;=trLD?hkRfj^as z5~IOcMetdfn)$&3_4nUbz-aZWO%Txor!+9eIfbgT3K*~`KgKc~1A1!f&FYx`|Im_D YQE4sYhx(0}y+;@@KWAlJVdxh9FMOS4nE(I) literal 0 HcmV?d00001 diff --git a/src/forge/css/index.scss b/src/forge/css/index.scss index 7066e01fa..d17292945 100644 --- a/src/forge/css/index.scss +++ b/src/forge/css/index.scss @@ -260,7 +260,6 @@ form{ margin-bottom: 12px; border-radius:2px; background-color: #fff; - padding: 20px 0; border:1px solid rgba(79, 108, 188, 0.21); &>li{ font-size: 15px; From 57b43c6a1dce652c51ab4658b67353dec870efa5 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Fri, 16 Jun 2023 17:21:55 +0800 Subject: [PATCH 2/9] update --- src/forge/Component/Setnav.jsx | 2 +- src/forge/SecuritySetting/cla/DeleteBox.jsx | 4 +-- src/forge/SecuritySetting/cla/Index.jsx | 5 ++-- src/forge/Team/Setting/TeamSettingIndex.jsx | 26 +++++++++++-------- .../Team/Setting/cla/TeamSettingCLAEdit.jsx | 2 +- 5 files changed, 22 insertions(+), 17 deletions(-) diff --git a/src/forge/Component/Setnav.jsx b/src/forge/Component/Setnav.jsx index 766081b2f..0a918bd53 100644 --- a/src/forge/Component/Setnav.jsx +++ b/src/forge/Component/Setnav.jsx @@ -11,7 +11,7 @@ export default(({ header , nav })=>{ nav && nav.list && nav.list.length>0 ? nav.list.map((item,key)=>{ return( -
  • + !item.hide &&
  • {item.icon && } diff --git a/src/forge/SecuritySetting/cla/DeleteBox.jsx b/src/forge/SecuritySetting/cla/DeleteBox.jsx index d2007df74..45514fdce 100644 --- a/src/forge/SecuritySetting/cla/DeleteBox.jsx +++ b/src/forge/SecuritySetting/cla/DeleteBox.jsx @@ -3,7 +3,7 @@ import { AlignCenter } from '../../Component/layout'; import Modals from '../../Component/PublicModal/Index'; import { Button } from 'antd'; -function DeleteBox({visible , onCancel,onSuccess}){ +function DeleteBox({visible , onCancel,onSuccess,pr_need}){ return( 确定解除协议吗? -

    您解除协议后,后续提交的合并请求对项目成员将不再可见(已存在的不会受影响)

    + { pr_need &&

    您解除协议后,后续提交的合并请求对项目成员将不再可见(已存在的不会受影响)

    }
  • ) diff --git a/src/forge/SecuritySetting/cla/Index.jsx b/src/forge/SecuritySetting/cla/Index.jsx index 4dc5adde5..a93c9afa9 100644 --- a/src/forge/SecuritySetting/cla/Index.jsx +++ b/src/forge/SecuritySetting/cla/Index.jsx @@ -13,6 +13,7 @@ function Index(props){ const[ isSpin, setIsSpin] = useState(false); const [ visible , setVisible ] = useState(false); const [ cancelKey , setCancelKey ] = useState(undefined); + const [ pr_need , setPr_need ] = useState(true); useEffect(()=>{ if(current_user && current_user.user_id){ @@ -45,7 +46,7 @@ function Index(props){ } return(
    - {setVisible(false);setCancelKey(undefined)}} onSuccess={onSuccess}/> + {setVisible(false);setCancelKey(undefined)}} onSuccess={onSuccess}/>
    我签署的CLA(开源贡献者协议)
    { lists && lists.length>0 && @@ -62,7 +63,7 @@ function Index(props){ 签署时间{i.created_at}

    - { i.state === "signed" && } + { i.state === "signed" && }

    diff --git a/src/forge/Team/Setting/TeamSettingIndex.jsx b/src/forge/Team/Setting/TeamSettingIndex.jsx index 246c73cad..00b1f1f79 100644 --- a/src/forge/Team/Setting/TeamSettingIndex.jsx +++ b/src/forge/Team/Setting/TeamSettingIndex.jsx @@ -42,6 +42,7 @@ export default (( props )=>{ const pathname = props.location.pathname; const OIdentifier = props.match.params.OIdentifier; const {organizeDetail} = props; + console.log(organizeDetail); useEffect(()=>{ if(organizeDetail){ const {nickname} = organizeDetail; @@ -71,7 +72,7 @@ export default (( props )=>{ {name:'组织成员管理',icon:"icon-zuzhichengyuan",href:`/${OIdentifier}/setting/member`}, {name:'组织团队管理',icon:"icon-zuzhixiangmu",href:`/${OIdentifier}/setting/group`}, // {name:'管理web钩子',icon:"icon-zhongqingdianxinicon10",href:`/${OIdentifier}/setting/hooks`} - {name:'CLA管理',img:claIcon,href:`/${OIdentifier}/setting/agreement`} + {name:'CLA管理',img:claIcon,href:`/${OIdentifier}/setting/agreement`,hide:organizeDetail && !organizeDetail.enabling_cla} ], active } @@ -84,24 +85,27 @@ export default (( props )=>{
    - ( - - )} - > - ( + + )} + > + } + {organizeDetail && organizeDetail.enabling_cla && ( )} - > - } + {organizeDetail && organizeDetail.enabling_cla && ( )} - > + > + } ( diff --git a/src/forge/Team/Setting/cla/TeamSettingCLAEdit.jsx b/src/forge/Team/Setting/cla/TeamSettingCLAEdit.jsx index 0de392e31..170fbaa34 100644 --- a/src/forge/Team/Setting/cla/TeamSettingCLAEdit.jsx +++ b/src/forge/Team/Setting/cla/TeamSettingCLAEdit.jsx @@ -125,7 +125,7 @@ forwardRef((props)=>{ 要求 Pull Request 中所有提交者必须签署 CLA 方可合并 - { claid && } + {/* { claid && } */}
    ) From c7418fa1f5abed13a44a99ea0a7614af66afb983 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E6=80=9D?= <2897217417@qq.com> Date: Wed, 21 Jun 2023 09:39:12 +0800 Subject: [PATCH 3/9] =?UTF-8?q?glcc=E4=BF=AE=E6=94=B9=E8=AF=BE=E9=A2=98?= =?UTF-8?q?=E6=9C=AA=E4=BC=A0=E5=8F=82taskId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/glcc/apply/editInfo.jsx | 6 ++++-- src/glcc/apply/taskApply.jsx | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/glcc/apply/editInfo.jsx b/src/glcc/apply/editInfo.jsx index b9198b41e..b9aed5f53 100644 --- a/src/glcc/apply/editInfo.jsx +++ b/src/glcc/apply/editInfo.jsx @@ -27,7 +27,7 @@ function EditRepoApplyInfo(props) { const taskCountArr = [] registrationTaskList.map((item, index)=>{ taskCountArr.push(index+1); - const{taskName, taskUrl, taskDifficulty, taskReward, tutorName, tutorMail, taskDesc, tutorPhone} = item; + const{taskName, taskUrl, taskDifficulty, taskReward, tutorName, tutorMail, taskDesc, tutorPhone, id} = item; taskInfo[`taskName${index+1}`] = taskName; taskInfo[`taskUrl${index+1}`] = taskUrl; taskInfo[`taskDifficulty${index+1}`] = taskDifficulty; @@ -36,6 +36,7 @@ function EditRepoApplyInfo(props) { taskInfo[`tutorMail${index+1}`] = tutorMail; taskInfo[`taskDesc${index+1}`] = taskDesc; taskInfo[`tutorPhone${index+1}`] = tutorPhone; + taskInfo[`taskId${index+1}`] = id; }) setTaskCount(taskCountArr); setTimeout(() => { @@ -76,6 +77,7 @@ function EditRepoApplyInfo(props) { const registrationTaskList = [] taskCount && taskCount.map(item=>{ registrationTaskList.push({ + id: values[`taskId${item}`], taskName: values[`taskName${item}`], taskUrl: values[`taskUrl${item}`], taskDifficulty: values[`taskDifficulty${item}`], @@ -267,7 +269,7 @@ function EditRepoApplyInfo(props) {
    课题信息({index+1}/5)
    {index>0 && } - + })} {taskCount && taskCount.length<5 &&
    diff --git a/src/glcc/apply/taskApply.jsx b/src/glcc/apply/taskApply.jsx index a263f9bd2..86ed6c5f0 100644 --- a/src/glcc/apply/taskApply.jsx +++ b/src/glcc/apply/taskApply.jsx @@ -4,7 +4,7 @@ import TextArea from 'antd/lib/input/TextArea'; const Option = Select.Option; // 课题信息编辑 function TaskApply(props) { - const {helper, disabled, taskKey, phonereg, emailreg} = props; + const {helper, disabled, taskKey, phonereg, emailreg, getFieldDecorator} = props; // 低、中、高 const difficultyList = [ {id: 1, name: "低"}, @@ -26,6 +26,9 @@ function TaskApply(props) { return(
    + {helper('课题名称', '', `taskName${taskKey}`, From 1d88dc736947668c759f77c0be572fde53c5cfdd Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Wed, 21 Jun 2023 10:04:09 +0800 Subject: [PATCH 4/9] data --- src/AppConfig.js | 2 +- src/forge/Information/Pages/newsDetail.jsx | 2 +- src/forge/Main/CoderDepot.jsx | 24 ++--- src/forge/Main/Detail.js | 12 ++- src/forge/Main/sub/UpdateDescModal.jsx | 2 +- src/forge/New/Index.js | 99 +++++++++++++++--- src/forge/New/new.scss | 8 +- src/forge/Newfile/m_editor.js | 1 - src/forge/SecuritySetting/cla/DeleteBox.jsx | 6 +- src/forge/SecuritySetting/cla/Index.jsx | 5 +- src/forge/SecuritySetting/img/cla-logo.png | Bin 3525 -> 1447 bytes src/forge/SecuritySetting/img/icon.svg | 13 +++ src/forge/Team/New.jsx | 6 +- src/forge/Team/RightBox.jsx | 8 ++ src/forge/Team/Setting/TeamSettingCommon.jsx | 6 +- src/forge/Team/Setting/TeamSettingIndex.jsx | 1 - src/forge/Team/Setting/cla/CLAinfos.jsx | 29 +++-- src/forge/Team/Setting/cla/TeamSettingCLA.jsx | 4 +- .../Team/Setting/cla/TeamSettingCLAEdit.jsx | 4 +- src/forge/Team/Setting/teamSetting.scss | 2 +- src/forge/Team/Sub/Detail.jsx | 20 ++-- src/forge/Team/images/cla-logo.png | Bin 3525 -> 1447 bytes src/forge/Team/images/icon.svg | 13 +++ 23 files changed, 197 insertions(+), 70 deletions(-) create mode 100644 src/forge/SecuritySetting/img/icon.svg create mode 100644 src/forge/Team/images/icon.svg diff --git a/src/AppConfig.js b/src/AppConfig.js index cf7fe8b6a..9c5fbfd40 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -25,7 +25,7 @@ if (isDev) { } debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' : window.location.search.indexOf('debug=s') !== -1 ? 'student' : - window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'admin' + window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'student' } window._debugType = debugType; export function initAxiosInterceptors(props) { diff --git a/src/forge/Information/Pages/newsDetail.jsx b/src/forge/Information/Pages/newsDetail.jsx index d7c00fbb4..476a4ed31 100644 --- a/src/forge/Information/Pages/newsDetail.jsx +++ b/src/forge/Information/Pages/newsDetail.jsx @@ -47,7 +47,7 @@ function NewsDetail(props){

    {detail.name}

      { cmsDir &&
    • {cmsDir.name}
    • } - { cmsDir &&
    • 发布于{cmsDir.createdAt}
    • } + { cmsDir &&
    • 发布于{detail.publishTime}
    • } { detail.visits &&
    • {detail.visits}
    • }
    diff --git a/src/forge/Main/CoderDepot.jsx b/src/forge/Main/CoderDepot.jsx index 91bc4ef21..9915ade4e 100644 --- a/src/forge/Main/CoderDepot.jsx +++ b/src/forge/Main/CoderDepot.jsx @@ -63,7 +63,7 @@ function CoderDepot(props){ branchName = returnbar(branchName); const details = props.projectDetail; let pathname = props.history.location.pathname; - const { platform } = props ; + const { platform , mirror_status } = props ; //distribution:判断此用户是否可以创建发行版 const distribution = details && details.type !== 2 && ( details.permission && details.permission !== "Reporter"); const { bannerList } = props; @@ -93,7 +93,7 @@ function CoderDepot(props){ useEffect(()=>{ - if(details){ + if(details && mirror_status!==2){ setProjectDetail(details); setTopics(details.topics); setDesc(details.description); @@ -102,7 +102,7 @@ function CoderDepot(props){ setDefaultBranch(details.default_branch); setInviteCode(details.invite_code); } - },[details]) + },[details,mirror_status]) useEffect(()=>{ // 设置网页标题 @@ -126,7 +126,7 @@ function CoderDepot(props){ },[treeValue]) useEffect(()=>{ - if (projectsId && owner && defaultBranch){ + if (projectsId && owner && defaultBranch && mirror_status!==2){ let b = turnbar(branchName) ; if(pathname.indexOf(`/${owner}/${projectsId}`) > -1 && pathname.indexOf(`/tree/${b}/`) > -1) { let url = pathname.split(`/tree/${b}/`)[1]; @@ -139,10 +139,10 @@ function CoderDepot(props){ setType("dir"); } } - },[projectsId,owner,pathname,defaultBranch]) + },[projectsId,owner,pathname,defaultBranch,mirror_status]) useEffect(()=>{ - if(platform){ + if(platform && mirror_status!==2){ setReadOnly(props.history.location.search.indexOf('edit') !== -1); axios.get(`/${owner}/${projectsId}/releases.json`).then((result)=>{ if(result && result.data){ @@ -154,7 +154,7 @@ function CoderDepot(props){ } }) } - },[platform]) + },[platform,mirror_status]) // 获取readme信息 function getReadmeInfo(path, ref) { @@ -390,10 +390,10 @@ function CoderDepot(props){ const fileOperate = type === "dir" && projectDetail && projectDetail.type !== 2 && ((projectDetail.permission && projectDetail.permission !=="Reporter") || (current_user && current_user.admin)); return( - setOpenModal(false)} onOk={okUpdate}/> + {mirror_status !== 2 && setOpenModal(false)} onOk={okUpdate} showNotification={props.showNotification}/> } { - (dirInfo || fileInfo) && + ((dirInfo || fileInfo) && mirror_status!==2 ) &&
    { - props && props.platform ? + props && (props.platform && mirror_status !== 2) ? } {/* 贡献者 */} - + {mirror_status !==2 && } {/* 语言 */} - + { mirror_status !== 2 && } } diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js index 8f4e41887..4ce2d4181 100644 --- a/src/forge/Main/Detail.js +++ b/src/forge/Main/Detail.js @@ -192,12 +192,14 @@ class Detail extends Component { // 非本平台项目 platform: false, - mirror_status:1 + mirror_status:2 } } componentDidMount = () => { + const { mirror_status } = this.state + this.props.showNotification("getProject getProject getProject",mirror_status); this.getProject(); let history = this.props.location; this.clearIssueCookies(history); @@ -262,14 +264,16 @@ class Detail extends Component { } else if (result.data.mirror_status === 2) { this.deleteProjectBack(); this.setState({ - mirror_status:2 + mirror_status:2, + firstSync: false }) } else { this.getBanner(); this.getDetail(); this.setState({ firstSync: false, - secondSync: false + secondSync: false, + mirror_status:0 }) } } @@ -860,7 +864,7 @@ class Detail extends Component { > (mirror_status!==2 ? :) + (props) => } > diff --git a/src/forge/Main/sub/UpdateDescModal.jsx b/src/forge/Main/sub/UpdateDescModal.jsx index 0043b865a..a2f9ade4a 100644 --- a/src/forge/Main/sub/UpdateDescModal.jsx +++ b/src/forge/Main/sub/UpdateDescModal.jsx @@ -4,7 +4,7 @@ import "./sub.scss"; import axios from 'axios'; import { useState } from 'react'; const { TextArea } = Input; -function UpdateDescModal({form , visible , onCancel , onOk,desc,website,lesson_url, topicsInfo}){ +function UpdateDescModal({form , visible , onCancel , onOk,desc,website,lesson_url, topicsInfo,showNotification}){ const { getFieldDecorator, validateFields , setFieldsValue } = form; const [topics, setTopics] = useState(undefined); diff --git a/src/forge/New/Index.js b/src/forge/New/Index.js index 8ade2df05..6502016a0 100644 --- a/src/forge/New/Index.js +++ b/src/forge/New/Index.js @@ -53,7 +53,10 @@ class Index extends Component { licenseFlag:false, // 区块链确权 - tokenConTri: false + tokenConTri: false, + + gitHubUrl:false, + checkToken:undefined } } componentDidMount = () => { @@ -203,7 +206,9 @@ class Index extends Component { isSpin: true }) const { projectsType } = this.props.match.params; - const { project_language_id, project_category_id, license_id, ignore_id, owners_id, ignoreFlag, licenseFlag, categoreFlag, languageFlag, tokenConTri} = this.state; + const { project_language_id, project_category_id, license_id + , ignore_id, owners_id, ignoreFlag, licenseFlag, + categoreFlag, languageFlag, tokenConTri,gitHubUrl} = this.state; const decoderPass = Base64.encode(values.password); const url = (projectsType && projectsType === "mirror") ? "/projects/migrate.json" : "/projects.json"; // 新建项目的时候,暂存数据,如果失败,返回的时候可以重新赋值 @@ -220,7 +225,8 @@ class Index extends Component { user_id:owners_id, blockchain: tokenConTri, blockchain_token_all: 10000, - blockchain_init_token: parseInt(blockchain_init) + blockchain_init_token: parseInt(blockchain_init), + auth_token:gitHubUrl ? values.auth_token : undefined }).then((result) => { if (result && result.data.id) { projectsType && projectsType !== "mirror" && this.props.showNotification(`项目创建成功!`); @@ -235,6 +241,7 @@ class Index extends Component { }) }) } else { + window.scrollTo(0,0); this.setState({ isSpin: false }) @@ -301,6 +308,9 @@ class Index extends Component { repository_name:first }) } + this.setState({gitHubUrl:value.indexOf("https://github.com")>-1 ? true : false}) + }else{ + this.setState({gitHubUrl:false,checkToken:undefined}) } } @@ -344,6 +354,29 @@ class Index extends Component { } } + + blurFunc=(e)=>{ + let value = e.target.value; + if(value){ + const { clone_addr } = this.props.form.getFieldsValue(); + if(clone_addr){ + const u = `/projects/verify_auth_token.json`; + axios.post(u,{ + auth_token:value, + clone_addr + }).then(response=>{ + if(response && response.data){ + this.setState({ + checkToken:response.data.data + }) + } + }).catch(error=>{}) + } + }else{ + this.setState({checkToken:undefined}) + } + } + render() { const { getFieldDecorator } = this.props.form; // 项目类型:deposit-托管项目,mirror-镜像项目 @@ -372,7 +405,9 @@ class Index extends Component { licenseFlag, languageFlag, categoreFlag, - tokenConTri + tokenConTri, + gitHubUrl, + checkToken } = this.state; return (
    @@ -381,7 +416,6 @@ class Index extends Component {
    - { projectsType && projectsType === "mirror" && @@ -398,7 +432,7 @@ class Index extends Component { )} -

    示例:https://github.com/Stability-AI/StableStudio.git

    +

    示例:https://github.com/Stability-AI/StableStudio.git

    } { @@ -406,10 +440,32 @@ class Index extends Component {

    需要授权验证 - 如果导入项目为私有仓库,则必须填写相应平台正确的用户名和密码 + + 如果导入项目为私有仓库,{gitHubUrl ? `则需输入目标平台用户token进行授权,`:"则必须填写相应平台正确的用户名和密码"} + {gitHubUrl && 如何获取token?} +

    { - mirrorCheck && + mirrorCheck && gitHubUrl && +
    + Token + + + {getFieldDecorator('auth_token')( + + )} + + + { checkToken === false && } + { checkToken === true && } + +
    + } + { + mirrorCheck && !gitHubUrl &&
    用户名 @@ -447,19 +503,26 @@ class Index extends Component { {getFieldDecorator('user_id', { rules: [{ required: true, message: '请选择拥有者' - },{ - validator:(rule, value, callback) => this.checkId(rule, value, callback, OwnerList, '拥有者') }], })( - this.ChangePlatform(value, e, 'owners', OwnerList)} className="plateAutoComplete" - onBlur={(value) => this.blurCategory(value, OwnerList, "owners")} + optionFilterProp="children" + filterOption={(input, option) => + option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0 + } > - {owners_list} - + {OwnerList && OwnerList.length > 0 && + OwnerList.map((i,k)=>{ + return( + + ) + }) + } + )} / @@ -681,4 +744,6 @@ class Index extends Component { } } const WrappedIndexForm = Form.create({ name: 'NewWorkForm' })(Index); -export default WrappedIndexForm; \ No newline at end of file +export default WrappedIndexForm; + + diff --git a/src/forge/New/new.scss b/src/forge/New/new.scss index 15aca70b2..8432cecdf 100644 --- a/src/forge/New/new.scss +++ b/src/forge/New/new.scss @@ -11,6 +11,12 @@ font-size: 1.6em; border-bottom: 1px solid #f0f0f0 } +.token_box{ + align-items: center; +} +.token_box .ant-form-explain{ + position: absolute; +} .newPanel_content{ padding:2rem; } @@ -25,7 +31,7 @@ min-width: 280px; } .newPanel_content .ant-select-selection{ - height: 37px; + height: 35px; } .newPanel_content .ant-select-selection__rendered,.newPanel_content input{ height: 35px; diff --git a/src/forge/Newfile/m_editor.js b/src/forge/Newfile/m_editor.js index 125d7c362..ae2ad19be 100644 --- a/src/forge/Newfile/m_editor.js +++ b/src/forge/Newfile/m_editor.js @@ -34,7 +34,6 @@ class m_editor extends Component { render() { const { editorValue, changeValue } = this.state; - console.log("editorValue:",editorValue) const { readOnly, editorType,onEmpty,filename,empty, currentBranch, descName, checkName, detail, match: { params },filepath,ideTheme } = this.props; const editor_options = { lineNumbers: "on", diff --git a/src/forge/SecuritySetting/cla/DeleteBox.jsx b/src/forge/SecuritySetting/cla/DeleteBox.jsx index 45514fdce..d6ae99032 100644 --- a/src/forge/SecuritySetting/cla/DeleteBox.jsx +++ b/src/forge/SecuritySetting/cla/DeleteBox.jsx @@ -1,4 +1,4 @@ -import React , { useState , useEffect } from 'react'; +import React from 'react'; import { AlignCenter } from '../../Component/layout'; import Modals from '../../Component/PublicModal/Index'; import { Button } from 'antd'; @@ -12,14 +12,14 @@ function DeleteBox({visible , onCancel,onSuccess,pr_need}){ btn={
    - +
    } >
    确定解除协议吗? - { pr_need &&

    您解除协议后,后续提交的合并请求对项目成员将不再可见(已存在的不会受影响)

    } + { pr_need &&

    您解除协议后,提交的合并请求对项目成员将不再可见(已存在的开启的合并请求也将被隐藏)

    }
    ) diff --git a/src/forge/SecuritySetting/cla/Index.jsx b/src/forge/SecuritySetting/cla/Index.jsx index a93c9afa9..7a98fa6c1 100644 --- a/src/forge/SecuritySetting/cla/Index.jsx +++ b/src/forge/SecuritySetting/cla/Index.jsx @@ -1,6 +1,6 @@ import React,{useEffect,useState} from 'react'; import './index.scss'; -import logo from '../img/cla-logo.png'; +import logo from '../img/icon.svg'; import { Link } from 'react-router-dom'; import { Button , Spin } from 'antd'; import Nodata from '../../Nodata'; @@ -14,6 +14,9 @@ function Index(props){ const [ visible , setVisible ] = useState(false); const [ cancelKey , setCancelKey ] = useState(undefined); const [ pr_need , setPr_need ] = useState(true); + useEffect(()=>{ + document.title = "我的CLA"; + },[]) useEffect(()=>{ if(current_user && current_user.user_id){ diff --git a/src/forge/SecuritySetting/img/cla-logo.png b/src/forge/SecuritySetting/img/cla-logo.png index d5b3ebb59c105d0a36b563c6772e89398cf12b1a..d9a35de0b2460aec65e59bed9121f870b25aae6e 100644 GIT binary patch literal 1447 zcmV;Y1z7rtP)lW&BVKIFKrh&Cq$YT=jb#|)$6!InCaj{;&Cr2-h{!;N(w*mo zQ%~`<=d{pMO5Zmj%}JlP=Y4+f|Np#C6HYaKeSOJJr?W<*(d-0Z;Qk_Mv~qbLHk-{Y zn%>^t2JWIPlCqzb>!?<%P1QIYjuGyS_y`6;sh1K6SA;_V=Lib}!Kr|On6Ux_p%jGE zIgNp#M{rJ0hjkfAGA1Ber}dhHtRgzQ?TB5f4{Hdt`0T|T=ROs zAO?pY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-jw{y$$&$N-N6ub5Pyq1d`2>?2E+ul9~Z| zwRYexE5DRTJMgMzV2ov*@&msnfXeFF*Dp#nqpE?#zBCRjz zuR?x|D`honD^=OfN#GJk#UgSgaZJT^AbwU<8&D z9~LA#q7Wag9)m^qyE0o5bnvte#4dqqGa&#Xsa`iay^Dpl~oK zd8(b;5{53JDQlYGIN%&6$gn4+&kvtTD==BHtZ5u#fUHGvLmL|#i9Z#+dF^~uG1zk` z8fMGM#WgA@rG5YYkui$;trLLj{e{|q$IlwaP0q8%K}J_u6Nx9Uii=n8A>vbXcoHtD z>4W44@YNW^`5dm(RC| YsyThu*uh!&SuX<_8JOu;=mM1g1ETS0FaQ7m diff --git a/src/forge/SecuritySetting/img/icon.svg b/src/forge/SecuritySetting/img/icon.svg new file mode 100644 index 000000000..121d52f4d --- /dev/null +++ b/src/forge/SecuritySetting/img/icon.svg @@ -0,0 +1,13 @@ + + + + + + + + CLA + + + + + diff --git a/src/forge/Team/New.jsx b/src/forge/Team/New.jsx index 16247e7b4..db4bf1451 100644 --- a/src/forge/Team/New.jsx +++ b/src/forge/Team/New.jsx @@ -45,7 +45,7 @@ export default Form.create()( } const url = `/organizations.json`; axios.post(url,{ - ...values,image + ...values,image,visibility:"common" }).then(result=>{ if(result && result.data){ showNotification("组织创建成功!"); @@ -121,7 +121,7 @@ export default Form.create()( [], ,false )} - {helper( + {/* {helper( '可见性', "visibility", [{ required: true, message: "请选择可见性" }], @@ -130,7 +130,7 @@ export default Form.create()( 受限(仅对登录用户可见) 私有(仅对组织成员可见) - )} + )} */}

    选择头像

    diff --git a/src/forge/Team/RightBox.jsx b/src/forge/Team/RightBox.jsx index 4e75fe666..6a05d6214 100644 --- a/src/forge/Team/RightBox.jsx +++ b/src/forge/Team/RightBox.jsx @@ -27,6 +27,10 @@ const ListName = styled.div`{ margin-bottom:8px; height:18px; line-height:18px; + width:210px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; }`; const ColorListName = styled.div`{ color:rgba(31, 35, 41, 1); @@ -34,6 +38,10 @@ const ColorListName = styled.div`{ margin-bottom:8px; height:18px; line-height:18px; + width:230px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; }` const Img = styled.img`{ border-radius:50%; diff --git a/src/forge/Team/Setting/TeamSettingCommon.jsx b/src/forge/Team/Setting/TeamSettingCommon.jsx index d16f15037..d1ff67c0f 100644 --- a/src/forge/Team/Setting/TeamSettingCommon.jsx +++ b/src/forge/Team/Setting/TeamSettingCommon.jsx @@ -58,7 +58,7 @@ export default Form.create()( if(!error){ const url = `/organizations/${organizeDetail.id}.json`; axios.patch(url,{ - ...values,image:imageFlag ? image : undefined + ...values,image:imageFlag ? image : undefined,visibility:"common" }).then(result=>{ if(result && result.data){ showNotification("组织信息更新成功!"); @@ -172,7 +172,7 @@ export default Form.create()( [], )} - {helper( + {/* {helper( '可见性:', "visibility", [], @@ -181,7 +181,7 @@ export default Form.create()( 受限(仅对登录用户可见) 私有(仅对组织成员可见) - )} + )} */} {helper( '权限:', "repo_admin_change_team_access", diff --git a/src/forge/Team/Setting/TeamSettingIndex.jsx b/src/forge/Team/Setting/TeamSettingIndex.jsx index 00b1f1f79..91db1156b 100644 --- a/src/forge/Team/Setting/TeamSettingIndex.jsx +++ b/src/forge/Team/Setting/TeamSettingIndex.jsx @@ -42,7 +42,6 @@ export default (( props )=>{ const pathname = props.location.pathname; const OIdentifier = props.match.params.OIdentifier; const {organizeDetail} = props; - console.log(organizeDetail); useEffect(()=>{ if(organizeDetail){ const {nickname} = organizeDetail; diff --git a/src/forge/Team/Setting/cla/CLAinfos.jsx b/src/forge/Team/Setting/cla/CLAinfos.jsx index 5a69cb9fd..3896f0cf2 100644 --- a/src/forge/Team/Setting/cla/CLAinfos.jsx +++ b/src/forge/Team/Setting/cla/CLAinfos.jsx @@ -1,13 +1,13 @@ import React,{ forwardRef, useState , useEffect } from 'react'; import '../teamSetting.scss'; import RenderHtml from '../../../../components/render-html'; -import { Button , Form , Input} from 'antd'; -import Cla from '../../images/cla.png'; +import { Button , Form , Input , Spin } from 'antd'; +import { getImageUrl } from 'educoder'; import axios from 'axios'; function CLAinfos(props){ - const { form , current_user } = props; + const { form , current_user , showLoginDialog } = props; const { getFieldDecorator , validateFields , setFieldsValue , getFieldsValue} = form; const OIdentifier = props.match.params.OIdentifier; @@ -15,9 +15,17 @@ function CLAinfos(props){ const [ details, setDetails ] = useState(undefined); + useEffect(()=>{ + if(current_user && current_user.email){ + setFieldsValue({ + email:current_user.email + }) + } + },[current_user,details]) + useEffect(()=>{ if(current_user &&!current_user.login){ - props.history.push(`/login`); + props.history.push(`/login?go_page=/${OIdentifier}/cla/${claid}`); } },[current_user]) @@ -32,6 +40,7 @@ function CLAinfos(props){ axios.get(url).then(response=>{ if(response && response.data){ setDetails(response.data); + document.title = `${response.data.name}`; } }).catch(error=>{}) } @@ -42,10 +51,12 @@ function CLAinfos(props){ const url = `/users/${current_user && current_user.user_id}/clas.json`; axios.post(url,{ ...values, - cla_id:details && details.id + cla_id:details && details.id, + email:(current_user && current_user.email) || values.email }).then(response=>{ if(response && response.data){ props.showNotification('协议签署成功!'); + window.scrollTo(0,0); getDetails(); } }).catch(error=>{}) @@ -54,11 +65,11 @@ function CLAinfos(props){ } return( - details && + details ?
    - +

    {details.name}

    {details.organization && details.organization.nickname}

    @@ -87,7 +98,7 @@ function CLAinfos(props){ {getFieldDecorator("email",{ rules:[{ required: true, message: "请输入签署邮箱" }] })( - + )}
    @@ -96,6 +107,8 @@ function CLAinfos(props){ }
    + : +
    ) } export default Form.create()(forwardRef(CLAinfos)) \ No newline at end of file diff --git a/src/forge/Team/Setting/cla/TeamSettingCLA.jsx b/src/forge/Team/Setting/cla/TeamSettingCLA.jsx index aaab6c953..a207f0c81 100644 --- a/src/forge/Team/Setting/cla/TeamSettingCLA.jsx +++ b/src/forge/Team/Setting/cla/TeamSettingCLA.jsx @@ -1,7 +1,7 @@ import React,{ useState , useEffect } from 'react'; import Title from '../../../Component/Title'; import defaultimg from '../../images/cla-icon-big.png'; -import Logo from '../../images/cla-logo.png'; +import Logo from '../../images/icon.svg'; import { Button, Spin } from 'antd'; import axios from 'axios'; @@ -40,7 +40,7 @@ function TeamSettingCLA(props){

    {list.name}

    签署人数{list.count || 0}
    - +
    diff --git a/src/forge/Team/Setting/cla/TeamSettingCLAEdit.jsx b/src/forge/Team/Setting/cla/TeamSettingCLAEdit.jsx index 170fbaa34..a7d956593 100644 --- a/src/forge/Team/Setting/cla/TeamSettingCLAEdit.jsx +++ b/src/forge/Team/Setting/cla/TeamSettingCLAEdit.jsx @@ -75,7 +75,7 @@ forwardRef((props)=>{ function checkKeyReg(rule, value, callback){ let reg = /^[a-zA-Z0-9][a-zA-Z0-9_]*[a-zA-Z0-9]+$/g if(value && !reg.test(value)){ - callback("协议标识只能以数字、字母开头结尾,可包含下划线"); + callback("协议标识长度2-30,只能以数字、字母开头结尾,可包含下划线"); } callback(); } @@ -103,7 +103,7 @@ forwardRef((props)=>{ { validator: checkKeyReg } ] })( - + )} diff --git a/src/forge/Team/Setting/teamSetting.scss b/src/forge/Team/Setting/teamSetting.scss index bdcdae7c0..6f5a21bc6 100644 --- a/src/forge/Team/Setting/teamSetting.scss +++ b/src/forge/Team/Setting/teamSetting.scss @@ -65,7 +65,7 @@ margin:0px auto; width: 1200px; &>img{ - width: 116px; + height: 94px; margin-right: 32px; border-radius: 4px; } diff --git a/src/forge/Team/Sub/Detail.jsx b/src/forge/Team/Sub/Detail.jsx index ab4c049ff..eedce64b2 100644 --- a/src/forge/Team/Sub/Detail.jsx +++ b/src/forge/Team/Sub/Detail.jsx @@ -6,7 +6,6 @@ import { setSeoMeta } from "educoder"; import Cards from '../../Component/Cards'; import axios from 'axios'; import '../Index.scss'; - const GroupDetails = Loadable({ loader: () => import("../Group/GroupDetails"), loading: Loading, @@ -40,6 +39,9 @@ function Detail(props){ if(pathname){ if(pathname.indexOf(`/${OIdentifier}/setting`)>-1){ setFlag(false); + if(detail && !detail.is_admin ){ + props.history.push("/nopage"); + } }else{ setFlag(true); } @@ -49,7 +51,7 @@ function Detail(props){ setButtonflagFlag(false); } } - },[pathname]) + },[pathname,detail]) useEffect(()=>{ if(OIdentifier){ @@ -134,12 +136,14 @@ function Detail(props){ return }} > - { - return - }} - > + + { + return + }} + > + { diff --git a/src/forge/Team/images/cla-logo.png b/src/forge/Team/images/cla-logo.png index d5b3ebb59c105d0a36b563c6772e89398cf12b1a..d9a35de0b2460aec65e59bed9121f870b25aae6e 100644 GIT binary patch literal 1447 zcmV;Y1z7rtP)lW&BVKIFKrh&Cq$YT=jb#|)$6!InCaj{;&Cr2-h{!;N(w*mo zQ%~`<=d{pMO5Zmj%}JlP=Y4+f|Np#C6HYaKeSOJJr?W<*(d-0Z;Qk_Mv~qbLHk-{Y zn%>^t2JWIPlCqzb>!?<%P1QIYjuGyS_y`6;sh1K6SA;_V=Lib}!Kr|On6Ux_p%jGE zIgNp#M{rJ0hjkfAGA1Ber}dhHtRgzQ?TB5f4{Hdt`0T|T=ROs zAO?pY!FJ~!8k>Ib3!XqkH4uX2#k=ln+x%4ofz03Z4oDRrTHZ%y#%jM*p&AG&OUx&T zi4jny?y0c#_Oc3S!4`S<cRiPu|&HHeYtqgeG_F+RoseL7iSBX9<1{*Gr zZHiHqb71j-pxV&lXhqA;bG#b<8oB>clKIPXko4*@h-0Nl1l1bqRH!TQ9ts4J)r&GGqgU=@ILa>{!9}j4q$8A?Dmo(VPkM2=uZ{09RvJ?Hf+{pxsw+at@tMCVcg`T_12kV} zAzo|1>piA~1K|M9p20`{nH*jhg>vg|UBNeeA>btEdFz4|qSP&q3><=(D zKJHVNv%fpYYS>EvS%bPrYNyv5Gx7Vd&8>=%Dv z0ztikRF6PFynWFU0}pDk3}k0RHHU$iAoO1>9UZDVH!t_?zGvqlcze=M76d)+_`uQ6KP4BgL&rVlxSad{u2_Tj2lQk?glqEt zuA70FA;v&35T52?ikPK{7Vf&h-vYCk;&nP*s;0lc|1IvvcC1`ts}@soe&lj6B_-vw z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yH+q9q#oEzbR{1-R4%=O!%wr&)iio&3a z*AYB4G3kuDMjIA;uS*W^v~t|z+WJJ%LHL?45(P%N+C;&E&7wUPrsx}`tHD|HL}IPc z2QvJ|=10l)S9vMVl;wzm)hItpdqq;#{08nnSf%g{7RWyu_ig8hTF-g_dvx9OmkS}^ z@ddv}mcmSQmwd8&(`yadtuLU28b1BwQ|WV}Som*%CRpvG8z{a#mxyIYNJQy?u$&gx z9$BRUzb2^SU_#S<=ymjkru`L>MR%Ut5GoTL-I2zQz-&Y*_u&`e(RQ|N4WR6Q+p;e{ z#e!)09oZuTvP^ogGZ$;XqJ=%Xw>o21;`82iuft;5qZx2^Ht#uzyemInfR}OX+&{Gw zrgjOPF$q+7|GE7HQ&LnLxj|dX(v54eTy$$Q5QmH={_FVtfl%^Dan|(iOol_EY0vVU z_T@WEpC1r9UlBjMSFXUpe$PLYd%G!!4ods?v~kzb?Tsnz8_#WU*^vxXc$joa`GF!J zTU`?jF1wu7or6VNOU-Q9>{N9BO%8PV7-jw{y$$&$N-N6ub5Pyq1d`2>?2E+ul9~Z| zwRYexE5DRTJMgMzV2ov*@&msnfXeFF*Dp#nqpE?#zBCRjz zuR?x|D`honD^=OfN#GJk#UgSgaZJT^AbwU<8&D z9~LA#q7Wag9)m^qyE0o5bnvte#4dqqGa&#Xsa`iay^Dpl~oK zd8(b;5{53JDQlYGIN%&6$gn4+&kvtTD==BHtZ5u#fUHGvLmL|#i9Z#+dF^~uG1zk` z8fMGM#WgA@rG5YYkui$;trLLj{e{|q$IlwaP0q8%K}J_u6Nx9Uii=n8A>vbXcoHtD z>4W44@YNW^`5dm(RC| YsyThu*uh!&SuX<_8JOu;=mM1g1ETS0FaQ7m diff --git a/src/forge/Team/images/icon.svg b/src/forge/Team/images/icon.svg new file mode 100644 index 000000000..121d52f4d --- /dev/null +++ b/src/forge/Team/images/icon.svg @@ -0,0 +1,13 @@ + + + + + + + + CLA + + + + + From de69c09c2adc9f7872ed8cd54dfe362c9d666b84 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Wed, 21 Jun 2023 11:03:56 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Main/CoderDepot.jsx | 22 +++++++++++----------- src/forge/Main/Detail.js | 5 +---- src/forge/Main/sub/UpdateDescModal.jsx | 2 +- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/forge/Main/CoderDepot.jsx b/src/forge/Main/CoderDepot.jsx index 9915ade4e..39ec3726c 100644 --- a/src/forge/Main/CoderDepot.jsx +++ b/src/forge/Main/CoderDepot.jsx @@ -65,7 +65,7 @@ function CoderDepot(props){ let pathname = props.history.location.pathname; const { platform , mirror_status } = props ; //distribution:判断此用户是否可以创建发行版 - const distribution = details && details.type !== 2 && ( details.permission && details.permission !== "Reporter"); + const distribution = details && details.type ===0 && ( details.permission && details.permission !== "Reporter"); const { bannerList } = props; useEffect(()=>{ if(bannerList && bannerList.length>0){ @@ -93,7 +93,7 @@ function CoderDepot(props){ useEffect(()=>{ - if(details && mirror_status!==2){ + if(details && mirror_status===0){ setProjectDetail(details); setTopics(details.topics); setDesc(details.description); @@ -126,7 +126,7 @@ function CoderDepot(props){ },[treeValue]) useEffect(()=>{ - if (projectsId && owner && defaultBranch && mirror_status!==2){ + if (projectsId && owner && defaultBranch && mirror_status===0){ let b = turnbar(branchName) ; if(pathname.indexOf(`/${owner}/${projectsId}`) > -1 && pathname.indexOf(`/tree/${b}/`) > -1) { let url = pathname.split(`/tree/${b}/`)[1]; @@ -142,7 +142,7 @@ function CoderDepot(props){ },[projectsId,owner,pathname,defaultBranch,mirror_status]) useEffect(()=>{ - if(platform && mirror_status!==2){ + if(platform && mirror_status===0){ setReadOnly(props.history.location.search.indexOf('edit') !== -1); axios.get(`/${owner}/${projectsId}/releases.json`).then((result)=>{ if(result && result.data){ @@ -386,14 +386,14 @@ function CoderDepot(props){ const { current_user , checkIfLogin , showLoginDialog } = props; const baseOper = current_user && current_user.login && issuesFlag; - const baseOperate = projectDetail && projectDetail.permission && projectDetail.permission !=="Reporter" && projectDetail.type !== 2 && pullsFlag && props.platform; - const fileOperate = type === "dir" && projectDetail && projectDetail.type !== 2 && ((projectDetail.permission && projectDetail.permission !=="Reporter") || (current_user && current_user.admin)); + const baseOperate = projectDetail && projectDetail.permission && projectDetail.permission !=="Reporter" && projectDetail.type ===0 && pullsFlag && props.platform; + const fileOperate = type === "dir" && projectDetail && projectDetail.type ===0 && ((projectDetail.permission && projectDetail.permission !=="Reporter") || (current_user && current_user.admin)); return( - {mirror_status !== 2 && setOpenModal(false)} onOk={okUpdate} showNotification={props.showNotification}/> } + {mirror_status ===0 && setOpenModal(false)} onOk={okUpdate}/> } { - ((dirInfo || fileInfo) && mirror_status!==2 ) && + ((dirInfo || fileInfo) && mirror_status===0 ) &&
    { - props && (props.platform && mirror_status !== 2) ? + props && (props.platform && mirror_status ===0) ? } {/* 贡献者 */} - {mirror_status !==2 && } + {mirror_status ===0 && } {/* 语言 */} - { mirror_status !== 2 && } + { mirror_status ===0 && } } diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js index 4ce2d4181..75cdf8871 100644 --- a/src/forge/Main/Detail.js +++ b/src/forge/Main/Detail.js @@ -198,8 +198,6 @@ class Detail extends Component { componentDidMount = () => { - const { mirror_status } = this.state - this.props.showNotification("getProject getProject getProject",mirror_status); this.getProject(); let history = this.props.location; this.clearIssueCookies(history); @@ -242,7 +240,6 @@ class Detail extends Component { open_devops: result.data.open_devops, platform: result.data.platform && result.data.platform !== 'educoder' }) - if (result.data.type !== 0 && result.data.mirror_status === 1) { console.log("--------start channel --------"); // 是镜像项目,且未完成迁移 @@ -262,11 +259,11 @@ class Detail extends Component { mirror_status:1 }) } else if (result.data.mirror_status === 2) { - this.deleteProjectBack(); this.setState({ mirror_status:2, firstSync: false }) + this.deleteProjectBack(); } else { this.getBanner(); this.getDetail(); diff --git a/src/forge/Main/sub/UpdateDescModal.jsx b/src/forge/Main/sub/UpdateDescModal.jsx index a2f9ade4a..0043b865a 100644 --- a/src/forge/Main/sub/UpdateDescModal.jsx +++ b/src/forge/Main/sub/UpdateDescModal.jsx @@ -4,7 +4,7 @@ import "./sub.scss"; import axios from 'axios'; import { useState } from 'react'; const { TextArea } = Input; -function UpdateDescModal({form , visible , onCancel , onOk,desc,website,lesson_url, topicsInfo,showNotification}){ +function UpdateDescModal({form , visible , onCancel , onOk,desc,website,lesson_url, topicsInfo}){ const { getFieldDecorator, validateFields , setFieldsValue } = form; const [topics, setTopics] = useState(undefined); From 316663cd1210286e637cf813bc673f8e283ab71c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E6=80=9D?= <2897217417@qq.com> Date: Wed, 21 Jun 2023 11:08:06 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=AF=BE=E9=A2=98?= =?UTF-8?q?=E5=85=88=E5=88=A4=E6=96=AD=E6=9C=89=E6=97=A0=E5=AD=A6=E7=94=9F?= =?UTF-8?q?=E6=8A=A5=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/glcc/api.js | 11 ++++++++++- src/glcc/apply/editInfo.jsx | 19 ++++++++++++------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/glcc/api.js b/src/glcc/api.js index f15c7a951..5d930499c 100644 --- a/src/glcc/api.js +++ b/src/glcc/api.js @@ -222,4 +222,13 @@ export function deleteApplyInfo(data) { method: 'post', data }); -} \ No newline at end of file +} + +// 判断课题是否有学生报名 +export async function findStudentTaskByTaskId(params) { + return await fetch({ + url: '/api/applyInformation/findStudentTaskByTaskId', + method: 'get', + params: params, + }); +} diff --git a/src/glcc/apply/editInfo.jsx b/src/glcc/apply/editInfo.jsx index b9aed5f53..b9b836e43 100644 --- a/src/glcc/apply/editInfo.jsx +++ b/src/glcc/apply/editInfo.jsx @@ -1,7 +1,7 @@ import React , { useCallback, useEffect , useState } from 'react'; import { Button, Form, Input, Select, Upload, message, Popconfirm } from 'antd'; import {getUploadActionUrl} from 'educoder'; -import {applyGlcc, updateApplyGlcc} from '../api'; +import {applyGlcc, findStudentTaskByTaskId, updateApplyGlcc} from '../api'; import TextArea from 'antd/lib/input/TextArea'; import { main_site_url } from '../fetch'; import TaskApply from './taskApply'; @@ -13,7 +13,7 @@ function EditRepoApplyInfo(props) { const {form, applyInfo, current_user, round, cateList, setReload, isAddRepo, setIsAddRepo, setIsEdit, setEditRepoCount} = props; const phonereg = /(^|\s*\+?0?0?86|\D)(1\d{2})[-\s]{0,3}(\d{4})[-\s]{0,3}(\d{4})(?=\D|$)/ const emailreg = /^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/ - const {getFieldDecorator, validateFields, setFieldsValue, validateFieldsAndScroll } = form; + const {getFieldDecorator, validateFields, setFieldsValue, validateFieldsAndScroll, getFieldValue } = form; const [imageUrl, setImageUrl] = useState(undefined); // 提交按钮loading效果 const [loading, setLoading] = useState(false); @@ -159,14 +159,19 @@ function EditRepoApplyInfo(props) { // 添加课题输入框 function addTaskApplyForm(){ - setTaskCount(taskCount.concat([taskCount.length+1])); + setTaskCount(taskCount.concat([taskCount[taskCount.length-1]+1])); } // 删除课题报名 - function deleteTaskApply(index){ - const arr = [...taskCount]; - arr.splice(index-1, 1) - setTaskCount(arr); + async function deleteTaskApply(index){ + const delTaskId = getFieldValue(`taskId${index}`); + const res = delTaskId ? await findStudentTaskByTaskId({ taskId: delTaskId }) : "newTask"; + if((res && res.data && res.data.length)){ + message.error("已有学生报名,不允许删除"); + }else{ + const arr = taskCount.filter(item=>item!== index); + setTaskCount(arr); + } } // 取消编辑点击函数 From 049f234f4ae30e8e2ee90fd284c6726910580185 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=BF=83=E5=AE=87?= Date: Wed, 21 Jun 2023 14:20:19 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=E8=A1=8C=E9=97=B4=E8=B7=9D=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Information/index.scss | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/forge/Information/index.scss b/src/forge/Information/index.scss index b3c7e6c49..795162c7f 100644 --- a/src/forge/Information/index.scss +++ b/src/forge/Information/index.scss @@ -1049,12 +1049,6 @@ margin: 25px 25px 25px 0; border-radius: 12px; } - .informations_detail.markdown-body{ - &>p{ - line-height: 32px; - margin-bottom: 8px!important; - } - } } .zone_parter{ background-color: #fff; @@ -1118,4 +1112,10 @@ border-color: var(--primary-color); } } +} +.informations_detail.markdown-body{ + &>p{ + line-height: 32px; + margin-bottom: 8px!important; + } } \ No newline at end of file From 6fa08b800e32226ac8e094d95a23eff7144c2ea7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=BF=83=E5=AE=87?= Date: Wed, 21 Jun 2023 14:43:21 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Information/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/forge/Information/index.jsx b/src/forge/Information/index.jsx index c7da2c5ca..10d24b00c 100644 --- a/src/forge/Information/index.jsx +++ b/src/forge/Information/index.jsx @@ -93,7 +93,7 @@ function Index(props){ function getAdminUrl(id){ getCheckZoneRole(id).then(response=>{ if(response && response.data.code === 200){ - setAdminUrl(response.data); + setAdminUrl(response.data.data); }else{ setAdminUrl(undefined); } From 47ad9f15e5c02a2aa9e845f4c5c6845a58a0096e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=BF=83=E5=AE=87?= Date: Wed, 21 Jun 2023 15:05:11 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=A4=84=E7=90=86cont.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Information/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/forge/Information/index.jsx b/src/forge/Information/index.jsx index 10d24b00c..33de4f597 100644 --- a/src/forge/Information/index.jsx +++ b/src/forge/Information/index.jsx @@ -92,7 +92,7 @@ function Index(props){ function getAdminUrl(id){ getCheckZoneRole(id).then(response=>{ - if(response && response.data.code === 200){ + if(response && response.data.data){ setAdminUrl(response.data.data); }else{ setAdminUrl(undefined);