adds banner error if no image submitted with reportback#6286
adds banner error if no image submitted with reportback#6286katiecrane merged 3 commits intoDoSomethingArchive:devfrom
Conversation
|
handing this over to a :js:smen |
| if (!($reportbackSubmissions.find(".messages.error").length > 0)) { | ||
| $reportbackSubmissions.prepend("<div class='messages error'>Oops! Make sure to upload a photo of you completing the campaign before submitting.</div>"); | ||
| } | ||
| return done({ |
There was a problem hiding this comment.
Looks like indentation might be a bit off here.
|
Not 100% necessary for merge, but I'd like to get in the habit of updating files to ES2015 syntax whenever we touch them. It should be pretty straightforward to remove the |
| * Initialize the ImageUpload interface. | ||
| */ | ||
| imageUploadInit: function() { | ||
| imageUpload(this.$uploadButton); |
There was a problem hiding this comment.
Hmm, is this from this rule? I think if we remove the new operator, all the references to this inside the ImageUpload function will refer to the window object, rather than being stored on the image uploader itself. I think a good solution for now would be to store new ImageUpload to a property on the Reportback object to silence the warning without changing behavior.
There was a problem hiding this comment.
@DFurnes Sure is. Okay I will look into that. Thanks!
|
The rest of the changes in b9fbc51 look good! 👍 If you're up for it, it'd be great to remove the warnings from the |
|
@DFurnes Oh yeah, there are 3 changed files! Yeah I will go for that one as well |
|
|
What's this PR do?
If a user tries to submit a reportback with no image attached, they get a "Oops! Make sure to upload a photo of you completing the campaign before submitting." in the same way that they get an error when uploading their picture if their image is too small.
How should this be manually tested?
Try to submit a reportback with no image. Try to submit a reportback with no image a few times. Try to submit a correct reportback to make sure the error goes away. Yay!
What are the relevant tickets?
Fixes #5141
cc: @weerd @DFurnes