调整登录 验证逻辑判断

dev_newshixunModel
杨树明 6 years ago
parent 0c18f5c859
commit 91359292a6

@ -28,6 +28,16 @@ class Fileslistitem extends Component{
} }
showfiles=(list)=>{ showfiles=(list)=>{
if(this.props.checkIfLogin()===false){
this.props.showLoginDialog()
return
}
if(this.props.checkIfProfileCompleted()===false){
this.props.showProfileCompleteDialog()
return
}
if(list.is_history_file===false){ if(list.is_history_file===false){
// this.props.DownloadFileA(list.title,list.url) // this.props.DownloadFileA(list.title,list.url)
//window.location.href=list.url; //window.location.href=list.url;
@ -217,7 +227,9 @@ class Fileslistitem extends Component{
{ {
this.props.isNotMember===true? this.props.isNotMember===true?
discussMessage.is_lock === true ? discussMessage.is_lock === true ?
<span className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.title}</span> <Tooltip title={"私有属性,非课堂成员不能访问"} placement="bottom">
<span className="fl mt3 font-16 font-bd color-dark maxwidth580 pointer">{discussMessage.title}</span>
</Tooltip>
:<a :<a
onClick={()=>this.showfiles(discussMessage)} onClick={()=>this.showfiles(discussMessage)}
title={discussMessage.title} title={discussMessage.title}

@ -113,31 +113,36 @@ class Fileslists extends Component{
updadatalist=(id)=>{ updadatalist=(id)=>{
// this.seactall(id) // this.seactall(id)
let coursesId=this.props.match.params.coursesId; if(this.props.user&&this.props.user.login=== ""||this.props.user&&this.props.user.login=== null||this.props.user&&this.props.user.login=== undefined){
let url="/courses/"+coursesId+"/attahcment_category_list.json";
axios.get(url, { }else{
}).then((response) => { let coursesId=this.props.match.params.coursesId;
if(response!=undefined){ let url="/courses/"+coursesId+"/attahcment_category_list.json";
axios.get(url, {
if(response.data&&response.data) { }).then((response) => {
if (response.data.status != 401) { if(response!=undefined){
let list = response.data.course_modules;
let course_second_categoriess; if(response.data&&response.data) {
list.map((item, key) => { if (response.data.status != 401) {
course_second_categoriess = item.course_second_categories let list = response.data.course_modules;
}) let course_second_categoriess;
list.map((item, key) => {
this.setState({ course_second_categoriess = item.course_second_categories
course_modules: response.data, })
has_course_groups: response.data.has_course_groups,
course_second_categories: course_second_categoriess this.setState({
}) course_modules: response.data,
has_course_groups: response.data.has_course_groups,
course_second_categories: course_second_categoriess
})
}
} }
} }
} })
}
})
} }
updatafiled=()=>{ updatafiled=()=>{
if(this.props.match.params.main_id){ if(this.props.match.params.main_id){

@ -10,6 +10,16 @@ class BoardsListItem extends Component{
} }
} }
onTitleClick = (discussMessage) => { onTitleClick = (discussMessage) => {
if(this.props.checkIfLogin()===false){
this.props.showLoginDialog()
return
}
if(this.props.checkIfProfileCompleted()===false){
this.props.showProfileCompleteDialog()
return
}
const isAdminOrStudent = this.props.isAdminOrStudent(); const isAdminOrStudent = this.props.isAdminOrStudent();
if (!isAdminOrStudent && discussMessage.is_public == false) { if (!isAdminOrStudent && discussMessage.is_public == false) {
// 没有权限访问 // 没有权限访问
@ -47,15 +57,16 @@ class BoardsListItem extends Component{
</a> </a>
<div className="clearfix ds pr pt5 contentSection" onClick={() => onItemClick(discussMessage)}> <div className="clearfix ds pr pt5 contentSection" onClick={() => onItemClick(discussMessage)}>
<h6> <h6>
<a href="javascript:void(0)" className="panel-list-title hide fl mt5 color-dark font-bd" <Tooltip title={canNotLink?"私有属性,非课堂成员不能访问":`${discussMessage.subject.length > 40 ? discussMessage.subject : ''}`} placement="bottom">
style={{ fontWeight: 'bold', cursor: (canNotLink ? 'default' : 'poninter'), maxWidth: '700px' }} <a className="panel-list-title hide fl mt5 color-dark font-bd pointer"
onClick={canNotLink ? () => {} : () => this.onTitleClick(discussMessage)} style={{ fontWeight: 'bold', cursor: (canNotLink ? 'poninter' : 'poninter'), maxWidth: '700px' }}
title={`${discussMessage.subject.length > 40 ? discussMessage.subject : ''}`} onClick={canNotLink ? () => {} : () => this.onTitleClick(discussMessage)}
>{discussMessage.subject}</a> >{discussMessage.subject}</a>
</Tooltip>
{ !!discussMessage.sticky && <span className="btn-cir btn-cir-red fl mt5 ml5">置顶</span> } { !!discussMessage.sticky && <span className="btn-cir btn-cir-red fl mt5 ml5">置顶</span> }
{ {
discussMessage.is_public == false ? (<Tooltip title={`${isAdminOrStudent ? '私有属性' : '私有属性,非课堂成员不能访问'}`}> discussMessage.is_public == false ? (<Tooltip title={`${isAdminOrStudent ? '私有属性' : '私有属性,非课堂成员不能访问'}`} placement="bottom">
<i className="iconfont icon-guansuo color-grey-c ml10 font-16 fl mt4"></i> <i className="iconfont icon-guansuo color-grey-c ml10 font-16 fl mt4"></i>
</Tooltip>) : "" </Tooltip>) : ""
} }

@ -16,7 +16,18 @@ class CommonWorkItem extends Component{
} }
} }
onItemClick = (item) => { onItemClick = (item) => {
const isStudent = this.props.isStudent()
if(this.props.checkIfLogin()===false){
this.props.showLoginDialog()
return
}
if(this.props.checkIfProfileCompleted()===false){
this.props.showProfileCompleteDialog()
return
}
const isStudent = this.props.isStudent()
if (isStudent) { if (isStudent) {
this.props.toWorkQuestionPage(this.props.match.params, item.homework_id) this.props.toWorkQuestionPage(this.props.match.params, item.homework_id)
} else { } else {
@ -144,15 +155,15 @@ class CommonWorkItem extends Component{
} }
<div className="flex1" onClick={() => this.props.onItemClick(Object.assign({}, item, {id: item.homework_id})) }> <div className="flex1" onClick={() => this.props.onItemClick(Object.assign({}, item, {id: item.homework_id})) }>
<p className="clearfix mb20"> <p className="clearfix mb20">
<a title={item.name} <Tooltip title={ canNotLink ? "私有属性,非课堂成员不能访问" : item.name} placement="bottom" >
className="fl font-16 font-bd mt2 comnonwidth580" style={{cursor: canNotLink ? 'default' : 'poninter'}} <span className="fl font-16 font-bd mt2 comnonwidth580 pointer" style={{cursor: canNotLink ? 'poninter' : 'poninter'}}
onClick={ canNotLink ? () => {} : () => this.onItemClick(item)} onClick={ canNotLink ? () => {} : () => this.onItemClick(item)}
>{item.name}</a> >{item.name}</span>
</Tooltip>
{/* 只有非课堂成员且作业是私有的情况下才会为true */} {/* 只有非课堂成员且作业是私有的情况下才会为true */}
{ {
item.private_icon===true ? item.private_icon===true ?
(<Tooltip title={ isAdminOrStudent ? "私有属性" : "私有属性,非课堂成员不能访问"}> (<Tooltip title={ isAdminOrStudent ? "私有属性" : "私有属性,非课堂成员不能访问"} placement="bottom" >
<i className="iconfont icon-guansuo color-grey-c ml10 font-16 fl"></i> <i className="iconfont icon-guansuo color-grey-c ml10 font-16 fl"></i>
</Tooltip>) : "" </Tooltip>) : ""
} }
@ -182,7 +193,7 @@ class CommonWorkItem extends Component{
{item.uncommit_count===undefined?"":<span className="mr20 fl">{item.uncommit_count} 未交</span>} {item.uncommit_count===undefined?"":<span className="mr20 fl">{item.uncommit_count} 未交</span>}
{ {
item.status_time!="" && item.status_time!="" &&
<Tooltip title={ item.status.indexOf('提交中') != -1 ? '提交剩余时间' : <Tooltip placement="bottom" title={ item.status.indexOf('提交中') != -1 ? '提交剩余时间' :
item.status.indexOf('补交中') != -1 ? '补交剩余时间' : item.status.indexOf('补交中') != -1 ? '补交剩余时间' :
item.status.indexOf('申诉中') != -1 ? '申诉剩余时间' : item.status.indexOf('申诉中') != -1 ? '申诉剩余时间' :
item.status.indexOf('匿评中') != -1 ? '匿评剩余时间' : item.status.indexOf('匿评中') != -1 ? '匿评剩余时间' :

@ -1045,10 +1045,7 @@ class Coursesleftnav extends Component{
}) })
: course_modules===undefined?"":course_modules.map((item,key)=>{ : course_modules===undefined?"":course_modules.map((item,key)=>{
if(key===this.props.indexs){
console.log(key)
console.log(this.props.indexs)
}
return( return(
<div key={key}> <div key={key}>
{/*<Tooltip placement="bottom" title={"点击空白处展开二级菜单,点击模块名字跳转到对应模块"}>*/} {/*<Tooltip placement="bottom" title={"点击空白处展开二级菜单,点击模块名字跳转到对应模块"}>*/}

@ -51,6 +51,21 @@ class ExerciseListItem extends Component{
Loadtype:false Loadtype:false
}) })
} }
toDetailPage=(url)=>{
if(this.props.checkIfLogin()===false){
this.props.showLoginDialog()
return
}
if(this.props.checkIfProfileCompleted()===false){
this.props.showProfileCompleteDialog()
return
}
this.props.history.push(url);
}
render(){ render(){
let{item,checkBox,index}=this.props; let{item,checkBox,index}=this.props;
let {coursesId,Id}=this.props.match.params let {coursesId,Id}=this.props.match.params
@ -96,20 +111,22 @@ class ExerciseListItem extends Component{
{/*<Link to={`/courses/${coursesId}/exercises/${item.id}/exercises/student_exercise_list?tab=0`} className="fl font-16 font-bd mt2 color-grey-3 task-hide" style={{"maxWidth":"600px"}}>{item.exercise_name}</Link>*/} {/*<Link to={`/courses/${coursesId}/exercises/${item.id}/exercises/student_exercise_list?tab=0`} className="fl font-16 font-bd mt2 color-grey-3 task-hide" style={{"maxWidth":"600px"}}>{item.exercise_name}</Link>*/}
{ {
this.props.isAdmin()? <Link className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580" this.props.isAdmin()? <a className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580 pointer"
title={item.exercise_name} title={item.exercise_name}
to={`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`}>{item.exercise_name}</Link>:"" onClick={()=>this.toDetailPage(`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}>{item.exercise_name}</a>:""
} }
{ {
this.props.isStudent()? this.props.isStudent()?
<Link className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580" title={item.exercise_name} to={`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`}>{item.exercise_name}</Link>:"" <a className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580 pointer" title={item.exercise_name} onClick={()=>this.toDetailPage(`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}>{item.exercise_name}</a>:""
} }
{ {
this.props.isNotMember()? item.lock_status === 0 ? this.props.isNotMember()? item.lock_status === 0 ?
<span className="fl mt3 font-16 font-bd color-dark comnonwidth580" title={item.exercise_name}>{item.exercise_name}</span> <Tooltip title={"私有属性,非课堂成员不能访问"} placement="bottom">
: <Link className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580" title={item.exercise_name} to={`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`}>{item.exercise_name}</Link>:"" <span className="fl mt3 font-16 font-bd color-dark comnonwidth580 pointer" title={item.exercise_name}>{item.exercise_name}</span>
</Tooltip>
: <a className="fl font-16 font-bd mt2 color-grey-3 task-hide comnonwidth580 pointer" title={item.exercise_name} onClick={()=>this.toDetailPage(`/courses/${coursesId}/exercises/${item.id}/student_exercise_list?tab=0`)}>{item.exercise_name}</a>:""
} }
{ {

@ -133,6 +133,21 @@ class GraduateTaskItem extends Component{
setupdate=()=>{ setupdate=()=>{
this.props.funlist this.props.funlist
} }
toDetailPage=(url)=>{
if(this.props.checkIfLogin()===false){
this.props.showLoginDialog()
return
}
if(this.props.checkIfProfileCompleted()===false){
this.props.showProfileCompleteDialog()
return
}
this.props.history.push(url);
}
render(){ render(){
let { let {
Modalstype, Modalstype,
@ -215,20 +230,22 @@ class GraduateTaskItem extends Component{
<h6> <h6>
{ {
this.props.isAdmin?<Link to={"/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/detail/"+taskid+"/list"} this.props.isAdmin?<a onClick={()=>this.toDetailPage("/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/detail/"+taskid+"/list")}
title={discussMessage.name} title={discussMessage.name}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</Link>:"" className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
} }
{ {
this.props.isStudent? <Link to={"/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/detail/"+taskid+"/list"} this.props.isStudent? <a onClick={()=>this.toDetailPage("/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/detail/"+taskid+"/list")}
title={discussMessage.name} title={discussMessage.name}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</Link>:"" className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
} }
{ {
this.props.isNotMember===true?this.props.discussMessage.private_icon===true? this.props.isNotMember===true?this.props.discussMessage.private_icon===true?
<span className="fl mt3 font-16 font-bd color-dark maxwidth580" title={discussMessage.name}>{discussMessage.name}</span> <Tooltip title={"私有属性,非课堂成员不能访问"} placement="bottom">
:<a href={"/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/"+taskid+"/list"} <span className="fl mt3 font-16 font-bd color-dark maxwidth580 pointer" >{discussMessage.name}</span>
</Tooltip>
:<a onClick={()=>this.toDetailPage("/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/"+taskid+"/list")}
title={discussMessage.name} title={discussMessage.name}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:"" className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
} }

@ -15,6 +15,17 @@ class GraduateTopicItem extends Component{
this.props.history.push(`/courses/${courseId}/graduation_topics/${topicId}/edit`); this.props.history.push(`/courses/${courseId}/graduation_topics/${topicId}/edit`);
} }
toDetailPage=(topicId)=>{ toDetailPage=(topicId)=>{
if(this.props.checkIfLogin()===false){
this.props.showLoginDialog()
return
}
if(this.props.checkIfProfileCompleted()===false){
this.props.showProfileCompleteDialog()
return
}
let courseId=this.props.match.params.coursesId; let courseId=this.props.match.params.coursesId;
this.props.history.push(`/courses/${courseId}/graduation_topics/${topicId}/detail`); this.props.history.push(`/courses/${courseId}/graduation_topics/${topicId}/detail`);
} }
@ -71,7 +82,9 @@ class GraduateTopicItem extends Component{
<h6> <h6>
{ {
isNotMember? isNotMember?
<a className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:"" <Tooltip title={ discussMessage.private_icon===true?"私有属性,非课堂成员不能访问":discussMessage.name} placement="bottom">
<span className="fl mt3 font-16 font-bd color-dark maxwidth580 pointer">{discussMessage.name}</span>
</Tooltip>:""
} }
{ {

@ -1,5 +1,5 @@
import React,{ Component } from "react"; import React,{ Component } from "react";
import Tooltip from 'material-ui/Tooltip'; import {Tooltip} from 'antd';
import {Link} from 'react-router-dom'; import {Link} from 'react-router-dom';
import moment from 'moment'; import moment from 'moment';
import CoursesListType from '../coursesPublic/CoursesListType'; import CoursesListType from '../coursesPublic/CoursesListType';
@ -15,6 +15,20 @@ class PollListItem extends Component{
constructor(props){ constructor(props){
super(props); super(props);
} }
toDetailPage=(url)=>{
if(this.props.checkIfLogin()===false){
this.props.showLoginDialog()
return
}
if(this.props.checkIfProfileCompleted()===false){
this.props.showProfileCompleteDialog()
return
}
this.props.history.push(url);
}
render(){ render(){
let{item,checkBox,courseType,index}=this.props; let{item,checkBox,courseType,index}=this.props;
let {coursesId}=this.props.match.params; let {coursesId}=this.props.match.params;
@ -37,12 +51,16 @@ class PollListItem extends Component{
} }
<div className="flex1 pr"> <div className="flex1 pr">
<p className="clearfix mb30"> <p className="clearfix mb30">
{ canNotLink ? <a className="fl font-16 font-bd mt2 color-grey-3 task-hide" style={{"maxWidth":"600px", "cursor": "default"}} title={item.polls_name}>{item.polls_name}</a> : { canNotLink ?
<Link to={`/courses/${coursesId}/polls/${item.id}/detail`} className="fl font-16 font-bd mt2 color-grey-3 task-hide" style={{"maxWidth":"600px"}} title={item.polls_name}>{item.polls_name}</Link> <Tooltip title={courseType.user_permission == 0?"私有属性,非课堂成员不能访问":item.polls_name} placement="bottom">
<span className="fl font-16 font-bd mt2 color-grey-3 task-hide pointer" style={{"maxWidth":"600px"}} >{item.polls_name}</span>
</Tooltip>
:
<a onClick={()=>this.toDetailPage(`/courses/${coursesId}/polls/${item.id}/detail`)} className="fl font-16 font-bd mt2 color-grey-3 task-hide pointer" style={{"maxWidth":"600px"}} title={item.polls_name}>{item.polls_name}</a>
} }
{ {
item.lock_status === 0 ? item.lock_status === 0 ?
<Tooltip title={`${courseType.user_permission == 0 ? "私有属性,非课堂成员不能访问" : "私有属性"}`}> <Tooltip title={`${courseType.user_permission == 0 ? "私有属性,非课堂成员不能访问" : "私有属性"}`} placement="bottom">
<i className="iconfont icon-guansuo color-grey-c ml10 font-16 fl"></i> <i className="iconfont icon-guansuo color-grey-c ml10 font-16 fl"></i>
</Tooltip> </Tooltip>
:"" :""

@ -143,6 +143,22 @@ class ShixunhomeWorkItem extends Component{
ModalsRenametype:false, ModalsRenametype:false,
}) })
} }
hrefjumpskip=(url)=>{
if(this.props.checkIfLogin()===false){
this.props.showLoginDialog()
return
}
if(this.props.checkIfProfileCompleted()===false){
this.props.showProfileCompleteDialog()
return
}
this.props.history.push(url);
}
render(){ render(){
let { let {
Modalstype, Modalstype,
@ -294,23 +310,25 @@ class ShixunhomeWorkItem extends Component{
{/*to={`/courses/${this.props.match.params.coursesId}/${discussMessage.homework_id}/jobsettings`}*/} {/*to={`/courses/${this.props.match.params.coursesId}/${discussMessage.homework_id}/jobsettings`}*/}
{ {
this.props.isAdmin?<Link to={"/courses/"+this.props.match.params.coursesId+"/"+this.state.shixuntypes+"/"+discussMessage.homework_id+"/list?tab=0"} this.props.isAdmin?<a onClick={()=>this.hrefjumpskip("/courses/"+this.props.match.params.coursesId+"/"+this.state.shixuntypes+"/"+discussMessage.homework_id+"/list?tab=0")}
title={discussMessage.name} title={discussMessage.name}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</Link>:"" className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
} }
{ {
this.props.isStudent? <Link to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/list?tab=0`} this.props.isStudent? <a onClick={()=>this.hrefjumpskip(`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/list?tab=0`)}
title={discussMessage.name} title={discussMessage.name}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</Link>:"" className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
} }
{ {
this.props.isNotMember===true? this.props.discussMessage.private_icon===true? this.props.isNotMember===true? this.props.discussMessage.private_icon===true?
<span className="fl mt3 font-16 font-bd color-dark maxwidth580" title={discussMessage.name}>{discussMessage.name}</span> <Tooltip title={"私有属性,非课堂成员不能访问"} placement="bottom">
: <Link to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/list?tab=0`} <span className="fl mt3 font-16 font-bd color-dark maxwidth580 pointer">{discussMessage.name}</span>
</Tooltip>
: <a onClick={()=>this.hrefjumpskip(`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/list?tab=0`)}
title={discussMessage.name} title={discussMessage.name}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</Link>:"" className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
} }

@ -400,7 +400,11 @@ class LoginDialog extends Component {
handleDialogClose = () => { handleDialogClose = () => {
if(this.props.match===undefined){ if(this.props.match===undefined){
window.location.href="/"; // window.location.href="/";
this.setState({
isRender: false
})
this.props.Modifyloginvalue();
}else{ }else{
this.setState({ this.setState({
isRender: false isRender: false

@ -3,7 +3,6 @@ import {getImageUrl} from 'educoder';
import {Tooltip,Modal,Icon,Spin,message} from 'antd'; import {Tooltip,Modal,Icon,Spin,message} from 'antd';
import DetailCardsEditAndAdd from './DetailCardsEditAndAdd'; import DetailCardsEditAndAdd from './DetailCardsEditAndAdd';
import DetailCardsEditAndEdit from './DetailCardsEditAndEdit'; import DetailCardsEditAndEdit from './DetailCardsEditAndEdit';
import AccountProfile from"../../user/AccountProfile";
import { BrowserRouter as Router, Route, Link } from "react-router-dom"; import { BrowserRouter as Router, Route, Link } from "react-router-dom";
import axios from 'axios'; import axios from 'axios';
import { DragDropContext , Draggable, Droppable} from 'react-beautiful-dnd'; import { DragDropContext , Draggable, Droppable} from 'react-beautiful-dnd';
@ -201,10 +200,8 @@ class DetailCards extends Component{
return return
} }
if(this.props.current_user&&this.props.current_user.profile_completed===false){ if(this.props.checkIfProfileCompleted()===false){
this.setState({ this.props.showProfileCompleteDialog()
AccountProfiletype:true
})
return return
} }
@ -308,16 +305,11 @@ class DetailCards extends Component{
startshixunCombattype:false startshixunCombattype:false
}) })
} }
hideAccountProfile=()=>{
this.setState({
AccountProfiletype:false
})
}
render(){ render(){
let { pathCardsList, let { pathCardsList,
dropid, dropid,
AccountProfiletype,
idsum, idsum,
pathCardsedittype, pathCardsedittype,
pathlistedit, pathlistedit,
@ -339,11 +331,7 @@ class DetailCards extends Component{
// console.log("zzz"+this.props.MenuItemsindextype) // console.log("zzz"+this.props.MenuItemsindextype)
return( return(
<div> <div>
{AccountProfiletype===true?<AccountProfile
hideAccountProfile={()=>this.hideAccountProfile()}
{...this.props}
{...this.state}
/>:""}
<Modals <Modals
modalsType={Modalstype} modalsType={Modalstype}

@ -5,7 +5,6 @@ import SendPanel from "./sendPanel.js";
import { getImageUrl } from 'educoder'; import { getImageUrl } from 'educoder';
import axios from 'axios'; import axios from 'axios';
import Modals from '../../modals/Modals'; import Modals from '../../modals/Modals';
import AccountProfile from"../../user/AccountProfile";
import OpenCourse from './OpenCourse'; import OpenCourse from './OpenCourse';
import Jointheclass from '../../modals/Jointheclass'; import Jointheclass from '../../modals/Jointheclass';
import './DetailTop.css'; import './DetailTop.css';
@ -30,7 +29,7 @@ class DetailTop extends Component{
Pathcourseid:undefined, Pathcourseid:undefined,
OpenCourseTypes:false, OpenCourseTypes:false,
putappointmenttype:false, putappointmenttype:false,
getappointmenttype:false getappointmenttype:false,
} }
} }
componentDidMount(){ componentDidMount(){
@ -250,7 +249,7 @@ class DetailTop extends Component{
return return
} }
if(this.props.current_user&&this.props.current_user.profile_completed===false){ if(this.props.checkIfProfileCompleted()===false){
this.props.showProfileCompleteDialog() this.props.showProfileCompleteDialog()
return return
} }
@ -269,10 +268,8 @@ class DetailTop extends Component{
return return
} }
if(this.props.current_user&&this.props.current_user.profile_completed===false){ if(this.props.checkIfProfileCompleted()===false){
this.setState({ this.props.showProfileCompleteDialog()
AccountProfiletype:true
})
return return
} }
@ -336,14 +333,10 @@ class DetailTop extends Component{
}) })
} }
hideAccountProfile=()=>{
this.setState({
AccountProfiletype:false
})
}
render(){ render(){
let{detailInfoList}=this.props; let{detailInfoList}=this.props;
let{Modalstype,Modalstopval,cardsModalcancel,putappointmenttype,Modalsbottomval,cardsModalsavetype,loadtype,getappointmenttype,AccountProfiletype}=this.state; let{Modalstype,Modalstopval,cardsModalcancel,putappointmenttype,Modalsbottomval,cardsModalsavetype,loadtype,getappointmenttype}=this.state;
const radioStyle = { const radioStyle = {
display: 'block', display: 'block',
height: '30px', height: '30px',
@ -373,11 +366,7 @@ class DetailTop extends Component{
return( return(
<div className={this.props.courses===undefined?"subhead":this.props.courses.length===0?applypath===true?"subhead mb100":"subhead":applypath===false?detailInfoList.name.length>40?"subhead mb100":"subhead mb70":this.state.MenuItemskey===this.props.courses.length?"subhead mb120":detailInfoList.name.length>40?"subhead mb100":"subhead mb80"}> <div className={this.props.courses===undefined?"subhead":this.props.courses.length===0?applypath===true?"subhead mb100":"subhead":applypath===false?detailInfoList.name.length>40?"subhead mb100":"subhead mb70":this.state.MenuItemskey===this.props.courses.length?"subhead mb120":detailInfoList.name.length>40?"subhead mb100":"subhead mb80"}>
{AccountProfiletype===true?<AccountProfile
hideAccountProfile={()=>this.hideAccountProfile()}
{...this.props}
{...this.state}
/>:""}
<Modals <Modals
modalsType={Modalstype} modalsType={Modalstype}

@ -167,7 +167,7 @@ class TPMBanner extends Component {
this.props.showLoginDialog() this.props.showLoginDialog()
return return
} }
if(this.props.current_user&&this.props.current_user.profile_completed===false){ if(this.props.checkIfProfileCompleted()===false){
this.setState({ this.setState({
AccountProfiletype:true AccountProfiletype:true
}) })
@ -390,7 +390,7 @@ class TPMBanner extends Component {
return return
} }
if(this.props.current_user&&this.props.current_user.profile_completed===false){ if(this.props.checkIfProfileCompleted()===false){
this.setState({ this.setState({
AccountProfiletype:true AccountProfiletype:true
}) })

@ -228,7 +228,7 @@ class Challenges extends Component {
} }
if(this.props.current_user&&this.props.current_user.profile_completed===false){ if(this.props.checkIfProfileCompleted()===false){
this.setState({ this.setState({
AccountProfiletype:true AccountProfiletype:true
}) })

Loading…
Cancel
Save