ui(governance): add go-processable shortcut in batch bmpa blocked hint
This commit is contained in:
@@ -1015,7 +1015,19 @@
|
||||
<div class="mt-6">
|
||||
<button class="btn btn-sm" type="submit" @disabled($batchBmpaBlocked) title="{{ $batchBmpaBlockedReason }}">批量标记支付并生效(含订阅同步)(当前筛选范围)</button>
|
||||
@if($batchBmpaBlocked)
|
||||
<div class="adm-tool-blocked-hint" data-role="batch-bmpa-blocked-hint">提示:{{ $batchBmpaBlockedReason }}</div>
|
||||
<div class="adm-tool-blocked-hint" data-role="batch-bmpa-blocked-hint">
|
||||
<div>提示:{{ $batchBmpaBlockedReason }}</div>
|
||||
@php
|
||||
// 提效:被阻断时给一键跳转到「可BMPA处理集合」(口径:pending + unpaid)。
|
||||
$goBmpaProcessableUrl = $buildQuickFilterUrl([
|
||||
'status' => 'pending',
|
||||
'payment_status' => 'unpaid',
|
||||
]);
|
||||
@endphp
|
||||
<div class="mt-6 actions gap-10">
|
||||
<a class="btn btn-secondary btn-sm" href="{!! $goBmpaProcessableUrl !!}">切到可BMPA处理集合</a>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class AdminPlatformOrderIndexBatchBmpaBlockedHintShouldIncludeGoProcessableLinkTest 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_blocked_hint_should_include_link_to_pending_unpaid_set(): void
|
||||
{
|
||||
$this->loginAsPlatformAdmin();
|
||||
|
||||
// 构造一个会触发 batch_bmpa 被阻断的筛选:不给 pending+unpaid。
|
||||
$res = $this->get('/admin/platform-orders');
|
||||
$res->assertOk();
|
||||
|
||||
$html = (string) $res->getContent();
|
||||
|
||||
$this->assertStringContainsString('data-role="batch-bmpa-blocked-hint"', $html);
|
||||
$this->assertStringContainsString('切到可BMPA处理集合', $html);
|
||||
$this->assertStringContainsString('status=pending', $html);
|
||||
$this->assertStringContainsString('payment_status=unpaid', $html);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user