Compare commits
No commits in common. "custom_production" and "main" have entirely different histories.
custom_pro
...
main
@ -10,7 +10,7 @@ import { SharedSummaryDetail } from '@/pages/SharedSummaries/SharedSummaryDetail
|
||||
import { WorkNotes } from '@/pages/WorkNotes';
|
||||
import { CreateRequest } from '@/pages/CreateRequest';
|
||||
import { ClaimManagementWizard } from '@/dealer-claim/components/request-creation/ClaimManagementWizard';
|
||||
// import { DealerDashboard } from '@/dealer-claim/pages/Dashboard';
|
||||
import { DealerDashboard } from '@/dealer-claim/pages/Dashboard';
|
||||
import { MyRequests } from '@/pages/MyRequests';
|
||||
import { Requests } from '@/pages/Requests/Requests';
|
||||
import { UserAllRequests } from '@/pages/Requests/UserAllRequests';
|
||||
@ -84,8 +84,7 @@ function DashboardRoute({ onNavigate, onNewRequest }: { onNavigate?: (page: stri
|
||||
|
||||
// Render dealer-specific dashboard if user is a dealer
|
||||
if (isDealer) {
|
||||
console.log("isDealer", isDealer)
|
||||
// return <DealerDashboard onNavigate={onNavigate} onNewRequest={onNewRequest} />;
|
||||
return <DealerDashboard onNavigate={onNavigate} onNewRequest={onNewRequest} />;
|
||||
}
|
||||
|
||||
// Render regular dashboard for all other users
|
||||
|
||||
@ -72,15 +72,14 @@ export function PageLayout({ children, currentPage = 'dashboard', onNavigate, on
|
||||
const items = [
|
||||
{ id: 'dashboard', label: 'Dashboard', icon: Home },
|
||||
// Add "All Requests" for all users (admin sees org-level, regular users see their participant requests)
|
||||
{ id: 'requests', label: 'All Requests', icon: List, adminOnly: false },
|
||||
{ id: 'my-requests', label: 'My Requests', icon: User }
|
||||
{ id: 'requests', label: 'All Requests', icon: List, adminOnly: false }
|
||||
// { id: 'admin/templates', label: 'Admin Templates', icon: Plus, adminOnly: true },
|
||||
];
|
||||
|
||||
// Add remaining menu items (exclude "My Requests" for dealers)
|
||||
// if (!isDealer) {
|
||||
// items.push({ id: 'my-requests', label: 'My Requests', icon: User });
|
||||
// }
|
||||
if (!isDealer) {
|
||||
items.push({ id: 'my-requests', label: 'My Requests', icon: User });
|
||||
}
|
||||
|
||||
items.push(
|
||||
{ id: 'open-requests', label: 'Open Requests', icon: FileText },
|
||||
@ -108,20 +107,6 @@ export function PageLayout({ children, currentPage = 'dashboard', onNavigate, on
|
||||
|
||||
// Navigate to the request if URL provided
|
||||
if (notification.actionUrl && onNavigate) {
|
||||
// PRIORITY: For shared summaries or specific action URLs, use them directly
|
||||
if (notification.actionUrl && (
|
||||
notification.notificationType === 'summary_shared' ||
|
||||
notification.actionUrl.includes('shared-summaries')
|
||||
)) {
|
||||
console.log('[PageLayout] Navigating to shared summary:', notification.actionUrl);
|
||||
const targetUrl = notification.actionUrl.startsWith('/')
|
||||
? notification.actionUrl.substring(1)
|
||||
: notification.actionUrl;
|
||||
onNavigate(targetUrl);
|
||||
setNotificationsOpen(false);
|
||||
return;
|
||||
}
|
||||
|
||||
// Extract request number from URL (e.g., /request/REQ-2025-12345)
|
||||
const requestNumber = notification.metadata?.requestNumber;
|
||||
if (requestNumber) {
|
||||
@ -290,7 +275,7 @@ export function PageLayout({ children, currentPage = 'dashboard', onNavigate, on
|
||||
</div>
|
||||
|
||||
{/* Quick Action in Sidebar - Right below menu items */}
|
||||
{/* {!isDealer && ( */}
|
||||
{!isDealer && (
|
||||
<div className="mt-6 pt-6 border-t border-gray-800 px-3">
|
||||
<Button
|
||||
onClick={onNewRequest}
|
||||
@ -301,7 +286,7 @@ export function PageLayout({ children, currentPage = 'dashboard', onNavigate, on
|
||||
Raise New Request
|
||||
</Button>
|
||||
</div>
|
||||
{/* )} */}
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
@ -79,10 +79,10 @@ interface WorkNoteChatProps {
|
||||
skipSocketJoin?: boolean; // Set to true when embedded in RequestDetail (to avoid double join)
|
||||
requestTitle?: string; // Optional title for display
|
||||
onAttachmentsExtracted?: (attachments: any[]) => void; // Callback to pass attachments to parent
|
||||
isInitiator?: boolean; // Whether current user is the initiator
|
||||
isSpectator?: boolean; // Whether current user is a spectator (view-only)
|
||||
currentLevels?: any[]; // Current approval levels for add approver modal
|
||||
onAddApprover?: (email: string, tatHours: number, level: number) => Promise<void>; // Callback to add approver
|
||||
canAddApprover?: boolean; // Whether the current user can add approvers
|
||||
maxApprovalLevels?: number; // Maximum allowed approval levels from system policy
|
||||
onPolicyViolation?: (violations: Array<{ type: string; message: string; currentValue?: number; maxValue?: number }>) => void; // Callback for policy violations
|
||||
}
|
||||
@ -145,7 +145,7 @@ const FileIcon = ({ type }: { type: string }) => {
|
||||
return <Paperclip className={`${iconClass} text-gray-600`} />;
|
||||
};
|
||||
|
||||
export function WorkNoteChat({ requestId, messages: externalMessages, onSend, skipSocketJoin = false, requestTitle, onAttachmentsExtracted, isSpectator = false, currentLevels = [], onAddApprover, canAddApprover, maxApprovalLevels, onPolicyViolation }: WorkNoteChatProps) {
|
||||
export function WorkNoteChat({ requestId, messages: externalMessages, onSend, skipSocketJoin = false, requestTitle, onAttachmentsExtracted, isInitiator = false, isSpectator = false, currentLevels = [], onAddApprover, maxApprovalLevels, onPolicyViolation }: WorkNoteChatProps) {
|
||||
const routeParams = useParams<{ requestId: string }>();
|
||||
const effectiveRequestId = requestId || routeParams.requestId || '';
|
||||
const [message, setMessage] = useState('');
|
||||
@ -1743,8 +1743,8 @@ export function WorkNoteChat({ requestId, messages: externalMessages, onSend, sk
|
||||
<div className="p-4 sm:p-6 flex-shrink-0">
|
||||
<h4 className="font-semibold text-gray-900 mb-3 text-sm sm:text-base">Quick Actions</h4>
|
||||
<div className="space-y-2">
|
||||
{/* Only initiator or current approver can add approvers in custom flows */}
|
||||
{canAddApprover && (
|
||||
{/* Only initiator can add approvers */}
|
||||
{isInitiator && (
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
@ -1805,7 +1805,7 @@ export function WorkNoteChat({ requestId, messages: externalMessages, onSend, sk
|
||||
)}
|
||||
|
||||
{/* Add Approver Modal - Hide for spectators */}
|
||||
{!effectiveIsSpectator && canAddApprover && (
|
||||
{!effectiveIsSpectator && isInitiator && (
|
||||
<AddApproverModal
|
||||
open={showAddApproverModal}
|
||||
onClose={() => setShowAddApproverModal(false)}
|
||||
|
||||
@ -56,8 +56,7 @@ export function ApprovalWorkflowStep({
|
||||
email: '',
|
||||
name: '',
|
||||
level: i + 1,
|
||||
tat: 8 as any,
|
||||
tatType: 'hours'
|
||||
tat: '' as any
|
||||
};
|
||||
}
|
||||
}
|
||||
@ -374,9 +373,9 @@ export function ApprovalWorkflowStep({
|
||||
<Input
|
||||
id={`tat-${level}`}
|
||||
type="number"
|
||||
placeholder={approver.tatType === 'days' ? '1' : '8'}
|
||||
placeholder={approver.tatType === 'days' ? '7' : '24'}
|
||||
min="1"
|
||||
max={approver.tatType === 'days' ? '90' : '720'}
|
||||
max={approver.tatType === 'days' ? '30' : '720'}
|
||||
value={approver.tat || ''}
|
||||
onChange={(e) => {
|
||||
const newApprovers = [...formData.approvers];
|
||||
@ -447,7 +446,28 @@ export function ApprovalWorkflowStep({
|
||||
<div className="flex-1">
|
||||
<div className="flex items-center justify-between mb-2">
|
||||
<h4 className="font-semibold text-emerald-900">TAT Summary</h4>
|
||||
<div>
|
||||
<div className="text-right">
|
||||
{(() => {
|
||||
// Calculate total calendar days (for display)
|
||||
// Days: count as calendar days
|
||||
// Hours: convert to calendar days (hours / 24)
|
||||
const totalCalendarDays = formData.approvers?.reduce((sum: number, a: any) => {
|
||||
const tat = Number(a.tat || 0);
|
||||
const tatType = a.tatType || 'hours';
|
||||
if (tatType === 'days') {
|
||||
return sum + tat; // Calendar days
|
||||
} else {
|
||||
return sum + (tat / 24); // Convert hours to calendar days
|
||||
}
|
||||
}, 0) || 0;
|
||||
const displayDays = Math.ceil(totalCalendarDays);
|
||||
return (
|
||||
<>
|
||||
<div className="text-lg font-bold text-emerald-800">{displayDays} {displayDays === 1 ? 'Day' : 'Days'}</div>
|
||||
<div className="text-xs text-emerald-600">Total Duration</div>
|
||||
</>
|
||||
);
|
||||
})()}
|
||||
</div>
|
||||
</div>
|
||||
<div className="space-y-3">
|
||||
@ -455,7 +475,8 @@ export function ApprovalWorkflowStep({
|
||||
{formData.approvers?.map((approver: any, idx: number) => {
|
||||
const tat = Number(approver.tat || 0);
|
||||
const tatType = approver.tatType || 'hours';
|
||||
const hours = tatType === 'days' ? tat * 8 : tat;
|
||||
// Convert days to hours: 1 day = 24 hours
|
||||
const hours = tatType === 'days' ? tat * 24 : tat;
|
||||
if (!tat) return null;
|
||||
return (
|
||||
<div key={idx} className="bg-white/60 p-2 rounded border border-emerald-100">
|
||||
@ -468,12 +489,15 @@ export function ApprovalWorkflowStep({
|
||||
})}
|
||||
</div>
|
||||
{(() => {
|
||||
// Convert all TAT to hours first
|
||||
// Days: 1 day = 24 hours
|
||||
// Hours: already in hours
|
||||
const totalHours = formData.approvers?.reduce((sum: number, a: any) => {
|
||||
const tat = Number(a.tat || 0);
|
||||
const tatType = a.tatType || 'hours';
|
||||
if (tatType === 'days') {
|
||||
// 1 day = 8 working hours
|
||||
return sum + (tat * 8);
|
||||
// 1 day = 24 hours
|
||||
return sum + (tat * 24);
|
||||
} else {
|
||||
return sum + tat;
|
||||
}
|
||||
@ -485,12 +509,12 @@ export function ApprovalWorkflowStep({
|
||||
<div className="bg-white/80 p-3 rounded border border-emerald-200">
|
||||
<div className="grid grid-cols-2 gap-4 text-center">
|
||||
<div>
|
||||
<div className="text-lg font-bold text-emerald-800">{totalHours}h</div>
|
||||
<div className="text-lg font-bold text-emerald-800">{totalHours}{totalHours === 1 ? 'h' : 'h'}</div>
|
||||
<div className="text-xs text-emerald-600">Total Hours</div>
|
||||
</div>
|
||||
<div>
|
||||
<div className="text-lg font-bold text-emerald-800">{workingDays} {workingDays === 1 ? 'Day' : 'Days'}</div>
|
||||
<div className="text-xs text-emerald-600">Total Days*</div>
|
||||
<div className="text-lg font-bold text-emerald-800">{workingDays}</div>
|
||||
<div className="text-xs text-emerald-600">Working Days*</div>
|
||||
</div>
|
||||
</div>
|
||||
<p className="text-xs text-emerald-600 mt-2 text-center">*Based on 8-hour working days</p>
|
||||
|
||||
@ -107,8 +107,8 @@ export function TemplateSelectionStep({
|
||||
<p>No admin templates available yet.</p>
|
||||
</div>
|
||||
) : (
|
||||
displayTemplates.map((template, index) => {
|
||||
const isComingSoon = index === 1;
|
||||
displayTemplates.map((template) => {
|
||||
const isComingSoon = false;
|
||||
const isDisabled = isComingSoon;
|
||||
const isCategoryCard = template.id === 'admin-templates-category';
|
||||
// const isCustomCard = template.id === 'custom';
|
||||
@ -124,7 +124,7 @@ export function TemplateSelectionStep({
|
||||
>
|
||||
<Card
|
||||
className={`h-full transition-all duration-300 border-2 ${isDisabled
|
||||
? 'border-gray-200 bg-gray-50/50 opacity-50 cursor-not-allowed'
|
||||
? 'border-gray-200 bg-gray-50/50 opacity-85 cursor-not-allowed'
|
||||
: isSelected
|
||||
? 'border-blue-500 shadow-xl bg-blue-50/50 ring-2 ring-blue-200 cursor-pointer'
|
||||
: isCategoryCard
|
||||
|
||||
@ -31,14 +31,14 @@ export function StandardClosedRequestsFilters({
|
||||
searchTerm,
|
||||
priorityFilter,
|
||||
statusFilter,
|
||||
templateTypeFilter: _templateTypeFilter,
|
||||
templateTypeFilter,
|
||||
sortBy,
|
||||
sortOrder,
|
||||
activeFiltersCount,
|
||||
onSearchChange,
|
||||
onPriorityChange,
|
||||
onStatusChange,
|
||||
onTemplateTypeChange: _onTemplateTypeChange,
|
||||
onTemplateTypeChange,
|
||||
onSortByChange,
|
||||
onSortOrderChange,
|
||||
onClearFilters,
|
||||
@ -131,7 +131,7 @@ export function StandardClosedRequestsFilters({
|
||||
</SelectContent>
|
||||
</Select>
|
||||
|
||||
{/* <Select value={_templateTypeFilter} onValueChange={_onTemplateTypeChange}>
|
||||
<Select value={templateTypeFilter} onValueChange={onTemplateTypeChange}>
|
||||
<SelectTrigger className="h-9 sm:h-10 md:h-11 text-sm sm:text-base bg-gray-50 border-gray-200 focus:bg-white" data-testid="closed-requests-template-type-filter">
|
||||
<SelectValue placeholder="All Templates" />
|
||||
</SelectTrigger>
|
||||
@ -140,7 +140,7 @@ export function StandardClosedRequestsFilters({
|
||||
<SelectItem value="CUSTOM">Non-Templatized</SelectItem>
|
||||
<SelectItem value="DEALER CLAIM">Dealer Claim</SelectItem>
|
||||
</SelectContent>
|
||||
</Select> */}
|
||||
</Select>
|
||||
|
||||
<div className="flex gap-2">
|
||||
<Select value={sortBy} onValueChange={(value) => onSortByChange(value as 'created' | 'due' | 'priority')}>
|
||||
|
||||
@ -31,13 +31,13 @@ export function StandardRequestsFilters({
|
||||
searchTerm,
|
||||
statusFilter,
|
||||
priorityFilter,
|
||||
templateTypeFilter: _templateTypeFilter,
|
||||
templateTypeFilter,
|
||||
sortBy,
|
||||
sortOrder,
|
||||
onSearchChange,
|
||||
onStatusFilterChange,
|
||||
onPriorityFilterChange,
|
||||
onTemplateTypeFilterChange: _onTemplateTypeFilterChange,
|
||||
onTemplateTypeFilterChange,
|
||||
onSortByChange,
|
||||
onSortOrderChange,
|
||||
onClearFilters,
|
||||
@ -120,7 +120,7 @@ export function StandardRequestsFilters({
|
||||
</SelectContent>
|
||||
</Select>
|
||||
|
||||
{/* <Select value={templateTypeFilter} onValueChange={onTemplateTypeFilterChange}>
|
||||
<Select value={templateTypeFilter} onValueChange={onTemplateTypeFilterChange}>
|
||||
<SelectTrigger className="h-9 sm:h-10 md:h-11 text-sm sm:text-base bg-gray-50 border-gray-200 focus:bg-white focus:border-blue-400 focus:ring-1 focus:ring-blue-200">
|
||||
<SelectValue placeholder="All Templates" />
|
||||
</SelectTrigger>
|
||||
@ -129,7 +129,7 @@ export function StandardRequestsFilters({
|
||||
<SelectItem value="CUSTOM">Non-Templatized</SelectItem>
|
||||
<SelectItem value="DEALER CLAIM">Dealer Claim</SelectItem>
|
||||
</SelectContent>
|
||||
</Select> */}
|
||||
</Select>
|
||||
|
||||
<div className="flex gap-2">
|
||||
<Select value={sortBy} onValueChange={(value: any) => onSortByChange(value)}>
|
||||
|
||||
@ -87,7 +87,7 @@ export function StandardUserAllRequestsFilters({
|
||||
searchTerm,
|
||||
statusFilter,
|
||||
priorityFilter,
|
||||
templateTypeFilter: _templateTypeFilter,
|
||||
templateTypeFilter,
|
||||
departmentFilter,
|
||||
slaComplianceFilter,
|
||||
initiatorFilter: _initiatorFilter,
|
||||
@ -104,7 +104,7 @@ export function StandardUserAllRequestsFilters({
|
||||
onSearchChange,
|
||||
onStatusChange,
|
||||
onPriorityChange,
|
||||
onTemplateTypeChange: _onTemplateTypeChange,
|
||||
onTemplateTypeChange,
|
||||
onDepartmentChange,
|
||||
onSlaComplianceChange,
|
||||
onInitiatorChange: _onInitiatorChange,
|
||||
@ -180,7 +180,7 @@ export function StandardUserAllRequestsFilters({
|
||||
</SelectContent>
|
||||
</Select>
|
||||
|
||||
{/* <Select value={_templateTypeFilter} onValueChange={_onTemplateTypeChange}>
|
||||
<Select value={templateTypeFilter} onValueChange={onTemplateTypeChange}>
|
||||
<SelectTrigger className="h-10" data-testid="template-type-filter">
|
||||
<SelectValue placeholder="All Templates" />
|
||||
</SelectTrigger>
|
||||
@ -189,7 +189,7 @@ export function StandardUserAllRequestsFilters({
|
||||
<SelectItem value="CUSTOM">Custom</SelectItem>
|
||||
<SelectItem value="DEALER CLAIM">Dealer Claim</SelectItem>
|
||||
</SelectContent>
|
||||
</Select> */}
|
||||
</Select>
|
||||
|
||||
<Select
|
||||
value={departmentFilter}
|
||||
|
||||
@ -47,9 +47,6 @@ import { CustomOverviewTab, CustomWorkflowTab } from '../index';
|
||||
import { SharedComponents } from '@/shared/components';
|
||||
const { DocumentsTab, ActivityTab, WorkNotesTab, SummaryTab, RequestDetailHeader, QuickActionsSidebar, RequestDetailModals } = SharedComponents;
|
||||
|
||||
// Utilities
|
||||
import { isCustomRequest } from '@/utils/requestTypeUtils';
|
||||
|
||||
// Other components
|
||||
import { ShareSummaryModal } from '@/components/modals/ShareSummaryModal';
|
||||
import { getSummaryDetails, getSummaryByRequestId, type SummaryDetails } from '@/services/summaryApi';
|
||||
@ -572,10 +569,10 @@ function CustomRequestDetailInner({ requestId: propRequestId, onBack, dynamicReq
|
||||
requestTitle={request.title}
|
||||
mergedMessages={mergedMessages}
|
||||
setWorkNoteAttachments={setWorkNoteAttachments}
|
||||
isInitiator={isInitiator}
|
||||
isSpectator={isSpectator}
|
||||
currentLevels={currentLevels}
|
||||
onAddApprover={handleAddApprover}
|
||||
canAddApprover={(isInitiator || !!currentApprovalLevel) && isCustomRequest(apiRequest)}
|
||||
maxApprovalLevels={systemPolicy.maxApprovalLevels}
|
||||
onPolicyViolation={(violations) => setPolicyViolationModal({ open: true, violations })}
|
||||
/>
|
||||
|
||||
@ -661,10 +661,10 @@ function DealerClaimRequestDetailInner({ requestId: propRequestId, onBack, dynam
|
||||
requestTitle={request.title}
|
||||
mergedMessages={mergedMessages}
|
||||
setWorkNoteAttachments={setWorkNoteAttachments}
|
||||
isInitiator={isInitiator}
|
||||
isSpectator={isSpectator}
|
||||
currentLevels={currentLevels}
|
||||
onAddApprover={handleAddApprover}
|
||||
canAddApprover={false} // Explicitly disabled for Dealer Claims
|
||||
maxApprovalLevels={systemPolicy.maxApprovalLevels}
|
||||
onPolicyViolation={(violations) => setPolicyViolationModal({ open: true, violations })}
|
||||
/>
|
||||
|
||||
@ -2,13 +2,13 @@ import { useState, useEffect } from 'react';
|
||||
import { useAuth } from '@/contexts/AuthContext';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Card, CardContent, CardHeader } from '@/components/ui/card';
|
||||
import { LogIn } from 'lucide-react';
|
||||
import { LogIn, Shield } from 'lucide-react';
|
||||
import { ReLogo, LandingPageImage } from '@/assets';
|
||||
// import { initiateTanflowLogin } from '@/services/tanflowAuth';
|
||||
import { initiateTanflowLogin } from '@/services/tanflowAuth';
|
||||
|
||||
export function Auth() {
|
||||
const { login, isLoading, error } = useAuth();
|
||||
const [tanflowLoading] = useState(false);
|
||||
const [tanflowLoading, setTanflowLoading] = useState(false);
|
||||
const [imageLoaded, setImageLoaded] = useState(false);
|
||||
|
||||
// Preload the background image
|
||||
@ -41,21 +41,21 @@ export function Auth() {
|
||||
}
|
||||
};
|
||||
|
||||
// const handleTanflowLogin = () => {
|
||||
// // Clear any existing session data
|
||||
// localStorage.clear();
|
||||
// sessionStorage.clear();
|
||||
const handleTanflowLogin = () => {
|
||||
// Clear any existing session data
|
||||
localStorage.clear();
|
||||
sessionStorage.clear();
|
||||
|
||||
// setTanflowLoading(true);
|
||||
// try {
|
||||
// initiateTanflowLogin();
|
||||
// } catch (loginError) {
|
||||
// console.error('========================================');
|
||||
// console.error('TANFLOW LOGIN ERROR');
|
||||
// console.error('Error details:', loginError);
|
||||
// setTanflowLoading(false);
|
||||
// }
|
||||
// };
|
||||
setTanflowLoading(true);
|
||||
try {
|
||||
initiateTanflowLogin();
|
||||
} catch (loginError) {
|
||||
console.error('========================================');
|
||||
console.error('TANFLOW LOGIN ERROR');
|
||||
console.error('Error details:', loginError);
|
||||
setTanflowLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
if (error) {
|
||||
console.error('Auth Error in Auth Component:', {
|
||||
@ -124,7 +124,7 @@ export function Auth() {
|
||||
)}
|
||||
</Button>
|
||||
|
||||
{/* <div className="relative">
|
||||
<div className="relative">
|
||||
<div className="absolute inset-0 flex items-center">
|
||||
<span className="w-full border-t border-gray-700"></span>
|
||||
</div>
|
||||
@ -152,7 +152,7 @@ export function Auth() {
|
||||
Dealer Login
|
||||
</>
|
||||
)}
|
||||
</Button> */}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div className="text-center text-sm text-gray-400 mt-4">
|
||||
|
||||
@ -22,11 +22,11 @@ export function MyRequestsFilters({
|
||||
searchTerm,
|
||||
statusFilter,
|
||||
priorityFilter,
|
||||
templateTypeFilter: _templateTypeFilter,
|
||||
templateTypeFilter,
|
||||
onSearchChange,
|
||||
onStatusChange,
|
||||
onPriorityChange,
|
||||
onTemplateTypeChange: _onTemplateTypeChange,
|
||||
onTemplateTypeChange,
|
||||
}: MyRequestsFiltersProps) {
|
||||
return (
|
||||
<Card className="border-gray-200" data-testid="my-requests-filters">
|
||||
@ -76,7 +76,7 @@ export function MyRequestsFilters({
|
||||
</SelectContent>
|
||||
</Select>
|
||||
|
||||
{/* <Select value={_templateTypeFilter} onValueChange={_onTemplateTypeChange}>
|
||||
<Select value={templateTypeFilter} onValueChange={onTemplateTypeChange}>
|
||||
<SelectTrigger
|
||||
className="flex-1 md:w-28 lg:w-32 text-xs sm:text-sm bg-white border-gray-300 hover:border-gray-400 focus:border-blue-400 focus:ring-1 focus:ring-blue-200 h-9 sm:h-10"
|
||||
data-testid="template-type-filter"
|
||||
@ -88,7 +88,7 @@ export function MyRequestsFilters({
|
||||
<SelectItem value="CUSTOM">Non-Templatized</SelectItem>
|
||||
<SelectItem value="DEALER CLAIM">Dealer Claim</SelectItem>
|
||||
</SelectContent>
|
||||
</Select> */}
|
||||
</Select>
|
||||
</div>
|
||||
</div>
|
||||
</CardContent>
|
||||
|
||||
@ -76,19 +76,6 @@ export function Notifications({ onNavigate }: NotificationsProps) {
|
||||
|
||||
// Navigate to the request if URL provided
|
||||
if (notification.actionUrl && onNavigate) {
|
||||
// PRIORITY: For shared summaries or specific action URLs, use them directly
|
||||
if (notification.actionUrl && (
|
||||
notification.notificationType === 'summary_shared' ||
|
||||
notification.actionUrl.includes('shared-summaries')
|
||||
)) {
|
||||
console.log('[Notifications] Navigating to shared summary:', notification.actionUrl);
|
||||
const targetUrl = notification.actionUrl.startsWith('/')
|
||||
? notification.actionUrl.substring(1)
|
||||
: notification.actionUrl;
|
||||
onNavigate(targetUrl);
|
||||
return;
|
||||
}
|
||||
|
||||
const requestNumber = notification.metadata?.requestNumber;
|
||||
if (requestNumber) {
|
||||
let navigationUrl = `request/${requestNumber}`;
|
||||
|
||||
@ -13,7 +13,6 @@ import notificationApi, { type Notification } from '@/services/notificationApi';
|
||||
import { ProcessDetailsCard } from '@/dealer-claim/components/request-detail/claim-cards';
|
||||
import { isClaimManagementRequest } from '@/utils/claimRequestUtils';
|
||||
import { determineUserRole, getRoleBasedVisibility, mapToClaimManagementRequest } from '@/utils/claimDataMapper';
|
||||
import { isCustomRequest } from '@/utils/requestTypeUtils';
|
||||
|
||||
interface QuickActionsSidebarProps {
|
||||
request: any;
|
||||
@ -146,8 +145,8 @@ export function QuickActionsSidebar({
|
||||
<CardTitle className="text-sm sm:text-base">Quick Actions</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-2">
|
||||
{/* Add Approver - Only for Initiator or Current Approver in Custom Workflows */}
|
||||
{(isInitiator || currentApprovalLevel) && isCustomRequest(request) && request.status !== 'closed' && (
|
||||
{/* Add Approver */}
|
||||
{isInitiator && request.status !== 'closed' && (
|
||||
<Button
|
||||
variant="outline"
|
||||
className="w-full justify-start gap-2 bg-white text-gray-700 border-gray-300 hover:bg-gray-50 hover:text-gray-900 h-9 sm:h-10 text-xs sm:text-sm"
|
||||
|
||||
@ -9,10 +9,10 @@ interface WorkNotesTabProps {
|
||||
requestTitle: string;
|
||||
mergedMessages: any[];
|
||||
setWorkNoteAttachments: (attachments: any[]) => void;
|
||||
isInitiator: boolean;
|
||||
isSpectator: boolean;
|
||||
currentLevels: any[];
|
||||
onAddApprover: (email: string, tatHours: number, level: number) => Promise<void>;
|
||||
canAddApprover?: boolean;
|
||||
maxApprovalLevels?: number;
|
||||
onPolicyViolation?: (violations: Array<{ type: string; message: string; currentValue?: number; maxValue?: number }>) => void;
|
||||
}
|
||||
@ -22,10 +22,10 @@ export function WorkNotesTab({
|
||||
requestTitle,
|
||||
mergedMessages,
|
||||
setWorkNoteAttachments,
|
||||
isInitiator,
|
||||
isSpectator,
|
||||
currentLevels,
|
||||
onAddApprover,
|
||||
canAddApprover,
|
||||
maxApprovalLevels,
|
||||
onPolicyViolation,
|
||||
}: WorkNotesTabProps) {
|
||||
@ -37,10 +37,10 @@ export function WorkNotesTab({
|
||||
skipSocketJoin={true}
|
||||
messages={mergedMessages}
|
||||
onAttachmentsExtracted={setWorkNoteAttachments}
|
||||
isInitiator={isInitiator}
|
||||
isSpectator={isSpectator}
|
||||
currentLevels={currentLevels}
|
||||
onAddApprover={onAddApprover}
|
||||
canAddApprover={canAddApprover}
|
||||
maxApprovalLevels={maxApprovalLevels}
|
||||
onPolicyViolation={onPolicyViolation}
|
||||
/>
|
||||
|
||||
@ -574,7 +574,7 @@ export function Requests({ onViewRequest }: RequestsProps) {
|
||||
</SelectContent>
|
||||
</Select>
|
||||
|
||||
{/* <Select value={filters.templateTypeFilter} onValueChange={filters.setTemplateTypeFilter}>
|
||||
<Select value={filters.templateTypeFilter} onValueChange={filters.setTemplateTypeFilter}>
|
||||
<SelectTrigger className="h-10" data-testid="template-type-filter">
|
||||
<SelectValue placeholder="All Templates" />
|
||||
</SelectTrigger>
|
||||
@ -583,7 +583,7 @@ export function Requests({ onViewRequest }: RequestsProps) {
|
||||
<SelectItem value="CUSTOM">Non-Templatized</SelectItem>
|
||||
<SelectItem value="DEALER CLAIM">Dealer Claim</SelectItem>
|
||||
</SelectContent>
|
||||
</Select> */}
|
||||
</Select>
|
||||
|
||||
<Select
|
||||
value={filters.departmentFilter}
|
||||
|
||||
@ -200,14 +200,14 @@ export function Settings() {
|
||||
<span className="hidden sm:inline">Holidays</span>
|
||||
<span className="sm:hidden">Holidays</span>
|
||||
</TabsTrigger>
|
||||
{/* <TabsTrigger
|
||||
<TabsTrigger
|
||||
value="templates"
|
||||
className="flex items-center justify-center gap-2 py-3 rounded-lg data-[state=active]:bg-white data-[state=active]:shadow-md transition-all"
|
||||
>
|
||||
<FileText className="w-4 h-4" />
|
||||
<span className="hidden sm:inline">Templates</span>
|
||||
<span className="sm:hidden">Templates</span>
|
||||
</TabsTrigger> */}
|
||||
</TabsTrigger>
|
||||
</TabsList>
|
||||
|
||||
{/* Fixed width container to prevent layout shifts */}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user