brennie got a fish trophy!
Fix issues with the new review request actions
Review Request #8228 — Created June 9, 2016 and submitted
The "Download Diff" action was hardcoding the URL for the revision of
the review request on first load. However, it was not updating the link
when the revision changed. Therefore, this action has been updated to
be a relative link toraw/
in the diffviewer, which was what the
previous code did. This way, it will always link to the correct diff
revision. We still use an absolute URL on the review request page
itself to generate a correct link.In addition, that action would be visible on review requests without
diffs due to a logic error (comparing the empty list toNone
). We now
just check if the review request has a repository instead.There have also been some edits made to the action template to generate
HTML that looks a bit better when rendered.Unit tests have been updated to address these issues. Unit tests for the
download diff action's URL have been removed becuase they are no longer
necessary.
- Ran unit tests.
- Verified the "Download Diff" action links to the currently selected
diff revision.
-
Tool: Pyflakes Processed Files: reviewboard/reviews/tests.py reviewboard/reviews/default_actions.py Ignored Files: reviewboard/templates/reviews/action.html Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/tests.py reviewboard/reviews/default_actions.py Ignored Files: reviewboard/templates/reviews/action.html
- Bugs:
- Description:
-
The "Download Diff" action was hardcoding the URL for the revision of
the review request on first load. However, it was not updating the link when the revision changed. Therefore, this action has been updated to be a relative link to raw/
in the diffviewer, which was what theprevious code did. This way, it will always link to the correct diff revision. We still use an absolute URL on the review request page itself to generate a correct link. In addition, that action would be visible on review requests without
diffs due to a logic error (comparing the empty list to None
). We nowjust check if the review request has a repository instead. + There have also been some edits made to the action template to generate
+ HTML that looks a bit better when rendered. + Unit tests have been updated to address these issues. Unit tests for the
download diff action's URL have been removed becuase they are no longer necessary.