fix(admin-products): status stats use light active class
This commit is contained in:
@@ -161,9 +161,9 @@
|
|||||||
];
|
];
|
||||||
@endphp
|
@endphp
|
||||||
<div class="grid-4">
|
<div class="grid-4">
|
||||||
<a href="{{ '/admin/products?' . http_build_query(array_filter($productBaseQuery, fn ($value) => $value !== null && $value !== '')) }}" class="status-link {{ $filters['status'] === '' ? 'is-active-dark' : '' }}"><div class="muted">全部</div><strong class="num-md">{{ $statusStats['all'] ?? 0 }}</strong></a>
|
<a href="{{ '/admin/products?' . http_build_query(array_filter($productBaseQuery, fn ($value) => $value !== null && $value !== '')) }}" class="status-link {{ $filters['status'] === '' ? 'is-active-light' : '' }}"><div class="muted">全部</div><strong class="num-md">{{ $statusStats['all'] ?? 0 }}</strong></a>
|
||||||
@foreach($filterOptions['statuses'] as $status)
|
@foreach($filterOptions['statuses'] as $status)
|
||||||
<a href="{{ '/admin/products?' . http_build_query(array_filter(array_merge($productBaseQuery, ['status' => $status]), fn ($value) => $value !== null && $value !== '')) }}" class="status-link {{ $filters['status'] === $status ? 'is-active-dark' : '' }}"><div class="muted">{{ $statusLabels[$status] ?? $status }}</div><strong class="num-md">{{ $statusStats[$status] ?? 0 }}</strong></a>
|
<a href="{{ '/admin/products?' . http_build_query(array_filter(array_merge($productBaseQuery, ['status' => $status]), fn ($value) => $value !== null && $value !== '')) }}" class="status-link {{ $filters['status'] === $status ? 'is-active-light' : '' }}"><div class="muted">{{ $statusLabels[$status] ?? $status }}</div><strong class="num-md">{{ $statusStats[$status] ?? 0 }}</strong></a>
|
||||||
@endforeach
|
@endforeach
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\Feature;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
class AdminProductsIndexStatusStatsAllShouldNotUseDarkActiveClassTest extends TestCase
|
||||||
|
{
|
||||||
|
use RefreshDatabase;
|
||||||
|
|
||||||
|
protected function loginAsPlatformAdmin(): void
|
||||||
|
{
|
||||||
|
$this->seed();
|
||||||
|
|
||||||
|
$this->post('/admin/login', [
|
||||||
|
'email' => 'platform.admin@demo.local',
|
||||||
|
'password' => 'Platform@123456',
|
||||||
|
])->assertRedirect('/admin');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function test_products_index_status_stats_all_should_not_use_dark_active_class(): void
|
||||||
|
{
|
||||||
|
$this->loginAsPlatformAdmin();
|
||||||
|
|
||||||
|
// 访问无 status 筛选的默认页:"全部"应高亮,但不应使用深色 is-active-dark(避免背景突兀)。
|
||||||
|
$res = $this->get('/admin/products');
|
||||||
|
$res->assertOk();
|
||||||
|
|
||||||
|
$res->assertSee('商品状态统计', false);
|
||||||
|
$res->assertSee('is-active-light', false);
|
||||||
|
$res->assertDontSee('is-active-dark', false);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user