Fix updating file attachments.
Review Request #10704 — Created Sept. 7, 2019 and submitted
The "Update" functionality for file attachments was broken in several
ways. The most basic of these was an error that got introduced sometime
whereby we weren't plumbing the review request editor through into the
upload dialog, and so it couldn't create the new file attachment object.
This was an easy fix, but exposed other issues.
We used to reload the entire page after creating a new file attachment.
no longer reloaded the page, and so the new file attachment would be
appended to the list of file attachments and show up as a new one at the
end of the list, rather than replacing the old revision. I've fixed up
the review request editor to correctly manage its collection of file
attachment objects, and the editor view to add new file attachments at
the correct index (and remove thumbnails as they're removed from the
- Updated various file attachments. Saw that drafts were created
correctly and that the thumbnail at the correct index was reloaded.
- Ran unit tests.
Can you put parents around the comparison, just to help a little with the readability/scannability next to the =>?