Open silvester-pari opened 1 week ago
Hi @silvester-pari, the userSettings custom editor functionality was initially meant to make changes to the userSettingsData object only and giving the core the chance to execute custom code when the user clicks 'Save' (e.g. if certain values have changed, like locale, theme, etc., do the necessary updates via Luigi Core API). I assume you want to have more like an "instant/live" effect for changed values, but i'm afraid that just adding the clientPermissions mechanism to userSettings MFE's wouldn't be sufficient, since it rather would mean a change of the whole flow. E.g. the "Save" button is probably obsolete in such a scenario, instead you would need a "rollback" action on cancel... or maybe even no cancel button at all(?)... storeUserSettings
probably needs to be called on each change. etc.
So I guess we have 3 options now (in order of complexity and thus time to be available):
Description
By setting the
viewUrl
property inside auserSettingGroup
it is possible to load a micro frontend as editor. But, if developing a e.g. custom language switcher, it is not possible to setclientPermissions.changeCurrentLocale
, necessary for allowing the micro frontend to switch the locale.This is because the
createIframe
function is called with only theviewUrl
andmicroFrontendType
, the rest beingundefined
. It looks likeclientPermissions
would be expected to be passed as part of the third argument (currentNode
).Reasons
When offering the usage of custom editors for
userSettings
, it would be great to have all the (necessary) functionalities present in the node creation process; especially the language switching use case demonstrates this. Other functionality could be e.g. also passing acontext
.