From c071fb1ca77e51ef6eb4ea1c8c70aab505f789d2 Mon Sep 17 00:00:00 2001 From: Janne Savolainen Date: Thu, 7 Jul 2022 10:42:41 +0300 Subject: [PATCH] Kludge "isEnabledForCluster" work again for kube object details Signed-off-by: Janne Savolainen --- ...when-cluster-is-not-relevant.test.tsx.snap | 1427 +++++++++++++++++ ...tems-when-cluster-is-not-relevant.test.tsx | 172 ++ src/extensions/common-api/registrations.ts | 2 +- .../extension-loader/extension-loader.ts | 28 +- src/extensions/lens-renderer-extension.ts | 3 +- .../api/kube-object-detail-registry.ts | 6 - src/renderer/bootstrap.tsx | 3 - .../details/volumes/variants/flex-volume.tsx | 2 +- ...rrent-kube-object-in-details.injectable.ts | 35 + ...ter-role-binding-detail-item.injectable.ts | 33 + .../cluster-role-detail-item.injectable.ts | 33 + .../config-map-detail-item.injectable.ts | 30 + .../cron-job-detail-item.injectable.ts | 32 + ...urce-definitions-detail-item.injectable.ts | 33 + .../daemon-set-detail-item.injectable.ts | 32 + .../deployment-detail-item.injectable.ts | 32 + .../endpoints-detail-item.injectable.ts | 32 + .../events-detail-item.injectable.ts | 30 + ...l-pod-autoscaler-detail-item.injectable.ts | 33 + .../ingress-detail-item.injectable.ts | 33 + .../job-detail-item.injectable.ts | 30 + .../kube-event-detail-item.injectable.ts | 84 + .../limit-range-detail-item.injectable.ts | 30 + .../namespaces-detail-item.injectable.ts | 30 + .../network-policy-detail-item.injectable.ts | 33 + .../node-detail-item.injectable.ts | 30 + ...ent-volume-claim-detail-item.injectable.ts | 33 + ...ersistent-volume-detail-item.injectable.ts | 33 + .../pod-detail-item.injectable.ts | 30 + ...isruption-budget-detail-item.injectable.ts | 33 + ...-security-policy-detail-item.injectable.ts | 33 + .../replica-set-detail-item.injectable.ts | 32 + .../resource-quota-detail-item.injectable.ts | 32 + .../role-binding-detail-item.injectable.ts | 33 + .../role-detail-item.injectable.ts | 32 + .../secrets-detail-item.injectable.ts | 30 + .../service-account-detail-item.injectable.ts | 33 + .../service-detail-item.injectable.ts | 32 + .../stateful-set-detail-item.injectable.ts | 33 + .../storage-class-detail-item.injectable.ts | 33 + ...kube-object-detail-item-injection-token.ts | 18 + ...ject-detail-item-registrator.injectable.ts | 76 + .../kube-object-detail-items.injectable.ts | 31 + ...-object-matches-to-kind-and-api-version.ts | 10 + .../kube-object-detail-registration.ts | 18 + .../kube-object-details.tsx | 62 +- src/renderer/initializers/index.ts | 1 - .../kube-object-detail-registry.tsx | 441 ----- src/renderer/initializers/registries.ts | 1 - 49 files changed, 2866 insertions(+), 512 deletions(-) create mode 100644 src/behaviours/cluster/kube-object-details/extension-api/__snapshots__/disable-kube-object-detail-items-when-cluster-is-not-relevant.test.tsx.snap create mode 100644 src/behaviours/cluster/kube-object-details/extension-api/disable-kube-object-detail-items-when-cluster-is-not-relevant.test.tsx delete mode 100644 src/renderer/api/kube-object-detail-registry.ts create mode 100644 src/renderer/components/kube-object-details/current-kube-object-in-details.injectable.ts create mode 100644 src/renderer/components/kube-object-details/kube-object-detail-items/implementations/cluster-role-binding-detail-item.injectable.ts create mode 100644 src/renderer/components/kube-object-details/kube-object-detail-items/implementations/cluster-role-detail-item.injectable.ts create mode 100644 src/renderer/components/kube-object-details/kube-object-detail-items/implementations/config-map-detail-item.injectable.ts create mode 100644 src/renderer/components/kube-object-details/kube-object-detail-items/implementations/cron-job-detail-item.injectable.ts create mode 100644 src/renderer/components/kube-object-details/kube-object-detail-items/implementations/custom-resource-definitions-detail-item.injectable.ts create mode 100644 src/renderer/components/kube-object-details/kube-object-detail-items/implementations/daemon-set-detail-item.injectable.ts create mode 100644 src/renderer/components/kube-object-details/kube-object-detail-items/implementations/deployment-detail-item.injectable.ts create mode 100644 src/renderer/components/kube-object-details/kube-object-detail-items/implementations/endpoints-detail-item.injectable.ts create mode 100644 src/renderer/components/kube-object-details/kube-object-detail-items/implementations/events-detail-item.injectable.ts create mode 100644 src/renderer/components/kube-object-details/kube-object-detail-items/implementations/horizontal-pod-autoscaler-detail-item.injectable.ts create mode 100644 src/renderer/components/kube-object-details/kube-object-detail-items/implementations/ingress-detail-item.injectable.ts create mode 100644 src/renderer/components/kube-object-details/kube-object-detail-items/implementations/job-detail-item.injectable.ts create mode 100644 src/renderer/components/kube-object-details/kube-object-detail-items/implementations/kube-event-detail-item.injectable.ts create mode 100644 src/renderer/components/kube-object-details/kube-object-detail-items/implementations/limit-range-detail-item.injectable.ts create mode 100644 src/renderer/components/kube-object-details/kube-object-detail-items/implementations/namespaces-detail-item.injectable.ts create mode 100644 src/renderer/components/kube-object-details/kube-object-detail-items/implementations/network-policy-detail-item.injectable.ts create mode 100644 src/renderer/components/kube-object-details/kube-object-detail-items/implementations/node-detail-item.injectable.ts create mode 100644 src/renderer/components/kube-object-details/kube-object-detail-items/implementations/persistent-volume-claim-detail-item.injectable.ts create mode 100644 src/renderer/components/kube-object-details/kube-object-detail-items/implementations/persistent-volume-detail-item.injectable.ts create mode 100644 src/renderer/components/kube-object-details/kube-object-detail-items/implementations/pod-detail-item.injectable.ts create mode 100644 src/renderer/components/kube-object-details/kube-object-detail-items/implementations/pod-disruption-budget-detail-item.injectable.ts create mode 100644 src/renderer/components/kube-object-details/kube-object-detail-items/implementations/pod-security-policy-detail-item.injectable.ts create mode 100644 src/renderer/components/kube-object-details/kube-object-detail-items/implementations/replica-set-detail-item.injectable.ts create mode 100644 src/renderer/components/kube-object-details/kube-object-detail-items/implementations/resource-quota-detail-item.injectable.ts create mode 100644 src/renderer/components/kube-object-details/kube-object-detail-items/implementations/role-binding-detail-item.injectable.ts create mode 100644 src/renderer/components/kube-object-details/kube-object-detail-items/implementations/role-detail-item.injectable.ts create mode 100644 src/renderer/components/kube-object-details/kube-object-detail-items/implementations/secrets-detail-item.injectable.ts create mode 100644 src/renderer/components/kube-object-details/kube-object-detail-items/implementations/service-account-detail-item.injectable.ts create mode 100644 src/renderer/components/kube-object-details/kube-object-detail-items/implementations/service-detail-item.injectable.ts create mode 100644 src/renderer/components/kube-object-details/kube-object-detail-items/implementations/stateful-set-detail-item.injectable.ts create mode 100644 src/renderer/components/kube-object-details/kube-object-detail-items/implementations/storage-class-detail-item.injectable.ts create mode 100644 src/renderer/components/kube-object-details/kube-object-detail-items/kube-object-detail-item-injection-token.ts create mode 100644 src/renderer/components/kube-object-details/kube-object-detail-items/kube-object-detail-item-registrator.injectable.ts create mode 100644 src/renderer/components/kube-object-details/kube-object-detail-items/kube-object-detail-items.injectable.ts create mode 100644 src/renderer/components/kube-object-details/kube-object-detail-items/kube-object-matches-to-kind-and-api-version.ts create mode 100644 src/renderer/components/kube-object-details/kube-object-detail-registration.ts delete mode 100644 src/renderer/initializers/kube-object-detail-registry.tsx diff --git a/src/behaviours/cluster/kube-object-details/extension-api/__snapshots__/disable-kube-object-detail-items-when-cluster-is-not-relevant.test.tsx.snap b/src/behaviours/cluster/kube-object-details/extension-api/__snapshots__/disable-kube-object-detail-items-when-cluster-is-not-relevant.test.tsx.snap new file mode 100644 index 0000000000000..84e061457ebdd --- /dev/null +++ b/src/behaviours/cluster/kube-object-details/extension-api/__snapshots__/disable-kube-object-detail-items-when-cluster-is-not-relevant.test.tsx.snap @@ -0,0 +1,1427 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`disable kube object detail items when cluster is not relevant given extension should be enabled for the cluster, when navigating renders 1`] = ` + +
+
+
+