Skip to content

Commit

Permalink
Merge pull request #362 from curder/3.x
Browse files Browse the repository at this point in the history
Fixed Tab bug in chinese language
  • Loading branch information
bezhanSalleh committed May 14, 2024
2 parents 1448716 + 0561692 commit ca21a5e
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/Resources/RoleResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand All @@ -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([
Expand All @@ -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([
Expand All @@ -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([
Expand All @@ -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([
Expand Down

0 comments on commit ca21a5e

Please sign in to comment.