Skip to content
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ The following configuration parameters are available:
| GROUP_V5_API_URL | URL of the v5 Groups API |
| LOOKUP_V5_API_URL | URL of the v5 Devices API |
| TERMS_V5_API_URL | URL of the v5 Terms API |
| CHALLENGES_V5_API_URL | URL of the v5 Challenges API |
| RESOURCE_V5_API_URL | URL of the v5 Resources API |
| AGREEABILITY_TYPES | List of Agreeable types and its UUID from Database |
| AGREE_FOR_DOCUSIGN_TEMPLATE | UUID from Database of the `"DocuSign Template"` Agreeable type |
| AGREE_ELECTRONICALLY | UUID from Database of the `Electronically` Agreeable Type |
Expand Down
10 changes: 9 additions & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
"GROUP_V5_API_URL": "http://localhost:3000/v5",
"LOOKUP_V5_API_URL": "http://localhost:3000/v5",
"TERMS_V5_API_URL": "http://localhost:3000/v5",
"CHALLENGES_V5_API_URL": "https://api.topcoder-dev.com/v5",
"RESOURCE_V5_API_URL": "https://api.topcoder-dev.com/v5",
"AGREEABILITY_TYPES": [
{
"id": "f3cb81fa-d1ed-4231-b6c6-770f4f1ce8a4",
Expand Down Expand Up @@ -53,6 +55,8 @@
"GROUP_V5_API_URL": "https://api.topcoder-dev.com/v5",
"LOOKUP_V5_API_URL": "https://api.topcoder-dev.com/v5",
"TERMS_V5_API_URL": "https://api.topcoder-dev.com/v5",
"CHALLENGES_V5_API_URL": "https://api.topcoder-dev.com/v5",
"RESOURCE_V5_API_URL": "https://api.topcoder-dev.com/v5",
"AGREEABILITY_TYPES": [
{
"id": "f3cb81fa-d1ed-4231-b6c6-770f4f1ce8a4",
Expand Down Expand Up @@ -91,6 +95,8 @@
"GROUP_V5_API_URL": "http://localhost:9000",
"LOOKUP_V5_API_URL": "http://localhost:3000/v5",
"TERMS_V5_API_URL": "http://localhost:3000/v5",
"CHALLENGES_V5_API_URL": "https://api.topcoder-dev.com/v5",
"RESOURCE_V5_API_URL": "https://api.topcoder-dev.com/v5",
"AGREEABILITY_TYPES": [
{
"id": "f3cb81fa-d1ed-4231-b6c6-770f4f1ce8a4",
Expand Down Expand Up @@ -129,6 +135,8 @@
"GROUP_V5_API_URL": "https://api.topcoder.com/v5",
"LOOKUP_V5_API_URL": "https://api.topcoder.com/v5",
"TERMS_V5_API_URL": "https://api.topcoder.com/v5",
"CHALLENGES_V5_API_URL": "https://api.topcoder-dev.com/v5",
"RESOURCE_V5_API_URL": "https://api.topcoder-dev.com/v5",
"AGREEABILITY_TYPES": [
{
"id": "f3cb81fa-d1ed-4231-b6c6-770f4f1ce8a4",
Expand All @@ -151,4 +159,4 @@
"AGREE_ELECTRONICALLY": "5b2798b2-ae82-4210-9b4d-5d6428125ccb",
"DEFAULT_TERMS_TYPE_ID": 5
}
}
}
76 changes: 47 additions & 29 deletions src/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,30 @@
* support-admin-app
*/
angular.module('supportAdminApp', [
'ngAnimate',
'ngCookies',
'ngTouch',
'ngSanitize',
'ngResource',
'csvReader',
'ui.router',
'ui.bootstrap',
'app.constants',
'angular-clipboard',
'ng-file-model',
'btorfs.multiselect',
'ui.bootstrap.datetimepicker',
'angularMoment',
'angular-jwt',
'ui.tinymce'])
'ngAnimate',
'ngCookies',
'ngTouch',
'ngSanitize',
'ngResource',
'csvReader',
'ui.router',
'ui.bootstrap',
'app.constants',
'angular-clipboard',
'ng-file-model',
'btorfs.multiselect',
'ui.bootstrap.datetimepicker',
'angularMoment',
'angular-jwt',
'ui.tinymce'])
// In the run phase of your Angular application
.run(function (AuthService) {
// init AuthService, it has to be done once, when app starts
AuthService.init();
})
.config(function ($stateProvider, $urlRouterProvider, $locationProvider, $compileProvider) {
var authenticate = ['AuthService', '$q', '$state', function(AuthService, $q, $state) {
return AuthService.authenticate().catch(function(err) {
var authenticate = ['AuthService', '$q', '$state', function (AuthService, $q, $state) {
return AuthService.authenticate().catch(function (err) {
// if we get error that use doesn't have permissions
// then go to auth page, which will show permissions denied error
if (err === AuthService.ERROR.NO_PERMISSIONS) {
Expand All @@ -43,9 +43,9 @@ angular.module('supportAdminApp', [
templateUrl: 'app/auth/auth.html',
data: { pageTitle: 'Authentication' },
resolve: {
auth: ['AuthService', '$q', function(AuthService, $q) {
auth: ['AuthService', '$q', function (AuthService, $q) {
// for auth state we use another resolver then all other states
return AuthService.authenticate().catch(function(err) {
return AuthService.authenticate().catch(function (err) {
// if we get error that use doesn't have permissions
// we still resolve the promise and proceed to auth page
// which will show permissions denied error
Expand Down Expand Up @@ -141,10 +141,10 @@ angular.module('supportAdminApp', [
value: 'develop',
name: 'Develop'
},
{
value: 'design',
name: 'Design'
}];
{
value: 'design',
name: 'Design'
}];

$scope.tagStatuses = [{
value: 'approved',
Expand All @@ -154,14 +154,14 @@ angular.module('supportAdminApp', [
name: 'Pending'
}];

TagService.getTechnologyStatuses().then(function(techStatuses) {
_.forEach(techStatuses, function(status) {
TagService.getTechnologyStatuses().then(function (techStatuses) {
_.forEach(techStatuses, function (status) {
status.value = _.lowerCase(status.description);
status.name = status.description;
});
$scope.techStatuses = techStatuses;
});
$scope.getTagStatuses = function(domainType) {
$scope.getTagStatuses = function (domainType) {
if (domainType === 'technology') {
return $scope.techStatuses;
} else {
Expand Down Expand Up @@ -415,7 +415,25 @@ angular.module('supportAdminApp', [
.state('index.challenges', {
url: 'challenges',
templateUrl: 'app/challenges/challenges.html',
data: { pageTitle: 'Challenge Management'},
data: { pageTitle: 'Challenge Management' },
resolve: { auth: authenticate }
})
.state('index.v5challenges', {
url: 'v5-challenges',
templateUrl: 'app/v5_challenges/challenges.list.html',
data: { pageTitle: 'Challenge Management' },
resolve: { auth: authenticate }
})
.state('index.v5ChallengeDetail', {
url: 'v5-challenge-details/:id',
templateUrl: 'app/v5_challenges/challenge.detail.html',
data: { pageTitle: 'Challenge Detail' },
resolve: { auth: authenticate }
})
.state('index.v5ChallengeManageUser', {
url: 'v5-challenge-manage-users/:id',
templateUrl: 'app/v5_challenges/challenge.manage.user.html',
data: { pageTitle: 'Manage Users' },
resolve: { auth: authenticate }
})
.state('index.ideas', {
Expand Down Expand Up @@ -464,7 +482,7 @@ angular.module('supportAdminApp', [
templateUrl: 'app/terms/terms.users.list.html',
controller: 'terms.ListTermsUsersController',
data: { pageTitle: 'Term Users' },
params:{
params: {
title: null
},
resolve: { auth: authenticate }
Expand Down
Loading