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

Commit c03beb7

Browse files
author
Jenkins Continuous Integration Server
committedJan 22, 2016
Merge commit '30751934f3ed42a1217842bf16652b357a3ea9c8' into HEAD
2 parents 123d198 + 3075193 commit c03beb7

15 files changed

+230
-99
lines changed
 

‎README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ Spec files live alongside the code they are testing. For example, in peer-review
5858
## UI-Router and States
5959
See any *.routes.js file as an example.
6060

61+
**Important:** Make sure the url in your routes files ends with a slash `/`
62+
6163
## Contributing
6264

6365
### Style Guide and Naming Conventions
@@ -78,9 +80,9 @@ Jade Files
7880
```
7981
.wrapper
8082
h1 Lorem ipsum
81-
83+
8284
p Sibling tag
83-
85+
8486
.wrapper2
8587
p Child
8688
```
@@ -99,7 +101,7 @@ SCSS Files
99101
height: 100px;
100102
width: 100px;
101103
}
102-
104+
103105
.inside-box {
104106
font-size: 14px;
105107
@media screen and (min-width: 768px) {

‎app/directives/challenge-tile/challenge-tile.directive.jade

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,30 @@
77
p.subtrack-color {{challenge.subTrack | underscoreStrip}}
88

99
challenge-links(challenge="challenge", view="'tile'")
10+
.challenge-card__bottom.challenge-card__bottom--active
11+
.challenge-details
12+
p.currentPhase {{challenge.userCurrentPhase}}
1013

11-
.challenge-details
12-
p.currentPhase {{challenge.userCurrentPhase}}
14+
.challenge-calendar(ng-show="challenge.userCurrentPhaseEndTime")
15+
p.ends-in Ends In
16+
p.time-remaining {{challenge.userCurrentPhaseEndTime[0]}}
17+
p.unit-of-time {{challenge.userCurrentPhaseEndTime[1]}}
1318

14-
.challenge-calendar(ng-show="challenge.userCurrentPhaseEndTime")
15-
p.ends-in Ends In
16-
p.time-remaining {{challenge.userCurrentPhaseEndTime[0]}}
17-
p.unit-of-time {{challenge.userCurrentPhaseEndTime[1]}}
19+
.stalled-challenge(ng-hide="challenge.userCurrentPhaseEndTime") This challenge is currently paused.
1820

19-
.stalled-challenge(ng-hide="challenge.userCurrentPhaseEndTime") This challenge is currently paused.
21+
.phase-action(ng-show="challenge.userAction", ng-switch="challenge.userAction")
22+
a.tc-btn.tc-btn-s.tc-btn-wide.tc-btn-ghost.submit(ng-switch-when="Submit", ng-href="{{challenge|challengeLinks:'detail'}}") Submit
2023

21-
.phase-action(ng-switch="challenge.userAction")
22-
a.tc-btn.tc-btn-s.tc-btn-wide.tc-btn-ghost.submit(ng-switch-when="Submit", ng-href="{{challenge|challengeLinks:'detail'}}") Submit
24+
.submitted(ng-switch-when="Submitted") Submitted
2325

24-
.submitted(ng-switch-when="Submitted") Submitted
26+
// TODO: Need styling and JS logic for this one
27+
.registered(ng-switch-when="Registered") Registered
2528

26-
// TODO: Need styling and JS logic for this one
27-
.registered(ng-switch-when="Registered") Registered
28-
29-
// Only show if not data science track
30-
p.roles
31-
span(ng-hide="challenge.track === 'DATA_SCIENCE'")
32-
span Role:  
33-
span {{challenge.userDetails.roles | listRoles}}
29+
// Only show if not data science track
30+
p.roles
31+
span(ng-hide="challenge.track === 'DATA_SCIENCE'")
32+
span Role:  
33+
span {{challenge.userDetails.roles | listRoles}}
3434

3535
.completed-challenge(
3636
ng-show="challenge.status === 'COMPLETED' || challenge.status === 'PAST'",
@@ -45,25 +45,26 @@
4545

4646
.winner-ribbon(ng-show="challenge.wonFirst")
4747

48-
.challenge-details(ng-switch-when="DATA_SCIENCE", ng-switch="challenge.subTrack", ng-class="challenge.track")
48+
.challenge-card__bottom.challenge-card__bottom--completed
49+
.challenge-details(ng-switch-when="DATA_SCIENCE", ng-switch="challenge.subTrack", ng-class="challenge.track")
4950

50-
div
51-
.marathon-score
52-
p.score {{challenge.pointTotal || 0 }}
51+
div
52+
.marathon-score
53+
p.score {{challenge.pointTotal || 0 }}
5354

54-
p Total Points
55+
p Total Points
5556

56-
.challenge-details(ng-switch-when="DEVELOP")
57-
dev-challenge-user-place(challenge="challenge", view="view")
57+
.challenge-details(ng-switch-when="DEVELOP")
58+
dev-challenge-user-place(challenge="challenge", view="view")
5859

59-
.challenge-details(ng-switch-when="DESIGN")
60-
design-challenge-user-place(challenge="challenge", view="view")
60+
.challenge-details(ng-switch-when="DESIGN")
61+
design-challenge-user-place(challenge="challenge", view="view")
6162

62-
// Only show if not data science track
63-
p.roles
64-
span(ng-hide="challenge.track === 'DATA_SCIENCE'")
65-
span Role:  
66-
span {{challenge.userDetails.roles | listRoles}}
63+
// Only show if not data science track
64+
p.roles
65+
span(ng-hide="challenge.track === 'DATA_SCIENCE'")
66+
span Role:  
67+
span {{challenge.userDetails.roles | listRoles}}
6768

6869
.challenge.list-view(ng-show="view=='list'", ng-class="challenge.track")
6970
.active-challenge(ng-show="challenge.status === 'ACTIVE'")

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
p.place.passed(ng-show="challenge.userStatus === 'PASSED_SCREENING'") Passed Screening
55
p.place.completed(ng-show="challenge.userStatus === 'COMPLETED'") COMPLETED
66

7-
.thumbnail(ng-click="!challenge.isPrivate && imageURL && openLightbox()", ng-hide="challenge.userStatus !== 'PASSED_REVIEW'")
7+
.thumbnail(ng-click="!challenge.isPrivate && imageURL && openLightbox()", ng-class="{hidden: challenge.userStatus !== 'PASSED_REVIEW'}")
88
img(ng-show="!challenge.isPrivate", ng-src="{{imageURL || '/images/card-bg-no-image.svg'}}", fallback-src="/images/card-bg-no-image.svg")
99
img(ng-show="challenge.isPrivate", src="/images/card-bg-private-project.svg")
1010

‎app/index.jade

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ html
156156
script(src='../bower_components/react/react.js')
157157
script(src='../bower_components/react/react-dom.js')
158158
script(src='../bower_components/classnames/index.js')
159+
script(src='../bower_components/classnames/bind.js')
160+
script(src='../bower_components/classnames/dedupe.js')
159161
script(src='../bower_components/react-input-autosize/dist/react-input-autosize.min.js')
160162
script(src='../bower_components/react-select/dist/react-select.min.js')
161163
script(src='../bower_components/ngReact/ngReact.js')
@@ -333,7 +335,7 @@ html
333335
script(src="submissions/submissions.module.js")
334336
script(src="submissions/submissions.controller.js")
335337
script(src="submissions/submissions.routes.js")
336-
script(src="submissions/submit-file/submit-file.controller.js")
338+
script(src="submissions/submit-design-files/submit-design-files.controller.js")
337339
script(src="topcoder.constants.js")
338340
script(src="topcoder.controller.js")
339341
script(src="topcoder.interceptors.js")

‎app/specs.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ <h1><a href="specs.html">Spec Runner</a></h1>
108108
<script src="/app/topcoder.controller.js"></script>
109109
<script src="/app/topcoder.constants.js"></script>
110110
<script src="/app/submissions/submissions.module.js"></script>
111-
<script src="/app/submissions/submit-file/submit-file.controller.js"></script>
111+
<script src="/app/submissions/submit-design-files/submit-design-files.controller.js"></script>
112112
<script src="/app/submissions/submissions.routes.js"></script>
113113
<script src="/app/submissions/submissions.controller.js"></script>
114114
<script src="/app/skill-picker/skill-picker.module.js"></script>
@@ -288,8 +288,8 @@ <h1><a href="specs.html">Spec Runner</a></h1>
288288
<script src="/app/account/login/login.spec.js"></script>
289289
<script src="/app/account/logout/logout.controller.spec.js"></script>
290290
<script src="/app/account/reset-password/reset-password.spec.js"></script>
291-
<script src="/app/blocks/exception/exception-handler.provider.spec.js"></script>
292291
<script src="/app/account/register/register.spec.js"></script>
292+
<script src="/app/blocks/exception/exception-handler.provider.spec.js"></script>
293293
<script src="/app/directives/badges/badge-tooltip.spec.js"></script>
294294
<script src="/app/directives/busy-button/busy-button.directive.spec.js"></script>
295295
<script src="/app/directives/challenge-tile/challenge-tile.spec.js"></script>
@@ -298,9 +298,9 @@ <h1><a href="specs.html">Spec Runner</a></h1>
298298
<script src="/app/directives/external-account/external-link-deletion.controller.spec.js"></script>
299299
<script src="/app/directives/external-account/external-links-data.directive.spec.js"></script>
300300
<script src="/app/directives/external-account/external-web-links.directive.spec.js"></script>
301+
<script src="/app/directives/tc-endless-paginator/tc-endless-paginator.spec.js"></script>
301302
<script src="/app/directives/tc-file-input/tc-file-input.spec.js"></script>
302303
<script src="/app/directives/tc-form-fonts/tc-form-fonts.spec.js"></script>
303-
<script src="/app/directives/tc-endless-paginator/tc-endless-paginator.spec.js"></script>
304304
<script src="/app/directives/tc-form-stockart/tc-form-stockart.spec.js"></script>
305305
<script src="/app/directives/tc-input/tc-input.spec.js"></script>
306306
<script src="/app/directives/tc-paginator/tc-paginator.spec.js"></script>
@@ -309,19 +309,19 @@ <h1><a href="specs.html">Spec Runner</a></h1>
309309
<script src="/app/my-dashboard/header-dashboard/header-dashboard.spec.js"></script>
310310
<script src="/app/my-dashboard/my-challenges/my-challenges.spec.js"></script>
311311
<script src="/app/my-dashboard/programs/programs.spec.js"></script>
312-
<script src="/app/my-dashboard/srms/srms.spec.js"></script>
313312
<script src="/app/my-dashboard/subtrack-stats/subtrack-stats.controller.spec.js"></script>
313+
<script src="/app/my-dashboard/srms/srms.spec.js"></script>
314314
<script src="/app/peer-review/completed-review/completed-review.spec.js"></script>
315315
<script src="/app/peer-review/edit-review/edit-review.spec.js"></script>
316316
<script src="/app/peer-review/readOnlyScorecard/readOnlyScorecard.spec.js"></script>
317-
<script src="/app/profile/about/about.controller.spec.js"></script>
318317
<script src="/app/peer-review/review-status/review-status.spec.js"></script>
318+
<script src="/app/profile/about/about.controller.spec.js"></script>
319319
<script src="/app/profile/badges/badges.spec.js"></script>
320320
<script src="/app/profile/subtrack/subtrack.spec.js"></script>
321321
<script src="/app/settings/account-info/account-info.spec.js"></script>
322322
<script src="/app/settings/edit-profile/edit-profile.spec.js"></script>
323323
<script src="/app/settings/preferences/preferences.spec.js"></script>
324-
<script src="/app/submissions/submit-file/submit-file.spec.js"></script>
324+
<script src="/app/submissions/submit-design-files/submit-design-files.spec.js"></script>
325325
<script src="/app/directives/account/toggle-password/toggle-password.spec.js"></script>
326326
<script src="/app/directives/account/toggle-password-with-tips/toggle-password-with-tips.spec.js"></script>
327327
<!-- endinject -->

‎app/submissions/submissions.controller.js

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

44
angular.module('tc.submissions').controller('SubmissionsController', SubmissionsController);
55

6-
SubmissionsController.$inject = ['challengeToSubmitTo'];
6+
SubmissionsController.$inject = ['challengeToSubmitTo', '$state'];
7+
8+
function SubmissionsController(challengeToSubmitTo, $state) {
79

8-
function SubmissionsController(challengeToSubmitTo) {
910
var vm = this;
1011

1112
var challenge = challengeToSubmitTo.challenge;
@@ -15,6 +16,14 @@
1516

1617
activate();
1718

18-
function activate() {}
19+
function activate() {
20+
var track = challengeToSubmitTo.challenge.track;
21+
22+
if (track === 'DESIGN') {
23+
$state.go('submissions.file.design');
24+
} else if (track === 'DEVELOP') {
25+
$state.go('submissions.file.develop')
26+
}
27+
}
1928
}
2029
})();

‎app/submissions/submissions.routes.js

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818
controllerAs: 'submissions',
1919
data: {
2020
authRequired: true,
21-
22-
// TODO: Get title from PMs
23-
title: 'Submit'
21+
title: 'Challenge Submission'
2422
},
2523
resolve: {
2624
challengeToSubmitTo: ['ChallengeService', '$stateParams', 'UserService', function(ChallengeService, $stateParams, UserService) {
@@ -36,10 +34,9 @@
3634
challenge = challenge[0];
3735

3836
if (!challenge) {
39-
// There should be a challenge, redirect?
37+
// TODO: There should be a challenge, redirect?
4038
alert('User is not associated with this challenge.');
4139
}
42-
4340
var phaseType;
4441
var phaseId;
4542

@@ -84,11 +81,22 @@
8481
}
8582
},
8683
'submissions.file': {
87-
url: '?method=file',
88-
templateUrl: 'submissions/submit-file/submit-file.html',
89-
controller: 'SubmitFileController',
84+
url:'file/',
85+
abstract: true,
86+
template: '<ui-view/>'
87+
},
88+
'submissions.file.design': {
89+
url:'',
90+
templateUrl: 'submissions/submit-design-files/submit-design-files.html',
91+
controller: 'SubmitDesignFilesController',
9092
controllerAs: 'vm',
91-
}
93+
},
94+
'submissions.file.develop': {
95+
url:'',
96+
templateUrl: 'submissions/submit-develop-files/submit-develop-files.html',
97+
controller: 'SubmitDevelopFilesController',
98+
controllerAs: 'vm',
99+
},
92100
};
93101

94102
for (var name in states) {

‎app/submissions/submissions.spec.js

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ describe('Submissions Controller', function() {
1010
}
1111
};
1212

13+
var state = {
14+
go: sinon.spy()
15+
}
16+
1317
beforeEach(function() {
1418
bard.appModule('tc.submissions');
1519
bard.inject(this, '$controller');
@@ -19,18 +23,44 @@ describe('Submissions Controller', function() {
1923

2024
beforeEach(function() {
2125
controller = $controller('SubmissionsController', {
22-
challengeToSubmitTo: mockChallenge
26+
challengeToSubmitTo: mockChallenge,
27+
$state: state
2328
});
2429
vm = controller;
2530
});
2631

27-
it('should exist', function() {
32+
it('exists', function() {
2833
expect(vm).to.exist;
2934
});
3035

31-
it('should have properties on vm from the routes resolve', function() {
36+
it('has properties on vm from the routes resolve', function() {
3237
expect(vm.challengeTitle).to.equal(mockChallenge.challenge.name);
3338
expect(vm.challengeId).to.equal(30049240);
3439
expect(vm.track).to.equal(mockChallenge.challenge.track.toLowerCase());
3540
});
41+
42+
describe('routes to the correct child state for', function() {
43+
it('design challenges', function() {
44+
45+
expect(state.go).calledWith('submissions.file.design');
46+
});
47+
48+
it('develop challenges', function() {
49+
50+
controller = $controller('SubmissionsController', {
51+
challengeToSubmitTo: {
52+
challenge: {
53+
name: 'Challenge Name',
54+
track: 'DEVELOP',
55+
id: 30049240
56+
}
57+
},
58+
$state: state
59+
});
60+
vm = controller;
61+
62+
expect(state.go).calledWith('submissions.file.develop');
63+
});
64+
65+
});
3666
});

‎app/submissions/submit-file/submit-file.controller.js renamed to ‎app/submissions/submit-design-files/submit-design-files.controller.js

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
(function () {
22
'use strict';
33

4-
angular.module('tc.submissions').controller('SubmitFileController', SubmitFileController);
4+
angular.module('tc.submissions').controller('SubmitDesignFilesController', SubmitDesignFilesController);
55

6-
SubmitFileController.$inject = ['$scope', '$stateParams', '$log', 'UserService', 'SubmissionsService', 'challengeToSubmitTo'];
6+
SubmitDesignFilesController.$inject = ['$scope','$window', '$stateParams', '$log', 'UserService', 'SubmissionsService', 'challengeToSubmitTo'];
77

8-
function SubmitFileController($scope, $stateParams, $log, UserService, SubmissionsService, challengeToSubmitTo) {
8+
function SubmitDesignFilesController($scope, $window, $stateParams, $log, UserService, SubmissionsService, challengeToSubmitTo) {
99
var vm = this;
10-
$log = $log.getInstance('SubmitFileController');
10+
$log = $log.getInstance('SubmitDesignFilesController');
1111
var files = {};
1212
var fileUploadProgress = {};
1313
vm.urlRegEx = new RegExp(/^(http(s?):\/\/)?(www\.)?[a-zA-Z0-9\.\-\_]+(\.[a-zA-Z]{2,3})+(\/[a-zA-Z0-9\_\-\s\.\/\?\%\#\&\=]*)?$/);
@@ -39,18 +39,14 @@
3939

4040
vm.submissionsBody = {
4141
reference: {
42-
43-
// type dynamic or static?
4442
type: 'CHALLENGE',
4543
id: $stateParams.challengeId,
4644
phaseType: challengeToSubmitTo.phaseType,
4745
phaseId: challengeToSubmitTo.phaseId
4846
},
4947
userId: userId,
5048
data: {
51-
52-
// Dynamic or static?
53-
method: 'DESIGN_CHALLENGE_ZIP_FILE',
49+
method: challengeToSubmitTo.challenge.track.toUpperCase() + '_CHALLENGE_ZIP_FILE',
5450

5551
// Can delete below since they are processed and added later?
5652
files: [],
@@ -64,6 +60,7 @@
6460
vm.setRankTo1 = setRankTo1;
6561
vm.setFileReference = setFileReference;
6662
vm.uploadSubmission = uploadSubmission;
63+
vm.refreshPage = refreshPage;
6764
vm.cancelRetry = cancelRetry;
6865

6966
activate();
@@ -194,11 +191,13 @@
194191
count++;
195192
}
196193
vm.uploadProgress = total / count;
194+
197195
// initiate digest cycle because this event (xhr event) is caused outside angular
198196
$scope.$apply();
199197
} else { // typeof args === 'number', mainly used a s fallback to mark completion of the UPLOAD phase
200198
vm.uploadProgress = args;
201199
}
200+
202201
// start next phase when UPLOAD is done
203202
if (vm.uploadProgress == 100) {
204203
$log.debug('Uploaded files.');
@@ -209,20 +208,20 @@
209208
// we are concerned only for completion of the phase
210209
if (args === 100) {
211210
$log.debug('Finished upload.');
212-
vm.finishing = false;
213-
vm.showProgress = false;
214-
215-
// TODO redirect to submission listing / challenge details page
216211
}
217-
} else { // assume it to be error condition
212+
} else {
213+
// assume it to be error condition
218214
$log.debug("Error Condition: " + phase);
219215
vm.errorInUpload = true;
220216
}
221217
}
222218

219+
function refreshPage() {
220+
$window.location.reload(true);
221+
}
222+
223223
function cancelRetry() {
224224
vm.showProgress = false;
225-
// TODO redirect to submission listing / challenge details page
226225
}
227226
}
228227
})();

‎app/submissions/submit-file/submit-file.jade renamed to ‎app/submissions/submit-design-files/submit-design-files.jade

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,25 +151,32 @@
151151

152152
button.tc-btn.tc-btn-secondary(type="submit", ng-disabled="submissionForm.$invalid") Submit
153153

154-
modal.transition(show="vm.showProgress", background-click-close="true", style="background-color:white;")
154+
modal.transition(show="vm.showProgress", background-click-close="false", style="background-color:white;")
155155
.upload-progress(ng-class="{'upload-progress--error': vm.errorInUpload}")
156156
.upload-progress__title
157157
p Uploading submission for
158158

159159
p.upload-progress-title__challenge-name [Challenge name]
160160

161161
img.upload-progress__image(src="/images/robot.svg", ng-hide="vm.errorInUpload")
162-
163162
img.upload-progress__image--error(src="/images/robot-embarresed.svg", ng-show="vm.errorInUpload")
164163

165-
p.upload-progress__message(ng-hide="vm.errorInUpload") Hey, your work is AWESOME! Please don’t close the window while I’m working, you’ll loose all files!
164+
p.upload-progress__message(ng-hide="vm.errorInUpload") Hey, your work is AWESOME! Please don’t close the window while I’m working or you’ll loose all files!
166165

167-
p.upload-progress__message--error(ng-show="vm.errorInUpload") Oh, that’s embarrassing! The file couldn’t be uploaded, I’m so sorry.
166+
p.upload-progress__message--error(ng-show="vm.errorInUpload") Oh, that’s embarrassing! One of the files couldn’t be uploaded, I’m so sorry.
168167

169168
progress-bar.upload-progress__progress-bar(completed="vm.uploadProgress", message="of 3 files uploaded")
170169

171170
.upload-progress__preparing(ng-show="vm.preparing && !vm.errorInUpload") #[span Preparing...]
172-
.upload-progress__finishing(ng-show="vm.finishing && !vm.errorInUpload") #[span Finishing...]
171+
.upload-progress__finishing(ng-show="vm.finishing && !vm.errorInUpload")
172+
p Finished!
173+
174+
.upload-progess__links
175+
a.tc-btn.tc-btn-s(ng-href="https://www.{{DOMAIN}}/challenge-details/{{submissions.challengeId}}/?type={{submissions.track}}") Back to the challenge
176+
177+
a.tc-btn.tc-btn-s.tc-btn-ghost(ng-click="vm.refreshPage()") Submit another
178+
179+
173180
.upload-progress__error(ng-show="vm.errorInUpload") #[span File upload failed]
174181

175182
.upload-progress__error-action(ng-show="vm.errorInUpload")

‎app/submissions/submit-file/submit-file.spec.js renamed to ‎app/submissions/submit-design-files/submit-design-files.spec.js

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* jshint -W117, -W030 */
2-
describe('Submit File Controller', function() {
2+
describe('Submit Design Files Controller', function() {
33
var controller, vm, scope;
44

55
var mockChallenge = {
@@ -22,6 +22,12 @@ describe('Submit File Controller', function() {
2222
getPresignedURL: function() {}
2323
};
2424

25+
var mockWindow = {
26+
location: {
27+
reload: function(val) { return val; }
28+
}
29+
};
30+
2531
beforeEach(function() {
2632
bard.appModule('tc.submissions');
2733
bard.inject(this, '$controller', '$rootScope');
@@ -32,19 +38,40 @@ describe('Submit File Controller', function() {
3238
bard.verifyNoOutstandingHttpRequests();
3339

3440
beforeEach(function() {
35-
controller = $controller('SubmitFileController', {
41+
controller = $controller('SubmitDesignFilesController', {
3642
$scope: scope,
3743
UserService: userService,
3844
challengeToSubmitTo: mockChallenge,
39-
SubmissionsService: submissionsService
45+
SubmissionsService: submissionsService,
46+
$window: mockWindow
4047
});
4148
vm = controller;
4249
});
4350

44-
it('should exist', function() {
51+
it('exists', function() {
4552
expect(vm).to.exist;
4653
});
4754

55+
it('sets the right track for the method', function() {
56+
controller = $controller('SubmitDesignFilesController', {
57+
$scope: scope,
58+
UserService: userService,
59+
challengeToSubmitTo: {
60+
challenge: {
61+
name: 'Challenge Name',
62+
track: 'DEVELOP',
63+
id: 30049240
64+
}
65+
},
66+
SubmissionsService: submissionsService,
67+
$window: mockWindow
68+
});
69+
vm = controller;
70+
scope.$digest();
71+
72+
expect(vm.submissionsBody.data.method).to.equal('DEVELOP_CHALLENGE_ZIP_FILE');
73+
});
74+
4875
describe('setRankTo1', function() {
4976
it('returns 1 if the input is blank', function() {
5077
expect(vm.setRankTo1('')).to.equal(1);
@@ -265,6 +292,18 @@ describe('Submit File Controller', function() {
265292
});
266293
});
267294

295+
describe('refreshPage', function() {
296+
it('reloads the page', function() {
297+
var mockRefresh = sinon.spy(mockWindow.location, 'reload');
298+
299+
vm.refreshPage();
300+
scope.$digest();
301+
302+
expect(mockRefresh).calledWith(true);
303+
expect(mockRefresh).calledOnce;
304+
});
305+
});
306+
268307
describe('cancelRetry', function() {
269308
it('sets showProgress to false', function() {
270309
vm.showProgress = true;

‎app/topcoder.routes.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,8 @@
4242
window.location.href = CONSTANTS.MAIN_URL + '/404/';
4343
}]
4444
},
45-
/**
46-
* Base state that all other routes should inherit from.
47-
* Child routes can override any of the specified regions
48-
*/
45+
// Base state that all other routes should inherit from.
46+
// Child routes can override any of the specified regions
4947
'root': {
5048
url: '',
5149
abstract: true,
@@ -70,10 +68,8 @@
7068
}
7169
},
7270
'home': {
73-
// TODO - set new home page
7471
parent: 'root',
7572
url: '/',
76-
// template: 'This is the home page',
7773
controller: ['$state', function($state) {
7874
$state.go('dashboard');
7975
}]

‎assets/css/directives/challenge-tile.scss

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,26 @@ challenge-tile .challenge.tile-view {
3737
}
3838
}
3939

40+
.challenge-card__bottom {
41+
width: 268px;/* 2px adjustment for 2 1px borders */
42+
flex: 2;
43+
display: flex;
44+
flex-direction: column;
45+
}
46+
4047
// challenge details section
4148
.challenge-details {
4249
display: flex;
4350
flex-direction: column;
4451
align-items: center;
52+
justify-content: center;
53+
flex: 2;
4554
}
4655

4756
// roles bar is common for both active and completed
4857
.roles {
4958
width: 100%;
50-
border-radius: 4px;
59+
border-radius: 0px 0px 4px 4px;
5160
display: flex;
5261
flex-direction: row;
5362
justify-content: flex-start;
@@ -71,7 +80,7 @@ challenge-tile .challenge.tile-view {
7180
}
7281

7382
.active-challenge {
74-
height: 350px;
83+
height: 390px;
7584
display: flex;
7685
flex-direction: column;
7786
justify-content: space-between;
@@ -84,7 +93,6 @@ challenge-tile .challenge.tile-view {
8493

8594
.challenge-details {
8695
.currentPhase {
87-
margin-top: 40px;
8896
margin-bottom: 20px;
8997
@include font-with-weight('Sofia Pro', 300);
9098
font-size: 18px;
@@ -99,7 +107,6 @@ challenge-tile .challenge.tile-view {
99107
align-items: center;
100108
width: 75px;
101109
height: 63px;
102-
margin-bottom: 20px;
103110
background-image: url(/images/ico-calendar.svg);
104111

105112
> p {
@@ -179,7 +186,7 @@ challenge-tile .challenge.tile-view {
179186

180187

181188
.completed-challenge {
182-
height: 350px;
189+
height: 390px;
183190
display: flex;
184191
flex-direction: column;
185192
justify-content: space-between;
@@ -222,6 +229,27 @@ challenge-tile .challenge.tile-view {
222229
justify-content: center;
223230
}
224231

232+
design-challenge-user-place {
233+
display: flex;
234+
flex-direction: column;
235+
flex: 2;
236+
237+
.tile-view {
238+
flex: 2;
239+
justify-content: flex-end;
240+
}
241+
}
242+
243+
dev-challenge-user-place {
244+
display: flex;
245+
flex-direction: column;
246+
flex: 2;
247+
248+
.tile-view {
249+
flex: 2;
250+
}
251+
}
252+
225253
.marathon-score {
226254
display: flex;
227255
flex-direction: column;

‎assets/css/my-challenges/my-challenges.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@
176176

177177
challenge-tile {
178178
&.tile-view {
179-
margin-bottom: 20px;
179+
margin-bottom: 13px;
180180
@media only screen and (max-width: 767px) {
181181
display: inline-block;
182182
margin-left: 15px;

‎assets/css/submissions/submit-file.scss

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,8 @@ tc-form-fonts, tc-form-stockart {
112112
}
113113

114114
modal {
115-
.close {
116-
.icon.cross {
117-
background-image: url(/images/x-mark-gray.svg);
118-
background-size: 25px;
119-
}
115+
> button {
116+
display: none;
120117
}
121118
}
122119
.upload-progress {
@@ -162,6 +159,7 @@ modal {
162159
font-size: 12px;
163160
line-height: 14px;
164161
color: $accent-gray-dark;
162+
text-align: center;
165163
}
166164

167165
.upload-progress__error {
@@ -180,3 +178,15 @@ modal {
180178
}
181179
}
182180
}
181+
182+
.upload-progess__links {
183+
margin-top: 40px;
184+
185+
a {
186+
display: inline-block;
187+
188+
&:first-child {
189+
margin-right: 10px;
190+
}
191+
}
192+
}

0 commit comments

Comments
 (0)
This repository has been archived.