fluid-project / uio-plus

UIO+: UI Options browser extension
https://chrome.google.com/webstore/detail/ui-options-plus-uio%20/okenndailhmikjjfcnmolpaefecbpaek
Other
2 stars 2 forks source link

Remove update settings invoker #16

Closed jobara closed 4 years ago

jobara commented 4 years ago

Describe the bug

The updateSettings invoker provides a means for updating the settings model and providing an optional fall back to the default settings. However, in UIO+ this isn't used except for resetting, and even then the default settings are explicitly passed in. What's worse is that updateSettings provides no means of identifying a source.

Expected behavior

The updateSettings should be removed from UIO+ and the model updated declaratively through for resetting.

e.g.

        contextMenuPanel: {
            type: "uioPlus.chrome.settingsContextPanel",
            options: {
                model: "{settings}.model",
                distributeOptions: {
                    reset: {
                        target: "{that reset}.options.invokers.click",
                        record: {
                            changePath: "settings",
                            value: "{settings}.options.defaultSettings",
                            source: "reset"
                        }
                    }
                }
            }
        }

For UIO+ for Morphic related to GPII-4218 we also need to update the model. It would be handy to re-implement updateSettings there but also provide an explicit source. This will be needed to prevent cyclical updates of models being passed from Morphic to UIO+ for Morphic and back to Morphic.