Key dv-screen map by parent screen UUID (nav target), not rv-screen UUID

This commit is contained in:
Bhanu Prakash Sai Potteri 2026-05-22 23:58:29 +05:30
parent 5dfdab0d69
commit 1e33a465d8
2 changed files with 11 additions and 10 deletions

View File

@ -10,7 +10,7 @@ import {
getHeaderConfig, getScreen, getAuditLog, getInstance,
type LayoutElement, type NavItem, type AuditEntry,
} from "../api/viewService";
import { WORKFLOW_ID, ACTIVITY_IDS, STATE_IDS, DETAIL_VIEW_IDS, RV_TO_DV_SCREEN } from "../config";
import { WORKFLOW_ID, ACTIVITY_IDS, STATE_IDS, DETAIL_VIEW_IDS, SCREEN_TO_DV } from "../config";
// State → contextual action buttons shown above the detail view.
const ACTIVITY_META: Record<string, { label: string; icon: React.ReactNode; style: "primary" | "ghost" }> = {
@ -249,7 +249,7 @@ export default function AppShell() {
<DetailViewPanel
key={`dv-${detailInstanceId}-${refreshKey}`}
viewId={
(activeScreenId && RV_TO_DV_SCREEN[activeScreenId]) ||
(activeScreenId && SCREEN_TO_DV[activeScreenId]) ||
DETAIL_VIEW_IDS.INSTANCE_DETAIL
}
instanceId={detailInstanceId}

View File

@ -29,14 +29,15 @@ export const DETAIL_VIEW_IDS = {
INSTANCE_DETAIL: "7865e1d9-9f7c-489e-a12b-98463ebbb5c1",
} as const;
// rv-screen source_uuid → dv-screen source_uuid (one dv per nav screen).
// Used until row-click jobs are added on the rv_tables in studio.
export const RV_TO_DV_SCREEN: Record<string, string> = {
"cffbba09-ec08-4f23-8cc2-a03a7028ea47": "05169c21-b5a5-4aa1-8faa-b0ddc8989c7d", // Active Scheduling
"4b8e47b4-4e00-43dd-b29b-4c5247ddac64": "ca9d2c41-f998-44ae-95d7-299b4c8aa895", // Scheduled Test Drives
"dbed01b6-462b-4208-8d21-81f814a4001c": "1eb72636-f6fc-41b6-9107-775f93de1fa1", // Pending Feedback
"1c29b808-27fa-4b7a-9664-a80ceda232bc": "f9828eb2-2c32-4a87-b7f1-fc0c8c16ac86", // Completed
"e5ad5164-16ea-4a70-96a0-e9f35e49216d": "f07f3a7f-300e-4040-b5ff-dba75493738a", // Leads
// Parent screen source_uuid (nav target) → dv-screen source_uuid.
// Each parent screen embeds an rv-screen via a `recordsview` element; this map
// short-circuits the lookup until row-click jobs land on the rv_tables in studio.
export const SCREEN_TO_DV: Record<string, string> = {
"bde69570-1b55-48ae-b670-bcfcaa093505": "05169c21-b5a5-4aa1-8faa-b0ddc8989c7d", // Active Scheduling
"98af93e0-0f66-444b-a007-129b322be86b": "ca9d2c41-f998-44ae-95d7-299b4c8aa895", // Scheduled Test Drives
"dfa82b37-ecc0-4b21-99aa-ae50d62c4dfb": "1eb72636-f6fc-41b6-9107-775f93de1fa1", // Pending Feedback
"1fe0a811-19bf-4dbd-a643-32ae1a067162": "f9828eb2-2c32-4a87-b7f1-fc0c8c16ac86", // Completed
"66c003dc-0162-46f2-9b87-a7b73051a4ca": "f07f3a7f-300e-4040-b5ff-dba75493738a", // Leads
};
// Workflow states