ui(governance): add go-syncable shortcut in batch activate blocked hint
This commit is contained in:
@@ -916,7 +916,19 @@
|
|||||||
<div class="mt-6">
|
<div class="mt-6">
|
||||||
<button class="btn btn-sm" type="submit" @disabled($batchActivateBlocked) title="{{ $batchActivateBlockedReason }}">批量同步订阅(当前筛选范围)</button>
|
<button class="btn btn-sm" type="submit" @disabled($batchActivateBlocked) title="{{ $batchActivateBlockedReason }}">批量同步订阅(当前筛选范围)</button>
|
||||||
@if($batchActivateBlocked)
|
@if($batchActivateBlocked)
|
||||||
<div class="adm-tool-blocked-hint" data-role="batch-activate-subscriptions-blocked-hint">提示:{{ $batchActivateBlockedReason }}</div>
|
<div class="adm-tool-blocked-hint" data-role="batch-activate-subscriptions-blocked-hint">
|
||||||
|
<div>提示:{{ $batchActivateBlockedReason }}</div>
|
||||||
|
@php
|
||||||
|
// 提效:被阻断时给一键跳转到「可同步订阅集合」(口径:syncable_only=1 + sync_status=unsynced)。
|
||||||
|
$goSyncableUrl = $buildQuickFilterUrl([
|
||||||
|
'syncable_only' => '1',
|
||||||
|
'sync_status' => 'unsynced',
|
||||||
|
]);
|
||||||
|
@endphp
|
||||||
|
<div class="mt-6 actions gap-10">
|
||||||
|
<a class="btn btn-secondary btn-sm" href="{!! $goSyncableUrl !!}">切到可同步订阅集合</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\Feature;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
class AdminPlatformOrderIndexBatchActivateBlockedHintShouldIncludeGoSyncableLinkTest 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_syncable_only_unsynced_set(): void
|
||||||
|
{
|
||||||
|
$this->loginAsPlatformAdmin();
|
||||||
|
|
||||||
|
// 构造一个会触发 batch_activate_subscriptions 被阻断的筛选:未勾选 syncable_only。
|
||||||
|
$res = $this->get('/admin/platform-orders');
|
||||||
|
$res->assertOk();
|
||||||
|
|
||||||
|
$html = (string) $res->getContent();
|
||||||
|
|
||||||
|
$this->assertStringContainsString('data-role="batch-activate-subscriptions-blocked-hint"', $html);
|
||||||
|
$this->assertStringContainsString('切到可同步订阅集合', $html);
|
||||||
|
$this->assertStringContainsString('syncable_only=1', $html);
|
||||||
|
$this->assertStringContainsString('sync_status=unsynced', $html);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user