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

Commit 52ae455

Browse files
author
Jenkins Continuous Integration Server
committed
Merge commit '0ce72b8197e4b3ee5f0d1e3388581baa921eaffe' into HEAD
2 parents 7e4b4eb + 0ce72b8 commit 52ae455

File tree

14 files changed

+63
-44
lines changed

14 files changed

+63
-44
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ styleguide
1212
.project
1313
.awspublish-app.topcoder-dev.com
1414
npm-debug.log
15+
*.swp

app/directives/tc-fp-file-input/tc-fp-file-input.directive.js

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,30 @@ import _ from 'lodash'
3232
scope.filePath += _.join([userId, scope.fieldId, (new Date()).valueOf()], '-') + '.zip'
3333
}
3434
var dragAreaClasses = 'tc-fp-file-drag-drop'
35-
// set extensions
35+
var dragText = ''
36+
// set mimeTypes
3637
if (scope.fieldId.indexOf('ZIP') > -1) {
37-
scope.extensions = '.zip'
38+
scope.mimeTypes = _.join([
39+
'application/x-download',
40+
'application/download',
41+
'application/zip',
42+
'application/x-zip',
43+
'application/x-zip-compressed',
44+
'application/octet-stream',
45+
'application/x-compress',
46+
'application/x-compressed',
47+
'multipart/x-zip'
48+
], ',')
49+
dragText = 'Drag and drop your .zip file here (500MB max) <br> or'
3850
} else if (scope.fieldId.indexOf('DESIGN_COVER') > -1) {
39-
scope.extensions = '.png,.jpeg,.jpg,.bmp'
51+
scope.mimeTypes = 'image/png,image/jpeg,image/bmp'
4052
dragAreaClasses += ' tc-fp-file-drag-drop-image'
53+
dragText = 'Drag and drop your .png or .jpg file here <br> or'
4154
}
4255

4356
// set default services
4457
scope.fpServices = scope.fpServices || 'COMPUTER,GOOGLE_DRIVE,BOX,DROPBOX'
45-
scope.fpContainer = CONSTANTS.FILE_PICKER_SUBMISSION_CONTAINER_NAME || 'submission-staging-dev'
58+
scope.fpContainer = CONSTANTS.FILE_PICKER_SUBMISSION_CONTAINER_NAME
4659

4760
// set max size
4861
scope.maxSize = 500 * 1024 * 1024
@@ -63,8 +76,9 @@ import _ from 'lodash'
6376
input.setAttribute('data-fp-services', scope.fpServices)
6477
input.setAttribute('data-fp-button-class', 'tc-btn')
6578
input.setAttribute('data-fp-drag-class', dragAreaClasses)
79+
input.setAttribute('data-fp-drag-text', dragText)
6680
input.setAttribute('data-fp-multiple', false)
67-
input.setAttribute('data-fp-extensions', scope.extensions)
81+
input.setAttribute('data-fp-mimetypes', scope.mimeTypes)
6882
input.setAttribute('data-fp-store-location', 's3')
6983
input.setAttribute('data-fp-store-container', scope.fpContainer)
7084
input.setAttribute('data-fp-store-path', scope.filePath)

app/directives/tc-fp-file-input/tc-fp-file-input.jade

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.tc-file-field__label
22
label.tc-label {{labelText}}
3-
span.lowercase(ng-if="showFileType") {{ ' *(.' + fileType + ')'}}
3+
//- span.lowercase(ng-if="showFileType") {{ ' *(.' + fileType + ')'}}
44
55
.tc-file-field__inputs
66
.tc-label__wrapper
@@ -11,6 +11,5 @@
1111
ng-model="ngModel",
1212
ng-required="mandatory",
1313
data-fp-button-text="Pick A File",
14-
data-fp-drag-text="&nbsp;",
1514
on-success="onFileSeleted(event.fpfile)"
1615
)

app/services/api.service.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ import _ from 'lodash'
6060
case 500: // SERVER ERROR
6161
case 503: // HTTP_503_SERVICE_UNAVAILABLE
6262
default:
63-
logger.error('Restangular Error Interceptor', response)
63+
logger.debug('Restangular Error Interceptor', response)
6464
return true // error not handled
6565
}
6666
})
@@ -146,7 +146,7 @@ import _ from 'lodash'
146146
case 500: // SERVER ERROR
147147
case 503: // HTTP_503_SERVICE_UNAVAILABLE
148148
default:
149-
logger.error('Restangular Error Interceptor ', response)
149+
logger.debug('Restangular Error Interceptor ', response)
150150
return true // error not handled
151151
}
152152
})

app/services/tcAuth.service.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ import { getCurrentUser, logout as doLogout } from './userv3.service.js'
1919
// logout of all browsers
2020
return doLogout().then(function() {
2121
$rootScope.$broadcast(CONSTANTS.EVENT_USER_LOGGED_OUT)
22+
// resolve the promise
23+
return true
2224
})
2325
}
2426

app/submissions/submissions.module.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import angular from 'angular'
1515
angular.module('tc.submissions', dependencies)
1616
.config(['filepickerProvider', 'CONSTANTS',
1717
function (filepickerProvider, CONSTANTS) {
18-
filepickerProvider.setKey(CONSTANTS.FILE_PICKER_API_KEY || 'AzFINuQoqTmqw0QEoaw9az')
18+
filepickerProvider.setKey(CONSTANTS.FILE_PICKER_API_KEY)
1919
}
2020
])
2121

