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

Commit ff92986

Browse files
author
Victor George
committed
Merge branch 'dev' of https://github.com/appirio-tech/topcoder-app into forms-refactor
# By Parth Shah (4) and others # Via Parth Shah (8) and others * 'dev' of https://github.com/appirio-tech/topcoder-app: SUP-2286, [Registration] Skill picker issue added some safeguards fixing skill icon reverted back based on review with community team Cutting member of month and moving copilots up Updated Arena to Competitive Programming Update communityData.service.js using rootscope to udpate page header directive & header controller on image / profile chnage enabling introjs and remove element selection as per anuj's request adding community home
2 parents 65735ef + 7bcd608 commit ff92986

File tree

14 files changed

+49
-88
lines changed

14 files changed

+49
-88
lines changed

app/community/community.controller.js

Lines changed: 0 additions & 16 deletions
This file was deleted.

app/community/community.routes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
'community': {
1515
parent: 'root',
1616
url: '/community/',
17+
abstract: true,
1718
data: {
1819
authRequired: false,
19-
},
20-
controller: 'BaseCommunityController'
20+
}
2121
},
2222
'community.members': {
2323
parent: 'root',

app/directives/busy-button/busy-button.directive.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
scope);
2424
element.attr('disabled', true).html('').append(busyMessageHtml);
2525
} else {
26-
// remove the disabled attribute only if either element does not have ng-disabled set
26+
// remove the disabled attribute only if either element does not have disabled set
2727
// or it evaluates to false
28-
if (!attr.ngDisabled || !$parse(attr.ngDisabled)) {
28+
if (!attrs.disabled) {
2929
element.removeAttr('disabled').html(scope.originalContent);
3030
}
3131
}

app/directives/challenge-user-place/design-challenge-user-place.directive.jade

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
p.place(ng-show="challenge.userStatus === 'PASSED_SCREENING'") Passed Screening
55
p.place(ng-show="challenge.userStatus === 'COMPLETED'") COMPLETED
66

7-
.thumbnail(ng-click="openLightbox()", ng-class="{hidden: challenge.userStatus !== 'PASSED_REVIEW'}")
8-
img(ng-src="{{imageURL}}", fallback-src="/images/ico-picture.svg")
7+
.thumbnail(ng-click="imageURL && openLightbox()", ng-class="{hidden: challenge.userStatus !== 'PASSED_REVIEW'}")
8+
img(ng-src="{{imageURL || '/images/ico-picture.svg'}}", fallback-src="/images/ico-picture.svg")
99

10-
.thumbnail-gallery(ng-click="openLightbox()")
10+
.thumbnail-gallery(ng-click="imageURL && openLightbox()")
1111
.gallery-icon
1212

1313
.num-images 1 image

app/directives/page-state-header/page-state-header.directive.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
hideMoney: '=',
1414
defaultState: '@'
1515
},
16-
controller: ['$scope', 'NotificationService', 'ProfileService', '$log', '$state', pageStateHeader],
16+
controller: ['CONSTANTS', '$rootScope', '$scope', 'NotificationService', 'ProfileService', '$log', '$state', pageStateHeader],
1717
controllerAs: "vm"
1818
};
1919
});
2020

