diff --git a/src/forge/SecuritySetting/Index.jsx b/src/forge/SecuritySetting/Index.jsx index 0982ccb50..8ec3626ae 100644 --- a/src/forge/SecuritySetting/Index.jsx +++ b/src/forge/SecuritySetting/Index.jsx @@ -119,8 +119,8 @@ function Index(props){ diff --git a/src/forge/SecuritySetting/bot/disposition/detail.jsx b/src/forge/SecuritySetting/bot/disposition/detail.jsx index e6b9fb54d..b27c8c181 100644 --- a/src/forge/SecuritySetting/bot/disposition/detail.jsx +++ b/src/forge/SecuritySetting/bot/disposition/detail.jsx @@ -143,7 +143,11 @@ function DispositionDetail(props){ > {filterOption.map(item=>({item.name}))} } - {checkValue === 1 && selectValue.map((item, index)=>{return
{item.name}{deleteSelect(item)}}>
})} + {checkValue === 1 && selectValue.map((item, index)=>{return
+ + {`${item.author && item.author.name}/${item.name}`} + {deleteSelect(item)}}> +
})}
更改Bot状态
{/* {botDetail && botDetail.state === 1 &&
diff --git a/src/forge/SecuritySetting/bot/disposition/index.jsx b/src/forge/SecuritySetting/bot/disposition/index.jsx index 34939f058..f8f4e9f43 100644 --- a/src/forge/SecuritySetting/bot/disposition/index.jsx +++ b/src/forge/SecuritySetting/bot/disposition/index.jsx @@ -15,7 +15,7 @@ function DispositionBot(props){ const [reload, setReload] = useState(undefined); useEffect(()=>{ - document.title='Bot配置'; + document.title='Bot安装'; }, []) useEffect(()=>{ @@ -44,7 +44,7 @@ function DispositionBot(props){ } return
-
Bot配置
+
Bot安装
{/* bot列表显示区域 */} {botList && (botList.length > 0 ?
{botList.map((item, index)=>{return
@@ -61,7 +61,7 @@ function DispositionBot(props){
:

您当前暂未安装任何Bot

-
Bot可以帮助项目贡献者处理繁杂的项目任务,比如关闭疑修、合并请求等,以节约时间精力提升开发效率。快去市场中挑选一个适合您项目的Bot吧!
+
您可以将Bot配置到仓库来处理一些繁杂的项目任务,比如自动化关闭疑修、合并请求等,以节约时间精力提升开发效率。快去 Bot市场 中挑选一个适合您项目的Bot吧!
)} diff --git a/src/forge/SecuritySetting/bot/exploit/configuration/compenent/advancedInformation.jsx b/src/forge/SecuritySetting/bot/exploit/configuration/compenent/advancedInformation.jsx index 62ff37011..ce6cdede8 100644 --- a/src/forge/SecuritySetting/bot/exploit/configuration/compenent/advancedInformation.jsx +++ b/src/forge/SecuritySetting/bot/exploit/configuration/compenent/advancedInformation.jsx @@ -58,7 +58,7 @@ function AdvancedInformation(props){ // 选择用户 function selectInputUser(e, option){ - setNewId(option.props.value); + setNewId(option.props); setSearchKey(option.props.name); }; @@ -92,12 +92,13 @@ function AdvancedInformation(props){ function makeOver(){ setMakeOverErrortTip(undefined); if(newId){ + const {value, login} = newId transferBot({ login: current_user && current_user.login, user_id: current_user && current_user.user_id, - user_name: current_user && current_user.username, bot_id: parseInt(id), - transfer_to_user_id: parseInt(newId) + transfer_to_user_id: parseInt(value), + to_logn: login }).then(res=>{ if(res && res.code === 200){ message.success('操作成功'); @@ -169,7 +170,7 @@ function AdvancedInformation(props){ return
高级选项
{/* 提示:转让中状态 */} - {botDetail && botDetail.is_transfer_success === 2 && } + {botDetail && botDetail.is_transfer_success === 2 && }
转让该Bot的所有权至其他用户 diff --git a/src/forge/SecuritySetting/bot/exploit/configuration/compenent/basicInformation.jsx b/src/forge/SecuritySetting/bot/exploit/configuration/compenent/basicInformation.jsx index e12131f64..1276e278a 100644 --- a/src/forge/SecuritySetting/bot/exploit/configuration/compenent/basicInformation.jsx +++ b/src/forge/SecuritySetting/bot/exploit/configuration/compenent/basicInformation.jsx @@ -61,6 +61,8 @@ function BasicInformation(props){ if(res && res.code === 200){ message.success("更改成功"); setReload(Math.random()); + }else{ + message.error(res.message); } }) }) @@ -100,7 +102,7 @@ function BasicInformation(props){ return {botDetail &&

注册信息

-
Bot所有者{current_user.username}
+
Bot所有者{current_user.username}
Bot ID{id}
客户端ID{botDetail.client_id}
主页URL{window.location.origin + `/softbot/${id}`}
@@ -128,7 +130,7 @@ function BasicInformation(props){ rules:[{required:true,message:"请输入Bot名称"}], initialValue: botDetail.bot_name })( - + )} diff --git a/src/forge/SecuritySetting/bot/exploit/configuration/compenent/putaway.jsx b/src/forge/SecuritySetting/bot/exploit/configuration/compenent/putaway.jsx index 9273e9015..88d98887c 100644 --- a/src/forge/SecuritySetting/bot/exploit/configuration/compenent/putaway.jsx +++ b/src/forge/SecuritySetting/bot/exploit/configuration/compenent/putaway.jsx @@ -105,7 +105,7 @@ function Putaway(props){ is_receive_ag1: disabled ? 1 : 0, is_receive_ag2: 0, logo: logo, - market_time: moment().format(), + market_time: "", }).then(res=>{ if(res && res.code === -1){ message.error(res.data); @@ -128,7 +128,7 @@ function Putaway(props){ rules:[{required:true,message:"请输入上架Bot市场名称"}], initialValue: detail.market_name })( - + )} @@ -185,7 +185,7 @@ function Putaway(props){ )} {!isEdit && - 我接受GitLink Bot市场开发者协议 + 我已阅读并接受《GitLink服务协议条款》 } } diff --git a/src/forge/SecuritySetting/bot/exploit/configuration/index.jsx b/src/forge/SecuritySetting/bot/exploit/configuration/index.jsx index 70b380df8..6b4d22ee4 100644 --- a/src/forge/SecuritySetting/bot/exploit/configuration/index.jsx +++ b/src/forge/SecuritySetting/bot/exploit/configuration/index.jsx @@ -50,7 +50,7 @@ function ConfigurateBot(props){ return
- Bot配置 + Bot开发者配置
diff --git a/src/forge/SecuritySetting/bot/exploit/index.jsx b/src/forge/SecuritySetting/bot/exploit/index.jsx index 1a59d0681..85ddfd828 100644 --- a/src/forge/SecuritySetting/bot/exploit/index.jsx +++ b/src/forge/SecuritySetting/bot/exploit/index.jsx @@ -16,7 +16,7 @@ function ExploitBot(props){ const [reload, setReload] = useState(undefined); useEffect(()=>{ - document.title='开发Bot'; + document.title='我的Bot'; }, []) useEffect(()=>{ @@ -73,7 +73,7 @@ function ExploitBot(props){ return
- Bot开发者配置 + 我的Bot
@@ -104,7 +104,7 @@ function ExploitBot(props){
:

您当前暂未注册任何Bot

-
欢迎使用Bot! Bot可以帮助项目贡献者处理繁杂的项目任务,比如关闭疑修、合并请求。在使用之前,请先注册一个Bot!
+
Bot可以帮助您自动化处理一些繁杂的项目任务,欢迎您 注册一个Bot 基于GitLink API进行开发。
此外您还可以在 Bot市场 中共享或安装他人的Bot
)} { const { projectsId , owner } = this.props.match.params; const { projectName } = this.state; + const {current_user:{login, user_id}, projectDetail:{project_id}} = this.props; this.props.confirm({ content: 该操作无法撤销!且将会一并删除相关的疑修、合并请求、工作流、里程碑、动态等数据。
是否确认删除 {owner}/{projectName}({projectsId})
, onOk: () => { const url = `/${owner}/${projectsId}.json`; axios.delete(url).then((result) => { - this.props.showNotification("仓库删除成功!"); - this.props.history.push(`/${owner}`); + // 卸载bot(判断bot是否安装后端做了判断) + unInstallMarketBot({ + login, + user_id, + store_id: project_id, + store_identifier: projectsId }) - .catch((error) => { - console.log(error); - }); + this.props.showNotification("仓库删除成功!"); + this.props.history.push(`/${owner}`); + }) + .catch((error) => { + console.log(error); + }); }, }); }; diff --git a/src/softbot/api.js b/src/softbot/api.js index abd38a47f..cde8eaf10 100644 --- a/src/softbot/api.js +++ b/src/softbot/api.js @@ -214,4 +214,13 @@ export function cancelTransferBot(data) { method: 'post', data: data }); +} + +// 仓库删除时取消安装bot +export function unInstallMarketBot(data){ + return fetch({ + url: '/uninstallMarketBot', + method: 'post', + data: data + }); } \ No newline at end of file diff --git a/src/softbot/image/banner.png b/src/softbot/image/banner.png index 6a76f833f..71c9e535f 100644 Binary files a/src/softbot/image/banner.png and b/src/softbot/image/banner.png differ diff --git a/src/softbot/softBotDetail/index.jsx b/src/softbot/softBotDetail/index.jsx index 917dd2951..73fd9690e 100644 --- a/src/softbot/softBotDetail/index.jsx +++ b/src/softbot/softBotDetail/index.jsx @@ -58,7 +58,7 @@ function SoftBotDEtail(props){ }).then(res=>{ if(res && res.code === 200){ const {is_public, developer_id, bot_name} = res.data; - document.title=bot_name; + document.title=`SoftBot-${bot_name}`; const {user_id, login} = current_user if((login && !is_public && developer_id !== user_id) || (!login && !is_public)){ message.error("私有bot,无权限访问"); @@ -151,7 +151,7 @@ function SoftBotDEtail(props){

{detail.bot_name}

-
{detail.first_func && {detail.first_func}}{detail.developer_name}
+
{detail.first_func && {detail.first_func}}{detail.second_func && {detail.second_func}}{detail.developer_name}
{detail.market_desc}
{((current_user && !current_user.login) || detail.is_public || (!detail.is_public && detail.developer_id === current_user.user_id))&&} @@ -188,7 +188,11 @@ function SoftBotDEtail(props){ > {filterOption.map(item=>({item.name}))} } - {checkValue === 1 && selectValue.map((item, index)=>{return
{item.name}{deleteSelect(item)}}>
})} + {checkValue === 1 && selectValue.map((item, index)=>{return
+ + {`${item.author && item.author.name}/${item.name}`} + {deleteSelect(item)}}> +
})}
权限信息
{detail &&
代码库{detail.limit_and_events.juris_diction_code === 2 ? '无' : detail.limit_and_events.juris_diction_code === 1 ? '读写' : '只读'}权限
} {detail &&
合并请求(PR){detail.limit_and_events.juris_diction_pr === 2 ? '无' : detail.limit_and_events.juris_diction_pr === 1 ? '读写' : '只读'}权限
}