feat(platform): include release in vehicle summary
This commit is contained in:
@@ -403,7 +403,7 @@ export default function App() {
|
|||||||
dashboard: <Dashboard onOpenVehicle={openVehicle} onOpenQuality={openQuality} onOpenRealtime={openRealtime} onOpenVehicles={openVehicles} onOpenHistory={openHistoryWithFilters} onOpenMileage={openMileageWithFilters} />,
|
dashboard: <Dashboard onOpenVehicle={openVehicle} onOpenQuality={openQuality} onOpenRealtime={openRealtime} onOpenVehicles={openVehicles} onOpenHistory={openHistoryWithFilters} onOpenMileage={openMileageWithFilters} />,
|
||||||
vehicles: <Vehicles onOpenVehicle={openVehicle} onOpenQuality={openQuality} onFiltersChange={updateVehicleFilters} initialFilters={vehicleFilters} />,
|
vehicles: <Vehicles onOpenVehicle={openVehicle} onOpenQuality={openQuality} onFiltersChange={updateVehicleFilters} initialFilters={vehicleFilters} />,
|
||||||
realtime: <Realtime onOpenVehicle={openVehicle} onOpenHistory={openHistoryForVehicle} onOpenQuality={openQuality} onFiltersChange={updateRealtimeFilters} initialFilters={realtimeFilters} />,
|
realtime: <Realtime onOpenVehicle={openVehicle} onOpenHistory={openHistoryForVehicle} onOpenQuality={openQuality} onFiltersChange={updateRealtimeFilters} initialFilters={realtimeFilters} />,
|
||||||
detail: <VehicleDetail vin={activeVin} protocol={activeProtocol} onOpenRealtime={openRealtimeForVehicle} onOpenHistory={openHistoryForVehicle} onOpenRaw={openRawForVehicle} onOpenMileage={openMileageForVehicle} onOpenVehicles={openVehicles} onOpenQuality={openQuality} onOpenHistoryEvidence={openHistoryWithFilters} onOpenRawEvidence={openRawWithFilters} onQueryChange={updateVehicleDetailQuery} />,
|
detail: <VehicleDetail vin={activeVin} protocol={activeProtocol} platformRelease={platformRelease} onOpenRealtime={openRealtimeForVehicle} onOpenHistory={openHistoryForVehicle} onOpenRaw={openRawForVehicle} onOpenMileage={openMileageForVehicle} onOpenVehicles={openVehicles} onOpenQuality={openQuality} onOpenHistoryEvidence={openHistoryWithFilters} onOpenRawEvidence={openRawWithFilters} onQueryChange={updateVehicleDetailQuery} />,
|
||||||
history: <History initialVin={analysisVin} initialProtocol={activeProtocol} initialTab={historyTab} initialFilters={historyFilters} onFiltersChange={updateHistoryFilters} onOpenVehicle={openVehicle} onOpenMileage={openMileageWithFilters} onOpenRaw={openRawWithFilters} />,
|
history: <History initialVin={analysisVin} initialProtocol={activeProtocol} initialTab={historyTab} initialFilters={historyFilters} onFiltersChange={updateHistoryFilters} onOpenVehicle={openVehicle} onOpenMileage={openMileageWithFilters} onOpenRaw={openRawWithFilters} />,
|
||||||
mileage: <Mileage initialVin={analysisVin} initialProtocol={activeProtocol} initialFilters={mileageFilters} onFiltersChange={updateMileageFilters} onOpenVehicle={openVehicle} onOpenHistory={openHistoryWithFilters} onOpenRaw={openRawWithFilters} />,
|
mileage: <Mileage initialVin={analysisVin} initialProtocol={activeProtocol} initialFilters={mileageFilters} onFiltersChange={updateMileageFilters} onOpenVehicle={openVehicle} onOpenHistory={openHistoryWithFilters} onOpenRaw={openRawWithFilters} />,
|
||||||
quality: <Quality onOpenVehicle={openVehicle} onOpenRealtime={openRealtime} onOpenHistory={openHistoryWithFilters} onOpenRaw={openRawWithFilters} onOpenMileage={openMileageWithFilters} onHealthLoaded={(health) => {
|
quality: <Quality onOpenVehicle={openVehicle} onOpenRealtime={openRealtime} onOpenHistory={openHistoryWithFilters} onOpenRaw={openRawWithFilters} onOpenMileage={openMileageWithFilters} onHealthLoaded={(health) => {
|
||||||
|
|||||||
@@ -130,6 +130,7 @@ async function copyText(value: string, label: string) {
|
|||||||
export function VehicleDetail({
|
export function VehicleDetail({
|
||||||
vin,
|
vin,
|
||||||
protocol,
|
protocol,
|
||||||
|
platformRelease,
|
||||||
onOpenRealtime,
|
onOpenRealtime,
|
||||||
onOpenHistory,
|
onOpenHistory,
|
||||||
onOpenRaw,
|
onOpenRaw,
|
||||||
@@ -142,6 +143,7 @@ export function VehicleDetail({
|
|||||||
}: {
|
}: {
|
||||||
vin: string;
|
vin: string;
|
||||||
protocol?: string;
|
protocol?: string;
|
||||||
|
platformRelease?: string;
|
||||||
onOpenRealtime: (vin: string, protocol?: string) => void;
|
onOpenRealtime: (vin: string, protocol?: string) => void;
|
||||||
onOpenHistory: (vin: string, protocol?: string) => void;
|
onOpenHistory: (vin: string, protocol?: string) => void;
|
||||||
onOpenRaw: (vin: string, protocol?: string) => void;
|
onOpenRaw: (vin: string, protocol?: string) => void;
|
||||||
@@ -359,6 +361,7 @@ export function VehicleDetail({
|
|||||||
const vehicleName = [archivePlate, displayVIN].filter((item) => item && item !== '-').join(' / ') || displayLookupKey;
|
const vehicleName = [archivePlate, displayVIN].filter((item) => item && item !== '-').join(' / ') || displayLookupKey;
|
||||||
const lines = [
|
const lines = [
|
||||||
'【车辆服务诊断摘要】',
|
'【车辆服务诊断摘要】',
|
||||||
|
...(platformRelease?.trim() ? [`运行版本:${platformRelease.trim()}`] : []),
|
||||||
`车辆:${vehicleName}`,
|
`车辆:${vehicleName}`,
|
||||||
`查询关键词:${reportText(displayLookupKey)}`,
|
`查询关键词:${reportText(displayLookupKey)}`,
|
||||||
`当前范围:${scopeText}`,
|
`当前范围:${scopeText}`,
|
||||||
|
|||||||
@@ -2349,7 +2349,7 @@ test('filters dashboard coverage from source consistency diagnosis', async () =>
|
|||||||
ok: true,
|
ok: true,
|
||||||
json: async () => ({
|
json: async () => ({
|
||||||
data: path.includes('/api/ops/health')
|
data: path.includes('/api/ops/health')
|
||||||
? { linkHealth: [], kafkaLag: 0, redisOnlineKeys: 0, tdengineWritable: true, mysqlWritable: true, runtime: { requestTimeoutMs: 5000 } }
|
? { linkHealth: [], kafkaLag: 0, redisOnlineKeys: 0, tdengineWritable: true, mysqlWritable: true, runtime: { requestTimeoutMs: 5000, platformRelease: 'platform-20260704155844' } }
|
||||||
: { items: [], total: 0, limit: 8, offset: 0 },
|
: { items: [], total: 0, limit: 8, offset: 0 },
|
||||||
traceId: 'trace-test',
|
traceId: 'trace-test',
|
||||||
timestamp: 1783094400000
|
timestamp: 1783094400000
|
||||||
@@ -2458,7 +2458,7 @@ test('opens full vehicle service list from dashboard coverage filters', async ()
|
|||||||
ok: true,
|
ok: true,
|
||||||
json: async () => ({
|
json: async () => ({
|
||||||
data: path.includes('/api/ops/health')
|
data: path.includes('/api/ops/health')
|
||||||
? { linkHealth: [], kafkaLag: 0, redisOnlineKeys: 0, tdengineWritable: true, mysqlWritable: true, runtime: { requestTimeoutMs: 5000 } }
|
? { linkHealth: [], kafkaLag: 0, redisOnlineKeys: 0, tdengineWritable: true, mysqlWritable: true, runtime: { requestTimeoutMs: 5000, platformRelease: 'platform-20260704155844' } }
|
||||||
: { items: [], total: 0, limit: 8, offset: 0 },
|
: { items: [], total: 0, limit: 8, offset: 0 },
|
||||||
traceId: 'trace-test',
|
traceId: 'trace-test',
|
||||||
timestamp: 1783094400000
|
timestamp: 1783094400000
|
||||||
@@ -4890,7 +4890,7 @@ test('shows vehicle context when opening detail from shareable hash', async () =
|
|||||||
ok: true,
|
ok: true,
|
||||||
json: async () => ({
|
json: async () => ({
|
||||||
data: path.includes('/api/ops/health')
|
data: path.includes('/api/ops/health')
|
||||||
? { linkHealth: [], kafkaLag: 0, redisOnlineKeys: 0, tdengineWritable: true, mysqlWritable: true, runtime: { requestTimeoutMs: 5000 } }
|
? { linkHealth: [], kafkaLag: 0, redisOnlineKeys: 0, tdengineWritable: true, mysqlWritable: true, runtime: { requestTimeoutMs: 5000, platformRelease: 'platform-20260704155844' } }
|
||||||
: { items: [], total: 0, limit: 10, offset: 0 },
|
: { items: [], total: 0, limit: 10, offset: 0 },
|
||||||
traceId: 'trace-test',
|
traceId: 'trace-test',
|
||||||
timestamp: 1783094400000
|
timestamp: 1783094400000
|
||||||
@@ -9405,7 +9405,7 @@ test('copies vehicle service diagnostic summary', async () => {
|
|||||||
ok: true,
|
ok: true,
|
||||||
json: async () => ({
|
json: async () => ({
|
||||||
data: path.includes('/api/ops/health')
|
data: path.includes('/api/ops/health')
|
||||||
? { linkHealth: [], kafkaLag: 0, redisOnlineKeys: 0, tdengineWritable: true, mysqlWritable: true, runtime: { requestTimeoutMs: 5000 } }
|
? { linkHealth: [], kafkaLag: 0, redisOnlineKeys: 0, tdengineWritable: true, mysqlWritable: true, runtime: { requestTimeoutMs: 5000, platformRelease: 'platform-20260704155844' } }
|
||||||
: { items: [], total: 0, limit: 10, offset: 0 },
|
: { items: [], total: 0, limit: 10, offset: 0 },
|
||||||
traceId: 'trace-test',
|
traceId: 'trace-test',
|
||||||
timestamp: 1783094400000
|
timestamp: 1783094400000
|
||||||
@@ -9418,9 +9418,12 @@ test('copies vehicle service diagnostic summary', async () => {
|
|||||||
expect(await screen.findByText('车辆服务结论')).toBeInTheDocument();
|
expect(await screen.findByText('车辆服务结论')).toBeInTheDocument();
|
||||||
fireEvent.click(screen.getByRole('button', { name: /复制诊断摘要/ }));
|
fireEvent.click(screen.getByRole('button', { name: /复制诊断摘要/ }));
|
||||||
|
|
||||||
expect(writeText).toHaveBeenCalledWith(expect.any(String));
|
await waitFor(() => {
|
||||||
|
expect(writeText).toHaveBeenCalledWith(expect.any(String));
|
||||||
|
});
|
||||||
const copied = String(writeText.mock.lastCall?.[0] ?? '');
|
const copied = String(writeText.mock.lastCall?.[0] ?? '');
|
||||||
expect(copied).toContain('【车辆服务诊断摘要】');
|
expect(copied).toContain('【车辆服务诊断摘要】');
|
||||||
|
expect(copied).toContain('运行版本:platform-20260704155844');
|
||||||
expect(copied).toContain('车辆:粤A诊断1 / VIN-SUMMARY-001');
|
expect(copied).toContain('车辆:粤A诊断1 / VIN-SUMMARY-001');
|
||||||
expect(copied).toContain('当前范围:单一来源:JT808');
|
expect(copied).toContain('当前范围:单一来源:JT808');
|
||||||
expect(copied).toContain('服务状态:来源不完整');
|
expect(copied).toContain('服务状态:来源不完整');
|
||||||
|
|||||||
Reference in New Issue
Block a user