@@ -4,7 +4,7 @@ import moment from 'moment';
4
4
import _ from 'lodash' ;
5
5
import React from 'react' ;
6
6
import PT from 'prop-types' ;
7
- // import { config } from 'topcoder-react-utils';
7
+ import { config } from 'topcoder-react-utils' ;
8
8
import { getRatingColor } from 'utils/tc' ;
9
9
// import { RATING_COLORS } from 'utils/tc';
10
10
import ChartTooltip from '../ChartTooltip' ;
@@ -63,7 +63,7 @@ export default class HistoryGraph extends React.Component {
63
63
64
64
draw ( ) {
65
65
const $scope = this ;
66
- const { history : wrapper , subTrack } = this . props ;
66
+ const { history : wrapper , track , subTrack } = this . props ;
67
67
68
68
if ( ! wrapper ) {
69
69
return ;
@@ -216,20 +216,20 @@ export default class HistoryGraph extends React.Component {
216
216
}
217
217
*/
218
218
219
- // function getChallengeLink(challengeId) {
220
- // if (track === 'DEVELOP') {
221
- // return `/challenges/${challengeId}`;
222
- // }
223
- // if (track === 'DATA_SCIENCE') {
224
- // if (subTrack === 'MARATHON_MATCH') {
225
- // return `${config.URL.CHALLENGES_URL}/${challengeId}`;
226
- // }
227
- // if (subTrack === 'SRM') {
228
- // return `${config.URL.COMMUNITY}/stat?c=round_overview&rd=${challengeId}`;
229
- // }
230
- // }
231
- // return null;
232
- // }
219
+ function getChallengeLink ( challengeId ) {
220
+ if ( track === 'DEVELOP' ) {
221
+ return `/challenges/${ challengeId } ` ;
222
+ }
223
+ if ( track === 'DATA_SCIENCE' ) {
224
+ if ( subTrack === 'MARATHON_MATCH' ) {
225
+ return `${ config . URL . CHALLENGES_URL } /${ challengeId } ` ;
226
+ }
227
+ if ( subTrack === 'SRM' ) {
228
+ return `${ config . URL . COMMUNITY } /stat?c=round_overview&rd=${ challengeId } ` ;
229
+ }
230
+ }
231
+ return null ;
232
+ }
233
233
234
234
/*
235
235
svg.append('g')
@@ -311,17 +311,13 @@ export default class HistoryGraph extends React.Component {
311
311
challengeData : moment ( d . ratingDate ) . format ( 'MMM DD, YYYY' ) ,
312
312
rating : d . newRating ,
313
313
ratingColor : getRatingColor ( d . newRating ) ,
314
+ href : getChallengeLink ( d . challengeId ) ,
314
315
} ) ;
315
316
316
317
updateTooltipPosition ( ) ;
317
318
} )
318
319
. on ( 'mousemove' , ( ) => {
319
320
updateTooltipPosition ( ) ;
320
- } )
321
- . on ( 'mouseout' , ( ) => {
322
- $scope . setState ( {
323
- show : false ,
324
- } ) ;
325
321
} ) ;
326
322
}
327
323
0 commit comments