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

Commit 2bcfc00

Browse files
author
vikasrohit
authored
Merge pull request #858 from appirio-tech/feature/submission-bughunt-fixes
Feature/submission bughunt fixes
2 parents add29e7 + a1908a2 commit 2bcfc00

File tree

6 files changed

+43
-38
lines changed

6 files changed

+43
-38
lines changed

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,15 @@ 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 = 'application/zip'
39+
dragText = 'Drag and drop your .zip file here (500MB max) <br> or'
3840
} else if (scope.fieldId.indexOf('DESIGN_COVER') > -1) {
39-
scope.extensions = '.png,.jpeg,.jpg,.bmp'
41+
scope.mimeTypes = 'image/png,image/jpeg,image/bmp'
4042
dragAreaClasses += ' tc-fp-file-drag-drop-image'
43+
dragText = 'Drag and drop your .png or .jpg file here <br> or'
4144
}
4245

4346
// set default services
@@ -63,8 +66,9 @@ import _ from 'lodash'
6366
input.setAttribute('data-fp-services', scope.fpServices)
6467
input.setAttribute('data-fp-button-class', 'tc-btn')
6568
input.setAttribute('data-fp-drag-class', dragAreaClasses)
69+
input.setAttribute('data-fp-drag-text', dragText)
6670
input.setAttribute('data-fp-multiple', false)
67-
input.setAttribute('data-fp-extensions', scope.extensions)
71+
input.setAttribute('data-fp-mimetypes', scope.mimeTypes)
6872
input.setAttribute('data-fp-store-location', 's3')
6973
input.setAttribute('data-fp-store-container', scope.fpContainer)
7074
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/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

assets/css/directives/tc-fp-file-input.directive.scss

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,6 @@ tc-fp-file-input {
1818
width: 240px;
1919
}
2020

21-
.tc-file-field__input::after {
22-
content: 'or';
23-
font-size: 12px;
24-
line-height: 15px;
25-
color: $tc-gray-30;
26-
bottom: 85px;
27-
position: absolute;
28-
left: 50%;
29-
transform: translateX(-50%)
30-
}
31-
3221
.tc-btn {
3322
margin-bottom: 5px;
3423
position: absolute;
@@ -38,37 +27,37 @@ tc-fp-file-input {
3827
z-index: 1;
3928
}
4029

30+
.tc-label__asterisk {
31+
right: 0px;
32+
}
33+
4134
.tc-fp-file-drag-drop {
4235
width: calc(100% - 4px);
43-
position: absolute;
4436
left: 0;
4537
top: 0;
4638
height: 190px;
4739
width: 240px;
4840
position: relative;
41+
color: $tc-gray-50 !important;
42+
padding: 25px !important;
43+
margin-left: 0px !important;
44+
text-align: center;
45+
46+
// div used to show progress bar for drop upload
47+
> div {
48+
position: absolute;
49+
left: 0;
50+
top: 0;
51+
}
4952

53+
// span used for showing remove button
5054
> span {
5155
position: absolute;
5256
top: 0px;
5357
right: 0px;
5458
}
5559
}
5660

57-
.tc-fp-file-drag-drop::after {
58-
content: 'Drag and drop your .zip file here (500MB max)';
59-
color: $tc-gray-50;
60-
top: 25px;
61-
position: absolute;
62-
width: 198px;
63-
text-align: center;
64-
left: 50%;
65-
transform: translateX(-50%)
66-
}
67-
68-
.tc-fp-file-drag-drop-image::after {
69-
content: 'Drag and Drop your PNG or JPG file here';
70-
}
71-
7261
&.file-uploaded {
7362
.tc-file-field__input::after,
7463
.tc-fp-file-drag-drop::after {

assets/css/submissions/submit-file.scss

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ tc-fp-file-input {
7979
flex-wrap: wrap;
8080
justify-content: space-around;
8181

82-
@media screen and (min-width: 1000px) {
82+
@media screen and (min-width: 875px) {
8383
justify-content: space-between;
8484
}
8585
}
@@ -158,6 +158,8 @@ modal {
158158
line-height: 19px;
159159
color: $accent-gray;
160160
margin-top: 40px;
161+
padding: 0px 40px;
162+
text-align: center;
161163
}
162164

163165
.upload-progress__progress-bar {
@@ -193,6 +195,12 @@ modal {
193195
}
194196
}
195197
}
198+
199+
.upload-progress__error-action {
200+
button:not(:first-child) {
201+
margin-left: 10px;
202+
}
203+
}
196204
}
197205

198206
.upload-progess__links {

0 commit comments

Comments
 (0)