From 0561692885e954faabe62659ffd6889252dffa17 Mon Sep 17 00:00:00 2001 From: curder Date: Mon, 8 Apr 2024 18:05:23 +0800 Subject: [PATCH] Tab bug in other languages (chinese and khmer) --- src/Resources/RoleResource.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Resources/RoleResource.php b/src/Resources/RoleResource.php index 790fa95..c73dd30 100644 --- a/src/Resources/RoleResource.php +++ b/src/Resources/RoleResource.php @@ -300,7 +300,8 @@ public static function getTabFormComponentForResources(): Component { return static::shield()->hasSimpleResourcePermissionView() ? static::getTabFormComponentForSimpleResourcePermissionsView() - : Forms\Components\Tabs\Tab::make(__('filament-shield::filament-shield.resources')) + : Forms\Components\Tabs\Tab::make('resources') + ->label(__('filament-shield::filament-shield.resources')) ->visible(fn (): bool => (bool) Utils::isResourceEntityEnabled()) ->badge(static::getResourceTabBadgeCount()) ->schema([ @@ -322,7 +323,8 @@ public static function getTabFormComponentForPage(): Component $options = static::getPageOptions(); $count = count($options); - return Forms\Components\Tabs\Tab::make(__('filament-shield::filament-shield.pages')) + return Forms\Components\Tabs\Tab::make('pages') + ->label(__('filament-shield::filament-shield.pages')) ->visible(fn (): bool => (bool) Utils::isPageEntityEnabled() && $count > 0) ->badge($count) ->schema([ @@ -335,7 +337,8 @@ public static function getTabFormComponentForWidget(): Component $options = static::getWidgetOptions(); $count = count($options); - return Forms\Components\Tabs\Tab::make(__('filament-shield::filament-shield.widgets')) + return Forms\Components\Tabs\Tab::make('widgets') + ->label(__('filament-shield::filament-shield.widgets')) ->visible(fn (): bool => (bool) Utils::isWidgetEntityEnabled() && $count > 0) ->badge($count) ->schema([ @@ -348,7 +351,8 @@ public static function getTabFormComponentForCustomPermissions(): Component $options = static::getCustomPermissionOptions(); $count = count($options); - return Forms\Components\Tabs\Tab::make(__('filament-shield::filament-shield.custom')) + return Forms\Components\Tabs\Tab::make('custom') + ->label(__('filament-shield::filament-shield.custom')) ->visible(fn (): bool => (bool) Utils::isCustomPermissionEntityEnabled() && $count > 0) ->badge($count) ->schema([ @@ -361,7 +365,8 @@ public static function getTabFormComponentForSimpleResourcePermissionsView(): Co $options = FilamentShield::getAllResourcePermissions(); $count = count($options); - return Forms\Components\Tabs\Tab::make(__('filament-shield::filament-shield.resources')) + return Forms\Components\Tabs\Tab::make('resources') + ->label(__('filament-shield::filament-shield.resources')) ->visible(fn (): bool => (bool) Utils::isResourceEntityEnabled() && $count > 0) ->badge($count) ->schema([