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 ===== */}
|
{/* ===== Documents Section ===== */}
|
||||||
<h3 style={styles.sectionTitle}>Documents</h3>
|
<h3 style={styles.sectionTitle}>Documents</h3>
|
||||||
<div style={styles.fourGrid}>
|
<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>
|
<h3 style={styles.cardTitle}>Upload New</h3>
|
||||||
<div style={styles.uploadIcon}>+</div>
|
<div style={styles.uploadIcon}>+</div>
|
||||||
<p style={styles.statLabel}>Upload invoice</p>
|
<p style={styles.statLabel}>Upload invoice</p>
|
||||||
|
|
@ -506,7 +506,7 @@ export default function Dashboard() {
|
||||||
<p style={styles.statLabel}>Uploaded this week</p>
|
<p style={styles.statLabel}>Uploaded this week</p>
|
||||||
<div style={styles.cardLinkArea}>
|
<div style={styles.cardLinkArea}>
|
||||||
{(data?.recent_invoices || 0) > 0 && (
|
{(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 →
|
View all →
|
||||||
</a>
|
</a>
|
||||||
)}
|
)}
|
||||||
|
|
@ -646,7 +646,7 @@ export default function Dashboard() {
|
||||||
</span>
|
</span>
|
||||||
))}
|
))}
|
||||||
</div>
|
</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>
|
<p style={styles.noData}>No upcoming events</p>
|
||||||
|
|
|
||||||
|
|
@ -373,7 +373,7 @@ export default function DisputeDetailModal({ disputeId, onClose, onUpdate }: Dis
|
||||||
<div>
|
<div>
|
||||||
<div style={styles.modalSubtitle}>
|
<div style={styles.modalSubtitle}>
|
||||||
{dispute.supplier_name} - <a
|
{dispute.supplier_name} - <a
|
||||||
href={`/invoice/${dispute.invoice_id}`}
|
href={`/kitchen/invoice/${dispute.invoice_id}`}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
style={styles.invoiceLink}
|
style={styles.invoiceLink}
|
||||||
|
|
|
||||||
|
|
@ -989,7 +989,7 @@ export default function GPReport() {
|
||||||
<div style={{ ...styles.breakdownContainer, textAlign: 'center', marginBottom: '1.5rem' }}>
|
<div style={{ ...styles.breakdownContainer, textAlign: 'center', marginBottom: '1.5rem' }}>
|
||||||
<h3 style={styles.sectionTitle}>Top Sellers</h3>
|
<h3 style={styles.sectionTitle}>Top Sellers</h3>
|
||||||
<p style={{ color: '#666', margin: '2rem 0' }}>
|
<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>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
|
|
|
||||||
|
|
@ -161,7 +161,7 @@ export default function InvoiceList() {
|
||||||
<div>
|
<div>
|
||||||
<div style={styles.header}>
|
<div style={styles.header}>
|
||||||
<h2 style={styles.title}>Uploaded Invoices</h2>
|
<h2 style={styles.title}>Uploaded Invoices</h2>
|
||||||
<a href="/upload" style={styles.uploadBtn}>
|
<a href="/kitchen/upload" style={styles.uploadBtn}>
|
||||||
+ Upload New
|
+ Upload New
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -226,7 +226,7 @@ export default function InvoiceList() {
|
||||||
{invoices.length === 0 ? (
|
{invoices.length === 0 ? (
|
||||||
<div style={styles.empty}>
|
<div style={styles.empty}>
|
||||||
<p>No invoices pending confirmation.</p>
|
<p>No invoices pending confirmation.</p>
|
||||||
<a href="/upload" style={styles.link}>
|
<a href="/kitchen/upload" style={styles.link}>
|
||||||
Upload one now
|
Upload one now
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -235,7 +235,7 @@ export default function InvoiceList() {
|
||||||
{invoices.map((invoice) => (
|
{invoices.map((invoice) => (
|
||||||
<a
|
<a
|
||||||
key={invoice.id}
|
key={invoice.id}
|
||||||
href={`/invoice/${invoice.id}`}
|
href={`/kitchen/invoice/${invoice.id}`}
|
||||||
style={{
|
style={{
|
||||||
...styles.card,
|
...styles.card,
|
||||||
borderLeft: `4px solid ${statusColors[invoice.status] || '#999'}`,
|
borderLeft: `4px solid ${statusColors[invoice.status] || '#999'}`,
|
||||||
|
|
@ -341,7 +341,7 @@ export default function InvoiceList() {
|
||||||
{completedInvoices.map((invoice) => (
|
{completedInvoices.map((invoice) => (
|
||||||
<a
|
<a
|
||||||
key={invoice.id}
|
key={invoice.id}
|
||||||
href={`/invoice/${invoice.id}`}
|
href={`/kitchen/invoice/${invoice.id}`}
|
||||||
style={{
|
style={{
|
||||||
...styles.card,
|
...styles.card,
|
||||||
borderLeft: `4px solid ${statusColors[invoice.status] || '#999'}`,
|
borderLeft: `4px solid ${statusColors[invoice.status] || '#999'}`,
|
||||||
|
|
|
||||||
|
|
@ -388,7 +388,7 @@ export default function LineItemHistoryModal({
|
||||||
{data.description || '-'}
|
{data.description || '-'}
|
||||||
</span>
|
</span>
|
||||||
<a
|
<a
|
||||||
href={`/invoice/${point.invoice_id}`}
|
href={`/kitchen/invoice/${point.invoice_id}`}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
style={{
|
style={{
|
||||||
|
|
|
||||||
|
|
@ -5324,7 +5324,7 @@ export default function Review() {
|
||||||
<td style={styles.searchTd}>{item.last_invoice_date || '—'}</td>
|
<td style={styles.searchTd}>{item.last_invoice_date || '—'}</td>
|
||||||
<td style={styles.searchTd}>
|
<td style={styles.searchTd}>
|
||||||
<a
|
<a
|
||||||
href={`/invoice/${item.invoice_id}`}
|
href={`/kitchen/invoice/${item.invoice_id}`}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
style={styles.invoiceLink}
|
style={styles.invoiceLink}
|
||||||
|
|
|
||||||
|
|
@ -617,7 +617,7 @@ export default function SearchDefinitions() {
|
||||||
<td style={tdStyle}>
|
<td style={tdStyle}>
|
||||||
{def.source_invoice_number ? (
|
{def.source_invoice_number ? (
|
||||||
<a
|
<a
|
||||||
href={`/invoice/${def.source_invoice_id}`}
|
href={`/kitchen/invoice/${def.source_invoice_id}`}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
style={{ color: '#2563eb', textDecoration: 'none' }}
|
style={{ color: '#2563eb', textDecoration: 'none' }}
|
||||||
|
|
@ -692,7 +692,7 @@ export default function SearchDefinitions() {
|
||||||
<div>
|
<div>
|
||||||
<strong>Source Invoice:</strong>{' '}
|
<strong>Source Invoice:</strong>{' '}
|
||||||
<a
|
<a
|
||||||
href={`/invoice/${editingDef.source_invoice_id}`}
|
href={`/kitchen/invoice/${editingDef.source_invoice_id}`}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
style={{ color: '#2563eb' }}
|
style={{ color: '#2563eb' }}
|
||||||
|
|
|
||||||
|
|
@ -415,7 +415,7 @@ export default function SearchInvoices() {
|
||||||
<tr key={inv.id} style={{ borderBottom: '1px solid #e5e7eb' }}>
|
<tr key={inv.id} style={{ borderBottom: '1px solid #e5e7eb' }}>
|
||||||
<td style={tdStyle}>
|
<td style={tdStyle}>
|
||||||
<a
|
<a
|
||||||
href={`/invoice/${inv.id}`}
|
href={`/kitchen/invoice/${inv.id}`}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
style={{ color: '#2563eb', textDecoration: 'none' }}
|
style={{ color: '#2563eb', textDecoration: 'none' }}
|
||||||
|
|
@ -466,7 +466,7 @@ export default function SearchInvoices() {
|
||||||
<tr key={inv.id} style={{ borderBottom: '1px solid #e5e7eb' }}>
|
<tr key={inv.id} style={{ borderBottom: '1px solid #e5e7eb' }}>
|
||||||
<td style={tdStyle}>
|
<td style={tdStyle}>
|
||||||
<a
|
<a
|
||||||
href={`/invoice/${inv.id}`}
|
href={`/kitchen/invoice/${inv.id}`}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
style={{ color: '#2563eb', textDecoration: 'none' }}
|
style={{ color: '#2563eb', textDecoration: 'none' }}
|
||||||
|
|
|
||||||
|
|
@ -911,7 +911,7 @@ export default function SearchLineItems() {
|
||||||
<td style={tdStyle}>{item.occurrence_count}</td>
|
<td style={tdStyle}>{item.occurrence_count}</td>
|
||||||
<td style={tdStyle}>
|
<td style={tdStyle}>
|
||||||
<a
|
<a
|
||||||
href={`/invoice/${item.most_recent_invoice_id}`}
|
href={`/kitchen/invoice/${item.most_recent_invoice_id}`}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
style={{ color: '#2563eb', textDecoration: 'none' }}
|
style={{ color: '#2563eb', textDecoration: 'none' }}
|
||||||
|
|
|
||||||
|
|
@ -502,7 +502,7 @@ export default function Upload() {
|
||||||
Install App
|
Install App
|
||||||
</button>
|
</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>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -144,7 +144,7 @@ export default function NewbookData() {
|
||||||
return (
|
return (
|
||||||
<div style={styles.container}>
|
<div style={styles.container}>
|
||||||
<div style={styles.titleRow}>
|
<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>
|
<h1 style={styles.title}>Newbook Data</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4282,7 +4282,7 @@ export default function Settings() {
|
||||||
{/* View Newbook Data Link - outside blocks */}
|
{/* View Newbook Data Link - outside blocks */}
|
||||||
<div style={{ marginTop: '1rem', paddingTop: '1.5rem', borderTop: '1px solid #e0e0e0' }}>
|
<div style={{ marginTop: '1rem', paddingTop: '1.5rem', borderTop: '1px solid #e0e0e0' }}>
|
||||||
<a
|
<a
|
||||||
href="/newbook"
|
href="/kitchen/newbook"
|
||||||
style={{
|
style={{
|
||||||
display: 'inline-block',
|
display: 'inline-block',
|
||||||
padding: '0.75rem 1.5rem',
|
padding: '0.75rem 1.5rem',
|
||||||
|
|
@ -4894,7 +4894,7 @@ export default function Settings() {
|
||||||
{/* View Resos Data Link */}
|
{/* View Resos Data Link */}
|
||||||
<div style={{ marginTop: '2rem', paddingTop: '1.5rem', borderTop: '1px solid #e0e0e0' }}>
|
<div style={{ marginTop: '2rem', paddingTop: '1.5rem', borderTop: '1px solid #e0e0e0' }}>
|
||||||
<a
|
<a
|
||||||
href="/resos"
|
href="/kitchen/resos"
|
||||||
style={{
|
style={{
|
||||||
display: 'inline-block',
|
display: 'inline-block',
|
||||||
padding: '0.75rem 1.5rem',
|
padding: '0.75rem 1.5rem',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue