Skip to content
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

Allow valid 0-value in renderUI of Progress widget #1173

Merged
merged 2 commits into from
Aug 1, 2016

Conversation

AFaust
Copy link
Contributor

@AFaust AFaust commented Jul 31, 2016

Currently the Progress widget is only displaying/tracking any progress if at least one "item" (may not be used for file-based actions) has been "done". The simple truthy-check within a condition of renderUI eliminates 0 as a valid value despite it being perfectly valid for an initial progress update at the start of a long running operation.

This PR allows 0-values in renderUI by adapting the check to consider all non-negative integers as valid and explicitly checking for NaN.

@AFaust AFaust force-pushed the Progress-nonTruthyValidProgress branch from 3a62e52 to d6cf57a Compare July 31, 2016 18:02
@draperd
Copy link

draperd commented Aug 1, 2016

I've checked out your branch locally and I've getting unit test failures. However, the unit test is quite old and may need some updating as it's not the best... I'll test for real on Share (using the download as zip action where this is used). If it works, then I'll update the unit test.

@draperd
Copy link

draperd commented Aug 1, 2016

Sadly, this doesn't appear to be working on Share either.... when downloading as a zip you do not see the progress bar update. I can't merge this as is - it looks like the unit test has done it's job here.

I think (based on IRC comments) that you've had issues getting the the unit tests up and running, but it would definitely be useful.

I'll have a dig into the issue to see if I can understand what the problem might be.

// 0 is a legal numeric value (e.g. initial "start" progress)
// can't use simple truthy vs non-truthy check
if (isNaN(total) || total < 0 || isNaN(done) || done < 0 ||
isNaN(filesAdded) || filesAddded < 0 || isNaN(totalFiles) || totalFiles < 0)
Copy link

@draperd draperd Aug 1, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the issue here is a simple typo... filesAddded needs to be filesAdded (you've got an extra "d" in there!)

@AFaust
Copy link
Contributor Author

AFaust commented Aug 1, 2016

I had planned to try one final time to get the whole node.js ... working while I am on this vacation. May as well be tomorrow then.

@draperd
Copy link

draperd commented Aug 1, 2016

If you can fix your typo I should be able to merge this - the unit tests will pass and I've verified with the download as zip action on Share as well.

When I opened up the file in in Sublime, JSHint highlighted the error immediately. I'm not sure if you've tried Sublime, but it works really well for JS changes.

Also, the setup instructions should get everything running for you... if they don't work for you then it would be good to know. We have had them verified in the past by Windows users.

@draperd
Copy link

draperd commented Aug 1, 2016

Thanks for making that update - I'll merge

@draperd draperd merged commit 1934f88 into Alfresco:develop Aug 1, 2016
@AFaust AFaust deleted the Progress-nonTruthyValidProgress branch August 4, 2016 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants