ui(governance): add go-pending shortcut in batch mark activated blocked hint
This commit is contained in:
@@ -1068,7 +1068,21 @@
|
|||||||
<div class="mt-6">
|
<div class="mt-6">
|
||||||
<button class="btn btn-sm" type="submit" @disabled($batchMarkActivatedBlocked) title="{{ $batchMarkActivatedBlockedReason }}">批量仅标记为已生效(当前筛选范围)</button>
|
<button class="btn btn-sm" type="submit" @disabled($batchMarkActivatedBlocked) title="{{ $batchMarkActivatedBlockedReason }}">批量仅标记为已生效(当前筛选范围)</button>
|
||||||
@if($batchMarkActivatedBlocked)
|
@if($batchMarkActivatedBlocked)
|
||||||
<div class="adm-tool-blocked-hint" data-role="batch-mark-activated-blocked-hint">提示:{{ $batchMarkActivatedBlockedReason }}</div>
|
<div class="adm-tool-blocked-hint" data-role="batch-mark-activated-blocked-hint">
|
||||||
|
<div>提示:{{ $batchMarkActivatedBlockedReason }}</div>
|
||||||
|
@php
|
||||||
|
// 提效:当被阻断时给一键跳转到“待生效集合”的入口(口径:paid + pending + sync_status=unsynced)。
|
||||||
|
// 说明:使用快捷筛选构造器,保留上下文(站点/套餐/订阅/keyword/lead/时间范围/back),并自动清空 page 与工具型开关。
|
||||||
|
$goPaidPendingUnsyncedUrl = $buildQuickFilterUrl([
|
||||||
|
'payment_status' => 'paid',
|
||||||
|
'status' => 'pending',
|
||||||
|
'sync_status' => 'unsynced',
|
||||||
|
]);
|
||||||
|
@endphp
|
||||||
|
<div class="mt-6 actions gap-10">
|
||||||
|
<a class="btn btn-secondary btn-sm" href="{!! $goPaidPendingUnsyncedUrl !!}">切到待生效集合</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\Feature;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
class AdminPlatformOrderIndexBatchMarkActivatedBlockedHintShouldIncludeGoPendingLinkTest 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_paid_pending_unsynced_set(): void
|
||||||
|
{
|
||||||
|
$this->loginAsPlatformAdmin();
|
||||||
|
|
||||||
|
// 构造一个会触发 batch_mark_activated 被阻断的筛选:缺少 sync_status=unsynced。
|
||||||
|
$res = $this->get('/admin/platform-orders?payment_status=paid&status=pending');
|
||||||
|
$res->assertOk();
|
||||||
|
|
||||||
|
$html = (string) $res->getContent();
|
||||||
|
|
||||||
|
$this->assertStringContainsString('data-role="batch-mark-activated-blocked-hint"', $html);
|
||||||
|
$this->assertStringContainsString('切到待生效集合', $html);
|
||||||
|
$this->assertStringContainsString('payment_status=paid', $html);
|
||||||
|
$this->assertStringContainsString('status=pending', $html);
|
||||||
|
$this->assertStringContainsString('sync_status=unsynced', $html);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user