-
-
Notifications
You must be signed in to change notification settings - Fork 230
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
Add photo field to inspector form #2965
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2965 +/- ##
==========================================
- Coverage 83.50% 83.48% -0.02%
==========================================
Files 250 250
Lines 15616 15620 +4
Branches 2921 2922 +1
==========================================
+ Hits 13040 13041 +1
- Misses 1655 1657 +2
- Partials 921 922 +1
Continue to review full report at Codecov.
|
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 small suggestions is all.
2b1d35d
to
0828ab6
Compare
While demo-ing the inspector tool on staging @dracos noticed that this change actually breaks the offline "save submitted form offline and submit to server when back online" functionality. Looks like that doesn't handle multipart forms correctly (it's assuming it's just a Also worth noting that |
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.
Other than the thing you've just mentioned, changes all look good - I think there's another partial you could have extracted in report/new/form_report.html?
77902e4
to
809c7c0
Compare
a244d66
to
eb8f08f
Compare
eb8f08f
to
a0d720c
Compare
a0d720c
to
85c03e3
Compare
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.
The Dropzone widget doesn't load if the report is loaded from the sidebar (e.g. on /reports
or /my/planned
):
If you hit reload or visit the report URL directly it's fine though:
(guessing it's not running the Dropzone JS after AJAX loading the report content)
Submitting the form with a photo offline on iOS also results in a "Safari cannot open the page because your iPhone is not connected to the internet" message, which I've not yet been able to track down the cause of. It looks like it's trying to do a POST to /report/<id>
instead of being handled by the JS/service worker.
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.
That looks to be the fix for the dropzone issue, certainly. This has been round long enough, so I'd say let's tidy/merge even if there is an iOS issue? I can't see what it would be, though :-/ Could hide form from iOS users if people start using it in anger, and/or revisit if/as we work on more full offline support, I guess.
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.
Agreed with @dracos that we should ship this sooner rather than later. However I don't think we can do that in the current state with the iOS bug as that's a bit of a showstopper for any staff affected. Removing the fields for offline iOS users seems like a good compromise for now.
The most recent two commits should sort the iOS issue 👍 @dracos do they look ok? |
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.
One unneeded commit (if I've understood it right) is all! Watch out for touchscreen desktop macs I guess ;-/
Open a new ticket about getting photo upload working offline I guess. Did you get any useful info in debugging it as to why it wasn't being handled by the service worker?
And I guess another ticket for having an offline-only Dropzone that could display the same as normal usage but only set the client input rather than try and upload async.
e103dd2
to
647be7e
Compare
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.
One bit I think would be better in the other commit, but meh :) Phewee.
@@ -302,6 +302,14 @@ fixmystreet.offline = (function() { | |||
$('.moderate-display.segmented-control, .shadow-wrap, #update_form, #report-cta, .mysoc-footer, .nav-wrapper').hide(); | |||
$('.js-back-to-report-list').attr('href', '/my/planned'); | |||
|
|||
// On iOS we want to hide the photo fields on the offline inspector |
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.
Pedantic, but I guess this should be in the following commit, as in this commit, offline support is just broken for everything because the changes in the following commit have not yet been made.
This adds the code for photo uploads from the regular update form to the inspector form, and adds details to the documentation.
This manually reconstructs the POST as there is no support for formData in safari, plus our storage mechanism does not handle formData as it's not a simple object.
647be7e
to
ae687e6
Compare
This adds a photo upload field to the inspector form.
Fixes #2902
Related to #2901