Merge branch 'develop' of http://git.trustie.net/jasder/forgeplus-react into develop

This commit is contained in:
dinglink 2020-03-27 10:04:31 +08:00
commit f651e7d80c
24 changed files with 482 additions and 205 deletions

6
.gitignore vendored
View File

@ -12,6 +12,11 @@ pids
*.seed
*.pid.lock
# Ignore master key for decrypting credentials and more.
/config/master.key
/config/database.yml
/.idea/*
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
@ -80,3 +85,4 @@ typings/
.dynamodb/
.DS_Store
.idea/*

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with NO BOM" />
</project>

View File

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="RUBY_MODULE" version="4">
<component name="ModuleRunConfigurationManager">
<shared />
</component>
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@ -1,6 +0,0 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
</profile>
</component>

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="JSX" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="ruby-2.3.7-p456" project-jdk-type="RUBY_SDK" />
</project>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/forgeplus-react.iml" filepath="$PROJECT_DIR$/.idea/forgeplus-react.iml" />
</modules>
</component>
</project>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View File

@ -3,8 +3,7 @@
<component name="ChangeListManager">
<list default="true" id="9830c5da-176a-4c72-a301-9f6ce98c82fe" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/forge/Merge/MergeSubmit.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/forge/Merge/MergeSubmit.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/forge/Merge/MessageCount.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/forge/Merge/MessageCount.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/forge/Settings/Collaborator.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/forge/Settings/Collaborator.js" afterDir="false" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
@ -14,25 +13,69 @@
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/forge/Merge/MergeSubmit.js">
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/.gitignore">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="222">
<caret line="175" column="212" lean-forward="true" selection-start-line="175" selection-start-column="212" selection-end-line="175" selection-end-column="212" />
<state relative-caret-position="1275">
<caret line="75" column="14" selection-start-line="75" selection-start-column="14" selection-end-line="75" selection-end-column="14" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/forge/Settings/Setting.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1360">
<caret line="80" column="27" selection-start-line="80" selection-start-column="27" selection-end-line="80" selection-end-column="27" />
<folding>
<element signature="e#0#40#0" expanded="true" />
<element signature="e#0#42#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/forge/Merge/MessageCount.js">
<entry file="file://$PROJECT_DIR$/src/forge/Newfile/Index.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="32">
<caret line="428" column="11" selection-start-line="428" selection-start-column="11" selection-end-line="428" selection-end-column="238" />
<state relative-caret-position="884">
<caret line="52" column="31" selection-start-line="52" selection-start-column="31" selection-end-line="52" selection-end-column="31" />
<folding>
<element signature="e#0#40#0" expanded="true" />
<element signature="e#0#42#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/forge/Settings/Collaborator.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="455">
<caret line="144" column="11" lean-forward="true" selection-start-line="144" selection-start-column="11" selection-end-line="144" selection-end-column="11" />
<folding>
<element signature="e#0#42#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/forge/Newfile/UserSubmitComponent.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="272">
<caret line="16" column="25" selection-start-line="16" selection-start-column="25" selection-end-line="16" selection-end-column="25" />
<folding>
<element signature="e#0#38#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/forge/Settings/Index.js">
<provider selected="true" editor-type-id="text-editor">
<state>
<folding>
<element signature="e#0#42#0" expanded="true" />
</folding>
</state>
</provider>
@ -58,11 +101,17 @@
<find>textcount</find>
<find>forks</find>
<find>commentCtx</find>
<find>上传文件</find>
<find>subFileType</find>
<find>.ide</find>
<find>.idea</find>
<find>deleteUser</find>
<find>axios.delete</find>
</findStrings>
<dirStrings>
<dir>$PROJECT_DIR$/src/forge</dir>
<dir>$PROJECT_DIR$/src</dir>
<dir>$PROJECT_DIR$</dir>
<dir>$PROJECT_DIR$/src</dir>
</dirStrings>
</component>
<component name="Git.Settings">
@ -81,13 +130,18 @@
<option value="$PROJECT_DIR$/src/forge/Merge/merge.js" />
<option value="$PROJECT_DIR$/src/modules/tpm/NewHeader.js" />
<option value="$PROJECT_DIR$/src/forge/Order/New.js" />
<option value="$PROJECT_DIR$/src/forge/Main/Detail.js" />
<option value="$PROJECT_DIR$/src/forge/Order/Detail.js" />
<option value="$PROJECT_DIR$/src/forge/Order/UpdateDetail.js" />
<option value="$PROJECT_DIR$/src/forge/Order/CopyDetail.js" />
<option value="$PROJECT_DIR$/src/forge/Merge/NewMerge.js" />
<option value="$PROJECT_DIR$/src/forge/Merge/MessageCount.js" />
<option value="$PROJECT_DIR$/src/forge/Merge/MergeSubmit.js" />
<option value="$PROJECT_DIR$/src/forge/Main/Detail.js" />
<option value="$PROJECT_DIR$/src/forge/Main/CoderRootDirectory.js" />
<option value="$PROJECT_DIR$/src/forge/Settings/Setting.js" />
<option value="$PROJECT_DIR$/.gitignore" />
<option value="$PROJECT_DIR$/src/forge/Newfile/UserSubmitComponent.js" />
<option value="$PROJECT_DIR$/src/forge/Settings/Collaborator.js" />
</list>
</option>
</component>
@ -107,11 +161,6 @@
<item name="forgeplus-react" type="b2602c69:ProjectViewProjectNode" />
<item name="forgeplus-react" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="forgeplus-react" type="b2602c69:ProjectViewProjectNode" />
<item name="forgeplus-react" type="462c0819:PsiDirectoryNode" />
<item name="build" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="forgeplus-react" type="b2602c69:ProjectViewProjectNode" />
<item name="forgeplus-react" type="462c0819:PsiDirectoryNode" />
@ -128,7 +177,7 @@
<item name="forgeplus-react" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="forge" type="462c0819:PsiDirectoryNode" />
<item name="Merge" type="462c0819:PsiDirectoryNode" />
<item name="Settings" type="462c0819:PsiDirectoryNode" />
</path>
</expand>
<select />
@ -146,6 +195,13 @@
<property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
<property name="nodejs_npm_path_reset_for_default_project" value="true" />
</component>
<component name="RubyModuleManagerSettings">
<option name="blackListedRootsPaths">
<list>
<option value="$PROJECT_DIR$" />
</list>
</option>
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
@ -170,18 +226,23 @@
<option name="presentableId" value="Default" />
<updated>1584692398144</updated>
<workItem from="1584692401543" duration="6228000" />
<workItem from="1585015135223" duration="17366000" />
<workItem from="1585015135223" duration="21118000" />
<workItem from="1585194891947" duration="1630000" />
<workItem from="1585210651078" duration="1600000" />
<workItem from="1585217705353" duration="104000" />
<workItem from="1585217834609" duration="4000" />
<workItem from="1585217980103" duration="418000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="23594000" />
<option name="totallyTimeSpent" value="32053000" />
</component>
<component name="ToolWindowManager">
<frame x="0" y="0" width="1440" height="900" extended-state="0" />
<editor active="true" />
<layout>
<window_info content_ui="combo" id="Project" order="0" weight="0.2532189" />
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.26752505" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info id="Favorites" order="2" side_tool="true" />
<window_info anchor="bottom" id="Message" order="0" />
@ -193,8 +254,8 @@
<window_info anchor="bottom" id="TODO" order="6" />
<window_info anchor="bottom" id="Docker" order="7" show_stripe_button="false" />
<window_info anchor="bottom" id="Database Changes" order="8" />
<window_info anchor="bottom" id="Version Control" order="9" weight="0.47228914" />
<window_info active="true" anchor="bottom" id="Terminal" order="10" visible="true" weight="0.17228916" />
<window_info anchor="bottom" id="Version Control" order="9" weight="0.24096386" />
<window_info active="true" anchor="bottom" id="Terminal" order="10" visible="true" weight="0.23493975" />
<window_info anchor="bottom" id="Event Log" order="11" side_tool="true" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
@ -255,16 +316,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/forge/Order/order.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="221">
<caret line="23" column="19" selection-start-line="23" selection-start-column="19" selection-end-line="23" selection-end-column="19" />
<folding>
<element signature="e#0#42#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/forge/Main/CoderRootIndex.js">
<provider selected="true" editor-type-id="text-editor">
<state>
@ -293,13 +344,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/forge/Main/CoderRootFileDetail.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="277">
<caret line="64" column="45" selection-start-line="64" selection-start-column="45" selection-end-line="64" selection-end-column="45" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/forge/Main/IndexItem.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="209">
@ -349,16 +393,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/forge/Order/OrderItem.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="323">
<caret line="19" column="25" selection-start-line="19" selection-start-column="25" selection-end-line="19" selection-end-column="25" />
<folding>
<element signature="e#0#42#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/forge/quillForEditor/index.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="125">
@ -453,23 +487,12 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/forge/Main/Detail.js">
<entry file="file://$PROJECT_DIR$/src/forge/Merge/MergeSubmit.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="260">
<caret line="495" column="3" lean-forward="true" selection-start-line="495" selection-start-column="3" selection-end-line="495" selection-end-column="3" />
<folding>
<element signature="e#0#42#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/forge/Order/Detail.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="300">
<caret line="327" lean-forward="true" selection-start-line="327" selection-end-line="327" />
<state relative-caret-position="255">
<caret line="176" column="43" selection-start-line="176" selection-start-column="43" selection-end-line="176" selection-end-column="43" />
<folding>
<element signature="e#0#40#0" expanded="true" />
<element signature="e#15286#16091#0" />
</folding>
</state>
</provider>
@ -484,15 +507,141 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/forge/Merge/MergeSubmit.js">
<entry file="file://$PROJECT_DIR$/src/forge/Order/Detail.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="222">
<caret line="175" column="212" lean-forward="true" selection-start-line="175" selection-start-column="212" selection-end-line="175" selection-end-column="212" />
<state relative-caret-position="2872">
<caret line="327" lean-forward="true" selection-start-line="327" selection-end-line="327" />
<folding>
<element signature="e#0#40#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/forge/Order/OrderItem.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="323">
<caret line="19" column="25" selection-start-line="19" selection-start-column="25" selection-end-line="19" selection-end-column="25" />
<folding>
<element signature="e#0#42#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/forge/Main/DetailTop.js">
<provider selected="true" editor-type-id="text-editor">
<state>
<folding>
<element signature="e#0#42#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/forge/Main/Index.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-3990">
<folding>
<element signature="e#0#42#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/forge/Order/order.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-5010">
<caret line="23" column="19" selection-start-line="23" selection-start-column="19" selection-end-line="23" selection-end-column="19" />
<folding>
<element signature="e#0#42#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/forge/Main/CoderRootFileDetail.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1049">
<caret line="64" column="45" selection-start-line="64" selection-start-column="45" selection-end-line="64" selection-end-column="45" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/forge/Main/Detail.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="4777">
<caret line="303" column="11" selection-start-line="303" selection-start-column="11" selection-end-line="303" selection-end-column="11" />
<folding>
<element signature="e#0#42#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/forge/Main/CoderRootDirectory.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="326">
<caret line="305" column="20" selection-start-line="305" selection-start-column="20" selection-end-line="305" selection-end-column="20" />
<folding>
<element signature="e#0#42#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/.idea/workspace.xml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-9766" />
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/.gitignore">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1275">
<caret line="75" column="14" selection-start-line="75" selection-start-column="14" selection-end-line="75" selection-end-column="14" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/forge/Settings/Setting.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1360">
<caret line="80" column="27" selection-start-line="80" selection-start-column="27" selection-end-line="80" selection-end-column="27" />
<folding>
<element signature="e#0#42#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/forge/Newfile/Index.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="884">
<caret line="52" column="31" selection-start-line="52" selection-start-column="31" selection-end-line="52" selection-end-column="31" />
<folding>
<element signature="e#0#42#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/forge/Newfile/UserSubmitComponent.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="272">
<caret line="16" column="25" selection-start-line="16" selection-start-column="25" selection-end-line="16" selection-end-column="25" />
<folding>
<element signature="e#0#38#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/forge/Settings/Index.js">
<provider selected="true" editor-type-id="text-editor">
<state>
<folding>
<element signature="e#0#42#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/forge/Settings/Collaborator.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="455">
<caret line="144" column="11" lean-forward="true" selection-start-line="144" selection-start-column="11" selection-end-line="144" selection-end-column="11" />
<folding>
<element signature="e#0#42#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</component>
</project>

View File

@ -1,5 +1,5 @@
import React , { Component } from 'react';
import { Dropdown , Icon } from 'antd';
import { Dropdown , Icon , Tooltip } from 'antd';
import "./branch.css";
class CloneAddress extends Component{
@ -8,7 +8,7 @@ class CloneAddress extends Component{
var e = document.getElementById("copy_rep_content");
e.select();
document.execCommand("Copy");
this.props.showNotification('复制成功');
// this.props.showNotification('复制成功');
}
render(){
@ -18,7 +18,9 @@ class CloneAddress extends Component{
<span className={"addressType active"} onClick={()=>this.changeAddress("http")}>HTTP</span>
{/* <span className={address ==="ssh" ? "addressType active":"addressType"} onClick={()=>this.changeAddress("ssh")}>SSH</span> */}
<input type="text" id="copy_rep_content" value={ http_url }/>
<span onClick={()=>this.jsCopy()}><i className="iconfont icon-fuzhi"></i></span>
<Tooltip title="复制链接">
<span onClick={()=>this.jsCopy()}><i className="iconfont icon-fuzhi"></i></span>
</Tooltip>
<span>
<Dropdown overlay={downloadUrl} trigger={['click']} placement="bottomRight">
<a className="ant-dropdown-link">

