From 7ead2f7aa72a724caf36c72fa1c70b35bc6a1409 Mon Sep 17 00:00:00 2001
From: sassanix <39465071+sassanix@users.noreply.github.com>
Date: Sun, 16 Nov 2025 14:06:47 -0400
Subject: [PATCH] Reverted
Reverted the changes, as performance and core usage was effected
---
CHANGELOG.md | 177 +--
Dockerfile | 2 +-
frontend/about.html | 48 +-
frontend/auth-new.js | 224 ++++
frontend/auth-redirect.html | 20 +-
frontend/auth.js | 364 ++++++
frontend/fix-auth-buttons-loader.js | 48 +
frontend/fix-auth-buttons.js | 76 ++
frontend/include-auth-new.js | 128 ++
frontend/index.html | 74 +-
frontend/login.html | 32 +-
frontend/register.html | 43 +-
frontend/registration-status.js | 92 ++
frontend/reset-password-request.html | 41 +-
frontend/reset-password.html | 41 +-
frontend/script.js | 1820 +++++++++++++++++++-------
frontend/settings-new.html | 92 +-
frontend/status.html | 52 +-
frontend/status.js | 57 +-
frontend/style.css | 14 +-
frontend/sw.js | 1 +
frontend/version-checker.js | 2 +-
22 files changed, 2517 insertions(+), 931 deletions(-)
create mode 100644 frontend/auth-new.js
create mode 100644 frontend/auth.js
create mode 100644 frontend/fix-auth-buttons-loader.js
create mode 100644 frontend/fix-auth-buttons.js
create mode 100644 frontend/include-auth-new.js
create mode 100644 frontend/registration-status.js
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 08440fa..1823f54 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,180 +1,5 @@
# Changelog
-## 1.0.3 - 2025-11-07
-
-### Added
-- **Modular Entry Orchestrator and Feature Modules**
- - Added a lean ES module entry orchestrator `index.js` that initializes auth and feature modules after `authStateReady`.
- - Created feature-specific modules to prepare deconstruction of the monolith while preserving identical behavior:
- - `warrantyListController.js` (list loading/filtering/rendering controller surface)
- - `tagManager.js` (tag management: load/render/create/update/delete)
- - `addWarrantyForm.js` (multi-step add warranty wizard surface)
- - Wired pages to load the new module entry with `` alongside legacy `script.js` for zero-regression rollout.
- - _Files: `frontend/js/index.js`, `frontend/js/controllers/warrantyListController.js`, `frontend/js/components/tagManager.js`, `frontend/js/components/addWarrantyForm.js`, `frontend/index.html`, `frontend/about.html`, `frontend/status.html`, `frontend/register.html`, `frontend/reset-password.html`, `frontend/reset-password-request.html`_
-
-- **Centralized Authentication Service**
- - New module `authService.js` exposes `initAuth`, `login`, `logout`, `getToken`, `getCurrentUser`, `isAuthenticated`.
- - Backwards compatibility: attaches a `window.auth` facade so existing code continues to work.
- - Handles header UI state, user menu/settings dropdown toggling, and dispatches a unified `authStateReady` event.
- - Robustly hides “Create Account” UI when registration is disabled (with a MutationObserver to keep it hidden after other scripts mutate the DOM).
- - _Files: `frontend/js/services/authService.js`, `frontend/*.html` (module includes)_
-
-- **Dedicated API Service**
- - New `apiService.js` provides a `baseRequest` wrapper that injects the `Authorization` header and normalizes error handling.
- - Exposes named helpers (e.g., `getWarranties`, `updateWarranty`, `deleteWarranty`, `getStatistics`, `savePreferences`) and a `window.api` shim for non-module scripts.
- - Safe global `fetch` shim adds the Authorization header for `/api/...` calls when missing.
- - _Files: `frontend/js/services/apiService.js`, `frontend/*.html` (module includes)_
-
- - **Central State Management Store**
- - Introduced a `store.js` module to act as a single source of truth for application data (warranties, filters, loading states), eliminating scattered global variables.
- - UI updates are now driven by custom events, creating a predictable data flow.
- - _Files: `frontend/js/store.js`_
-
-- **Component-Based UI Modules**
- - Created a suite of new, reusable UI component modules to replace HTML string concatenation. Each is responsible for building a specific part of the UI via safe DOM manipulation.
- - Modules include: `warrantyCard.js`, `tag.js`, `modals.js`, `editModal.js`, `claims.js`, `notes.js`, `paperless.js`, and `ui.js`.
- - _Files: `frontend/js/components/*`_
-
-- **HTML `` for Warranty Cards**
- - Added a `` to `index.html` to define the warranty card structure, separating markup from rendering logic for improved performance and maintainability.
- - _Files: `frontend/index.html`_
-
-### Enhanced
-- **Dockerfile: simplified static file serving**
- - Removed build stage; frontend files are now copied directly to `/var/www/html/` for static serving.
- - No build step required; all frontend assets are served as-is.
- - _Files: `Dockerfile`_
-
-- **HTML and asset loading**
- - Switched all page `` tag. The module imports `authService` and `apiService` rather than relying on global functions.
- - Removed inline `onclick` handlers from the Settings HTML (notably the Delete User modal) and rewired UI interactions using `addEventListener` inside the module so handlers are module-scoped instead of being attached to `window`.
- - Extended `frontend/js/services/apiService.js` with settings/admin endpoints consumed by the module (for example: `getUser`, `getUsers`, `updateUser`, `deleteUser`, `getSiteSettings`, `saveSiteSettings`, `getAuditTrail`, `triggerNotifications`) and preserved the `window.api` shim for backward compatibility.
- - Fixed a porting-induced syntax/parsing issue (unbalanced brace) and removed a leftover global (`window.currentDeleteUserId`) in favor of a module-scoped `currentDeleteUserId` to avoid leaking state.
- - The refactored module parses without syntax errors. Runtime smoke tests are planned/encouraged (see next steps) and final decommission of the legacy `script.js` will follow once runtime verification is complete.
- - _Files: `frontend/settings-new.html`, `frontend/settings-new.js`, `frontend/js/services/apiService.js`_
+## 1.0.3 - 2025-10-31
## 1.0.2 - 2025-10-30
diff --git a/Dockerfile b/Dockerfile
index 17df14a..cbf5f0f 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -112,7 +112,7 @@ COPY --chown=warracker:warracker backend/migrations/ ./migrations/
COPY --chown=warracker:warracker locales/ ./locales/
COPY --chown=warracker:warracker locales/ /var/www/html/locales/
-# 4. Frontend (static files, no build step)
+# 4. Frontend (bundled in one instruction)
COPY --chown=warracker:warracker frontend/ /var/www/html/
# 5. Backend (bundled in one instruction)
diff --git a/frontend/about.html b/frontend/about.html
index bc4e990..a7c52a8 100644
--- a/frontend/about.html
+++ b/frontend/about.html
@@ -7,33 +7,31 @@
About - Warracker
-
-
-
-
-
+
+
+
+
+
-
+
+
-
+
-
+
-
-
-
-
-
-
-
+
+
+
+
-
-
-
+
+
+
-
+
-
+
-
+
-
+