Platform orders index: add batch review link in run_id badges
This commit is contained in:
@@ -549,6 +549,13 @@
|
|||||||
<div>
|
<div>
|
||||||
当前 BAS run_id:<strong>{{ $batchActivationRunId }}</strong>
|
当前 BAS run_id:<strong>{{ $batchActivationRunId }}</strong>
|
||||||
<button type="button" class="btn btn-secondary btn-sm" data-action="copy-text" data-copy-text="{{ $batchActivationRunId }}" data-copy-label="BAS run_id">复制 run_id</button>
|
<button type="button" class="btn btn-secondary btn-sm" data-action="copy-text" data-copy-text="{{ $batchActivationRunId }}" data-copy-label="BAS run_id">复制 run_id</button>
|
||||||
|
@php
|
||||||
|
$basBatchReviewUrl = \App\Support\BackUrl::withBack('/admin/platform-batches/show?' . \Illuminate\Support\Arr::query([
|
||||||
|
'type' => 'bas',
|
||||||
|
'run_id' => $batchActivationRunId,
|
||||||
|
]), $selfWithoutBack);
|
||||||
|
@endphp
|
||||||
|
<a class="btn btn-secondary btn-sm" href="{!! $basBatchReviewUrl !!}">查看批次复盘</a>
|
||||||
<span class="muted">|</span>
|
<span class="muted">|</span>
|
||||||
<a class="btn btn-secondary btn-sm" href="{!! $safeFullUrlWithQuery(['batch_activation_run_id' => null, 'page' => null]) !!}">清除 BAS 批次筛选</a>
|
<a class="btn btn-secondary btn-sm" href="{!! $safeFullUrlWithQuery(['batch_activation_run_id' => null, 'page' => null]) !!}">清除 BAS 批次筛选</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -602,6 +609,13 @@
|
|||||||
<div>
|
<div>
|
||||||
当前 BMPA run_id:<strong>{{ $batchBmpaRunId }}</strong>
|
当前 BMPA run_id:<strong>{{ $batchBmpaRunId }}</strong>
|
||||||
<button type="button" class="btn btn-secondary btn-sm" data-action="copy-text" data-copy-text="{{ $batchBmpaRunId }}" data-copy-label="BMPA run_id">复制 run_id</button>
|
<button type="button" class="btn btn-secondary btn-sm" data-action="copy-text" data-copy-text="{{ $batchBmpaRunId }}" data-copy-label="BMPA run_id">复制 run_id</button>
|
||||||
|
@php
|
||||||
|
$bmpaBatchReviewUrl = \App\Support\BackUrl::withBack('/admin/platform-batches/show?' . \Illuminate\Support\Arr::query([
|
||||||
|
'type' => 'bmpa',
|
||||||
|
'run_id' => $batchBmpaRunId,
|
||||||
|
]), $selfWithoutBack);
|
||||||
|
@endphp
|
||||||
|
<a class="btn btn-secondary btn-sm" href="{!! $bmpaBatchReviewUrl !!}">查看批次复盘</a>
|
||||||
<span class="muted">|</span>
|
<span class="muted">|</span>
|
||||||
<a class="btn btn-secondary btn-sm" href="{!! $safeFullUrlWithQuery(['batch_bmpa_run_id' => null, 'page' => null]) !!}">清除 BMPA 批次筛选</a>
|
<a class="btn btn-secondary btn-sm" href="{!! $safeFullUrlWithQuery(['batch_bmpa_run_id' => null, 'page' => null]) !!}">清除 BMPA 批次筛选</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,47 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\Feature;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
class AdminPlatformOrderIndexBatchRunIdBadgesShouldIncludeReviewLinksTest 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_platform_orders_page_batch_run_id_badges_should_include_review_links(): void
|
||||||
|
{
|
||||||
|
$this->loginAsPlatformAdmin();
|
||||||
|
|
||||||
|
$basRunId = 'BAS_BADGE_REVIEW_LINK_0001';
|
||||||
|
$bmpaRunId = 'BMPA_BADGE_REVIEW_LINK_0001';
|
||||||
|
|
||||||
|
$htmlBas = $this->get('/admin/platform-orders?batch_activation_run_id=' . $basRunId)
|
||||||
|
->assertOk()
|
||||||
|
->getContent();
|
||||||
|
|
||||||
|
$this->assertStringContainsString('查看批次复盘', $htmlBas);
|
||||||
|
$this->assertStringContainsString('/admin/platform-batches/show?type=bas', $htmlBas);
|
||||||
|
$this->assertStringContainsString('run_id=' . $basRunId, $htmlBas);
|
||||||
|
$this->assertStringContainsString('back=', $htmlBas);
|
||||||
|
|
||||||
|
$htmlBmpa = $this->get('/admin/platform-orders?batch_bmpa_run_id=' . $bmpaRunId)
|
||||||
|
->assertOk()
|
||||||
|
->getContent();
|
||||||
|
|
||||||
|
$this->assertStringContainsString('查看批次复盘', $htmlBmpa);
|
||||||
|
$this->assertStringContainsString('/admin/platform-batches/show?type=bmpa', $htmlBmpa);
|
||||||
|
$this->assertStringContainsString('run_id=' . $bmpaRunId, $htmlBmpa);
|
||||||
|
$this->assertStringContainsString('back=', $htmlBmpa);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user