Admin subscriptions: hide batch expired action in attach order mode
This commit is contained in:
@@ -271,6 +271,7 @@
|
||||
<a class="btn btn-sm" href="{!! $createOrderFromSubIndexUrl !!}">续费下单(先选订阅)</a>
|
||||
@endif
|
||||
|
||||
@if($attachOrderId <= 0)
|
||||
<form method="post" action="/admin/site-subscriptions/batch-mark-expired" data-action="disable-on-submit" onsubmit="return confirm('确认将当前筛选集合内的订阅批量标记为已过期?该操作会更新 status 字段。');" class="actions gap-10">
|
||||
@csrf
|
||||
<input type="hidden" name="status" value="{{ $filters['status'] ?? '' }}">
|
||||
@@ -292,6 +293,7 @@
|
||||
@endif
|
||||
</div>
|
||||
</form>
|
||||
@endif
|
||||
</div>
|
||||
<div class="muted muted-xs mt-6">
|
||||
@if($attachOrderId > 0)
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class AdminSiteSubscriptionIndexBatchMarkExpiredShouldHideWhenAttachOrderModeTest 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_batch_mark_expired_form_should_not_render_when_attach_order_mode_enabled(): void
|
||||
{
|
||||
$this->loginAsPlatformAdmin();
|
||||
|
||||
$res = $this->get('/admin/site-subscriptions?attach_order_id=123&expiry=expired');
|
||||
$res->assertOk();
|
||||
|
||||
$html = (string) $res->getContent();
|
||||
|
||||
// 在“绑定订阅到订单”模式下,工具区应专注绑定操作,避免出现批量治理动作造成误操作。
|
||||
$this->assertStringNotContainsString('action="/admin/site-subscriptions/batch-mark-expired"', $html);
|
||||
$this->assertStringNotContainsString('批量标记已过期(当前集合)', $html);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user