Skip to content

πŸ›‘οΈ Warracker is an open source, self-hostable warranty tracker to monitor expirations, store receipts, files. You own the data, your rules!

Removed unused references and files

sassanix058d61b0eccf
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0449be1..ce508f1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -68,6 +68,8 @@
- **Security:** Mitigated potential cross-site scripting (XSS) vulnerabilities by removing reliance on building the UI with `innerHTML` from dynamic data.
- **Performance:** Improved rendering performance by using efficient DOM creation and appending (`<template>` clones, `document.createElement`) instead of causing the browser to re-parse large HTML strings on every update.
- **Code Quality:** Drastically reduced code complexity and repetition in `script.js` by delegating UI creation to specialized component modules.
+ - Eliminated 404s for removed stylesheet by deleting the `/styles.css` link in `frontend/src/about.html` and removing it from the service worker pre-cache (`frontend/public/sw.js`).
+ - _Files: `frontend/src/about.html`, `frontend/public/sw.js`_
### Removed
- Legacy, scattered auth scripts now replaced by `authService.js`:
@@ -77,6 +79,19 @@
- **Hardcoded HTML Strings**
- Removed large, multi-line HTML string templates from JavaScript files, which were fragile and difficult to maintain.
+ - Frontend duplicate/unused assets removed in favor of `frontend/public` copies:
+ - `frontend/src/js/i18n.js`, `frontend/src/js/i18n-debug.js`, and `frontend/src/js/lib/*` (kept `frontend/public/js` versions)
+ - Root-level duplicates in `frontend/src/`: `chart.js`, `file-utils.js`, `footer-content.js`, `footer-fix.js`, `mobile-menu.js`, `script.js`, `settings-new.js`, `theme-loader.js`, `version-checker.js`, `auth-redirect.js`, `sw.js`
+ - Removed unused stylesheet: `frontend/src/styles.css`
+ - Removed debug files: `frontend/public/js/i18n-debug.js`, `frontend/src/temp-toast-debug.js`
+
+ - Backend cleanup: removed unused `backend/fix_notification_columns.py`.
+
+### House Cleaning
+- Deleted generated artifacts not needed in repo: `frontend/dist`, `frontend/node_modules` (Docker builds frontend in-image)
+- Purged Python caches: `backend/**/__pycache__`, stray `.pyc`
+- Removed old backup: `backend/fix_permissions.sql.bak`
+
## 1.0.2 - 2025-10-30
diff --git a/frontend/public/js/i18n-debug.js b/frontend/public/js/i18n-debug.js
deleted file mode 100644
index d3684af..0000000
--- a/frontend/public/js/i18n-debug.js
+++ /dev/null
@@ -1,36 +0,0 @@
-// Debug script to test i18next CDN loading
-console.log('=== i18next Debug Script ===');
-
-// Check if CDN scripts are loaded
-setTimeout(() => {
- console.log('Checking i18next libraries:');
- console.log('- i18next:', typeof i18next !== 'undefined' ? 'LOADED' : 'NOT LOADED');
- console.log('- i18nextHttpBackend:', typeof i18nextHttpBackend !== 'undefined' ? 'LOADED' : 'NOT LOADED');
- console.log('- i18nextBrowserLanguageDetector:', typeof i18nextBrowserLanguageDetector !== 'undefined' ? 'LOADED' : 'NOT LOADED');
-
- // Test basic fetch to translation file
- fetch('/locales/en/translation.json')
- .then(response => {
- console.log('Translation file fetch status:', response.status);
- return response.json();
- })
- .then(data => {
- console.log('Translation file loaded successfully, keys:', Object.keys(data).slice(0, 5));
- })
- .catch(error => {
- console.error('Failed to load translation file:', error);
- });
-
- // Test API endpoint
- fetch('/api/locales')
- .then(response => {
- console.log('Locales API status:', response.status);
- return response.json();
- })
- .then(data => {
- console.log('Locales API response:', data);
- })
- .catch(error => {
- console.error('Failed to load locales API:', error);
- });
-}, 2000); // Wait 2 seconds for CDN scripts to load
\ No newline at end of file
diff --git a/frontend/public/sw.js b/frontend/public/sw.js
index 97b932f..d01731d 100644
--- a/frontend/public/sw.js
+++ b/frontend/public/sw.js
@@ -15,7 +15,6 @@ const urlsToCache = [
// Stylesheets (versioned)
'./style.css?v=20250119004',
- './styles.css?v=20250119001',
'./settings-styles.css?v=20250119001',
'./header-fix.css?v=20250119001',
'./mobile-header.css?v=20250119002',
diff --git a/frontend/src/about.html b/frontend/src/about.html
index 3673861..8e0c738 100644
--- a/frontend/src/about.html
+++ b/frontend/src/about.html
@@ -15,7 +15,6 @@
<!-- Stylesheets -->
<link rel="stylesheet" href="/style.css?v=20250119004"> <!-- Main stylesheet -->
- <link rel="stylesheet" href="/styles.css?v=20250119001"> <!-- Additional styles -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/7.0.1/css/all.min.css"> <!-- Font Awesome -->
<link rel="stylesheet" href="/header-fix.css?v=20250119001"> <!-- Header specific styles -->
<!-- Mobile Header specific styles -->
diff --git a/frontend/src/settings-new.html b/frontend/src/settings-new.html
index b2dac88..08b4b34 100644
--- a/frontend/src/settings-new.html
+++ b/frontend/src/settings-new.html
@@ -40,9 +40,6 @@
<!-- i18n Configuration -->
<script src="/js/i18n.js?v=20250119001"></script>
-
- <!-- Temporary debug script -->
- <script src="/js/i18n-debug.js?v=20250119001"></script>
<!-- Mobile menu logic isolated to avoid collisions on settings -->
<script src="/mobile-menu.js?v=20250119002" defer></script>
diff --git a/frontend/src/styles.css b/frontend/src/styles.css
deleted file mode 100644
index 925f78a..0000000
--- a/frontend/src/styles.css
+++ /dev/null
@@ -1,327 +0,0 @@
-/* Tag Styles */
-.tags-container {
- margin-bottom: 15px;
-}
-
-.selected-tags {
- display: flex;
- flex-wrap: wrap;
- gap: 8px;
- margin-bottom: 10px;
-}
-
-.tag {
- display: inline-flex;
- align-items: center;
- padding: 4px 8px;
- border-radius: 16px;
- font-size: 14px;
- cursor: pointer;
- transition: all 0.2s ease;
- margin: 2px;
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
-}
-
-.tag .remove-tag {
- margin-left: 6px;
- font-size: 12px;
- opacity: 0.7;
-}
-
-.tag:hover .remove-tag {
- opacity: 1;
-}
-
-.tags-dropdown {
- position: relative;
-}
-
-.tags-list {
- position: absolute;
- top: 100%;
- left: 0;
- right: 0;
- background: white;
- border: 1px solid #ddd;
- border-radius: 4px;
- max-height: 200px;
- overflow-y: auto;
- z-index: 1000;
- display: none;
-}
-
-.tags-list.show {
- display: block;
-}
-
-.tag-option {
- padding: 8px 12px;
- cursor: pointer;
-}
-
-.tag-option:hover {
- background-color: #f5f5f5;
-}
-
-/* Tag Management Modal */
-#tagManagementModal {
- z-index: 1050;
-}
-
-.tag-form {
- display: flex;
- gap: 10px;
- margin-bottom: 20px;
-}
-
-.tag-form input[type="color"] {
- width: 50px;
- padding: 0;
- height: 38px;
-}
-
-.existing-tags {
- display: flex;
- flex-direction: column;
- gap: 10px;
-}
-
-.existing-tag {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 8px 12px;
- background: var(--bg-secondary);
- border-radius: 4px;
-}
-
-.existing-tag-info {
- display: flex;
- align-items: center;
- gap: 10px;
-}
-
-.existing-tag-color {
- width: 20px;
- height: 20px;
- border-radius: 50%;
- border: 1px solid var(--border-color);
-}
-
-.existing-tag-actions {
- display: flex;
- gap: 8px;
-}
-
-.edit-tab-content .tags-container,
-.tab-content .tags-container {
- background-color: var(--bg-secondary);
- border-radius: 8px;
- padding: 10px;
- margin-bottom: 15px;
-}
-
-.edit-tab-content .selected-tags,
-.tab-content .selected-tags {
- margin-bottom: 10px;
-}
-
-#editTagSearch, #tagSearch {
- background-color: var(--bg-main);
- color: var(--text-primary);
- border: 1px solid var(--border-color);
-}
-
-/* Fix for the tag modal to appear on top of other modals */
-.modal {
- display: none;
- position: fixed;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- background-color: rgba(0, 0, 0, 0.5);
- z-index: 1000;
- overflow: auto;
-}
-
-.modal-content {
- background-color: var(--bg-main);
- margin: 50px auto;
- padding: 0;
- border-radius: 8px;
- box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
- width: 90%;
- max-width: 600px;
- max-height: 85vh;
- overflow-y: auto;
-}
-
-.modal-header {
- padding: 15px 20px;
- border-bottom: 1px solid var(--border-color);
- display: flex;
- justify-content: space-between;
- align-items: center;
- background-color: var(--bg-secondary);
- border-radius: 8px 8px 0 0;
-}
-
-.modal-header h2 {
- margin: 0;
- font-size: 1.25rem;
-}
-
-.modal-body {
- padding: 20px;
-}
-
-.modal-footer {
- padding: 15px 20px;
- border-top: 1px solid var(--border-color);
- display: flex;
- justify-content: flex-end;
- gap: 10px;
-}
-
-.modal .close {
- font-size: 24px;
- font-weight: bold;
- cursor: pointer;
- color: var(--text-muted);
-}
-
-.modal .close:hover {
- color: var(--text-primary);
-}
-
-/* Add tag indicator in warranty cards */
-.warranty-card .tags-row {
- display: flex;
- flex-wrap: wrap;
- gap: 6px;
- margin-top: 10px;
- padding-top: 10px;
- border-top: 1px solid #eee;
-}
-
-/* Modal z-index layering */
-.modal {
- z-index: 1000;
-}
-
-#editModal, #deleteModal {
- z-index: 1000;
-}
-
-#tagManagementModal {
- z-index: 1050;
-}
-
-/* ============================================================================
- Paperless-ngx Integration Styles
- ============================================================================ */
-
-/* Storage Selection Styles */
-.storage-selection {
- margin-bottom: 15px;
- padding: 12px;
- background-color: var(--bg-secondary);
- border-radius: 8px;
- border: 1px solid var(--border-color);
-}
-
-.storage-options {
- display: flex;
- gap: 20px;
- flex-wrap: wrap;
-}
-
-.storage-option {
- display: flex;
- align-items: center;
- cursor: pointer;
- padding: 8px 12px;
- border-radius: 6px;
- transition: all 0.2s ease;
- border: 1px solid transparent;
- background-color: var(--bg-main);
-}
-
-.storage-option:hover {
- background-color: var(--bg-accent);
- border-color: var(--border-color);
-}
-
-.storage-option input[type="radio"] {
- margin: 0;
- margin-right: 8px;
-}
-
-.storage-label {
- display: flex;
- align-items: center;
- gap: 6px;
- font-weight: 500;
- color: var(--text-primary);
-}
-
-.storage-label i {
- font-size: 14px;
- width: 16px;
- text-align: center;
-}
-
-.storage-option input[type="radio"]:checked + .storage-label {
- color: var(--accent-color);
-}
-
-.storage-option input[type="radio"]:checked + .storage-label i {
- color: var(--accent-color);
-}
-
-/* Paperless-ngx info alert */
-.alert {
- padding: 12px 16px;
- margin-bottom: 20px;
- border-radius: 6px;
- border: 1px solid transparent;
- display: flex;
- align-items: center;
- gap: 10px;
-}
-
-.alert-info {
- background-color: #e7f3ff;
- border-color: #b8d4f0;
- color: #31708f;
-}
-
-.alert-info i {
- color: #31708f;
-}
-
-/* Dark mode support for Paperless-ngx elements */
-.dark-mode .storage-selection {
- background-color: var(--bg-secondary);
- border-color: var(--border-color);
-}
-
-.dark-mode .storage-option {
- background-color: var(--bg-main);
- color: var(--text-primary);
-}
-
-.dark-mode .storage-option:hover {
- background-color: var(--bg-accent);
-}
-
-.dark-mode .alert-info {
- background-color: rgba(49, 112, 143, 0.1);
- border-color: rgba(49, 112, 143, 0.3);
- color: #a8c8e1;
-}
-
-.dark-mode .alert-info i {
- color: #a8c8e1;
-}
\ No newline at end of file
diff --git a/frontend/src/temp-toast-debug.js b/frontend/src/temp-toast-debug.js
deleted file mode 100644
index 96e68ee..0000000
--- a/frontend/src/temp-toast-debug.js
+++ /dev/null
@@ -1,28 +0,0 @@
-// Temporary toast notification enhancement for debugging
-// Add this to browser console to make success messages more visible
-
-(function() {
- console.log('🍞 Toast Debug Enhancement Loaded');
-
- // Override showToast to make it more visible
- const originalShowToast = window.showToast;
-
- window.showToast = function(message, type = 'info', duration = 5000) {
- console.log(`🍞 TOAST NOTIFICATION: ${message} (Type: ${type})`);
-
- // Call original function
- if (originalShowToast) {
- originalShowToast.call(this, message, type, duration);
- }
-
- // Also show an alert for debugging (remove this in production)
- if (type === 'success') {
- alert(`SUCCESS: ${message}`);
- }
-
- // Add a visible console message
- console.log(`%c${message}`, `color: ${type === 'success' ? 'green' : type === 'error' ? 'red' : 'blue'}; font-weight: bold; font-size: 16px;`);
- };
-
- console.log('Toast notifications will now be more visible with alerts');
-})();
\ No newline at end of file