daily logs tiles fixed

This commit is contained in:
suryacp23 2026-07-20 11:12:19 +05:30
parent 377c851ba6
commit 3bf6757bdf
3 changed files with 7 additions and 2 deletions

View File

@ -5,7 +5,7 @@ import type { WiredRecordViewProps } from './OrdersView';
import { DailyLogCard } from '../cards/DailyLogCard'; import { DailyLogCard } from '../cards/DailyLogCard';
/** Daily Logs record view (Daily Reports workflow). */ /** Daily Logs record view (Daily Reports workflow). */
export function DailyLogsView({ onRowClick, onPunchOutRow, pageSize, headerActions, refreshKey, preset_alias = "my_logs", title = "Daily Logs" }: WiredRecordViewProps & { onPunchOutRow?: (row: any) => void, preset_alias?: string, title?: string }) { export function DailyLogsView({ onRowClick, onPunchOutRow, pageSize, headerActions, refreshKey, preset_alias = "my_logs", title = "Daily Logs", hideTiles }: WiredRecordViewProps & { onPunchOutRow?: (row: any) => void, preset_alias?: string, title?: string, hideTiles?: boolean }) {
return ( return (
<RecordView <RecordView
client={dailyReportsClient} client={dailyReportsClient}
@ -19,6 +19,7 @@ export function DailyLogsView({ onRowClick, onPunchOutRow, pageSize, headerActio
sortBy="instance_id" sortBy="instance_id"
sortDir="desc" sortDir="desc"
hideChart hideChart
hideTiles={hideTiles}
renderItem={(row) => <DailyLogCard row={row} onPunchOut={onPunchOutRow} />} renderItem={(row) => <DailyLogCard row={row} onPunchOut={onPunchOutRow} />}
/> />
); );

View File

@ -42,6 +42,8 @@ export interface RecordViewProps {
sortDir?: 'asc' | 'desc'; sortDir?: 'asc' | 'desc';
/** If true, the analytics chart will not be rendered even if data is returned */ /** If true, the analytics chart will not be rendered even if data is returned */
hideChart?: boolean; hideChart?: boolean;
/** If true, the tiles will not be rendered even if data is returned */
hideTiles?: boolean;
/** Pass a preset alias to apply server-side presets */ /** Pass a preset alias to apply server-side presets */
preset_alias?: string; preset_alias?: string;
} }
@ -66,6 +68,7 @@ export function RecordView({
sortBy, sortBy,
sortDir, sortDir,
hideChart = false, hideChart = false,
hideTiles = false,
preset_alias, preset_alias,
}: RecordViewProps) { }: RecordViewProps) {
const [page, setPage] = useState(1); const [page, setPage] = useState(1);
@ -144,7 +147,7 @@ export function RecordView({
return ( return (
<div className="flex flex-col gap-5 w-full"> <div className="flex flex-col gap-5 w-full">
<StatsTiles tiles={tileValues} /> {!hideTiles && <StatsTiles tiles={tileValues} />}
{!hideChart && <AnalyticsChart data={chartData} />} {!hideChart && <AnalyticsChart data={chartData} />}

View File

@ -22,6 +22,7 @@ export function DailyLogsPage() {
return ( return (
<> <>
<DailyLogsView <DailyLogsView
hideTiles
refreshKey={refreshKey} refreshKey={refreshKey}
onRowClick={(row) => { onRowClick={(row) => {
const id = row.instance_id as number | string | undefined; const id = row.instance_id as number | string | undefined;