@@ -15,7 +15,6 @@ export default class HistoryGraph extends React.Component {
15
15
this . state = { } ;
16
16
this . mobileWidth = 0 ;
17
17
this . graphRef = React . createRef ( ) ;
18
- this . onHandleDataPointClicked = this . onHandleDataPointClicked . bind ( this ) ;
19
18
}
20
19
21
20
componentDidMount ( ) {
@@ -59,23 +58,6 @@ export default class HistoryGraph extends React.Component {
59
58
return 300 ;
60
59
}
61
60
62
- onHandleDataPointClicked ( ) {
63
- const { challengeId, href } = this . state ;
64
- fetch ( `${ config . API . V5 } /challenges?legacyId=${ challengeId } ` )
65
- . then ( result => result . json ( ) )
66
- . then ( ( dataResponse ) => {
67
- if ( dataResponse . length > 0 ) {
68
- const challenge = dataResponse [ 0 ] ;
69
- window . location . href = `${ config . URL . CHALLENGES_URL } /${ challenge . id } ` ;
70
- } else {
71
- window . location . href = href ;
72
- }
73
- } ) . catch ( ( ) => {
74
- window . location . href = href ;
75
- } ) ;
76
- }
77
-
78
-
79
61
draw ( ) {
80
62
const $scope = this ;
81
63
const { history : wrapper , track, subTrack } = this . props ;
@@ -230,7 +212,7 @@ export default class HistoryGraph extends React.Component {
230
212
}
231
213
if ( track === 'DATA_SCIENCE' ) {
232
214
if ( subTrack === 'MARATHON_MATCH' ) {
233
- return `${ config . URL . COMMUNITY } /tc?module=MatchDetails&rd= ${ challengeId } ` ;
215
+ return `${ config . URL . CHALLENGES_URL } / ${ challengeId } ` ;
234
216
}
235
217
if ( subTrack === 'SRM' ) {
236
218
return `${ config . URL . COMMUNITY } /stat?c=round_overview&rd=${ challengeId } ` ;
@@ -265,7 +247,6 @@ export default class HistoryGraph extends React.Component {
265
247
show : true ,
266
248
left : e . pageX ,
267
249
top : e . pageY ,
268
- challengeId : d . challengeId ,
269
250
challengeName : d . challengeName ,
270
251
challengeData : moment ( d . ratingDate ) . format ( 'MMM DD, YYYY' ) ,
271
252
rating : d . newRating ,
@@ -278,18 +259,7 @@ export default class HistoryGraph extends React.Component {
278
259
render ( ) {
279
260
return (
280
261
< div styleName = "history-graph" ref = { this . graphRef } >
281
- < ChartTooltip
282
- { ...this . state }
283
- onClick = { ( ) => {
284
- const { track } = this . props ;
285
- const { href } = this . state ;
286
- if ( track === 'DATA_SCIENCE' ) {
287
- this . onHandleDataPointClicked ( ) ;
288
- } else {
289
- window . location . href = href ;
290
- }
291
- } }
292
- />
262
+ < ChartTooltip { ...this . state } />
293
263
</ div >
294
264
) ;
295
265
}
0 commit comments