Skip to content

Resolve "Show the size of the files in image diff"

What does this MR do?

This MR re-adds the 2-Up Image Viewer Diff file sizes.

It was removed as a regression in a previous version, so this MR simply passes the values provided by the backend for diff.old_size and diff.new_size into the Diff Viewer, which passes those values down until they reach the 2 Up viewer.

Notable Changes

There are four notable "groups" of changes in this MR.

  1. The file sizes are passed down from the top level diff-content component all the way to the viewer component, which - when it's a TwoUpViewer - renders those file sizes via image-viewers.
  2. The ImageViewer is tested to ensure that it properly renders (or does not render, based on other options) the file size. the ImageViewer was not tested at all, so this tests the features that are under consideration, but not every feature.
  3. When adding the tests for the newly-added props, a lot of redundant prop data was abstracted to a single POJO (in each file) and extended when necessary.

Screenshots

Before After
noSizeBefore withSizeAfter

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • ~~Label as security and @ mention @gitlab-com/gl-security/appsec~~
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Regarding #32145 (closed)

Edited by 🤖 GitLab Bot 🤖

Merge request reports