remove material-ui

dev_aliyun2
harry 5 years ago
parent 4a2c3c963d
commit b9b7e68a0e

@ -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 {
}
}
/*
<img src={messagegreyImg}/>
<span data-tip-top={ tread ? "踩" : "取消踩" } id="game_tread" className="color-grey" style={{paddingTop:'7px'}}>
<i className={`fa fa-thumbs-down font-20 mr3 ${ tread ? "" : "color-orange03" } `} ></i>
<span className="font-12 font-bd" id="game_tread_count">{tread_count}</span>
</span>
<div className="clearfix with100">
<textarea className="commentTxt"></textarea>
<p className="clearfix">
<a href="javascript:void(0)" className="fl uploadImg mt2">
<img src="/images/sendimg.svg" className="fl mr3 mt6"/><span className="up">上传图片</span>
</a>
<a href="javascript:void(0)" className="commentsbtn task-btn task-btn-blue fr">评论</a>
<span className="fr mr15 mt3"><i className="fa fa-thumbs-up color-dark-grey mr3 font-18"></i>20</span>
<img src="/images/message.svg" className="fr mr15 mt8"/>
</p>
</div>
*/
export default CommentInput;

@ -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 {
</a>
: ''}
{/*
<span className="ml5 mr5 color-grey-8">|</span>
<span className="reply_praise_count_952">
<a href="/praise_tread/praise_plus?obj_id=952&amp;obj_type=Discuss&amp;type=reply&amp;user_activity_id=952" data-remote="true" className="fr mr5 color-grey-8" data-tip-down="点赞">
<i className="fa fa-thumbs-up mr5"></i>
<span className="ml5 fr"></span>
</a>
</span>*/}
</p>
{/* currentUser.id == item.creator_user.id && (
<p className="fr mr10 orig_repll">
<span id={`hidden_discuss_btn_${item.id}`}>
<a href="javascript:void(0);" className="color-grey-8" onClick={ this.onCommentBtnClick(comment, item, 'delete') } >
<i className="far fa-trash-alt mr5"></i>
</a>
<span className="ml5 mr5 color-grey-8">|</span>
</span>
</p>
)*/}
</div>
<div className="comment_content clearfix" id={`reply_content_${item.id}`}>
@ -320,28 +291,11 @@ class Comments extends Component {
}
</div>
{/* currentUser.id == item.creator_user.id && (
<p className="fr mr10 orig_repll">
<span id={`hidden_discuss_btn_${item.id}`}>
<a href="javascript:void(0);" className="color-grey-8" onClick={ deleteComment.bind(this, item, index) } >
<i className="far fa-trash-alt mr5"></i>
</a>
<span className="ml5 mr5 color-grey-8">|</span>
</span>
</p>
)*/}
</div>
<div className="comment_content clearfix" id={`reply_content_${item.id}`}>
<div className="color-grey-3" id={`reply_content_${item.id}`}>
{/* 改成后端返回了的都是要显示的不管hidden的值是true还是false */}
{/* { item.hidden && ((this.props.onlySuperAdminCouldHide && !item.isSuperAdmin)
|| !this.props.onlySuperAdminCouldHide && item.admin === false && (item.manager === false || item.manager == undefined))
? <p className="color-orange font-16">违规评论已被屏蔽</p>
: */}
<div className={"break_word_comments markdown-body"} dangerouslySetInnerHTML={{ __html: _content }}></div>
{/* } */}
<div className="cl"></div>
</div>
</div>
@ -356,12 +310,10 @@ class Comments extends Component {
</Tooltip>
: ''}
</div>
{/*mr10 */}
<p className="fr orig_reply">
<span id="hidden_discuss_btn_952">
</span>
{/* && !item.reward */}
{this.props.showRewardButton != false && item.admin === true ?
<a href="javascript:void(0);" className="color-grey-8 fl mt2" onClick={() => this.showGoldRewardDialog(item)}>
<Tooltip title={"给TA奖励金币"} disableFocusListener={true}>
@ -425,7 +377,6 @@ class Comments extends Component {
>
</CommentItemMDEditor>
}
{/* <div id={`reply_message_${item.id}`} className="reply_to_message"></div> */}
</div>
</div>
@ -433,15 +384,6 @@ class Comments extends Component {
</div>
)
})
/*
/users/reply_to?reply_id=${item.id}&amp;type=Challenge&amp;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 (
<div className="fit -scroll" style={{ 'overflow-x': 'hidden' }}>
@ -560,13 +500,6 @@ class Comments extends Component {
<InputNumber placeholder="请输入奖励的金币数量" id="goldReward" type="number" value={this.state.goldRewardInput}
onChange={(e) => this.onGoldRewardInputChange(e)} width={228} style={{ width: '228px' }} />
{/* <FormControl { ...goldRewardInputErrorObj } aria-describedby="name-error-text">
<InputLabel htmlFor="goldReward">请输入奖励的金币数量</InputLabel>
<Input id="goldReward" type="number" value={this.state.goldRewardInput} onChange={(e) => this.onGoldRewardInputChange(e)} />
{ goldRewardInputError ? <FormHelperText id="name-error-text">奖励金币不能为空或负数</FormHelperText> : ''}
</FormControl> */}
{/*<DialogContentText id="alert-dialog-description" style={{textAlign: 'center'}}> </DialogContentText>*/}
</DialogContent>
<DialogActions>
<Button onClick={this.handleGoldRewardDialogClose} color="primary">

