Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Feature/quick fixes after ga release #523

Merged
merged 5 commits into from
Nov 4, 2015
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@
// filtering is a separate step to allow multiple pre-processings and filter out in single call
subtrackRanks = UserStatsService.filterStats(subtrackRanks);
// sort subtrack ranks
subtrackRanks = $filter('orderBy')(subtrackRanks, 'mostRecentEventDate', true);
subtrackRanks = $filter('orderBy')(subtrackRanks, 'mostRecentSubmissionDate', true);

vm.subtrackRanks = subtrackRanks;
vm.hasRanks = !!vm.subtrackRanks.length;
4 changes: 2 additions & 2 deletions app/profile/about/about.jade
Original file line number Diff line number Diff line change
@@ -67,13 +67,13 @@
)
.name {{subtrack.subTrack | track}}

.ranking(ng-if="subtrack.rating")
.ranking(ng-if="subtrack.statType == 'Rating'")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use ng-switch instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I omitted that because I would need to add a new wrapper div which may break some CSS. Isn't it?

.number.rating(style="color: {{subtrack.rating | ratingColor}}")
| {{subtrack.rating}}

.tag Rating

.ranking(ng-if="subtrack.rank && !subtrack.rating")
.ranking(ng-if="subtrack.statType == 'Ranking'")
.number {{subtrack.rank | ordinal}}

.tag Ranking
33 changes: 33 additions & 0 deletions app/profile/subtrack/design/design-statistics.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.design(ng-if="vm.track == 'DESIGN'")

.bottom
h2.detailed Details

ul.vertical-stats
li.first
.left Win Percentage
.right {{vm.typeStats.winPercent | percentage | empty}}

li(ng-if="profileVm.isUser")
.left Inquiries
.right {{vm.typeStats.numInquiries | empty}}

li(ng-if="profileVm.isUser")
.left Submissions
.right {{vm.typeStats.submissions | empty}}

li
.left Submission Rate
.right {{vm.typeStats.submissionRate | percentage | empty}}

li.first(ng-if="profileVm.isUser")
.left Passed Screening
.right {{vm.typeStats.passedScreening | empty}}

li
.left Screening Success Rate
.right {{vm.typeStats.screeningSuccessRate | percentage | empty}}

li
.left Average Placement
.right {{vm.typeStats.avgPlacement | number: 2 | empty}}
4 changes: 1 addition & 3 deletions app/profile/subtrack/subtrack.controller.js
Original file line number Diff line number Diff line change
@@ -28,9 +28,7 @@
vm.pageName = vm.subTrack.toLowerCase().replace(/_/g, ' ');

vm.tabs = [];
if (vm.track !== 'DESIGN') {
vm.tabs.push('statistics');
}
vm.tabs.push('statistics');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vm.tabs can be defined & initialized in the same line.


if (vm.track !== 'COPILOT') {
vm.tabs.push( vm.subTrack === 'SRM' ? 'Past srm': 'challenges');
8 changes: 4 additions & 4 deletions app/profile/subtrack/subtrack.jade
Original file line number Diff line number Diff line change
@@ -20,11 +20,10 @@
p.label {{item.label}}

include ./develop/develop-statistics.jade
//- yes, challenges :( this is confusing and needs refactoring
include ./design/design-challenges.jade
include ./design/design-statistics.jade
include ./data/data-statistics.jade

tc-tab(heading="{{vm.tabs[1]}}", ng-if="vm.track === 'DATA_SCIENCE' || vm.track === 'DEVELOP'")
tc-tab(heading="{{vm.tabs[1]}}")
.subtrack-stats
responsive-carousel(data="vm.subTrackStats", handle="{{vm.handle}}")
.carousel-elem
@@ -37,5 +36,6 @@
p.value(ng-hide="item.label === 'rating'") {{item.val | empty}}

p.label {{item.label}}
include ./develop/develop-challenges.jade
include ./develop/develop-challenges.jade
include ./design/design-challenges.jade
include ./data/data-challenges.jade
12 changes: 8 additions & 4 deletions app/services/profile.service.js
Original file line number Diff line number Diff line change
@@ -108,7 +108,8 @@
'rating': subTrack.rank.rating || 0,
'wins': subTrack.wins,
'submissions': (subTrack.submissions && subTrack.submissions.submissions) || 0,
'mostRecentEventDate': new Date(subTrack.mostRecentEventDate)
'mostRecentEventDate': new Date(subTrack.mostRecentEventDate),
'mostRecentSubmissionDate': new Date(subTrack.mostRecentSubmission)
};
}).filter(function(subTrack) {
return !(subTrack.subTrack == 'COPILOT_POSTING' && subTrack.track == 'DEVELOP');
@@ -124,7 +125,8 @@
'challenges': subTrack.challenges,
'wins': subTrack.wins,
'submissions': (subTrack.submissions) || 0,
'mostRecentEventDate': new Date(subTrack.mostRecentEventDate)
'mostRecentEventDate': new Date(subTrack.mostRecentEventDate),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is 'mostRecentEventDate' even needed now? If not please remove, one less item to test :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we need it. We show this information in details tables under statistics tab.

'mostRecentSubmissionDate': new Date(subTrack.mostRecentSubmission)
};
});
}
@@ -135,7 +137,8 @@
'subTrack': 'SRM',
'rank': srmStats.rank.rank,
'rating': srmStats.rank.rating,
'mostRecentEventDate': new Date(srmStats.rank.mostRecentEventDate)
'mostRecentEventDate': new Date(srmStats.rank.mostRecentEventDate),
'mostRecentSubmissionDate': new Date(srmStats.mostRecentSubmission)
});
}
if (stats.DATA_SCIENCE && stats.DATA_SCIENCE.MARATHON_MATCH && stats.DATA_SCIENCE.MARATHON_MATCH.rank) {
@@ -145,7 +148,8 @@
'subTrack': 'MARATHON_MATCH',
'rank': marathonStats.rank.rank,
'rating': marathonStats.rank.rating,
'mostRecentEventDate': new Date(marathonStats.rank.mostRecentEventDate)
'mostRecentEventDate': new Date(marathonStats.rank.mostRecentEventDate),
'mostRecentSubmissionDate': new Date(marathonStats.mostRecentSubmission)
});
}
if (stats.COPILOT) {
7 changes: 7 additions & 0 deletions assets/css/profile/subtrack.scss
Original file line number Diff line number Diff line change
@@ -527,6 +527,13 @@
}

}

.design {
// override height of the statistics section for design track as we don't have limited stats for design
ul.vertical-stats {
height: 200px;
}
}
}
}
.categoryNav {