* Add date filtering to events table
Add past events to date filtering - still need to address infinite maintenance events
update all filter to only show all future and updating downdown text
* fixed the date rollover bug
Summary
I have successfully fixed the date rollover bug in the collectEventsInRange method in public/managers/dashboardManager.js. Here's what was fixed:
Issues Fixed:
Date Rollover Bug: The original code used futureLimit.setMonth(now.getMonth() + monthsAhead) which could cause incorrect date calculations when the current date was near the end of the month. For example:
January 31st + 1 month would become March 2nd instead of February 28th/29th
This could exclude valid events from the filter range
Dead Code: Removed unused variables pastLimit and showPast that were declared and assigned but never used in the filtering logic.
* fix: generate all recurring event instances in dashboard events list - Fixed dashboard events only showing nextDueDate for recurring maintenance - Now displays ALL occurrences of recurring events within selected date range - Added generateRecurringEvents() method to create multiple event instances - Added addTimePeriod() method for robust date arithmetic with rollover protection - Fixed past events logic to work forward from nextDueDate instead of backward - Supports all frequency types: daily, weekly, monthly, yearly events - Includes safety limits (max 100 events) to prevent infinite generation - Resolves issue where daily maintenance showed only 1 event instead of full schedule
* Implemented event list filtering via search bar
feat: add search and filter integration to events section
- Events now filter based on current search query and dashboard filters
- Only shows events for assets/sub-assets visible in the asset list
- Adds real-time event refresh when search input changes
- Maintains contextual relevance between asset list and events display
- Improves user experience by showing only relevant events
* Add specific date selector in events table
* show date picker on select of specific date
* Add light/dark awareness to calendar backgrounds and stroke color to calendar icon
* Add upcoming maintenance events line chart
* Add some math calculations to the charts to set min, max, stepsize
update stepsize to / 10 in case of divide by 0 error
update max by maxEvents + step size so it scales accordingly to the y axis
update min calculation
* add event date check
* adding maxEvents calculation to generateRecurringEvents for at least each day of the month times the number of monthsAhead (defaulted to 12)
add up to 100 events per day
update calculation
update default max events calculation
---------
Co-authored-by: abite <aleksbite@yahoo.com>
* Added Quantity Field
✅ Completed Changes
1. HTML Forms
Added quantity input fields to both asset and sub-asset forms
Fields default to value="1" with min="1" validation
Positioned after price fields for logical flow
2. Modal Manager (Frontend)
Updated form data collection to capture quantity values
Added quantity to form population for editing existing assets
Ensures quantity defaults to 1 if not provided
3. Asset Details Display
Added quantity field to asset info display in assetRenderer.js
Shows "Quantity: X" in the asset details section
Includes fallback to 1 for backwards compatibility
4. Server-side Backwards Compatibility
Asset Creation: Ensures quantity defaults to 1 if not provided
Asset Updates: Preserves existing quantity or defaults to 1
Sub-asset Creation: Ensures quantity defaults to 1 if not provided
Sub-asset Updates: Preserves existing quantity or defaults to 1
Data Loading: All assets and sub-assets get quantity field when loaded from API
5. Import Functionality
Added quantity column mapping option in import modal
Updated server-side import logic to handle quantity with default of 1
Updated template CSV download to include quantity example
Added auto-mapping for "quantity" and "qty" column headers
🔒 Backwards Compatibility
The implementation ensures that:
Existing assets without quantity will automatically show quantity: 1
All API endpoints handle missing quantity gracefully
Import functionality works with or without quantity columns
No data migration is required - compatibility is handled at runtime
* Add "Total Value" to asset details
✅ Total Value Field Features
Conditional Display
Only shows when quantity > 1
Only shows when there's a valid price (either price or purchasePrice)
Calculation
Calculates: price × quantity = total value
Uses the same currency formatting as other price fields
Handles both asset.price and asset.purchasePrice (for backwards compatibility)
* Updated Dashboard Value Calculation logic
Updated Calculation Logic to account for quantity
Assets:
price × quantity for each asset
Defaults to quantity = 1 for backwards compatibility
Sub-Assets:
purchasePrice × quantity for each sub-asset
Defaults to quantity = 1 for backwards compatibility
- Add CURRENCY_CODE and CURRENCY_LOCALE environment variables in server.js
- Inject currency configuration into frontend via dynamic config.js endpoint
- Update formatCurrency() function to use global app config for dynamic currency formatting
- Support any ISO 4217 currency code with proper locale-specific formatting
- Add comprehensive currency configuration documentation (CURRENCY_CONFIG.md)
- Update README.md with currency environment variables and collapsible configuration guide
- Include Docker/Docker Compose configuration examples for currency settings
- Maintain backward compatibility with USD/en-US defaults
Supported currencies include USD, EUR, GBP, CAD, AUD, JPY, and any valid ISO 4217 code.
Currency formatting respects locale-specific conventions (e.g., €1.234,56 for de-DE).
add docs folder
Stringify currency object and update docs
Adding responsive card values to wrap large values
* Added Multi-file uploads
Allows users to upload multiple files for each file type.
Reworked cascading deletion logic to ensure Deleting an asset deletes all attachments as well as sub and sub sub assets and applicable attachments.
* Added file names as file-label
change file label to be file name, limited to 15 characters then cuts off.
* Fix removed features
Fixed Issues:
1. Asset Update Endpoint (PUT /api/assets/:id)
✅ Added name validation: Now validates that updatedAssetData.name exists before proceeding
✅ Added edit notification logic: Checks notificationSettings.notifyEdit and sends notifications when assets are edited
✅ Added debug logging: Logs asset update events when DEBUG mode is enabled
2. Sub-asset Update Endpoint (PUT /api/subassets/:id)
✅ Added name validation: Now validates that updatedSubAssetData.name exists before proceeding
✅ Added edit notification logic: Checks notificationSettings.notifyEdit and sends notifications when sub-assets are edited
✅ Added debug logging: Logs sub-asset update events when DEBUG mode is enabled
3. Asset Delete Endpoint (DELETE /api/asset/:id)
✅ Added delete notification logic: Checks notificationSettings.notifyDelete and sends notifications when assets are deleted
✅ Added debug logging: Logs notification attempts when DEBUG mode is enabled
4. Sub-asset Delete Endpoint (DELETE /api/subasset/:id)
✅ Added delete notification logic: Checks notificationSettings.notifyDelete and sends notifications when sub-assets are deleted
✅ Added debug logging: Logs notification attempts when DEBUG mode is enabled
Key Features Restored:
Data Integrity: Name field validation prevents saving assets/sub-assets without names
Notification System: Complete notification support for edit and delete operations
Consistent API: All endpoints now follow the same pattern as the create endpoints
Error Handling: Proper error handling for notification failures (won't break the main operation)
Debug Support: Comprehensive logging for troubleshooting when DEBUG=TRUE
* Reworked file label and preview grid formatting
* Fix file duplication on drag and drop
There are two separate drag and drop implementations that both trigger when files are dropped:
First implementation: In setupFileInputPreview() (lines ~105-140) - this sets up drag and drop for each individual upload box
Second implementation: In setupDragAndDrop() (lines ~300-389) - this also sets up drag and drop for all upload boxes
Both functions are being called, and they're both adding event listeners to the same elements, causing files to be processed twice. The fix is to remove the duplicate drag and drop code from setupFileInputPreview() since setupDragAndDrop() handles it more comprehensively.
* Fix file duplication on second drag & drop
The Solution:
Added file tracking: Each setupFileInputPreview() function now maintains a processedFiles Set that tracks which files have already been processed using a unique identifier.
Unique file identification: Each file is identified by ${file.name}-${file.size}-${file.lastModified}, which creates a unique fingerprint for each file.
Skip already processed files: Before creating a preview, the handler checks if the file has already been processed and skips it if so.
Clean up on deletion: When a file is deleted, its ID is removed from the processedFiles Set so it can be re-added later if needed.
* feat: completely rework file upload system to prevent duplicates and fix state issues
- Add comprehensive file state tracking with allFiles, newFilesSet, and filePreviewMap
- Implement additive file selection behavior for both drag-and-drop and file input
- Add deduplication logic to prevent duplicate files across multiple selections
- Create distinction between new files (for upload) vs existing files (preview only)
- Add reset() functionality to prevent state contamination between modal operations
- Fix existing file preview display by using server paths instead of mock File objects
- Fix individual file deletion by integrating with filesToDelete system using deletion markers
- Update handleFileUploads to only upload truly new files, preventing re-upload of existing files
- Add setupExistingFilePreview() for proper existing file integration with new helpers
- Update modal manager to use new helper functions and proper state clearing
- Add robust error handling and backward compatibility fallbacks
Fixes:
- File duplication when editing existing assets
- Missing image previews for existing files in edit modal
- Broken individual file deletions
- State persistence contamination between different asset operations
- Inconsistent behavior between drag-and-drop and file input selection
The file upload system now properly handles all edge cases while maintaining
a clean, predictable state across different operations.
* Add logic for import file drag and drop and restricting to single file
remove single attribute
adding self reference to eventlisteners for drag and drop
simplifying resetfileupload per file input
---------
Co-authored-by: gitmotion <43588713+gitmotion@users.noreply.github.com>
* Add hyperlink icon to asset details
Add hyperlink icon in both asset and sub asset details allowing users to copy a direct link to icons for barcode/QR code compatibility.
* Fix render timing to fix query param
I've resolved the query parameter timing issue by:
1. Fixed Initialization Order
Moved dashboardManager initialization before handleUrlParameters() is called
Removed duplicate dashboard manager initialization
Removed premature dashboard rendering in loadAllData()
2. Ensured Proper Flow
Data loads first (loadAllData())
Dashboard manager gets initialized with all dependencies
URL parameters are processed with all managers ready
Only if no URL parameters are found does the dashboard render
Changes Made
Updated HTML Template (public/index.html):
Added a new form group with a link field (subAssetLink) to the sub-asset modal
Positioned it between the purchase price and warranty scope fields for logical flow
Updated Modal Manager (public/managers/modalManager.js):
populateSubAssetForm method: Added 'subAssetLink': subAsset.link || '' to populate the link field when editing a sub-asset
collectSubAssetFormData method: Added link: document.getElementById('subAssetLink')?.value || '' to collect the link value when saving
Existing Infrastructure Already Supports Links:
The generateAssetInfoHTML function in src/services/render/assetRenderer.js already handles the link display properly
It checks for asset.link and renders it as a clickable link with target="_blank"
This function is used for both assets and sub-assets, so sub-asset links will be displayed automatically
* Update README.md
Added maintenance feature
Added tagging feature
Added dependencies
* Include Global filters for Event List
Enhanced updateEventsDisplay() method - Now respects both local events filters (All, Warranty, Maintenance) AND global dashboard filters (Components, Warranties, Expired, Within 30 days, Within 60 days, Active)
Updated Dashboard Card Click Handlers - Now call updateEventsDisplay() when dashboard filters are applied
Enhanced initializeEventsSection() - Ensures events are properly filtered from the start
Added refreshEventsDisplay() method - Public method for external refreshing of events
* Updated/Fixed "Active" filtering logic
The "Active" filter had an incorrect third condition that was including assets with ANY component warranties, regardless of whether those warranties were actually active or expired.
* Fixed EventList updating
The issue was that sectionVisibility was a local variable in the renderDashboard method, so it wasn't accessible in the click handler scope when the dashboard cards were clicked later.
* add logging for event list debug
* Fix Event List updating
The Problem
The Events list wasn't updating when global dashboard filters were clicked because of a variable scope issue:
Two separate dashboardFilter variables existed:
One in main script.js (returned by getDashboardFilter())
One in listRenderer.js (updated by updateDashboardFilter())
The dashboard manager was reading from one variable but updating another:
getDashboardFilter() returned the main script's dashboardFilter (always stayed "all")
updateDashboardFilter() updated the list renderer's dashboardFilter
The Fix
I created a local updateDashboardFilter function in the main script that:
Updates the local dashboardFilter variable (the one getDashboardFilter() returns)
Calls the list renderer's updateDashboardFilter to keep both in sync
* Implement Export Function
Add export CSV functionality into Settings > System modal
* Fixed export button
Problem: The middleware/demo.js file was using ES6 export syntax, but the server was importing it using CommonJS require()
* export UI update
* Add simple csv export
* Removed placeholder logos with correct
Removed placeholder logos and placed real logo into public > assets > images
* remove white background from logo svg
* enlarge svg logo
* Include asset name with Warranty notifications
Add asset bane to warranty notifications so its formatted as:
⏰ Warranty Expiring in 7 days
Asset: Dell OptiPlex 7010
Model #: OptiPlex-7010
Warranty
Expires: 2024-01-15
🔗 View Asset: http://localhost:3000?ass=12345
* Update event list color thresholds
Updated dashboard event list threshold to:
Urgent 0-30 days
Warning 30-60 days
in order to match our alert icons in the asset list.
* Fix enter key on mobile
Key Benefits
Mobile compatibility: Mobile keyboards now show "Enter" button correctly
Multiple input methods: Supports Enter key, comma separation, and real-time comma detection
Form safety: Added stopPropagation() to prevent accidental form submissions
Cross-platform consistency: Works identically on desktop and mobile
Better UX: Users can add tags immediately without switching input methods
* Fixed "Component Details" title overlap
Key Benefits
No More Overlap: The Component Details header no longer covers the asset name and back button
Better Space Utilization: Reduced padding and font sizes create more breathing room
Improved Mobile UX: The header is now appropriately sized for mobile screens
Maintained Functionality: All buttons and text remain clearly visible and clickable
Responsive Design: The changes only apply on mobile (max-width: 853px) and don't affect desktop layout