diff --git a/src/dashboard/Synapse.Dashboard/Components/ResourceManagement/NamespacedResourceManagementComponentState.cs b/src/dashboard/Synapse.Dashboard/Components/ResourceManagement/NamespacedResourceManagementComponentState.cs index c03e0f5c1..910396cae 100644 --- a/src/dashboard/Synapse.Dashboard/Components/ResourceManagement/NamespacedResourceManagementComponentState.cs +++ b/src/dashboard/Synapse.Dashboard/Components/ResourceManagement/NamespacedResourceManagementComponentState.cs @@ -22,6 +22,11 @@ public record NamespacedResourceManagementComponentState where TResource : Resource, new() { + /// + /// Gets/sets a boolean value that indicates whether to list s + /// + public bool ListNamespaces { get; set; } = true; + /// /// Gets a that contains all s /// diff --git a/src/dashboard/Synapse.Dashboard/Components/ResourceManagement/NamespacedResourceManagementComponentStore.cs b/src/dashboard/Synapse.Dashboard/Components/ResourceManagement/NamespacedResourceManagementComponentStore.cs index 1b251c5df..9a4f2c4a5 100644 --- a/src/dashboard/Synapse.Dashboard/Components/ResourceManagement/NamespacedResourceManagementComponentStore.cs +++ b/src/dashboard/Synapse.Dashboard/Components/ResourceManagement/NamespacedResourceManagementComponentStore.cs @@ -30,7 +30,12 @@ public class NamespacedResourceManagementComponentStore(ILogg { /// - /// Gets an used to observe s + /// Gets an used to observe + /// + public IObservable ListNamespaces => this.Select(s => s.ListNamespaces).DistinctUntilChanged(); + + /// + /// Gets an used to observe s /// public IObservable?> Namespaces => this.Select(s => s.Namespaces).DistinctUntilChanged(); @@ -51,6 +56,27 @@ public class NamespacedResourceManagementComponentStore(ILogg ) .DistinctUntilChanged(); + /// + /// Sets the to true + /// + public void EnableNamespaceListing() + { + this.Reduce(state => state with + { + ListNamespaces = true + }); + } + /// + /// Sets the to false + /// + public void DisableNamespaceListing() + { + this.Reduce(state => state with + { + ListNamespaces = false + }); + } + /// /// Sets the /// @@ -85,8 +111,8 @@ public override async Task DeleteResourceAsync(TResource resource) /// public override async Task InitializeAsync() { - await this.ListNamespacesAsync().ConfigureAwait(false); await base.InitializeAsync(); + if (this.Get(state => state.ListNamespaces)) await this.ListNamespacesAsync().ConfigureAwait(false); } } diff --git a/src/dashboard/Synapse.Dashboard/Pages/Workflows/Details/View.razor b/src/dashboard/Synapse.Dashboard/Pages/Workflows/Details/View.razor index 7f3a46fa6..c884151d6 100644 --- a/src/dashboard/Synapse.Dashboard/Pages/Workflows/Details/View.razor +++ b/src/dashboard/Synapse.Dashboard/Pages/Workflows/Details/View.razor @@ -170,6 +170,7 @@ /// protected override async Task OnInitializedAsync() { + Store.DisableNamespaceListing(); UpdateBreadcrumb(); Store.WorkflowInstanceName.Subscribe(value => OnStateChanged(_ => instanceName = value), token: CancellationTokenSource.Token); Store.WorkflowDefinition.Where(value => value != null).Subscribe(value => OnStateChanged(_ => workflowDefinition = value!), token: CancellationTokenSource.Token);