fix:DB 기반 메뉴 컴포넌트에서 A 탭 제거

This commit is contained in:
pro
2026-01-28 19:16:56 +09:00
parent 39e9ae39c6
commit a02959d871

View File

@@ -12,23 +12,19 @@
return;
}
// 자식 메뉴들을 탭별로 분류
// 자식 메뉴들을 탭별로 분류 (S 탭만 사용)
$sMenus = collect();
$aMenus = collect();
$mMenus = collect();
foreach ($labsGroup->menuChildren as $menu) {
$tab = $menu->getMeta('tab') ?? 'S';
match ($tab) {
'S' => $sMenus->push($menu),
'A' => $aMenus->push($menu),
'M' => $mMenus->push($menu),
default => $sMenus->push($menu),
};
// S 탭 메뉴만 수집 (A 탭은 제외)
if ($tab === 'S') {
$sMenus->push($menu);
}
}
// 모든 탭이 비어있으면 렌더링하지 않음
if ($sMenus->isEmpty() && $aMenus->isEmpty() && $mMenus->isEmpty()) {
// S 탭이 비어있으면 렌더링하지 않음
if ($sMenus->isEmpty()) {
return;
}
@endphp
@@ -49,18 +45,8 @@
</svg>
</button>
<!-- + 메뉴 콘텐츠 -->
<!-- 메뉴 콘텐츠 -->
<div id="lab-group" class="mt-2">
<!-- S | A 버튼 -->
<div class="lab-tabs flex mx-2 mb-2 bg-gray-100 rounded-lg p-1">
<button type="button" onclick="switchLabTab('s')" id="lab-tab-s" class="lab-tab active flex-1 py-1.5 text-xs font-bold rounded-md transition-all text-blue-600">
S
</button>
<button type="button" onclick="switchLabTab('a')" id="lab-tab-a" class="lab-tab flex-1 py-1.5 text-xs font-bold rounded-md transition-all text-purple-600">
A
</button>
</div>
<!-- S. Strategy 메뉴 -->
<ul id="lab-panel-s" class="lab-panel space-y-1">
@foreach($sMenus as $menu)
@@ -74,21 +60,6 @@ class="flex items-center gap-2 px-3 py-2 rounded-lg text-sm text-gray-600 hover:
</li>
@endforeach
</ul>
<!-- A. AI/Automation 메뉴 -->
<ul id="lab-panel-a" class="lab-panel space-y-1 hidden">
@foreach($aMenus as $menu)
<li>
<a href="{{ $menu->getRouteName() ? route($menu->getRouteName()) : $menu->url }}"
class="flex items-center gap-2 px-3 py-2 rounded-lg text-sm text-gray-600 hover:bg-gray-100 hover:text-gray-900 transition-colors"
title="{{ $menu->name }}">
<x-sidebar.menu-icon :icon="$menu->icon" class="w-4 h-4 flex-shrink-0" />
<span class="font-medium sidebar-text">{{ $menu->name }}</span>
</a>
</li>
@endforeach
</ul>
</div>
</div>
@@ -112,17 +83,7 @@ class="flex items-center gap-2 px-3 py-2 rounded-lg text-sm text-gray-600 hover:
<span class="text-xs font-bold text-amber-800 uppercase tracking-wider">R&D Labs</span>
</div>
<!-- -->
<div class="flex p-2 bg-gray-50 border-b border-gray-100">
<button type="button" onclick="switchLabFlyoutTab('s')" id="lab-flyout-tab-s" class="lab-flyout-tab active flex-1 py-1.5 text-xs font-bold rounded transition-all text-blue-600">
S
</button>
<button type="button" onclick="switchLabFlyoutTab('a')" id="lab-flyout-tab-a" class="lab-flyout-tab flex-1 py-1.5 text-xs font-bold rounded transition-all text-purple-600">
A
</button>
</div>
<!-- 메뉴 패널들 -->
<!-- 메뉴 패널 -->
<div class="p-2 max-h-64 overflow-y-auto">
<!-- S. Strategy -->
<ul id="lab-flyout-panel-s" class="lab-flyout-panel space-y-0.5">
@@ -135,19 +96,6 @@ class="block px-2 py-1 text-xs text-gray-600 rounded hover:bg-gray-100 hover:tex
</li>
@endforeach
</ul>
<!-- A. AI/Automation -->
<ul id="lab-flyout-panel-a" class="lab-flyout-panel space-y-0.5 hidden">
@foreach($aMenus as $menu)
<li>
<a href="{{ $menu->getRouteName() ? route($menu->getRouteName()) : $menu->url }}"
class="block px-2 py-1 text-xs text-gray-600 rounded hover:bg-gray-100 hover:text-gray-900">
{{ $menu->name }}
</a>
</li>
@endforeach
</ul>
</div>
</div>
</div>