From 6d0bda5e2e081de04b73f2ce020bc3ea8a0c05b5 Mon Sep 17 00:00:00 2001 From: Janne Savolainen Date: Wed, 6 Jul 2022 16:40:37 +0300 Subject: [PATCH] Kludge "isEnabledForCluster" work again for kube object menu items Signed-off-by: Janne Savolainen --- ...when-cluster-is-not-relevant.test.tsx.snap | 1189 +++++++++++++++++ ...tems-when-cluster-is-not-relevant.test.tsx | 165 +++ .../get-kube-object-menu-items.ts | 31 - .../kube-object-menu-items.injectable.ts | 22 - .../static-kube-object-menu-items.ts | 39 - .../kube-object-menu-item-injection-token.ts | 25 + ...object-menu-item-registrator.injectable.ts | 59 + .../kube-object-menu-items.injectable.ts | 43 + .../cron-job-menu.injectable.ts | 25 + .../deployment-menu.injectable.ts | 25 + .../replica-set-menu.injectable.ts | 25 + .../service-account-menu.injectable.ts | 25 + .../kube-object-menu.test.tsx | 102 +- .../kube-object-menu/kube-object-menu.tsx | 11 +- 14 files changed, 1639 insertions(+), 147 deletions(-) create mode 100644 src/behaviours/cluster/kube-object-menu/extension-api/__snapshots__/disable-kube-object-menu-items-when-cluster-is-not-relevant.test.tsx.snap create mode 100644 src/behaviours/cluster/kube-object-menu/extension-api/disable-kube-object-menu-items-when-cluster-is-not-relevant.test.tsx delete mode 100644 src/renderer/components/kube-object-menu/dependencies/kube-object-menu-items/get-kube-object-menu-items.ts delete mode 100644 src/renderer/components/kube-object-menu/dependencies/kube-object-menu-items/kube-object-menu-items.injectable.ts delete mode 100644 src/renderer/components/kube-object-menu/dependencies/static-kube-object-menu-items.ts create mode 100644 src/renderer/components/kube-object-menu/kube-object-menu-item-injection-token.ts create mode 100644 src/renderer/components/kube-object-menu/kube-object-menu-item-registrator.injectable.ts create mode 100644 src/renderer/components/kube-object-menu/kube-object-menu-items.injectable.ts create mode 100644 src/renderer/components/kube-object-menu/kube-object-menu-items/cron-job-menu.injectable.ts create mode 100644 src/renderer/components/kube-object-menu/kube-object-menu-items/deployment-menu.injectable.ts create mode 100644 src/renderer/components/kube-object-menu/kube-object-menu-items/replica-set-menu.injectable.ts create mode 100644 src/renderer/components/kube-object-menu/kube-object-menu-items/service-account-menu.injectable.ts diff --git a/src/behaviours/cluster/kube-object-menu/extension-api/__snapshots__/disable-kube-object-menu-items-when-cluster-is-not-relevant.test.tsx.snap b/src/behaviours/cluster/kube-object-menu/extension-api/__snapshots__/disable-kube-object-menu-items-when-cluster-is-not-relevant.test.tsx.snap new file mode 100644 index 000000000000..0100e6de1011 --- /dev/null +++ b/src/behaviours/cluster/kube-object-menu/extension-api/__snapshots__/disable-kube-object-menu-items-when-cluster-is-not-relevant.test.tsx.snap @@ -0,0 +1,1189 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`disable kube object menu items when cluster is not relevant given extension should be enabled for the cluster, when navigating renders 1`] = ` + +
+
+
+