From b9b7e68a0e5aca58dbc75560144d16c1eb275a90 Mon Sep 17 00:00:00 2001 From: harry Date: Tue, 10 Mar 2020 19:54:21 +0800 Subject: [PATCH] remove material-ui --- .../react/src/modules/comment/CommentInput.js | 33 +------- public/react/src/modules/comment/Comments.js | 69 +--------------- .../react/src/modules/common/RewardDialog.js | 49 +++--------- public/react/src/modules/login/LoginDialog.js | 10 +-- public/react/src/modules/modals/Modals.js | 79 +++++++++---------- .../modules/page/main/CodeRepositoryView.js | 32 ++------ 6 files changed, 61 insertions(+), 211 deletions(-) diff --git a/public/react/src/modules/comment/CommentInput.js b/public/react/src/modules/comment/CommentInput.js index fbd0c5766..13e5a2d53 100644 --- a/public/react/src/modules/comment/CommentInput.js +++ b/public/react/src/modules/comment/CommentInput.js @@ -1,21 +1,16 @@ -import React, { Component } from 'react'; +import React, { Component } from 'react' -import Tooltip from '@material-ui/core/Tooltip'; +import { Tooltip } from 'antd' import './Comment.css' -const $ = window.$; +const $ = window.$ function pasteListener(event) { if (event.clipboardData.types[0] === 'Files') { event.preventDefault(); } } -/* -*/ class CommentInput extends Component { - componentDidMount() { - } - componentWillReceiveProps(newProps, newContext) { // TODO 暂没有切实训的场景 if (newProps.challenge && newProps.challenge.shixun_id @@ -89,26 +84,4 @@ class CommentInput extends Component { } } -/* - - - - - - {tread_count} - - -
- -

- - 上传图片 - - 评论 - 20 - - -

-
-*/ export default CommentInput; \ No newline at end of file diff --git a/public/react/src/modules/comment/Comments.js b/public/react/src/modules/comment/Comments.js index 5cc88f177..8b5dbb952 100644 --- a/public/react/src/modules/comment/Comments.js +++ b/public/react/src/modules/comment/Comments.js @@ -8,8 +8,7 @@ import DialogContentText from '@material-ui/core/DialogContentText'; import DialogTitle from '@material-ui/core/DialogTitle'; import Button from '@material-ui/core/Button'; -import Tooltip from '@material-ui/core/Tooltip'; - +import { Tooltip } from 'antd' import { getImageUrl } from 'educoder'; import CommentItemKEEditor from './CommentItemKEEditor'; @@ -134,9 +133,6 @@ class Comments extends Component { } else { $(reply_message_el).show(); } - // $(reply_message_el).html(""); - - // $(reply_iconup_el).hide(); } } else { // MD this.setState({ @@ -144,11 +140,6 @@ class Comments extends Component { showReplyEditorFlag: !this.state.showReplyEditorFlag }) } - } - // enableReplyTo - // onClick={() => this.replyTo(item.user_id)} - replyTo = (toUserId) => { - } renderChildenComments(comment) { if (!comment.children || comment.children.length === 0) { @@ -209,29 +200,9 @@ class Comments extends Component { : ''} - {/* - | - - - - 赞 - - - - */}

- {/* currentUser.id == item.creator_user.id && ( -

- - - 删除 - - | - -

- )*/}
@@ -320,28 +291,11 @@ class Comments extends Component { }
- {/* currentUser.id == item.creator_user.id && ( -

- - - 删除 - - | - -

- )*/}
- {/* 改成后端返回了的,都是要显示的,不管hidden的值是true还是false */} - - {/* { item.hidden && ((this.props.onlySuperAdminCouldHide && !item.isSuperAdmin) - || !this.props.onlySuperAdminCouldHide && item.admin === false && (item.manager === false || item.manager == undefined)) - ?

违规评论已被屏蔽!

- : */}
- {/* } */}
@@ -356,12 +310,10 @@ class Comments extends Component { : ''} - {/*mr10 */}

- {/* && !item.reward */} {this.props.showRewardButton != false && item.admin === true ? this.showGoldRewardDialog(item)}> @@ -425,7 +377,6 @@ class Comments extends Component { > } - {/*

*/} @@ -433,15 +384,6 @@ class Comments extends Component { ) }) - /* - /users/reply_to?reply_id=${item.id}&type=Challenge&user_activity_id=118 - */ - /* - onclick="delete_confirm_box_2('<%= discuss_path(comment, :challenge_id => @game_challenge) %>', '确定要删除该条回复吗?')" - delete按钮 - id=`delete_reply_<%=@game_challenge.id %>_<%=comment.id %>` - - */ return commentsElement; } @@ -504,8 +446,6 @@ class Comments extends Component { const { deleteComment, onPaginationChange, comment_count_without_reply, currentPage, comments, usingAntdModal } = this.props; const { dialogOpen, goldRewardDialogOpen, dialogType, goldRewardInputError } = this.state; - const goldRewardInputErrorObj = goldRewardInputError ? { 'error': 'error' } : {} - return (
@@ -560,13 +500,6 @@ class Comments extends Component { this.onGoldRewardInputChange(e)} width={228} style={{ width: '228px' }} /> - {/* - 请输入奖励的金币数量 - this.onGoldRewardInputChange(e)} /> - { goldRewardInputError ? 奖励金币不能为空或负数 : ''} - */} - - {/* */} - - - + this.onGoldRewardInputChange(e)} width={228} style={{ width: '228px' }} /> + ); } } diff --git a/public/react/src/modules/login/LoginDialog.js b/public/react/src/modules/login/LoginDialog.js index d853b45a9..19c65e13b 100644 --- a/public/react/src/modules/login/LoginDialog.js +++ b/public/react/src/modules/login/LoginDialog.js @@ -2,9 +2,8 @@ import React, { Component } from 'react'; import { notification } from 'antd'; import axios from 'axios'; -import { Dialog } - from '@material-ui/core'; import './LoginDialog.css'; +import { Modal } from 'antd' import { broadcastChannelPostMessage } from 'educoder' import Notcompletedysl from "../user/Notcompletedysl"; @@ -487,11 +486,8 @@ class LoginDialog extends Component { } return ( - this.handleDialogClose()} >
: ""} - + ); } diff --git a/public/react/src/modules/modals/Modals.js b/public/react/src/modules/modals/Modals.js index 1aaec6402..c134db3d7 100644 --- a/public/react/src/modules/modals/Modals.js +++ b/public/react/src/modules/modals/Modals.js @@ -1,31 +1,30 @@ import React, { Component } from 'react'; -import {getImageUrl} from 'educoder'; -import { Spin, Icon , Modal} from 'antd'; +import { Spin, Icon, Modal } from 'antd'; class Modals extends Component { constructor(props) { super(props); this.state = { - funmodalsType:false, - istype:false + funmodalsType: false, + istype: false } } -render() { + render() { const antIcons = - return( - - {this.props.modalsType===true?:""} - -
-

{this.props.modalsTopval}

- {this.props.modalsMidval===undefined?"":

{this.props.modalsMidval}

} -

{this.props.modalsBottomval}

- {this.props.loadtype===true? -
- 知道啦 -
- : -
- 取消 - {this.props.okText || '确定'} -
- } + } + : ""} + +
+

{this.props.modalsTopval}

+ {this.props.modalsMidval === undefined ? "" :

{this.props.modalsMidval}

} +

{this.props.modalsBottomval}

+ {this.props.loadtype === true ? +
+ 知道啦 +
+ : +
+ 取消 + {this.props.okText || '确定'}
- - + } +
+
+ ) } } diff --git a/public/react/src/modules/page/main/CodeRepositoryView.js b/public/react/src/modules/page/main/CodeRepositoryView.js index cca63e645..220be3fb0 100644 --- a/public/react/src/modules/page/main/CodeRepositoryView.js +++ b/public/react/src/modules/page/main/CodeRepositoryView.js @@ -1,9 +1,7 @@ import React, { Component } from 'react'; -import Drawer from '@material-ui/core/Drawer'; -import { CircularProgress } from '@material-ui/core'; -import Tooltip from '@material-ui/core/Tooltip'; +import { Tooltip, Drawer } from 'antd' import WebSSHTimer from '../component/WebSSHTimer' import Tree, { TreeNode } from 'rc-tree'; import 'rc-tree/assets/index.css'; @@ -330,42 +328,30 @@ class CodeRepositoryView extends Component { } return false; } - /** multi ssh end */ render() { - const { repositoryCode, onRepositoryCodeUpdate, showFilesDrawer, drawerOpen, loadingFirstRepoFiles + const { showFilesDrawer, drawerOpen, loadingFirstRepoFiles , challenge, evaluateViewExpanded, onRepositoryViewExpand, codeStatus, showResetCodeDialog, showResetPassedCodeDialog, tabIndex, tabIndexChange, game, shixun, isEditablePath, currentPath , showSettingDrawer, hide_code } = this.props; - // onRequestChange={(drawerOpen) => showFilesDrawer(drawerOpen)} - /* - -

- 请点击文件名称切换代码显示,代表当前显示的代码文件 -

- */ const { tpm_cases_modified, tpm_modified, tpm_script_modified, myshixun, onShowUpdateDialog } = this.props; let needUpdateScript = (tpm_modified || tpm_script_modified) && challenge.st === 0; const showUpdateButton = (tpm_cases_modified || needUpdateScript) && myshixun.system_tip === true; const { addtionalSSHArray, sshIsClosed } = this.state; - // shixun.multi_webssh = true; return ( showFilesDrawer(false)} + visible={drawerOpen} > {loadingFirstRepoFiles ? (
- + 正在加载中...
) : this.buildTree()}
@@ -526,13 +512,5 @@ class CodeRepositoryView extends Component { ); } } -/* - <%= Redmine::CodesetUtil.replace_invalid_utf8(@content) %> - , overflow: 'scroll' ref="editor" - - - -*/ export default CodeRepositoryView; \ No newline at end of file