mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Check object instanceof on all detail panels (#4054)
* Check object instanceof on all detail panels Signed-off-by: Sebastian Malton <sebastian@malton.name> * Fix unit tests - Remove prettier as snapShot testing is too tight of a bound Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
dabfce3609
commit
052d12fc19
32 files changed
+392
-168
No files matched your search
@@ -38,6 +38,7 @@ import { PodCharts, podMetricTabs } from "../+workloads-pods/pod-charts";
|
||||
import { ClusterMetricsResourceType } from "../../../common/cluster-types";
|
||||
import { getActiveClusterEntity } from "../../api/catalog-entity-registry";
|
||||
import { getDetailsUrl } from "../kube-detail-params";
|
||||
import logger from "../../../common/logger";
|
||||
|
||||
interface Props extends KubeObjectDetailsProps<Namespace> {
|
||||
}
|
||||
@@ -81,7 +82,16 @@ export class NamespaceDetails extends React.Component<Props> {
|
||||
render() {
|
||||
const { object: namespace } = this.props;
|
||||
|
||||
if (!namespace) return null;
|
||||
if (!namespace) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!(namespace instanceof Namespace)) {
|
||||
logger.error("[NamespaceDetails]: passed object that is not an instanceof Namespace", namespace);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
const status = namespace.getStatus();
|
||||
const isMetricHidden = getActiveClusterEntity()?.isMetricHidden(ClusterMetricsResourceType.Namespace);
|
||||
|
||||
|
||||
Reference in new issue
Block a user