diff --git a/src/forge/Component/Cards.jsx b/src/forge/Component/Cards.jsx index 498b375c..f9a3d52e 100644 --- a/src/forge/Component/Cards.jsx +++ b/src/forge/Component/Cards.jsx @@ -3,7 +3,7 @@ import { getImageUrl } from 'educoder'; import { Link } from 'react-router-dom'; import './Component.scss'; -function Cards({img , title, desc , rightBtn , src}){ +function Cards({img , title, desc , rightBtn , src , bottomInfos}){ return(
取消转移【{project && project.name}】仓库
+ case 'common': + return正在将【{project && project.name}】仓库转移给【{owner && owner.name}】
+ case 'successed': + return【{project && project.name}】仓库成功转移给【{owner && owner.name}】
+ default: + return拒绝转移【{project && project.name}】仓库
+ } + + }else{ + return "" + } + } + + return( ++ {i.applied_user && i.applied_user.name} + {i.time_ago} +
+ {renderStatus(i.status,i.applied)} ++ {i.user && i.user.name} + {i.time_ago} +
+请求将仓库【{i.project && i.project.name}】 + 转移给【{i.owner && i.owner.name}】,是否接受?
+ { + i.status === "common" && + +删除本仓库
-- 删除仓库是永久性的, - 无法撤消,且删除后,与仓库关联的项目/任务/合并请求/版本发布等,均会被删除 -
+转移仓库
++ { + is_transfering ? + 此仓库正在转移给【 + {transfer && {transfer.name}} + 】,请联系对方接收此仓库。 + : + `将此仓库转移给其他用户或组织` + } +
+删除本仓库
++ 删除仓库是永久性的, + 无法撤消,且删除后,与仓库关联的项目/任务/合并请求/版本发布等,均会被删除 +
+
- {item.identifier}
+ {item.name}
{ item.forked_from_project_id && }
{
item.type && item.type !== 0 ?
diff --git a/src/forge/users/Infos.js b/src/forge/users/Infos.js
index e3febfce..f7a1d887 100644
--- a/src/forge/users/Infos.js
+++ b/src/forge/users/Infos.js
@@ -41,8 +41,8 @@ const FanUser = Loadable({
loading: Loading,
})
-const UndoEvents = Loadable({
- loader: () => import("./undo_events"),
+const Notice = Loadable({
+ loader: () => import("../Notice/Index"),
loading: Loading,
})
class Infos extends Component {
@@ -52,7 +52,9 @@ class Infos extends Component {
isSpin: false,
user: undefined,
project_type: undefined,
- route_type: undefined
+ route_type: undefined,
+ undo_events:0,
+ undo_messages:0
};
}
@@ -73,14 +75,22 @@ class Infos extends Component {
});
const { current_user } = this.props;
const { username } = this.props.match.params;
+ const { pathname } = this.props.location;
+ const { notice } = this.state;
let url = `/users/${username || (current_user && current_user.login)}.json`;
axios
.get(url)
.then((result) => {
+ let e = result.data && result.data.undo_events;
+ let p = result.data && result.data.undo_messages;
+ let n = notice || pathname === `/users/${username}/notice` ;
this.setState({
user: result.data,
isSpin: false,
+ undo_events:n ? (e-p) : e,
+ undo_messages:0,
+ notice:n
});
})
.catch((error) => {
@@ -114,11 +124,15 @@ class Infos extends Component {
}
undo_link = () => {
- const {user} = this.state
+ const {user } = this.state;
this.setState({
- route_type: undefined
+ route_type: undefined,
+ project_type:"notice",
+ notice:true
+ },()=>{
+ this.props.history.push(`/users/${user && user.login}/notice`);
+ this.fetchUser();
})
- this.props.history.push(`/users/${user && user.login}/undo_events`)
}
route_link = (type) => {
@@ -130,7 +144,8 @@ class Infos extends Component {
organize_link = () => {
const {user} = this.state
this.setState({
- route_type: undefined
+ route_type: undefined,
+ project_type:"organizes"
})
this.props.history.push(`/users/${user && user.login}/organizes`)
}
@@ -140,7 +155,7 @@ class Infos extends Component {
const { current_user, mygetHelmetapi } = this.props;
const { username } = this.props.match.params;
- const { user, isSpin, project_type, route_type } = this.state;
+ const { user, isSpin, project_type, route_type , undo_events , undo_messages } = this.state;
return (
this.undo_link()}> - - - 待办事项 - - - {user.undo_events} - -
+this.undo_link()}> + + + 待办事项 + + + {undo_events} + +
+this.organize_link()} > - - - 组织 - - - {user && user.user_org_count} - -
+this.organize_link()} > + + + 组织 + + + {user && user.user_org_count} + +
+- 尚未创建任务的实训,不能申请发布 + 尚未创建易修的实训,不能申请发布