Files
Warracker/frontend/test-api.js
sassanix b4855af43f Grid view, manuals, prices, table view, export option, filters
## [0.5.0] - 2025-03-07

### Added
- Enhanced filtering and sorting capabilities
  - Status filter (All, Active, Expiring Soon, Expired)
  - Multiple sorting options (Expiration Date, Purchase Date, Name)
  - Export filtered warranties as CSV
  - Improved filter controls layout
  - Mobile-responsive filter design
- Multiple view options for warranty display
  - Grid view with card layout (default)
  - List view for compact horizontal display
  - Table view for structured data presentation
  - View preference saved between sessions
  - Responsive design for all view types
- Optional purchase price tracking
  - Users can now add purchase prices to warranties
  - Price information displayed in warranty cards
  - Currency formatting with dollar sign
  - Included in warranty summary and exports

### Changed
- Completely redesigned user interface
  - Modern card-based layout for warranties
  - Enhanced filter controls with improved styling
  - Better visual hierarchy with labeled filter groups
  - Custom dropdown styling with intuitive icons
  - Improved spacing and alignment throughout
  - Consistent color scheme and visual feedback
  - Responsive grid layout for warranty cards

### Fixed
- Status indicator borders now correctly displayed for all warranty states
  - Green border for active warranties
  - Orange border for warranties expiring soon
  - Red border for expired warranties
- Consistent status styling across all warranty cards
- Form now resets to first tab after successful warranty submission
- Manual filename now properly cleared when form is reset

## [0.4.0] - 2025-03-07

### Added
- Improved warranty creation process
  - Multi-step form with intuitive navigation
  - Progress indicator showing completion status
  - Enhanced validation with clear error messages
  - Summary review step before submission
  - Expiration date preview in summary
  - Responsive design for all device sizes

### Fixed
- Progress indicator alignment issue in multi-step form
  - Contained indicator within form boundaries
  - Prevented overflow with improved CSS approach
  - Ensured consistent tab widths for better alignment
- Improved tab navigation visual feedback

## [0.3.0] - 2025-03-07

### Added
- Product manual upload support
  - Users can now upload a second document for product manuals
  - Manual documents are displayed alongside invoices in the warranty details
  - Both add and edit forms support manual uploads
- Product URL support
  - Users can now add website URLs for products
  - Links to product websites displayed in warranty cards
  - Easy access to product support and information pages

### Changed
- Improved document link styling for consistency
  - Enhanced visual appearance of document links
  - Consistent styling between invoice and manual links
  - Better hover effects for document links
  - Fixed styling inconsistencies between document links
- Improved warranty card layout
  - Document links now displayed side by side for better space utilization
  - Responsive design adapts to different screen sizes
  - More compact and organized appearance

### Fixed
- Styling inconsistency between View Invoice and View Manual buttons
- Removed unused CSS file to prevent styling conflicts
2025-03-07 16:12:15 -04:00

44 lines
1.9 KiB
JavaScript

// API connection test script
document.addEventListener('DOMContentLoaded', function() {
// Element to display test results
const resultElement = document.getElementById('apiTestResult');
if (resultElement) {
resultElement.innerHTML = '<p>Checking API connection...</p>';
// Test API connection
fetch('/api/warranties')
.then(response => {
if (!response.ok) {
throw new Error('API responded with status: ' + response.status);
}
return response.json();
})
.then(data => {
console.log('API response:', data);
resultElement.innerHTML = `
<div class="alert alert-success">
<h4>✅ API Connection Successful</h4>
<p>The API responded with ${data && Array.isArray(data) ? data.length : 0} warranties.</p>
<pre>${JSON.stringify(data && data.length ? data[0] : {}, null, 2)}</pre>
</div>
`;
})
.catch(error => {
console.error('API connection error:', error);
resultElement.innerHTML = `
<div class="alert alert-danger">
<h4>❌ API Connection Failed</h4>
<p>Error: ${error.message}</p>
<h5>Debug Information:</h5>
<ul>
<li>Browser URL: ${window.location.href}</li>
<li>Target API: /api/warranties</li>
<li>Make sure the backend is running and accessible</li>
<li>Check that nginx is properly configured to proxy API requests</li>
</ul>
</div>
`;
});
}
});