diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..04a210b9 --- /dev/null +++ b/LICENSE @@ -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 License,Version 2 +Mulan Permissive Software License,Version 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 IT’S 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 License,Version 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. diff --git a/public/css/iconfont.css b/public/css/iconfont.css index 3866189c..37a53c1c 100644 --- a/public/css/iconfont.css +++ b/public/css/iconfont.css @@ -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 { diff --git a/src/forge/Branch/SelectOverlay.jsx b/src/forge/Branch/SelectOverlay.jsx index e9c4aae4..0be56732 100644 --- a/src/forge/Branch/SelectOverlay.jsx +++ b/src/forge/Branch/SelectOverlay.jsx @@ -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); diff --git a/src/forge/Component/NoticeModal/Index.scss b/src/forge/Component/NoticeModal/Index.scss new file mode 100644 index 00000000..18e4dcda --- /dev/null +++ b/src/forge/Component/NoticeModal/Index.scss @@ -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; + } + } + } +} \ No newline at end of file diff --git a/src/forge/Component/NoticeModal/SystemNotice.jsx b/src/forge/Component/NoticeModal/SystemNotice.jsx new file mode 100644 index 00000000..1560c1ff --- /dev/null +++ b/src/forge/Component/NoticeModal/SystemNotice.jsx @@ -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 ( + +
+
+

{system_notification && system_notification.subject}

+

{system_notification && system_notification.sub_subject}

+ {/*
+
+ 为了给用户提供更加稳定、优质的服务,我们即将对平台门户首页、平台名称、平台域名进行一次全面升级与变更。原平台名称:Trustie(中文名:确实)将于2021年10月xx日统一更改为Gitlink(中文名:确实开源)。届时平台域名将统一进行更换,更换规则如下 +
+
+
    +
  • 原域名:
  • +
  • 官网顶级域名https://www.trustie.net
  • +
  • 版本库子域名https://forgeplus.trustie.net
  • +
  • 论坛子域名https://forum.trustie.net/forums
  • +
+
    +
  • 更换后域名:
  • +
  • 官网顶级域名https://www.gitlink.org.cn
  • +
  • 版本库子域名https://www.git.gitlink.org.cn
  • +
  • 论坛子域名https://forum.gitlink.org.cn
  • +
+
+
+ 自2021年10月xx日起,旧域名将停止访问。因平台名称与域名变更给您带来的不便,我们深表歉意!非常感谢您一直以来对本平台的信任与支持,我们将一如既往地为您提供优质的服务。 特此通知! +
+
+

Gitlink运营团队

+

2021年10月xx日

+
+
*/} + +
+ +
+
+
+
+ ) +} +export default SystemNotice; \ No newline at end of file diff --git a/src/forge/Component/NoticeModal/bg.png b/src/forge/Component/NoticeModal/bg.png new file mode 100644 index 00000000..625b3c31 Binary files /dev/null and b/src/forge/Component/NoticeModal/bg.png differ diff --git a/src/forge/Main/CoderDepot.jsx b/src/forge/Main/CoderDepot.jsx index 8dd5e468..f50c134a 100644 --- a/src/forge/Main/CoderDepot.jsx +++ b/src/forge/Main/CoderDepot.jsx @@ -407,14 +407,14 @@ function CoderDepot(props){ 分支 - {projectDetail && projectDetail.branches && projectDetail.branches.total_count} + {projectDetail && projectDetail.branches_count} 标签 - {projectDetail && projectDetail.tags && projectDetail.tags.total_count} + {projectDetail && projectDetail.tags_count} diff --git a/src/forge/Main/CoderRootBranch.js b/src/forge/Main/CoderRootBranch.js new file mode 100644 index 00000000..4982414a --- /dev/null +++ b/src/forge/Main/CoderRootBranch.js @@ -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( + + + + ) + }else if(data && data.length === 0){ + return ( ) + } + } + const menu =(zip_url,tar_url)=> ( + + ZIP + TAR.GZ + + ) + + return( + +
+ +
+

分支列表

+
{list()}
+
+
+
+
+ ) +}) + + + diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js index 06d2fc44..96b14b17 100644 --- a/src/forge/Main/Detail.js +++ b/src/forge/Main/Detail.js @@ -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'; @@ -575,6 +576,18 @@ class Detail extends Component { } + {/*
+ { + 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 ? + 镜像自 {projectDetail.mirror_url} + :"" + } +
*/} { firstSync ? "" : a{ + display: block; + width: 399px; + + } a:hover{ span{ color: #466AFF!important; diff --git a/src/forge/Merge/CreateMerge.js b/src/forge/Merge/CreateMerge.js index c335d79f..d7a32009 100644 --- a/src/forge/Merge/CreateMerge.js +++ b/src/forge/Merge/CreateMerge.js @@ -150,7 +150,7 @@ class CreateMerge extends Component { }else{ if(pullOwner === mergeOwner){ if (!noMergeBranch) { - this.compareProject(result.data.id, branchParams); + this.compareProject(true, branchParams); } else { this.setState({ showMessage: true, @@ -172,53 +172,51 @@ class CreateMerge extends Component { }; // compare接口,获取分支对比信息 - compareProject = (baseid, branchParams) => { + compareProject = (sameProject, branchParams) => { // const { project } = this.props; // const { owner, projectsId } = this.props.match.params; - const projectObj = this.props.project; const { pullOwner, pullBranch, mergeOwner, mergeBranch, projectId } = branchParams; let url = `/${mergeOwner}/${projectId}/compare`; - if (projectObj) { - if (baseid === projectObj.id) { - 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, - }); - } + 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({ - comparesData: result.data, + showMessage: false, + }); + } else { + this.setState({ + showMessage: true, + defaultMessage: result.data.message, }); } this.setState({ - isFirstLoading: false, - isSpin: false, - isCompareSpin: false, + comparesData: result.data, }); - }) - .catch((error) => { - this.setState({ isSpin: false, isCompareSpin: false }); + } + this.setState({ + isFirstLoading: false, + isSpin: false, + isCompareSpin: false, }); - } + }) + .catch((error) => { + this.setState({ isSpin: false, isCompareSpin: false }); + }); }; // 根据所有者、仓库名,获取分支列表,目前仅涉及目标仓库分支查询 - getBranchList = ({ mergeOwner, projectId, mergeBranch }) => { + getBranchList = (branchParams) => { + const { mergeOwner, projectId, mergeBranch } = branchParams; this.setState({ isSpin: true }); const url = `/${mergeOwner}/${projectId}/pulls/get_branches.json`; axios @@ -234,6 +232,7 @@ class CreateMerge extends Component { defaultMessage: '目标分支不存在', isCompareSpin: false, }); + !noMergeBranch && this.compareProject(false, branchParams); } this.setState({ isSpin: false }); }) @@ -368,7 +367,9 @@ class CreateMerge extends Component { value={pull} onSelect={(e) => this.selectBrach('pull', e)} showSearch - className="merge-flex1 flex1" + className="merge-flex1 flex1 matchwidth" + dropdownMatchSelectWidth={false} + dropdownClassName="overlihide" > {this.renderBrances(pullBranches)} @@ -394,7 +395,9 @@ class CreateMerge extends Component { value={merge} onSelect={(e) => this.selectBrach('merge', e)} showSearch - className="merge-flex1 flex1" + className="merge-flex1 flex1 matchwidth" + dropdownMatchSelectWidth={false} + dropdownClassName="overlihide" > {this.renderBrances(mergeBranches)} diff --git a/src/forge/Merge/MergeItem.js b/src/forge/Merge/MergeItem.js index e16da7fe..a15aeefb 100644 --- a/src/forge/Merge/MergeItem.js +++ b/src/forge/Merge/MergeItem.js @@ -66,7 +66,7 @@ class MergeItem extends Component { {item.name} @@ -112,7 +112,7 @@ class MergeItem extends Component { {item.is_original ? item.fork_project_user @@ -136,7 +136,7 @@ class MergeItem extends Component { {/* {item.is_fork ? item.pull_request_base : `${item.author_name}:${item.pull_request_base}`} */} {project_author_name}:{item.pull_request_base} diff --git a/src/forge/Merge/MessageCount.js b/src/forge/Merge/MessageCount.js index 685f4235..6d01e8a3 100644 --- a/src/forge/Merge/MessageCount.js +++ b/src/forge/Merge/MessageCount.js @@ -340,11 +340,11 @@ class MessageCount extends Component {
-
-
+
+
- + {data.issue.subject} @@ -366,7 +366,7 @@ class MessageCount extends Component { {data.pull_request.is_original ? data.pull_request.fork_project_user : data.issue.project_author_name}: {data.pull_request && data.pull_request.head} @@ -381,7 +381,7 @@ class MessageCount extends Component { {data.issue.project_author_name}:{data.pull_request.base} @@ -445,8 +445,7 @@ class MessageCount extends Component {
-
-
+
{operate && (
-
{ data.issue.description ? diff --git a/src/forge/Merge/UpdateMerge.js b/src/forge/Merge/UpdateMerge.js index 001bedd5..8918db6e 100644 --- a/src/forge/Merge/UpdateMerge.js +++ b/src/forge/Merge/UpdateMerge.js @@ -64,12 +64,12 @@ class UpdateMerge extends Component {
源分支:
- {" "} {" "} @@ -83,12 +83,12 @@ class UpdateMerge extends Component {
目标分支 :
{" "} - {" "} {" "} diff --git a/src/forge/Merge/merge.css b/src/forge/Merge/merge.css index 3ea2620c..d61543b4 100644 --- a/src/forge/Merge/merge.css +++ b/src/forge/Merge/merge.css @@ -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%; @@ -213,4 +214,12 @@ form .ant-cascader-picker, form .ant-select { .mergeRequest .folders{ /* width: 72rem; */ width: 100%; - } \ No newline at end of file + } + + .matchwidth .ant-select-selection__rendered{ + width: 200px; + } + .overlihide li{ + max-width: 450px; + + } \ No newline at end of file diff --git a/src/forge/Merge/merge_form.js b/src/forge/Merge/merge_form.js index 4716bdfc..e6378139 100644 --- a/src/forge/Merge/merge_form.js +++ b/src/forge/Merge/merge_form.js @@ -265,7 +265,7 @@ class MergeForm extends Component { }, ], initialValue: title, - })()} + })()} - {data && data.subject} + {data && data.subject} {data && data.priority && ( diff --git a/src/forge/Order/order_form.js b/src/forge/Order/order_form.js index 0858ac52..3399a7fe 100644 --- a/src/forge/Order/order_form.js +++ b/src/forge/Order/order_form.js @@ -320,7 +320,7 @@ class order_form extends Component { message: "请填写易修标题", }, ] - })()} + })()}
  • 消息通知
  • -1 && pathname.indexOf("/settings/notice/config") == -1) || pathname.indexOf("/settings/notice/privateLetter")>-1 ?"active":""}>我的通知
  • - {/*
  • -1 ?"active":""}>通知管理
  • */} +
  • -1 ?"active":""}>通知管理
  • }
    • 安全设置
    • @@ -73,18 +73,24 @@ function Index(props){ - ( - - )} - > ( )} > + ( + + )} + > + ( + + )} + > ( @@ -103,12 +109,6 @@ function Index(props){ )} > - ( - - )} - > diff --git a/src/forge/SecuritySetting/notice/manager/Index.jsx b/src/forge/SecuritySetting/notice/manager/Index.jsx index ebe84bea..5ba82d60 100644 --- a/src/forge/SecuritySetting/notice/manager/Index.jsx +++ b/src/forge/SecuritySetting/notice/manager/Index.jsx @@ -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(
      @@ -12,87 +55,23 @@ function NoticeManager(props){
      您可以通过通知管理来选择接受通知的方式 -
      - 我创建或负责的 -
      -
      -
      易修状态变更
      - 站内信 - 邮件 -
      -
      -
      易修截止日期到达最后一天
      - 站内信 - 邮件 -
      -
      -
      合并请求状态变更
      - 站内信 - 邮件 -
      -
      -
      易修有新的评论
      - 站内信 - 邮件 -
      -
      -
      合并请求有新的评论
      - 站内信 - 邮件 -
      - -
      - 我管理的仓库 -
      -
      -
      被关注
      - 站内信 - 邮件 -
      -
      -
      被点赞
      - 站内信 - 邮件 -
      -
      -
      被复刻
      - 站内信 - 邮件 -
      -
      -
      有新的里程碑
      - 站内信 - 邮件 -
      - -
      - 我关注的仓库 -
      -
      -
      被删除
      - 站内信 - 邮件 -
      -
      -
      被转移
      - 站内信 - 邮件 -
      -
      -
      有新的易修
      - 站内信 - 邮件 -
      -
      -
      有新的合并请求
      - 站内信 - 邮件 -
      -
      -
      有新的版本发布
      - 站内信 - 邮件 -
      + {settingTypes && userNotification && userEmail && settingTypes.map((item,key)=>{ + return( + item.type_name &&
      +
      {item.type_name}
      + {item.settings.map((i, k) => { + const setting = item.type.substring(item.type.indexOf("::")+2)+"::"+i.key; + return ( +
      +
      {i.name}
      + {onChange(true,e,setting)}}>站内信 + {onChange(false,e,setting)}}>邮件 +
      + ) + })} +
      + ) + })}
    ) diff --git a/src/forge/users/Material/Base.jsx b/src/forge/users/Material/Base.jsx index f9707ab0..61a9d6f1 100644 --- a/src/forge/users/Material/Base.jsx +++ b/src/forge/users/Material/Base.jsx @@ -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){ diff --git a/src/modules/tpm/TPMIndexHOC.js b/src/modules/tpm/TPMIndexHOC.js index b9215568..c20e75b1 100644 --- a/src/modules/tpm/TPMIndexHOC.js +++ b/src/modules/tpm/TPMIndexHOC.js @@ -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 (
    +