Fix namespaces not respecting accessible namespace config (#7279)

* Fix namespaces not respecting accessible namespace config

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix warning hover text formatting

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Log state after refresh accessibility

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix tests

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix NamespaceStore.allowedNamespaces

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Remove unnecessary '?'

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Add deprecation messages

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Move selected_namespaces storage to injectable

- And its initialization

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Implement contextNamespaces logic in forNamespacedResources

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Update snapshot

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix formatting

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix formatting

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix test

- This was a side effect of the previous bug fixes where
  the clusterContext.hasAllSelected was previously erroneously 'false'

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Change log level

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix another test suite

Signed-off-by: Sebastian Malton <sebastian@malton.name>

---------

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton authored and GitHub committed 2023-03-06 14:28:08 -08:00
1 parent aad19677db
commit a286ae4c44
17 files changed
+112 -65

No files matched your search

@@ -498,6 +498,7 @@ export class Cluster implements ClusterModel {
this.allowedResources.replace(await this.getAllowedResources(requestNamespaceListPermissions));
this.ready = this.knownResources.length > 0;
this.dependencies.logger.debug(`[CLUSTER]: refreshed accessibility data`, this.getState());
}
/**
@@ -4,7 +4,7 @@
*/
import { getInjectable } from "@ogre-tools/injectable";
import { computed } from "mobx";
import namespaceStoreInjectable from "../../renderer/components/+namespaces/store.injectable";
import clusterFrameContextForNamespacedResourcesInjectable from "../../renderer/cluster-frame-context/for-namespaced-resources.injectable";
import { storesAndApisCanBeCreatedInjectionToken } from "./stores-apis-can-be-created.token";
const selectedFilterNamespacesInjectable = getInjectable({
@@ -15,9 +15,9 @@ const selectedFilterNamespacesInjectable = getInjectable({
return computed(() => []);
}
const store = di.inject(namespaceStoreInjectable);
const context = di.inject(clusterFrameContextForNamespacedResourcesInjectable);
return computed(() => [...store.contextNamespaces]);
return computed(() => [...context.contextNamespaces]);
},
});