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

Refactoring of the plugin responsible for the image/directory delete functionality + adjust tests #27994

Conversation

coderimus
Copy link
Contributor

@coderimus coderimus commented Apr 26, 2020

Description (*)

While working on one of the ASI issues I found one bug and the way we can improve some part of the MediaGallery. Also, fix a bug with deleting an image uploaded to the root media folder.

This PR provides:

  • Fix bug for media file uploaded to the media root folder.
  • Refactoring to the MediaGallery plugin responsible for image or folder delete functionality. I removed deprecated classes and start to use recommended.
  • Adjust Unit tests for the current MediaGallery functionality. They were good but I have to combine them and add changes required to the current implementation.
  • Fix _fixture classes for MediaGallery.

Related Pull Requests

N/A

Fixed Issues (if relevant)

N/A

Manual testing scenarios (*)

Image delete test
Magento 2 v2.4-develop

  1. Log in to the Magento Admin
  2. Go to the Catalog -> Categories
  3. Click on the Content collapsable panel and press Select from gallery
  4. Upload an image and validate that it was uploaded to the physical storage and entry created in media_gallery_asset for the uploaded image
  5. Select uploaded image in Media gallery and press Delete Selected in the Meda gallery control panel

Accepted result: image deleted from the physical storage and from the media_gallery_asset

Folder with images delete test
Magento 2 v2.4-develop

  1. Log in to the Magento Admin
  2. Go to the Catalog -> Categories
  3. Click on the Content collapsable panel and press Select from gallery
  4. Click on Create Folder and create a custom folder
  5. Select the newly created folder
  6. Upload several images to it and validate that they uploaded to the physical storage and entries created in media_gallery_asset for the uploaded images
  7. Select created folder with images in Media gallery and press Delete Folder in the Meda gallery control panel

Accepted result: images deleted from physical storage, folder deleted from physical storage and from the media_gallery_asset

Questions or comments

N/A

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

@m2-assistant
Copy link

m2-assistant bot commented Apr 26, 2020

Hi @coderimus. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Guide documentation.

@coderimus coderimus changed the title 1245/delete asset file from storage Fix delete image from the root media gallery folder and refactoring of the plugin responsible for image/directory delete Apr 26, 2020
@coderimus coderimus changed the title Fix delete image from the root media gallery folder and refactoring of the plugin responsible for image/directory delete Refactoring of the plugin responsible for the image/directory delete functionality + adjust tests Apr 26, 2020
@magento-engcom-team
Copy link
Contributor

Hi @sivaschenko, thank you for the review.
ENGCOM-7489 has been created to process this Pull Request
✳️ @sivaschenko, could you please add one of the following labels to the Pull Request?

Label Description
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests
Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests

@sivaschenko sivaschenko added the Auto-Tests: Covered All changes in Pull Request is covered by auto-tests label Apr 26, 2020
@sivaschenko
Copy link
Member

@coderimus can you please add the testing scenario for QA to be able to check the changes

@coderimus
Copy link
Contributor Author

@sivaschenko QA steps added. Please, validate.

Copy link
Contributor

@engcom-Bravo engcom-Bravo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ QA Failed

The Deleted image reappears in Megia Gallery

@sivaschenko
Copy link
Member

The issue with deleted image reappearing should be addressed by magento/adobe-stock-integration#1279

@ghost ghost dismissed sivaschenko’s stale review April 28, 2020 13:54

Pull Request state was updated. Re-review required.

@slavvka slavvka added this to the 2.4.0 milestone Apr 28, 2020
@magento-engcom-team
Copy link
Contributor

Hi @sivaschenko, thank you for the review.
ENGCOM-7489 has been created to process this Pull Request

magento-engcom-team pushed a commit that referenced this pull request Apr 29, 2020
@magento-engcom-team magento-engcom-team merged commit 4af3b0b into magento:2.4-develop Apr 29, 2020
@m2-assistant
Copy link

m2-assistant bot commented Apr 29, 2020

Hi @coderimus, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants