magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.56k stars 9.32k forks source link

Subtitle got hidden in backend menu #27217

Open BrokenMop opened 4 years ago

BrokenMop commented 4 years ago

Preconditions:

  1. Magento 2.4-develop
  2. Magento version 2.3.4

Steps to reproduce:

  1. Add at least two menu items under backend Content menu ( Test Menu 2, Test Menu 3 for example);

e.g. Screenshot from 2021-01-05 15-26-47 So now, we have totally 4 submenus under the Content menu: Elements, Design, Test Menu 2, and Test Menu 3

  1. Use ACL to hide Design to current backend users. ( Go to Admin -> System -> User Roles and open current role for edit);

Screenshot from 2021-01-05 15-54-57

Expected result: :heavy_check_mark:

  1. All menu shows correctly, Design will get hidden for the user.

Actual result: :heavy_multiplication_x:

  1. All menu shows correctly, Design will get hidden for the user.
  2. The Subtitles for Elements, Test Menu 2, Test Menu 3 are hidden by the CSS below

2021-01-05_15-49

.adminmenu .submenu .column:only-of-type .submenu-group-title, .adminmenu .level-0 > .submenu > ul > .level-1:only-of-type > .submenu-group-title { display: none; }

The first selector actually hides the subtitle.

Observation: Looks like Magento groups submenu into columns when there are multiple, but when there is only 1 column, the subtitle is hidden by the CSS.

m2-assistant[bot] commented 4 years ago

Hi @BrokenMop. Thank you for your report. To help us process this issue please make sure that you provided the following information:

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

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

@BrokenMop do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?


BrokenMop commented 4 years ago

Yes I can confirm the issue on vanilla Magento instance

m2-assistant[bot] commented 3 years ago

Hi @engcom-Alfa. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

magento-engcom-team commented 3 years ago

:white_check_mark: Confirmed by @engcom-Alfa Thank you for verifying the issue. Based on the provided information internal tickets MC-40292 were created

Issue Available: @engcom-Alfa, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 14 days if no further activity occurs. Is this issue still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? Thank you for your contributions!

gixid192 commented 3 years ago

I think this is intended, just don't know the right cases for this css. Otherwise, we can safely remove it.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 14 days if no further activity occurs. Is this issue still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? Thank you for your contributions!

lfolco commented 3 years ago

It's still relevant, you need the headings there.

lfolco commented 3 years ago

This also occurs if you add an additional menu, making the total count three. For example, I have an additional menu under Content where the subtitles do not show:

image

But, when I add a fourth grouping, it shows up:

image

This is a full admin user; I did not change any ACL.

mskalny commented 3 years ago

Add it to for example Vendor/Module/view/adminhtml/web/css/source/_module.less as a temporary solution:

body {
  .admin__menu {
    .submenu {
      .column:only-of-type {
        .submenu-group-title {
          display: block;
        }
      }
    }

    .level-0 {
      & > .submenu {
        & > ul {
          & > .level-1:only-of-type {
            & > .submenu-group-title {
              display: block;
            }
          }
        }
      }
    }
  }
}
markshust commented 2 years ago

I've confirmed the same issue as @lfolco, this is definitely a bug.

Out of the box, Magento's HTML structure looks like this:

Screen Shot 2021-12-08 at 11 45 38 AM

Notice how there is a single <ul role="menu"> element.

Now, when I add a new third item with a child, the headers are hidden due to the CSS in this screenshot. This seems to be triggered because a child <ul role="menu"> element is contained within a parent <ul role="menu"> element, as well as a .column el which wasn't previously present:

Screen Shot 2021-12-08 at 11 48 22 AM

If I create a second custom menu item (with no child, as just a placeholder), the headers show back up, but a second column shows (which is obviously unintended):

Screen Shot 2021-12-08 at 11 50 30 AM

The headers show back up because there are two .column elements, so the .column:only-of-type CSS rule is not activated.

m2-assistant[bot] commented 5 months ago

Hi @engcom-Delta. Thank you for working on this issue. Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction: