local storage clear set fix
This commit is contained in:
parent
d9e932ce8c
commit
dcbc288faf
@ -45,7 +45,7 @@ export function AuthProvider({ children }: { children: ReactNode }) {
|
|||||||
setUserEmail(null);
|
setUserEmail(null);
|
||||||
setIsAdmin(false);
|
setIsAdmin(false);
|
||||||
setRoles([]);
|
setRoles([]);
|
||||||
localStorage.removeItem('krishna_sales_user_email');
|
localStorage.clear();
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -23,11 +23,11 @@ export function DailyLogsPage() {
|
|||||||
const mapComponent = (
|
const mapComponent = (
|
||||||
<div className="!bg-[var(--tiles-card-bg)] rounded-lg shadow-sm border border-gray-100 overflow-hidden flex flex-col h-full min-h-[320px]">
|
<div className="!bg-[var(--tiles-card-bg)] rounded-lg shadow-sm border border-gray-100 overflow-hidden flex flex-col h-full min-h-[320px]">
|
||||||
<div className="px-5 py-4 border-b border-[var(--z-block-border)] flex items-center gap-2">
|
<div className="px-5 py-4 border-b border-[var(--z-block-border)] flex items-center gap-2">
|
||||||
<MapPin size={18} className="text-slate-400" />
|
<MapPin size={18} className="text-slate-400" />
|
||||||
<h3 className="text-md font-semibold text-[var(--z-text-default)]">Activity Locations</h3>
|
<h3 className="text-md font-semibold text-[var(--z-text-default)]">Activity Locations</h3>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex-1 relative bg-slate-50">
|
<div className="flex-1 relative bg-slate-50">
|
||||||
<DailyLogMap />
|
<DailyLogMap />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@ -35,14 +35,14 @@ export function DailyLogsPage() {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{instanceId == null && (
|
{instanceId == null && (
|
||||||
<DailyLogsView
|
<DailyLogsView
|
||||||
mapComponent={mapComponent}
|
mapComponent={mapComponent}
|
||||||
refreshKey={refreshKey}
|
refreshKey={refreshKey}
|
||||||
presetAlias="my_logs"
|
presetAlias=""
|
||||||
onRowClick={(row) => {
|
onRowClick={(row) => {
|
||||||
const id = row.instance_id as number | string | undefined;
|
const id = row.instance_id as number | string | undefined;
|
||||||
if (id != null) navigate(`/daily/${id}`);
|
if (id != null) navigate(`/daily/${id}`);
|
||||||
}}
|
}}
|
||||||
headerActions={
|
headerActions={
|
||||||
<Button size="sm" iconLeft={<Plus size={14} />} onClick={() => {
|
<Button size="sm" iconLeft={<Plus size={14} />} onClick={() => {
|
||||||
setCreateTitle('Punch In');
|
setCreateTitle('Punch In');
|
||||||
@ -55,7 +55,7 @@ export function DailyLogsPage() {
|
|||||||
const state = String(row.current_state_name || row.current_state_name_ || row.current_state || row.status || '').toLowerCase();
|
const state = String(row.current_state_name || row.current_state_name_ || row.current_state || row.status || '').toLowerCase();
|
||||||
// Show only for Punched In, hide for Punched Out or others
|
// Show only for Punched In, hide for Punched Out or others
|
||||||
if (state.includes('out') || !state.includes('in')) return null;
|
if (state.includes('out') || !state.includes('in')) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Button size="sm" variant="secondary" onClick={() => {
|
<Button size="sm" variant="secondary" onClick={() => {
|
||||||
setPunchOutTitle('Punch Out');
|
setPunchOutTitle('Punch Out');
|
||||||
@ -74,8 +74,8 @@ export function DailyLogsPage() {
|
|||||||
title={createTitle}
|
title={createTitle}
|
||||||
width="md"
|
width="md"
|
||||||
>
|
>
|
||||||
<DynamicForm
|
<DynamicForm
|
||||||
client={dailyReportsClient}
|
client={dailyReportsClient}
|
||||||
activityId={DAILY_REPORTS.activities.INIT.uid}
|
activityId={DAILY_REPORTS.activities.INIT.uid}
|
||||||
initialActivityName="Punch In"
|
initialActivityName="Punch In"
|
||||||
onSuccess={() => {
|
onSuccess={() => {
|
||||||
@ -94,8 +94,8 @@ export function DailyLogsPage() {
|
|||||||
width="md"
|
width="md"
|
||||||
>
|
>
|
||||||
{punchOutInstanceId != null && (
|
{punchOutInstanceId != null && (
|
||||||
<DynamicForm
|
<DynamicForm
|
||||||
client={dailyReportsClient}
|
client={dailyReportsClient}
|
||||||
activityId={DAILY_REPORTS.activities.PUNCH_OUT.uid}
|
activityId={DAILY_REPORTS.activities.PUNCH_OUT.uid}
|
||||||
instanceId={punchOutInstanceId}
|
instanceId={punchOutInstanceId}
|
||||||
initialActivityName="Punch Out"
|
initialActivityName="Punch Out"
|
||||||
@ -111,11 +111,11 @@ export function DailyLogsPage() {
|
|||||||
|
|
||||||
{instanceId != null && (
|
{instanceId != null && (
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
<DailyLogDetail
|
<DailyLogDetail
|
||||||
instanceId={instanceId}
|
instanceId={instanceId}
|
||||||
refreshKey={refreshKey}
|
refreshKey={refreshKey}
|
||||||
onPunchOut={() => setPunchOutInstanceId(instanceId)}
|
onPunchOut={() => setPunchOutInstanceId(instanceId)}
|
||||||
onBack={() => navigate('/daily')}
|
onBack={() => navigate('/daily')}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user