21-
function pageStateHeader($scope, NotificationService, ProfileService, $log, $state) {
21+
function pageStateHeader(CONSTANTS, $rootScope, $scope, NotificationService, ProfileService, $log, $state) {
2222
var vm = this;
2323
vm.handle = $scope.handle;
2424
vm.profile = null;
@@ -31,12 +31,16 @@
3131
vm.backHandler = backHandler;
3232
activate();
3333

34+
// watch for profile update event in case handle/image are updated
35+
$rootScope.$on(CONSTANTS.EVENT_PROFILE_UPDATED, function() {
36+
activate();
37+
});
38+
3439
function activate() {
3540
vm.loading = true;
3641

3742
// identifies the previous state
3843
if ($scope.$root.previousState && $scope.$root.previousState.name.length > 0) {
39-
console.log($scope.$root.previousState);
4044
vm.previousState = $scope.$root.previousState;
4145
vm.previousStateName = vm.previousState.name;
4246
} else if ($scope.defaultState) {

app/index.jade

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ html
175175
script(src="blocks/logger/logEnhancer.js")
176176
script(src="blocks/logger/logger.js")
177177
script(src="community/community.module.js")
178-
script(src="community/community.controller.js")
179178
script(src="community/community.routes.js")
180179
script(src="community/members.controller.js")
181180
script(src="community/statistics.controller.js")

app/layout/header/header.controller.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
angular.forEach([
3333
CONSTANTS.EVENT_USER_LOGGED_IN,
3434
CONSTANTS.EVENT_USER_LOGGED_OUT,
35+
CONSTANTS.EVENT_PROFILE_UPDATED
3536
], function(event) {
3637
$rootScope.$on(event, function() {
3738
initHeaderProps(event);

app/services/communityData.service.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,17 @@
7171
var deferred = $q.defer();
7272
var data = {
7373
"SRMWinners": [{
74-
"avatar": "http://www.topcoder.com/i/m/tourist.jpeg",
75-
"name": "tourist",
76-
"date": "20151014T000000Z",
77-
"country": "Belarus",
78-
"contests": ["SRM 671 DIVISION 1 WINNER"]
74+
"avatar": "https://s3.amazonaws.com/app.topcoder-dev.com/images/ico-user-default.7aa28736.svg",
75+
"name": "xudyh",
76+
"date": "20151020T000000Z",
77+
"country": "China",
78+
"contests": ["SRM 672 DIVISION 1 WINNER"]
7979
}, {
80-
"avatar": "https://www.topcoder.com/i/m/thegunner2401.jpeg",
81-
"name": "thegunner2401",
82-
"date": "20151014T000000Z",
83-
"country": "Viet Nam",
84-
"contests": ["SRM 671 DIVISION 2 WINNER"]
80+
"avatar": "https://s3.amazonaws.com/app.topcoder-dev.com/images/ico-user-default.7aa28736.svg",
81+
"name": "jiangshibiao2",
82+
"date": "20151020T000000Z",
83+
"country": "China",
84+
"contests": ["SRM 672 DIVISION 2 WINNER"]
8585
}],
8686
"MarathonWinner": [{
8787
"avatar": "http://www.topcoder.com/i/m/eldidou.jpeg",

app/services/introduction.service.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,17 @@
8181
intro: 'Welcome to the new Topcoder Profile. To make this the premier place to showcase skills, we have reimagined this page and introduced several new features.'
8282
},
8383
{
84-
element: '#skills',
84+
// element: '#skills',
8585
intro: 'The quickest way to understand a member’s skills. It includes languages, environments, frameworks, libraries, platforms, tools, and any other technologies that you know well.',
8686
position: 'top'
8787
},
8888
{
89-
element: '#tcActivity',
89+
// element: '#tcActivity',
9090
intro: 'Topcoder activity, ratings and other statistics now live in this section. See the active sub-tracks and click on them for even more details and history.',
9191
position: 'top'
9292
},
9393
{
94-
element: '#externalLinks',
94+
// element: '#externalLinks',
9595
intro: 'Best of member’s presence on the web will be highlighted here. Show off your work and experience outside of Topcoder by connecting accounts or adding links.',
9696
position: 'top'
9797
}
@@ -103,12 +103,12 @@
103103
intro: 'Welcome to the new Sub-track details page. This page contains activity in this track and in-depth metrics in an easy-to-understand way.'
104104
},
105105
{
106-
element: '#subtrack-stats',
106+
// element: '#subtrack-stats',
107107
intro: 'Find the most important metrics here to understand performance in a glance. You can scroll below to see charts and more in-depth metrics to get a very granular understanding of the activity in this subtrack.',
108108
position: 'bottom'
109109
},
110110
{
111-
element: '#challenges-tab',
111+
// element: '#challenges-tab',
112112
intro: 'This sections contains all the completed challenges, in order of success.',
113113
position: 'top'
114114
}
@@ -121,32 +121,32 @@
121121
intro: 'Welcome to your new Topcoder Dashboard. We have revamped the dashboard to bring to fore the information that matters to you. Let us walk you through some of the new things to help you keep on top of your Topcoder activity.'
122122
},
123123
{
124-
element: '#metrics',
124+
// element: '#metrics',
125125
intro: 'Quickly glance your active challenges and money earned, and click on them to see more in detail.',
126126
position: 'bottom'
127127
},
128128
{
129-
element: '#stats',
129+
// element: '#stats',
130130
intro: 'Keep on top of how you are faring vs rest of the community with the rating here.',
131131
position: 'top'
132132
},
133133
{
134-
element: '#challenges',
134+
// element: '#challenges',
135135
intro: 'All your active challenges can be found here. See the phase, and activity on here, or click on them to go to the challenge details. You can view these in a grid or list view.',
136136
position: 'top'
137137
},
138138
{
139-
element: '#viewAllChallenges',
139+
// element: '#viewAllChallenges',
140140
intro: 'Want to see more of the challenges? Or look up a past one? Click on the buttons here to see all of your challenges.',
141141
position: 'top'
142142
},
143143
{
144-
element: '#srms',
144+
// element: '#srms',
145145
intro: 'Keep track of the SRMs being scheduled, and find easy links to past problems, editorial and the Arena.',
146146
position: 'top'
147147
},
148148
{
149-
element: '#community',
149+
// element: '#community',
150150
intro: 'Don’t miss out on the latest happenings in our community. Blogs, Events, Member Programs and more!',
151151
position: 'top'
152152
}

app/services/nav.service.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
{ 'href': "/challenges/design/active/?pageIndex=1", 'text': 'DESIGN CHALLENGES', 'icon': '/images/nav/track-design.svg' },
2020
{ 'href': "/challenges/develop/active/?pageIndex=1", 'text': 'DEVELOPMENT CHALLENGES', 'icon': '/images/nav/track-develop.svg' },
2121
{ 'href': "/challenges/data/active/?pageIndex=1", 'text': 'DATA SCIENCE CHALLENGES', 'icon': '/images/nav/track-data.svg' },
22-
{ 'href': CONSTANTS.ARENA_URL, 'text': 'COMPETITIVE PROGRAMMING', 'icon': '/images/nav/track-cp.svg', 'target': '_blank' },
22+
{ 'href': CONSTANTS.ARENA_URL, 'text': 'COMPETITIVE PROGRAMMING', 'icon': '/images/nav/track-cp.svg', 'target': '_blank' }
2323
],
2424
'learn': [
2525
{ 'href': '/getting-started/', 'text': 'GETTING STARTED', 'icon': '/images/nav/rocket.svg' },
@@ -29,6 +29,7 @@
2929
{ 'href': '/community/competitive%20programming/', 'text': 'COMPETITIVE PROGRAMMING', 'icon': '/images/nav/book-cp.svg' },
3030
],
3131
'community': [
32+
{ 'sref': 'community', 'text': 'HOME', 'icon': '/images/nav/community.svg' },
3233
{ 'sref': 'community.members', 'text': 'MEMBERS', 'icon': '/images/nav/members.svg' },
3334
{ 'href': '/community/member-programs/', 'text': 'PROGRAMS', 'icon': '/images/nav/programs.svg' },
3435
{ 'href': CONSTANTS.FORUMS_APP_URL, 'text': 'FORUMS', 'icon': '/images/nav/forums.svg', 'target': '_blank' },

app/services/profile.service.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
angular.module('tc.services').factory('ProfileService', ProfileService);
55

6-
ProfileService.$inject = ['CONSTANTS', 'ApiService', 'UserService', '$q', '$filter'];
6+
ProfileService.$inject = ['CONSTANTS', 'ApiService', 'UserService', '$q', '$filter', '$rootScope'];
77

8-
function ProfileService(CONSTANTS, ApiService, UserService, $q, $filter) {
8+
function ProfileService(CONSTANTS, ApiService, UserService, $q, $filter, $rootScope) {
99

1010
var restangular = ApiService.restangularV3;
1111

@@ -42,7 +42,11 @@
4242
}
4343

4444
function updateUserProfile(userData) {
45-
return userData.save();
45+
return userData.save().then(function(resp) {
46+
// notify listeners of profile update event
47+
$rootScope.$broadcast(CONSTANTS.EVENT_PROFILE_UPDATED);
48+
return resp;
49+
});
4650
}
4751

4852
function getUserSkills(username) {

app/settings/edit-profile/edit-profile.controller.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
angular.module('tc.settings').controller('EditProfileController', EditProfileController);
55

66

7-
EditProfileController.$inject = ['userData', 'userHandle', 'ProfileService', 'ExternalAccountService', '$log', 'ISO3166', 'ImageService', 'CONSTANTS', 'TagsService', 'toaster', '$scope'];
7+
EditProfileController.$inject = ['$rootScope', 'userData', 'userHandle', 'ProfileService', 'ExternalAccountService', '$log', 'ISO3166', 'ImageService', 'CONSTANTS', 'TagsService', 'toaster', '$scope'];
88

9-
function EditProfileController(userData, userHandle, ProfileService, ExternalAccountService, $log, ISO3166, ImageService, CONSTANTS, TagsService, toaster, $scope) {
9+
function EditProfileController($rootScope, userData, userHandle, ProfileService, ExternalAccountService, $log, ISO3166, ImageService, CONSTANTS, TagsService, toaster, $scope) {
1010
$log = $log.getInstance("EditProfileCtrl");
1111
var vm = this;
1212
vm.toggleTrack = toggleTrack;
@@ -112,6 +112,7 @@
112112
.then(ImageService.createFileRecord)
113113
.then(function(newPhotoURL) {
114114
vm.userData.photoURL = newPhotoURL;
115+
$rootScope.$broadcast(CONSTANTS.EVENT_PROFILE_UPDATED);
115116
});
116117
}
117118

app/topcoder.controller.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@
3030
$rootScope.$on('$stateChangeSuccess', function(evt, toState, toParams, fromState, fromParams) {
3131
$document[0].body.scrollTop = $document[0].documentElement.scrollTop = 0;
3232

33-
vm.introOptions = {};
34-
// vm.introOptions = IntroService.getCurrentPageOptions();
33+
vm.introOptions = IntroService.getCurrentPageOptions();
3534

3635
$timeout(function() {
3736
if (vm.introOptions) {

assets/images/skills/id-322.svg

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)