Files
Warracker/frontend/sw.js
T
sassanix 96f2859975 Fix global warranties view, add Model Number field, and enhance modal tab responsiveness
* **Fixed:**

  * Global view on Index page now correctly shows warranties from all users, including archived ones.
  * Added `GET /api/warranties/global/archived` and unified global queries with correlated subqueries to avoid missing or collapsed rows.
  * Updated frontend logic to merge archived warranties from the new endpoint when Global scope and Status = “All.”
  * Bumped `script.js` and service worker cache to ensure clients receive updated logic.
  * Updated files: `backend/warranties_routes.py`, `frontend/script.js`, `frontend/sw.js`, `frontend/index.html`, `frontend/status.html`.

* **Added:**

  * Introduced **Model Number** field to warranties.
  * Backend: Added `model_number` column, integrated into GET/POST/PUT routes.
  * Frontend: Added Model Number input in New/Edit modals and display on warranty cards.
  * Updated files: `backend/migrations/047_add_model_number_to_warranties.sql`, `backend/warranties_routes.py`, `frontend/index.html`, `frontend/status.html`, `frontend/script.js`, `locales/en/translation.json`.

* **Enhanced:**

  * Improved **Add Warranty modal** tab alignment for responsive layouts (≤740px).
  * Adjusted tab label size and spacing to prevent wrapping while keeping icons and labels visible.
  * Ensured consistent five-step progress indicator across all breakpoints.
  * Updated file: `frontend/style.css`.
2025-10-09 15:04:13 -03:00

66 lines
1.7 KiB
JavaScript

const CACHE_NAME = 'warracker-cache-v20250119006';
const urlsToCache = [
'./',
'./index.html',
'./settings-new.html',
'./status.html',
'./style.css?v=20250119004',
'./settings-styles.css?v=20250119001',
'./header-fix.css?v=20250119001',
'./mobile-header.css?v=20250119002',
'./script.js?v=20250119002',
'./auth.js?v=20250119001',
'./settings-new.js?v=20250119001',
'./status.js?v=20250119001',
'./theme-loader.js?v=20250119001',
'./footer-fix.js?v=20250119001',
'./footer-content.js?v=20250119001',
'./js/i18n.js?v=20250119001',
'./js/lib/i18next.min.js',
'./js/lib/i18nextHttpBackend.min.js',
'./js/lib/i18nextBrowserLanguageDetector.min.js',
'./manifest.json',
'./img/favicon-16x16.png',
'./img/favicon-32x32.png',
'./img/favicon-512x512.png'
// Add other important assets here, especially icons declared in manifest.json
];
self.addEventListener('install', event => {
event.waitUntil(
caches.open(CACHE_NAME)
.then(cache => {
console.log('Opened cache');
return cache.addAll(urlsToCache);
})
);
});
self.addEventListener('fetch', event => {
event.respondWith(
caches.match(event.request)
.then(response => {
// Cache hit - return response
if (response) {
return response;
}
return fetch(event.request);
}
)
);
});
self.addEventListener('activate', event => {
const cacheWhitelist = [CACHE_NAME];
event.waitUntil(
caches.keys().then(cacheNames => {
return Promise.all(
cacheNames.map(cacheName => {
if (cacheWhitelist.indexOf(cacheName) === -1) {
return caches.delete(cacheName);
}
})
);
})
);
});