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

Bug Bash 1 Merge #991

Merged
merged 27 commits into from
Feb 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
7c1b889
fixes #906 infinite scolling for user challenges
shubhendusaurabh Jan 27, 2017
c3521a1
indicator on my-challenges
shubhendusaurabh Jan 28, 2017
c993945
fixes #952 hide others menu from top menu
shubhendusaurabh Jan 28, 2017
06037d8
Merge pull request #964 from shubhendusaurabh/issue-952
birdofpreyru Jan 29, 2017
dc823d2
fixes #906 removed load more from profile challenges
shubhendusaurabh Jan 30, 2017
20ae128
removed unsed vars
shubhendusaurabh Jan 30, 2017
688a6b7
Merge pull request #962 from shubhendusaurabh/issue-906
birdofpreyru Jan 30, 2017
19a651b
Fix for issue #946
gets0ul Jan 30, 2017
f3c8112
Merge pull request #970 from gets0ul/issue946_update_ui-router
birdofpreyru Jan 30, 2017
b2855ed
Fixed name of the Predix Badge
birdofpreyru Jan 31, 2017
80e730e
Merge branch 'hotfix/skill_picker_subscribed_community_visibility' in…
Feb 1, 2017
6308541
fixed #976 added min-width for badge modal
shubhendusaurabh Feb 1, 2017
ba3d0fb
Fix footer links for mobile view
ThomasKranitsas Feb 1, 2017
d4b32be
Merge pull request #977 from shubhendusaurabh/issue-976
birdofpreyru Feb 2, 2017
e56da76
fix to package.json
tladendo Feb 3, 2017
20f06a5
Merge pull request #981 from appirio-tech/tom-fix-packagejson
tladendo Feb 3, 2017
b97cb9d
fix issue 979
lijulat Feb 4, 2017
aef2991
Update footer.scss
lijulat Feb 4, 2017
27a05aa
A slight correction: added top padding to the footer in mobile layout
birdofpreyru Feb 5, 2017
49cdbdb
Merge pull request #978 from ThomasKranitsas/fix-footer
birdofpreyru Feb 5, 2017
8c13292
Merge pull request #982 from lijulat/dev
birdofpreyru Feb 5, 2017
efaf5b9
Fix /my-dashboard ENDS IN time counter issue
ThomasKranitsas Feb 6, 2017
a68f9bf
Merge pull request #986 from ThomasKranitsas/challenge-late-deliverables
birdofpreyru Feb 6, 2017
8f20d4a
fixed #987 added ios community badge
shubhendusaurabh Feb 6, 2017
316498e
Merge pull request #988 from shubhendusaurabh/issue-987
birdofpreyru Feb 6, 2017
8cc98f7
Merge branch 'master' into dev
ajefts Feb 8, 2017
80d9b3c
Fixed unit tests
birdofpreyru Feb 9, 2017
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
8 changes: 5 additions & 3 deletions app/account/logout/logout.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ import angular from 'angular'
describe('Logout Controller', function() {
var controller
var fakeWindow = {
// Without the `angular` field our fake window will crush
// `[email protected]` and higher!
angular: {
callbacks: {}
},
location: {
href: ''
}
Expand All @@ -15,14 +20,11 @@ describe('Logout Controller', function() {
angular.mock.module('tc.account', function($provide) {
$provide.value('$window', fakeWindow)
})

bard.inject(this, '$controller', 'TcAuthService', '$window', '$q', 'CONSTANTS')

bard.mockService(TcAuthService, {
logout: $q.when({}),
_default: $q.when({})
})

controller = $controller('LogoutController')
})

Expand Down
6 changes: 3 additions & 3 deletions app/directives/challenge-tile/challenge-tile.jade
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
.challenge-details
p.currentPhase {{challenge.userCurrentPhase}}

.challenge-calendar(ng-show="challenge.userCurrentPhaseEndTime")
p.ends-in Ends In
.challenge-calendar(ng-show="challenge.userCurrentPhaseEndTime", ng-class="{'challenge-late' : challenge.isLate}")
p.ends-in {{challenge.isLate ? 'Late for' : 'Ends In'}}
p.time-remaining {{challenge.userCurrentPhaseEndTime[0]}}
p.unit-of-time {{challenge.userCurrentPhaseEndTime[1]}}

Expand Down Expand Up @@ -88,7 +88,7 @@
p.roles(ng-hide="challenge.track === 'DATA_SCIENCE'") #[span Role: ] #[span {{challenge.userDetails.roles | listRoles}}]

.challenge-details
.challenge-info
.challenge-info(ng-class="{'challenge-late' : challenge.isLate}")
p.currentPhase {{challenge.userCurrentPhase}}

p.ends-in(ng-show="challenge.userCurrentPhaseEndTime") Ends: {{challenge.userCurrentPhaseEndTime[2] | localTime}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
div.paginator
tc-section(state="state")
button.tc-btn.tc-btn-s(ng-show="pageParams.totalCount > pageParams.currentCount", ng-click="loadMore()") Load More
button.tc-btn.tc-btn-s(ng-show="pageParams.totalCount > pageParams.currentCount && firstLoadMore", ng-click="loadMore()") Load More
2 changes: 1 addition & 1 deletion app/directives/tc-section/tc-section.jade
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
section(ng-switch="state")
.section-loading(ng-switch-when="loading")
.section-loading(ng-transclude, ng-switch-when="loading")

.section-error(ng-switch-when="error")
p {{errMsg}}
Expand Down
1 change: 0 additions & 1 deletion app/layout/footer/footer.jade
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
footer.bottom-footer
// Footer links
nav.menu-item
.menu-item-header.show-small OTHERS

ul.submenu
li.submenu-item #[a.menu-link(ng-href="https://www.{{domain}}/sitemap") SITE MAP]
Expand Down
13 changes: 8 additions & 5 deletions app/my-challenges/my-challenges.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import _ from 'lodash'
vm.loadMore = loadMore
vm.getChallenges = getChallenges
vm.totalCount = 0
vm.firstLoadMore = true
// this will help to keep track of pagination across individual api calls
var counts = {
devDesign: {total: 0, current: 0},
Expand Down Expand Up @@ -99,7 +100,7 @@ import _ from 'lodash'

function getDevDesignChallenges(offset) {
var params = {
limit: 12,
limit: CONSTANTS.CHALLENGES_LOADING_CHUNK,
offset: offset,
orderBy: vm.orderBy + ' desc',
filter: 'status=' + vm.statusFilter
Expand All @@ -125,7 +126,7 @@ import _ from 'lodash'
_filter = 'status=past&isRatedForMM=true'
}
var params = {
limit: 12,
limit: CONSTANTS.CHALLENGES_LOADING_CHUNK,
offset: offset,
orderBy: vm.statusFilter === 'active' ? 'startDate' : 'endDate desc',
filter: _filter
Expand All @@ -142,12 +143,14 @@ import _ from 'lodash'
}

function loadMore() {
currentOffset+=12
vm.getChallenges(currentOffset, false)
if (vm.loading === CONSTANTS.STATE_READY) {
currentOffset += CONSTANTS.CHALLENGES_LOADING_CHUNK
vm.getChallenges(currentOffset, false)
}
}

window.onscroll = function() {
if ((window.innerHeight + window.scrollY) >= document.body.offsetHeight) {
if ((window.innerHeight + window.scrollY) >= (document.body.offsetHeight - CONSTANTS.INFINITE_SCROLL_OFFSET)) {
if (vm.totalCount > vm.myChallenges.length) {
vm.loadMore()
}
Expand Down
2 changes: 2 additions & 0 deletions app/my-challenges/my-challenges.jade
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@
challenge-tile(
ng-repeat="challenge in vm.myChallenges | orderBy:vm.orderBy:true",
challenge="challenge", view="vm.view", ng-class="vm.view + '-view'")

tc-section.load-more-section(state="vm.loading")
6 changes: 6 additions & 0 deletions app/profile/badges/badges.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,12 @@ import moment from 'moment-timezone'
name: 'Predix Community',
groupClass: 'Predix-Community',
active: false
},
{
id: 1009,
name: 'iOS Community',
groupClass: 'iOS-Community',
active: false
}
]
}
Expand Down
20 changes: 17 additions & 3 deletions app/profile/subtrack/subtrack.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ import _ from 'lodash'
vm.showNav = showNav
vm.back = back
vm.subTrackStats = []

vm.loadMore = loadMore
vm.pageName = vm.subTrack

vm.tabs = ['statistics']

if (vm.track !== 'COPILOT') {
Expand All @@ -41,7 +40,7 @@ import _ from 'lodash'
// paging params, these are updated by tc-pager
vm.pageParams = {
currentOffset : 0,
limit: 16,
limit: CONSTANTS.CHALLENGES_LOADING_CHUNK,
currentCount: 0,
totalCount: 0,
// counter used to indicate page change
Expand Down Expand Up @@ -156,6 +155,21 @@ import _ from 'lodash'
$window.history.back()
}

function loadMore() {
if (vm.status.challenges === CONSTANTS.STATE_READY) {
vm.pageParams.currentOffset += CONSTANTS.CHALLENGES_LOADING_CHUNK
_getChallenges()
}
}

window.onscroll = function() {
if ((window.innerHeight + window.scrollY) >= (document.body.offsetHeight - CONSTANTS.INFINITE_SCROLL_OFFSET)) {
if (vm.pageParams.totalCount > vm.challenges.length) {
vm.loadMore()
}
}
}

function _getChallenges() {
vm.status.challenges = CONSTANTS.STATE_LOADING
var params = {
Expand Down
5 changes: 2 additions & 3 deletions app/services/blog.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import X2JS from 'xml2js'

// fetch blog rss feed
$http.get(CONSTANTS.BLOG_LOCATION)
.success(function(data) {
.then(function(data) {
// parse the blog rss feed using x2js
var parseString = X2JS.parseString
parseString(data.trim(), function (err, res) {
Expand All @@ -38,8 +38,7 @@ import X2JS from 'xml2js'

deferred.resolve(result)
})
})
.error(function(error) {
}, function(error) {
deferred.reject(error)
})

Expand Down
1 change: 1 addition & 0 deletions app/services/challenge.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ import moment from 'moment'
// Add actual time ['2', 'months', actual date]
timeAndUnit.push(fullTime)
challenge.userCurrentPhaseEndTime = timeAndUnit
challenge.isLate = moment().diff(fullTime) > 0 // If > 0 then the challenge has 'Late Deliverables' or
}
})
}
Expand Down
5 changes: 5 additions & 0 deletions app/services/helpers.service.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ const mockData = require('../../tests/test-helpers/mock-data')
describe('Helper Service', function() {

var fakeWindow = {
// Without the `angular` field our fake window will crush
// `[email protected]` and higher!
angular: {
callbacks: {}
},
location: {
href: '/'
},
Expand Down
5 changes: 5 additions & 0 deletions app/services/jwtInterceptor.service.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ describe('JWT Interceptor Service', function() {
})
},
fakeWindow = {
// Without the `angular` field our fake window will crush
// `[email protected]` and higher!
angular: {
callbacks: {}
},
location: ''
}

Expand Down
4 changes: 3 additions & 1 deletion app/topcoder.constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,7 @@ angular.module('CONSTANTS', []).constant('CONSTANTS', {
'REGISTERED' : 'REGISTERED',
'SUBMISSION_TYPE_CONTEST': 'Contest Submission',
'STATUS_ACTIVE' : 'Active',
'STATUS_COMPLETED_WITHOUT_WIN' : 'Completed Without Win'
'STATUS_COMPLETED_WITHOUT_WIN' : 'Completed Without Win',
'CHALLENGES_LOADING_CHUNK' : 36,
'INFINITE_SCROLL_OFFSET' : '400' // footer is 300px and challenge tile is 400px
})
3 changes: 3 additions & 0 deletions assets/css/directives/badge-tooltip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,9 @@
.Predix-Community {
background-position: -50px -672px;
}
.iOS-Community {
background-position: -95px -672px;
}
.Wireframe {
width: 31px;
background-position: 0px -1009px !important;
Expand Down
12 changes: 12 additions & 0 deletions assets/css/directives/challenge-tile.scss
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,12 @@ challenge-tile .challenge.tile-view {
text-transform: lowercase;
color: #7F7F7F;
}

&.challenge-late {
.ends-in, .time-remaining, .unit-of-time {
color: #ee6666;
}
}
}

.stalled-challenge {
Expand Down Expand Up @@ -462,6 +468,12 @@ challenge-tile .challenge.list-view {
font-size: 14px;
color: #A3A3AE;
}

&.challenge-late {
.ends-in, .time-remaining, .unit-of-time {
color: #ee6666;
}
}
}

.marathon-score {
Expand Down
1 change: 1 addition & 0 deletions assets/css/directives/tc-section.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

.section-loading {
width: 100%;
min-width: 50px;
min-height: 100px;
background: url(../../images/ripple.gif) no-repeat center center;
}
Expand Down
Loading