From 51e215f425f7992453796ec311692a1f71595cef Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 26 Jul 2019 16:52:29 +0800 Subject: [PATCH 1/8] html --- public/react/src/common/TextUtil.js | 40 ++++++++++++++++------------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/public/react/src/common/TextUtil.js b/public/react/src/common/TextUtil.js index 70ca23258..05299467b 100644 --- a/public/react/src/common/TextUtil.js +++ b/public/react/src/common/TextUtil.js @@ -6,26 +6,30 @@ export function isImageExtension(fileName) { export function markdownToHTML(oldContent, selector) { window.$('#md_div').html('') // markdown to html - try { - var markdwonParser = window.editormd.markdownToHTML("md_div", { - markdown: oldContent, // .replace(/▁/g,"▁▁▁"), - emoji: true, - htmlDecode: "style,script,iframe", // you can filter tags decode - taskList: true, - tex: true, // 默认不解析 - flowChart: true, // 默认不解析 - sequenceDiagram: true // 默认不解析 - }); + if (selector && oldContent && oldContent.startsWith('

')) { // 普通html处理 + window.$(selector).html(oldContent) + } else { + try { + var markdwonParser = window.editormd.markdownToHTML("md_div", { + markdown: oldContent, // .replace(/▁/g,"▁▁▁"), + emoji: true, + htmlDecode: "style,script,iframe", // you can filter tags decode + taskList: true, + tex: true, // 默认不解析 + flowChart: true, // 默认不解析 + sequenceDiagram: true // 默认不解析 + }); - } catch(e) { - console.error(e) + } catch(e) { + console.error(e) + } + + const content = window.$('#md_div').html() + if (selector) { + window.$(selector).html(content) + } + return content } - - const content = window.$('#md_div').html() - if (selector) { - window.$(selector).html(content) - } - return content } export function appendFileSizeToUploadFile(item) { From bcfe17712f2fd626b5ccdbda1e8a5e62947e42bb Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 26 Jul 2019 16:54:18 +0800 Subject: [PATCH 2/8] selector --- public/react/src/modules/courses/busyWork/CommonWorkQuestion.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/busyWork/CommonWorkQuestion.js b/public/react/src/modules/courses/busyWork/CommonWorkQuestion.js index 7932311b1..49f1e5158 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkQuestion.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkQuestion.js @@ -87,7 +87,7 @@ class CommonWorkQuestion extends Component{ {/* 内容区 */}

- + { attachments && attachments.map((item) => { return (
From ae1b31263ca283b3a34d13c902c38a36bbab3499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 26 Jul 2019 17:24:02 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/user/FindPasswordComponent.js | 2 +- public/react/src/modules/user/LoginRegisterComponent.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/user/FindPasswordComponent.js b/public/react/src/modules/user/FindPasswordComponent.js index 408ca6142..b2e89da52 100644 --- a/public/react/src/modules/user/FindPasswordComponent.js +++ b/public/react/src/modules/user/FindPasswordComponent.js @@ -691,7 +691,7 @@ class LoginRegisterComponent extends Component { this.inputOnBlurzhuche(e)} + // onBlur={(e) => this.inputOnBlurzhuche(e)} onChange={this.loginInputonChange} style={{marginTop: '10px', height: "38px"}}> { Phonenumberisnotco && Phonenumberisnotco !== "" ? diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js index 1377298a9..081f868a7 100644 --- a/public/react/src/modules/user/LoginRegisterComponent.js +++ b/public/react/src/modules/user/LoginRegisterComponent.js @@ -1028,7 +1028,7 @@ class LoginRegisterComponent extends Component { value={this.state.logins} type="text" autoComplete="off" onChange={this.loginInputonChanges} - onBlur={(e) => this.inputOnBlurzhuche(e, 2)} + // onBlur={(e) => this.inputOnBlurzhuche(e, 2)} style={{marginTop: '30px' , height: '38px',color:'#999999',fontSize:"14px"}}> { Phonenumberisnotcos && Phonenumberisnotcos !== "" ? From 05cedd7bec6657d9f576825fce122a42904e2f5a Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 26 Jul 2019 17:29:58 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/homework_common.rb | 2 +- .../20190726082937_add_is_md_for_homeworks.rb | 12 ++++++++++++ db/migrate/20190726083814_migrate_course_is_md.rb | 14 ++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20190726082937_add_is_md_for_homeworks.rb create mode 100644 db/migrate/20190726083814_migrate_course_is_md.rb diff --git a/app/models/homework_common.rb b/app/models/homework_common.rb index ac64b92c1..5f5808944 100644 --- a/app/models/homework_common.rb +++ b/app/models/homework_common.rb @@ -35,7 +35,7 @@ class HomeworkCommon < ApplicationRecord has_many :homework_review_results, :dependent => :destroy validates :name, length: { maximum: 60 } - validates :description, length: { maximum: 5000 } + validates :description, length: { maximum: 10000 } validates :reference_answer, length: { maximum: 5000 } # after_update :update_activity diff --git a/db/migrate/20190726082937_add_is_md_for_homeworks.rb b/db/migrate/20190726082937_add_is_md_for_homeworks.rb new file mode 100644 index 000000000..0b25dde97 --- /dev/null +++ b/db/migrate/20190726082937_add_is_md_for_homeworks.rb @@ -0,0 +1,12 @@ +class AddIsMdForHomeworks < ActiveRecord::Migration[5.2] + def change + # add_column :homework_commons, :is_md, :boolean, :default => true + # add_column :homework_banks, :is_md, :boolean, :default => true + # + # + # add_column :exercise_questions,:is_md, :boolean, :default => true + # add_column :poll_questions,:is_md, :boolean, :default => true + # + # add_column :exercise_bank_questions, :is_md, :boolean, :default => true + end +end diff --git a/db/migrate/20190726083814_migrate_course_is_md.rb b/db/migrate/20190726083814_migrate_course_is_md.rb new file mode 100644 index 000000000..6988db14a --- /dev/null +++ b/db/migrate/20190726083814_migrate_course_is_md.rb @@ -0,0 +1,14 @@ +class MigrateCourseIsMd < ActiveRecord::Migration[5.2] + def change + # HomeworkCommon.where(homework_type: [1, 3]).where("created_at < '2019-07-21 00:00:00'").update_all(is_md: false) + # HomeworkBank.where(homework_type: [1, 3]).where("created_at < '2019-07-21 00:00:00'").update_all(is_md: false) + # + # HomeworkCommon.where(homework_type: [1, 3]).where("created_at >= '2019-07-21 00:00:00' and homework_bank_id is not null").each do |homework| + # + # end + # + # ExerciseQuestion.where("created_at < '2019-07-21 00:00:00'").update_all(is_md: false) + # PollQuestion.where("created_at < '2019-07-21 00:00:00'").update_all(is_md: false) + # ExerciseBankQuestion.where("created_at < '2019-07-21 00:00:00'").update_all(is_md: false) + end +end From a97c4f9d82c8542969a5a63e942bdf926f60f816 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 26 Jul 2019 17:31:20 +0800 Subject: [PATCH 5/8] select --- public/react/src/modules/user/account/AccountBasicEdit.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/user/account/AccountBasicEdit.js b/public/react/src/modules/user/account/AccountBasicEdit.js index 4a2fd97f1..a4637c00e 100644 --- a/public/react/src/modules/user/account/AccountBasicEdit.js +++ b/public/react/src/modules/user/account/AccountBasicEdit.js @@ -402,6 +402,7 @@ class AccountBasic extends Component { filterDepartments, school, school_id, + departments, departmentsName, identity }=this.state; @@ -718,7 +719,9 @@ class AccountBasic extends Component { { - (!filterDepartments || (filterDepartments && filterDepartments.length==0 ) || (departmentsName == '' && !this.state.department_id)) && + (!filterDepartments || (filterDepartments && filterDepartments.length==0 ) + || (departmentsName == '' && !this.state.department_id + && (!departments || departments.length == 0) )) &&
{departmentsName ? `未找到包含“${departmentsName}”的院系/部门` : '未找到院系'}, From 4e94aae89b614503de35694b2a5417ed32ce3740 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 26 Jul 2019 17:33:58 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/homework_common.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/homework_common.rb b/app/models/homework_common.rb index 5f5808944..9aa4a8fe1 100644 --- a/app/models/homework_common.rb +++ b/app/models/homework_common.rb @@ -35,7 +35,7 @@ class HomeworkCommon < ApplicationRecord has_many :homework_review_results, :dependent => :destroy validates :name, length: { maximum: 60 } - validates :description, length: { maximum: 10000 } + validates :description, length: { maximum: 15000 } validates :reference_answer, length: { maximum: 5000 } # after_update :update_activity From bd93a5aaec6d6e8ecf9c5423fe351ad752578c88 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 26 Jul 2019 17:45:15 +0800 Subject: [PATCH 7/8]

')) { // 普通html处理 + if (selector && oldContent && oldContent.startsWith(' Date: Fri, 26 Jul 2019 17:54:58 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/login/LoginDialog.js | 30 +++++++++++++++---- .../modules/user/LoginRegisterComponent.js | 4 +-- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/public/react/src/modules/login/LoginDialog.js b/public/react/src/modules/login/LoginDialog.js index d3df6090e..a4dee4b4c 100644 --- a/public/react/src/modules/login/LoginDialog.js +++ b/public/react/src/modules/login/LoginDialog.js @@ -13,6 +13,7 @@ import axios from 'axios'; import './LoginDialog.css'; import { broadcastChannelPostMessage } from 'educoder' +import Notcompletedysl from "../user/Notcompletedysl"; const $ = window.$; var wait = 60; @@ -100,6 +101,7 @@ class LoginDialog extends Component { authCodeType:true, authCodeclass:'log-botton mt5', isRender: false, + MyEduCoderModals:false, }; } @@ -365,11 +367,12 @@ class LoginDialog extends Component { description:response.data.message, }); }else{ - if(response.data.identity === null || response.data.identity === undefined){ - this.props.history.push("/interesse"); + if(response.data.profile_completed !== null || response.data.profile_completed === false){ + this.setMyEduCoderModals(); return; } - broadcastChannelPostMessage('refreshPage') + + broadcastChannelPostMessage('refreshPage') this.setState({ isRender:false }) @@ -388,17 +391,28 @@ class LoginDialog extends Component { console.log(error) }) - } + }; + setNotcompleteds=()=>{ + this.setState({ + Notcompleteds:true, + MyEduCoderModals:false + }) + }; + setMyEduCoderModals=()=>{ + this.setState({ + MyEduCoderModals:true + }) + }; onKeydowns=(e)=>{ let {disabled}=this.state; if( disabled===false&& e.keyCode === 13){ this.loginEDU() console.log(1) } - } + }; getloginurl=(url)=>{ window.location.href = url; - } + }; render() { let{open,login,speedy,loginValue,regular,isGoing,isGoingValue,disabled,bottonclass, dialogBox,shortcutnum,disabledType,gaincode,authCodeType,authCodeclass, isRender}=this.state; @@ -414,6 +428,10 @@ class LoginDialog extends Component { disableBackdropClick={true} onClose={() => this.handleDialogClose()} > + {this.setNotcompleteds()}} + /> {isRender===true?

{this.handleDialogClose()}}> diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js index 081f868a7..9b1533bea 100644 --- a/public/react/src/modules/user/LoginRegisterComponent.js +++ b/public/react/src/modules/user/LoginRegisterComponent.js @@ -340,8 +340,8 @@ class LoginRegisterComponent extends Component { } - if(response.data.identity === null || response.data.identity === undefined){ - this.props.history.push("/interesse"); + if(response.data.profile_completed !== null || response.data.profile_completed === false){ + this.setMyEduCoderModals(); return; }