Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore and backup image sizes alongside the sources properties #242

Merged

Commits on Mar 19, 2022

  1. Add class to mimic image operations on the editor.

    The class is in charge of performing operations to an image
    as if a user is performing those actions from the image editor
    but from the BE. This class is a utility class to be used
    from within the test context to mimic the user behavior of
    performing edits into an image.
    mitogh committed Mar 19, 2022
    Configuration menu
    Copy the full SHA
    a6f5e07 View commit details
    Browse the repository at this point in the history
  2. Restore and backup image sizes including sources.

    When an image is edited the `sources` properties is going to be backup with
    the rest of the sizes properties, however that's not the case for the `full`
    size which is a virtual type and the top level `sources` would be moved
    into the backup metadata.
    
    When the image is restored any edited image available in the sources array would
    be removed before the restore takes place. The `sources` property for the `full-orig`
    would be placed at the top level `sources` with the rest of the metadata.
    mitogh committed Mar 19, 2022
    Configuration menu
    Copy the full SHA
    4820501 View commit details
    Browse the repository at this point in the history

Commits on Mar 22, 2022

  1. Configuration menu
    Copy the full SHA
    ab7bf05 View commit details
    Browse the repository at this point in the history

Commits on Mar 23, 2022

  1. Remove handling of edited images

    This would be handled once #158 is merged so
    the current approach can be adjusted accordingly.
    mitogh committed Mar 23, 2022
    Configuration menu
    Copy the full SHA
    7e82041 View commit details
    Browse the repository at this point in the history
  2. Update the success logic to handle additional cases.

    When an image is edited using a target other than the
    all and the thumbnail make sure the `success` method
    returns the correct value.
    mitogh committed Mar 23, 2022
    Configuration menu
    Copy the full SHA
    a2b82e3 View commit details
    Browse the repository at this point in the history
  3. Update logic to store and restore backup.

    Due to the only value that is not correctly stored is
    the top level sources attributes this now is stored
    in a separate meta value. Stored in `_wp_attachment_backup_sources`
    
    Logic was added to handle scenarios where only the thumbnail
    or all images except the thumbnail are modified.
    mitogh committed Mar 23, 2022
    Configuration menu
    Copy the full SHA
    ba0cbdf View commit details
    Browse the repository at this point in the history
  4. Remove empty space

    Co-authored-by: Felix Arntz <felixarntz@users.noreply.github.com>
    mitogh and felixarntz committed Mar 23, 2022
    Configuration menu
    Copy the full SHA
    2dd29d8 View commit details
    Browse the repository at this point in the history
  5. Update prefix on functions

    Co-authored-by: Felix Arntz <felixarntz@users.noreply.github.com>
    mitogh and felixarntz committed Mar 23, 2022
    Configuration menu
    Copy the full SHA
    b16cee1 View commit details
    Browse the repository at this point in the history
  6. Update prefix on functions

    Co-authored-by: Felix Arntz <felixarntz@users.noreply.github.com>
    mitogh and felixarntz committed Mar 23, 2022
    Configuration menu
    Copy the full SHA
    8a8e967 View commit details
    Browse the repository at this point in the history
  7. Update prefix on functions

    Co-authored-by: Felix Arntz <felixarntz@users.noreply.github.com>
    mitogh and felixarntz committed Mar 23, 2022
    Configuration menu
    Copy the full SHA
    322dd3d View commit details
    Browse the repository at this point in the history
  8. Update hooks reference

    mitogh committed Mar 23, 2022
    Configuration menu
    Copy the full SHA
    226a5aa View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    8a809ed View commit details
    Browse the repository at this point in the history

Commits on Mar 24, 2022

  1. Configuration menu
    Copy the full SHA
    6d134e5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    76307e6 View commit details
    Browse the repository at this point in the history

Commits on Mar 26, 2022

  1. Remove the need of auxilary variable to hold the sources

    Move the hooks for the update right into the place where they are
    actually used.
    mitogh committed Mar 26, 2022
    Configuration menu
    Copy the full SHA
    951c4ca View commit details
    Browse the repository at this point in the history

Commits on Mar 28, 2022

  1. Add since doc block

    Co-authored-by: Felix Arntz <felixarntz@users.noreply.github.com>
    mitogh and felixarntz committed Mar 28, 2022
    Configuration menu
    Copy the full SHA
    61e25e8 View commit details
    Browse the repository at this point in the history
  2. Align parameters on the doc block

    Co-authored-by: Felix Arntz <felixarntz@users.noreply.github.com>
    mitogh and felixarntz committed Mar 28, 2022
    Configuration menu
    Copy the full SHA
    4c26f4f View commit details
    Browse the repository at this point in the history
  3. Removal of non required parameter

    The `backup_sizes` parameter was not used so it can be safely removed
    from the code execution.
    mitogh committed Mar 28, 2022
    Configuration menu
    Copy the full SHA
    973a7b8 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    cb35f42 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    7880f6b View commit details
    Browse the repository at this point in the history
  6. Move logic of the hook into a variable

    Reuse the hook as now is stored in a variable, so it can be reused in
    both hooks.
    mitogh committed Mar 28, 2022
    Configuration menu
    Copy the full SHA
    ca8d28e View commit details
    Browse the repository at this point in the history

Commits on Mar 30, 2022

  1. Add white spaces on tests

    Co-authored-by: Eugene Manuilov <manuilov@google.com>
    mitogh and eugene-manuilov committed Mar 30, 2022
    Configuration menu
    Copy the full SHA
    c381398 View commit details
    Browse the repository at this point in the history
  2. Add white spaces on tests

    Co-authored-by: Eugene Manuilov <manuilov@google.com>
    mitogh and eugene-manuilov committed Mar 30, 2022
    Configuration menu
    Copy the full SHA
    93e0d01 View commit details
    Browse the repository at this point in the history
  3. Removal of sanitize_text_field due this value is not required.

    Co-authored-by: Eugene Manuilov <manuilov@google.com>
    mitogh and eugene-manuilov committed Mar 30, 2022
    Configuration menu
    Copy the full SHA
    c165a11 View commit details
    Browse the repository at this point in the history
  4. Run logic only if was executed when doing ajax.

    Co-authored-by: Eugene Manuilov <manuilov@google.com>
    mitogh and eugene-manuilov committed Mar 30, 2022
    Configuration menu
    Copy the full SHA
    7d96583 View commit details
    Browse the repository at this point in the history
  5. Update code flow for more performant checks

    Make sure the code performns in a more structured way
    mitogh committed Mar 30, 2022
    Configuration menu
    Copy the full SHA
    7a113d3 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    e202548 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    188c7df View commit details
    Browse the repository at this point in the history