190 Commits

Author SHA1 Message Date
Chris
ada7f44f6f
Merge pull request #32 from DumbWareio/fix/clearbtn-overload-optimizations
Fix clearfilterbtn overload, optimize settings to cache fetched settings to localStorage, ignore data folder in development
2025-05-29 17:30:37 -07:00
gitmotion
b56a9d8156 Fix clearfilterbtn overload, optimize settings to cache fetched settings to localStorage, ignore data folder in development 2025-05-29 17:28:57 -07:00
Chris
07facdadcb
Merge pull request #31 from DumbWareio/fix/styles-fix
Fix/styles fix
2025-05-29 12:38:46 -07:00
gitmotion
c381b88690 Add event date and type fix
remove duplicate comment
2025-05-29 12:37:58 -07:00
gitmotion
be5b158a2a Apply quick fix 2025-05-29 12:36:28 -07:00
Chris
a5711ff857
Merge pull request #30 from DumbWareio/fix/events-grid-spacing
Adjust events grid spacing across different dimensions
2025-05-29 12:25:55 -07:00
gitmotion
01952cf90f Adjust events grid spacing across different dimensions 2025-05-29 12:22:31 -07:00
Chris
83d146ffe6
Merge pull request #25 from DumbWareio/fix/dashboard-card-filters-not-sticking
Fix dashboard card filters not sticking
2025-05-29 11:02:18 -07:00
gitmotion
b943410171 Fix dashboard card filters not sticking 2025-05-29 11:00:38 -07:00
Chris
a9a850adef
Merge pull request #23 from DumbWareio/upgrade-multer-remove-unused-deps
Upgrade multer remove unused deps
2025-05-29 10:26:29 -07:00
gitmotion
8385d21cfa remove and prune unused packages 2025-05-29 10:20:14 -07:00
gitmotion
e09e770779 upgrade multer to 2.0.0 2025-05-29 10:19:59 -07:00
Chris
c01964758a
Merge pull request #22 from DumbWareio/fix/delete-attachments-on-server
Fix: Add logic to delete asset files and all associated files serverside
2025-05-29 00:37:00 -07:00
gitmotion
ba4066fd9a Fix: Add logic to delete asset files and all associated files server side
Fix save subasset child modal and delete approriate files for those subassets and subassetchildren

Refactor and simply delete and update logic for assets and subassets

update import for url example

add resetImportForm to window from importmanager instead of script.js

update subasset file attachment expand/collapse to before showing the modal

match accepted file types from frontend to backend  for manuals

update deleteAssetFileAsync with early return and to work with starting "/" or without
2025-05-29 00:34:22 -07:00
gitmotion
77a255f4b5 replace alerts with toasts in script.js 2025-05-28 17:31:34 -07:00
Chris
da50fefaaf
Merge pull request #21 from DumbWareio/fix/scriptjs-major-cleanup
Complete script.js reorganization and cleanup v1
2025-05-28 17:03:32 -07:00
gitmotion
9bd03ea59f Complete script.js reorganization and cleanup v1
Add new toast manager with stacking toasts with success and error colors and repositioned to top

set button loading to false on subasset form validation

revert index.html change
2025-05-28 17:02:47 -07:00
Chris
040e8d25ec
Merge pull request #20 from DumbWareio/fix/settings-refactor
Refactor settings for stability and consistency
2025-05-28 13:43:43 -07:00
gitmotion
944cc00ff4 Refactor settings for stability and consistency
initialize settings with default and copy over settings to always make sure all properties are included