View File

@ -3,9 +3,13 @@
border-radius: 4px;
display: flex;
justify-content: center;
padding:0px 10px;
height: 35px;
line-height: 35px;
width: 150px;
}
.branchDropdown .ant-dropdown-trigger{
width: 100%;
text-align: center;
}
.branchOptions{
width: 200px;
@ -16,7 +20,7 @@
max-height: 200px;
}
.OptionsUl{
max-height: 100px;
max-height: 200px;
overflow-y: auto;
}
.OptionsUl li{

View File

@ -36,7 +36,6 @@ class CoderRootDirectory extends Component{
branchList:undefined,
fileDetail:undefined,
branchLastCommit:undefined,
current_user:undefined,
rootData:undefined
}
@ -293,10 +292,10 @@ class CoderRootDirectory extends Component{
</div>
<div className="f-wrap-alignCenter">
{
subFileType !== "file" && isManager && isDeveloper &&
<p className="addFile">
subFileType !== "file" && (isManager || isDeveloper) &&
<p className="addFile mr30">
<Link to={`/projects/${projectsId}/coders/${branch}/newfile${urlRoot}`} >新建文件</Link>
<Link to={``}>上传文件</Link>
{/* <Link to={``}>上传文件</Link> */}
</p>
}
{

View File

@ -1,5 +1,14 @@
import React , { Component } from "react";
import Editor from "react-monaco-editor";
// import Editor from "react-monaco-editor";
import {UnControlled as CodeMirror} from 'react-codemirror2';
import 'codemirror/mode/cmake/cmake';
import 'codemirror/mode/sql/sql';
import 'codemirror/mode/xml/xml';
import 'codemirror/mode/clike/clike';
import 'codemirror/mode/javascript/javascript';
import 'codemirror/addon/hint/show-hint.css';
import 'codemirror/addon/hint/show-hint.js';
import { Popconfirm, Result } from 'antd';
@ -42,16 +51,16 @@ class CoderRootFileDetail extends Component{
}
// 编辑文件
changeContent=(e)=>{
changeMmirror=(e,e1,value)=>{
this.setState({
value:e
value
})
}
deleteFile=()=>{
const { author , branch , detail }= this.props;
const { branch , detail }= this.props;
const { projectsId } = this.props.match.params;
const authorLogin = this.props.match.params.author;
const url = `/repositories/${projectsId}/delete_file.json`;
axios.delete(url,{
@ -97,30 +106,35 @@ class CoderRootFileDetail extends Component{
}
render(){
const { detail } = this.props;
const { detail , current_user , isManager , isReporter , isDeveloper } = this.props;
const { readOnly ,value } = this.state;
let flag = current_user && current_user.login && (isManager || isReporter);
return(
<div>
<div className="branchTable">
<p className="branchTitle f-wrap-alignCenter f-wrap-between">
<span>{bytesToSize(detail && detail.size)}</span>
<span>
{
readOnly ?
<a onClick={this.EditFile} className="ml20"><i className="iconfont icon-bianji font-15 color-grey-6"></i></a>
:
<React.Fragment>
<button type="button" className="ant-btn ant-btn-sm mr10" onClick={this.CancelEdit}><span> </span>
</button>
<button type="button" className="ant-btn ant-btn-primary ant-btn-sm" onClick={this.UpdateFile}><span> </span>
</button>
</React.Fragment>
}
flag &&
<span>
{
readOnly ?
<a onClick={this.EditFile} className="ml20"><i className="iconfont icon-bianji font-15 color-grey-6"></i></a>
:
<React.Fragment>
<button type="button" className="ant-btn ant-btn-sm mr10" onClick={this.CancelEdit}><span> </span>
</button>
<button type="button" className="ant-btn ant-btn-primary ant-btn-sm" onClick={this.UpdateFile}><span> </span>
</button>
</React.Fragment>
}
<Popconfirm title="确认删除这个文件?" className="ml20" okText="确定" cancelText="取消" onConfirm={this.deleteFile}>
<a><i className="iconfont icon-shanchu font-15 color-grey-6"></i></a>
</Popconfirm>
</span>
<Popconfirm title="确认删除这个文件?" className="ml20" okText="确定" cancelText="取消" onConfirm={this.deleteFile}>
<a><i className="iconfont icon-shanchu font-15 color-grey-6"></i></a>
</Popconfirm>
</span>
}
</p>
</div>
<div className="content-file">
@ -130,13 +144,30 @@ class CoderRootFileDetail extends Component{
<a href={detail.download_url} className="color-blue font-15">下载原始文件</a>
</div>
:
<Editor
height="300px"
theme={"vs-dark"}
<CodeMirror
value={value}
onChange={this.changeContent}
readOnly={readOnly}
options={{
// mode: 'xml',
theme: 'default',
lineNumbers: true,
// extraKeys: {"Ctrl-Q": "autocomplete"}, // 快捷键
indentUnit: 4, //代码缩进为一个tab的距离
matchBrackets: true,
autoRefresh: true,
smartIndent: true,//智能换行
styleActiveLine: true,
lint: true,
readOnly: readOnly?"nocursor":false
}}
onChange={this.changeMmirror}
/>
// <Editor
// height="300px"
// theme={"vs-dark"}
// value={value}
// onChange={this.changeContent}
// readOnly={readOnly}
// />
}
</div>
</div>

View File

@ -291,12 +291,11 @@ class Detail extends Component{
render(){
const { projectDetail , watchers_count , praises_count , forked_count , isSpin } = this.state;
const { projectDetail , watchers_count , praises_count , forked_count , isSpin , isManager } = this.state;
const url = this.props.history.location.pathname;
const urlArr= url.split("/");
const urlFlag = (urlArr.length === 3);
const { isManager } = this.props;
const { projectsId } = this.props.match.params;
const { state } = this.props.history.location;

View File

@ -368,8 +368,8 @@ body,#root{
}
/* 分支 */
.branchTable{
border:1px solid #f4f4f4;
background-color: #f4f4f4;
border:1px solid #f7f7f7;
background-color: #f7f7f7;
border-radius: 4px;
margin-top:20px;
}
@ -442,10 +442,10 @@ body,#root{
padding: 0px 10px;
}
.addFile a:first-child{
border-radius: 4px 0px 0px 4px;
border-radius: 4px;
}
.addFile a:last-child{
border-radius: 0px 4px 4px 0px;
/* border-radius: 0px 4px 4px 0px; */
border-left: 1px solid rgba(247, 247, 247, 0.3);
}
.addFile a:active{
@ -559,4 +559,10 @@ body,#root{
border: 1px solid #2185d0;
}
.content-file{margin-top: 8px;}
.content-file .CodeMirror{
background-color: #f7f7f7;
border: 1px solid #e4e4e4;
border-radius: 4px;
}
.text-center{text-align: center;}

View File

@ -5,15 +5,20 @@ import axios from 'axios';
import Nav from '../Order/Nav';
import UploadComponent from '../Upload/Index';
import { getImageUrl } from 'educoder';
import {Modal, Col, Form, Input, Tooltip, Popconfirm, Pagination , Spin,Dropdown,Icon,Menu} from 'antd'
import NoneData from '../../modules/courses/coursesPublic/NoneData';
import {Modal, Form, Input, Tooltip, Popconfirm, Pagination , Spin,Dropdown,Icon,Menu} from 'antd'
import Attachments from '../Upload/attachment'
import './merge.css';
import QuillForEditor from '../quillForEditor';
const TextArea = Input.TextArea;
const options = [
['bold', 'italic', 'underline'],
[{header: [1,2,3,false]}],
['blockquote', 'code-block'],
['link', 'image'],
['formula']
];
class MessageCount extends Component{
constructor(props){
super(props);
@ -39,7 +44,9 @@ class MessageCount extends Component{
mergename:'合并请求',
mergekey:'merge',
title:'',
body:''
body:'',
commentsContent:undefined,
quillFlag:false
}
}
@ -81,12 +88,19 @@ class MessageCount extends Component{
//添加评论
addjournals=()=>{
const { data, page, limit, fileList , commentsContent } = this.state;
if(!commentsContent){
this.setState({
quillFlag:true
})
return;
}
this.props.form.validateFieldsAndScroll((err, values) => {
if(!err){
const { data, page, limit, fileList } = this.state;
const url = `/issues/${data.issue.id}/journals.json`;
axios.post(url,{
...values,
content:JSON.stringify(commentsContent),
issue_id:data.id,
attachment_ids:fileList
}).then(result=>{
@ -96,7 +110,9 @@ class MessageCount extends Component{
attachments_ids: undefined
});
this.setState({
showFiles: false
showFiles: false,
quillFlag:false,
commentsContent:undefined
})
this.getjournalslist(page, limit);
this.props.showNotification("评论成功!");
@ -160,7 +176,7 @@ class MessageCount extends Component{
project_id:projectsId,
id:data.pull_request.id,
do:mergekey,
body:body,
body:JSON.stringify(body),
title:title,
}).then(result=>{
if(result){
@ -173,14 +189,14 @@ class MessageCount extends Component{
//修改评论
updatedetail=(id)=>{
console.log("updtedetail", this.state)
// console.log("updtedetail", this.state)
const {page, limit,data } = this.state;
const {orderId} = this.props.match.params;
const url = `/issues/${data.issue.id}/journals/${id}.json`;
axios.put(url,{
issue_id:orderId,
id:id,
content:this.state.countvalue
content:JSON.stringify(this.state.countvalue)
}).then(result=>{
if(result){
this.setState({
@ -217,9 +233,9 @@ class MessageCount extends Component{
})
}
changmodelname=(e)=>{
changmodelname=(value)=>{
this.setState({
countvalue:e.target.value
countvalue:value
})
}
changtitlepr=(e)=>{
@ -228,9 +244,9 @@ class MessageCount extends Component{
})
}
changbodypr=(e)=>{
changbodypr=(value)=>{
this.setState({
body:e.target.value
body:value
})
}
editdetail=(count,status)=>{
@ -314,9 +330,48 @@ class MessageCount extends Component{
})
}
changeComments=(value)=>{
this.setState({
commentsContent:value
})
if(value){
this.setState({
quillFlag:false
})
}
}
stringJson=(value) =>{
let _value = null;
try {
_value = JSON.parse(value);
} catch (e) {
_value = value;
}
return _value
}
commentCtx = (ctx) => {
let _ctx = null;
try {
_ctx = JSON.parse(ctx);
} catch (e) {
_ctx = ctx;
}
return (
<QuillForEditor
readOnly={true}
value={_ctx}
showUploadImage={this.handleShowImage}
/>
)
};
render(){
const { projectsId,mergeId } = this.props.match.params;
const { data,journalsdata, page, limit, search_count, isSpin, isedit, showFiles } = this.state;
const { data,journalsdata, page, limit, search_count, isSpin, isedit, showFiles , commentsContent , quillFlag } = this.state;
const { getFieldDecorator } = this.props.form;
const { current_user } = this.props;
const url = this.props.history.location.pathname;
@ -370,7 +425,7 @@ class MessageCount extends Component{
<div style={{display: (isedit && isedit === item.id) ? "none" : "block"}} >
{
item.content ?
<div>{item.content}</div>
this.commentCtx(item.content)
:
<div>
{this.renderJournalList(item.journal_details)}
@ -384,7 +439,20 @@ class MessageCount extends Component{
}
</div>
<div style={{display: (isedit && isedit === item.id) ? "block" : "none"}}>
<TextArea style={{height:"200px"}} value={this.state.countvalue} onChange={this.changmodelname}/>
<QuillForEditor
value = {this.stringJson(this.state.countvalue)}
wrapStyle={{
height: '220px',
opacity:1,
marginTop:"20px"
}}
// autoFocus={true}
style={{ height: '170px' }}
placeholder="评论内容"
options={options}
onContentChange={this.changmodelname}
/>
{/* <TextArea style={{height:"200px"}} value={this.state.countvalue} onChange={this.changmodelname}/> */}
<p className="clearfix mt15">
<a className="topWrapper_btn fr" type="submit" onClick={()=>this.updatedetail(item.id)}>保存</a>
<a className="a_btn cancel_btn fr" type="submit" onClick={()=>this.editdetail(item.content,undefined)}>取消</a>
@ -462,7 +530,7 @@ class MessageCount extends Component{
{ Paginations }
<div className="df" style={{display:this.state.data&&this.state.data.pull_request.status===1?'none':'flex'}}>
<Link to={``}><img className="user_img" src={getImageUrl(`images/${current_user && current_user.image_url}`)} alt=""/></Link>
<img className="user_img" src={getImageUrl(`images/${current_user && current_user.image_url}`)} alt=""/>
<div className="new_context" >
<p>该合并请求可以进行自动合并操作</p>
<p style={{marginTop:15,display:this.state.mergekey==='rebase'?this.state.buttonshow==='none'?"block":"none":this.state.ismesrge==='none'?"block":"none"}}>
@ -476,8 +544,22 @@ class MessageCount extends Component{
</p>
<div style={{display:this.state.ismesrge,marginTop:15}}>
<Input placeholder="合并请求标题" value={this.state.title} onChange={this.changtitlepr}/>
<TextArea placeholder="合并请求描述..." style={{height:"300px",marginTop:15}} value={this.state.body} onChange={this.changbodypr} />
<Input placeholder="标题" value={this.state.title} onChange={this.changtitlepr}/>
<div className="quillContent" style={{marginTop:"20px"}}>
<QuillForEditor
value = {this.state.body}
wrapStyle={{
height: '220px',
opacity:1,
}}
// autoFocus={true}
style={{ height: '170px' }}
placeholder="评论内容..."
options={options}
onContentChange={this.changbodypr}
/>
</div>
{/* <TextArea placeholder="请输入合并描述..." style={{height:"300px",marginTop:15}} value={this.state.body} onChange={this.changbodypr} /> */}
</div>
<p className="clearfix mt15" style={{display:this.state.buttonshow}}>
<a className="topWrapper_btn " type="submit" onClick={()=>this.prmerge()}>合并请求</a>
@ -488,10 +570,9 @@ class MessageCount extends Component{
</div>
<div className="order_line" style={{marginLeft:80}}></div>
<div className="df">
<Link to={``}><img className="user_img"
src={getImageUrl(`images/${current_user && current_user.image_url}`)} alt=""/></Link>
<img className="user_img" src={getImageUrl(`images/${current_user && current_user.image_url}`)} alt=""/>
<div className="new_context">
<Form.Item>
{/* <Form.Item>
{getFieldDecorator('content', {
rules: [{
required: true, message: '请输入内容'
@ -499,7 +580,24 @@ class MessageCount extends Component{
})(
<TextArea placeholder="添加评论..." style={{height: "200px"}}/>
)}
</Form.Item>
</Form.Item> */}
<div className="quillContent">
<QuillForEditor
value = {commentsContent}
wrapStyle={{
height: '240px',
opacity:1,
}}
// autoFocus={true}
style={{ height: '170px' }}
placeholder="请输入合并描述..."
options={options}
onContentChange={this.changeComments}
/>
<p className="quillFlag">
{ quillFlag && <span className="">请输入评论内容</span>}
</p>
</div>
<UploadComponent load={this.UploadFunc} isComplete={showFiles}></UploadComponent>
<p className="clearfix mt15">
<a className="topWrapper_btn fr" type="submit" onClick={this.addjournals}>评论</a>

View File

@ -1,17 +1,23 @@
import React , {Component} from 'react';
import { Link } from 'react-router-dom';
import {Radio, Form,Menu,Dropdown,Input,Select,Table} from 'antd';
import NoneData from '../../modules/courses/coursesPublic/NoneData';
import reactCSS from 'reactcss'
import axios from 'axios';
import moment from 'moment'
import UploadComponent from '../Upload/Index';
import { getImageUrl } from 'educoder';
import '../Order/order.css';
import QuillForEditor from '../quillForEditor';
const { Group, Button } = Radio;
const { Button } = Radio;
const Option = Select.Option;
const TextArea = Input.TextArea;
const options = [
['bold', 'italic', 'underline'],
[{header: [1,2,3,false]}],
['blockquote', 'code-block'],
['link', 'image'],
['formula']
];
class NewMerge extends Component{
constructor(props){
super(props);
@ -21,6 +27,7 @@ class NewMerge extends Component{
merge:undefined,
pull:undefined,
//判断 是否显示创建合并请求的页面
desc:undefined,
iscreatemerge:'none',
issue_tag_ids:"",
fixed_version_id:"",
@ -147,9 +154,10 @@ class NewMerge extends Component{
}else{
values.issue_tag_ids = []
}
const { desc } = this.state;
axios.post(url,{
...values,
body:JSON.stringify(desc),
project_id:projectsId,
head:this.state.merge,
base:this.state.pull,
@ -220,12 +228,18 @@ class NewMerge extends Component{
}
onContentChange=(value)=>{
this.setState({
desc:value
})
}
render(){
const { getFieldDecorator } = this.props.form;
const { projectsId } = this.props.match.params;
const { current_user } = this.props;
const { issue_tag_ids , fixed_version_id ,assigned_to_id ,issue_chosen,data,titledata} = this.state;
const { issue_tag_ids , fixed_version_id ,assigned_to_id ,issue_chosen,data,titledata , desc } = this.state;
const columns=[{
@ -317,7 +331,7 @@ class NewMerge extends Component{
<Form>
<div className="f-wrap-between mt20" style={{alignItems:"flex-start"}}>
<div className="list-right df">
<Link to={``}><img class="user_img" src={getImageUrl(`images/${current_user && current_user.image_url}`)} alt=""/></Link>
<img class="user_img" src={getImageUrl(`images/${current_user && current_user.image_url}`)} alt=""/>
<div className="new_context">
<Form.Item>
{getFieldDecorator('title', {
@ -328,13 +342,25 @@ class NewMerge extends Component{
<Input placeholder="标题"/>
)}
</Form.Item>
<Form.Item>
<QuillForEditor
value = {desc}
wrapStyle={{
height: '220px',
opacity:1,
}}
// autoFocus={true}
style={{ height: '170px' }}
placeholder="合并请求的描述..."
options={options}
onContentChange={this.onContentChange}
/>
{/* <Form.Item>
{getFieldDecorator('body', {
rules: [],
})(
<TextArea placeholder="合并请求的描述。。。" style={{height:"300px"}}/>
)}
</Form.Item>
</Form.Item> */}
<UploadComponent load={this.UploadFunc} isComplete={true} ></UploadComponent>
<p className="clearfix mt15">
<a className="topWrapper_btn fr" type="submit" onClick={this.submit}>创建合并请求</a>

View File

@ -11,6 +11,9 @@
border-radius:4px;
margin-left: 15px;
}
.new_context{
flex:1;
}
.topmerge_btn{
background: #21ba45;
color: #FFFFFF!important;

View File

@ -22,16 +22,16 @@ class UserSubmitComponent extends Component{
// 提交变更
subMitFrom=()=>{
const { current_user , filepath , content } = this.props;
const { filepath , content } = this.props;
const { branch , projectsId } = this.props.match.params;
const { submitType } = this.state;
let path = filepath.substr(1);
this.props.form.validateFieldsAndScroll((err, values) => {
if(!err){
const url = `/${current_user && current_user.login}/${projectsId}/contents.json`;
const url = `/repositories/${projectsId}/create_file.json`;
axios.post(url,{
filepath:path,
branch:submitType==="0" ? branch : undefined,
branch:branch,
new_branch:submitType==="1" ? values.branchname:undefined,
content,
message:values.desc
@ -84,7 +84,7 @@ class UserSubmitComponent extends Component{
{getFieldDecorator('desc', {
rules: [],
})(
<TextArea placeholder={`添加一个可扩展的描述`} authSize={{minRows:3,maxRows:5}}/>
<TextArea placeholder={`请输入合并请求的描述`} authSize={{minRows:3,maxRows:5}}/>
)}
</Form.Item>
<Radio.Group value={submitType} onChange={this.changeSubmittype}>

View File

@ -6,7 +6,6 @@ import { getImageUrl } from 'educoder';
import Nav from './Nav';
import UploadComponent from '../Upload/Index';
import QuillForEditor from '../quillForEditor';
import { QuillDeltaToHtmlConverter } from 'quill-delta-to-html'
import './order.css';
@ -164,7 +163,7 @@ class New extends Component{
<QuillForEditor
value = {description}
wrapStyle={{
height: '220px',
height: '240px',
opacity:1,
}}
// autoFocus={true}

View File

@ -9,10 +9,10 @@ const MENU_LIST = [{
name:'管理员'
},{
id:"Developer",
name:'开发人员'
name:'可写权限'
},{
id:"Reporter",
name:'报告人员'
name:'可读权限'
}];
const LIMIT = 15;
class Collaborator extends Component{
@ -140,8 +140,9 @@ class Collaborator extends Component{
onOk:()=>{
const { project_id } = this.props;
const url = `/projects/${project_id}/members/remove.json`;
axios.delete(url,{
user_id:id
axios.delete(url,{ data: {
user_id:id
}
}).then(result=>{
if(result){
this.setState({
@ -207,7 +208,7 @@ class Collaborator extends Component{
<span>{operation && operation[0].name}<Icon type="down" /></span>
</Dropdown>
}
</span>
<span style={{justifyContent:"center"}}>
{
@ -219,7 +220,7 @@ class Collaborator extends Component{
)
})
}
</div>
</Spin>
@ -245,4 +246,4 @@ class Collaborator extends Component{
)
}
}
export default Collaborator;
export default Collaborator;

View File

@ -22,7 +22,6 @@ const Collaborator = Loadable({
class Index extends Component{
render(){
const { projectsId } = this.props.match.params;
console.log(this.props);
const { pathname } = this.props.history.location;
const flag = (pathname === `/projects/${projectsId}/setting`);
@ -36,7 +35,7 @@ class Index extends Component{
<div className="main">
<Switch {...this.props}>
{/* 协作者 */}
<Route path="/projects/:projectsId/collaborator"
<Route path="/projects/:projectsId/setting/collaborator"
render={
(props) => (<Collaborator {...this.props} {...props} {...this.state}/>)
}

View File

@ -32,7 +32,6 @@ class Setting extends Component{
}
getInfo=()=>{
const { current_user } = this.props;
const { projectsId } = this.props.match.params;
const url = `/repositories/${projectsId}/edit.json`;
axios.get(url).then(result=>{
@ -200,7 +199,7 @@ class Setting extends Component{
<div className="flex-a-center padding15-10">
<div>
<p className="font-bd font-16">删除本仓库</p>
<p className="mt10">删除仓库是永久性的, 无法撤消</p>
<p className="mt10">删除仓库是永久性的, 无法撤消且删除后与仓库关联的项目/工单/合并请求/版本发布等均会被删除</p>
</div>
<a onClick={this.deleteProject} className="red_deleteBtn">删除本仓库</a>
</div>

View File

@ -17,7 +17,6 @@ import Quill from 'quill';
import katex from 'katex';
import deepEqual from './deepEqual.js'
import { fetchUploadImage } from '../../services/ojService.js';
import { getImageUrl } from 'educoder'
import ImageBlot from './ImageBlot';
import FillBlot from './FillBlot';
import LinkBlot from './link-blot'

View File

@ -469,7 +469,7 @@ class LoginDialog extends Component {
autologin:isGoingValue
}
).then((response) => {
debugger;
// debugger;
if(response===undefined){
return
}
@ -782,4 +782,3 @@ class LoginDialog extends Component {
}
export default LoginDialog ;