Pre rendering handler is missing
nitin- opened this issue · 3 comments
nitin- commented
I have provided certain configuration and I want to decide at the run time whether a component should be rendered or not by looking at value provided in componentState key.
content:[
{
type: 'component',
componentName: 'Test1',
title: 'Test1',
componentState: { role: 'Admin' }
},
{
type: 'component',
componentName: 'app-editor',
title: 'Editor',
componentState: { role: 'ALL' }
}
]
A glimpse of my configuration , I want admin should only open Test1.
martin31821 commented
This is something you need to handle either within your components, or filter the state before passing it into goldenlayout.
nitin- commented
once the component will be opened , then how can I close it based on certain condition
johannwagner commented
So, you have three ways of archiving this, neither does not include a prerendering handler.
- You can only insert the "Test1" component, if you are an admin, which you have to determine out of your application context.
- Your component can close itself, if you are not an admin.
- Your component can show an error message, that this is only available for admins.
Introducing a pre-rendering handler would not be helpful at this point. Right now, I do not have any ideas, how this should be useful in other cases.