diff --git a/src/App.tsx b/src/App.tsx
index 5a981c2..8f57cb5 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -6,6 +6,7 @@ import { OrdersPage } from './screens/OrdersPage'
import { CallsPage } from './screens/CallsPage'
import { StoresPage } from './screens/StoresPage'
import { DailyLogsPage } from './screens/DailyLogsPage'
+import { AllDailyLogsPage } from './screens/AllDailyLogsPage'
import { AnalyticsPage } from './screens/AnalyticsPage'
function App() {
return (
@@ -26,9 +27,13 @@ function App() {
} />
} />
+ } />
+ } />
+
+
} />
- } />
+ } />
diff --git a/src/api/client.ts b/src/api/client.ts
index a30bfad..3f1f9fa 100644
--- a/src/api/client.ts
+++ b/src/api/client.ts
@@ -146,6 +146,7 @@ export class ZinoClient {
recordView(rvUid: string, params: RecordViewParams = {}): Promise {
return this.request('POST', `/app/${APP_ID}/view/recordview`, {
rv_template_uid: rvUid,
+ preset_alias: params.preset_alias,
search_query: {
page: params.page ?? 1,
limit: params.limit ?? 50,
diff --git a/src/api/types.ts b/src/api/types.ts
index c8a1298..42ee795 100644
--- a/src/api/types.ts
+++ b/src/api/types.ts
@@ -53,6 +53,7 @@ export interface RecordViewParams {
sortDir?: 'asc' | 'desc';
search?: string;
filters?: Array<{ field_key: string; value: string; data_type?: string }>;
+ preset_alias?: string;
}
// --- Form schema (POST /app/{appId}/view/form-screens) ---
diff --git a/src/components/rv/DailyLogsView.tsx b/src/components/rv/DailyLogsView.tsx
index e7b8c2b..b74960d 100644
--- a/src/components/rv/DailyLogsView.tsx
+++ b/src/components/rv/DailyLogsView.tsx
@@ -5,16 +5,17 @@ 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 }: WiredRecordViewProps & { onPunchOutRow?: (row: any) => void }) {
+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 }) {
return (
{
live = false;
};
- }, [client, rvUid, page, pageSize, debounced, filtersParam, refreshKey, sortBy, sortDir]);
+ }, [client, rvUid, preset_alias, page, pageSize, debounced, filtersParam, refreshKey, sortBy, sortDir]);
const fields: RecordViewField[] = useMemo(() => {
const all = resp?.config.fields ?? [];
diff --git a/src/screens/AllDailyLogsPage.tsx b/src/screens/AllDailyLogsPage.tsx
new file mode 100644
index 0000000..c0c9dec
--- /dev/null
+++ b/src/screens/AllDailyLogsPage.tsx
@@ -0,0 +1,95 @@
+import { useNavigate, useParams } from 'react-router-dom';
+import { Modal } from '../components/reusable';
+import { DailyLogsView } from '../components/rv';
+import { DailyLogDetail } from '../components/dv';
+import { useState } from 'react';
+
+import { ClipboardList } from 'lucide-react';
+import { DynamicForm } from '../components/forms/DynamicForm';
+import { DAILY_REPORTS } from '../api/config';
+import { dailyReportsClient } from '../api/clients';
+
+export function AllDailyLogsPage() {
+ const params = useParams();
+ const instanceId = params.instanceId ? Number(params.instanceId) : undefined;
+ const navigate = useNavigate();
+ const [isCreating, setIsCreating] = useState(false);
+ const [createTitle, setCreateTitle] = useState("Punch In");
+ const [punchOutInstanceId, setPunchOutInstanceId] = useState(null);
+ const [punchOutTitle, setPunchOutTitle] = useState("Punch Out");
+ const [refreshKey, setRefreshKey] = useState(0);
+
+ return (
+ <>
+ {
+ const id = row.instance_id as number | string | undefined;
+ if (id != null) navigate(`/all-daily/${id}`);
+ }}
+ onPunchOutRow={(row) => {
+ setPunchOutInstanceId(row.instance_id as string | number);
+ setPunchOutTitle("Punch Out");
+ }}
+ />
+
+ {/* Global Floating Action Button for Punch In */}
+
+
+ setIsCreating(false)}
+ title={createTitle}
+ width="md"
+ >
+ {
+ setIsCreating(false);
+ setRefreshKey(k => k + 1);
+ }}
+ onCancel={() => setIsCreating(false)}
+ onActivityChange={(name) => setCreateTitle(name)}
+ />
+
+
+ setPunchOutInstanceId(null)}
+ title={punchOutTitle}
+ width="md"
+ >
+ {punchOutInstanceId != null && (
+ {
+ setPunchOutInstanceId(null);
+ setRefreshKey(k => k + 1);
+ }}
+ onCancel={() => setPunchOutInstanceId(null)}
+ onActivityChange={(name) => setPunchOutTitle(name)}
+ />
+ )}
+
+
+ navigate(`/all-daily`)}
+ title={instanceId != null ? `Daily Log #${instanceId}` : undefined}
+ width="lg"
+ >
+ {instanceId != null && }
+
+ >
+ );
+}
diff --git a/src/screens/ConsoleLayout.tsx b/src/screens/ConsoleLayout.tsx
index ffa3d79..ac5454b 100644
--- a/src/screens/ConsoleLayout.tsx
+++ b/src/screens/ConsoleLayout.tsx
@@ -52,9 +52,9 @@ export function ConsoleLayout() {