app/submissions/submit-design-files/submit-design-files.controller.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import _ from 'lodash'
1010

1111
function SubmitDesignFilesController($scope, $window, $stateParams, logger, UserService, SubmissionsService, challengeToSubmitTo) {
1212
if (!challengeToSubmitTo.challenge) { return }
13+
var challengeTitle = challengeToSubmitTo.challenge.name
1314

1415
var vm = this
1516
vm.urlRegEx = new RegExp(/^(http(s?):\/\/)?(www\.)?[a-zA-Z0-9\.\-\_]+(\.[a-zA-Z]{2,3})+(\/[a-zA-Z0-9\_\-\s\.\/\?\%\#\&\=]*)?$/)
@@ -36,6 +37,7 @@ import _ from 'lodash'
3637
stockArts: [],
3738
hasAgreedToTerms: false
3839
}
40+
vm.progressTitle = ''
3941

4042
var userId = parseInt(UserService.getUserIdentity().userId)
4143

@@ -114,6 +116,8 @@ import _ from 'lodash'
114116
vm.errorInUpload = false
115117
vm.uploadProgress = 0
116118
vm.showProgress = true
119+
vm.progressTitle = 'Uploading submission for "' + challengeTitle + '"'
120+
vm.uploadProgressMessage = 'Hey, your work is AWESOME! Please don’t close the window while the upload is in progress, or you’ll lose all files!'
117121
vm.preparing = true
118122
vm.finishing = false
119123
vm.finished = false
@@ -178,6 +182,8 @@ import _ from 'lodash'
178182
vm.preparing = false
179183
vm.finishing = false
180184
vm.finished = true
185+
vm.progressTitle = 'Submission completed for "' + challengeTitle + '"'
186+
vm.uploadProgressMessage = 'Thanks for participating! We\'ve received your submission and will send you an email shortly to confirm and explain what happens next.'
181187
}
182188
} else {
183189
// assume it to be error condition

app/submissions/submit-design-files/submit-design-files.jade

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
p Please be sure to double-check that you have submitted the correct files and that your JPG files (if applicable) are in RGB color mode.
2525

26-
a(ng-href="https://help.{{DOMAIN}}/hc/en-us/articles/219122667-Formatting-Your-Submission-for-Design-Challenges") Learn more about formatting your submission file
26+
a(ng-href="https://help.{{DOMAIN}}/hc/en-us/articles/219122667-Formatting-Your-Submission-for-Design-Challenges") Learn more about formatting your submission file.
2727

2828
.form-block__fields
2929
.fieldset.files
@@ -161,12 +161,12 @@
161161
modal.transition(show="vm.showProgress", background-click-close="false", style="background-color:white;")
162162
.upload-progress(ng-class="{'upload-progress--error': vm.errorInUpload}")
163163
.upload-progress__title
164-
p Uploading submission for "{{submissions.challengeTitle}}"
164+
p {{ vm.progressTitle }}
165165

166166
img.upload-progress__image(src=require("../../../assets/images/skills/id-180.svg"), ng-hide="vm.errorInUpload")
167167
img.upload-progress__image--error(src=require("../../../assets/images/robot-embarresed.svg"), ng-show="vm.errorInUpload")
168168

169-
p.upload-progress__message(ng-hide="vm.errorInUpload") Hey, your work is AWESOME! Please don’t close the window while the upload is in progress, or you’ll lose all files!
169+
p.upload-progress__message(ng-hide="vm.errorInUpload") {{ vm.uploadProgressMessage}}
170170

171171
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.
172172

@@ -177,7 +177,6 @@ modal.transition(show="vm.showProgress", background-click-close="false", style="
177177
p Finishing...
178178

179179
.upload-progress__finished(ng-show="vm.finished && !vm.errorInUpload")
180-
p Finished!
181180

182181
.upload-progess__links
183182
a.tc-btn.tc-btn-s(ng-href="https://www.{{DOMAIN}}/challenge-details/{{submissions.challengeId}}/?type={{submissions.track}}") Back to the challenge

app/topcoder.constants.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ angular.module('CONSTANTS', []).constant('CONSTANTS', {
2121
'SWIFT_PROGRAM_URL' : process.env.SWIFT_PROGRAM_URL,
2222
'TCO16_URL' : process.env.TCO16_URL,
2323
'ACCOUNTS_APP_URL' : process.env.ACCOUNTS_APP_URL,
24+
'FILE_PICKER_API_KEY' : process.env.FILE_PICKER_API_KEY,
25+
'FILE_PICKER_SUBMISSION_CONTAINER_NAME': process.env.FILE_PICKER_SUBMISSION_CONTAINER_NAME,
2426

2527
'NEW_CHALLENGES_URL' : 'https://www.topcoder.com/challenges/develop/upcoming/',
2628
'SWIFT_PROGRAM_ID' : 3445,

assets/css/directives/badge-tooltip.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
float: left;
2121
}
2222

23-
2423
.subBadge {
2524
height: 48px;
2625
float: left;

0 commit comments

Comments
 (0)