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

The image details are not hidden when click on same image #25566

Merged
merged 8 commits into from
Nov 26, 2019
Merged

The image details are not hidden when click on same image #25566

merged 8 commits into from
Nov 26, 2019

Conversation

engcom-Golf
Copy link
Contributor

Description (*)

Fixed Issues (if relevant)

  1. The image details are not hidden when click on same image in the search result adobe-stock-integration#690 The image details are not hidden when click on same image in the search result adobe-stock-integration#690

Manual testing scenarios (*)

  1. Login to admin panel
  2. Navigate to Cms Pages
  3. User clicks Add New Page button
  4. Expand "Content" section
  5. User clicks "Insert Image..." button
  6. Click "Search Adobe Stock" button to open images grid
  7. Click on an image to expand the preview

Expected result:
User sees that image details are hidden

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)

@engcom-Golf engcom-Golf requested a review from DrewML as a code owner November 12, 2019 09:10
@m2-assistant
Copy link

m2-assistant bot commented Nov 12, 2019

Hi @engcom-Golf. 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.3-develop instance - deploy vanilla Magento instance

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

@magento-engcom-team
Copy link
Contributor

Hi @sivaschenko, thank you for the review.
ENGCOM-6285 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

@@ -101,6 +101,13 @@ define([
show: function (record) {
var img;

if (record._rowIndex === this.visibleRecord() &&
this.isVisible(record)) {
Copy link
Member

Choose a reason for hiding this comment

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

There is no need to call this.isVisible(record) as the first condition seems to be enough

Copy link
Member

Choose a reason for hiding this comment

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

ok

@@ -101,6 +101,13 @@ define([
show: function (record) {
var img;

if (record._rowIndex === this.visibleRecord() &&
this.isVisible(record)) {
this.hide();
Copy link
Member

Choose a reason for hiding this comment

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

Let's just move the codition below the this.hide(); not to duplicate the call

@sivaschenko sivaschenko added the Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests label Nov 14, 2019
@magento-engcom-team
Copy link
Contributor

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

@engcom-Delta
Copy link
Contributor

Hi @engcom-Golf . Image still cannot be hidden by clicking on it in images grid when image preview was opened.
Could you take a look?

@engcom-Golf
Copy link
Contributor Author

Hi @engcom-Delta thank you for attention on this pr, yes this issue related to the latest changes where method hide() moved to the beginning of if statement, so we always have visibleRecord(null) so I think the best way is to revert and place hide() method inside of if statement and boby of the method, as hide() method sets null to all observables.

@magento-engcom-team
Copy link
Contributor

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

@engcom-Delta
Copy link
Contributor

@engcom-Golf There is issue with closing image preview when user clicks on the image on the next page that has same index in grid as original image
Steps to reproduce:

  • Login to admin panel
  • Navigate to Cms Pages
  • User clicks Add New Page button
  • Expand "Content" section
  • User clicks "Insert Image..." button
  • Click "Search Adobe Stock" button to open images grid
  • Click on an first image to expand the preview on first page
  • Change grid page.
  • Click on an first image on new page.

Actual result:
Image details are hidden

#25566PR

@sivaschenko
Copy link
Member

@VasylShvorak can you please report it as a separate issue to Adobe Stock Integration project: Image preview should be closed when the page is changed

@engcom-Delta
Copy link
Contributor

✔️ QA passed

@Nazar65 Nazar65 added Auto-Tests: Covered All changes in Pull Request is covered by auto-tests and removed Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests labels Nov 24, 2019
@m2-assistant
Copy link

m2-assistant bot commented Nov 26, 2019

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

@magento-engcom-team magento-engcom-team added this to the Release: 2.3.5 milestone Nov 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants