Problem
I want to hide/disable access to some panels in a standard layout config based on the users permission, or a feature flag, and instead of having them removed from the layout when the users lacks permissions I'd like to hide them so that I can unhide when the user gains permissions.
Framework
All (React)
Proposed solution
There's an API method for hiding groups, I'd like to have the same API available on a panel level. The visibility status would be serialised into the JSON state format, ideally as a property of the panel in the panels map. It should trigger an onDidVisibilityChange event for the panel.
panel.setVisible(false) // => panel.isVisible === false
Alternatives considered
I tried storing the visibility state in the panel params and using a custom tab renderer and CSS to hide the tab and some logic to change the active panel to something else if a panel becomes unavailable and to prevent the panel component from rendering its content if it is hidden. It works, but it is hacky and the overflow menu still counts the tab as visible so the number showing the number of overflowing doesn't match the number of tabs in the overflow menu.
Problem
I want to hide/disable access to some panels in a standard layout config based on the users permission, or a feature flag, and instead of having them removed from the layout when the users lacks permissions I'd like to hide them so that I can unhide when the user gains permissions.
Framework
All (React)
Proposed solution
There's an API method for hiding groups, I'd like to have the same API available on a panel level. The visibility status would be serialised into the JSON state format, ideally as a property of the panel in the
panelsmap. It should trigger anonDidVisibilityChangeevent for the panel.Alternatives considered
I tried storing the visibility state in the panel
paramsand using a custom tab renderer and CSS to hide the tab and some logic to change the active panel to something else if a panel becomes unavailable and to prevent the panel component from rendering its content if it is hidden. It works, but it is hacky and the overflow menu still counts the tab as visible so the number showing the number of overflowing doesn't match the number of tabs in the overflow menu.