feat(plans): add cross links in summary cards
This commit is contained in:
@@ -139,18 +139,27 @@
|
|||||||
<div class="num-md">
|
<div class="num-md">
|
||||||
<a class="link" href="{!! $safeFullUrlWithQuery(['status' => 'active', 'page' => null]) !!}">{{ $summaryStats['active_plans'] ?? 0 }}</a>
|
<a class="link" href="{!! $safeFullUrlWithQuery(['status' => 'active', 'page' => null]) !!}">{{ $summaryStats['active_plans'] ?? 0 }}</a>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="muted muted-xs">
|
||||||
|
<a class="link" href="{!! $safeFullUrlWithQuery(['status' => 'inactive', 'page' => null]) !!}">查看停用套餐</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<h3>月付套餐</h3>
|
<h3>月付套餐</h3>
|
||||||
<div class="num-md">
|
<div class="num-md">
|
||||||
<a class="link" href="{!! $safeFullUrlWithQuery(['billing_cycle' => 'monthly', 'page' => null]) !!}">{{ $summaryStats['monthly_plans'] ?? 0 }}</a>
|
<a class="link" href="{!! $safeFullUrlWithQuery(['billing_cycle' => 'monthly', 'page' => null]) !!}">{{ $summaryStats['monthly_plans'] ?? 0 }}</a>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="muted muted-xs">
|
||||||
|
<a class="link" href="{!! $safeFullUrlWithQuery(['billing_cycle' => 'yearly', 'page' => null]) !!}">查看年付套餐</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<h3>年付套餐</h3>
|
<h3>年付套餐</h3>
|
||||||
<div class="num-md">
|
<div class="num-md">
|
||||||
<a class="link" href="{!! $safeFullUrlWithQuery(['billing_cycle' => 'yearly', 'page' => null]) !!}">{{ $summaryStats['yearly_plans'] ?? 0 }}</a>
|
<a class="link" href="{!! $safeFullUrlWithQuery(['billing_cycle' => 'yearly', 'page' => null]) !!}">{{ $summaryStats['yearly_plans'] ?? 0 }}</a>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="muted muted-xs">
|
||||||
|
<a class="link" href="{!! $safeFullUrlWithQuery(['billing_cycle' => 'monthly', 'page' => null]) !!}">查看月付套餐</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<h3>关联订阅总量</h3>
|
<h3>关联订阅总量</h3>
|
||||||
|
|||||||
35
tests/Feature/AdminPlanIndexSummaryCardsCrossLinksTest.php
Normal file
35
tests/Feature/AdminPlanIndexSummaryCardsCrossLinksTest.php
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\Feature;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
class AdminPlanIndexSummaryCardsCrossLinksTest 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_summary_cards_should_have_cross_links_for_quick_navigation(): void
|
||||||
|
{
|
||||||
|
$this->loginAsPlatformAdmin();
|
||||||
|
|
||||||
|
$this->get('/admin/plans')
|
||||||
|
->assertOk()
|
||||||
|
->assertSee('查看停用套餐')
|
||||||
|
->assertSee('查看年付套餐')
|
||||||
|
->assertSee('查看月付套餐')
|
||||||
|
->assertSee('status=inactive', false)
|
||||||
|
->assertSee('billing_cycle=monthly', false)
|
||||||
|
->assertSee('billing_cycle=yearly', false);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user