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

SUP-2392, Extra spacing on profile if section is missing #512

Merged
merged 1 commit into from
Oct 30, 2015
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion app/profile/about/about.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
vm.categories = profileVm.categories;
vm.marathonRating = profileVm.categories['MARATHON_MATCH'] && profileVm.categories['MARATHON_MATCH'].rating;
vm.SRMRating = profileVm.categories['SRM'] && profileVm.categories['SRM'].rating;
vm.displaySection.stats = profileVm.showEditProfileLink || _.get(vm, 'categories.DESIGN', []).length || _.get(vm, 'categories.DEVELOP', []).length || _.get(vm, 'categories.DATA_SCIENCE', []).length || _.get(vm, 'categories.COPILOT', []).length;
vm.displaySection.stats = profileVm.showEditProfileLink;
});

profileVm.skillsPromise.then(function() {
Expand Down
6 changes: 3 additions & 3 deletions app/profile/about/about.jade
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

.empty-profile
.empty-state
empty-state-placeholder(state-name="profile-empty", show="profileVm.status.skills === 'ready' && profileVm.status.stats === 'ready' && profileVm.status.externalLinks === 'ready' && !profileVm.showEditProfileLink && !profileVm.numProjects && (!profileVm.skills || (profileVm.skills && profileVm.skills.length == 0)) && !vm.hasLinks")
empty-state-placeholder(state-name="profile-empty", show="profileVm.status.skills === 'ready' && profileVm.status.stats === 'ready' && profileVm.status.externalLinks === 'ready' && !profileVm.showEditProfileLink && !profileVm.showTCActivity && (!profileVm.skills || (profileVm.skills && profileVm.skills.length == 0)) && !vm.hasLinks")
.sample-image
img(ng-src="/images/robot.svg")

Expand All @@ -39,12 +39,12 @@


#tcActivity
tc-section(ng-show="vm.displaySection.stats", state="profileVm.status.stats")
tc-section(ng-show="vm.displaySection.stats || profileVm.showTCActivity", state="profileVm.status.stats")

.categories

.empty-state
empty-state-placeholder(state-name="profile-topcoder-activity", show="!profileVm.numProjects", theme="offwhite")
empty-state-placeholder(state-name="profile-topcoder-activity", show="!profileVm.showTCActivity", theme="offwhite")

.track(
ng-repeat="track in profileVm.profile.tracks",
Expand Down
16 changes: 14 additions & 2 deletions app/profile/profile.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,26 +42,38 @@
if (stats.COPILOT && stats.COPILOT.contests && vm.profile.tracks.indexOf('COPILOT') == -1) {
vm.profile.tracks.push('COPILOT');
}
vm.numProjects = vm.stats.challenges;
// flag to indicate if the member has acitivity on topcoder to be shown
// it is set to true, if we get at least one track with showTrack == true
vm.showTCActivity = false;
vm.numWins = vm.stats.wins;
vm.categories = ProfileService.getRanks(vm.stats);
for(var trackName in vm.categories) {
// trackStats is an array of subtrack rankings along with track stats properties (e.g showTrack)
var trackStats = vm.categories[trackName];
// flag to indicate if the member has activity for this track
// it is set to true, if we get at least one subtrack which can be shown for topcoder activity
trackStats.showTrack = false;
// if track has subtracks with stats
if (trackStats && trackStats.length > 0) {
// iterate over each subtrack stat and determine if we need to show as stat
trackStats.forEach(function(subTrackRank) {
// process subtack stat
UserStatsService.processStatRank(subTrackRank);
// if any of the subtrack has stat to show, enable the showTrack flag for the track
if (subTrackRank.showStats) {
trackStats.showTrack = true;
}
});
}
// if any of the track has stat to show, enable the showTCActivity flag to true
if (trackStats.showTrack) {
vm.showTCActivity = true;
}
}
} else {
vm.stats = false;
// vm.profile.tracks = [];
vm.numProjects = 0;
vm.showTCActivity = 0;
vm.numWins = 0;
vm.categories = {};
}
Expand Down