Skip to content

Commit 8af41f2

Browse files
author
James Cori
committed
Merge branch 'dev'
2 parents a4258c3 + 3222b50 commit 8af41f2

22 files changed

+390
-43
lines changed

.circleci/config.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ install_deploysuite: &install_deploysuite
2020
build_steps: &build_steps
2121
- checkout
2222
- run: curl -s https://raw.githubusercontent.com/chronogolf/circleci-google-chrome/master/use_chrome_stable_version.sh | bash
23-
- restore_cache:
24-
key: node-modules-{{ checksum "package-lock.json" }}
23+
# - restore_cache:
24+
# key: node-modules-{{ checksum "package-lock.json" }}
2525
- run: npm install
26-
- save_cache:
27-
key: node-modules-{{ checksum "package-lock.json" }}
28-
paths:
29-
- node_modules
26+
# - save_cache:
27+
# key: node-modules-{{ checksum "package-lock.json" }}
28+
# paths:
29+
# - node_modules
3030
- run: ./node_modules/gulp/bin/gulp.js clean
3131
- run: ./node_modules/gulp/bin/gulp.js build
3232
# - run: ./node_modules/gulp/bin/gulp.js publish

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
6.17.1

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Internal application used to administer specific support tasks related to the To
66

77
## Software Requirements
88

9-
- node.js v6+
10-
- npm v3+
9+
- node.js v6 (not later)
10+
- npm v3
1111
- Google Chrome browser version >= 55.0.2883.0
1212

1313
## Installation
@@ -46,6 +46,10 @@ The following configuration parameters are available:
4646
| AGREE_FOR_DOCUSIGN_TEMPLATE | UUID from Database of the `"DocuSign Template"` Agreeable type |
4747
| AGREE_ELECTRONICALLY | UUID from Database of the `Electronically` Agreeable Type |
4848
| DEFAULT_TERMS_TYPE_ID | The default terms type id |
49+
| CONNECT_URL | URL of Topcoder Connect |
50+
| DIRECT_URL | URL of Topcoder Direct |
51+
| WORK_MANAGER_URL | URL of Topcoder Work Manager |
52+
| ONLINE_REVIEW_URL | URL of Topcoder Online Review |
4953

5054

5155
## Start the Application

config.json

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@
1919
"RESOURCE_V5_API_URL": "https://api.topcoder-dev.com/v5",
2020
"AGREE_FOR_DOCUSIGN_TEMPLATE": "999a26ad-b334-453c-8425-165d4cf496d7",
2121
"AGREE_ELECTRONICALLY": "5b2798b2-ae82-4210-9b4d-5d6428125ccb",
22-
"DEFAULT_TERMS_TYPE_ID": 5
22+
"DEFAULT_TERMS_TYPE_ID": 5,
23+
"CONNECT_URL": "https://connect.topcoder-dev.com",
24+
"DIRECT_URL": "https://www.topcoder-dev.com/direct",
25+
"WORK_MANAGER_URL": "https://challenges.topcoder-dev.com",
26+
"ONLINE_REVIEW_URL": "https://software.topcoder-dev.com/review"
2327
},
2428
"dev": {
2529
"API_URL": "https://api.topcoder-dev.com",
@@ -41,7 +45,11 @@
4145
"RESOURCE_V5_API_URL": "https://api.topcoder-dev.com/v5",
4246
"AGREE_FOR_DOCUSIGN_TEMPLATE": "999a26ad-b334-453c-8425-165d4cf496d7",
4347
"AGREE_ELECTRONICALLY": "5b2798b2-ae82-4210-9b4d-5d6428125ccb",
44-
"DEFAULT_TERMS_TYPE_ID": 5
48+
"DEFAULT_TERMS_TYPE_ID": 5,
49+
"CONNECT_URL": "https://connect.topcoder-dev.com",
50+
"DIRECT_URL": "https://www.topcoder-dev.com/direct",
51+
"WORK_MANAGER_URL": "https://challenges.topcoder-dev.com",
52+
"ONLINE_REVIEW_URL": "https://software.topcoder-dev.com/review"
4553
},
4654
"qa": {
4755
"API_URL": "https://api.topcoder-qa.com",
@@ -63,7 +71,11 @@
6371
"RESOURCE_V5_API_URL": "https://api.topcoder-dev.com/v5",
6472
"AGREE_FOR_DOCUSIGN_TEMPLATE": "999a26ad-b334-453c-8425-165d4cf496d7",
6573
"AGREE_ELECTRONICALLY": "5b2798b2-ae82-4210-9b4d-5d6428125ccb",
66-
"DEFAULT_TERMS_TYPE_ID": 5
74+
"DEFAULT_TERMS_TYPE_ID": 5,
75+
"CONNECT_URL": "https://connect.topcoder-dev.com",
76+
"DIRECT_URL": "https://www.topcoder-dev.com/direct",
77+
"WORK_MANAGER_URL": "https://challenges.topcoder-dev.com",
78+
"ONLINE_REVIEW_URL": "https://software.topcoder-dev.com/review"
6779
},
6880
"prod": {
6981
"API_URL": "https://api.topcoder.com",
@@ -85,6 +97,10 @@
8597
"RESOURCE_V5_API_URL": "https://api.topcoder.com/v5",
8698
"AGREE_FOR_DOCUSIGN_TEMPLATE": "1363a7ab-fd3e-4d7c-abbb-2f7440b8b355",
8799
"AGREE_ELECTRONICALLY": "2db6c920-4089-4755-9cd1-99b0df0af961",
88-
"DEFAULT_TERMS_TYPE_ID": 5
100+
"DEFAULT_TERMS_TYPE_ID": 5,
101+
"CONNECT_URL": "https://connect.topcoder.com",
102+
"DIRECT_URL": "https://www.topcoder.com/direct",
103+
"WORK_MANAGER_URL": "https://challenges.topcoder.com",
104+
"ONLINE_REVIEW_URL": "https://software.topcoder.com/review"
89105
}
90106
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
"wiredep": "~4.0.0"
8383
},
8484
"engines": {
85-
"node": ">=0.10.0"
85+
"node": "6"
8686
},
8787
"scripts": {
8888
"clean": "gulp clean",

src/app/challenges/challenges.service.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ angular.module('supportAdminApp')
1414
getChallengeTypes: getChallengeTypes,
1515
getChallengeTracks: getChallengeTracks,
1616
getChallengeById: getChallengeById,
17+
getChallengeByLegacyId: getChallengeByLegacyId,
1718
getChallengeResources: getChallengeResources,
1819
getResourceRoles: getResourceRoles,
1920
deleteChallengeResource: deleteChallengeResource,
@@ -305,6 +306,31 @@ angular.module('supportAdminApp')
305306
return deferred.promise;
306307
};
307308