remove unused async from createWarrantyDashboard function
2025-05-28 13:35:42 -07:00
Chris
000ae94afd
Merge pull request #19 from DumbWareio/fix/dashboard-settings-not-in-sync
Fix dashboard order sync
2025-05-27 23:45:40 -07:00
gitmotion
e2a1769252 Fix dashboard order sync 2025-05-27 23:44:08 -07:00
abite
6a7e8c993c
merge commit into dev from fix-file-deletion-on-asset-deletion
Removes all associated files when asset or sub asset is deleted.
2025-05-27 21:38:00 -05:00
abite
ee8c3f2c86
Merge pull request #16 from DumbWareio/revert-15-fix-file-deletion-on-asset-deletion
Revert "Delete all associated files with asset deletion"
2025-05-27 22:28:10 -04:00
abite
c6c2f4198c
Revert "Delete all associated files with asset deletion" 2025-05-27 21:27:35 -05:00
abite
c5a6d836bc
Merge pull request #15 from DumbWareio/fix-file-deletion-on-asset-deletion
Delete all associated files with asset deletion
2025-05-27 22:20:55 -04:00
abite
713cad3aa5 Delete all associated files with asset deletion
New Helper Function: deleteAssetFiles(asset)
Handles all file formats:
Legacy single files: photoPath, receiptPath, manualPath
Multiple file arrays: photoPaths[], receiptPaths[], manualPaths[]
File info arrays: photoInfo[], receiptInfo[], manualInfo[]
Robust error handling: Continues deletion even if individual files fail
Comprehensive logging: Debug information tracks all file operations
Path normalization: Handles different path formats safely
2025-05-27 21:17:16 -05:00
abite
308b6cc96d
Merge pull request #13 from DumbWareio/add-lifetime-column-to-import-mapping
add lifetime column to import mapping
2025-05-27 22:07:38 -04:00
abite
8b5788f3b0 add lifetime column to import mapping
Summary of Changes
I've successfully added a "Lifetime" column to the import modal that maps to the isLifetime property in the asset warranty object. Here's what was implemented:
1. Frontend Changes (HTML)
Added a new "Lifetime" column mapping row in the import modal (public/index.html)
Positioned it logically after "Warranty Expiration" and before "2nd Warranty Scope"
2. Frontend Changes (JavaScript)
public/managers/import.js:
Added lifetimeColumn to the column selection dropdowns
Added lifetime to the mappings object for form data collection
Added auto-mapping rules for common lifetime column names: ["lifetime", "lifetime warranty", "is lifetime", "islifetime", "permanent"]
Updated the CSV template to include the "Lifetime" column
Added sample data generation for the lifetime column (defaults to false)
Added lifetimeColumn to the reset form function
3. Backend Changes (Server)
server.js:
Added parsing logic for the lifetime column that accepts multiple formats:
true, 1, yes (case-insensitive) → true
Everything else → false
When isLifetime is true, the warranty expiration date is automatically set to null
The isLifetime property is properly set in the warranty object

