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.
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
* Implementiere bevorzugte Sprachauswahl und Datenquellen-Synonyme
Die Spracheinstellungen/System-Settings wurden um die Möglichkeit ergänzt, bevorzugte Sprachen für die Dropdown-Menüs festzulegen. Zudem wurde ein Datenquellen-Synonymsystem implementiert, um benutzerfreundlichere Bezeichnungen anzuzeigen und zu personalisieren.
* Anpassung aus Analyse
* Entferne alten JSON-basierten Datenquellen-Synonym-Handler
Die Verwaltung der Datenquellen-Synonyme wurde überarbeitet, um ein flexibleres und strukturiertes Konzept zu ermöglichen. Der bestehende JSON-basierte Ansatz wurde durch eine neue Service-basierte Architektur ersetzt, die eine bessere Handhabung und Erweiterbarkeit erlaubt.
* Ermögliche Rückgabe aller möglichen Sprachoptionen in Verbindung mit den vom Nutzer freigeschalteten.
* Removed unnecessary service definition
The tag is applied via autoconfiguration
* Use default translations for the NotBlank constraint
* Started refactoring ElementTypeNameGenerator
* Made ElementTypeNameGenerator class readonly
* Modified form to work properly with new datastructure
* Made the form more beautiful and space saving
* Made synonym form even more space saving
* Allow to define overrides for any element label there is
* Use defined synonyms in ElementTypeNameGenerator
* Use ElementTypeNameGenerator where possible
* Register synonyms for element types as global translation parameters
* Revert changes done to permission layout
* Use new synonym system for admin page titles
* Removed now unnecessary services
* Reworked settings name and translation
* Renamed all files to Synonyms
* Removed unnecessary translations
* Removed unnecessary translations
* Fixed duplicate check
* Renamed synoynms translations
* Use our synonyms for permission translations
* Fixed phpstan issue
* Added tests
---------
Co-authored-by: Marcel Diegelmann <marcel.diegelmann@gmail.com>
Co-authored-by: Jan Böhmer <mail@jan-boehmer.de>
* Erweiterungstätigkeiten zur IPN-Vorschlagsliste anhand von Präfixen aus den Kategorien
* Umstellung Migrationen bzgl. Multi-Plattform-Support.
Zunächst MySQL, SQLite Statements integrieren.
* Postgre Statements integrieren
* SQL-Formatierung in Migration verbessern
* Erweitere IPN-Suggest um Bauteilbeschreibung.
Die Implementierung berücksichtigt nun zusätzlich die Bauteilbeschreibung zu maximal 150 Zeichen Länge für die Generierung von IPN-Vorschlägen und Inkrementen.
* Anpassungen aus Analyse vornehmen
* IPN-Validierung für Parts überarbeiten
* IPN-Vorschlagslogik um Konfiguration erweitert
* Anpassungen aus phpstan Analyse
* IPN-Vorschlagslogik erweitert und Bauteil-IPN vereindeutigt
Die IPN-Logik wurde um eine Konfiguration zur automatischen Suffix-Anfügung und die Berücksichtigung von doppelten Beschreibungen bei Bedarf ergänzt. Zudem wurde das Datenmodell angepasst, um eine eindeutige Speicherung der IPN zu gewährleisten.
* Regex-Konfigurationsmöglichkeit für IPN-Vorschläge einführen
Die Einstellungen für die IPN-Vorschlagslogik wurden um eine Regex-Validierung und eine Hilfetext-Konfiguration erweitert. Tests und Änderungen an den Formularoptionen wurden implementiert.
* Match range assert and form limits in suggestPartDigits
* Keep existing behavior with autoAppend suffix by default
* Show the regex hint in the browser validation notice.
* Improved translations
* Removed unnecessary service definition
* Removed german comments
---------
Co-authored-by: Marcel Diegelmann <marcel.diegelmann@gmail.com>
Co-authored-by: Jan Böhmer <mail@jan-boehmer.de>
- Add BulkSearchResponseDTO, FieldMappingDTO for type safety
- Use composition instead of inheritance in BulkSearchResultDTO
- Remove unnecessary BulkSearchRequestDTO
- Fix N+1 queries and API error handling
- Fix Add Mapping button functionality