Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
585803e
AS:100624428182393, Create a modified Dashboard banner for TCO
Mar 16, 2016
3e9b92d
AS:100624428182393, Create a modified Dashboard banner for TCO
Mar 16, 2016
e31c52d
AS:100624428182393, Create a modified Dashboard banner for TCO
Mar 16, 2016
0e6d9e7
Add view my submissions button
Mar 16, 2016
46d5804
Use .gitignore for ignore path
Mar 16, 2016
8003f39
Fix margins
Mar 16, 2016
b283f87
Merge pull request #749 from appirio-tech/dev
nlitwin Mar 16, 2016
8c23432
Update button text
Mar 16, 2016
7942fbb
Merge commit '8c234320d3df5ada8e9508b02f64db4a841e6258' into HEAD
Mar 16, 2016
3c7d819
Merge pull request #748 from appirio-tech/feature/tco-banner
Mar 17, 2016
1a15fe4
AS:100624428182393, Create a modified Dashboard banner for TCO
Mar 17, 2016
fea65aa
Merge pull request #750 from appirio-tech/feature/tco-banner
Mar 17, 2016
6c44f87
Merge commit 'fea65aa91a35607ea31b18f0624060bf85c6dd24' into HEAD
Mar 17, 2016
06e9642
Add fonts to topcoder app
Mar 18, 2016
e8345ac
Add babel-polyfill to entrypoint
Mar 18, 2016
b42513a
Add member search module to topcoder angular app
Mar 18, 2016
257576a
Add override styles to fix member search inside angular
Mar 18, 2016
fe0ebdb
Add babel-polyfill, redux-logger, topcoder-app-r to package.json
Mar 18, 2016
311bcbc
Add member search angular module that wraps React member search
Mar 18, 2016
f23dc65
Add module to tests
Mar 18, 2016
76f7296
Merge pull request #751 from appirio-tech/add-member-search
nlitwin Mar 18, 2016
f0f098f
Replace path with new search link
Mar 18, 2016
55819f6
Use new version of member serach
Mar 18, 2016
b2346b1
Move to import syntax
Mar 18, 2016
95c98a7
Add vic's changes - new image, not upper case title
Mar 18, 2016
e5e26cf
Set max width to title
Mar 18, 2016
959e0bf
Merge pull request #752 from appirio-tech/progress-modal
nlitwin Mar 18, 2016
23d1fbc
Merge commit '959e0bf523bee7a42db9147ef228d74931c102af' into HEAD
Mar 18, 2016
215c1ea
AS#101110714058011, User cannot add custom URL to profile
Mar 21, 2016
fb7bf26
Merge pull request #753 from appirio-tech/feature/long-tld-support
Mar 21, 2016
b6de098
Merge commit 'fb7bf26523c34ea61933378fea1b54679c37042f' into HEAD
Mar 21, 2016
5201ad6
AS#100624428182393, Create a modified Dashboard banner for TCO
Mar 24, 2016
8035786
Merge pull request #754 from appirio-tech/feature/tco-banner
Mar 24, 2016
86a3b6a
Merge commit '8035786050addfc3f893f3e9f3ec794730224bf2' into HEAD
Mar 24, 2016
6e18a3e
Update member search package
Mar 25, 2016
2e838b0
Merge branch 'dev' of https://github.com/appirio-tech/topcoder-app in…
Mar 25, 2016
930a474
Only show header for member search - no footer
Mar 25, 2016
705873c
Add empty footer
Mar 25, 2016
4f3abe0
Merge commit '705873c68806a6bb708c938278ee49051856bf8f' into HEAD
Mar 25, 2016
001fe7a
Update repository description
nlitwin Mar 28, 2016
276ed05
Merge pull request #755 from appirio-tech/dev
nlitwin Mar 28, 2016
33f69ba
Trigger travis
Mar 30, 2016
34dafcc
Merge commit '33f69ba1a6a24f041f4417d7a4e27bae9b60cb19' into HEAD
Mar 30, 2016
d39f84a
Trigger travis build
Mar 31, 2016
9290798
Update url maxlength
Mar 31, 2016
b169811
Merge commit '9290798c0b2e24d3fe13ab29a23e791bdc3e6234' into HEAD
Mar 31, 2016
b34d9fe
Trigger travis build
Apr 1, 2016
9618c29
Remove page-wide min-width
Apr 1, 2016
ddfa94b
Trigger travis build
Apr 1, 2016
5b2ac25
Merge commit 'ddfa94b621ff0561f7701a3493a9691bf09f91a7' into HEAD
Apr 1, 2016
5563c22
Fix conversion error to actually be 500MB
Apr 5, 2016
fb215de
Merge commit '5563c220db4164fdc6d7b75656a5dad33d7bd475' into HEAD
Apr 5, 2016
1728e94
Build travis
Apr 6, 2016
fbc847a
Test with console logs
Apr 6, 2016
fd88d3d
Disable linting for console
Apr 6, 2016
92d90c6
f
nlitwin Apr 6, 2016
8bb9944
Merge pull request #757 from appirio-tech/dev
nlitwin Apr 6, 2016
29c2abd
revert
nlitwin Apr 6, 2016
c0ac438
Merge pull request #758 from appirio-tech/dev
nlitwin Apr 6, 2016
35bdf69
Remove console logs
Apr 6, 2016
d7f4521
Merge branch 'qa-integration' of https://github.com/appirio-tech/topc…
Apr 6, 2016
1497e5c
Trigger travis build for picking up member search animations
Apr 7, 2016
32ba648
Trigger travis build for picking up member search animation bug fix
Apr 7, 2016
5a2d7c6
Merge pull request #759 from appirio-tech/dev
nlitwin Apr 7, 2016
53278aa
Trigger travis build
Apr 8, 2016
3f3bcc3
Trigger travis build for default avatars
Apr 8, 2016
70175c9
Trigger travis build for default avatars
Apr 8, 2016
be44c18
Merge commit '70175c9efa883a248f3d43d2fa7f265f7e2a3cc8' into HEAD
Apr 8, 2016
180956d
Log errors to new relic
Apr 11, 2016
6b0c7a8
Fix typo
Apr 11, 2016
8289cce
Remove debugger
Apr 11, 2016
29e7e63
Fix orderBy error
Apr 11, 2016
ee4349b
Add back accidentally deleted line
Apr 11, 2016
1d02080
AS#111130683709862, Topcoder Team Live banner (for Friday broadcast)
Apr 12, 2016
ff875fc
Merge pull request #761 from appirio-tech/feature/ttl-banner
Apr 12, 2016
4085d34
Fix typo
nlitwin Apr 12, 2016
9207018
Remove Chrome=1, which is obsolete
Apr 12, 2016
b985fc5
Update to remove
Apr 12, 2016
e13b7bc
Merge pull request #760 from appirio-tech/newrelic-errors
nlitwin Apr 12, 2016
173b5f4
Trigger travis build for member search updates
Apr 12, 2016
c276ddd
Merge commit '173b5f46e87c0632fa257d421dea440e13549c57' into HEAD
Apr 12, 2016
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#### Dev [![Build Status](https://travis-ci.org/appirio-tech/topcoder-app.svg?branch=dev)](https://travis-ci.org/appirio-tech/topcoder-app) QA [![Build Status](https://travis-ci.org/appirio-tech/topcoder-app.svg?branch=qa-integration)](https://travis-ci.org/appirio-tech/topcoder-app) Master [![Build Status](https://travis-ci.org/appirio-tech/topcoder-app.svg?branch=master)](https://travis-ci.org/appirio-tech/topcoder-app)
# Topcoder-App