309+
/**
310+
* gets the challenge details by legacyId.
311+
* Throws an error message if no challenge is found, as of now the api returns 200 and an empty array
312+
* @param {string} legacyId the challenge legacyId.
313+
* @returns {Promise} the promise base api result.
314+
*/
315+
function getChallengeByLegacyId(id) {
316+
var deferred = $q.defer();
317+
318+
$http({
319+
method: 'GET',
320+
url: V5_API_URL + '/challenges?legacyId=' + id,
321+
headers: {
322+
"Content-Type": "application/json"
323+
}
324+
}).then(function (response) {
325+
if (Array.isArray(response.data) && response.data.length > 0)
326+
deferred.resolve(response.data[0]);
327+
else throw({"message":" Invalid \"legacyId\""});
328+
}).catch(function (error) {
329+
handleError(error, deferred);
330+
});
331+
return deferred.promise;
332+
};
333+
308334
/**
309335
* get the challenge resources
310336
* @param {string} challengeId the challenge id.

src/app/directives.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,50 @@ angular.module('supportAdminApp')
7373
});
7474
}
7575
};
76+
})
77+
.directive('backButton', function($window) {
78+
return {
79+
restrict: 'AE',
80+
link: function(scope, element, attrs) {
81+
element.on('click', function() {
82+
$window.history.back();
83+
});
84+
}
85+
}
86+
87+
})
88+
// gets current phase according to a predefined logic, based on the phases array of a challenge
89+
.directive('currentPhase', function(moment) {
90+
return {
91+
restrict: 'AE',
92+
replace: true,
93+
template: '<span>{{phaseMessage}}</span>',
94+
scope: {
95+
challenge: '='
96+
},
97+
link: function(scope, element, attrs) {
98+
var statusPhase = null;
99+
100+
if (scope.challenge.phases) {
101+
statusPhase = scope.challenge.phases
102+
.filter(function(p) {
103+
return p.name !== 'Registration' && p.isOpen
104+
})
105+
.sort(function(a, b) {
106+
return moment(a.scheduledEndDate).diff(b.scheduledEndDate);
107+
})[0];
108+
}
109+
110+
if (!statusPhase && scope.challenge.type === 'First2Finish' && scope.challenge.phases.length) {
111+
statusPhase = _.clone(scope.challenge.phases[0]);
112+
statusPhase.name = 'Submission';
113+
}
114+
115+
scope.phaseMessage = "Stalled";
116+
if (statusPhase)
117+
scope.phaseMessage = statusPhase.name;
118+
else if (scope.challenge.status === 'Draft')
119+
scope.phaseMessage = "In Draft";
120+
}
121+
}
76122
});

src/app/less/base.less

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1372,4 +1372,25 @@ input[readonly] {
13721372

13731373
.mce-container > iframe {
13741374
height: 200px !important;
1375-
}
1375+
}
1376+
1377+
.dropdown-go-to {
1378+
left: auto;
1379+
right: 0;
1380+
}
1381+
1382+
.table-challenge-list {
1383+
th:first-child {
1384+
width:46px;
1385+
}
1386+
}
1387+
1388+
.table-challenge-overflow {
1389+
overflow-x: auto;
1390+
}
1391+
1392+
.dropdown-menu > li > a.link-disabled {
1393+
cursor: default;
1394+
pointer-events: none;
1395+
color: #bbbbbb;
1396+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.challenge-users-stats {
2+
min-width: 100px;
3+
4+
.challenge-users-stats-type:not(:first-child) {
5+
margin: 0 0 0 10px;
6+
}
7+
}

src/app/less/style.less

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
@import "spinners.less";
2828
@import "progress-bar.directive.less";
2929

30+
// Components
31+
@import "challenge-users-stats.directive.less";
32+
@import "track-icon.directive.less";
33+
3034
// Landing page styles
3135
@import "landing.less";
3236

0 commit comments

Comments
 (0)