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

Qa integration #743

Merged
merged 18 commits into from
Mar 10, 2016
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
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

2 changes: 1 addition & 1 deletion app/community/members.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import angular from 'angular'
ctrl.notSearch = true
ctrl.showing = 'list'
ctrl.domain = CONSTANTS.domain
ctrl.currentMonth = 'January 2016'
ctrl.currentMonth = 'February 2016'
ctrl.memberLeaderboard = []
ctrl.copilots = []
CommunityDataService.getMembersData()
Expand Down
2 changes: 1 addition & 1 deletion app/directives/external-account/external-account.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ describe('External Accounts Directive', function() {
scope.linkedAccounts = null
scope.$digest()
expect(element.isolateScope().accountList).to.have.length(7)
expect(_.all(_.pluck(element.isolateScope().accountList, 'status'))).to.be.false
expect(_.every(_.map(element.isolateScope().accountList, 'status'))).to.be.false
})

it('should link external account ', function() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ import _ from 'lodash'
function displayMoneyEarned(handle) {
ProfileService.getUserFinancials(handle)
.then(function(financials) {
vm.moneyEarned = _.sum(_.pluck(financials, 'amount'))
vm.moneyEarned = _.sum(_.map(financials, 'amount'))

if (!vm.moneyEarned) {
$scope.hideMoney = true
Expand Down
2 changes: 1 addition & 1 deletion app/my-challenges/my-challenges.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ import _ from 'lodash'
.then(function(data) {
// data should be an array of 2 objects each with it's own array (2D array with metadata)

vm.totalCount = _.sum(_.pluck(data, 'metadata.totalCount'))
vm.totalCount = _.sum(_.map(data, 'metadata.totalCount'))
vm.myChallenges = vm.myChallenges.concat(_.union(data[0], data[1]))
if (vm.totalCount === 0) {
_checkForParticipation().then(function() {
Expand Down
2 changes: 1 addition & 1 deletion app/profile/subtrack/subtrack.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ import _ from 'lodash'
var mustHaveMetrics = ['rank', 'rating', 'reliability']
// check if rating, rank & reliability are all set
var _filteredObjs = _.filter(vm.subTrackStats, function(k) { return _.indexOf(mustHaveMetrics, k.label) > -1})
if (_.all(_.pluck(_filteredObjs, 'val'), function(v) { return !v})) {
if (_.every(_.map(_filteredObjs, 'val'), function(v) { return !v})) {
// all false filter em out
_.remove(vm.subTrackStats, function(k) { return _.indexOf(mustHaveMetrics, k.label) > -1})
}
Expand Down
28 changes: 14 additions & 14 deletions app/services/communityData.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,29 @@ import angular from 'angular'
var data = {
'memberLeaderboard': [
{
'avatar': '//www.topcoder.com/wp-content/uploads/2015/05/f0rc0d3r_jan2016.png',
'name': 'f0rc0d3r',
'avatar': '//www.topcoder.com/wp-content/uploads/2015/05/tewibowo_feb2016.png',
'name': 'Tewibowo',
'contestType': 'Design',
'description': 'Three first place wins in design totalling $4500',
'description': 'Won $4,175 in 6 challenges',
'class': 'design'
}, {
'avatar': '//www.topcoder.com/wp-content/uploads/2015/05/vvvpig_jan2016.png',
'name': 'vvvpig',
'avatar': '//www.topcoder.com/wp-content/uploads/2015/05/billsedison_feb2016.png',
'name': 'billsedison',
'contestType': 'Development',
'description': 'Eight first place wins in design totalling $9300',
'description': 'Four wins for $4,500',
'class': 'develop'
}, {
'avatar': '//www.topcoder.com/wp-content/uploads/2015/05/grumpy_gordon_jan2016.png',
'name': 'grumpy_gordon',
'avatar': '//www.topcoder.com/wp-content/uploads/2015/05/anubhav94_feb2016.png',
'name': 'anubhav94',
'contestType': 'Data Science',
'description': 'Rating increase of 316 pts in Nov SRMs, vaulting into Div 1',
'description': 'Gained 336 rating points within all 3 December SRMs',
'class': 'data-science'
}, {
'avatar': '//www.topcoder.com/wp-content/uploads/2015/05/thomaskranitsas_jan2016.png',
'name': 'thomaskranitsas',
'contestType': 'Development Rookie',
'description': 'Won first place in his first two challenges!',
'class': 'develop'
'avatar': '//www.topcoder.com/wp-content/uploads/2015/05/johnalok_feb2016.png',
'name': 'johnalok',
'contestType': 'Design Rookie',
'description': 'Won first place within 2 weeks of joining!',
'class': 'design'
}
],
'copilots': [{
Expand Down
11 changes: 5 additions & 6 deletions app/services/externalAccounts.service.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ describe('ExternalAccount Service', function() {
var auth0, userService
var profileGet, profilePost, profileDelete


beforeEach(function() {
bard.appModule('topcoder')
bard.inject(this, 'ExternalAccountService', '$httpBackend', '$q', 'CONSTANTS', 'JwtInterceptorService', 'auth', 'UserService')
Expand Down Expand Up @@ -91,8 +90,8 @@ describe('ExternalAccount Service', function() {
// spy
service.getAllExternalLinks('test1', 111, false).then(function(data) {
expect(data).to.be.defined
expect(_.pluck(data, 'provider')).to.include.members(['dribbble', 'github','bitbucket', 'stackoverflow'])
expect(_.all(_.pluck(data, 'data'))).to.be.truthy
expect(_.map(data, 'provider')).to.include.members(['dribbble', 'github','bitbucket', 'stackoverflow'])
expect(_.every(_.map(data, 'data'))).to.be.truthy
})
$httpBackend.flush()
})
Expand All @@ -101,7 +100,7 @@ describe('ExternalAccount Service', function() {
// spy
service.getAllExternalLinks('test1', 111, true).then(function(data) {
expect(data).to.be.defined
expect(_.pluck(data, 'provider')).to.include.members(['dribbble', 'github', 'behance', 'bitbucket','stackoverflow'])
expect(_.map(data, 'provider')).to.include.members(['dribbble', 'github', 'behance', 'bitbucket','stackoverflow'])
expect(data).to.have.length(5)
var nullAccounts = _.remove(data, function(n) {return n.data.status === 'PENDING'})
expect(nullAccounts).to.have.length(1)
Expand All @@ -116,8 +115,8 @@ describe('ExternalAccount Service', function() {
// spy
service.getAllExternalLinks('test1', 111, true).then(function(data) {
expect(data).to.be.defined
expect(_.pluck(data, 'provider')).to.include.members(['dribbble', 'github','bitbucket', 'stackoverflow'])
expect(_.all(_.pluck(data, 'data'))).to.be.truthy
expect(_.map(data, 'provider')).to.include.members(['dribbble', 'github','bitbucket', 'stackoverflow'])
expect(_.every(_.map(data, 'data'))).to.be.truthy
})
$httpBackend.flush()
})
Expand Down
10 changes: 5 additions & 5 deletions app/services/externalLinks.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ import _ from 'lodash'
})
}
// add provider type as weblink
links = _(links).forEach(function(l) {
l.provider = 'weblink'
if (l.synchronizedAt === 0) {
l.status = 'PENDING'
links.forEach(function(l, i, array) {
array[i].provider = 'weblink'
if (array[i].synchronizedAt === 0) {
array[i].status = 'PENDING'
}
}).value()
})
return links
})
}
Expand Down
6 changes: 3 additions & 3 deletions app/services/introduction.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,21 @@ import _ from 'lodash'
var handleInParams = $stateParams.userHandle ? $stateParams.userHandle.toLowerCase() : null
var userIntroJSStats = store.get(userId)

if (!userIntroJSStats.dashboardIntroComplete && _.contains(currentPage, 'dashboard')) {
if (!userIntroJSStats.dashboardIntroComplete && _.includes(currentPage, 'dashboard')) {
userIntroJSStats.dashboardIntroComplete = true
store.set(userId, userIntroJSStats)

return getIntroData(currentPage)
}

if (!userIntroJSStats.profileAboutIntroComplete && _.contains(currentPage, 'profile.about') && userHandle === handleInParams) {
if (!userIntroJSStats.profileAboutIntroComplete && _.includes(currentPage, 'profile.about') && userHandle === handleInParams) {
userIntroJSStats.profileAboutIntroComplete = true
store.set(userId, userIntroJSStats)

return getIntroData(currentPage)
}

if (!userIntroJSStats.profileSubtrackIntroComplete && _.contains(currentPage, 'profile.subtrack') && userHandle === handleInParams && $stateParams.subTrack.toLowerCase() !== 'copilot') {
if (!userIntroJSStats.profileSubtrackIntroComplete && _.includes(currentPage, 'profile.subtrack') && userHandle === handleInParams && $stateParams.subTrack.toLowerCase() !== 'copilot') {
userIntroJSStats.profileSubtrackIntroComplete = true
store.set(userId, userIntroJSStats)

Expand Down
18 changes: 9 additions & 9 deletions app/services/userStats.service.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,30 @@ describe('User Stats Service', function() {
var _data = UserStatsService.getIterableStats('DEVELOP', 'ASSEMBLY_COMPETITION', stats)
expect(_data).to.have.length(6)

expect(_.pluck(_data, 'val')).to.have.members(['1,733', '25', '95%', '16', '10', '80%'])
expect(_.pluck(_data, 'label')).to.have.members(['rating', 'rank', 'percentile', 'challenges', 'wins', 'reliability'])
expect(_.map(_data, 'val')).to.have.members(['1,733', '25', '95%', '16', '10', '80%'])
expect(_.map(_data, 'label')).to.have.members(['rating', 'rank', 'percentile', 'challenges', 'wins', 'reliability'])
})

it('should return stats for design-webdesign ', function() {
var _data = UserStatsService.getIterableStats('DESIGN', 'WEB_DESIGNS', stats)
expect(_data).to.have.length(2)
expect(_.pluck(_data, 'val')).to.have.members(['190','418'])
expect(_.pluck(_data, 'label')).to.have.members(['wins', 'challenges'])
expect(_.map(_data, 'val')).to.have.members(['190','418'])
expect(_.map(_data, 'label')).to.have.members(['wins', 'challenges'])
})

it('should return stats for data-science: srms ', function() {
var _data = UserStatsService.getIterableStats('DATA_SCIENCE', 'SRM', stats)
expect(_data).to.have.length(5)
expect(_.pluck(_data, 'label')).to.have.members(['rating', 'rank', 'percentile', 'competitions', 'volatility'])
expect(_.pluck(_data, 'val')).to.have.members(['799', '6,280', '26%', '10', '473'])
expect(_.map(_data, 'label')).to.have.members(['rating', 'rank', 'percentile', 'competitions', 'volatility'])
expect(_.map(_data, 'val')).to.have.members(['799', '6,280', '26%', '10', '473'])
})


it('should return stats for Copilot ', function() {
var _data = UserStatsService.getIterableStats('COPILOT', 'COPILOT', stats)
expect(_data).to.have.length(5)
expect(_.pluck(_data, 'label')).to.have.members(['active challenges', 'active projects', 'total challenges', 'total projects', 'fulfillment'])
expect(_.pluck(_data, 'val')).to.have.members([0, '1', '24', '3', '84%'])
expect(_.map(_data, 'label')).to.have.members(['active challenges', 'active projects', 'total challenges', 'total projects', 'fulfillment'])
expect(_.map(_data, 'val')).to.have.members([0, '1', '24', '3', '84%'])
})
})

Expand Down Expand Up @@ -322,7 +322,7 @@ describe('User Stats Service', function() {
}]
var filtered = UserStatsService.filterStats(toTest)
expect(filtered).to.exist.to.have.length(3)
expect(_.pluck(filtered, 'showStats')).to.have.members([true, true, true])
expect(_.map(filtered, 'showStats')).to.have.members([true, true, true])
})
})

Expand Down
6 changes: 3 additions & 3 deletions app/settings/edit-profile/edit-profile.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ import _ from 'lodash'

function processData(userInfo) {
vm.tracks = {
DESIGN: _.contains(userInfo.tracks, 'DESIGN'),
DEVELOP: _.contains(userInfo.tracks, 'DEVELOP'),
DATA_SCIENCE: _.contains(userInfo.tracks, 'DATA_SCIENCE')
DESIGN: _.includes(userInfo.tracks, 'DESIGN'),
DEVELOP: _.includes(userInfo.tracks, 'DEVELOP'),
DATA_SCIENCE: _.includes(userInfo.tracks, 'DATA_SCIENCE')
}
}

Expand Down
6 changes: 3 additions & 3 deletions app/skill-picker/skill-picker.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ import _ from 'lodash'
* Verfies if the communities section state has been modified by the user in any way.
*/
function isCommunitiesDirty() {
var community = _.findWhere(vm.communities, {dirty: true})
var community = _.find(vm.communities, {dirty: true})
return !!community
}

Expand Down Expand Up @@ -97,7 +97,7 @@ import _ from 'lodash'
vm.loadingCommunities = false
responses.forEach(function(program) {
if (program) {
var community = _.findWhere(vm.communities, {programId: program.eventId})
var community = _.find(vm.communities, {programId: program.eventId})
if (community) {
// set display false to avoid showing already enabled/registered program
// we expect display property to be modified after first load of the page
Expand All @@ -111,7 +111,7 @@ import _ from 'lodash'
}
})
// if there exists at least 1 community which can be displayed, set showCommunity flag to true
var community = _.findWhere(vm.communities, {display: true})
var community = _.find(vm.communities, {display: true})
if (community) {
vm.showCommunity = true
}
Expand Down
19 changes: 0 additions & 19 deletions assets/css/layout/header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,6 @@
background-size: contain;
background-repeat: no-repeat;
}

.logo-link:after {
content: 'beta';
display: inline-block;
width: 37px;
height: 18px;
margin-top: 21px;
margin-left: 160px;
padding: 0 1px;
line-height: 19px;
font-size: 10px;
background-color: $gray-lighter;
border-radius: 15px;
}
}

.user-link {
Expand Down Expand Up @@ -315,11 +301,6 @@

.top-header {
padding: 0 20px 20px;

.logo-link:after {
margin-top: 21px;
margin-left: -3px;
}
}

.menu-item {
Expand Down
4 changes: 4 additions & 0 deletions assets/css/submissions/submissions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,7 @@
margin-left: auto;
margin-right: auto;
}

.icon-arrow {
background-image: url(../../images/ico-arrow-big-left.svg);
}
Loading