This repository houses any new topcoder pages or refactored Angular apps/pages from the tc-site repository.
Topcoder-App is an Angular application that contains dashboard, profile, settings, login/registration, and design submissions.

The technologies used are NPM, Webpack, ES2015, Jade, SCSS, and Angular 1.x.

Expand All @@ -13,7 +13,7 @@ Install dependencies by running the following in the root of the project:
- `npm i`
- **Note:** You must use npm 3. Type `npm -v` to ensure you have a 3.x version.

In order to test a logged in user, you must make an entry in your `/etc/hosts` file, pointing `local.topcoder-dev.com` to `localhost`. For example, open your `/etc/hosts` file with something like `vim /etc/hosts` and add `127.0.0.1 local.topcoder-dev.com`. After you run `gulp serve`, which launches a new window or tab, change `http://localhost:3000/login/` to `http://local.topcoder-dev.com:3000/login/`. You will then be able to login and pick up information from the cookies with `.topcoder-dev.com` as the domain.
In order to test a logged in user, you must make an entry in your `/etc/hosts` file, pointing `local.topcoder-dev.com` to `localhost`. For example, open your `/etc/hosts` file with something like `vim /etc/hosts` and add `127.0.0.1 local.topcoder-dev.com`.

## NPM Commands
- To run locally: `npm start` and head to `local.topcoder-dev.com:3000/login`
Expand Down
6 changes: 0 additions & 6 deletions app/account/account.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,4 @@ import angular from 'angular'
]

