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

FIx text and images are displayed cropped if folder has long name && Filters isn`t applied on the "Category" #29633

Merged
merged 18 commits into from
Aug 25, 2020

Conversation

Nazar65
Copy link
Member

@Nazar65 Nazar65 commented Aug 18, 2020

Description (*)

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes Text and images are displayed cropped if folder has long name adobe-stock-integration#1758: Text and images are displayed cropped if folder has long name
  2. Fixes Filters aren`t applied on the "Category" grid  adobe-stock-integration#1763: Filters isn`t applied on the "Category"

Manual testing scenarios (*)

  1. Go to Content -> Media Gallery
  2. Create a folder with long name (for example: TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEESSSSSSSSSSSSSSSSSSSSSSSTTTTTTTTTTTTTT)
  3. Select it

"We couldn't find any records." text should be displayed without cropping it there is no any image. If there is any image, it should also be displayed without cropping.

  1. Go to Content -> Media Gallery
  2. Select uploaded image
  3. Click on three dots -> View Details
  4. Click on the link 'Categories..." in 'Used in' attribute
  5. Delete the ?filters[asset_id]=[1] part of request from address line -> Press Enter key
  6. Pay attention to the 'Active filters:'
  7. Click on the "Clear all" link
  8. Waite a few seconds and reload the page
  9. Click on the "Filters" button
  10. Enter any word in the "ID" field -> Apply Filters
  11. Try to apply any filter

Filter should be applied

Questions or comments

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 Aug 18, 2020

Hi @Nazar65. 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

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests

You can find more information about the builds here

ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

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

⚠️ According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@Nazar65
Copy link
Member Author

Nazar65 commented Aug 18, 2020

@magento run all tests

@sivaschenko sivaschenko added Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Severity: S1 Affects critical data or functionality and forces users to employ a workaround. labels Aug 18, 2020
Copy link
Member

@sivaschenko sivaschenko left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @Nazar65 ! Can you please cover the fixed cases with the MFTF tests:

  1. Creating a folder with more than 50 characters name
  2. Applying a filter after following the link with url-filter-applier

@@ -84,8 +84,9 @@ private function getDirectories(): array
}

$pathArray = explode('/', $path);
$displayName = strlen(end($pathArray)) > 50 ? substr(end($pathArray),0,50)."..." : end($pathArray);
Copy link
Member

Choose a reason for hiding this comment

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

Please create a constant for 50

Copy link
Member Author

Choose a reason for hiding this comment

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

ok

@Nazar65
Copy link
Member Author

Nazar65 commented Aug 19, 2020

@magento run all tests

@Nazar65
Copy link
Member Author

Nazar65 commented Aug 19, 2020

@magento run all tests

@Nazar65
Copy link
Member Author

Nazar65 commented Aug 19, 2020

@magento run all tests

$directories[] = [
'data' => count($pathArray) > 0 ? end($pathArray) : $path,
'data' => count($pathArray) > 0 ? $displayName : $path,
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure it's a right way to trim name on the backend, it would be better adapt frontend application to handle long names. Let's imagine that someone will decide to extend frontend implementation and provide new design (where long names will look good) and with such approach, we are limiting 3d party developers to use trimmed names only.

Copy link
Member Author

@Nazar65 Nazar65 Aug 20, 2020

Choose a reason for hiding this comment

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

agree but there is some limitation in a frontend so i decided it can be more easier to fix this in a back-end part, but i will try one more time fix this behavior on a frontend.

Copy link
Member Author

Choose a reason for hiding this comment

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

@sidolov i'v changed implementation, instead of cutting folders as it was done in old media gallery and there is also this issue here ->
Screenshot_2020-08-20 Default Category (ID 2) Categories Inventory Catalog Magento Admin

so when we have a long folders and the block is too small for it i had added ability to scroll, as we can have alot of folders created one in one and soon or later we also have same issue, so i think only adding ability to vertical scrolling when there is a lot folder will be correct

Copy link
Contributor

Choose a reason for hiding this comment

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

@Nazar65 sounds good to me! Look like it's the only solution in such case.

@ghost ghost assigned sidolov Aug 19, 2020
@Nazar65
Copy link
Member Author

Nazar65 commented Aug 20, 2020

@magento run all tests

@Nazar65
Copy link
Member Author

Nazar65 commented Aug 21, 2020

@sidolov there was some style issue, so i've added few new commits, need to review it again

@Nazar65
Copy link
Member Author

Nazar65 commented Aug 21, 2020

@magento run all tests

@engcom-Lima engcom-Lima added the QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope label Aug 21, 2020
@magento-engcom-team
Copy link
Contributor

Hi @sidolov, thank you for the review.
ENGCOM-8047 has been created to process this Pull Request
✳️ @sidolov, 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

@engcom-Lima
Copy link
Contributor

✔️ QA Passed
See dependent comment

@Nazar65
Copy link
Member Author

Nazar65 commented Aug 21, 2020

@magento run all tests

@sivaschenko sivaschenko added the Auto-Tests: Covered All changes in Pull Request is covered by auto-tests label Aug 24, 2020
magento-engcom-team pushed a commit that referenced this pull request Aug 25, 2020
…long name && Filters isn`t applied on the "Category" #29633
@magento-engcom-team magento-engcom-team merged commit 0f70673 into magento:2.4-develop Aug 25, 2020
@m2-assistant
Copy link

m2-assistant bot commented Aug 25, 2020

Hi @Nazar65, 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.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Frontend Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Component: Catalog Component: MediaGalleryCatalogUi Component: MediaGalleryUi Component: Ui Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: accept Project: ASI QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope Release Line: 2.4 Severity: S1 Affects critical data or functionality and forces users to employ a workaround.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Filters aren`t applied on the "Category" grid Text and images are displayed cropped if folder has long name
6 participants