@ -1,12 +1,5 @@
import React, { Component } from 'react';
import DialogActions from '@material-ui/core/DialogActions';
import DialogContent from '@material-ui/core/DialogContent';
import DialogTitle from '@material-ui/core/DialogTitle';
import Dialog from '@material-ui/core/Dialog';
import Button from '@material-ui/core/Button';
import { InputNumber } from 'antd'
import React, { Component } from 'react'
import { InputNumber, Button, Modal } from 'antd'
class RewardDialog extends Component {
constructor(props) {
@ -15,7 +8,6 @@ class RewardDialog extends Component {
this.handleGoldRewardDialogClose = this.handleGoldRewardDialogClose.bind(this)
this.state = {
// goldRewardDialogOpen: false,
goldRewardInput: '',
}
}
@ -36,7 +28,6 @@ class RewardDialog extends Component {
const { goldRewardInput } = this.state;
if (!goldRewardInput || goldRewardInput === '0' || goldRewardInput < 0) {
this.props.showNotification('奖励金币不能为空或负数')
// this.setState({ goldRewardInputError: true})
return;
} else {
this.props.setRewardDialogVisible(false)
@ -54,37 +45,17 @@ class RewardDialog extends Component {
render() {
const { goldRewardDialogOpen } = this.props;
const { goldRewardInputError } = this.state;
const goldRewardInputErrorObj = goldRewardInputError ? { 'error': 'error' } : {}
return (
<Dialog
open={goldRewardDialogOpen}
disableEscapeKeyDown={true}
onClose={this.handleGoldRewardDialogClose}
className={'rewardDialog'}
<Modal
title="奖励设置"
visible={goldRewardDialogOpen}
onOk={this.onGoldRewardDialogOkBtnClick.bind(this)}
onCancel={this.handleGoldRewardDialogClose}
>
<style>{`
.rewardDialog>div:last-child {
width: 280px;
}
`}</style>
<DialogTitle id="alert-dialog-title">{"奖励设置"}</DialogTitle>
<DialogContent>
<InputNumber placeholder="请输入奖励的金币数量" id="goldReward" type="number" value={this.state.goldRewardInput}
onChange={(e) => this.onGoldRewardInputChange(e)} width={228} style={{ width: '228px' }} />
</DialogContent>
<DialogActions>
<Button onClick={this.handleGoldRewardDialogClose} color="primary">
取消
</Button>
<Button variant="raised"
onClick={() => this.onGoldRewardDialogOkBtnClick()} color="primary" autoFocus>
确定
</Button>
</DialogActions>
</Dialog>
<InputNumber placeholder="请输入奖励的金币数量" id="goldReward" type="number" value={this.state.goldRewardInput}
onChange={(e) => this.onGoldRewardInputChange(e)} width={228} style={{ width: '228px' }} />
</Modal>
);
}
}

@ -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 (
<Dialog open={true} id="DialogID"
<Modal visible={true} id="DialogID"
className="zindextest"
style={{ display: isRender == false ? 'none' : '' }}
disableEscapeKeyDown={true}
disableBackdropClick={true}
onClose={() => this.handleDialogClose()}
>
<Notcompletedysl
@ -655,7 +651,7 @@ class LoginDialog extends Component {
</div>
</div>
: ""}
</Dialog>
</Modal>
);
}

@ -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 = <Icon type="loading" style={{ fontSize: 24 }} spin />
return(
<Modal
className={this.props.className}
keyboard={false}
title="提示"
visible={this.props.modalsType===undefined?false:this.props.modalsType}
closable={false}
footer={null}
destroyOnClose={true}
centered={true}
width="530px"
>
{this.props.modalsType===true?<style>
{
`
return (
<Modal
className={this.props.className}
keyboard={false}
title="提示"
visible={this.props.modalsType === undefined ? false : this.props.modalsType}
closable={false}
footer={null}
destroyOnClose={true}
centered={true}
width="530px"
>
{this.props.modalsType === true ? <style>
{
`
body{
width: calc(100%) !important;
}
@ -36,27 +35,27 @@ render() {
color:#848282;
}
`
}
</style>:""}
<Spin indicator={antIcons} spinning={this.props.antIcon===undefined?false:this.props.antIcon} >
<div className="task-popup-content">
<p className="task-popup-text-center font-16">{this.props.modalsTopval}</p>
{this.props.modalsMidval===undefined?"":<p className={this.props.modalstyles?"task-popup-text-center font-16 mt5 color848282":"task-popup-text-center font-16 mt5"}>{this.props.modalsMidval}</p>}
<p className={this.props.modalstyles?"task-popup-text-center font-16 mt5 color848282":"task-popup-text-center font-16 mt5"}
>{this.props.modalsBottomval}</p>
{this.props.loadtype===true?
<div className="clearfix edu-txt-center mt20">
<a className="task-btn task-btn-orange pop_close" onClick={this.props.modalSave}>知道啦</a>
</div>
:
<div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30" onClick={this.props.modalCancel}>取消</a>
<a className="task-btn task-btn-orange" onClick={this.props.modalSave}>{this.props.okText || '确定'}</a>
</div>
}
}
</style> : ""}
<Spin indicator={antIcons} spinning={this.props.antIcon === undefined ? false : this.props.antIcon} >
<div className="task-popup-content">
<p className="task-popup-text-center font-16">{this.props.modalsTopval}</p>
{this.props.modalsMidval === undefined ? "" : <p className={this.props.modalstyles ? "task-popup-text-center font-16 mt5 color848282" : "task-popup-text-center font-16 mt5"}>{this.props.modalsMidval}</p>}
<p className={this.props.modalstyles ? "task-popup-text-center font-16 mt5 color848282" : "task-popup-text-center font-16 mt5"}
>{this.props.modalsBottomval}</p>
{this.props.loadtype === true ?
<div className="clearfix edu-txt-center mt20">
<a className="task-btn task-btn-orange pop_close" onClick={this.props.modalSave}>知道啦</a>
</div>
:
<div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30" onClick={this.props.modalCancel}>取消</a>
<a className="task-btn task-btn-orange" onClick={this.props.modalSave}>{this.props.okText || '确定'}</a>
</div>
</Spin>
</Modal>
}
</div>
</Spin>
</Modal>
)
}
}

@ -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)}
/*
<p className="pl10 pr10 mt5 mb5 edu-txt-left" style={{height:'30px'}}>
请点击文件名称切换代码显示<span className="blue-line">代表当前显示的代码文件</span>
</p>
*/
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 (
<React.Fragment>
<Drawer
anchor="right"
className="repoFilesDrawer"
placement="right"
width={300}
open={drawerOpen}
onClose={() => showFilesDrawer(false)}
visible={drawerOpen}
>
{loadingFirstRepoFiles ? (
<div style={{ width: '100%', height: '200px', textAlign: 'center', marginTop: '48px' }} >
<CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '40%', display: 'block' }} />
正在加载中...
</div>
) : this.buildTree()}
</Drawer>
@ -526,13 +512,5 @@ class CodeRepositoryView extends Component {
);
}
}
/*
<%= Redmine::CodesetUtil.replace_invalid_utf8(@content) %>
, overflow: 'scroll' ref="editor"
<CodeMirror style={{height: '100%'}} value={repositoryCode} onChange={onRepositoryCodeUpdate} options={cmOptions} />
<iframe src="https://testwebssh.educoder.net/?Host=10.9.81.28&amp;Port=44940&amp;Username=root&amp;Password=123123&amp;Gameid=2618&amp;Rows=24&amp;Tab=2"
style={{width: '100%', border: '0px', minHeight: '440px', maxHeight: '440px'}} scrolling="no" id="game_webssh" className="game_webssh"></iframe>
*/
export default CodeRepositoryView;
Loading…
Cancel
Save