From 1ede0c0d72130bd3795bbea8a556e5d2fc7e7e9c Mon Sep 17 00:00:00 2001 From: Seth Daugherty Date: Wed, 9 Jun 2021 21:55:16 -0600 Subject: [PATCH] Hide Address Tab When Adding New Customer In Admin - Add Core Magento change to check if a child component is an instance of `\Magento\Framework\View\Element\ComponentVisibilityInterface` and whether it should be visible by calling `ComponentVisibilityInterface::isComponentVisible()` - Magento reference: https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Ui/Component/Layout/Tabs.php#L91-L93 --- Component/Layout/Tabs.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Component/Layout/Tabs.php b/Component/Layout/Tabs.php index 5eb918c8..67bf9bf1 100644 --- a/Component/Layout/Tabs.php +++ b/Component/Layout/Tabs.php @@ -2,6 +2,7 @@ namespace ClassyLlama\AvaTax\Component\Layout; +use Magento\Framework\View\Element\ComponentVisibilityInterface; use Magento\Framework\View\Element\UiComponent\BlockWrapperInterface; use Magento\Framework\View\Element\UiComponent\DataSourceInterface; use Magento\Framework\View\Element\UiComponentInterface; @@ -46,6 +47,9 @@ protected function addChildren(array &$topNode, UiComponentInterface $component, $this->addWrappedBlock($childComponent, $childrenAreas); continue; } + if ($childComponent instanceof ComponentVisibilityInterface && !$childComponent->isComponentVisible()) { + continue; + } $name = $childComponent->getName(); $config = $childComponent->getData('config');