Merge branch 'dev_aliyun' into dev_tj

merge aliyun
chromesetting
tangjiang 5 years ago
commit bd8de2b86c

@ -0,0 +1,10 @@
class ModifyDescriptionForHacks < ActiveRecord::Migration[5.2]
def change
change_column :hacks, :description, :longtext
change_column :hack_codes, :code, :longtext
change_column :hack_user_lastest_codes, :code, :longtext
change_column :hack_user_codes, :code, :longtext
change_column :hack_user_debugs, :code, :longtext
end
end

@ -109,6 +109,8 @@ class TPMBanner extends Component {
if (prevProps != this.props) { if (prevProps != this.props) {
let shixunopenprocess=window.localStorage.shixunopenprocess; let shixunopenprocess=window.localStorage.shixunopenprocess;
let openopenpublictype=window.localStorage.openopenpublictype; let openopenpublictype=window.localStorage.openopenpublictype;
if(this.props.status===0&&this.props.openknows===false){
if(this.props.shixunsDetails&&this.props.shixunsDetails.shixun_status === 0 && this.props.identity < 5){ if(this.props.shixunsDetails&&this.props.shixunsDetails.shixun_status === 0 && this.props.identity < 5){
if(shixunopenprocess===undefined||shixunopenprocess===false){ if(shixunopenprocess===undefined||shixunopenprocess===false){
this.setState({ this.setState({
@ -120,7 +122,15 @@ class TPMBanner extends Component {
}) })
} }
} }
}else{
this.setState({
openknow:false
})
}
if(this.props.public===0&&this.props.status>1&&this.props.openknows===false){
if(this.props.shixunsDetails&&this.props.shixunsDetails.shixun_status === 2 && this.props.shixunsDetails&&this.props.shixunsDetails.public===0 && this.props.identity < 5){ if(this.props.shixunsDetails&&this.props.shixunsDetails.shixun_status === 2 && this.props.shixunsDetails&&this.props.shixunsDetails.public===0 && this.props.identity < 5){
if(openopenpublictype===undefined||openopenpublictype===false){ if(openopenpublictype===undefined||openopenpublictype===false){
this.setState({ this.setState({
@ -132,6 +142,12 @@ class TPMBanner extends Component {
}) })
} }
} }
}else{
this.setState({
openshowpublictype:false
})
}
} }
} }
@ -779,8 +795,8 @@ class TPMBanner extends Component {
}; };
// //
// console.log(this.props.shixunsDetails&&this.props.shixunsDetails.is_jupyter) // console.log(this.props.shixunsDetails&&this.props.shixunsDetails.is_jupyter)
console.log(this.props) // console.log(this.props)
console.log(this.state) // console.log(this.state)
return ( return (
shixunsDetails === undefined ? "" : shixunsDetails === undefined ? "" :

@ -50,12 +50,17 @@ class Shixuninformation extends Component {
} }
componentDidMount() { componentDidMount() {
let query=this.props.location.search
const types = query.split('?edit=')
if(types[1]==="1"){
let anchorElement = document.getElementById("newcourseContentMD"); let anchorElement = document.getElementById("newcourseContentMD");
if(anchorElement){ if(anchorElement){
this.scrollToAnchor("newcourseContentMD"); this.scrollToAnchor("newcourseContentMD");
} }
} }
}
componentDidUpdate(prevProps, prevState) { componentDidUpdate(prevProps, prevState) {
if (prevProps.data != this.props.data) { if (prevProps.data != this.props.data) {

@ -407,10 +407,10 @@ class Challenges extends Component {
<span className="font-16 fl">简介</span> <span className="font-16 fl">简介</span>
{this.props.identity < 5 && ChallengesDataList&&ChallengesDataList.shixun_status < 3 ? {this.props.identity < 5 && ChallengesDataList&&ChallengesDataList.shixun_status < 3 ?
<Link to={"/shixuns/" + id + "/settings"} className="fr color-blue font-14"> <a href={"/shixuns/" + id + "/settings?edit=1"} className="fr color-blue font-14">
{/*<img src={getImageUrl("images/educoder/icon/edit.svg")} className="fl mt3 ml2" />*/} {/*<img src={getImageUrl("images/educoder/icon/edit.svg")} className="fl mt3 ml2" />*/}
编辑 编辑
</Link>:""} </a>:""}
{this.props.user && this.props.user.main_site === true ? {this.props.user && this.props.user.main_site === true ?
this.props.identity < 5?<a className="fr font-14 color-blue mr20" href="/forums/2943" this.props.identity < 5?<a className="fr font-14 color-blue mr20" href="/forums/2943"
target="_blank">实训制作指南</a> : "":""} target="_blank">实训制作指南</a> : "":""}

@ -227,10 +227,10 @@ class Challengesjupyter extends Component {
<div className={"shixunjianjie"}> <div className={"shixunjianjie"}>
<span className="font-16 fl">简介</span> <span className="font-16 fl">简介</span>
<Tooltip placement="bottom" title={"编辑"}> <Tooltip placement="bottom" title={"编辑"}>
<Link style={{ display: this.props.identity < 5 && ChallengesDataList&&ChallengesDataList.shixun_status < 3 ? "block" : 'none' }} <a style={{ display: this.props.identity < 5 && ChallengesDataList&&ChallengesDataList.shixun_status < 3 ? "block" : 'none' }}
to={"/shixuns/" + id + "/settings?edit=1"} className="fr color-blue font-14"> href={"/shixuns/" + id + "/settings?edit=1"} className="fr color-blue font-14">
编辑 编辑
</Link> </a>
</Tooltip> </Tooltip>
</div> </div>
{this.state.opentitletype===true?<style> {this.state.opentitletype===true?<style>

@ -330,6 +330,7 @@ class Collaborators extends Component {
}); });
this.updatacomponentDiddata(); this.updatacomponentDiddata();
this.props.showNotification(response.data.message); this.props.showNotification(response.data.message);
// window.location.reload();
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}); });
@ -530,7 +531,7 @@ class Collaborators extends Component {
{ {
Collaboratorslist.length === 0 ? "" : Collaboratorslist.map((item, key) => { Collaboratorslist.length === 0 ? "" : Collaboratorslist.map((item, key) => {
return ( return (
<Radio key={key} style={radioStyle} value={item.user_id} <Radio key={key} style={radioStyle} value={item.user_id} defaultChecked={false}
onClick={() => this.addadminredio(item.user_id)}>{item.name}</Radio> onClick={() => this.addadminredio(item.user_id)}>{item.name}</Radio>
) )
}) })

Loading…
Cancel
Save