fix(smarthome): CSP-safe modal wiring + client i18n keys - #205
Merged
Conversation
- CSP (script-src-attr 'none') blocked inline onclick → connect/close/cancel buttons dead. Replace with id=sh-connect-open + [data-sh-close] wired via addEventListener (wireModal), matching midea's CSP-safe pattern. - Add 13 smarthome.* client keys to GC.t in all 3 layouts (were only in en/de.json server-side → JS-rendered labels showed raw keys). - Route dropdown populates once modal opens (fillRoutes/endpoint already correct).
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Behebt drei Live-Bugs auf der Smart-Home-Admin-Seite (gemeldet nach #204):
script-src-attr 'none') blockt inlineonclick=-Handler. Modal öffnen/schließen/abbrechen waren tot. Ersetzt durchid="sh-connect-open"+[data-sh-close], verdrahtet viaaddEventListener(wireModal()) — wie das CSP-sichere Midea-Muster.smarthome.*-Keys nur server-seitig in en/de.json standen, aber nicht in der Client-Bridgewindow.GC.t(layout.njk). 13 Keys in allen 3 Layouts ergänzt.fillRoutes//api/v1/routeswaren korrekt. Befüllt sich nach dem Modal-Fix.Verifikation: 9/9 betroffene Templates kompilieren sauber; keine inline
onclickmehr in smarthome-Templates; alle 13 Keys in en+de vorhanden;smarthome.jsSyntax ok.🤖 Generated with Claude Code