data
This commit is contained in:
parent
57b43c6a1d
commit
1d88dc7369
|
|
@ -25,7 +25,7 @@ if (isDev) {
|
|||
}
|
||||
debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' :
|
||||
window.location.search.indexOf('debug=s') !== -1 ? 'student' :
|
||||
window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'admin'
|
||||
window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'student'
|
||||
}
|
||||
window._debugType = debugType;
|
||||
export function initAxiosInterceptors(props) {
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ function NewsDetail(props){
|
|||
<p className="i_name">{detail.name}</p>
|
||||
<ul className="i_ul_value">
|
||||
{ cmsDir && <li>{cmsDir.name}</li> }
|
||||
{ cmsDir && <li>发布于{cmsDir.createdAt}</li> }
|
||||
{ cmsDir && <li>发布于{detail.publishTime}</li> }
|
||||
{ detail.visits && <li><img src={liulan} alt="" className="mr5" />{detail.visits}</li> }
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ function CoderDepot(props){
|
|||
branchName = returnbar(branchName);
|
||||
const details = props.projectDetail;
|
||||
let pathname = props.history.location.pathname;
|
||||
const { platform } = props ;
|
||||
const { platform , mirror_status } = props ;
|
||||
//distribution:判断此用户是否可以创建发行版
|
||||
const distribution = details && details.type !== 2 && ( details.permission && details.permission !== "Reporter");
|
||||
const { bannerList } = props;
|
||||
|
|
@ -93,7 +93,7 @@ function CoderDepot(props){
|
|||
|
||||
|
||||
useEffect(()=>{
|
||||
if(details){
|
||||
if(details && mirror_status!==2){
|
||||
setProjectDetail(details);
|
||||
setTopics(details.topics);
|
||||
setDesc(details.description);
|
||||
|
|
@ -102,7 +102,7 @@ function CoderDepot(props){
|
|||
setDefaultBranch(details.default_branch);
|
||||
setInviteCode(details.invite_code);
|
||||
}
|
||||
},[details])
|
||||
},[details,mirror_status])
|
||||
|
||||
useEffect(()=>{
|
||||
// 设置网页标题
|
||||
|
|
@ -126,7 +126,7 @@ function CoderDepot(props){
|
|||
},[treeValue])
|
||||
|
||||
useEffect(()=>{
|
||||
if (projectsId && owner && defaultBranch){
|
||||
if (projectsId && owner && defaultBranch && mirror_status!==2){
|
||||
let b = turnbar(branchName) ;
|
||||
if(pathname.indexOf(`/${owner}/${projectsId}`) > -1 && pathname.indexOf(`/tree/${b}/`) > -1) {
|
||||
let url = pathname.split(`/tree/${b}/`)[1];
|
||||
|
|
@ -139,10 +139,10 @@ function CoderDepot(props){
|
|||
setType("dir");
|
||||
}
|
||||
}
|
||||
},[projectsId,owner,pathname,defaultBranch])
|
||||
},[projectsId,owner,pathname,defaultBranch,mirror_status])
|
||||
|
||||
useEffect(()=>{
|
||||
if(platform){
|
||||
if(platform && mirror_status!==2){
|
||||
setReadOnly(props.history.location.search.indexOf('edit') !== -1);
|
||||
axios.get(`/${owner}/${projectsId}/releases.json`).then((result)=>{
|
||||
if(result && result.data){
|
||||
|
|
@ -154,7 +154,7 @@ function CoderDepot(props){
|
|||
}
|
||||
})
|
||||
}
|
||||
},[platform])
|
||||
},[platform,mirror_status])
|
||||
|
||||
// 获取readme信息
|
||||
function getReadmeInfo(path, ref) {
|
||||
|
|
@ -390,10 +390,10 @@ function CoderDepot(props){
|
|||
const fileOperate = type === "dir" && projectDetail && projectDetail.type !== 2 && ((projectDetail.permission && projectDetail.permission !=="Reporter") || (current_user && current_user.admin));
|
||||
return(
|
||||
<WhiteBack>
|
||||
<UpdateDescModal desc={desc} website={website} lesson_url={lesson_url} topicsInfo={topics} visible={openModal} onCancel={()=>setOpenModal(false)} onOk={okUpdate}/>
|
||||
{mirror_status !== 2 && <UpdateDescModal desc={desc} website={website} lesson_url={lesson_url} topicsInfo={topics} visible={openModal} onCancel={()=>setOpenModal(false)} onOk={okUpdate} showNotification={props.showNotification}/> }
|
||||
<Spin spinning={isSpin}>
|
||||
{
|
||||
(dirInfo || fileInfo) &&
|
||||
((dirInfo || fileInfo) && mirror_status!==2 ) &&
|
||||
<React.Fragment>
|
||||
<DrawerPanel
|
||||
history={props.history}
|
||||
|
|
@ -421,7 +421,7 @@ function CoderDepot(props){
|
|||
<AlignCenter>
|
||||
<div className="mr30">
|
||||
{
|
||||
props && props.platform ?
|
||||
props && (props.platform && mirror_status !== 2) ?
|
||||
<SelectBranch
|
||||
repo_id={projectDetail && projectDetail.repo_id}
|
||||
projectsId={projectsId}
|
||||
|
|
@ -651,9 +651,9 @@ function CoderDepot(props){
|
|||
</React.Fragment>
|
||||
}
|
||||
{/* 贡献者 */}
|
||||
<Contributors owner={owner} projectsId={projectsId} />
|
||||
{mirror_status !==2 && <Contributors owner={owner} projectsId={projectsId} /> }
|
||||
{/* 语言 */}
|
||||
<LanguagePower owner={owner} projectsId={projectsId}/>
|
||||
{ mirror_status !== 2 && <LanguagePower owner={owner} projectsId={projectsId}/> }
|
||||
</Gap>
|
||||
</ShortWidth>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -192,12 +192,14 @@ class Detail extends Component {
|
|||
|
||||
// 非本平台项目
|
||||
platform: false,
|
||||
mirror_status:1
|
||||
mirror_status:2
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
componentDidMount = () => {
|
||||
const { mirror_status } = this.state
|
||||
this.props.showNotification("getProject getProject getProject",mirror_status);
|
||||
this.getProject();
|
||||
let history = this.props.location;
|
||||
this.clearIssueCookies(history);
|
||||
|
|
@ -262,14 +264,16 @@ class Detail extends Component {
|
|||
} else if (result.data.mirror_status === 2) {
|
||||
this.deleteProjectBack();
|
||||
this.setState({
|
||||
mirror_status:2
|
||||
mirror_status:2,
|
||||
firstSync: false
|
||||
})
|
||||
} else {
|
||||
this.getBanner();
|
||||
this.getDetail();
|
||||
this.setState({
|
||||
firstSync: false,
|
||||
secondSync: false
|
||||
secondSync: false,
|
||||
mirror_status:0
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
@ -860,7 +864,7 @@ class Detail extends Component {
|
|||
></Route>
|
||||
<Route path="/:owner/:projectsId"
|
||||
render={
|
||||
(props) => (mirror_status!==2 ? <CoderDepot {...this.props} {...props} {...this.state} {...common} /> :<Spin />)
|
||||
(props) => <CoderDepot {...this.props} {...props} {...this.state} {...common} mirror_status={mirror_status}/>
|
||||
}
|
||||
></Route>
|
||||
</Switch>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import "./sub.scss";
|
|||
import axios from 'axios';
|
||||
import { useState } from 'react';
|
||||
const { TextArea } = Input;
|
||||
function UpdateDescModal({form , visible , onCancel , onOk,desc,website,lesson_url, topicsInfo}){
|
||||
function UpdateDescModal({form , visible , onCancel , onOk,desc,website,lesson_url, topicsInfo,showNotification}){
|
||||
const { getFieldDecorator, validateFields , setFieldsValue } = form;
|
||||
const [topics, setTopics] = useState(undefined);
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,10 @@ class Index extends Component {
|
|||
licenseFlag:false,
|
||||
|
||||
// 区块链确权
|
||||
tokenConTri: false
|
||||
tokenConTri: false,
|
||||
|
||||
gitHubUrl:false,
|
||||
checkToken:undefined
|
||||
}
|
||||
}
|
||||
componentDidMount = () => {
|
||||
|
|
@ -203,7 +206,9 @@ class Index extends Component {
|
|||
isSpin: true
|
||||
})
|
||||
const { projectsType } = this.props.match.params;
|
||||
const { project_language_id, project_category_id, license_id, ignore_id, owners_id, ignoreFlag, licenseFlag, categoreFlag, languageFlag, tokenConTri} = this.state;
|
||||
const { project_language_id, project_category_id, license_id
|
||||
, ignore_id, owners_id, ignoreFlag, licenseFlag,
|
||||
categoreFlag, languageFlag, tokenConTri,gitHubUrl} = this.state;
|
||||
const decoderPass = Base64.encode(values.password);
|
||||
const url = (projectsType && projectsType === "mirror") ? "/projects/migrate.json" : "/projects.json";
|
||||
// 新建项目的时候,暂存数据,如果失败,返回的时候可以重新赋值
|
||||
|
|
@ -220,7 +225,8 @@ class Index extends Component {
|
|||
user_id:owners_id,
|
||||
blockchain: tokenConTri,
|
||||
blockchain_token_all: 10000,
|
||||
blockchain_init_token: parseInt(blockchain_init)
|
||||
blockchain_init_token: parseInt(blockchain_init),
|
||||
auth_token:gitHubUrl ? values.auth_token : undefined
|
||||
}).then((result) => {
|
||||
if (result && result.data.id) {
|
||||
projectsType && projectsType !== "mirror" && this.props.showNotification(`项目创建成功!`);
|
||||
|
|
@ -235,6 +241,7 @@ class Index extends Component {
|
|||
})
|
||||
})
|
||||
} else {
|
||||
window.scrollTo(0,0);
|
||||
this.setState({
|
||||
isSpin: false
|
||||
})
|
||||
|
|
@ -301,6 +308,9 @@ class Index extends Component {
|
|||
repository_name:first
|
||||
})
|
||||
}
|
||||
this.setState({gitHubUrl:value.indexOf("https://github.com")>-1 ? true : false})
|
||||
}else{
|
||||
this.setState({gitHubUrl:false,checkToken:undefined})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -344,6 +354,29 @@ class Index extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
blurFunc=(e)=>{
|
||||
let value = e.target.value;
|
||||
if(value){
|
||||
const { clone_addr } = this.props.form.getFieldsValue();
|
||||
if(clone_addr){
|
||||
const u = `/projects/verify_auth_token.json`;
|
||||
axios.post(u,{
|
||||
auth_token:value,
|
||||
clone_addr
|
||||
}).then(response=>{
|
||||
if(response && response.data){
|
||||
this.setState({
|
||||
checkToken:response.data.data
|
||||
})
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}
|
||||
}else{
|
||||
this.setState({checkToken:undefined})
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const { getFieldDecorator } = this.props.form;
|
||||
// 项目类型:deposit-托管项目,mirror-镜像项目
|
||||
|
|
@ -372,7 +405,9 @@ class Index extends Component {
|
|||
licenseFlag,
|
||||
languageFlag,
|
||||
categoreFlag,
|
||||
tokenConTri
|
||||
tokenConTri,
|
||||
gitHubUrl,
|
||||
checkToken
|
||||
} = this.state;
|
||||
return (
|
||||
<div className="main back-white" style={{padding:"0px",border:"none"}}>
|
||||
|
|
@ -381,7 +416,6 @@ class Index extends Component {
|
|||
<Spin spinning={isSpin}>
|
||||
<Form>
|
||||
<div className="newPanel_content">
|
||||
|
||||
{
|
||||
projectsType && projectsType === "mirror" &&
|
||||
<React.Fragment>
|
||||
|
|
@ -398,7 +432,7 @@ class Index extends Component {
|
|||
<Input placeholder="请输入需要导入到本项目的仓库地址" onBlur={this.ChangeAddr} />
|
||||
)}
|
||||
</Form.Item>
|
||||
<p className="formTip color-orange">示例:https://github.com/Stability-AI/StableStudio.git</p>
|
||||
<p className="formTip" style={{color:"#D1d1c9"}}>示例:https://github.com/Stability-AI/StableStudio.git</p>
|
||||
</React.Fragment>
|
||||
}
|
||||
{
|
||||
|
|
@ -406,10 +440,32 @@ class Index extends Component {
|
|||
<div className="pb10">
|
||||
<p className="mt10 mb10 color-grey-3 pointer" onClick={this.changeMirrorCheck}>
|
||||
需要授权验证<i className={mirrorCheck ? "iconfont icon-xiajiantou font-13 ml10 color-grey-8":"iconfont icon-youjiantou font-13 ml10 color-grey-8"}></i>
|
||||
<span className="ml20 font-12 color-red">如果导入项目为私有仓库,则必须填写相应平台正确的用户名和密码</span>
|
||||
<span className="ml20 font-12" style={{color:"#D1d1c9"}}>
|
||||
如果导入项目为私有仓库,{gitHubUrl ? `则需输入目标平台用户token进行授权,`:"则必须填写相应平台正确的用户名和密码"}
|
||||
{gitHubUrl && <a href="https://forum.gitlink.org.cn/forums/8516/detail" className="color-blue" target="_blank">如何获取token?</a>}
|
||||
</span>
|
||||
</p>
|
||||
{
|
||||
mirrorCheck &&
|
||||
mirrorCheck && gitHubUrl &&
|
||||
<div className="df mb10 token_box">
|
||||
<span className="mr10">Token</span>
|
||||
<input type="password" style={{display:"none"}} />
|
||||
<Form.Item
|
||||
style={{ marginBottom: "0px" }}
|
||||
label=""
|
||||
>
|
||||
{getFieldDecorator('auth_token')(
|
||||
<Input placeholder="请输入对应平台的有效token" style={{width:"240px"}} onBlur={this.blurFunc} />
|
||||
)}
|
||||
</Form.Item>
|
||||
<span style={{marginLeft:"-20px"}}>
|
||||
{ checkToken === false && <i className="iconfont icon-cuo color-red"></i>}
|
||||
{ checkToken === true && <i className="iconfont icon-dui color-green"></i>}
|
||||
</span>
|
||||
</div>
|
||||
}
|
||||
{
|
||||
mirrorCheck && !gitHubUrl &&
|
||||
<div className="df mb10" style={{alignItems:'center'}}>
|
||||
<span className="mr10">用户名</span>
|
||||
<input type="password" style={{display:"none"}} />
|
||||
|
|
@ -447,19 +503,26 @@ class Index extends Component {
|
|||
{getFieldDecorator('user_id', {
|
||||
rules: [{
|
||||
required: true, message: '请选择拥有者'
|
||||
},{
|
||||
validator:(rule, value, callback) => this.checkId(rule, value, callback, OwnerList, '拥有者')
|
||||
}],
|
||||
})(
|
||||
<AutoComplete
|
||||
style={{width:"260px",height:"35px"}}
|
||||
<Select
|
||||
showSearch
|
||||
style={{width:"260px",height:"33px"}}
|
||||
placeholder="请选择拥有者"
|
||||
onChange={(value, e) => this.ChangePlatform(value, e, 'owners', OwnerList)}
|
||||
className="plateAutoComplete"
|
||||
onBlur={(value) => this.blurCategory(value, OwnerList, "owners")}
|
||||
optionFilterProp="children"
|
||||
filterOption={(input, option) =>
|
||||
option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
||||
}
|
||||
>
|
||||
{owners_list}
|
||||
</AutoComplete>
|
||||
{OwnerList && OwnerList.length > 0 &&
|
||||
OwnerList.map((i,k)=>{
|
||||
return(
|
||||
<Option value={i.id}>{i.name}</Option>
|
||||
)
|
||||
})
|
||||
}
|
||||
</Select>
|
||||
)}
|
||||
</Form.Item>
|
||||
<span className="ml10 mr10 mt10 font-18">/</span>
|
||||
|
|
@ -681,4 +744,6 @@ class Index extends Component {
|
|||
}
|
||||
}
|
||||
const WrappedIndexForm = Form.create({ name: 'NewWorkForm' })(Index);
|
||||
export default WrappedIndexForm;
|
||||
export default WrappedIndexForm;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,12 @@
|
|||
font-size: 1.6em;
|
||||
border-bottom: 1px solid #f0f0f0
|
||||
}
|
||||
.token_box{
|
||||
align-items: center;
|
||||
}
|
||||
.token_box .ant-form-explain{
|
||||
position: absolute;
|
||||
}
|
||||
.newPanel_content{
|
||||
padding:2rem;
|
||||
}
|
||||
|
|
@ -25,7 +31,7 @@
|
|||
min-width: 280px;
|
||||
}
|
||||
.newPanel_content .ant-select-selection{
|
||||
height: 37px;
|
||||
height: 35px;
|
||||
}
|
||||
.newPanel_content .ant-select-selection__rendered,.newPanel_content input{
|
||||
height: 35px;
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@ class m_editor extends Component {
|
|||
|
||||
render() {
|
||||
const { editorValue, changeValue } = this.state;
|
||||
console.log("editorValue:",editorValue)
|
||||
const { readOnly, editorType,onEmpty,filename,empty, currentBranch, descName, checkName, detail, match: { params },filepath,ideTheme } = this.props;
|
||||
const editor_options = {
|
||||
lineNumbers: "on",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import React , { useState , useEffect } from 'react';
|
||||
import React from 'react';
|
||||
import { AlignCenter } from '../../Component/layout';
|
||||
import Modals from '../../Component/PublicModal/Index';
|
||||
import { Button } from 'antd';
|
||||
|
|
@ -12,14 +12,14 @@ function DeleteBox({visible , onCancel,onSuccess,pr_need}){
|
|||
btn={
|
||||
<div>
|
||||
<Button size={'large'} onClick={onCancel}>取消</Button>
|
||||
<Button type={"danger"} size={"large"} onClick={onSuccess}>确认删除</Button>
|
||||
<Button type={"danger"} size={"large"} onClick={onSuccess}>确定</Button>
|
||||
</div>
|
||||
}
|
||||
>
|
||||
<div className="desc">
|
||||
<AlignCenter className="descMain">
|
||||
<i className="iconfont icon-jinggao1 mr10 font-20 red"></i>确定解除协议吗?</AlignCenter>
|
||||
{ pr_need && <p>您解除协议后,后续提交的合并请求对项目成员将不再可见(已存在的不会受影响)</p> }
|
||||
{ pr_need && <p>您解除协议后,提交的合并请求对项目成员将不再可见(已存在的开启的合并请求也将被隐藏)</p> }
|
||||
</div>
|
||||
</Modals>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import React,{useEffect,useState} from 'react';
|
||||
import './index.scss';
|
||||
import logo from '../img/cla-logo.png';
|
||||
import logo from '../img/icon.svg';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { Button , Spin } from 'antd';
|
||||
import Nodata from '../../Nodata';
|
||||
|
|
@ -14,6 +14,9 @@ function Index(props){
|
|||
const [ visible , setVisible ] = useState(false);
|
||||
const [ cancelKey , setCancelKey ] = useState(undefined);
|
||||
const [ pr_need , setPr_need ] = useState(true);
|
||||
useEffect(()=>{
|
||||
document.title = "我的CLA";
|
||||
},[])
|
||||
|
||||
useEffect(()=>{
|
||||
if(current_user && current_user.user_id){
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
|
@ -0,0 +1,13 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="65.368" height="70.129" viewBox="0 0 65.368 70.129">
|
||||
<g id="icon" transform="translate(-680.606 -410)">
|
||||
<path id="路径_3391" data-name="路径 3391" d="M190.644,100.032H130.724A2.724,2.724,0,0,0,128,102.756v64.682a2.724,2.724,0,0,0,2.724,2.724h59.921a2.724,2.724,0,0,0,2.724-2.724V102.756A2.724,2.724,0,0,0,190.644,100.032Z" transform="translate(552.606 309.968)" fill="#e6e6e6"/>
|
||||
<rect id="矩形_367" data-name="矩形 367" width="49" height="53" transform="translate(689 419)" fill="#fff"/>
|
||||
<g id="协议" transform="translate(687.555 417.455)">
|
||||
<path id="路径_3391-2" data-name="路径 3391" d="M177.325,100.032H130.145A2.145,2.145,0,0,0,128,102.177v50.93a2.145,2.145,0,0,0,2.145,2.145h47.181a2.145,2.145,0,0,0,2.145-2.145v-50.93A2.145,2.145,0,0,0,177.325,100.032Zm1.187,1.058v53.25H129.125V101.09Z" transform="translate(-128 -100.032)" fill="#aeb4bb"/>
|
||||
<path id="路径_3392" data-name="路径 3392" d="M308.3,544v4.289H288V544Zm-11.6,8.578v4.289H288v-4.289Z" transform="translate(-280.604 -510.521)" fill="#c4c7cc"/>
|
||||
<text id="CLA" transform="translate(25.444 22.609)" fill="#5f6872" stroke="rgba(0,0,0,0)" stroke-width="1" font-size="17" font-family="STFangsong"><tspan x="-16.023" y="0">CLA</tspan></text>
|
||||
</g>
|
||||
<path id="icon_徽章" d="M204.579,70.459a6.149,6.149,0,1,0-10.543,4.3,6.22,6.22,0,0,0,.855.729v5a.194.194,0,0,0,.278.174l3.246-1.569,3.246,1.569a.194.194,0,0,0,.278-.174V75.509a6.212,6.212,0,0,0,.837-.7A6.108,6.108,0,0,0,204.579,70.459Zm-11.071,0a4.922,4.922,0,1,1,4.922,4.922A4.928,4.928,0,0,1,193.507,70.459Zm7.206,8.384-2.213-1.07a.194.194,0,0,0-.168,0l-2.213,1.07V76.16a6.19,6.19,0,0,0,4.6.011v2.672Z" transform="translate(526.76 384.613)" fill="#009b28"/>
|
||||
<circle id="椭圆_67" data-name="椭圆 67" cx="3" cy="3" r="3" transform="translate(722 452)" fill="rgba(0,155,40,0.31)"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
|
|
@ -45,7 +45,7 @@ export default Form.create()(
|
|||
}
|
||||
const url = `/organizations.json`;
|
||||
axios.post(url,{
|
||||
...values,image
|
||||
...values,image,visibility:"common"
|
||||
}).then(result=>{
|
||||
if(result && result.data){
|
||||
showNotification("组织创建成功!");
|
||||
|
|
@ -121,7 +121,7 @@ export default Form.create()(
|
|||
[],
|
||||
<Input placeholder="请输入地址" maxLength={50}/>,false
|
||||
)}
|
||||
{helper(
|
||||
{/* {helper(
|
||||
'可见性',
|
||||
"visibility",
|
||||
[{ required: true, message: "请选择可见性" }],
|
||||
|
|
@ -130,7 +130,7 @@ export default Form.create()(
|
|||
<Radio style={radioStyle} value="limited" key={2}>受限<span className="color-grey-8">(仅对登录用户可见)</span></Radio>
|
||||
<Radio style={radioStyle} value="privacy" key={3}>私有<span className="color-grey-8">(仅对组织成员可见)</span></Radio>
|
||||
</Radio.Group>
|
||||
)}
|
||||
)} */}
|
||||
|
||||
<p className="font-16 lables must">选择头像</p>
|
||||
<UploadImage getImage={getImage}/>
|
||||
|
|
|
|||
|
|
@ -27,6 +27,10 @@ const ListName = styled.div`{
|
|||
margin-bottom:8px;
|
||||
height:18px;
|
||||
line-height:18px;
|
||||
width:210px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}`;
|
||||
const ColorListName = styled.div`{
|
||||
color:rgba(31, 35, 41, 1);
|
||||
|
|
@ -34,6 +38,10 @@ const ColorListName = styled.div`{
|
|||
margin-bottom:8px;
|
||||
height:18px;
|
||||
line-height:18px;
|
||||
width:230px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}`
|
||||
const Img = styled.img`{
|
||||
border-radius:50%;
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ export default Form.create()(
|
|||
if(!error){
|
||||
const url = `/organizations/${organizeDetail.id}.json`;
|
||||
axios.patch(url,{
|
||||
...values,image:imageFlag ? image : undefined
|
||||
...values,image:imageFlag ? image : undefined,visibility:"common"
|
||||
}).then(result=>{
|
||||
if(result && result.data){
|
||||
showNotification("组织信息更新成功!");
|
||||
|
|
@ -172,7 +172,7 @@ export default Form.create()(
|
|||
[],
|
||||
<Input placeholder="请输入城市"/>
|
||||
)}
|
||||
{helper(
|
||||
{/* {helper(
|
||||
'可见性:',
|
||||
"visibility",
|
||||
[],
|
||||
|
|
@ -181,7 +181,7 @@ export default Form.create()(
|
|||
<Radio value="limited" style={radioStyle}>受限<span>(仅对登录用户可见)</span></Radio>
|
||||
<Radio value="privacy" style={radioStyle}>私有<span>(仅对组织成员可见)</span></Radio>
|
||||
</Radio.Group>
|
||||
)}
|
||||
)} */}
|
||||
{helper(
|
||||
'权限:',
|
||||
"repo_admin_change_team_access",
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ export default (( props )=>{
|
|||
const pathname = props.location.pathname;
|
||||
const OIdentifier = props.match.params.OIdentifier;
|
||||
const {organizeDetail} = props;
|
||||
console.log(organizeDetail);
|
||||
useEffect(()=>{
|
||||
if(organizeDetail){
|
||||
const {nickname} = organizeDetail;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import React,{ forwardRef, useState , useEffect } from 'react';
|
||||
import '../teamSetting.scss';
|
||||
import RenderHtml from '../../../../components/render-html';
|
||||
import { Button , Form , Input} from 'antd';
|
||||
import Cla from '../../images/cla.png';
|
||||
import { Button , Form , Input , Spin } from 'antd';
|
||||
import { getImageUrl } from 'educoder';
|
||||
import axios from 'axios';
|
||||
|
||||
|
||||
function CLAinfos(props){
|
||||
const { form , current_user } = props;
|
||||
const { form , current_user , showLoginDialog } = props;
|
||||
const { getFieldDecorator , validateFields , setFieldsValue , getFieldsValue} = form;
|
||||
|
||||
const OIdentifier = props.match.params.OIdentifier;
|
||||
|
|
@ -15,9 +15,17 @@ function CLAinfos(props){
|
|||
|
||||
const [ details, setDetails ] = useState(undefined);
|
||||
|
||||
useEffect(()=>{
|
||||
if(current_user && current_user.email){
|
||||
setFieldsValue({
|
||||
email:current_user.email
|
||||
})
|
||||
}
|
||||
},[current_user,details])
|
||||
|
||||
useEffect(()=>{
|
||||
if(current_user &&!current_user.login){
|
||||
props.history.push(`/login`);
|
||||
props.history.push(`/login?go_page=/${OIdentifier}/cla/${claid}`);
|
||||
}
|
||||
},[current_user])
|
||||
|
||||
|
|
@ -32,6 +40,7 @@ function CLAinfos(props){
|
|||
axios.get(url).then(response=>{
|
||||
if(response && response.data){
|
||||
setDetails(response.data);
|
||||
document.title = `${response.data.name}`;
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}
|
||||
|
|
@ -42,10 +51,12 @@ function CLAinfos(props){
|
|||
const url = `/users/${current_user && current_user.user_id}/clas.json`;
|
||||
axios.post(url,{
|
||||
...values,
|
||||
cla_id:details && details.id
|
||||
cla_id:details && details.id,
|
||||
email:(current_user && current_user.email) || values.email
|
||||
}).then(response=>{
|
||||
if(response && response.data){
|
||||
props.showNotification('协议签署成功!');
|
||||
window.scrollTo(0,0);
|
||||
getDetails();
|
||||
}
|
||||
}).catch(error=>{})
|
||||
|
|
@ -54,11 +65,11 @@ function CLAinfos(props){
|
|||
}
|
||||
|
||||
return(
|
||||
details &&
|
||||
details ?
|
||||
<div className="cla_allinfos">
|
||||
<div className="cla_infos_header">
|
||||
<div>
|
||||
<img src={Cla} alt="" />
|
||||
<img src={getImageUrl(details.organization && details.organization.avatar_url)} alt="" />
|
||||
<div className="cla_i">
|
||||
<p className="cla_i_name">{details.name}</p>
|
||||
<p className="cla_o_name">{details.organization && details.organization.nickname}</p>
|
||||
|
|
@ -87,7 +98,7 @@ function CLAinfos(props){
|
|||
{getFieldDecorator("email",{
|
||||
rules:[{ required: true, message: "请输入签署邮箱" }]
|
||||
})(
|
||||
<Input placeholder="请输入签署邮箱" maxLength={30}/>
|
||||
<Input placeholder="请输入签署邮箱" maxLength={30} disabled={current_user && current_user.email}/>
|
||||
)}
|
||||
</Form.Item>
|
||||
</div>
|
||||
|
|
@ -96,6 +107,8 @@ function CLAinfos(props){
|
|||
}
|
||||
</div>
|
||||
</div>
|
||||
:
|
||||
<div style={{display:'flex',alignItems:'center',justifyContent:"center",minHeight:"500px"}}><Spin /></div>
|
||||
)
|
||||
}
|
||||
export default Form.create()(forwardRef(CLAinfos))
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import React,{ useState , useEffect } from 'react';
|
||||
import Title from '../../../Component/Title';
|
||||
import defaultimg from '../../images/cla-icon-big.png';
|
||||
import Logo from '../../images/cla-logo.png';
|
||||
import Logo from '../../images/icon.svg';
|
||||
import { Button, Spin } from 'antd';
|
||||
import axios from 'axios';
|
||||
|
||||
|
|
@ -40,7 +40,7 @@ function TeamSettingCLA(props){
|
|||
<p className="task-hide cla_name">{list.name}</p>
|
||||
<span className="cla_personCount">签署人数<span>{list.count || 0}</span></span>
|
||||
<div className="cla_btn">
|
||||
<Button onClick={()=>{props.history.push(`/${OIdentifier}/cla/${list.key}`)}} style={{color:"#466aff",borderColor:"#466aff"}}>查看协议</Button>
|
||||
<Button href={`/${OIdentifier}/cla/${list.key}`} target="_blank" style={{color:"#466aff",borderColor:"#466aff"}}>查看协议</Button>
|
||||
<Button onClick={()=>{props.history.push(`/${OIdentifier}/setting/agreement/${list.key}`)}} style={{color:"#466aff",borderColor:"#466aff"}} className="ml22">编辑</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ forwardRef((props)=>{
|
|||
function checkKeyReg(rule, value, callback){
|
||||
let reg = /^[a-zA-Z0-9][a-zA-Z0-9_]*[a-zA-Z0-9]+$/g
|
||||
if(value && !reg.test(value)){
|
||||
callback("协议标识只能以数字、字母开头结尾,可包含下划线");
|
||||
callback("协议标识长度2-30,只能以数字、字母开头结尾,可包含下划线");
|
||||
}
|
||||
callback();
|
||||
}
|
||||
|
|
@ -103,7 +103,7 @@ forwardRef((props)=>{
|
|||
{ validator: checkKeyReg }
|
||||
]
|
||||
})(
|
||||
<Input addonBefore={keyBefore} autoComplete={"off"} placeholder="请输入协议标识" maxLength={30}/>
|
||||
<Input addonBefore={keyBefore} autoComplete={"off"} placeholder="请输入协议标识" minLength={2} maxLength={30}/>
|
||||
)}
|
||||
</Form.Item>
|
||||
<Form.Item label="协议内容">
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@
|
|||
margin:0px auto;
|
||||
width: 1200px;
|
||||
&>img{
|
||||
width: 116px;
|
||||
height: 94px;
|
||||
margin-right: 32px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import { setSeoMeta } from "educoder";
|
|||
import Cards from '../../Component/Cards';
|
||||
import axios from 'axios';
|
||||
import '../Index.scss';
|
||||
|
||||
const GroupDetails = Loadable({
|
||||
loader: () => import("../Group/GroupDetails"),
|
||||
loading: Loading,
|
||||
|
|
@ -40,6 +39,9 @@ function Detail(props){
|
|||
if(pathname){
|
||||
if(pathname.indexOf(`/${OIdentifier}/setting`)>-1){
|
||||
setFlag(false);
|
||||
if(detail && !detail.is_admin ){
|
||||
props.history.push("/nopage");
|
||||
}
|
||||
}else{
|
||||
setFlag(true);
|
||||
}
|
||||
|
|
@ -49,7 +51,7 @@ function Detail(props){
|
|||
setButtonflagFlag(false);
|
||||
}
|
||||
}
|
||||
},[pathname])
|
||||
},[pathname,detail])
|
||||
|
||||
useEffect(()=>{
|
||||
if(OIdentifier){
|
||||
|
|
@ -134,12 +136,14 @@ function Detail(props){
|
|||
return <Group {...props} {...p} organizeDetail={detail}/>
|
||||
}}
|
||||
></Route>
|
||||
<Route
|
||||
path="/:OIdentifier/setting"
|
||||
render={(p) => {
|
||||
return <Setting {...props} {...p} organizeDetail={detail} updateFunc={updateDetail}/>
|
||||
}}
|
||||
></Route>
|
||||
|
||||
<Route
|
||||
path="/:OIdentifier/setting"
|
||||
render={(p) => {
|
||||
return <Setting {...props} {...p} organizeDetail={detail} updateFunc={updateDetail}/>
|
||||
}}
|
||||
></Route>
|
||||
|
||||
<Route
|
||||
path="/:OIdentifier"
|
||||
render={(p) => {
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
|
@ -0,0 +1,13 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="65.368" height="70.129" viewBox="0 0 65.368 70.129">
|
||||
<g id="icon" transform="translate(-680.606 -410)">
|
||||
<path id="路径_3391" data-name="路径 3391" d="M190.644,100.032H130.724A2.724,2.724,0,0,0,128,102.756v64.682a2.724,2.724,0,0,0,2.724,2.724h59.921a2.724,2.724,0,0,0,2.724-2.724V102.756A2.724,2.724,0,0,0,190.644,100.032Z" transform="translate(552.606 309.968)" fill="#e6e6e6"/>
|
||||
<rect id="矩形_367" data-name="矩形 367" width="49" height="53" transform="translate(689 419)" fill="#fff"/>
|
||||
<g id="协议" transform="translate(687.555 417.455)">
|
||||
<path id="路径_3391-2" data-name="路径 3391" d="M177.325,100.032H130.145A2.145,2.145,0,0,0,128,102.177v50.93a2.145,2.145,0,0,0,2.145,2.145h47.181a2.145,2.145,0,0,0,2.145-2.145v-50.93A2.145,2.145,0,0,0,177.325,100.032Zm1.187,1.058v53.25H129.125V101.09Z" transform="translate(-128 -100.032)" fill="#aeb4bb"/>
|
||||
<path id="路径_3392" data-name="路径 3392" d="M308.3,544v4.289H288V544Zm-11.6,8.578v4.289H288v-4.289Z" transform="translate(-280.604 -510.521)" fill="#c4c7cc"/>
|
||||
<text id="CLA" transform="translate(25.444 22.609)" fill="#5f6872" stroke="rgba(0,0,0,0)" stroke-width="1" font-size="17" font-family="STFangsong"><tspan x="-16.023" y="0">CLA</tspan></text>
|
||||
</g>
|
||||
<path id="icon_徽章" d="M204.579,70.459a6.149,6.149,0,1,0-10.543,4.3,6.22,6.22,0,0,0,.855.729v5a.194.194,0,0,0,.278.174l3.246-1.569,3.246,1.569a.194.194,0,0,0,.278-.174V75.509a6.212,6.212,0,0,0,.837-.7A6.108,6.108,0,0,0,204.579,70.459Zm-11.071,0a4.922,4.922,0,1,1,4.922,4.922A4.928,4.928,0,0,1,193.507,70.459Zm7.206,8.384-2.213-1.07a.194.194,0,0,0-.168,0l-2.213,1.07V76.16a6.19,6.19,0,0,0,4.6.011v2.672Z" transform="translate(526.76 384.613)" fill="#009b28"/>
|
||||
<circle id="椭圆_67" data-name="椭圆 67" cx="3" cy="3" r="3" transform="translate(722 452)" fill="rgba(0,155,40,0.31)"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
Loading…
Reference in New Issue