Fix internal navigation links: add /kitchen/ prefix to all bare hrefs
Bare <a href="/invoice/..."> tags bypass React Router basename, causing hard navigations to absolute paths with no NPM route. Added /kitchen/ prefix to all internal href values across 12 components. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
9cd1683572
commit
0d6ca9b979
12 changed files with 17666 additions and 17666 deletions
|
|
@ -441,7 +441,7 @@ export default function Dashboard() {
|
|||
{/* ===== Documents Section ===== */}
|
||||
<h3 style={styles.sectionTitle}>Documents</h3>
|
||||
<div style={styles.fourGrid}>
|
||||
<a href="/upload" style={{ ...styles.card, ...styles.uploadCard, ...styles.cardFlex, textDecoration: 'none' }}>
|
||||
<a href="/kitchen/upload" style={{ ...styles.card, ...styles.uploadCard, ...styles.cardFlex, textDecoration: 'none' }}>
|
||||
<h3 style={styles.cardTitle}>Upload New</h3>
|
||||
<div style={styles.uploadIcon}>+</div>
|
||||
<p style={styles.statLabel}>Upload invoice</p>
|
||||
|
|
@ -506,7 +506,7 @@ export default function Dashboard() {
|
|||
<p style={styles.statLabel}>Uploaded this week</p>
|
||||
<div style={styles.cardLinkArea}>
|
||||
{(data?.recent_invoices || 0) > 0 && (
|
||||
<a href={`/invoices?status=&date_from=${new Date(Date.now() - 7 * 24 * 60 * 60 * 1000).toISOString().split('T')[0]}&date_to=${new Date().toISOString().split('T')[0]}`} style={styles.linkText}>
|
||||
<a href={`/kitchen/invoices?status=&date_from=${new Date(Date.now() - 7 * 24 * 60 * 60 * 1000).toISOString().split('T')[0]}&date_to=${new Date().toISOString().split('T')[0]}`} style={styles.linkText}>
|
||||
View all →
|
||||
</a>
|
||||
)}
|
||||
|
|
@ -646,7 +646,7 @@ export default function Dashboard() {
|
|||
</span>
|
||||
))}
|
||||
</div>
|
||||
<a href="/resos" style={styles.link}>View Calendar →</a>
|
||||
<a href="/kitchen/resos" style={styles.link}>View Calendar →</a>
|
||||
</>
|
||||
) : (
|
||||
<p style={styles.noData}>No upcoming events</p>
|
||||
|
|
|
|||
|
|
@ -373,7 +373,7 @@ export default function DisputeDetailModal({ disputeId, onClose, onUpdate }: Dis
|
|||
<div>
|
||||
<div style={styles.modalSubtitle}>
|
||||
{dispute.supplier_name} - <a
|
||||
href={`/invoice/${dispute.invoice_id}`}
|
||||
href={`/kitchen/invoice/${dispute.invoice_id}`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
style={styles.invoiceLink}
|
||||
|
|
|
|||
|
|
@ -989,7 +989,7 @@ export default function GPReport() {
|
|||
<div style={{ ...styles.breakdownContainer, textAlign: 'center', marginBottom: '1.5rem' }}>
|
||||
<h3 style={styles.sectionTitle}>Top Sellers</h3>
|
||||
<p style={{ color: '#666', margin: '2rem 0' }}>
|
||||
No categories configured. <a href="/sambapos" style={{ color: '#e94560' }}>Configure SambaPOS categories</a> to see top sellers by category.
|
||||
No categories configured. <a href="/kitchen/sambapos" style={{ color: '#e94560' }}>Configure SambaPOS categories</a> to see top sellers by category.
|
||||
</p>
|
||||
</div>
|
||||
) : (
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ export default function InvoiceList() {
|
|||
<div>
|
||||
<div style={styles.header}>
|
||||
<h2 style={styles.title}>Uploaded Invoices</h2>
|
||||
<a href="/upload" style={styles.uploadBtn}>
|
||||
<a href="/kitchen/upload" style={styles.uploadBtn}>
|
||||
+ Upload New
|
||||
</a>
|
||||
</div>
|
||||
|
|
@ -226,7 +226,7 @@ export default function InvoiceList() {
|
|||
{invoices.length === 0 ? (
|
||||
<div style={styles.empty}>
|
||||
<p>No invoices pending confirmation.</p>
|
||||
<a href="/upload" style={styles.link}>
|
||||
<a href="/kitchen/upload" style={styles.link}>
|
||||
Upload one now
|
||||
</a>
|
||||
</div>
|
||||
|
|
@ -235,7 +235,7 @@ export default function InvoiceList() {
|
|||
{invoices.map((invoice) => (
|
||||
<a
|
||||
key={invoice.id}
|
||||
href={`/invoice/${invoice.id}`}
|
||||
href={`/kitchen/invoice/${invoice.id}`}
|
||||
style={{
|
||||
...styles.card,
|
||||
borderLeft: `4px solid ${statusColors[invoice.status] || '#999'}`,
|
||||
|
|
@ -341,7 +341,7 @@ export default function InvoiceList() {
|
|||
{completedInvoices.map((invoice) => (
|
||||
<a
|
||||
key={invoice.id}
|
||||
href={`/invoice/${invoice.id}`}
|
||||
href={`/kitchen/invoice/${invoice.id}`}
|
||||
style={{
|
||||
...styles.card,
|
||||
borderLeft: `4px solid ${statusColors[invoice.status] || '#999'}`,
|
||||
|
|
|
|||
|
|
@ -388,7 +388,7 @@ export default function LineItemHistoryModal({
|
|||
{data.description || '-'}
|
||||
</span>
|
||||
<a
|
||||
href={`/invoice/${point.invoice_id}`}
|
||||
href={`/kitchen/invoice/${point.invoice_id}`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
style={{
|
||||
|
|
|
|||
|
|
@ -5324,7 +5324,7 @@ export default function Review() {
|
|||
<td style={styles.searchTd}>{item.last_invoice_date || '—'}</td>
|
||||
<td style={styles.searchTd}>
|
||||
<a
|
||||
href={`/invoice/${item.invoice_id}`}
|
||||
href={`/kitchen/invoice/${item.invoice_id}`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
style={styles.invoiceLink}
|
||||
|
|
|
|||
|
|
@ -617,7 +617,7 @@ export default function SearchDefinitions() {
|
|||
<td style={tdStyle}>
|
||||
{def.source_invoice_number ? (
|
||||
<a
|
||||
href={`/invoice/${def.source_invoice_id}`}
|
||||
href={`/kitchen/invoice/${def.source_invoice_id}`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
style={{ color: '#2563eb', textDecoration: 'none' }}
|
||||
|
|
@ -692,7 +692,7 @@ export default function SearchDefinitions() {
|
|||
<div>
|
||||
<strong>Source Invoice:</strong>{' '}
|
||||
<a
|
||||
href={`/invoice/${editingDef.source_invoice_id}`}
|
||||
href={`/kitchen/invoice/${editingDef.source_invoice_id}`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
style={{ color: '#2563eb' }}
|
||||
|
|
|
|||
|
|
@ -415,7 +415,7 @@ export default function SearchInvoices() {
|
|||
<tr key={inv.id} style={{ borderBottom: '1px solid #e5e7eb' }}>
|
||||
<td style={tdStyle}>
|
||||
<a
|
||||
href={`/invoice/${inv.id}`}
|
||||
href={`/kitchen/invoice/${inv.id}`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
style={{ color: '#2563eb', textDecoration: 'none' }}
|
||||
|
|
@ -466,7 +466,7 @@ export default function SearchInvoices() {
|
|||
<tr key={inv.id} style={{ borderBottom: '1px solid #e5e7eb' }}>
|
||||
<td style={tdStyle}>
|
||||
<a
|
||||
href={`/invoice/${inv.id}`}
|
||||
href={`/kitchen/invoice/${inv.id}`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
style={{ color: '#2563eb', textDecoration: 'none' }}
|
||||
|
|
|
|||
|
|
@ -911,7 +911,7 @@ export default function SearchLineItems() {
|
|||
<td style={tdStyle}>{item.occurrence_count}</td>
|
||||
<td style={tdStyle}>
|
||||
<a
|
||||
href={`/invoice/${item.most_recent_invoice_id}`}
|
||||
href={`/kitchen/invoice/${item.most_recent_invoice_id}`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
style={{ color: '#2563eb', textDecoration: 'none' }}
|
||||
|
|
|
|||
|
|
@ -502,7 +502,7 @@ export default function Upload() {
|
|||
Install App
|
||||
</button>
|
||||
) : (
|
||||
<a href="/upload-app" style={styles.openAppLink}>Open Upload App</a>
|
||||
<a href="/kitchen/upload-app" style={styles.openAppLink}>Open Upload App</a>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ export default function NewbookData() {
|
|||
return (
|
||||
<div style={styles.container}>
|
||||
<div style={styles.titleRow}>
|
||||
<a href="/settings" style={styles.backLink}>← Back to Settings</a>
|
||||
<a href="/kitchen/settings" style={styles.backLink}>← Back to Settings</a>
|
||||
<h1 style={styles.title}>Newbook Data</h1>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -4282,7 +4282,7 @@ export default function Settings() {
|
|||
{/* View Newbook Data Link - outside blocks */}
|
||||
<div style={{ marginTop: '1rem', paddingTop: '1.5rem', borderTop: '1px solid #e0e0e0' }}>
|
||||
<a
|
||||
href="/newbook"
|
||||
href="/kitchen/newbook"
|
||||
style={{
|
||||
display: 'inline-block',
|
||||
padding: '0.75rem 1.5rem',
|
||||
|
|
@ -4894,7 +4894,7 @@ export default function Settings() {
|
|||
{/* View Resos Data Link */}
|
||||
<div style={{ marginTop: '2rem', paddingTop: '1.5rem', borderTop: '1px solid #e0e0e0' }}>
|
||||
<a
|
||||
href="/resos"
|
||||
href="/kitchen/resos"
|
||||
style={{
|
||||
display: 'inline-block',
|
||||
padding: '0.75rem 1.5rem',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue