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

Qa integration #593

Merged
merged 92 commits into from
Dec 2, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
4e4fa38
SUP-1611, Settings: Support adding an external web link.
Oct 6, 2015
dbaaab5
Merge branch 'dev' into feature/sup-1611-web-link-support-ui
Oct 24, 2015
c84af59
major refactoring, moving data processing to services
Oct 26, 2015
5a62e35
more fixes
Oct 27, 2015
c254046
SUP-2481, intergrate-web-links-api
Nov 4, 2015
13b4020
SUP-2481, intergrate-web-links-api
Nov 6, 2015
6c57b2c
Merge branch 'dev' into feature/sup-2481-intergrate-web-links-api
Nov 10, 2015
a1df4e4
SUP-2481, intergrate-web-links-api
Nov 10, 2015
11583ef
Merge branch 'dev' into feature/sup-2481-intergrate-web-links-api
Nov 16, 2015
34eb382
SUP-2481, Integrate w/ API for External web links
Nov 16, 2015
8e7941b
SUP-2481, intergrate-web-links-api
Nov 16, 2015
39c198a
SUP-2481, intergrate-web-links-api
Nov 16, 2015
92d84b3
SUP-2481, intergrate-web-links-api
Nov 17, 2015
9692e5f
SUP-2481, intergrate-web-links-api
Nov 17, 2015
48af033
Merge branch 'dev' into feature/sup-2481-intergrate-web-links-api
Nov 18, 2015
6167b0b
SUP-2481, intergrate-web-links-api
Nov 18, 2015
333fb05
initial restructuring
tladendo Nov 23, 2015
79252b0
Added hover above bars
tladendo Nov 23, 2015
fda6af1
SUP-2481, intergrate-web-links-api
Nov 24, 2015
0b3e95d
Merge branch 'dev' into feature/sup-2481-intergrate-web-links-api
Nov 24, 2015
39a64a0
SUP-2740, [Registration] Typo on reg skill picker
Nov 24, 2015
bfd7b85
Merge pull request #576 from appirio-tech/feature/sup-2740-typo-skill…
Nov 24, 2015
5bf8927
Merge pull request #575 from appirio-tech/feature/SUP-2373
tladendo Nov 24, 2015
d6e1a02
Added correct link for MMs
tladendo Nov 24, 2015
fda7d42
Add appirio-styles to repo
Nov 24, 2015
556ddd2
Remove styleguide tasks and add external styles repo
Nov 24, 2015
b842cf3
Remove double array
Nov 25, 2015
95c6398
Remove old ui kit files
Nov 25, 2015
c84c359
Fix path for @imports
Nov 25, 2015
e36cdaf
fixed test
tladendo Nov 25, 2015
ca083b0
Merge pull request #577 from appirio-tech/feature/SUP-2670
tladendo Nov 25, 2015
6b9958a
added hover for subtrack navigation
tladendo Nov 25, 2015
0169719
placeholder 2
tladendo Nov 25, 2015
4a814e1
Updated month to be current
tladendo Nov 25, 2015
4e7c2ea
Merge pull request #580 from appirio-tech/feature/SUP-2665
tladendo Nov 25, 2015
d0e9eb9
Merge pull request #581 from appirio-tech/pullStylesRepo
nlitwin Nov 25, 2015
74017c4
placeholder 3
tladendo Nov 25, 2015
79a6cee
add ng-messages
tladendo Nov 25, 2015
4c510f9
Rest of cleanup for login
tladendo Nov 25, 2015
c2abe4c
SUP-2757, Remove scroll listener for tc-sticky directive to avoid mem…
Nov 27, 2015
5639756
SUP-1262, Clicking the hide/show password button should work on mobile
Nov 30, 2015
24ee23a
Merge pull request #586 from appirio-tech/feature/sup-1262-show-hide-…
Nov 30, 2015
03f2500
Merge pull request #578 from appirio-tech/feature/SUP-2376
tladendo Nov 30, 2015
6753076
Made properties more enum-like
tladendo Nov 30, 2015
0d48071
Merge pull request #584 from appirio-tech/feature/SUP-2592
tladendo Nov 30, 2015
94c2939
Merge pull request #556 from appirio-tech/feature/sup-2481-intergrate…
parthshah Nov 30, 2015
528bc3f
Fixed showing top placements
tladendo Nov 30, 2015
3e3f56e
Simplify
Nov 30, 2015
ebbf70f
Remove unused module
Nov 30, 2015
fc8994b
Move several tasks to their own file
Nov 30, 2015
4dd106a
Move tasks to individual files
Nov 30, 2015
c3bcee2
Merge branch 'dev' into organize-gulp
Nov 30, 2015
0ac0ee6
Restructure
Nov 30, 2015
1beeb0c
Remove devicon
Nov 30, 2015
44b4169
Remove devicon
Nov 30, 2015
bc25d04
Restructure
Nov 30, 2015
86e4b4c
Remove unused mixin and fix includes path
Nov 30, 2015
c8c65ba
Simplify to one clean
Nov 30, 2015
abf7bf4
Move images out to own file
Nov 30, 2015
885d3fe
Add single clean
Nov 30, 2015
0466036
Add simple clean
Nov 30, 2015
74d9339
Simplify clean and remove devicon
Nov 30, 2015
0f1362b
Move and refactor ngConstants gulp task
Nov 30, 2015
0039b79
Fix bugs
Nov 30, 2015
004fa4f
Remove images-orig-nav task and clean up images tasks
Nov 30, 2015
bc5d945
Move images and ngconstants out
Nov 30, 2015
79abf6e
Rename
Nov 30, 2015
f6982fb
Add run sequence
Nov 30, 2015
d59a593
Remove clean
Nov 30, 2015
9d0029c
Remove clean
Nov 30, 2015
aec9718
Move tests
Nov 30, 2015
7dd06d3
Move inject tasks
Nov 30, 2015
7f3a5f1
Fix typo
Nov 30, 2015
62192c1
Remove clean
Dec 1, 2015
90ce423
Remove clean
Dec 1, 2015
223918a
Renames and new dependencies
Dec 1, 2015
618e543
Move remaining tasks out
Dec 1, 2015
9488f0c
Move tasks out of gulpfile into individual files
Dec 1, 2015
f9c06b7
Merge pull request #588 from appirio-tech/organize-gulp
nlitwin Dec 1, 2015
e4f94d5
Rework tasks
Dec 1, 2015
fe781b8
Add sequencing
Dec 1, 2015
80e1527
Fix typo
Dec 1, 2015
b100dbf
Add callback to indicate task is done
Dec 1, 2015
cc4190e
Add asset prefix to fallback source
Dec 1, 2015
061e265
Merge pull request #587 from appirio-tech/feature/SUP-2739
tladendo Dec 1, 2015
2c82ba2
Remove double quotes
Dec 1, 2015
e1c4682
SUP-2481, intergrate-web-links-api
Dec 2, 2015
5a40dab
Merge pull request #589 from appirio-tech/feature/sup-2481-external-w…
Dec 2, 2015
6b52c4d
Merge pull request #585 from appirio-tech/feature/sup-2757-tc-sticky-…
Dec 2, 2015
017648d
SUP-2790, Weblink regular expression:--Able to add "http://aa" as a w…
Dec 2, 2015
750293a
Merge pull request #590 from appirio-tech/feature/sup-2481-external-w…
Dec 2, 2015
95cbe4f
update .version
tladendo Dec 2, 2015
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 .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.0.16
v1.0.17
105 changes: 63 additions & 42 deletions app/account/login/login.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,96 +3,116 @@

