daily logs tiles fixed
This commit is contained in:
parent
377c851ba6
commit
3bf6757bdf
@ -5,7 +5,7 @@ import type { WiredRecordViewProps } from './OrdersView';
|
||||
import { DailyLogCard } from '../cards/DailyLogCard';
|
||||
|
||||
/** 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 (
|
||||
<RecordView
|
||||
client={dailyReportsClient}
|
||||
@ -19,6 +19,7 @@ export function DailyLogsView({ onRowClick, onPunchOutRow, pageSize, headerActio
|
||||
sortBy="instance_id"
|
||||
sortDir="desc"
|
||||
hideChart
|
||||
hideTiles={hideTiles}
|
||||
renderItem={(row) => <DailyLogCard row={row} onPunchOut={onPunchOutRow} />}
|
||||
/>
|
||||
);
|
||||
|
||||
@ -42,6 +42,8 @@ export interface RecordViewProps {
|
||||
sortDir?: 'asc' | 'desc';
|
||||
/** If true, the analytics chart will not be rendered even if data is returned */
|
||||
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 */
|
||||
preset_alias?: string;
|
||||
}
|
||||
@ -66,6 +68,7 @@ export function RecordView({
|
||||
sortBy,
|
||||
sortDir,
|
||||
hideChart = false,
|
||||
hideTiles = false,
|
||||
preset_alias,
|
||||
}: RecordViewProps) {
|
||||
const [page, setPage] = useState(1);
|
||||
@ -144,7 +147,7 @@ export function RecordView({
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-5 w-full">
|
||||
<StatsTiles tiles={tileValues} />
|
||||
{!hideTiles && <StatsTiles tiles={tileValues} />}
|
||||
|
||||
{!hideChart && <AnalyticsChart data={chartData} />}
|
||||
|
||||
|
||||
@ -22,6 +22,7 @@ export function DailyLogsPage() {
|
||||
return (
|
||||
<>
|
||||
<DailyLogsView
|
||||
hideTiles
|
||||
refreshKey={refreshKey}
|
||||
onRowClick={(row) => {
|
||||
const id = row.instance_id as number | string | undefined;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user