Compare commits

...

159 Commits

Author SHA1 Message Date
jasder 3bf9de2d4c Merge pull request 'FIX 合并主干开发分支功能' (#220) from develop into master 2021-10-22 16:55:27 +08:00
jasder 6be0d12e8c Merge pull request 'cherry pick' (#219) from jasder/forgeplus-react:develop into develop 2021-10-22 16:54:51 +08:00
caishi b000fc11f3 iconfont + style 2021-10-22 16:52:27 +08:00
jasder a0fa4eccf0 Merge pull request 'FIX bug' (#209) from jasder/forgeplus-react:develop into develop 2021-10-22 10:09:16 +08:00
jasder d81b40969a FIX 项目路由改造的bug 2021-10-22 10:05:24 +08:00
jasder 9f4069fc6a Merge pull request 'Add license 协议' (#207) from master into develop 2021-10-22 09:58:00 +08:00
jasder 257519f98b Merge branch 'master' of https://git.trustie.net/Gitlink/forgeplus-react 2021-10-22 09:56:37 +08:00
jasder 0c180ace32 ADD MulanPSL-2.0 LICENSE 2021-10-22 09:55:53 +08:00
jasder b703c27d44 Merge pull request '并入master分支' (#205) from develop into master 2021-10-22 09:47:53 +08:00
jasder fe2318021e Merge pull request '合并最新功能代码' (#206) from jasder/forgeplus-react:master into master 2021-10-22 09:47:39 +08:00
jasder 8f9e9b0152 解决代码冲突 2021-10-22 09:41:50 +08:00
jasder cde55c1b3c Merge pull request 'WIP' (#204) from jasder/forgeplus-react:develop into develop 2021-10-21 18:38:47 +08:00
jasder 0f0130742e FIX 解决文件冲突 2021-10-21 18:35:47 +08:00
jasder 12f97cce62 Merge pull request '添加一些功能和修复相关问题' (#196) from pre_develop_dev into pre_develop 2021-10-21 14:51:56 +08:00
jasder 2f90ccab3c Merge pull request '通知管理' (#195) from durian/forgeplus-react:feature_notification_v2_noticeSettings into pre_develop_dev 2021-10-21 14:19:51 +08:00
谢思 035296732a Merge branch 'pre_develop_dev' of https://git.trustie.net/Gitlink/forgeplus-react into feature_notification_v2_noticeSettings 2021-10-21 11:04:36 +08:00
谢思 cc62bde5b4 修改提交列表页 提交信息多行样式问题 2021-10-21 11:02:15 +08:00
jasder 5ef02c698d Merge pull request 'detail.json接口数据精简,前端做对应的修改' (#194) from caishi/forgeplus-react:pre_develop_dev into pre_develop_dev 2021-10-21 10:49:33 +08:00
caishi 13c58faad8 项目详情接口-根据接口使用对应的数据字段 2021-10-21 10:37:10 +08:00
谢思 6435b09982 Merge branch 'pre_develop_dev' of https://git.trustie.net/Gitlink/forgeplus-react into feature_notification_v2_noticeSettings 2021-10-21 09:42:25 +08:00
谢思 a0081bf3b1 Merge branch 'pre_develop' of https://git.trustie.net/Gitlink/forgeplus-react into feature_notification_v2_noticeSettings 2021-10-21 09:41:44 +08:00
jasder a542ed3dcd Merge pull request 'pr新建、编辑、列表等页面,分支过长时需处理' (#193) from caishi/forgeplus-react:pre_develop_dev into pre_develop_dev 2021-10-20 16:52:52 +08:00
caishi 057881097d pr 分支长度 2021-10-20 16:26:23 +08:00
caishi d47c725b96 pr分支过长,显示时应固定宽度 2021-10-20 15:25:35 +08:00
jasder be3e2b6936 Merge pull request '通知公告弹框bug以及pr页面下拉弹框的宽度' (#192) from caishi/forgeplus-react:pre_develop_dev into pre_develop_dev 2021-10-20 11:19:13 +08:00
caishi 76c2d205eb cookie设置时间 2021-10-20 11:06:49 +08:00
caishi 2c867f9856 cookie设置path 2021-10-20 11:05:38 +08:00
caishi 7b74564ecc Merge branch 'pre_develop_dev' of https://git.trustie.net/Gitlink/forgeplus-react into pre_develop_dev 2021-10-20 10:45:56 +08:00
jasder b31503ee0d Merge pull request 'ÅDD compare api on create pr action' (#191) from pre_develop_dev into pre_develop 2021-10-19 11:50:39 +08:00
jasder eadec88e0c Merge pull request '合并请求' (#190) from durian/forgeplus-react:router_v2_issue into pre_develop_dev 2021-10-19 11:46:59 +08:00
谢思 31af77e704 通知管理 2021-10-19 10:45:15 +08:00
谢思 6ff27a559f Merge branch 'pre_develop' of https://git.trustie.net/Gitlink/forgeplus-react into feature_notification_v2_noticeSettings 2021-10-19 10:28:34 +08:00
谢思 fe1bacb984 通知管理+删除基本资料页面的consolo语句 2021-10-19 10:26:36 +08:00
谢思 573ec813a6 Merge branch 'pre_develop' of https://git.trustie.net/Gitlink/forgeplus-react into router_v2_issue 2021-10-19 09:10:37 +08:00
谢思 11b92ac52b 通知管理 2021-10-19 09:00:00 +08:00
jasder e992849723 Merge pull request 'FIx 合并测试分支功能代码' (#188) from pre_develop_dev into pre_develop 2021-10-18 18:00:02 +08:00
jasder 0c52ea22a7 Merge pull request 'ADD平台通知公告' (#187) from featrue_system_popup_notification into pre_develop_dev 2021-10-18 17:59:02 +08:00
谢思 b6b19eabe9 仓库不同时调用compare接口 2021-10-18 17:28:40 +08:00
jasder edbd47ea0f Merge pull request '域名更换弹框样式' (#186) from caishi/forgeplus-react:featrue_system_popup_notification into featrue_system_popup_notification 2021-10-18 17:25:35 +08:00
caishi 644e3c3f73 cookie失效时间改为一天 2021-10-18 17:19:20 +08:00
caishi e7a322e038 弹框样式-markdown渲染有影响 2021-10-18 17:13:52 +08:00
谢思 a2c5c1ea6f 通知管理模块 2021-10-18 16:54:16 +08:00
caishi dfa9b3d835 issue 2021-10-18 15:48:31 +08:00
jasder e744714da0 Merge pull request 'FIX 合并测试分支代码' (#182) from pre_develop_dev into featrue_system_popup_notification 2021-10-18 11:49:55 +08:00
jasder 14df994cd6 Merge pull request 'issue - 易修、合并请求标题长度和显示样式' (#181) from caishi/forgeplus-react:pre_develop_dev into pre_develop_dev 2021-10-18 11:46:58 +08:00
caishi e9546951c9 非汉字需要强制换行 2021-10-18 11:30:20 +08:00
caishi 9de7ac7c90 易修、合并请求标题:字符长度、详情的显示、列表的显示长度等 2021-10-18 11:15:38 +08:00
baladiwei 3e3e9f3681 Merge pull request '202110151541 release' (#179) from pre_develop_dev into pre_develop 2021-10-15 16:03:59 +08:00
jasder 4b2651339b Merge pull request '修改新建合并请求页面目标分支存在但显示不存在bug以及提交详情页面的浏览文件按钮上移样式问题' (#177) from durian/forgeplus-react:router_v2_issue into pre_develop_dev 2021-10-15 15:28:11 +08:00
jasder 4b9cc26d9c Merge pull request 'issue上线' (#178) from caishi/forgeplus-react:pre_develop_dev into pre_develop_dev 2021-10-15 15:26:44 +08:00
谢思 66108083fd 修改新建合并请求页面目标分支存在但显示不存在bug以及提交详情页面的浏览文件按钮上移样式问题 2021-10-15 15:22:22 +08:00
caishi adfd2ae66c Merge branch 'pre_develop_dev' of https://git.trustie.net/Gitlink/forgeplus-react into pre_develop_dev 2021-10-15 15:21:59 +08:00
jasder f78eecd775 Merge pull request 'FIX 合并生产版本分支代码' (#175) from pre_develop into pre_develop_dev 2021-10-15 15:21:48 +08:00
caishi b30f2169e4 数据state 2021-10-15 15:20:21 +08:00
caishi 8ace7da3a7 同上-数据传参 2021-10-15 14:40:40 +08:00
caishi 35110b7db4 动态页面数据传参 2021-10-15 14:15:23 +08:00
caishi 95050bb3bd 非.git结尾的也需要自动填充 2021-10-15 10:54:26 +08:00
jasder f97c90f20e Merge pull request '弹框弹出时间用cookie保存' (#173) from caishi/forgeplus-react:featrue_system_popup_notification into featrue_system_popup_notification 2021-10-15 10:49:17 +08:00
caishi afd2cec4f2 保存cookie时先删除cookie 2021-10-15 10:29:03 +08:00
caishi 0903edfd2c 设置cookie为24小时的限制,超过后重新弹出弹框 2021-10-15 10:27:16 +08:00
caishi 1aa6c05869 动态比例数据 2021-10-14 14:55:35 +08:00
jasder 94fd500423 Merge pull request '合并请求相关路由改造' (#170) from durian/forgeplus-react:feature_router_v2 into pre_develop 2021-10-14 14:34:56 +08:00
jasder 90cfac4436 Merge pull request '动态配置开启通知模块' (#171) from durian/forgeplus-react:pre_develop_dev into pre_develop 2021-10-14 14:34:50 +08:00
caishi db2c3b707a Merge branch 'pre_develop_dev' of https://git.trustie.net/Gitlink/forgeplus-react into pre_develop_dev 2021-10-14 14:28:24 +08:00
caishi bb1175de01 setting修改报错时要隐藏加载效果 2021-10-14 14:28:20 +08:00
jasder c45a6ffe1a Merge pull request '动态页面数据显示、以及样式更改' (#172) from caishi/forgeplus-react:pre_develop_dev into pre_develop_dev 2021-10-14 14:06:17 +08:00
caishi c0f2c77e1a Merge branch 'pre_develop_dev' of https://git.trustie.net/Gitlink/forgeplus-react into pre_develop_dev 2021-10-14 13:59:08 +08:00
caishi c386bcf5e7 动态也数据显示、样式修改 2021-10-14 13:59:03 +08:00
jasder 0b4baa1d03 Merge pull request '项目复刻按钮显示优化' (#169) from hc1913847458/forgeplus-react:testdev into pre_develop_dev 2021-10-14 10:52:38 +08:00
jasder c0afc7a052 Merge pull request 'markdown编辑器' (#168) from caishi/forgeplus-react:pre_develop_dev into pre_develop_dev 2021-10-14 10:46:03 +08:00
hucong 1826c1923f 项目复刻按钮显示优化 2021-10-14 10:45:39 +08:00
caishi 76d8c4b67a Merge branch 'pre_develop_dev' of https://git.trustie.net/Gitlink/forgeplus-react into pre_develop_dev 2021-10-14 10:28:46 +08:00
caishi fbbb3c3aa6 markdown文件样式影响内容 2021-10-14 10:28:41 +08:00
jasder 2f06288507 Merge pull request '项目复刻按钮显示优化' (#167) from hc1913847458/forgeplus-react:testdev into pre_develop_dev 2021-10-14 10:23:37 +08:00
hucong 47b6c3d948 save 2021-10-14 10:21:47 +08:00
hucong f6b59e0a3a save 2021-10-14 10:20:36 +08:00
hucong bb6fe08c54 file 2021-10-14 10:00:51 +08:00
jasder a7283b5567 Merge pull request '域名更换增加提示弹框样式' (#165) from caishi/forgeplus-react:featrue_system_popup_notification into featrue_system_popup_notification 2021-10-14 09:49:02 +08:00
hucong 05eb0367ba 项目复刻按钮显示优化 2021-10-14 09:43:00 +08:00
caishi 3ca38e76a1 弹框的样式 2021-10-14 09:38:20 +08:00
hucong 7b180560a6 Merge branch 'pre_develop_dev' of https://git.trustie.net/Gitlink/forgeplus-react into testdev 2021-10-14 09:38:00 +08:00
hucong 17cf0412cd Merge branch 'pre_develop_dev' of https://git.trustie.net/Gitlink/forgeplus-react into testdev
# Conflicts:
#	src/forge/Main/tag/Index.jsx
2021-10-14 09:37:34 +08:00
jasder f65781b49b Merge pull request '仓库设置-增加仓库标识的修改' (#164) from caishi/forgeplus-react:pre_develop_dev into pre_develop_dev 2021-10-14 09:37:33 +08:00
jasder 82d8a0d198 Merge pull request '域名更换增加提示弹框' (#163) from caishi/forgeplus-react:featrue_system_popup_notification into featrue_system_popup_notification 2021-10-13 18:05:26 +08:00
caishi 0d7805fc9d Merge branch 'featrue_system_popup_notification' of https://git.trustie.net/Gitlink/forgeplus-react into featrue_system_popup_notification 2021-10-13 18:03:24 +08:00
jasder 68b34ab418 Merge pull request 'fix wip' (#162) from pre_develop into featrue_system_popup_notification 2021-10-13 18:02:49 +08:00
caishi 5223a84dac 域名更换通知 2021-10-13 17:58:45 +08:00
jasder 4afb131aef Merge pull request '未登录状态进入消息页面跳转首页' (#160) from durian/forgeplus-react:pre_develop_dev into pre_develop_dev 2021-10-13 17:22:35 +08:00
谢思 5d19f6c06b 未登录状态进入消息页面跳转首页 2021-10-13 17:17:51 +08:00
baladiwei a4902739f2 Merge pull request 'pr路由改造bugfix' (#159) from yuzhantian/forgeplus-react:feature_pull_routers into feature_router_v2 2021-10-13 17:01:18 +08:00
yuzhantian bfcf714822 Merge branch 'feature_router_v2' of https://git.trustie.net/Gitlink/forgeplus-react into feature_pull_routers 2021-10-13 16:56:01 +08:00
巴拉迪维 fc305ae952 Merge branch 'pre_develop' of https://git.trustie.net/Gitlink/forgeplus-react into feature_router_v2 2021-10-13 16:52:58 +08:00
baladiwei 095e27fcc3 Merge pull request '处理未登录状态下地址栏输入跳转消息页面情况' (#157) from durian/forgeplus-react:pre_develop_dev into pre_develop_dev 2021-10-13 16:49:24 +08:00
谢思 5c819070bb 处理未登录状态下地址栏输入跳转消息页面情况 2021-10-13 16:45:21 +08:00
yuzhantian 8e3bd741cb fix: pr路由bugfix 2021-10-13 16:38:43 +08:00
jasder baba177244 Merge pull request '未登录状态隐藏消息铃铛' (#156) from durian/forgeplus-react:pre_develop_dev into pre_develop_dev 2021-10-13 15:24:47 +08:00
谢思 38c553d87c 未登录状态隐藏消息铃铛 2021-10-13 15:14:47 +08:00
baladiwei de79518e0d Merge pull request '动态配置是否开启通知模块' (#155) from durian/forgeplus-react:pre_develop_dev into pre_develop_dev 2021-10-13 13:46:21 +08:00
谢思 a7c2120cf3 动态配置通知模块 2021-10-13 13:37:51 +08:00
谢思 8dcc6c6d59 Merge branch 'pre_develop' of https://git.trustie.net/Gitlink/forgeplus-react into pre_develop_dev 2021-10-13 11:54:12 +08:00
caishi fe4c5a79d2 仓库设置-可修改项目标识 2021-10-13 09:57:04 +08:00
yuzhantian fd21cc6d00 Merge branch 'pre_develop' of https://git.trustie.net/Gitlink/forgeplus-react into feature_pull_routers 2021-10-13 09:11:18 +08:00
hucong cda7311fa1 Merge branch 'pre_develop_dev' of https://git.trustie.net/Gitlink/forgeplus-react into testdev 2021-10-12 17:19:11 +08:00
hucong e726ba40ea Merge branch 'pre_develop_dev' of https://git.trustie.net/Gitlink/forgeplus-react into testdev 2021-10-12 16:43:06 +08:00
baladiwei 279d358be9 Merge pull request '合并请求路由改造' (#147) from yuzhantian/forgeplus-react:feature_pull_routers into feature_router_v2 2021-10-12 16:39:12 +08:00
yuzhantian 50f785bf42 Merge branch 'pre_develop' of https://git.trustie.net/Gitlink/forgeplus-react into feature_pull_routers 2021-10-12 16:12:38 +08:00
yuzhantian a09d330a7e refactor: 新建合并请求路由改造 2021-10-12 16:12:16 +08:00
谢思 9812761b47 Merge branch 'pre_develop' of https://git.trustie.net/Gitlink/forgeplus-react into pre_develop_dev 2021-10-12 16:09:55 +08:00
hucong 8b186467a4 Merge branch 'pre_develop_dev' of https://git.trustie.net/Gitlink/forgeplus-react into testdev 2021-10-12 13:38:26 +08:00
hucong 112aacb6a1 代码库二级页面标签加载优化 2021-10-12 11:49:04 +08:00
yuzhantian 5a88a1a4e6 Merge branch 'pre_develop' of https://git.trustie.net/Gitlink/forgeplus-react into feature_pull_routers 2021-10-11 09:01:02 +08:00
yuzhantian 8a8f8693fe Merge branch 'pre_develop' of https://git.trustie.net/Gitlink/forgeplus-react into feature_pull_routers 2021-10-09 16:43:39 +08:00
yuzhantian da7ff8c749 refactor: 合并请求路由改造以及评论数量bug修复 2021-10-09 16:39:47 +08:00
caishi 0d0b164370 Merge branch 'develop' of https://git.trustie.net/jasder/forgeplus-react into develop 2021-08-23 10:15:55 +08:00
caishi ec84ed56b0 reset 2021-08-23 10:15:32 +08:00
caishi 466ed1fe1b Merge branch 'pre_develop' into develop
# Conflicts:
#	public/css/iconfont.css
#	public/css/iconfont.js
#	public/css/iconfont.ttf
#	public/css/iconfont.woff
#	public/css/iconfont.woff2
2021-08-23 10:09:00 +08:00
caishi 9b101403a1 里程碑-切换分页需要带上状态参数 2021-08-23 10:08:04 +08:00
caishi 6beb4c2c8a 修复镜像项目时的展示问题
修复镜像项目时的展示问题
2021-08-18 14:43:28 +08:00
何童崇 e8dadb187b 紧急修复镜像bug 2021-08-18 14:38:11 +08:00
caishi 3a1fd14e7c 代码库-样式 2021-08-13 17:12:56 +08:00
caishi 20f64bdf81 md fullscreen 2021-08-12 17:36:37 +08:00
caishi 2347d04710 同上-细节修改 2021-08-12 15:24:45 +08:00
caishi d13d94e9cf 代码库样式整改 2021-08-12 11:45:56 +08:00
caishi 00402ef13d Merge branch 'master' of https://git.trustie.net/jasder/forgeplus-react
# Conflicts:
#	src/forge/Main/sub/UpdateDescModal.jsx
2021-08-09 10:37:23 +08:00
caishi 8f2df90555 代码style 2021-08-09 10:36:15 +08:00
caishi 7530d3f9c4 Merge branch 'develop' 2021-08-06 17:07:54 +08:00
hc1913847458 b7869e5203 Merge branch 'develop' of https://git.trustie.net/jasder/forgeplus-react 2021-08-05 10:48:43 +08:00
hc1913847458 b238bb51ca 限制字符 2021-08-05 10:47:22 +08:00
hc1913847458 ad7ab189b1 限制字符 2021-08-04 14:42:08 +08:00
caishi c9802c26a4 Merge branch 'develop' 2021-08-02 10:35:49 +08:00
caishi 4ec840f252 Merge branch 'develop' 2021-07-30 20:13:49 +08:00
caishi 44a8f806e0 Merge branch 'develop' 2021-07-30 17:44:17 +08:00
caishi 9408ad7dcb Merge branch 'develop' 2021-07-30 17:03:19 +08:00
caishi 810ea37bed Merge branch 'develop' 2021-07-26 09:38:44 +08:00
caishi 6679fe8a48 Merge branch 'develop' 2021-07-22 17:44:30 +08:00
caishi d31b932efe Merge branch 'develop' 2021-07-21 10:10:53 +08:00
caishi 07852b204c Merge branch 'develop' 2021-07-05 20:35:59 +08:00
caishi 934ac61b77 Merge branch 'develop' 2021-07-02 18:19:02 +08:00
caishi 95091d0e08 Merge branch 'develop' 2021-07-02 15:37:43 +08:00
caishi e31ff9bdf3 Merge branch 'develop' 2021-07-01 17:00:43 +08:00
caishi eba6ed0876 搜索的接口改用正式版对应的服务器地址 2021-06-28 10:44:42 +08:00
caishi db682ace86 Merge branch 'develop' 2021-06-25 18:34:19 +08:00
caishi 777dbd0f43 Merge branch 'develop' 2021-06-25 18:21:48 +08:00
caishi b44b6530e5 Merge branch 'develop' 2021-06-25 09:14:50 +08:00
caishi b808bcee99 Merge branch 'develop' 2021-06-18 16:56:18 +08:00
caishi c0f7c489fb Merge branch 'develop' 2021-06-11 18:11:43 +08:00
caishi bc64cbb415 Merge branch 'develop' 2021-06-08 14:56:20 +08:00
caishi fa169b27cd Merge branch 'develop' 2021-05-26 16:48:35 +08:00
caishi 3e0814344f Merge branch 'develop' 2021-05-25 11:25:04 +08:00
caishi eb58f91dbf Merge branch 'develop' 2021-05-21 19:21:32 +08:00
caishi 513255428c Merge branch 'develop'
# Conflicts:
#	package-lock.json
2021-05-14 17:04:57 +08:00
caishi 8baf2cb49c install babel-polyfill 2021-05-08 17:28:14 +08:00
caishi 705bfb07bd Merge branch 'develop' 2021-05-08 16:53:26 +08:00
caishi d783d998fc 编辑合并请求-url地址错误 2021-05-08 14:36:12 +08:00
caishi 51925542b8 Merge branch 'develop'
# Conflicts:
#	public/css/edu-purge.css
2021-05-07 16:37:21 +08:00
caishi ff06efe109 merge develop 2021-05-06 17:15:43 +08:00
caishi c33561c212 新建项目-maxlength 2021-05-06 17:14:42 +08:00
caishi 2deb6f8f9d 设置所有标签的marginbottom为0 2021-05-06 17:14:30 +08:00
caishi 63d69a955e 代码库-提交描述未换行 2021-05-06 17:14:19 +08:00
46 changed files with 1452 additions and 407 deletions

124
LICENSE Normal file
View File

@ -0,0 +1,124 @@
木兰宽松许可证, 第2版
2020年1月 http://license.coscl.org.cn/MulanPSL2
您对“软件”的复制、使用、修改及分发受木兰宽松许可证第2版“本许可证”的如下条款的约束
0. 定义
“软件” 是指由“贡献”构成的许可在“本许可证”下的程序和相关文档的集合。
“贡献” 是指由任一“贡献者”许可在“本许可证”下的受版权法保护的作品。
“贡献者” 是指将受版权法保护的作品许可在“本许可证”下的自然人或“法人实体”。
“法人实体” 是指提交贡献的机构及其“关联实体”。
“关联实体” 是指对“本许可证”下的行为方而言控制、受控制或与其共同受控制的机构此处的控制是指有受控方或共同受控方至少50%直接或间接的投票权、资金或其他有价证券。
1. 授予版权许可
每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的版权许可,您可以复制、使用、修改、分发其“贡献”,不论修改与否。
2. 授予专利许可
每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的(根据本条规定撤销除外)专利许可,供您制造、委托制造、使用、许诺销售、销售、进口其“贡献”或以其他方式转移其“贡献”。前述专利许可仅限于“贡献者”现在或将来拥有或控制的其“贡献”本身或其“贡献”与许可“贡献”时的“软件”结合而将必然会侵犯的专利权利要求,不包括对“贡献”的修改或包含“贡献”的其他结合。如果您或您的“关联实体”直接或间接地,就“软件”或其中的“贡献”对任何人发起专利侵权诉讼(包括反诉或交叉诉讼)或其他专利维权行动,指控其侵犯专利权,则“本许可证”授予您对“软件”的专利许可自您提起诉讼或发起维权行动之日终止。
3. 无商标许可
“本许可证”不提供对“贡献者”的商品名称、商标、服务标志或产品名称的商标许可但您为满足第4条规定的声明义务而必须使用除外。
4. 分发限制
您可以在任何媒介中将“软件”以源程序形式或可执行形式重新分发,不论修改与否,但您必须向接收者提供“本许可证”的副本,并保留“软件”中的版权、商标、专利及免责声明。
5. 免责声明与责任限制
“软件”及其中的“贡献”在提供时不带任何明示或默示的担保。在任何情况下,“贡献者”或版权所有者不对任何人因使用“软件”或其中的“贡献”而引发的任何直接或间接损失承担责任,不论因何种原因导致或者基于何种法律理论,即使其曾被建议有此种损失的可能性。
6. 语言
“本许可证”以中英文双语表述,中英文版本具有同等法律效力。如果中英文版本存在任何冲突不一致,以中文版为准。
条款结束
如何将木兰宽松许可证第2版应用到您的软件
如果您希望将木兰宽松许可证第2版应用到您的新软件为了方便接收者查阅建议您完成如下三步
1 请您补充如下声明中的空白,包括软件名、软件的首次发表年份以及您作为版权人的名字;
2 请您在软件包的一级目录下创建以“LICENSE”为名的文件将整个许可证文本放入该文件中
3 请将如下声明文本放入每个源文件的头部注释中。
Copyright (c) [Year] [name of copyright holder]
[Software Name] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
Mulan Permissive Software LicenseVersion 2
Mulan Permissive Software LicenseVersion 2 (Mulan PSL v2)
January 2020 http://license.coscl.org.cn/MulanPSL2
Your reproduction, use, modification and distribution of the Software shall be subject to Mulan PSL v2 (this License) with the following terms and conditions:
0. Definition
Software means the program and related documents which are licensed under this License and comprise all Contribution(s).
Contribution means the copyrightable work licensed by a particular Contributor under this License.
Contributor means the Individual or Legal Entity who licenses its copyrightable work under this License.
Legal Entity means the entity making a Contribution and all its Affiliates.
Affiliates means entities that control, are controlled by, or are under common control with the acting entity under this License, control means direct or indirect ownership of at least fifty percent (50%) of the voting power, capital or other securities of controlled or commonly controlled entity.
1. Grant of Copyright License
Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable copyright license to reproduce, use, modify, or distribute its Contribution, with modification or not.
2. Grant of Patent License
Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable (except for revocation under this Section) patent license to make, have made, use, offer for sale, sell, import or otherwise transfer its Contribution, where such patent license is only limited to the patent claims owned or controlled by such Contributor now or in future which will be necessarily infringed by its Contribution alone, or by combination of the Contribution with the Software to which the Contribution was contributed. The patent license shall not apply to any modification of the Contribution, and any other combination which includes the Contribution. If you or your Affiliates directly or indirectly institute patent litigation (including a cross claim or counterclaim in a litigation) or other patent enforcement activities against any individual or entity by alleging that the Software or any Contribution in it infringes patents, then any patent license granted to you under this License for the Software shall terminate as of the date such litigation or activity is filed or taken.
3. No Trademark License
No trademark license is granted to use the trade names, trademarks, service marks, or product names of Contributor, except as required to fulfill notice requirements in section 4.
4. Distribution Restriction
You may distribute the Software in any medium with or without modification, whether in source or executable forms, provided that you provide recipients with a copy of this License and retain copyright, patent, trademark and disclaimer statements in the Software.
5. Disclaimer of Warranty and Limitation of Liability
THE SOFTWARE AND CONTRIBUTION IN IT ARE PROVIDED WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL ANY CONTRIBUTOR OR COPYRIGHT HOLDER BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO ANY DIRECT, OR INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM YOUR USE OR INABILITY TO USE THE SOFTWARE OR THE CONTRIBUTION IN IT, NO MATTER HOW ITS CAUSED OR BASED ON WHICH LEGAL THEORY, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
6. Language
THIS LICENSE IS WRITTEN IN BOTH CHINESE AND ENGLISH, AND THE CHINESE VERSION AND ENGLISH VERSION SHALL HAVE THE SAME LEGAL EFFECT. IN THE CASE OF DIVERGENCE BETWEEN THE CHINESE AND ENGLISH VERSIONS, THE CHINESE VERSION SHALL PREVAIL.
END OF THE TERMS AND CONDITIONS
How to Apply the Mulan Permissive Software LicenseVersion 2 (Mulan PSL v2) to Your Software
To apply the Mulan PSL v2 to your work, for easy identification by recipients, you are suggested to complete following three steps:
Fill in the blanks in following statement, including insert your software name, the year of the first publication of your software, and your name identified as the copyright owner;
Create a file named "LICENSE" which contains the whole context of this License in the first directory of your software package;
Attach the statement to the appropriate annotated syntax at the beginning of each source file.
Copyright (c) [Year] [name of copyright holder]
[Software Name] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.

View File

@ -2456,7 +2456,7 @@ a.hoverLine:hover{
.color-grey-9 {
color: #333333 !important;
color: #999 !important;
}
a:hover{

View File

@ -1,8 +1,8 @@
@font-face {
font-family: "iconfont"; /* Project id 2340181 */
src: url('iconfont.woff2?t=1632964996877') format('woff2'),
url('iconfont.woff?t=1632964996877') format('woff'),
url('iconfont.ttf?t=1632964996877') format('truetype');
src: url('iconfont.woff2?t=1634881729644') format('woff2'),
url('iconfont.woff?t=1634881729644') format('woff'),
url('iconfont.ttf?t=1634881729644') format('truetype');
}
.iconfont {

View File

@ -97,10 +97,10 @@ const ProjectIndex = Loadable({
loading: Loading,
});
const CreateMerge = Loadable({
loader: () => import('./forge/Merge/NewMerge'),
loading: Loading,
})
// const CreateMerge = Loadable({
// loader: () => import('./forge/Merge/NewMerge'),
// loading: Loading,
// })
// 此处仅维护前端可能的一级路由,不用进行项目或者组织判断的字段。
const keyWord = ["explore", "settings", "setting", "mulan", "wiki", "issues", "setting", "trending", "code", "projects", "pulls", "mine", "login", "register", "email", "export", "nopage", "404", "403", "500", "501", "search", "organize"];
@ -279,7 +279,7 @@ class App extends Component {
} />
{/* 项目PR */}
<Route path="/:owner/:projectsId/pulls/new"
<Route path="/:owner/:projectsId/compare"
render={
(props) => (<ProjectDetail {...this.props} {...props} {...this.state} />)
}

View File

@ -10,6 +10,10 @@ import ActivityItem from './ActivityItem';
import axios from 'axios';
const LIMIT = 15;
const ARRAY = [
{
id:"",
name:'全部'
},
{
id:1,
name:'1天'
@ -32,10 +36,15 @@ class Activity extends Component{
constructor(props){
super(props);
this.state={
time:'30',
time:undefined,
type:undefined,
state:undefined,
page:1,
pr_count:undefined,
new_pr_count:undefined,
close_issues_count:undefined,
open_issues_count:undefined,
pr_all_count:undefined,issues_count:undefined,
data:undefined,
project_trends:undefined,
@ -63,8 +72,15 @@ class Activity extends Component{
this.setState({
data:result.data,
project_trends:result.data.project_trends,
isSpin:false
isSpin:false,
pr_count:result.data.pr_count,
new_pr_count:result.data.new_pr_count,
close_issues_count:result.data.close_issues_count,
open_issues_count:result.data.open_issues_count,
pr_all_count:result.data.pr_all_count,
issues_count:result.data.issues_count,
})
window.scrollTo(0,0);
}
}).catch(error=>{
console.log(error);
@ -74,19 +90,19 @@ class Activity extends Component{
// 切换周期
changeTime=(e)=>{
this.setState({
time:e.key,
time:e.key ==="item_0"?undefined:e.key,
isSpin:true
})
const { type,status,page } = this.state;
this.getInfo(e.key,type,status,page);
this.getInfo(e.key ==="item_0"?undefined:e.key,type,status,page);
}
//筛选
changeTrends=(type,status)=>{
this.setState({
type,status
type,status,page:1
})
const {time,page}=this.state;
this.getInfo(time,type,status,page);
const {time}=this.state;
this.getInfo(time,type,status,1);
}
// 分页
ChangePage=(page)=>{
@ -108,12 +124,14 @@ class Activity extends Component{
</Menu>
)
render(){
const { time , data , page , project_trends , isSpin } = this.state;
const { time , data , page , project_trends , isSpin , pr_count , new_pr_count , close_issues_count , open_issues_count , pr_all_count ,issues_count } = this.state;
let name = time ? ARRAY.filter(item=>item.id === parseInt(time)) :[{name:"全部"}];
let name = time && ARRAY.filter(item=>item.id === parseInt(time)) ;
const second_per = (parseInt(data && data.close_issues_count)/parseInt(data && data.issues_count)*100)+'%';
const third_per = (parseInt(data && data.close_issues_count)/parseInt(data && data.issues_count)*100)+'%';
const fourth_per = (parseInt(data && data.open_issues_count)/parseInt(data && data.issues_count)*100)+'%';
const first_per = pr_all_count > 0 ? `${parseFloat(pr_count/pr_all_count).toFixed(2)*100}%` :"50%";
const second_per =pr_all_count > 0 ? `${parseFloat(new_pr_count/pr_all_count).toFixed(2)*100}%` :"50%";
const third_per =issues_count > 0 ?`${parseFloat(close_issues_count/issues_count).toFixed(2)*100}%` :"50%";
const fourth_per =issues_count > 0 ?`${parseFloat(open_issues_count/issues_count).toFixed(2)*100}%` :"50%";
return(
<div className="main">
@ -122,7 +140,7 @@ class Activity extends Component{
<div className="orderInfo">
<div>
<div className="percentLine prPercent">
<p className="percent_purple" style={{width:'100%'}}></p>
<p className="percent_purple" style={{width:first_per}}></p>
<p className="percent_green resetStyle" style={{width:`${second_per}`}}></p>
</div>
<span>{data && data.pr_all_count}合并请求</span>
@ -132,25 +150,25 @@ class Activity extends Component{
<p className="percent_red" style={{width:`${third_per}`}}></p>
<p className="percent_green" style={{width:`${fourth_per}`}}></p>
</div>
<span>{data && data.issues_count}任务</span>
<span>{data && data.issues_count}易修</span>
</div>
</div>
<ul className="percentBox">
<li>
<span className="purple">{data && data.pr_count}</span>
<span className="change" onClick={()=>this.changeTrends("PullRequest","close")}>已处理的合并请求</span>
<span className="change" onClick={()=>this.changeTrends("PullRequest","delay")}>已处理的合并请求</span>
</li>
<li>
<span className="green">{data && data.new_pr_count}</span>
<span className="change" onClick={()=>this.changeTrends("PullRequest","create")}>未处理的合并请求</span>
<span className="change" onClick={()=>this.changeTrends("PullRequest","not_delay")}>未处理的合并请求</span>
</li>
<li>
<span className="red">{data && data.close_issues_count}</span>
<span className="change" onClick={()=>this.changeTrends("Issue","close")}>已关闭的任务</span>
<span className="change" onClick={()=>this.changeTrends("Issue","delay")}>已关闭的易修</span>
</li>
<li>
<span className="green">{data && data.open_issues_count}</span>
<span className="change" onClick={()=>this.changeTrends("Issue","create")}>未处理的任务</span>
<span className="change" onClick={()=>this.changeTrends("Issue","not_delay")}>未处理的易修</span>
</li>
</ul>
</div>

View File

@ -27,7 +27,7 @@ class ActivityItem extends Component {
:
// 如果是合并请求
<p className="itemLine">
<Link to={`/${owner}/${projectsId}/pulls/${item.trend_id}/Messagecount`} className="color-blue font-16">{item.name}</Link>
<Link to={`/${owner}/${projectsId}/pulls/${item.trend_id}`} className="color-blue font-16">{item.name}</Link>
<span className="activity_type">{item.trend_type}</span>
</p >
}

View File

@ -2,7 +2,7 @@ import React , { useState , useEffect } from 'react';
import { Input , Spin , Menu } from 'antd';
import { getBranch , getTag } from '../GetData/getData';
function SelectOverlay({ changeBranch , tagflag , branchList , projectsId , owner , visible }) {
function SelectOverlay({ changeBranch , tagflag , projectsId , owner , visible }) {
const [ inputValue , setInputValue] = useState(undefined);
const [ nav , setNav ] = useState(0);
const [ isSpin , setIsSpin ] = useState(true);
@ -11,21 +11,13 @@ function SelectOverlay({ changeBranch , tagflag , branchList , projectsId , owne
const [ datas , setDatas ] = useState(undefined);
const [ keys ,setKeys] = useState("branch");
// useEffect(()=>{
// if(visible){
// setKeys("branch");
// getBranchs(projectsId,owner);
// setIsSpin(true);
// }
// },[visible])
useEffect(()=>{
if(branchList){
setData(branchList);
setDatas(branchList);
setIsSpin(false);
if(visible){
setKeys("branch");
getBranchs(projectsId,owner);
setIsSpin(true);
}
},[branchList])
},[visible])
async function getBranchs(id,owner){
let result = await getBranch(id,owner);

View File

@ -0,0 +1,90 @@
.systemBox{
.ant-modal-body{
padding:1px 0px 0px 0px;
.sysBox{
background-image: url('./bg.png');
background-repeat: no-repeat;
background-size: 100% 334px;
margin-top: -55px;
}
.sysnoticeBox{
width: 100%;
padding:80px 0px 34px;
display: flex;
flex-direction: column;
width: 780px;
margin: 0px auto;
p.ntitle{
height: 33px;
font-size: 24px;
font-weight: 500;
color: #31FFF7;
line-height: 33px;
text-align: center;
}
p.nSubtitle{
height: 25px;
line-height: 25px;
font-size: 18px;
font-weight: 500;
color: #FFFFFF;
margin-top: 60px;
padding-left: 20px;
}
.markdown-body{
box-shadow: 0px 0px 17px rgba(0,0,0,0.2);
border-radius: 4px;
margin-top: 17px!important;
}
.nContent{
padding:20px 34px;
background-color: #fff;
line-height: 30px;
font-size: 15px;
font-weight: 400;
color: #333;
.realmName{
margin-top: 20px;
display: flex;
ul{
width: 50%;
padding-left: 0px!important;
li{
font-size: 15px;
font-weight: 500;
line-height: 32px;
text-align: left;
color: #000;
list-style-type: none!important;
&:first-child{
color: #E65714;
}
}
}
}
.nSubdesc{
font-size: 15px;
font-weight: 400;
color: #000000;
line-height: 31px;
margin-top: 20px;
}
.nInfo{
font-size: 14px;
font-weight: 400;
color: #333333;
text-align: right;
margin-top: 25px;
p{
height: 20px;
line-height: 20px;
}
}
}
.nBtn{
text-align: center;
margin-top: 33px;
}
}
}
}

View File

@ -0,0 +1,76 @@
import React , { useEffect , useState } from 'react';
import { Modal , Button } from 'antd';
import './Index.scss';
import '../../css/index.scss';
import RenderHtml from '../../../components/render-html';
import cookie from 'react-cookies';
function SystemNotice({system_notification,history}){
const [ visible , setVisible ] = useState(false);
useEffect(()=>{
if(system_notification && !cookie.load('notice_stage')){
setVisible(true);
}
},[system_notification,history.location])
function sureContinue() {
cookie.remove('notice_stage');
let inFifteenMinutes = new Date(new Date().getTime() + 24 * 3600 * 1000);//
// let inFifteenMinutes = new Date(new Date().getTime() + 60 * 1000);//
cookie.save('notice_stage', true,{ expires: inFifteenMinutes,path:"/" });
setVisible(false);
}
return (
<Modal
visible = {visible}
width="1000px"
footer={false}
title={false}
centered={true}
closable={false}
wrapClassName={'systemBox'}
>
<div className="sysBox">
<div className="sysnoticeBox">
<p className="ntitle">{system_notification && system_notification.subject}</p>
<p className="nSubtitle">{system_notification && system_notification.sub_subject}</p>
{/* <div className="nContent">
<div className="nMaindesc">
为了给用户提供更加稳定优质的服务我们即将对平台门户首页平台名称平台域名进行一次全面升级与变更原平台名称Trustie中文名确实将于2021年10月xx日统一更改为Gitlink中文名确实开源届时平台域名将统一进行更换更换规则如下
</div>
<div className="realmName">
<ul>
<li>原域名</li>
<li>官网顶级域名https://www.trustie.net</li>
<li>版本库子域名https://forgeplus.trustie.net</li>
<li>论坛子域名https://forum.trustie.net/forums</li>
</ul>
<ul>
<li>更换后域名</li>
<li>官网顶级域名https://www.gitlink.org.cn</li>
<li>版本库子域名https://www.git.gitlink.org.cn</li>
<li>论坛子域名https://forum.gitlink.org.cn</li>
</ul>
</div>
<div className="nSubdesc">
自2021年10月xx日起旧域名将停止访问因平台名称与域名变更给您带来的不便我们深表歉意!非常感谢您一直以来对本平台的信任与支持我们将一如既往地为您提供优质的服务 特此通知!
</div>
<div className="nInfo">
<p>Gitlink运营团队</p>
<p>2021年10月xx日</p>
</div>
</div> */}
<RenderHtml className="break_word_comments imageLayerParent" value={system_notification && system_notification.content} url={history.location}/>
<div className="nBtn">
<Button type="primary" className="btnblue" onClick={sureContinue}>确认并继续</Button>
</div>
</div>
</div>
</Modal>
)
}
export default SystemNotice;

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 KiB

View File

@ -367,7 +367,6 @@ class NewHeader extends Component {
}
let search_url = settings && settings.common && settings.common.search;
let notice_url = settings && settings.common && settings.common.notice;
return (
<div className="newHeaders" id="nHeader">
<div className="headerContent">
@ -438,7 +437,7 @@ class NewHeader extends Component {
</Dropdown>:""
}
{current_user && current_user.login ?
{ (settings && settings.common && settings.common.notice) && (current_user && current_user.login)?
<Popover
overlayClassName="notice-popover"
placement={`bottomRight`}
@ -448,9 +447,9 @@ class NewHeader extends Component {
destroyTooltipOnHide
>
<Link to={"/settings/notice"} className="message-icon">
<Badge count={current_user.message_unread_total}>
{current_user && <Badge count={current_user.message_unread_total}>
<i className="iconfont icon-xiaoxilingdang color-grey-6 ml15 mr15"></i>
</Badge>
</Badge>}
</Link>
</Popover>
: ""

View File

@ -407,14 +407,14 @@ function CoderDepot(props){
<Link to={`/${owner}/${projectsId}/branches`} className="iconBtn">
<i className="iconfont icon-master_icon font-16"></i>
<span>分支</span>
<span>{projectDetail && projectDetail.branches && projectDetail.branches.total_count}</span>
<span>{projectDetail && projectDetail.branches_count}</span>
</Link>
</AlignCenter>
<AlignCenter className="mr20">
<Link to={`/${owner}/${projectsId}/tags`} className="iconBtn">
<i className="iconfont icon-biaoqianicon font-16"></i>
<span>标签</span>
<span>{projectDetail && projectDetail.tags && projectDetail.tags.total_count}</span>
<span>{projectDetail && projectDetail.tags_count}</span>
</Link>
</AlignCenter>
</React.Fragment>
@ -426,7 +426,7 @@ function CoderDepot(props){
<div className="addOptionBtn">
{
baseOperate &&
<CheckProfile {...props} sureFunc={()=>urlLink(`/${owner}/${projectsId}/pulls/new/${branchName || defaultBranch}`)} >+ 合并请求</CheckProfile>
<CheckProfile {...props} sureFunc={()=>urlLink(`/${owner}/${projectsId}/compare/master...${branchName || defaultBranch}`)} >+ 合并请求</CheckProfile>
}
{
baseOper &&

View File

@ -0,0 +1,92 @@
import React , { useState, useEffect } from 'react';
import { Link } from "react-router-dom";
import { Dropdown , Menu , Icon , Tooltip , Spin } from 'antd';
import { truncateCommitId } from '../common/util';
import { getBranch } from '../GetData/getData';
import Nodata from '../Nodata';
import './list.scss';
function turnbar(str){
if(str && str.length>0 && str.indexOf("/")>-1){
return str.replaceAll('/','%2F');
}
return str;
}
export default ((props)=>{
const [ data , setData ] =useState(undefined);
const [ isSpin , setIsSpin ] =useState(true);
const { projectsId , owner } = props.match.params;
const { isManager , isDeveloper , projectDetail } = props;
useEffect(()=>{
getBranchs(projectsId, owner);
},[projectsId])
async function getBranchs(id,owner){
let result = await getBranch(id,owner);
setData(result);
setIsSpin(false);
}
const list =()=>{
if(data && data.length>0){
return(
<React.Fragment>
<ul className="branchUl">
{
data.map((item,key)=>{
return(
<li key={key}>
<div>
<Link to={`/${owner}/${projectsId}/tree/${turnbar(item.name)}`} className="color-blue font-15" style={{"maxWidth":"100px"}}>{item.name}</Link>
<p className="f-wrap-alignCenter mt15">
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.last_commit.sha}`)}`} className="mr5 commitKey" style={{marginLeft:0}}>{item.last_commit && truncateCommitId(item.last_commit.sha)}</Link>
<span className="color-grey-3 hide-1 messages leftPoint">{item.last_commit && item.last_commit.message}</span>
<span className="color-grey-8 ml30">最后更新于{item.last_commit && item.last_commit.time_from_now}</span>
</p>
</div>
<span>
{
(isManager || isDeveloper) && (projectDetail && projectDetail.type!==2) &&
<Link to={`/${owner}/${projectsId}/pulls/new/${item.name}`} className="mr20 color-blue mr30">创建合并请求</Link>
}
<Dropdown overlay={menu(item.zip_url,item.tar_url)} trigger={['click']} placement="bottomRight" className="color-green-file">
<a className="ant-dropdown-link">
<Tooltip title={`下载分支${item.name}`}><Icon type="cloud-download" className="font-18"/></Tooltip>
</a>
</Dropdown>
</span>
</li>
)
})
}
</ul>
</React.Fragment>
)
}else if(data && data.length === 0){
return ( <Nodata _html="暂无数据"/>)
}
}
const menu =(zip_url,tar_url)=> (
<Menu>
<Menu.Item key={'0'}><a href={zip_url}>ZIP</a></Menu.Item>
<Menu.Item key={'1'}><a href={tar_url}>TAR.GZ</a></Menu.Item>
</Menu>
)
return(
<React.Fragment>
<div className="main">
<Spin spinning={isSpin}>
<div className="branchTable">
<p className="branchTitle bor-bottom-greyE">分支列表</p>
<div style={{minHeight:"400px"}}>{list()}</div>
</div>
</Spin>
</div>
</React.Fragment>
)
})

View File

@ -3,6 +3,7 @@ import { Spin, Tooltip } from 'antd';
import { Link, Route, Switch } from 'react-router-dom';
import { Content, AlignTop } from '../Component/layout';
import DetailBanner from './sub/DetailBanner';
import { numFormat } from 'educoder';
import '../css/index.scss'
import './list.scss';
@ -70,7 +71,7 @@ const MergeIndexDetail = Loadable({
})
const CreateMerge = Loadable({
loader: () => import('../Merge/NewMerge'),
loader: () => import('../Merge/CreateMerge'),
loading: Loading,
})
@ -150,7 +151,9 @@ function checkPathname(projectsId, owner, pathname) {
name = "about"
} else if (url.indexOf("/issues") > -1 || url.indexOf("Milepost") > 0) {
name = "issues";
} else if (url.indexOf("/pulls") > -1) {
} else if (url.indexOf("/pulls") > -1 || url.indexOf("/compare") > -1) {
// /pulls合并请求除新建合并请求外
// /compare新建合并请求
name = "pulls"
} else if (url.indexOf("/milestones") > -1) {
name = "milestones"
@ -318,6 +321,9 @@ class Detail extends Component {
const url = `/${owner}/${projectsId}/detail.json`;
axios.get(url).then((result) => {
if (result && result.data) {
if (result.data.status === 404) {
this.props.history.push('/nopage');
}
this.setState({
projectDetail: result.data,
project_id: result.data.project_id,
@ -552,7 +558,7 @@ class Detail extends Component {
<span className="detail_tag_btn" loading={forkSpin}>
<Tooltip title="复刻是fork的中文名即复制代码仓库" placement="bottom">
<a className="detail_tag_btn_name" style={{ cursor: platform ? "pointer" : "default" }} onClick={this.forkFunc}>
<i className="iconfont icon-fork color-grey-9 mr3 font-16"></i><span></span>
<i className="iconfont icon-fork color-grey-9 mr3 font-16"></i><span>(Fork)</span>
</a>
</Tooltip>
{
@ -570,6 +576,18 @@ class Detail extends Component {
}
</div>
</AlignTop>
{/* <div className="mt6" style={{minHeight:"20px"}}>
{
projectDetail && projectDetail.forked_from_project_id && projectDetail.fork_info ?
this.textFunc(projectDetail.forked_from_project_id,projectDetail.fork_info)
:""
}
{
projectDetail && projectDetail.type && projectDetail.type !== 0 ?
<span className="color-grey-9">镜像自 <a className="color-blue hoverLine" target="_blank" href={projectDetail.mirror_url}>{projectDetail.mirror_url}</a></span>
:""
}
</div> */}
{
firstSync ? "" :
<DetailBanner
@ -713,22 +731,32 @@ class Detail extends Component {
}
></Route>
{/* 新建合并请求 */}
<Route path="/:owner/:projectsId/pulls/new/:branch"
{/* <Route path="/:owner/:projectsId/compare/:branch"
render={
(props) => (<CreateMerge {...this.props} {...props} {...this.state} {...common} is_fork={true} />)
}
></Route> */}
<Route path="/:owner/:projectsId/compare"
render={
(props) => (<CreateMerge {...this.props} {...props} {...this.state} {...common} is_fork={true} />)
}
></Route>
<Route path="/:owner/:projectsId/pulls/new"
render={
(props) => (<CreateMerge {...this.props} {...props} {...this.state} {...common} is_fork={true} />)
}
></Route>
<Route path="/:owner/:projectsId/pulls/:mergeId/UpdateMerge"
<Route path="/:owner/:projectsId/pulls/:mergeId/edit"
render={
(props) => (<UpdateMerge {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
<Route path="/:owner/:projectsId/pulls/:mergeId/Messagecount"
<Route path="/:owner/:projectsId/pulls/:mergeId"
render={
(props) => (<MessageCount {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
<Route path="/:owner/:projectsId/pulls/:mergeId/commits"
render={
(props) => (<MessageCount {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
<Route path="/:owner/:projectsId/pulls/:mergeId/files"
render={
(props) => (<MessageCount {...this.props} {...props} {...this.state} {...common} />)
}

View File

@ -21,8 +21,8 @@ const Infos = styled.div`
& .markdown-body table{
background: #f1f8ff;
}
& .f-wrap-between{
align-items: center;
& .btnblue{
margin-top: 12px;
}
& .task-hide{
width: 65rem;

View File

@ -480,7 +480,7 @@
}
}
.ant-anchor-wrapper{
padding-left: 2px;
padding-left: 2px!important;
.ant-anchor-ink::before{
background-color: #fff;
}
@ -490,8 +490,8 @@
margin:0px auto;
}
.griditemAnchor{
margin-left: 0px;
padding: 0px;
margin-left: 0px!important;
padding: 0px!important;
border-bottom: 1px solid #ddd;
.ant-anchor{
display: flex;

View File

@ -734,7 +734,9 @@ a.color-grey-ccc:hover{
border: 1px solid rgba(42, 97, 255, 0.23);
border-radius: 4px;
margin-left: 16px;
align-items: center;
& .treecopy{
margin-top: 20px;
}
& .markdown-body table{
background: #FAFCFF;
}

View File

@ -50,7 +50,7 @@ function DetailBanner({ history,list , owner , projectsId , isManager , url , pa
<Link to={{ pathname: `/${owner}/${projectsId}/issues`, state }}>
<Tooltip title="易修是Issue的中文名即问题列表" placement="bottom">
<i className={"iconfont icon-yixiuicon1 color-grey-3 mr5 font-14"}></i>
<span>易修</span>
<span>易修(Issue)</span>
</Tooltip>
{projectDetail && projectDetail.issues_count ? <span className="num">{numFormat(projectDetail.issues_count)}</span> : ""}
</Link>

View File

@ -121,15 +121,15 @@ function Tags(props) {
<SubMenu tab={"tags"} projectsId={projectsId} owner={owner}/>
<Spin spinning={isSpin}>
<div className="tagSpin">
{
source && source.length > 0 &&
<Table
className="tagTable"
dataSource={source} columns={columns} pagination={false}></Table>
}
{
source && source.length === 0 && <Nonedata _html={'暂无数据~'}/>
}
{
source && source.length > 0 &&
<Table
className="tagTable"
dataSource={source} columns={columns} pagination={false}></Table>
}
{
source && source.length === 0 && <Nonedata _html={'暂无数据~'}/>
}
</div>
</Spin>
</div>

View File

@ -91,7 +91,7 @@ function Index(props) {
<div className="treeabout">
{
(isManager || isDeveloper) && (projectDetail && projectDetail.type!==2) &&
<Link to={`/${owner}/${projectsId}/pulls/new/${i.name}`} className="btn-83">+ 合并请求</Link>
<Link to={`/${owner}/${projectsId}/compare/master...${i.name}`} className="btn-83">+ 合并请求</Link>
}
<Dropdown overlay={menu(i.zip_url,i.tar_url)} trigger={['click']} placement="bottomRight">
<a className="btn-83 ml15">下载<i className="iconfont icon-sanjiaoxing-down font-14"></i></a>

View File

@ -22,9 +22,14 @@
border-bottom: none;
}
.treeinfo{
max-width: 399px;
width: 399px;
flex:1;
flex-direction: column;
&>a{
display: block;
width: 399px;
}
a:hover{
span{
color: #466AFF!important;

View File

@ -0,0 +1,448 @@
import React, { Component } from 'react';
import { Input, Select, Spin, Alert } from 'antd';
import axios from 'axios';
import MergeForm from './merge_form';
import MergeFooter from './merge_footer';
import '../Order/order.css';
import './merge.css';
/**
* 根据url获取目标仓库目标分支源仓库源分支
* 路由规则owner/projectId/compare/merge...pullowner:pullBranch
* 可能存在的情况
* 1代码库首页跳转仓库相同目标分支为默认分支owner/projectId/compare/pullBranch
* 2代码库分支列表仓库相同目标分支为默认分支owner/projectId/compare/pullBranch
* 3合并请求列表页新建无数据时的提示仓库相同目标都为默认分支owner/projectId/compare
* 4新建页面切换分支切换目标仓库刷新页面等存在所有可能情况
*/
function getBranchParams(pathname) {
const result = {
// 目标仓库所有者
mergeOwner: undefined,
// 目标分支
mergeBranch: 'master',
// 源仓库所有者
pullOwner: undefined,
// 源分支
pullBranch: 'master',
// 仓库名称
projectId: undefined,
};
// 去掉第一个字符/
const _pathname = pathname.slice(1);
const [ownerProject, branchUrl] = _pathname.split('/compare');
const [mergeOwner, projectId] = ownerProject.split('/');
// 同仓库时
result.mergeOwner = mergeOwner;
result.pullOwner = mergeOwner;
result.projectId = projectId;
if (branchUrl) {
// 如果存在具体的分支
const _branchUrl = branchUrl.slice(1);
if (_branchUrl.indexOf('...') > -1) {
// 存在源分支与目标分支
const [mergeBranch, pullObj] = _branchUrl.split('...');
result.mergeBranch = mergeBranch;
if (pullObj.indexOf(':') > -1) {
// 存在源仓库
const [pullOwner, pullBranch] = pullObj.split(':');
result.pullOwner = pullOwner;
result.pullBranch = pullBranch;
} else {
result.pullBranch = pullObj;
}
} else {
result.pullBranch = _branchUrl;
}
}
return result;
}
const Option = Select.Option;
class CreateMerge extends Component {
constructor(props) {
super(props);
const { pullBranch, mergeBranch } = getBranchParams(
this.props.location.pathname
);
this.state = {
data: undefined,
pullBranches: undefined,
mergeBranches: undefined,
mergeProjects: undefined,
merge: mergeBranch || 'master',
pull: pullBranch || 'master',
id: undefined,
// isFork: false,
projects_names: undefined,
isSpin: true,
showMessage: false,
merge_head: false, // 是否向fork后的源项目发起合并请求
defaultMessage: '必须选择不同的分支',
project_id: undefined, // 当前项目的id也即开始发送合并请求的源项目id
merge_project_user: undefined,
comparesData: undefined, //提交和文件的内容保存compare接口返回的数据
// 比较分支时的加载效果
isCompareSpin: true,
// 是否是初次加载用这个字段来控制提示组件和文件组件的显示、隐藏比直接用isCompareSpin交互友好些
isFirstLoading: true,
};
}
componentDidMount = () => {
// 初始化时根据url获取目标仓库、分支源仓库、分支
// 再获取对应的仓库列表、分支列表
// 再调用比较接口
const branchParams = getBranchParams(this.props.location.pathname);
this.getMergeInfo(branchParams);
};
componentDidUpdate = (preProps) => {
// url变化触发时切换源分支、切换目标仓库、切换目标分支回退
const oldPathname = preProps.location.pathname;
const newPathname = this.props.location.pathname;
if (oldPathname !== newPathname) {
const branchParams = getBranchParams(newPathname);
this.getMergeInfo(branchParams);
}
};
//获取新建合并请求数据
getMergeInfo = (branchParams) => {
this.setState({ isSpin: true });
const { pullOwner, pullBranch, mergeOwner, mergeBranch, projectId } =
branchParams;
const url = `/${pullOwner}/${projectId}/pulls/new.json`;
axios
.get(url)
.then((result) => {
if (result) {
// 如果url上的分支不存在取默认值master
const noMergeBranch =
(result.data.branches || []).filter(
(branch) => branch.name === mergeBranch
).length === 0;
const noPullBranch =
(result.data.branches || []).filter(
(branch) => branch.name === pullBranch
).length === 0;
this.setState({
// isFork: result.data.is_fork,
projects_names: result.data.projects_names,
mergeProjects: result.data.merge_projects,
pullBranches: result.data.branches,
mergeBranches: result.data.branches,
project_id: result.data.project_id,
id: result.data.id,
merge: mergeBranch,
pull: pullBranch,
});
//判断源分支是否存在
if(noPullBranch){
this.setState({
showMessage: true,
defaultMessage:'源分支不存在',
isCompareSpin: false,
});
}else{
if(pullOwner === mergeOwner){
if (!noMergeBranch) {
this.compareProject(true, branchParams);
} else {
this.setState({
showMessage: true,
defaultMessage:'目标分支不存在',
isCompareSpin: false,
});
}
}else{
this.getBranchList(branchParams);
}
}
}
this.setState({ isSpin: false });
})
.catch((error) => {
this.setState({ isSpin: false });
console.log(error);
});
};
// compare接口获取分支对比信息
compareProject = (sameProject, branchParams) => {
// const { project } = this.props;
// const { owner, projectsId } = this.props.match.params;
const { pullOwner, pullBranch, mergeOwner, mergeBranch, projectId } =
branchParams;
let url = `/${mergeOwner}/${projectId}/compare`;
if (sameProject) {
url += `/${pullBranch}...${mergeBranch}.json`;
} else {
url += `/${mergeBranch}...${pullOwner}/${projectId}:${pullBranch}.json`;
}
this.setState({ isSpin: false, isCompareSpin: true });
axios
.get(url)
.then((result) => {
if (result) {
if (result.data.status === 0) {
this.setState({
showMessage: false,
});
} else {
this.setState({
showMessage: true,
defaultMessage: result.data.message,
});
}
this.setState({
comparesData: result.data,
});
}
this.setState({
isFirstLoading: false,
isSpin: false,
isCompareSpin: false,
});
})
.catch((error) => {
this.setState({ isSpin: false, isCompareSpin: false });
});
};
// 根据所有者、仓库名,获取分支列表,目前仅涉及目标仓库分支查询
getBranchList = (branchParams) => {
const { mergeOwner, projectId, mergeBranch } = branchParams;
this.setState({ isSpin: true });
const url = `/${mergeOwner}/${projectId}/pulls/get_branches.json`;
axios
.get(url)
.then((result) => {
if (result) {
const noMergeBranch =
(result.data || []).filter((branch) => branch.name === mergeBranch)
.length === 0;
this.setState({
mergeBranches: result.data,
showMessage: noMergeBranch,
defaultMessage: '目标分支不存在',
isCompareSpin: false,
});
!noMergeBranch && this.compareProject(false, branchParams);
}
this.setState({ isSpin: false });
})
.catch((error) => {
this.setState({ isSpin: false });
console.log(error);
});
};
// 切换分支事件
selectBrach = (type, value) => {
const { pullOwner, pullBranch, mergeOwner, mergeBranch, projectId } =
getBranchParams(this.props.location.pathname);
let _url = `/${mergeOwner}/${projectId}/compare/`;
// type为pull时pullBranch取value否则取原有值
// type为pull时mergeBranch取原有值否则取value
let _pullBranch = type === 'pull' ? value : pullBranch;
let _mergeBranch = type === 'pull' ? mergeBranch : value;
if (pullOwner === mergeOwner) {
// 如果仓库相同, compare/目标分支...源分支
_url += `${_mergeBranch}...${_pullBranch}`;
} else {
// 如果仓库不同, compare/目标分支...源分支
_url += `${_mergeBranch}...${pullOwner}:${_pullBranch}`;
}
this.props.history.push(_url);
};
// 切换仓库响应事件,目前仅目标分支可切换仓库
selectProjectName = (value) => {
const { projects_names, id } = this.state;
const { pullOwner, pullBranch } = getBranchParams(
this.props.location.pathname
);
let arr =
projects_names && projects_names.filter((item) => item.id === value);
let identifier = arr && arr[0].project_id;
let login = arr && arr[0].project_user_login;
// 目标仓库与源仓库不是一个仓库
let is_fork = parseInt(value, 10) !== parseInt(id, 10);
this.setState({
isSpin: true,
// merge_head: is_fork,
data: {
is_original: is_fork,
fork_project_id: is_fork ? id : '',
merge_user_login: is_fork
? projects_names[0].project_user_login
: undefined,
},
});
if (login === pullOwner) {
// 如果切换后, 仓库与源仓库一致了
this.props.history.push(
`/${login}/${identifier}/compare/master...${pullBranch}`
);
} else {
this.props.history.push(
`/${login}/${identifier}/compare/master...${pullOwner}:${pullBranch}`
);
}
// this.newMergelist(login, identifier);
};
// 渲染分支列表
renderBrances = (list) => {
if (list && list.length > 0) {
return list.map((item, key) => {
return (
<Option key={key + 1} value={item.name}>
{item.name}
</Option>
);
});
}
};
// 渲染项目列表
renderProjectNames = (list) => {
if (list && list.length > 0) {
return list.map((item, key) => {
return (
<Option key={key + 1} value={item.id}>
{item.project_name}
</Option>
);
});
}
};
// 渲染html内容
withHtml = (html) => {
return <div dangerouslySetInnerHTML={{ __html: html }}></div>;
};
render() {
const {
data,
pullBranches,
mergeBranches,
mergeProjects,
pull,
merge,
isSpin,
isCompareSpin,
isFirstLoading,
showMessage,
defaultMessage,
projects_names,
id,
comparesData,
} = this.state;
let { project } = this.props;
return (
<div>
<Spin spinning={isSpin || isCompareSpin}>
<div className="main">
<div className="merge-header width100 inline-block">
<div className="width40 pull-left">
<div className="color-grey-3 mb10 fwb">源分支:</div>
<Input.Group compact className="display-flex">
<Select
value={id}
className="hide-1 task-hide flex1"
disabled
>
{this.renderProjectNames(projects_names)}
</Select>
<Select
value={pull}
onSelect={(e) => this.selectBrach('pull', e)}
showSearch
className="merge-flex1 flex1 matchwidth"
dropdownMatchSelectWidth={false}
dropdownClassName="overlihide"
>
{this.renderBrances(pullBranches)}
</Select>
</Input.Group>
</div>
<div className="width10 pull-left text-center mt25">
<i
className={'iconfont icon-youjiang color-grey-c font-32'}
></i>
</div>
<div className="width40 pull-left">
<div>
<div className="color-grey-3 mb10 fwb">目标分支:</div>
<Input.Group compact className="display-flex">
<Select
value={project && project.id}
className="hide-1 task-hide flex1"
onSelect={(e) => this.selectProjectName(e)}
>
{this.renderProjectNames(mergeProjects)}
</Select>
<Select
value={merge}
onSelect={(e) => this.selectBrach('merge', e)}
showSearch
className="merge-flex1 flex1 matchwidth"
dropdownMatchSelectWidth={false}
dropdownClassName="overlihide"
>
{this.renderBrances(mergeBranches)}
</Select>
</Input.Group>
</div>
</div>
</div>
{/* 非加载状态且有提示 */}
{!isCompareSpin && showMessage && (
<div className="mb20">
<Alert
description={this.withHtml(defaultMessage)}
type="error"
/>
</div>
)}
{/* 非加载状态且可以提交 */}
{!isCompareSpin && !showMessage && (
<MergeForm
{...this.props}
merge_type="new"
data={data}
merge={merge}
pull={pull}
files_count={
comparesData &&
comparesData.diff &&
comparesData.diff.files_count
}
commits_count={comparesData && comparesData.commits_count}
></MergeForm>
)}
</div>
{!isFirstLoading && (
<MergeFooter
{...this.props}
merge={merge}
pull={pull}
comparesData={comparesData}
></MergeFooter>
)}
</Spin>
</div>
);
}
}
export default CreateMerge;

View File

@ -228,7 +228,7 @@ class MergeDetail extends Component {
<div>
{
data && data.issue.user_permission ?
<Link to={`/${owner}/${projectsId}/pulls/${mergeid}/updatemerge`} className="color-blue fr">编辑</Link>
<Link to={`/${owner}/${projectsId}/pulls/${mergeid}/edit`} className="color-blue fr">编辑</Link>
: ''
}
</div>

View File

@ -62,9 +62,9 @@ class MergeItem extends Component {
<p className="mb15 df" style={{ alignItems: "center" }}>
<i className={`iconfont icon-hebingqingqiu1 font-14 mr3 i_${status}`}></i>
<Link
to={`/${owner}/${projectsId}/pulls/${item.pull_request_id}/Messagecount`}
to={`/${owner}/${projectsId}/pulls/${item.pull_request_id}`}
className="hide-1 font-15 color-grey-3 fwb lineh-30 mr10"
style={{ maxWidth: "300px" }}
style={{ maxWidth: "600px" }}
>
{item.name}
</Link>
@ -110,7 +110,7 @@ class MergeItem extends Component {
<Tag className="pr-branch-tag">
<Link
to={`/${item.is_original ? item.fork_project_user : owner}/${ item.is_original ? item.fork_project_identifier : projectsId }/tree/${turnbar(item.pull_request_head)}`}
className="maxW200px hide-1 ver-middle"
className="maxW200px task-hide ver-middle" style={{maxWidth:"200px"}}
>
{item.is_original
? item.fork_project_user
@ -134,7 +134,7 @@ class MergeItem extends Component {
<Tag className="pr-branch-tag">
<Link
to={`/${owner}/${projectsId}/tree/${turnbar(item.pull_request_base)}`}
className="maxW200px hide-1 ver-middle"
className="maxW200px task-hide ver-middle" style={{maxWidth:"200px"}}
>
{/* {item.is_fork ? item.pull_request_base : `${item.author_name}:${item.pull_request_base}`} */}
{project_author_name}:{item.pull_request_base}
@ -175,7 +175,7 @@ class MergeItem extends Component {
{item.journals_count ? (
<Link
className="mr5 color-grey-8"
to={`/${owner}/${projectsId}/pulls/${item.pull_request_id}/Messagecount`}
to={`/${owner}/${projectsId}/pulls/${item.pull_request_id}`}
>
<i className="iconfont icon-huifu1 font-15 mr5 ver-middle"></i>
{item.journals_count}
@ -196,7 +196,7 @@ class MergeItem extends Component {
>
<div className="grid-item mr15 color-grey-9">
<Link
to={`/${owner}/${projectsId}/pulls/${item.pull_request_id}/updatemerge`}
to={`/${owner}/${projectsId}/pulls/${item.pull_request_id}/edit`}
className="color-grey-9"
>
<i className="iconfont icon-bianji3 font-14 mr5"></i>

View File

@ -0,0 +1,210 @@
import React, { Component } from 'react';
import { Tabs, Spin } from 'antd';
import { Link } from 'react-router-dom';
import axios from 'axios';
import Commits from './Commits';
import Comments from '../comments/comments';
import Files from './Files';
import '../Order/order.css';
import './merge.css';
const { TabPane } = Tabs;
class MergeFooter extends Component {
constructor(props) {
super(props);
this.state = {
commitsData: [],
filesData: undefined,
isSpin: false,
activeKey: '1',
commitCount: 0,
filesCount: 0,
//
commentsTotalCount: 0,
};
}
componentDidMount() {
this.Init();
// 便
this.props.bindFootRef && this.props.bindFootRef(this);
}
componentDidUpdate(prevProps) {
// tab退taburltab
const newPathname = this.props.location.pathname;
const prevPathname = prevProps.location.pathname;
if (newPathname !== prevPathname) {
this.Init(true);
}
}
Init = (isTabChange) => {
const { data, location, match } = this.props;
const { pathname } = location;
const { projectsId, owner, mergeId } = match.params;
let activeKey = '1';
if (pathname.indexOf('commits') > -1) {
activeKey = '2';
this.getCommit(owner, projectsId, mergeId);
} else if (pathname.indexOf('files') > -1) {
activeKey = '3';
this.getFile(owner, projectsId, mergeId);
}
if (isTabChange && activeKey === '1') {
this.refreshComment();
}
this.setState({
activeKey: activeKey,
commitCount: data && data.commits_count,
filesCount: data && data.files_count,
});
};
bindCommentRef = (commentRef) => {
this.childComment = commentRef;
}
refreshComment = () => {
this.childComment && this.childComment.getjournalslist();
}
getCommit = (owner, projectsId, mergeId) => {
this.setState({ isSpin: true });
const url = `/${owner}/${projectsId}/pulls/${mergeId}/commits.json`;
axios
.get(url)
.then((result) => {
if (result) {
this.setState({
commitsData: result.data.commits,
commitCount: result.data.commits_count,
});
}
this.setState({ isSpin: false });
})
.catch((error) => {
this.setState({ isSpin: false });
});
};
getFile = (owner, projectsId, mergeId) => {
this.setState({ isSpin: true });
const url = `/${owner}/${projectsId}/pulls/${mergeId}/files.json`;
axios
.get(url)
.then((result) => {
if (result) {
this.setState({
filesData: result.data,
filesCount: result.data.files_count,
});
}
this.setState({ isSpin: false });
})
.catch((error) => {
this.setState({ isSpin: false });
});
};
render() {
const { projectsId, owner, mergeId } = this.props.match.params;
const { order_id, data = {} } = this.props;
const {
isSpin,
activeKey,
filesCount,
commitCount,
filesData,
commitsData = [],
} = this.state;
// Comment0
const commentsTotalCount = parseInt(
this.state.commentsTotalCount || data.comments_total_count || 0,
10
);
return (
<div className="main mergeRequest" style={{ paddingTop: '0px' }}>
<Spin spinning={isSpin}>
<Tabs
activeKey={activeKey}
className="custom-commit-tabs"
animated={false}
>
<TabPane
tab={
<Link to={`/${owner}/${projectsId}/pulls/${mergeId}`}>
<span className="font-16">评论</span>
{commentsTotalCount > 0 && (
<span className="tabNum">{commentsTotalCount}</span>
)}
</Link>
}
key="1"
>
<Comments
order_id={order_id}
showNotification={this.props.showNotification}
only_show_content={true}
updateCommentsNum={(commentsCount) => {
this.setState({ commentsTotalCount: commentsCount || 0 });
}}
{...this.props}
bindCommentRef={this.bindCommentRef}
/>
</TabPane>
{commitCount > 0 && (
<TabPane
tab={
<Link to={`/${owner}/${projectsId}/pulls/${mergeId}/commits`}>
<span className="font-16">提交</span>
{commitCount > 0 && (
<span className="tabNum">{commitCount}</span>
)}
</Link>
}
key="2"
>
{commitsData.length > 0 && (
<Commits
{...this.props}
commits={commitsData}
projectsId={projectsId}
owner={owner}
></Commits>
)}
</TabPane>
)}
{filesCount > 0 && (
<TabPane
tab={
<Link to={`/${owner}/${projectsId}/pulls/${mergeId}/files`}>
<span className="font-16">文件</span>
{filesCount > 0 && (
<span className="tabNum">{filesCount}</span>
)}
</Link>
}
key="3"
>
<Files
{...this.props}
data={filesData}
projectsId={projectsId}
owner={owner}
/>
</TabPane>
)}
</Tabs>
</Spin>
</div>
);
}
}
export default MergeFooter;

View File

@ -1,7 +1,6 @@
import React, { Component } from "react";
import { Tabs } from 'antd';
import { Link } from "react-router-dom";
import { AlignCenter } from '../Component/layout';
import axios from "axios";
import { getImageUrl } from "educoder";
import {
@ -11,7 +10,6 @@ import {
Dropdown,
Icon,
Menu,
Select,
Tag,
Button,
Alert,
@ -19,9 +17,8 @@ import {
import "./merge.css";
import RenderHtml from "../../components/render-html";
import "../Order/order.css";
import MergeFooter from "./merge_footer";
import MergeLinkFooter from "./MergeLinkFooter";
const Option = Select.Option;
const TextArea = Input.TextArea;
function turnbar(str){
@ -61,6 +58,11 @@ class MessageCount extends Component {
// this.clickBody();
};
bindFootRef = (footRef) => {
this.footRef = footRef;
}
clickBody=()=>{
document.body.addEventListener('click', e => {
let name = e.target.className;
@ -150,6 +152,8 @@ class MessageCount extends Component {
});
const { getDetail } = this.props;
getDetail && getDetail();
// 调用子组件的方法刷新评论列表
this.footRef && this.footRef.refreshComment();
} else {
this.setState({ SpinMerge: false });
}
@ -283,13 +287,13 @@ class MessageCount extends Component {
conflict_files && conflict_files.length>0 &&
<div>
<p className="mt10 font-16 pt10" style={{borderTop:"1px solid #f9d7d5"}}>如下文件有代码冲突</p>
<p>
<div>
{
conflict_files.map((i,k)=>{
return <p>{i}</p>
return <p key={k}>{i}</p>
})
}
</p>
</div>
</div>
}
</div>
@ -336,11 +340,11 @@ class MessageCount extends Component {
<div>
<div className="main">
<div>
<div className="grid-item-top pb20 border-1f">
<div>
<div className="pb20 border-1f df">
<div className="flex1">
<div className="ver-middle">
<span className="mr10 ver-middle">
<span className="font-18 fwb">
<span className="font-18 fwb" style={{wordBreak:"break-all"}}>
{data.issue.subject}
</span>
</span>
@ -362,7 +366,7 @@ class MessageCount extends Component {
<Tag className="pr-branch-tag">
<Link
to={`/${data.pull_request.is_original ? data.pull_request.fork_project_user : data.issue.project_author_name}/${data.pull_request.is_original?data.project_identifier:projectsId}/tree/${turnbar(data.pull_request && data.pull_request.head)}`}
className="ver-middle"
className="ver-middle task-hide" style={{maxWidth:"200px"}} title={`${data.pull_request.is_original ? data.pull_request.fork_project_user : data.issue.project_author_name}: ${data.pull_request && data.pull_request.head}`}
>
{data.pull_request.is_original ? data.pull_request.fork_project_user : data.issue.project_author_name}: {data.pull_request && data.pull_request.head}
</Link>
@ -377,7 +381,7 @@ class MessageCount extends Component {
<Tag className="pr-branch-tag">
<Link
to={`/${owner}/${projectsId}/tree/${data.pull_request.base}`}
className="ver-middle"
className="ver-middle task-hide" style={{maxWidth:"200px"}} title={`${data.issue.project_author_name}:${data.pull_request.base}`}
>
{data.issue.project_author_name}:{data.pull_request.base}
</Link>
@ -441,14 +445,13 @@ class MessageCount extends Component {
</span>
</div>
</div>
<div className="ml10">
<div className="mt15 text-right" style={{display:"flex",justifyContent:"flex-end"}}>
<div className="ml10 text-right">
{operate && (
<Button
type="green"
ghost
className="ml20"
onClick={()=>{this.props.history.push(`/${owner}/${projectsId}/pulls/${mergeId}/UpdateMerge`);}}
onClick={()=>{this.props.history.push(`/${owner}/${projectsId}/pulls/${mergeId}/edit`);}}
>
编辑
</Button>
@ -465,7 +468,6 @@ class MessageCount extends Component {
</Button>
)}
</div>
</div>
</div>
{
data.issue.description ?
@ -543,7 +545,7 @@ class MessageCount extends Component {
onChange={this.changbodypr}
/>
</div>
<p
<div
className="clearfix mt15"
style={{ display: this.state.buttonshow }}
>
@ -558,19 +560,19 @@ class MessageCount extends Component {
取消
</Button>
</Spin>
</p>
</div>
</div>
</Spin>
)}
</div>
</div>
<MergeFooter
footer_type={true}
<MergeLinkFooter
order_id={data && data.issue.id}
{...this.props}
{...this.state}
></MergeFooter>
bindFootRef={this.bindFootRef}
></MergeLinkFooter>
</div>
) : (
""

View File

@ -6,6 +6,11 @@ import "./merge.css";
import MergeForm from "./merge_form";
import MergeFooter from "./merge_footer";
const Option = Select.Option;
/**
* 此文件已废弃新文件为CreateMerge.js
* 2021.10.12
*/
class NewMerge extends Component {
constructor(props) {
super(props);
@ -194,7 +199,7 @@ class NewMerge extends Component {
// this.ischeckmerge();
let { id ,merge , pull } = this.state;
if(type==="pull"){
this.props.history.push(`/${owner}/${projectsId}/pulls/new/${pull}`)
this.props.history.push(`/${owner}/${projectsId}/compare/${pull}`)
this.compareProject(id,value,merge);
}else{
this.compareProject(id,pull,value);
@ -216,7 +221,7 @@ class NewMerge extends Component {
merge_user_login: is_fork_id ? projects_names[0].project_user_login : undefined
}
})
this.props.history.push(`/${login}/${identifier}/pulls/new`);
this.props.history.push(`/${login}/${identifier}/compare`);
this.newMergelist(login,identifier);
};

View File

@ -64,12 +64,12 @@ class UpdateMerge extends Component {
<div className="color-grey-3 mb10 fwb">源分支:</div>
<Input.Group compact className="display-flex">
<Button className="merge-header-button maxW50 hide-1 task-hide">
<Button className="merge-header-button flex1 maxW50 hide-1 task-hide" disabled>
{data.is_original ? `${data.fork_project_user_name}/${data.fork_project_identifier}` : `${data.project_author}/${data.project_name}`}
</Button>
<Select
defaultValue={data.is_original ? `${data.fork_project_user}:${pull}` : `${pull}`}
className="minW50 merge-flex1"
className="minW50 merge-flex1 flex1 matchwidth"
disabled
></Select>{" "}
</Input.Group>{" "}
@ -83,12 +83,12 @@ class UpdateMerge extends Component {
<div>
<div className="color-grey-3 mb10 fwb"> 目标分支 : </div>{" "}
<Input.Group compact className="display-flex">
<Button className="merge-header-button maxW50 hide-1 task-hide">
<Button className="merge-header-button flex1 maxW50 hide-1 task-hide" disabled>
{`${data.project_author}/${data.project_name}`}
</Button>
<Select
defaultValue={data.is_original ? `${data.project_login}:${merge}` : `${merge}`}
className="minW50 merge-flex1"
className="minW50 merge-flex1 flex1 matchwidth"
disabled
></Select>{" "}
</Input.Group>{" "}

View File

@ -40,6 +40,7 @@ form .ant-cascader-picker, form .ant-select {
}
.merge-header-button{
background:rgba(241,248,255,1);
text-align: left;
}
.width70{
width:70%;
@ -211,5 +212,14 @@ form .ant-cascader-picker, form .ant-select {
}
.mergeRequest .folders{
width: 72rem;
}
/* width: 72rem; */
width: 100%;
}
.matchwidth .ant-select-selection__rendered{
width: 200px;
}
.overlihide li{
max-width: 450px;
}

View File

@ -213,7 +213,7 @@ class merge extends Component {
checkOperation() {
const { projectsId,owner } = this.props.match.params;
this.props.history.push(`/${owner}/${projectsId}/pulls/new`);
this.props.history.push(`/${owner}/${projectsId}/compare/master...master`);
}
render() {
const { projectsId , owner } = this.props.match.params;

View File

@ -1,169 +1,84 @@
import React, { Component } from "react";
import { Tabs, Spin } from "antd";
import "../Order/order.css";
import "./merge.css";
import Commits from "./Commits";
import Comments from "../comments/comments";
import Files from "./Files";
import axios from 'axios';
import React, { Component } from 'react';
import { Tabs } from 'antd';
import Commits from './Commits';
import Files from './Files';
import '../Order/order.css';
import './merge.css';
const { TabPane } = Tabs;
class MergeFooter extends Component {
constructor(props){
constructor(props) {
super(props);
this.state={
pageData:undefined,
commitsData:undefined,
filesData:undefined,
isSpin:false,
activeKey:"1",
commitCount:0,
filesCount:0
}
}
componentDidMount=()=>{
const { footer_type ,data } = this.props;
if(footer_type){
const { projectsId , owner , mergeId } = this.props.match.params;
this.getCommit(owner,projectsId,mergeId);
this.getFile(owner,projectsId,mergeId);
}
this.setState({
activeKey:footer_type ? "1" : "2",
commitCount:data && data.commits_count,
filesCount:data && data.files_count
})
}
componentDidUpdate=(prevProps)=>{
const { comparesData } = this.props;
const { footer_type } = this.props;
if(footer_type){
const { data } = this.props;
if(data !== prevProps.data){
this.setState({
commitCount:data && data.commits_count,
filesCount:data && data.files_count
})
}
}
if(comparesData !== prevProps.comparesData){
this.setState({
activeKey:footer_type ? "1" : "2"
})
this.changeTab(footer_type ? "1" : "2");
}
this.state = {
activeKey: '1',
};
}
changeTab=(index)=>{
changeTab = (index) => {
this.setState({
isSpin:true
})
this.setState({
activeKey:index
})
const { footer_type , comparesData } = this.props;
const { projectsId , owner , mergeId } = this.props.match.params;
if(footer_type){
if(index === "2"){
this.getCommit(owner,projectsId,mergeId);
}else if(index === "3"){
this.getFile(owner,projectsId,mergeId);
}else{
this.setState({
isSpin:false
})
}
}else{
this.setState({
commitsData:comparesData.commits,
filesData:comparesData.diff,
commitCount:comparesData.commits_count,
filesCount:comparesData.diff && comparesData.diff.files_count,
isSpin:false
})
}
}
getCommit =(owner,projectsId,mergeId)=>{
const url = `/${owner}/${projectsId}/pulls/${mergeId}/commits.json`;
axios.get(url).then(result=>{
if(result){
this.setState({
commitsData:result.data.commits,
isSpin:false,
commitCount:result.data.commits_count
})
}
}).catch(error=>{})
}
getFile =(owner,projectsId,mergeId)=>{
const url = `/${owner}/${projectsId}/pulls/${mergeId}/files.json`;
axios.get(url).then(result=>{
if(result){
this.setState({
filesData:result.data,
isSpin:false,
filesCount:result.data.files_count,
})
}
}).catch(error=>{})
}
activeKey: index,
});
};
render() {
const { projectsId , owner } = this.props.match.params;
const { projectsId, owner } = this.props.match.params;
const { comparesData = {} } = this.props;
const { commits, diff, commits_count } = comparesData;
const { activeKey } = this.state;
const { footer_type, order_id, data , comparesData } = this.props;
let { isSpin , activeKey , filesCount, commitCount , filesData , commitsData } = this.state;
return (
!footer_type && !comparesData || (comparesData && ((comparesData.commits && comparesData.commits.length===0)||(comparesData && !comparesData.diff)) )?"":
<div className="main mergeRequest" style={{paddingTop:"0px"}}>
<Spin spinning={isSpin}>
<Tabs
activeKey={activeKey}
className="custom-commit-tabs"
animated={false}
onChange={this.changeTab}
>
{
footer_type &&
<TabPane
tab={
<span><span className="font-16">评论</span>
{data && parseInt(data.comments_count) > 0 && <span className="tabNum">{data.comments_count}</span>}
</span>
} key="1">
<Comments
order_id={order_id}
showNotification={this.props.showNotification}
only_show_content={true}
{...this.props}
/>
</TabPane>
}
{
commitsData && commitsData.length > 0 &&
<TabPane tab={<span><span className="font-16">提交</span>
{commitCount > 0 && <span className="tabNum">{commitCount}</span>}
</span>} key="2">
<Commits {...this.props} commits={commitsData} projectsId={projectsId} owner={owner}></Commits>
</TabPane>
}
{
filesData && filesData.files && filesData.files.length>0 &&
<TabPane tab={
<span><span className="font-16">文件</span>
{filesCount > 0 && <span className="tabNum">{filesCount}</span>}
</span>
} key="3">
<Files {...this.props} data={filesData} projectsId={projectsId} owner={owner}/>
</TabPane>
}
</Tabs>
</Spin>
return (commits && commits.length === 0) || !diff ? (
''
) : (
<div className="main mergeRequest" style={{ paddingTop: '0px' }}>
<Tabs
activeKey={activeKey}
className="custom-commit-tabs"
animated={false}
onChange={this.changeTab}
>
{commits && commits.length > 0 && (
<TabPane
tab={
<span>
<span className="font-16">提交</span>
{commits_count > 0 && (
<span className="tabNum">{commits_count}</span>
)}
</span>
}
key="1"
>
<Commits
{...this.props}
commits={commits}
projectsId={projectsId}
owner={owner}
></Commits>
</TabPane>
)}
{diff && diff.files && diff.files.length > 0 && (
<TabPane
tab={
<span>
<span className="font-16">文件</span>
{diff.files_count > 0 && (
<span className="tabNum">{diff.files_count}</span>
)}
</span>
}
key="3"
>
<Files
{...this.props}
data={diff}
projectsId={projectsId}
owner={owner}
/>
</TabPane>
)}
</Tabs>
</div>
);
}

View File

@ -165,7 +165,8 @@ class MergeForm extends Component {
this.setState({
isSpin: false,
});
this.props.history.push(`/${owner}/${projectsId}/pulls`);
const { pull_request_id } = result.data;
this.props.history.push(`/${owner}/${projectsId}/pulls/${pull_request_id}`);
const { getDetail } = this.props;
getDetail && getDetail();
} else {
@ -195,7 +196,7 @@ class MergeForm extends Component {
isSpin: false,
});
this.props.history.push(
`/${owner}/${projectsId}/pulls/${mergeId}/Messagecount`
`/${owner}/${projectsId}/pulls/${mergeId}`
);
} else {
this.setState({
@ -264,7 +265,7 @@ class MergeForm extends Component {
},
],
initialValue: title,
})(<Input placeholder="标题" maxLength={50} />)}
})(<Input placeholder="标题" maxLength={200} />)}
</Form.Item>
<MDEditor
placeholder={"请输入合并请求的描述..."}
@ -287,7 +288,7 @@ class MergeForm extends Component {
type="default"
className="ml30"
onClick={()=>{
this.props.history.push(merge_type === "new" ? `/${owner}/${projectsId}/pulls` : `/${owner}/${projectsId}/pulls/${mergeId}/detail`)
this.props.history.push(merge_type === "new" ? `/${owner}/${projectsId}/pulls` : `/${owner}/${projectsId}/pulls/${mergeId}`)
}}
>
<span className="plr10">取消</span>

View File

@ -12,7 +12,7 @@ class Nodata extends Component{
<h3>欢迎使用合并请求</h3>
<div className="color-grey-8">
合并请求可以帮助您与他人协作编写代码在使用之前请先创建一个 <Link className="color-blue" to={`/${owner}/${projectsId}/pulls/new`}>合并请求</Link>
合并请求可以帮助您与他人协作编写代码在使用之前请先创建一个 <Link className="color-blue" to={`/${owner}/${projectsId}/compare/master...master`}>合并请求</Link>
</div>
</div>
</div>

View File

@ -285,12 +285,16 @@ class Index extends Component {
if(value.indexOf("/") > -1){
let arr = value.split("/");
let first = arr[arr.length-1];
if(first.indexOf(".git") > -1){
if(first.indexOf(".") > -1){
let second = first.split('.')[0];
if(!second)return;
this.props.form.setFieldsValue({
repository_name:second
})
}else{
this.props.form.setFieldsValue({
repository_name:first
})
}
}
}
@ -351,7 +355,7 @@ class Index extends Component {
required: true, message: '请填写镜像版本库地址'
}],
})(
<Input placeholder="请输入需要导入到本项目的仓库地址" onChange={this.ChangeAddr} />
<Input placeholder="请输入需要导入到本项目的仓库地址" onBlur={this.ChangeAddr} />
)}
</Form.Item>
<p className="formTip color-orange">示例https://github.com/facebook/reack.git</p>

View File

@ -1,5 +1,7 @@
import React, { Component } from "react";
import Editor from "react-monaco-editor";
// import {UnControlled as CodeMirror} from 'react-codemirror2'
import UserSubmitComponent from "./UserSubmitComponent";
import "./index.css";
@ -103,6 +105,17 @@ class m_editor extends Component {
editorWillMount={this.editorWillMount}
editorDidMount={handleEditorMount}
/>
{/* <CodeMirror
value={editorValue}
options={{
theme: 'monokai',
mode: 'JavaScript',
extraKeys: {"Ctrl": "autocomplete"},//ctrl可以弹出提示
styleActiveLine: true,
lineNumbers: true,
readOnly:true
}}
/> */}
</div>
{!readOnly && (
<div className="editorBorderSubmitBox" style={{marginTop:"20px",padding:"20px"}}>

View File

@ -233,7 +233,7 @@ class Detail extends Component {
: "合并请求"}
</span>
<span className="font-16 fwb">{data && data.subject}</span>
<span className="font-16 fwb" style={{wordBreak:"break-all"}}>{data && data.subject}</span>
</span>
{data && data.priority && (

View File

@ -320,7 +320,7 @@ class order_form extends Component {
message: "请填写易修标题",
},
]
})(<Input placeholder="标题" size="large" maxLength={80}/>)}
})(<Input placeholder="标题" size="large" maxLength={200}/>)}
</Form.Item>
<div className="quillContent">
<MDEditor

View File

@ -43,8 +43,9 @@ const PrivateLetter = Loadable({
});
function Index(props){
const { current_user } = props;
const { current_user,mygetHelmetapi } = props;
const { pathname } = props.location;
const notice_url = mygetHelmetapi && mygetHelmetapi.common && mygetHelmetapi.common.notice;
return(
<div className="newMain clearfix whiteBack">
@ -59,11 +60,11 @@ function Index(props){
<li>个人信息</li>
<li className={pathname.indexOf("/settings/profile")>-1 ?"active":""}><Link to={`/settings/profile`}><i className="iconfont icon-gerenziliao mr5 font-14"></i><span className="text-shodow-bold">基本资料</span></Link></li>
</ul>
<ul className="securityUl ul-border-buttom">
{notice_url && <ul className="securityUl ul-border-buttom">
<li>消息通知</li>
<li className={(pathname.indexOf("/settings/notice")>-1 && pathname.indexOf("/settings/notice/config") == -1) || pathname.indexOf("/settings/notice/privateLetter")>-1 ?"active":""}><Link to={"/settings/notice"}><i className="iconfont icon-wodetongzhi"></i><span className="text-shodow-bold">我的通知</span></Link></li>
{/* <li className={pathname.indexOf("/settings/notice/config")>-1 ?"active":""}><Link to={'/settings/notice/config'}><i className="iconfont icon-tongzhiguanli"></i><span className="text-shodow-bold">通知管理</span></Link></li> */}
</ul>
<li className={pathname.indexOf("/settings/notice/config")>-1 ?"active":""}><Link to={'/settings/notice/config'}><i className="iconfont icon-tongzhiguanli"></i><span className="text-shodow-bold">通知管理</span></Link></li>
</ul>}
<ul className="securityUl">
<li>安全设置</li>
<li className={pathname.indexOf("/settings/SSH")>-1 ?"active":""}><Link to={`/settings/SSH`}><i className="iconfont icon-xuanzhongssh_icon mr5 font-14"></i><span className="text-shodow-bold">SSH密钥</span></Link></li>
@ -72,18 +73,24 @@ function Index(props){
<LongWidth>
<Gap>
<Switch>
<Route
path="/settings/notice"
render={(p) => (
<MyNoticeIndex {...props} {...p}/>
)}
></Route>
<Route
path="/settings/notice/config"
render={(p) => (
<NoticeManager {...props} {...p}/>
)}
></Route>
<Route
path="/settings/notice/privateLetter"
render={(p)=>(
<PrivateLetter{...props} {...p}/>
)}
></Route>
<Route
path="/settings/notice"
render={(p) => (
<MyNoticeIndex {...props} {...p}/>
)}
></Route>
<Route
path="/settings/SSH/new"
render={(p) => (
@ -102,12 +109,6 @@ function Index(props){
<SSHIndex {...props} {...p}/>
)}
></Route>
<Route
path="/settings/notice/privateLetter"
render={(p)=>(
<PrivateLetter{...props} {...p}/>
)}
></Route>
</Switch>
</Gap>
</LongWidth>

View File

@ -1,9 +1,52 @@
import { Button, Checkbox } from "antd";
import React from "react";
import { Checkbox } from "antd";
import React, { useEffect, useState } from "react";
import axios from 'axios';
import './Index.scss';
function NoticeManager(props){
const {current_user} = props;
const [settingTypes, setSettingTypes] = useState();
const [userNotification, setUserNotification] = useState();
const [userEmail, setUserEmail] = useState();
function onChange(type,e,setting){
let notification_body = userNotification;
let email_body = userEmail;
if(type){//
notification_body[setting] = e.target.checked;
}else{//
email_body[setting] = e.target.checked;
}
axios.post(`/users/${current_user.login}/template_message_settings/update_setting.json`,{
setting:{
notification_body:notification_body,
email_body:email_body
}
}).then(response=>{
if(response && response.status === 0){
getUserSettings();
}
})
}
function getUserSettings(){
axios.get(`/users/${current_user.login}/template_message_settings.json`).then((response)=>{
if(response && response.status === 200 ){
setUserEmail(response.data.email_body);
setUserNotification(response.data.notification_body);
}
})
}
useEffect(()=>{
axios.get("/template_message_settings.json").then(response => {
if (response && response.status === 200) {
setSettingTypes(response.data.setting_types);
}
})
getUserSettings();
},[])
return(
<div className="notice01">
@ -12,87 +55,23 @@ function NoticeManager(props){
</div>
<div>
<span className="notice-manager-tip">您可以通过通知管理来选择接受通知的方式</span>
<div className="manager-cont-top">
我创建或负责的
</div>
<div className="manager-cont">
<div className="manager-cont-title">易修状态变更</div>
<Checkbox defaultChecked='true' disabled>站内信</Checkbox>
<Checkbox >邮件</Checkbox>
</div>
<div className="manager-cont">
<div className="manager-cont-title">易修截止日期到达最后一天</div>
<Checkbox defaultChecked='true' disabled>站内信</Checkbox>
<Checkbox >邮件</Checkbox>
</div>
<div className="manager-cont">
<div className="manager-cont-title">合并请求状态变更</div>
<Checkbox defaultChecked='true' disabled>站内信</Checkbox>
<Checkbox >邮件</Checkbox>
</div>
<div className="manager-cont">
<div className="manager-cont-title">易修有新的评论</div>
<Checkbox defaultChecked='true'>站内信</Checkbox>
<Checkbox >邮件</Checkbox>
</div>
<div className="manager-cont">
<div className="manager-cont-title">合并请求有新的评论</div>
<Checkbox defaultChecked='true'>站内信</Checkbox>
<Checkbox >邮件</Checkbox>
</div>
<div className="manager-cont-top">
我管理的仓库
</div>
<div className="manager-cont">
<div className="manager-cont-title">被关注</div>
<Checkbox defaultChecked='true'>站内信</Checkbox>
<Checkbox >邮件</Checkbox>
</div>
<div className="manager-cont">
<div className="manager-cont-title">被点赞</div>
<Checkbox defaultChecked='true'>站内信</Checkbox>
<Checkbox >邮件</Checkbox>
</div>
<div className="manager-cont">
<div className="manager-cont-title">被复刻</div>
<Checkbox defaultChecked='true'>站内信</Checkbox>
<Checkbox >邮件</Checkbox>
</div>
<div className="manager-cont">
<div className="manager-cont-title">有新的里程碑</div>
<Checkbox defaultChecked='true'>站内信</Checkbox>
<Checkbox >邮件</Checkbox>
</div>
<div className="manager-cont-top">
我关注的仓库
</div>
<div className="manager-cont">
<div className="manager-cont-title">被删除</div>
<Checkbox defaultChecked='true'>站内信</Checkbox>
<Checkbox >邮件</Checkbox>
</div>
<div className="manager-cont">
<div className="manager-cont-title">被转移</div>
<Checkbox defaultChecked='true'>站内信</Checkbox>
<Checkbox >邮件</Checkbox>
</div>
<div className="manager-cont">
<div className="manager-cont-title">有新的易修</div>
<Checkbox defaultChecked='true'>站内信</Checkbox>
<Checkbox >邮件</Checkbox>
</div>
<div className="manager-cont">
<div className="manager-cont-title">有新的合并请求</div>
<Checkbox defaultChecked='true'>站内信</Checkbox>
<Checkbox >邮件</Checkbox>
</div>
<div className="manager-cont">
<div className="manager-cont-title">有新的版本发布</div>
<Checkbox defaultChecked='true'>站内信</Checkbox>
<Checkbox >邮件</Checkbox>
</div>
{settingTypes && userNotification && userEmail && settingTypes.map((item,key)=>{
return(
item.type_name && <div key={key}>
<div className="manager-cont-top">{item.type_name}</div>
{item.settings.map((i, k) => {
const setting = item.type.substring(item.type.indexOf("::")+2)+"::"+i.key;
return (
<div className="manager-cont" key={k}>
<div className="manager-cont-title">{i.name}</div>
<Checkbox disabled = {i.notification_disabled} defaultChecked={userNotification[setting]} onChange={(e)=>{onChange(true,e,setting)}}>站内信</Checkbox>
<Checkbox disabled = {i.email_disabled} defaultChecked={userEmail[setting]} onChange={(e)=>{onChange(false,e,setting)}}>邮件</Checkbox>
</div>
)
})}
</div>
)
})}
</div>
</div>
)

View File

@ -9,10 +9,9 @@ import './Index.scss';
import '../manager/Index.scss'
function MyNotice(props) {
let current_user = props.current_user;
let resetUserInfo = props.resetUserInfo;
let { current_user, resetUserInfo, location, mygetHelmetapi, history}= props;
//tab
let popover = props.location.query && props.location.query.noticeType;
let popover = location && location.query && location.query.noticeType;
let pageSize = 15;
const [noticeType, setNoticeType] = useState(popover==="atme"?"2":"0");//tab
const [selectedNum, setSelectedNum] = useState(0);//@
@ -27,6 +26,18 @@ function MyNotice(props) {
const [currentPage, setCurrentPage] = useState(1);//
const [onlyUnread, setOnlyUnread] = useState();
//访/settings/profile
//访/explore
useEffect(()=>{
let notice = mygetHelmetapi && mygetHelmetapi.common && mygetHelmetapi.common.notice;
let login = current_user && current_user.login;
if(!login){
history.push(`/explore`);
}else if(!notice){
history.push(`/settings/profile`);
}
},[mygetHelmetapi])
useEffect(()=>{
popover==="atme" ? setNoticeType("2"):setNoticeType("0");
},[popover])
@ -46,7 +57,7 @@ function MyNotice(props) {
limit: pageSize,
page: currentPage,
};
axios.get(`/users/${current_user.login}/messages.json`, {
current_user && axios.get(`/users/${current_user.login}/messages.json`, {
params: params,
}).then((response) => {
if(response && response.data){
@ -59,7 +70,7 @@ function MyNotice(props) {
}
function readNotice(id){
if(id){
if(id && current_user){
const params = {
type: noticeType === "0" ? "notification" : noticeType === "2" ? "atme" : "",
ids:id,

View File

@ -157,19 +157,18 @@ class Setting extends Component {
...values,
}).then((result) => {
if (result) {
this.setState({
loading:false
})
this.props.showNotification(`仓库信息修改成功!`);
// if(values.project_identifier !== projectsId){
// this.props.history.push(`/${owner}/${values.project_identifier}/settings`);
// }else{
// }
if(values.project_identifier !== projectsId){
this.props.history.push(`/${owner}/${values.project_identifier}/settings`);
}else{
const { getDetail } = this.props;
getDetail && getDetail();
}
}
this.setState({
loading:false
})
}).catch((error) => {
console.log(error);
this.setState({
loading:false
})
@ -288,7 +287,9 @@ class Setting extends Component {
)}
</Form.Item>
</div>
{/* <Form.Item label=" (url)">
<Form.Item
label={<span>项目标识 <span className="color-grey-9">(项目url标识部分更改项目标识将导致原仓库地址失效)</span></span>}
>
{getFieldDecorator("project_identifier", {
rules: [
{
@ -299,7 +300,7 @@ class Setting extends Component {
})(
<Input placeholder="项目标识请使用与项目相关的英文关键字" maxLength="100" />
)}
</Form.Item> */}
</Form.Item>
<Form.Item label="项目简介">
{getFieldDecorator("project_description", {
rules: [],

View File

@ -17,6 +17,7 @@ class children_comments extends Component {
page: 1,
journal_spin: false,
search_count: 0,
isSpin: false,
};
}
@ -71,6 +72,9 @@ class children_comments extends Component {
.then((result) => {
if (result) {
this.getChildrenJournals();
// 删除回复后,如果需手动调用父组件查询评论列表的接口,以保持角标(评论数量)的一致(合并请求页面),
// 否则直接查顶级评论列表,否则只查询当前子评论列表(易修页面)
this.props.refreshCommentList && this.props.refreshCommentList();
}
})
.catch((error) => {
@ -80,9 +84,15 @@ class children_comments extends Component {
// 翻页
ChangePage = (page) => {
this.state.page = page;
this.state.isSpin = true;
this.getChildrenJournals();
// this.state.page = page;
// this.state.isSpin = true;
// 使用回调的写法这样在getChildrenJournals中使用的就是最新的state
this.setState({
page,
isSpin: true
}, () => {
this.getChildrenJournals();
});
};
commentCtx = (v) => {
@ -183,7 +193,7 @@ class children_comments extends Component {
size="large"
loading={isSpin}
dataSource={journalsdata.issue_journals}
renderItem={(item) => <List.Item>{this.renderList(item)}</List.Item>}
renderItem={(item) => <List.Item key={item.id}>{this.renderList(item)}</List.Item>}
/>
{this.Paginations()}
</div>

View File

@ -35,6 +35,8 @@ class comments extends Component {
componentDidMount = () => {
this.getjournalslist();
// 给父组件绑定以使父组件可以使用组件内方法用于切换tab时重新请求评论列表、合并请求完之后重新请求评论列表
this.props.bindCommentRef && this.props.bindCommentRef(this);
};
//添加评论
@ -151,6 +153,8 @@ class comments extends Component {
isSpin: false,
fileList: undefined,
});
const { updateCommentsNum } = this.props;
updateCommentsNum && updateCommentsNum(result.data.journals_total_count);
}
})
.catch((error) => {
@ -372,7 +376,7 @@ class comments extends Component {
const renderList = (item) => {
return (
<div className="width100">
<div className="width100" key={item.id}>
<div className="pb5">
<Link
to={`/${item && item.user_login}`}
@ -456,6 +460,7 @@ class comments extends Component {
parent_id={item.id}
onRef={this.onRef}
children_comment_id={new_journal_id}
refreshCommentList={this.getjournalslist}
{...this.props}
></ChildrenComments>
</div>
@ -500,7 +505,7 @@ class comments extends Component {
loading={isSpin}
header=""
dataSource={journalsdata.issue_journals}
renderItem={(item) => <List.Item>{renderList(item)}</List.Item>}
renderItem={(item) => <List.Item key={item.id}>{renderList(item)}</List.Item>}
/>
)}
{this.Paginations()}
@ -558,7 +563,7 @@ class comments extends Component {
header=""
dataSource={journalsdata.issue_journals}
renderItem={(item) => (
<List.Item>{renderList(item)}</List.Item>
<List.Item key={item.id}>{renderList(item)}</List.Item>
)}
/>
)}

View File

@ -11,7 +11,6 @@ export default Form.create()(
const { getFieldDecorator, validateFields , setFieldsValue } = props && props.form;
// const { username } = props && props.match && props.match.params;
const { resetUserInfo , current_user } = props;
console.log(props);
useEffect(()=>{
if(current_user && current_user.login){

View File

@ -298,7 +298,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {
.CodeMirror-scroll {
overflow: scroll !important;
margin-bottom: -30px;
margin-right: -30px;
margin-right: -30px!important;
padding-bottom: 30px;
height: 100%;
outline: none;

View File

@ -7,6 +7,7 @@ import './TPMIndex.css';
import LoginDialog from '../login/LoginDialog';
import EducoderAccount from '../../forge/Component/EducoderAccount';
import ProfileModal from '../../forge/Component/ProfileModal/Index';
import SystemNotice from '../../forge/Component/NoticeModal/SystemNotice';
export function TPMIndexHOC(WrappedComponent) {
return class II extends React.Component {
@ -27,7 +28,7 @@ export function TPMIndexHOC(WrappedComponent) {
giteaVisible:false,
email:undefined,
completeProfile:false,
showCP:false
showCP:false,
}
}
@ -214,9 +215,8 @@ export function TPMIndexHOC(WrappedComponent) {
})
}
render() {
let { isRender , current_user , giteaVisible , email , completeProfile , showCP } = this.state;
let { isRender , current_user , giteaVisible , email , completeProfile , showCP , mygetHelmetapi } = this.state;
const common = {
showLoginDialog: this.showLoginDialog,
checkIfLogin: this.checkIfLogin,
@ -225,6 +225,11 @@ export function TPMIndexHOC(WrappedComponent) {
};
return (
<div className="indexHOC">
<SystemNotice
system_notification={mygetHelmetapi && mygetHelmetapi.system_notification}
history={this.props.history}
login={current_user && current_user.login}
/>
<EducoderAccount visible={giteaVisible} email={email} onOk={this.onOk}/>
<ProfileModal
visible={!completeProfile && showCP}