Repository navigation
Fix: open a widget's settings from its own config, not the last one edited - #128
Merged
Merged
Conversation
…dited The config form keeps values typed into it across a re-render, so a view switch does not discard them. That cache was matched on widget type alone and outlived the editor, so opening a second widget of the same type filled its form from the first: a tile reading one source showed another as its source, and saving would have written it. The cache now belongs to one opening of the editor. Switching type tiles inside an open editor still keeps what was typed, which clearing the cache outright would have discarded.
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.
Summary
carriesTypedValuestoadmin-logic.js: typed values are carried only into a re-render of the same form in the same editing session.admin.jswhen the edit view opens an item, and record it alongside the cached form inadmin-widget-form.js.The cache was matched on widget type alone and was never cleared between openings, so
_wAutoCfgwas overwritten by the previously edited widget's form values. With several widgets of one type on a dashboard, the settings showed another tile's provider, URL and slots, and saving would have persisted them against the wrong tile's stored secret.Keying to the session rather than clearing the cache preserves the case that made it exist: switching the type tiles inside an open editor re-renders the body and must not discard what was typed.
Testing
All green. Added 1 test covering the same-form, next-widget, different-type and empty-cache cases. Verified in a container with four
system-summarytiles, opening them in sequence.Checklist