From a1739150c88e1c52ac8ed02edd640e1a0ffa30bf Mon Sep 17 00:00:00 2001 From: Janne Savolainen Date: Tue, 12 Jul 2022 21:26:50 +0300 Subject: [PATCH] Introduce kludge to make "isEnabledForCluster" work again for kube object status texts PART 3 (#5802) * Kludge "isEnabledForCluster" work again for kube object status texts Signed-off-by: Janne Savolainen * Kludge "isEnabledForCluster" work again for kube object menu items (#5803) Signed-off-by: Janne Savolainen --- ...when-cluster-is-not-relevant.test.tsx.snap | 1189 +++++++++++++++++ ...tems-when-cluster-is-not-relevant.test.tsx | 165 +++ ...when-cluster-is-not-relevant.test.tsx.snap | 1181 ++++++++++++++++ ...uses-when-cluster-is-not-relevant.test.tsx | 160 +++ .../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 +- .../kube-object-status-icon.test.tsx | 126 +- .../kube-object-status-icon.tsx | 11 +- ...kube-object-status-text-injection-token.ts | 20 + ...ject-status-text-registrator.injectable.ts | 55 + ...ject-status-texts-for-object.injectable.ts | 42 + .../kube-object-status-texts.injectable.ts | 23 + .../status-registrations.injectable.ts | 21 - .../statuses-for-kube-object.injectable.ts | 35 - 24 files changed, 3184 insertions(+), 276 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 create mode 100644 src/behaviours/cluster/kube-object-status-icon/extension-api/__snapshots__/disable-kube-object-statuses-when-cluster-is-not-relevant.test.tsx.snap create mode 100644 src/behaviours/cluster/kube-object-status-icon/extension-api/disable-kube-object-statuses-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 create mode 100644 src/renderer/components/kube-object-status-icon/kube-object-status-text-injection-token.ts create mode 100644 src/renderer/components/kube-object-status-icon/kube-object-status-text-registrator.injectable.ts create mode 100644 src/renderer/components/kube-object-status-icon/kube-object-status-texts-for-object.injectable.ts create mode 100644 src/renderer/components/kube-object-status-icon/kube-object-status-texts.injectable.ts delete mode 100644 src/renderer/components/kube-object-status-icon/status-registrations.injectable.ts delete mode 100644 src/renderer/components/kube-object-status-icon/statuses-for-kube-object.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..9d116616fd19 --- /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 renders 1`] = ` + +
+
+
+