phases one of time logged now with log display
This commit is contained in:
@@ -11,15 +11,19 @@
|
||||
|
||||
$items = $this->getTenantMenuItems();
|
||||
|
||||
$canSwitchTenants = filament()->hasTenantSwitcher() && filled($tenants = array_filter(
|
||||
filament()->getUserTenants(filament()->auth()->user()),
|
||||
fn (\Illuminate\Database\Eloquent\Model $tenant): bool => ! $tenant->is($currentTenant),
|
||||
));
|
||||
$canSwitchTenants =
|
||||
filament()->hasTenantSwitcher() &&
|
||||
filled(
|
||||
$tenants = array_filter(
|
||||
filament()->getUserTenants(filament()->auth()->user()),
|
||||
fn(\Illuminate\Database\Eloquent\Model $tenant): bool => !$tenant->is($currentTenant),
|
||||
),
|
||||
);
|
||||
|
||||
$isSearchable = $canSwitchTenants && (filament()->isTenantMenuSearchable() ?? (count($tenants) >= 10));
|
||||
$isSearchable = $canSwitchTenants && (filament()->isTenantMenuSearchable() ?? count($tenants) >= 10);
|
||||
|
||||
$itemsBeforeAndAfterTenantSwitcher = collect($items)
|
||||
->groupBy(fn (Action $item): bool => $canSwitchTenants && ($item->getSort() < 0), preserveKeys: true)
|
||||
->groupBy(fn(Action $item): bool => $canSwitchTenants && $item->getSort() < 0, preserveKeys: true)
|
||||
->all();
|
||||
$itemsBeforeTenantSwitcher = $itemsBeforeAndAfterTenantSwitcher[true] ?? collect();
|
||||
$itemsAfterTenantSwitcher = $itemsBeforeAndAfterTenantSwitcher[false] ?? collect();
|
||||
@@ -29,19 +33,10 @@
|
||||
|
||||
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::TENANT_MENU_BEFORE) }}
|
||||
|
||||
<x-filament::dropdown
|
||||
placement="bottom-start"
|
||||
size
|
||||
:teleport="$teleport"
|
||||
:attributes="
|
||||
\Filament\Support\prepare_inherited_attributes($attributes)
|
||||
->class(['fi-tenant-menu'])
|
||||
"
|
||||
>
|
||||
<x-filament::dropdown placement="bottom-start" size :teleport="$teleport" :attributes="\Filament\Support\prepare_inherited_attributes($attributes)->class(['fi-tenant-menu'])">
|
||||
<x-slot name="trigger">
|
||||
<button
|
||||
@if ($isSidebarCollapsibleOnDesktop)
|
||||
x-data="{ tooltip: false }"
|
||||
@if ($isSidebarCollapsibleOnDesktop) x-data="{ tooltip: false }"
|
||||
x-effect="
|
||||
tooltip = $store.sidebar.isOpen
|
||||
? false
|
||||
@@ -51,22 +46,12 @@
|
||||
theme: $store.theme,
|
||||
}
|
||||
"
|
||||
x-tooltip.html="tooltip"
|
||||
@endif
|
||||
type="button"
|
||||
class="fi-tenant-menu-trigger"
|
||||
>
|
||||
<x-filament-panels::avatar.tenant
|
||||
:tenant="$currentTenant"
|
||||
loading="lazy"
|
||||
/>
|
||||
x-tooltip.html="tooltip" @endif
|
||||
type="button" class="fi-tenant-menu-trigger">
|
||||
<x-filament-panels::avatar.tenant :tenant="$currentTenant" loading="lazy" />
|
||||
|
||||
<span
|
||||
@if ($isSidebarCollapsibleOnDesktop)
|
||||
x-show="$store.sidebar.isOpen"
|
||||
@endif
|
||||
class="fi-tenant-menu-trigger-text"
|
||||
>
|
||||
<span @if ($isSidebarCollapsibleOnDesktop) x-show="$store.sidebar.isOpen" @endif
|
||||
class="fi-tenant-menu-trigger-text">
|
||||
@if ($currentTenant instanceof \Filament\Models\Contracts\HasCurrentTenantLabel)
|
||||
<span class="fi-tenant-menu-trigger-current-tenant-label">
|
||||
{{ $currentTenant->getCurrentTenantLabel() }}
|
||||
@@ -78,11 +63,13 @@
|
||||
</span>
|
||||
</span>
|
||||
|
||||
{{
|
||||
\Filament\Support\generate_icon_html(\Filament\Support\Icons\Heroicon::ChevronDown, alias: \Filament\View\PanelsIconAlias::TENANT_MENU_TOGGLE_BUTTON, attributes: new \Illuminate\View\ComponentAttributeBag([
|
||||
{{ \Filament\Support\generate_icon_html(
|
||||
\Filament\Support\Icons\Heroicon::ChevronDown,
|
||||
alias: \Filament\View\PanelsIconAlias::TENANT_MENU_TOGGLE_BUTTON,
|
||||
attributes: new \Illuminate\View\ComponentAttributeBag([
|
||||
'x-show' => $isSidebarCollapsibleOnDesktop ? '$store.sidebar.isOpen' : null,
|
||||
]))
|
||||
}}
|
||||
]),
|
||||
) }}
|
||||
</button>
|
||||
</x-slot>
|
||||
|
||||
@@ -103,12 +90,9 @@
|
||||
{{ __('filament-panels::layout.tenant_menu.search_field.label') }}
|
||||
</label>
|
||||
|
||||
<x-filament::input
|
||||
x-bind:id="$id('input')"
|
||||
x-model="search"
|
||||
<x-filament::input x-bind:id="$id('input')" x-model="search"
|
||||
placeholder="{{ __('filament-panels::layout.tenant_menu.search_field.placeholder') }}"
|
||||
type="search"
|
||||
/>
|
||||
type="search" />
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@@ -125,13 +109,8 @@
|
||||
@js($tenantName).replace(/ /g, '')
|
||||
.toLowerCase()
|
||||
.includes(search.replace(/ /g, '').toLowerCase())
|
||||
"
|
||||
>
|
||||
<x-filament::dropdown.list.item
|
||||
:href="$tenantUrl"
|
||||
:image="$tenantImage"
|
||||
tag="a"
|
||||
>
|
||||
">
|
||||
<x-filament::dropdown.list.item :href="$tenantUrl" :image="$tenantImage" tag="a">
|
||||
{{ $tenantName }}
|
||||
</x-filament::dropdown.list.item>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user