@@ -48,10 +48,10 @@ class ChallengeList extends Component {
4848 * @param {String } projectStatus project status
4949 */
5050 updateSearchParam ( searchText , projectStatus ) {
51- const { status, filterChallengeName, loadChallengesByPage, activeProjectId } = this . props
51+ const { status, filterChallengeName, loadChallengesByPage, activeProjectId, selfService } = this . props
5252 this . setState ( { searchText } , ( ) => {
5353 if ( status !== projectStatus || searchText !== filterChallengeName ) {
54- loadChallengesByPage ( 1 , activeProjectId , projectStatus , searchText )
54+ loadChallengesByPage ( 1 , activeProjectId , projectStatus , searchText , selfService )
5555 }
5656 } )
5757 }
@@ -62,9 +62,9 @@ class ChallengeList extends Component {
6262 */
6363 handlePageChange ( pageNumber ) {
6464 const { searchText } = this . state
65- const { page, loadChallengesByPage, activeProjectId, status } = this . props
65+ const { page, loadChallengesByPage, activeProjectId, status, selfService } = this . props
6666 if ( page !== pageNumber ) {
67- loadChallengesByPage ( pageNumber , activeProjectId , status , searchText )
67+ loadChallengesByPage ( pageNumber , activeProjectId , status , searchText , selfService )
6868 }
6969 }
7070
@@ -73,8 +73,8 @@ class ChallengeList extends Component {
7373 */
7474 reloadChallengeList ( ) {
7575 const { searchText } = this . state
76- const { page, loadChallengesByPage, activeProjectId, status } = this . props
77- loadChallengesByPage ( page , activeProjectId , status , searchText )
76+ const { page, loadChallengesByPage, activeProjectId, status, selfService } = this . props
77+ loadChallengesByPage ( page , activeProjectId , status , searchText , selfService )
7878 }
7979
8080 /**
@@ -104,7 +104,8 @@ class ChallengeList extends Component {
104104 totalChallenges,
105105 partiallyUpdateChallengeDetails,
106106 deleteChallenge,
107- isBillingAccountExpired
107+ isBillingAccountExpired,
108+ selfService
108109 } = this . props
109110 if ( warnMessage ) {
110111 return < Message warnMessage = { warnMessage } />
@@ -167,7 +168,8 @@ class ChallengeList extends Component {
167168 break
168169 }
169170 case 1 : {
170- this . directUpdateSearchParam ( searchText , CHALLENGE_STATUS . NEW )
171+ const status = selfService ? CHALLENGE_STATUS . DRAFT : CHALLENGE_STATUS . NEW
172+ this . directUpdateSearchParam ( searchText , status )
171173 break
172174 }
173175 case 2 : {
@@ -186,18 +188,21 @@ class ChallengeList extends Component {
186188 } } >
187189 < TabList >
188190 < Tab > Active</ Tab >
189- < Tab > New</ Tab >
191+ { ( ! selfService && < Tab > New</ Tab > ) }
190192 < Tab > Draft</ Tab >
191- < Tab > Completed</ Tab >
192- < Tab > Cancelled</ Tab >
193+ { ( ! selfService && < Tab > Completed</ Tab > ) }
194+ { ( ! selfService && < Tab > Cancelled</ Tab > ) }
193195 </ TabList >
194196 < TabPanel />
195197 < TabPanel />
196198 < TabPanel />
197199 </ Tabs > ) }
198200 {
199201 challenges . length === 0 && (
200- < NoChallenge activeProject = { activeProject } />
202+ < NoChallenge
203+ activeProject = { activeProject }
204+ selfService = { selfService }
205+ />
201206 )
202207 }
203208 {
@@ -225,6 +230,7 @@ class ChallengeList extends Component {
225230 partiallyUpdateChallengeDetails = { partiallyUpdateChallengeDetails }
226231 deleteChallenge = { deleteChallenge }
227232 isBillingAccountExpired = { isBillingAccountExpired }
233+ disableHover = { selfService }
228234 />
229235 </ li >
230236 )
@@ -269,7 +275,8 @@ ChallengeList.propTypes = {
269275 totalChallenges : PropTypes . number . isRequired ,
270276 partiallyUpdateChallengeDetails : PropTypes . func . isRequired ,
271277 deleteChallenge : PropTypes . func . isRequired ,
272- isBillingAccountExpired : PropTypes . bool
278+ isBillingAccountExpired : PropTypes . bool ,
279+ selfService : PropTypes . bool
273280}
274281
275282export default ChallengeList
0 commit comments