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

Commit 6ba4d50

Browse files
author
vikasrohit
committed
AS#152122905738626, Files upload: dragging/dropping incorrect file leads to overlap with help text
-- Fixed, with catch been that 'or' keyword is not removed in case of file type does not match the required types because we don't get the event from filestack for this case.
1 parent 7aa6c1e commit 6ba4d50

File tree

3 files changed

+15
-17
lines changed

3 files changed

+15
-17
lines changed

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

Lines changed: 4 additions & 0 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+
var dragText = ''
3536
// set mimeTypes
3637
if (scope.fieldId.indexOf('ZIP') > -1) {
3738
scope.mimeTypes = 'application/zip'
39+
dragText = 'Drag and drop your .zip file here (500MB max)'
3840
} else if (scope.fieldId.indexOf('DESIGN_COVER') > -1) {
3941
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'
4144
}
4245

4346
// set default services
@@ -63,6 +66,7 @@ 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)
6771
input.setAttribute('data-fp-mimetypes', scope.mimeTypes)
6872
input.setAttribute('data-fp-store-location', 's3')

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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=" ",
1514
on-success="onFileSeleted(event.fpfile)"
1615
)

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

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,35 +40,30 @@ tc-fp-file-input {
4040

4141
.tc-fp-file-drag-drop {
4242
width: calc(100% - 4px);
43-
position: absolute;
4443
left: 0;
4544
top: 0;
4645
height: 190px;
4746
width: 240px;
4847
position: relative;
48+
color: $tc-gray-50 !important;
49+
padding: 25px !important;
50+
text-align: center;
4951

52+
// div used to show progress bar for drop upload
53+
> div {
54+
position: absolute;
55+
left: 0;
56+
top: 0;
57+
}
58+
59+
// span used for showing remove button
5060
> span {
5161
position: absolute;
5262
top: 0px;
5363
right: 0px;
5464
}
5565
}
5666

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-
7267
&.file-uploaded {
7368
.tc-file-field__input::after,
7469
.tc-fp-file-drag-drop::after {

0 commit comments

Comments
 (0)