completed client state invalidation in multi-user environment

This commit is contained in:
Shaun Walker
2020-03-10 10:37:42 -04:00
parent 834b1476d4
commit 155c4e12d9
47 changed files with 104 additions and 143 deletions

View File

@ -0,0 +1,44 @@
@namespace Oqtane.UI
<CascadingValue Value="@ModuleState">
@DynamicComponent
</CascadingValue>
@code {
[CascadingParameter]
protected PageState PageState { get; set; }
[Parameter]
public Module Module { get; set; }
RenderFragment DynamicComponent { get; set; }
Module ModuleState;
protected override void OnParametersSet()
{
ModuleState = Module; // passed in from Pane component
string container = ModuleState.ContainerType;
if (PageState.ModuleId != -1 && PageState.Action != "" && ModuleState.UseAdminContainer)
{
container = Constants.DefaultAdminContainer;
}
DynamicComponent = builder =>
{
Type containerType = Type.GetType(container);
if (containerType != null)
{
builder.OpenComponent(0, containerType);
builder.CloseComponent();
}
else
{
// container does not exist with type specified
builder.OpenComponent(0, Type.GetType(Constants.ModuleMessageComponent));
builder.AddAttribute(1, "Message", "Error Loading Module Container " + container);
builder.CloseComponent();
}
};
}
}