Remove delete subnamespace depenency from store

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev committed 2023-03-02 14:42:03 +03:00
1 parent a61d475bbc
commit 7fd7fd66f7
2 files changed
-9

No files matched your search

@@ -12,7 +12,6 @@ import storesAndApisCanBeCreatedInjectable from "../../stores-apis-can-be-create
import clusterFrameContextForClusterScopedResourcesInjectable from "../../cluster-frame-context/for-cluster-scoped-resources.injectable";
import clusterConfiguredAccessibleNamespacesInjectable from "../../cluster/accessible-namespaces.injectable";
import loggerInjectable from "../../../common/logger.injectable";
import removeSubnamespaceInjectable from "./remove-subnamespace.injectable";
const namespaceStoreInjectable = getInjectable({
id: "namespace-store",
@@ -28,7 +27,6 @@ const namespaceStoreInjectable = getInjectable({
storage: createStorage<string[] | undefined>("selected_namespaces", undefined),
clusterConfiguredAccessibleNamespaces: di.inject(clusterConfiguredAccessibleNamespacesInjectable),
logger: di.inject(loggerInjectable),
removeSubnamespace: di.inject(removeSubnamespaceInjectable),
}, api);
},
injectionToken: kubeObjectStoreInjectionToken,
@@ -21,7 +21,6 @@ export interface NamespaceTree {
interface Dependencies extends KubeObjectStoreDependencies {
readonly storage: StorageLayer<string[] | undefined>;
readonly clusterConfiguredAccessibleNamespaces: IComputedValue<string[]>;
readonly removeSubnamespace: (name: string) => Promise<void>;
}
export class NamespaceStore extends KubeObjectStore<Namespace, NamespaceApi> {
@@ -221,12 +220,6 @@ export class NamespaceStore extends KubeObjectStore<Namespace, NamespaceApi> {
@action
async remove(item: Namespace) {
if (item.isSubnamespace()) {
await this.dependencies.removeSubnamespace(item.getName());
return;
}
await super.remove(item);
this.clearSelected(item.getName());
}