Changes based on maintainer feedback from PR #1217:
1. Add yarn install/build steps to update process
- Added yarn availability check in validateUpdatePreconditions
- Added yarn install and yarn build steps after composer install
- Added yarn rebuild to rollback process
- Updated total steps count from 12 to 14
2. Add environment variables to disable web features
- DISABLE_WEB_UPDATES: Completely disable web-based updates
- DISABLE_BACKUP_RESTORE: Disable backup restore from web UI
- Added checks in controller and template
3. Extract BackupManager service
- New service handles backup creation, listing, details, and restoration
- UpdateExecutor now delegates backup operations to BackupManager
- Cleaner separation of concerns for future reuse
4. Merge upstream/master and resolve translation conflicts
- Added Conrad info provider and generic web provider translations
- Kept Update Manager translations
* feat: add supplier SPN lookup for BOM import
Add automatic part linking via supplier part numbers (SPNs) in the
BOM importer. When a Part-DB ID is not provided, the importer now
searches for existing parts by matching supplier SPNs from the CSV
with orderdetail records in the database.
This allows automatic part linking when KiCad schematic BOMs contain
supplier information like LCSC SPN, Mouser SPN, etc., improving the
import workflow for users who track parts by supplier part numbers.
* add tests for BOM import with supplier SPN handling
The previous implementation used inline onsubmit handlers with return
confirmVersionChange(...), which could fail silently if any JavaScript
error occurred on the page, causing the form to submit without confirmation.
Fixes:
- Use event.preventDefault() FIRST to ensure form never submits by default
- Use DOMContentLoaded event listeners instead of inline handlers
- Properly escape translation strings using json_encode filter
- Wrap in IIFE with 'use strict' for better error handling
- Use data-attributes to identify forms and pass isDowngrade state
Fix DOMContentLoaded race condition in update form handlers
The event listener was not attaching if DOMContentLoaded had already
fired by the time the script executed. Now checks document.readyState
and attaches handlers immediately if DOM is already ready.
Added console.log statements to help debug form handler attachment.
Use Stimulus controller for update confirmation dialogs
The inline script was blocked by Content Security Policy (CSP).
Stimulus controllers are bundled with webpack and properly allowed by CSP.
- Create update_confirm_controller.js Stimulus controller
- Remove inline script from template
- Pass translation strings via data-* attributes
When downgrading to versions before v2.6.0, show a warning that the
Update Manager will not be available in older versions and that future
updates will need to be done manually via command line.
- Bump permission schema to version 4
- Add upgradeSchemaToVersion4 for manage_updates permission
- Grants manage_updates to users who have both show_updates and server_infos
- Fix ZIP_RELEASE installation type: set supportsAutoUpdate to false
(ZIP update not yet implemented)
- Improve update instructions for ZIP installations
This feature adds a comprehensive Update Manager similar to Mainsail's
update system, allowing administrators to update Part-DB directly from
the web interface.
Features:
- Web UI at /admin/update-manager showing current and available versions
- Support for Git-based installations with automatic update execution
- Maintenance mode during updates to prevent user access
- Automatic database backup before updates
- Git rollback points for recovery (tags created before each update)
- Progress tracking with real-time status updates
- Update history and log viewing
- Downgrade support with appropriate UI messaging
- CLI command `php bin/console partdb:update` for server-side updates
New files:
- UpdateManagerController: Handles all web UI routes
- UpdateCommand: CLI command for running updates
- UpdateExecutor: Core update execution logic with safety mechanisms
- UpdateChecker: GitHub API integration for version checking
- InstallationTypeDetector: Detects installation type (Git/Docker/ZIP)
- MaintenanceModeSubscriber: Blocks user access during maintenance
- UpdateExtension: Twig functions for update notifications
UI improvements:
- Update notification in navbar for admins when update available
- Confirmation dialogs for update/downgrade actions
- Downgrade-specific text throughout the interface
- Progress page with auto-refresh
* Fix: Use correct field name for LCSC supplier part numbers in BOM import
The field mapping system uses 'LCSC SPN' as the target field name for LCSC
supplier part numbers (following the pattern SupplierName + ' SPN'), but the
code in parseKiCADSchematic() was incorrectly checking for 'LCSC'.
This caused LCSC supplier part numbers to be silently ignored and not included
in the BOM entry comments during schematic import.
Changed isset($mapped_entry['LCSC']) to isset($mapped_entry['LCSC SPN']) to
match the actual field name produced by the field mapping system.
* regression test: check for LCSC SPN in comment
* Support dynamic supplier SPNs in BOM import comments
Replace hardcoded LCSC SPN handling with dynamic supplier lookup to support all configured suppliers in BOM import. This allows any supplier defined in
Part-DB to have their SPN fields recognized and included in the BOM entry
comments during BOM import.
* Optimize BOM import by only calculating supplier SPN keys once