ui(governance): add go-scope shortcuts for clear-error blocked hints

This commit is contained in:
萝卜
2026-03-17 05:49:14 +08:00
parent 3e2e0ad046
commit 537c1e093c
3 changed files with 96 additions and 2 deletions

View File

@@ -1163,7 +1163,18 @@
<div class="mt-6">
<button class="btn btn-danger btn-sm" type="submit" @disabled($clearSyncBlocked) title="{{ $clearSyncBlockedReason }}">清除同步失败标记(当前筛选范围)</button>
@if($clearSyncBlocked)
<div class="adm-tool-blocked-hint" data-role="clear-sync-errors-blocked-hint">提示:{{ $clearSyncBlockedReason }}</div>
<div class="adm-tool-blocked-hint" data-role="clear-sync-errors-blocked-hint">
<div>提示:{{ $clearSyncBlockedReason }}</div>
@php
// 提效:清理同步失败标记前必须先锁定失败集合;被阻断时给一键跳转入口。
$goSyncFailedUrl = $buildQuickFilterUrl([
'sync_status' => 'failed',
]);
@endphp
<div class="mt-6 actions gap-10">
<a class="btn btn-secondary btn-sm" href="{!! $goSyncFailedUrl !!}">切到同步失败集合</a>
</div>
</div>
@endif
</div>
</form>
@@ -1219,7 +1230,18 @@
<div class="mt-6">
<button class="btn btn-danger btn-sm" type="submit" @disabled($clearBmpaBlocked) title="{{ $clearBmpaBlockedReason }}">清除批量标记支付失败标记(当前筛选范围)</button>
@if($clearBmpaBlocked)
<div class="adm-tool-blocked-hint" data-role="clear-bmpa-errors-blocked-hint">提示:{{ $clearBmpaBlockedReason }}</div>
<div class="adm-tool-blocked-hint" data-role="clear-bmpa-errors-blocked-hint">
<div>提示:{{ $clearBmpaBlockedReason }}</div>
@php
// 提效:清理 BMPA 失败标记前必须先锁定 BMPA 失败集合;被阻断时给一键跳转入口。
$goBmpaFailedUrl = $buildQuickFilterUrl([
'bmpa_failed_only' => '1',
]);
@endphp
<div class="mt-6 actions gap-10">
<a class="btn btn-secondary btn-sm" href="{!! $goBmpaFailedUrl !!}">切到 BMPA 失败集合</a>
</div>
</div>
@endif
</div>
</form>

View File

@@ -0,0 +1,36 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminPlatformOrderIndexClearBmpaBlockedHintShouldIncludeGoBmpaFailedLinkTest 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_bmpa_failed_set(): void
{
$this->loginAsPlatformAdmin();
// 构造一个会触发 clear_bmpa_errors 被阻断的筛选:不在 BMPA 失败集合。
$res = $this->get('/admin/platform-orders');
$res->assertOk();
$html = (string) $res->getContent();
$this->assertStringContainsString('data-role="clear-bmpa-errors-blocked-hint"', $html);
$this->assertStringContainsString('切到 BMPA 失败集合', $html);
$this->assertStringContainsString('bmpa_failed_only=1', $html);
}
}

View File

@@ -0,0 +1,36 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminPlatformOrderIndexClearSyncBlockedHintShouldIncludeGoFailedLinkTest 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_sync_failed_set(): void
{
$this->loginAsPlatformAdmin();
// 构造一个会触发 clear_sync_errors 被阻断的筛选:不在失败集合。
$res = $this->get('/admin/platform-orders');
$res->assertOk();
$html = (string) $res->getContent();
$this->assertStringContainsString('data-role="clear-sync-errors-blocked-hint"', $html);
$this->assertStringContainsString('切到同步失败集合', $html);
$this->assertStringContainsString('sync_status=failed', $html);
}
}