Fix updating file attachments.

Review Request #10704 — Created Sept. 7, 2019 and submitted

Information

Review Board
release-4.0.x

Reviewers

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.
This was changed to send the form data via javascript, but that meant we
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
collection).

  • Updated various file attachments. Saw that drafts were created
    correctly and that the thumbnail at the correct index was reloaded.
  • Ran unit tests.
Summary ID
Fix updating file attachments.
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. This was changed to send the form data via javascript, but that meant we 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 collection). Testing Done: - Updated various file attachments. Saw that drafts were created correctly and that the thumbnail at the correct index was reloaded. - Ran unit tests.
b9f500ce918bb09e75ad8cb0c47f84db51376538
Description From Last Updated

Can you put parents around the comparison, just to help a little with the readability/scannability next to the =>?

chipx86chipx86
chipx86
  1. 
      
  2. Show all issues

    Can you put parents around the comparison, just to help a little with the readability/scannability next to the =>?

  3. 
      
david
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-4.0.x (013f51d)
Loading...