Key Features
Flexible Input: Accepts true/false, 1/0, yes/no (case-insensitive)
Auto-mapping: Automatically detects common column names for lifetime warranties
Template Generation: Downloads include the Lifetime column with sample data
Data Validation: Properly handles the boolean conversion and warranty logic
2025-05-27 21:05:16 -05:00
abite
68e546a0df
Merge pull request #12 from DumbWareio/Fix-sub-sub-asset-mx-events-not-showing
Fix sub-sub assets not showing in event list
2025-05-27 21:56:24 -04:00
abite
a18d04af81 Fix sub-sub assets not showing in event list
maintenace events for sub sub assets were not showing in the event list.
2025-05-27 20:51:20 -05:00
V
af4264487a feat: added dumb logos
Behold, the dawn of a dumb aesthetic!
This change is 1% cosmetic, 99% awesome, and 0% likely to break anything....
2025-05-27 13:45:44 -07:00
Chris
9d24a3045f
Recalculate collapsible heights according to the children elements inside of the collapsible element (#11)
Recalculate heights of maintenance events in modal when adding blank events
- so on reopen of the modal it will readjust
2025-05-27 13:43:24 -07:00
Chris
3c16044a94
Merge pull request #1 from DumbWareio/dev
1.0 Rework Part One - Add PWA, cache busting, cors, styling updates, security, styling, new features, and fixes
2025-05-27 10:26:53 -07:00
abite
4fa01b11bf remove boilerplate, edit maint notif.md 2025-05-26 23:05:21 -05:00
abite
ab2759f4da Fix duplicate asset saves
The Problem:
Every time you opened a modal (asset or sub-asset), the ModalManager was adding new keyboard event listeners without removing the old ones. This caused:
1st modal open: 1 event listener → Ctrl+Enter works once
2nd modal open: 2 event listeners → Ctrl+Enter triggers twice (creates 2 assets)
3rd modal open: 3 event listeners → Ctrl+Enter triggers 3 times
And so on...
2025-05-26 22:26:51 -05:00
abite
5c7b6d43b4 removed overdue detection
What Remains Intact:
 Warranty Notifications - Still sends notifications at 30, 14, 7, and 3 days before expiration
 Maintenance Frequency Notifications - Still sends notifications when frequency-based maintenance is due
 Maintenance Specific Date Notifications - Still sends 7-day advance and due-date notifications
 Duplicate Prevention - Still prevents duplicate notifications using tracking keys
 Data Validation - Still validates all maintenance events and dates
 Comprehensive Logging - Still provides detailed debug and summary logs
 Date Calculation Fix - Still uses the corrected start-of-day date comparison
2025-05-26 22:20:20 -05:00
abite
d6bd5608f0 Fix date calculation and maint settings
The problem is that we're comparing the full DateTime (including time) instead of just the date portion. When the cron runs at 12:01 PM on the expiration date, the warranty expiration date (which defaults to midnight) is actually in the past by about 12 hours, resulting in a negative fractional day that gets floored to -1.
2025-05-26 12:14:35 -05:00
abite
18d6ab629d upgraded the warranty notification system
🔧 KEY ENHANCEMENTS:
Comprehensive Summary Reporting
Total assets/components checked
Total warranties processed
Success/failure notification counts
Current notification settings display
Robust Error Handling
Individual asset processing wrapped in try-catch
Failed notifications don't stop the entire process
Detailed error logging with context
Enhanced Date Parsing
Uses the same robust parseDate() function as maintenance
Proper timezone handling with TIMEZONE constant
Validation and warning for invalid dates
Safety Mechanisms
Expired warranty detection (1-7 days past expiration)
Asset type differentiation (Asset vs Component)
Consolidated threshold logic for cleaner code
Detailed Debug Logging
Individual warranty check logging
Processing status for each asset/component
Clear identification of notification triggers
2025-05-25 22:29:54 -05:00
abite
132279ecab Massive Notification Overhaul
CRITICAL ISSUES FIXED
1. TIMEZONE MISMATCH (HIGH RISK) - FIXED
Problem: Dates compared in UTC while cron runs in local timezone → off-by-one day errors
Solution: Implemented robust timezone handling using Luxon DateTime library
2. DATE PARSING FRAGILITY (HIGH RISK) - FIXED
Problem: Basic new Date() parsing could fail silently with invalid dates
Solution: Created comprehensive parseDate() function handling multiple formats with validation
3. DATE CALCULATION ERRORS (MEDIUM-HIGH RISK) - FIXED
Problem: Month arithmetic had edge cases (Jan 31 + 1 month = March 3 instead of Feb 29)
Solution: Implemented addTimePeriod() using Luxon's robust date arithmetic
4. MISSING VALIDATION & ERROR HANDLING - FIXED
Added comprehensive validation for all maintenance event data
Enhanced error handling to prevent system crashes
Added overdue detection as safety net (1-3 days past due notifications)
🛡️ SAFETY MECHANISMS ADDED
Overdue Detection: Catches missed maintenance (server downtime scenarios)
Duplicate Prevention: Tracking system prevents multiple notifications for same event
Data Validation: Invalid events are skipped with logging, don't crash system
Comprehensive Logging: Detailed debugging and summary reports
📊 TEST RESULTS
The comprehensive test suite shows all critical edge cases now work correctly:
 Leap year dates (Feb 29)
 Month-end arithmetic (Jan 31 + 1 month = Feb 29, not March 3)
 Timezone consistency across DST changes
 Multiple date formats parsed correctly
 Invalid dates handled gracefully
2025-05-25 22:20:26 -05:00
abite
2d8cd60d95 Add notifications for sub and sub sub assets
edit/add/delete notifications were not available for sub assets.
2025-05-25 22:08:41 -05:00
abite
cccda6f043 fix query selector null error 2025-05-25 22:02:23 -05:00
abite
367954a9fc Fix auth flow when accessing link with query param 2025-05-25 21:58:19 -05:00
abite
27e85ce829 Add Query Params for links in notifications
Introduce query params so notifications include URLs with direct links to assets
2025-05-25 21:53:36 -05:00
abite
c06bcf93d8 Fix sub asset click handling
When viewing a main asset, sub-assets were rendered correctly using createSubAssetElement directly, so clicks worked fine
When viewing a sub-asset, sub-sub-assets were rendered using innerHTML, which converted the DOM elements to HTML strings and back to DOM, losing all event listeners

Instead of using innerHTML with HTML strings, I changed the code to:
Create DOM elements properly using document.createElement
Append elements directly using appendChild
2025-05-25 21:41:45 -05:00
abite
24142355cc Fix modal save issues
The sub-asset editing was failing with a 404 "Sub-asset not found" error because the collectSubAssetFormData() method was incorrectly handling the sub-asset ID. It was trying to get the ID from a form field (document.getElementById('subAssetId')?.value) instead of using the actual existing sub-asset's ID when in edit mode.

The Fix:
I updated the collectSubAssetFormData() method in public/managers/modalManager.js to follow the same pattern as the asset form:
Edit Mode: When this.isEditMode is true and this.currentSubAsset exists, use this.currentSubAsset.id
Create Mode: When creating a new sub-asset, generate a new ID with this.generateId()
Changes Made:
Fixed the ID assignment logic to use this.currentSubAsset.id in edit mode instead of trying to read from a form field
Added debugging logs to help track the ID assignment process
Ensured the same pattern is used as the working asset form
2025-05-25 20:54:34 -05:00
gitmotion
a441fbee9a add isEditMode declaration for saveSubAsset 2025-05-25 13:49:58 -07:00
gitmotion
752b87830e add fix to hide subassetcontainer when rendering dashboard (fixes bug when saving settings while viewing an asset detail) 2025-05-25 13:27:12 -07:00
gitmotion
542ca310df expand / collapse maintenance events sections in form on open 2025-05-25 13:06:34 -07:00
gitmotion
54ab9aa250 saveasset fix 2025-05-25 13:00:35 -07:00
gitmotion
beab12688e minor styling updates 2025-05-25 12:55:39 -07:00