[app-hax] Configuration / Localization panel in system-settings dashboard - #824
Merged
Conversation
Adds a new "Configuration" panel (panelType: "fields") to haxcms-system-
settings for the system-wide default language, backed by the
v1/configuration/localization API (getLocalizationSettings /
saveLocalizationSettingsPatch) shared by the PHP and NodeJS backends.
- haxcms-system-settings.js: new configuration panel with a localization
section containing a defaultLanguage select (32 BCP-47 tags matching the
backend curated list). Load/save helpers mirror the existing media panel
pattern; payload wrapped as {localizationSettings:{defaultLanguage}} which
the backend resolveLocalizationSettingsPayload handles. Panel added to the
dashboard second-row order. DDD-token-based styling inherited via the
existing panelType:"fields" rendering path (light-dark() dark mode); no raw
hex / inline styles / Polymer-era constructs added.
- AppHaxBackendAPI.js: getLocalizationSettings (GET) and
saveLocalizationSettings (PATCH) system call aliases, matching the PHP
OpenAPI operationIds.
Field name (defaultLanguage), panel key (configuration), section key
(localization), and API route (v1/configuration/localization) match the PHP
and NodeJS backends exactly.
Refs haxtheweb/issues#2974
Co-Authored-By: Warp <agent@warp.dev>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The new panel and API aliases follow the established media-settings pattern in this codebase and appear internally consistent with the existing simple-fields/HAXFields wiring.
Pull request overview
Adds a new “Configuration” panel to the AppHax system settings dashboard to manage system-wide localization defaults (currently: default language), backed by new AppHaxBackendAPI system-call aliases for the shared v1/configuration/localization API.
Changes:
- Added
getLocalizationSettings(GET) andsaveLocalizationSettings(PATCH) system call aliases toAppHaxBackendAPI. - Introduced a new
configurationadmin panel (panelType:fields) with adefaultLanguageselect, plus load/save plumbing mirroring the existingmediasettings flow. - Updated dashboard ordering and copy to include the new configuration defaults panel.
File summaries
| File | Description |
|---|---|
| elements/app-hax/lib/v2/AppHaxBackendAPI.js | Adds localization settings GET/PATCH call aliases used by the admin UI. |
| elements/app-hax/lib/v2/admin/haxcms-system-settings.js | Adds the Configuration panel UI plus normalization + load/save methods for default language settings. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new Configuration panel to the
haxcms-system-settingsadmin dashboard for the system-wide default language, backed by thev1/configuration/localizationAPI shared by the PHP and NodeJS backends (companion PRs haxtheweb/haxcms-php#624 and haxtheweb/haxcms-nodejs#33).What's added
haxcms-system-settings.js— newconfigurationpanel (panelType: "fields") with alocalizationsection containing adefaultLanguageselect offering 32 common BCP-47 tags (matching the backend curated list). Load/save helper methods mirror the existingmediapanel pattern exactly; the save payload is wrapped as{localizationSettings:{defaultLanguage}}, which the backendresolveLocalizationSettingsPayloadhandles. The panel is added to the dashboard second-row order. No new CSS — it inherits the DDD-token-based styling (incl.light-dark()dark mode) from the existingpanelType: "fields"rendering path.AppHaxBackendAPI.js—getLocalizationSettings(GET) andsaveLocalizationSettings(PATCH) system call aliases, matching the PHP OpenAPI operationIds.Consistency across repos
defaultLanguageconfiguration/ section key:localizationv1/configuration/localization(GET → get, PATCH → save)localizationblock on_config/config.json(single source of truth)Validation
node -con both modified files: PASS.?.); nowindowreferences (usesglobalThis).build/files modified.panelType: "fields"rendering; no raw hex, inline styles, or Polymer-era constructs introduced.Refs haxtheweb/issues#2974
Co-Authored-By: Warp agent@warp.dev