-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dataup 209 fix error msg cutoff #1885
Conversation
@@ -17,7 +17,7 @@ | |||
margin: 2em 4.5em; | |||
} | |||
|
|||
.text-button { | |||
.btn__text { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed the button name to match new BEM standard.
// If there is a button already in the area, it has to be removed, | ||
// and appened to the new document when additional errored files are added. | ||
this.deleteClearAllButton(); | ||
$dropzoneElem.append(this.makeClearAllButton()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deleted this and moved it to the 'added' file event to fix a bug with the clear all button.
}) | ||
.on('success', (file, serverResponse) => { | ||
var $successElem = $(file.previewElement); | ||
$successElem.find('#upload_progress_and_cancel').hide(); | ||
$successElem.find('#dz_file_row_1').css({"display": "flex", "align-items": "center"}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to use display: flex
to get the items in the row vertically aligned. I'm wasn't able to do this with any bootstrap trickery.
kbase-extension/static/kbase/js/widgets/narrative_core/upload/fileUploadWidget.js
Outdated
Show resolved
Hide resolved
kbase-extension/static/kbase/templates/data_staging/dropped_file.html
Outdated
Show resolved
Hide resolved
kbase-extension/static/kbase/templates/data_staging/dropped_file.html
Outdated
Show resolved
Hide resolved
<div id="upload_progress_and_cancel" style="display: inline;"> | ||
<div class="col-md-3 text-center"> | ||
<div class="progress progress-striped active dz-file__progress__bar" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"> | ||
<div class="progress-bar progress-bar-success" style="width:0%;" data-dz-uploadprogress></div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no unit for 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still needs the unit removing :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a reason this styling is inline vs css?
Can you add a bit more space around the icons? They look a little cramped as-is. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AJ already caught everything I would have asked to be fixed - otherwise things are looking good.
Small comment/tip for testing: but I've also been getting around testing with a 20GB file by setting the maxFileSize var in the fileUploadWidget manually to 2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few minor comments but looks good to me otherwise
@@ -168,6 +172,15 @@ define([ | |||
$('#clear-all-btn').remove(); | |||
}, | |||
|
|||
removeProgressBar: function($dropzoneElem) { | |||
if (this.dropzone.getQueuedFiles().length === 0 && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor but it should be enough to say .length without the ===0 check
<div id="upload_progress_and_cancel" style="display: inline;"> | ||
<div class="col-md-3 text-center"> | ||
<div class="progress progress-striped active dz-file__progress__bar" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"> | ||
<div class="progress-bar progress-bar-success" style="width:0%;" data-dz-uploadprogress></div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a reason this styling is inline vs css?
$successElem.find('#dz_file_row_1').css({'display': 'flex', 'align-items': 'center'}); | ||
$successElem.find('#success_icon').css('display', 'flex'); | ||
$successElem.find('#success_message').css('display', 'inline'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will there only ever be one file loading at a time -- i.e. will the IDs always be unique?
Can we change these so that rather than adding/removing inline styles, we are adding/removing a class instead? That way, all the css info can go in the stylesheet.
e.g.
<!-- this is not the real html, I made it up as an example -->
<div class="dz-file__status__success dz-file__status__success__hidden">
<span>Completed</span>
<i class="fa fa-2x fa-check-circle dz-file__status__icon" aria-hidden="true"></i>
</div>
<div class="dz-file__status__error dz-file__status__error__hidden">
<span>ZOMG ERROR!</span>
<i class="fa fa-2x fa-check-circle dz-file__status__icon" aria-hidden="true"></i>
</div>
.dz-file__status__success {
display: flex;
...
}
.dz-file__status__success__hidden {
display: none;
}
$successElem.find('#success_icon').removeClass('dz-file__status__success__hidden')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this code only changes the file template (that is shown in dropzone) for a the single file. The default template, which creates each file's html won't be changed by the .on('errorr'... changes. I don't know if that made sense. If it didn't, let me know and I can explain on a quick zoom call. I can work on making the styling changes in classes instead of jquery stuff :)
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Description of PR purpose/changes
This PR alters the file row UI in the dropzone area. On success and error, the file row has been updated to reflect this figma mock: https://www.figma.com/file/zBQcHiLV4FlIkD3Y1ogNcy/concept-sketches2?node-id=13%3A153
Jira Ticket / Issue
https://kbase-jira.atlassian.net/browse/DATAUP-209
Testing Instructions
To test this PR, run the narrative locally and navigate to the staging area. Drop a file that is larger than the max file size (20). This will cause the file to error and you will be able to see the changes.
To view the successful file upload, you should see it flash briefly upon success. If you would like to view it for a longer period, open devtools and put a break point on line
108
in filefileUploadWidget.js
.A question I am currently asking Mallory: If the successful files are cleared immediately, do we need the brief flash of the success styling? Does it make sense to leave those files in the dropzone or should we just remove it immediately?
Dev Checklist:
Updating Version and Release Notes (if applicable)