ui(platform-orders): show run_id badge and clear filter link
This commit is contained in:
@@ -499,6 +499,22 @@
|
|||||||
</div>
|
</div>
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
@php
|
||||||
|
$batchActivationRunId = trim((string) ($filters['batch_activation_run_id'] ?? ''));
|
||||||
|
@endphp
|
||||||
|
@if($batchActivationRunId !== '')
|
||||||
|
<div class="card mb-20 governance-block">
|
||||||
|
<div class="muted governance-block-title"><strong>当前批次筛选</strong></div>
|
||||||
|
<div class="muted governance-block-body">
|
||||||
|
<div>
|
||||||
|
当前 run_id:<strong>{{ $batchActivationRunId }}</strong>
|
||||||
|
<span class="muted">|</span>
|
||||||
|
<a class="btn btn-secondary btn-sm" href="{!! $safeFullUrlWithQuery(['batch_activation_run_id' => null, 'page' => null]) !!}">清除批次筛选</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
<div class="grid-3 mb-20">
|
<div class="grid-3 mb-20">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<h3>平台订单总数</h3>
|
<h3>平台订单总数</h3>
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\Feature;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
class AdminPlatformOrderIndexBatchActivationRunIdBadgeShouldRenderTest 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_platform_orders_page_should_render_run_id_badge_and_clear_link_when_filter_present(): void
|
||||||
|
{
|
||||||
|
$this->loginAsPlatformAdmin();
|
||||||
|
|
||||||
|
$res = $this->get('/admin/platform-orders?batch_activation_run_id=BAS_BADGE_0001');
|
||||||
|
$res->assertOk();
|
||||||
|
|
||||||
|
$res->assertSee('当前批次筛选');
|
||||||
|
$res->assertSee('BAS_BADGE_0001');
|
||||||
|
$res->assertSee('清除批次筛选');
|
||||||
|
$res->assertSee('/admin/platform-orders?batch_activation_run_id=', false);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user