From d9b7e32e32829b6bdd2736048bee46716e75cc68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Sat, 14 Mar 2026 13:26:45 +0000 Subject: [PATCH] admin-components: make row-warn-prefix a subtle pill badge (scoped) --- public/css/admin-components.css | 2 +- ...OrderIndexRowWarnPrefixStyleScopedTest.php | 34 +++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 tests/Feature/AdminPlatformOrderIndexRowWarnPrefixStyleScopedTest.php diff --git a/public/css/admin-components.css b/public/css/admin-components.css index 92a9868..44ecb9c 100644 --- a/public/css/admin-components.css +++ b/public/css/admin-components.css @@ -93,7 +93,7 @@ .platform-orders-table .row-warn{margin-top:4px;padding:4px 6px;border-left:3px solid #d9534f;background:#fff6f6;border-radius:4px;} .platform-orders-table .row-warn a.link{color:#b52b27;text-decoration:underline;} .platform-orders-table .row-warn a.link:hover{text-decoration:none;} -.platform-orders-table .row-warn-prefix{font-weight:600;} +.platform-orders-table .row-warn-prefix{font-weight:600;display:inline-block;padding:1px 6px;border-radius:10px;background:#ffecec;color:#b52b27;margin-right:4px;} /* 平台订单列表:精简视图也要可达的治理提示(对账/退款不一致) */ .platform-orders-table .governance-hints{margin-bottom:6px;} diff --git a/tests/Feature/AdminPlatformOrderIndexRowWarnPrefixStyleScopedTest.php b/tests/Feature/AdminPlatformOrderIndexRowWarnPrefixStyleScopedTest.php new file mode 100644 index 0000000..8cb058f --- /dev/null +++ b/tests/Feature/AdminPlatformOrderIndexRowWarnPrefixStyleScopedTest.php @@ -0,0 +1,34 @@ +seed(); + + $this->post('/admin/login', [ + 'email' => 'platform.admin@demo.local', + 'password' => 'Platform@123456', + ])->assertRedirect('/admin'); + } + + public function test_row_warn_prefix_style_is_scoped_under_platform_orders_table_only(): void + { + $this->loginAsPlatformAdmin(); + + $css = file_get_contents(public_path('css/admin-components.css')); + $this->assertIsString($css); + + $this->assertStringContainsString('.platform-orders-table .row-warn-prefix{', $css); + + // 避免全局污染 + $this->assertStringNotContainsString("\n.row-warn-prefix{", $css); + } +}