angular.module('tc.account').controller('LoginController', LoginController);

LoginController.$inject = ['$log', '$state', '$stateParams', '$location', '$scope', 'TcAuthService', 'AuthTokenService', 'UserService', 'NotificationService', 'Helpers', 'CONSTANTS'];
LoginController.$inject = ['$log', '$state', '$stateParams', '$location', '$scope', 'TcAuthService', 'UserService', 'NotificationService', 'Helpers', 'CONSTANTS'];

function LoginController($log, $state, $stateParams, $location, $scope, TcAuthService, AuthTokenService, UserService, NotificationService, Helpers, CONSTANTS) {
$log = $log.getInstance("LoginController");
function LoginController($log, $state, $stateParams, $location, $scope, TcAuthService, UserService, NotificationService, Helpers, CONSTANTS) {
var vm = this;
$log = $log.getInstance("LoginController");
vm.$stateParams = $stateParams;
vm.passwordReset = false;
vm.usernameExists = true;
vm.currentPasswordDefaultPlaceholder = "Password";
vm.loginErrors = {
USERNAME_NONEXISTANT: false,
WRONG_PASSWORD: false,
SOCIAL_LOGIN_ERROR: false
};

vm.login = login;
vm.socialLogin = socialLogin;

// reference for main vm
var mainVm = $scope.$parent.main;

if ($stateParams.notifyReset) {
NotificationService.inform('Your new password has been set. Please log in. If you have any trouble, please contact [email protected].');
}
activate();

function _doLogin(usernameOrEmail, password) {
return TcAuthService.login(usernameOrEmail, password).then(
function(data) {
// success
$log.debug('logged in');
// setup login event for analytics tracking
Helpers.setupLoginEventMetrices(usernameOrEmail);
return Helpers.redirectPostLogin($stateParams.next);
})
.catch(function(resp) {
$log.warn(resp);
switch (resp.status) {
case "ACCOUNT_INACTIVE":
$state.go('registeredSuccessfully');
// user should already be redirected
break;
case "UNKNOWN_ERROR":
default:
vm.wrongPassword = true;
vm.password = '';
}
});
function activate() {
if ($stateParams.notifyReset) {
NotificationService.inform('Your new password has been set. Please log in. If you have any trouble, please contact [email protected].');
}
}

vm.login = function() {
vm.usernameExists = true;
vm.wrongPassword = false;
function login() {
vm.loginErrors.USERNAME_NONEXISTANT = false;
vm.loginErrors.WRONG_PASSWORD = false;

// TODO ideally it should be done by dedicated directive to handle all outside clicks
mainVm.menuVisible = false;

if (Helpers.isEmail(vm.username)) {
// the user is loggin in using email
vm.emailOrUsername = 'email';

// ensure email exists
// uses same validity check as registration
// valid => email isn't already used by someone
UserService.validateUserEmail(vm.username).then(function(data) {
if (data.valid) {
// email doesn't exist
vm.usernameExists = false;
vm.loginErrors.USERNAME_NONEXISTANT = true;
} else {
vm.usernameExists = true;
_doLogin(vm.username, vm.currentPassword);
}
}).catch(function(resp) {
// TODO handle error
// assume email exists, login would in any case if it didn't
vm.usernameExists = true;
vm.loginErrors.USERNAME_NONEXISTANT = false;
_doLogin(vm.username, vm.currentPassword);
});
} else {
// the user is logging in using a username
vm.emailOrUsername = 'username';

// username - make sure it exists
UserService.validateUserHandle(vm.username).then(function(data) {
if (data.valid) {
// username doesn't exist
vm.usernameExists = false;
vm.loginErrors.USERNAME_NONEXISTANT = true;
} else {
vm.usernameExists = true;
_doLogin(vm.username, vm.currentPassword);
}
}).catch(function(resp) {
// TODO handle error
// assume email exists, login would in any case if it didn't
vm.usernameExists = true;
_doLogin(vm.username, vm.currentPassword);
});
}
};

vm.socialLogin = function(backend) {
var params = {}, callbackUrl;
function _doLogin(usernameOrEmail, password) {
return TcAuthService.login(usernameOrEmail, password).then(function(data) {
// success
$log.debug('logged in');

// setup login event for analytics tracking
Helpers.setupLoginEventMetrics(usernameOrEmail);
return Helpers.redirectPostLogin($stateParams.next);

}).catch(function(resp) {
$log.warn(resp);
switch (resp.status) {
case "ACCOUNT_INACTIVE":
$state.go('registeredSuccessfully');
// user should already be redirected
break;
case "UNKNOWN_ERROR":
default:
vm.loginErrors.WRONG_PASSWORD = true;
vm.password = '';
}
});
}

function socialLogin(platform) {
// we need to pass on the 'next' param if we have one
var params = {};
if ($stateParams.next) {
params = {next: $stateParams.next};
}
callbackUrl = $state.href('login', params, {absolute: true});
TcAuthService.socialLogin(backend, callbackUrl)

// redirect back to login
var callbackUrl = $state.href('login', params, {absolute: true});

TcAuthService.socialLogin(platform, callbackUrl)
.then(function() {
$log.debug('logged in');
return Helpers.redirectPostLogin($stateParams.next);
Expand All @@ -104,6 +124,7 @@
case "USER_NOT_REGISTERED":
default:
vm.socialLoginError = 401;
vm.loginErrors.SOCIAL_LOGIN_ERROR = true;
break;
}
});
Expand Down
10 changes: 5 additions & 5 deletions app/account/login/login.jade
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
h1 LOG IN TO TOPCODER

form(name="vm.loginForm", role="form", ng-submit="vm.loginForm.$valid && vm.login()", novalidate)
.form-errors
p.form-error(ng-hide="vm.usernameExists") We couldn't find a member with that {{vm.emailOrUsername || "username"}}. Please check that you entered it correctly.
.form-errors(ng-messages="vm.loginErrors")
p.form-error(ng-message="USERNAME_NONEXISTANT") We couldn't find a member with that {{vm.emailOrUsername || "username"}}. Please check that you entered it correctly.

p.form-error(ng-show="vm.wrongPassword") That password is incorrect. Please check that you entered the right one.
p.form-error(ng-message="WRONG_PASSWORD") That password is incorrect. Please check that you entered the right one.

p.form-error(ng-show="vm.socialLoginError === 401") User with that profile is not registered.
p.form-error(ng-message="SOCIAL_LOGIN_ERROR") User with that profile is not registered.

div.validation-bar(ng-class="{'error-bar': !vm.usernameExists}")
div.validation-bar(ng-class="{'error-bar': vm.loginErrors.USERNAME_NONEXISTANT}")
input(ng-model="vm.username", name="username", placeholder="Username or Email", type="text", required)

toggle-password
Expand Down
2 changes: 1 addition & 1 deletion app/community/members.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
ctrl.notSearch = true;
ctrl.showing = 'list';
ctrl.domain = CONSTANTS.domain;
ctrl.currentMonth = 'October 2015';
ctrl.currentMonth = 'November 2015';
ctrl.memberLeaderboard = [];
ctrl.copilots = [];
CommunityDataService.getMembersData()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
if (relatedTarget.attr('type') === 'checkbox' && relatedTarget.attr('id') === 'currentPasswordCheckbox') {
vm.currentPasswordFocus = true;
vm.currentPasswordPlaceholder = '';
currentPasswordInput.focus();
} else {
// If you are blurring from the password input and clicking anywhere but the checkbox
vm.currentPasswordFocus = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ input#current-password-input(
ng-model="vm.currentPassword",
ng-model-options="{allowInvalid: true}",

focus-on="focusOnCurrentPasswordInput",
ng-focus="vm.onCPFocus($event)",
ng-blur="vm.onCPBlur($event)",

Expand Down
2 changes: 1 addition & 1 deletion app/directives/badges/badge-tooltip.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* jshint -W117, -W030 */
describe('Badge Tooltiop Directive', function() {
describe('Badge Tooltip Directive', function() {
var scope;
var element;
var badge = mockData.getMockBadge();
Expand Down
6 changes: 4 additions & 2 deletions app/directives/challenge-tile/challenge-tile.directive.jade
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
// Only show if not data science track
p.roles
span(ng-hide="challenge.track === 'DATA_SCIENCE'")
#[span Role: ] #[span {{challenge.userDetails.roles | listRoles}}]
span Role:  
span {{challenge.userDetails.roles | listRoles}}

.completed-challenge(
ng-show="challenge.status === 'COMPLETED' || challenge.status === 'PAST'",
Expand Down Expand Up @@ -66,7 +67,8 @@
// Only show if not data science track
p.roles
span(ng-hide="challenge.track === 'DATA_SCIENCE'")
#[span Role: ] #[span {{challenge.userDetails.roles | listRoles}}]
span Role:  
span {{challenge.userDetails.roles | listRoles}}

.challenge.list-view(ng-show="view=='list'", ng-class="challenge.track")
.active-challenge(ng-show="challenge.status === 'ACTIVE'")
Expand Down
21 changes: 17 additions & 4 deletions app/directives/distribution-graph/distribution-graph.directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,18 +178,31 @@
})
.attr('fill', function(d) {
return ratingToColor($scope.colors, d.start);
});

svg.selectAll('rect.hover')
.data(ranges)
.enter()
.append('rect')
.attr('class', 'hover')
.attr('fill', 'transparent')
.attr('x', function(d, i) {
return xScale(i);
})
.attr('y', function(d) {
return padding.top;
})
.attr('width', xScale.rangeBand())
.attr('height', function(d) {
return totalH - padding.bottom - padding.top;
})
.on('mouseover', function(d) {
d3.select(this)
.attr('fill', ratingToDarkerColor($scope.colors, d.start));
$scope.highlightedRating = d.start;
$scope.displayCoders = true;
$scope.numCoders = d.number;
$scope.$digest();
})
.on('mouseout', function(d) {
d3.select(this)
.attr('fill', ratingToColor($scope.colors, d.start));
$scope.displayCoders = false;
$scope.highlightedRating = false;
$scope.$digest();
Expand Down
Loading