mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Remove delete subnamespace depenency from store
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
a61d475bbc
commit
7fd7fd66f7
@ -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());
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user