angular.module('tc.account', dependencies)
.config(['$provide',function ($provide) {
$provide.decorator('$log', ['$delegate', 'LogEnhancer', function ($delegate, LogEnhancer) {
LogEnhancer.enhanceLogger($delegate)
return $delegate
}])
}])
})()
4 changes: 2 additions & 2 deletions app/account/account.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ import angular from 'angular'
data: {
authRequired: false
},
onEnter: ['$state', '$stateParams', 'TcAuthService', '$log', function($state, $stateParams, TcAuthService, $log) {
onEnter: ['$state', '$stateParams', 'TcAuthService', 'logger', function($state, $stateParams, TcAuthService, logger) {
if (TcAuthService.isAuthenticated()) {
// redirect to next if exists else dashboard
if ($stateParams.next) {
$log.debug('Redirecting: ' + $stateParams.next)
logger.debug('Redirecting: ' + $stateParams.next)
window.location.href = decodeURIComponent($stateParams.next)
} else {
$state.go('dashboard')
Expand Down
54 changes: 27 additions & 27 deletions app/account/login/login.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ import angular from 'angular'

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

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

function LoginController($log, $state, $stateParams, $location, $scope, TcAuthService, UserService, Helpers, CONSTANTS) {
function LoginController(logger, $state, $stateParams, $location, $scope, TcAuthService, UserService, Helpers, CONSTANTS) {
var vm = this
$log = $log.getInstance('LoginController')
vm.$stateParams = $stateParams
vm.passwordReset = false
vm.loginErrors = {
Expand Down Expand Up @@ -76,27 +75,28 @@ import angular from 'angular'
}

function _doLogin(usernameOrEmail, password) {
return TcAuthService.login(usernameOrEmail, password).then(function(data) {
// success
$log.debug('logged in')
return TcAuthService.login(usernameOrEmail, password)
.then(function(data) {
// setup login event for analytics tracking
Helpers.setupLoginEventMetrics(usernameOrEmail)
return Helpers.redirectPostLogin($stateParams.next)

// 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 = ''
}
})
})
.catch(function(err) {
logger.warning(err)

switch (err.status) {
case 'ACCOUNT_INACTIVE':
$state.go('registeredSuccessfully')
// user should already be redirected
break
case 'UNKNOWN_ERROR':
default:
vm.loginErrors.WRONG_PASSWORD = true
vm.password = ''
logger.error('Error logging in: ', err)
}
})
}

function socialLogin(platform) {
Expand All @@ -111,19 +111,19 @@ import angular from 'angular'

TcAuthService.socialLogin(platform, callbackUrl)
.then(function() {
$log.debug('logged in')
logger.debug('logged in')
return Helpers.redirectPostLogin($stateParams.next)
})
.catch(function(resp) {
.catch(function(err) {
/*eslint no-fallthrough:0*/
switch (resp.status) {
switch (err.status) {
case 'ACCOUNT_INACTIVE':
window.location.href = 'https://www.' + CONSTANTS.domain + '/account-inactive/'
case 'USER_NOT_REGISTERED':
default:
vm.socialLoginError = 401
vm.loginErrors.SOCIAL_LOGIN_ERROR = true
break
logger.error('Error logging in with social account', err)
}
})
}
Expand Down
11 changes: 5 additions & 6 deletions app/account/logout/logout.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@ import angular from 'angular'

angular.module('tc.account').controller('LogoutController', LogoutController)

LogoutController.$inject = ['$log', 'TcAuthService', '$window', 'CONSTANTS']
LogoutController.$inject = ['logger', 'TcAuthService', '$window', 'CONSTANTS']

function LogoutController($log, TcAuthService, $window, CONSTANTS) {
$log = $log.getInstance('LogoutController')
function LogoutController(logger, TcAuthService, $window, CONSTANTS) {

TcAuthService.logout()
.then(function() {
$log.debug('successfully logged out.')
// redirect to home
logger.debug('Successfully logged out.')

// Redirect to home
$window.location.href = CONSTANTS.MAIN_URL
})

}
})()
47 changes: 21 additions & 26 deletions app/account/register/register.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ import _ from 'lodash'

angular.module('tc.account').controller('RegisterController', RegisterController)

RegisterController.$inject = ['$log', 'CONSTANTS', '$state', '$stateParams', 'TcAuthService', 'UserService', 'ISO3166', 'Helpers']
RegisterController.$inject = ['logger', 'CONSTANTS', '$state', '$stateParams', 'TcAuthService', 'UserService', 'ISO3166', 'Helpers']

function RegisterController($log, CONSTANTS, $state, $stateParams, TcAuthService, UserService, ISO3166, Helpers) {
$log = $log.getInstance('RegisterController')
$log.debug('-init')
function RegisterController(logger, CONSTANTS, $state, $stateParams, TcAuthService, UserService, ISO3166, Helpers) {
var vm = this
vm.registering = false
// prepares utm params, if available
Expand All @@ -20,18 +18,10 @@ import _ from 'lodash'
campaign : $stateParams && $stateParams.utm_campaign ? $stateParams.utm_campaign : ''
}


// Set default for toggle password directive
vm.defaultPlaceholder = 'Create Password'
vm.busyMessage = CONSTANTS.BUSY_PROGRESS_MESSAGE

// FIXME - This needs to be setup with https
// lookup users country
// Helpers.getCountyObjFromIP()
// .then(function(obj) {
// vm.countryObj = obj
// })

vm.countries = ISO3166.getAllCountryObjects()

vm.updateCountry = function (angucompleteCountryObj) {
Expand Down Expand Up @@ -85,18 +75,18 @@ import _ from 'lodash'
}
}

$log.debug('attempting to register user')
TcAuthService.register(body)
.then(function(data) {
vm.registering = false
$log.debug('registered successfully')
logger.debug('Registered successfully')

// In the future, go to dashboard
$state.go('registeredSuccessfully')
})
.catch(function(err) {
vm.registering = false
$log.error('Error in registering new user: ', err)

logger.error('Error in registering new user', err)
})
}

Expand Down Expand Up @@ -130,17 +120,22 @@ import _ from 'lodash'
vm.isSocialRegistration = false
}
})
.catch(function(result) {
switch (result.status) {
case 'SOCIAL_PROFILE_ALREADY_EXISTS':
vm.errMsg = 'An account with that profile already exists. Please login to access your account.'
break
default:
vm.errMsg = 'Whoops! Something went wrong. Please try again later.'
break
}
vm.isSocialRegistration = false
})
.catch(function(err) {
switch (err.status) {
case 'SOCIAL_PROFILE_ALREADY_EXISTS':
vm.errMsg = 'An account with that profile already exists. Please login to access your account.'

logger.error('Error registering user with social account', err)

break

default:
vm.errMsg = 'Whoops! Something went wrong. Please try again later.'

logger.error('Error registering user with social account', err)
}
vm.isSocialRegistration = false
})
}

vm.$stateParams = $stateParams
Expand Down
27 changes: 21 additions & 6 deletions app/blocks/logger/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ import angular from 'angular'
var service = {
showToasts: false,

error: error,
info: info,
error : error,
info : info,
success: success,
warning: warning,
debug : debug,

// straight to console bypass toastr
log: $log.log
Expand All @@ -25,19 +26,33 @@ import angular from 'angular'
/////////////////////

function error(message, data, title) {
$log.error('Error: ' + message, data)
if (data) {
message = `${message} ${JSON.stringify(data)}`
}

$log.error(message)

if (window.NREUM) {
var err = new Error(message)

window.NREUM.noticeError(err)
}
}

function info(message, data, title) {
$log.info('Info: ' + message, data)
$log.info('Info: ' + message, data ? data : '')
}

function success(message, data, title) {
$log.info('Success: ' + message, data)
$log.info('Success: ' + message, data ? data : '')
}

function debug(message, data, title) {
$log.debug('Debug: ' + message, data ? data : '')
}

function warning(message, data, title) {
$log.warn('Warning: ' + message, data)
$log.warn('Warning: ' + message, data ? data : '')
}
}
}())
12 changes: 6 additions & 6 deletions app/directives/account/validate-register.directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ import angular from 'angular'
}
}

usernameIsFree.$inject = ['UserService', '$log', '$q']
usernameIsFree.$inject = ['UserService', 'logger', '$q']

function usernameIsFree(UserService, $log, $q) {
function usernameIsFree(UserService, logger, $q) {
return {
require: 'ngModel',
link: function(scope, element, attrs, ctrl) {
ctrl.$asyncValidators.usernameIsFree = function(modelValue, viewValue) {
$log.info('Validating username: ' + modelValue)
logger.info('Validating username: ' + modelValue)

var defer = $q.defer()

Expand Down Expand Up @@ -97,14 +97,14 @@ import angular from 'angular'
}
}

emailIsAvailable.$inject = ['UserService', '$log', '$q']
emailIsAvailable.$inject = ['UserService', 'logger', '$q']

function emailIsAvailable(UserService, $log, $q) {
function emailIsAvailable(UserService, logger, $q) {
return {
require: 'ngModel',
link: function(scope, element, attrs, ctrl) {
ctrl.$asyncValidators.emailIsAvailable = function(modelValue, viewValue) {
$log.info('Validating email: ' + modelValue)
logger.info('Validating email: ' + modelValue)

var defer = $q.defer()

Expand Down
Loading