-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
frontend: PluginSettings: Rework plugin settings local storage usage #2596
base: main
Are you sure you want to change the base?
Conversation
825bbe1
to
5ba4e15
Compare
last push
|
5ba4e15
to
6b0ad82
Compare
last push fixes merge conflicts |
6b0ad82
to
fb4cd59
Compare
last push rebases and fixes storybook |
e257f80
to
0e02bf1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am a bit surprised this needs so many changes. Wasn't the idea just to remove the saving of the whole package.json from the settings and use just the plugin name instead? Even if we change the name of the key in local storage, or move it to index db, why are we touching the plugin settings this much?
I would also like to understand: are plugins now supposed to be disabled by default? I understood that shipped plugins need to be enabled by default, and that the other ones were also like that for keeping a consistent behavior with the previous versions.
noticed some weird behavior when not using any of the old |
Signed-off-by: Vincent T <[email protected]>
0e02bf1
to
5c99964
Compare
some meeting notes
|
Description
resolves issue #2595
This PR refactors the way Headlamp handles plugin settings stored in local storage, focusing on simplifying and improving the management of plugin states. Previously, the project stored the entire JSON data of plugin information in
headlampPluginSettings
, which included unnecessary details. This refactor reduces complexity by saving only the essential state information, improving performance and maintainability.Key Changes
Simplified Storage:
headlampPluginSettings
structure withenabledPluginsList
in local storage.on/off
state, eliminating the need to store complete JSON data.State Management Updates:
pluginData
slice in the plugin state to store plugin information.enabledPlugins
to maintain a list of plugins currently in use.Backward Compatibility:
headlampPluginSettings
in local storage.enabledPluginsList
format automatically upon visiting the plugin settings page.Steps to Test
To verify the changes and ensure backward compatibility:
Setup:
main
branch with multiple plugins installed.headlampPluginSettings
JSON.Switch to this Branch:
Observe Migration:
headlampPluginSettings
in local storage, migrates the settings into a newenabledPluginsList
object, deletes the oldheadlampPluginSettings
, and reloads the page.Post-Migration:
enabledPluginsList
structure.Notes