From 0bbdbfd17ea028fb992aca25d591840eb3a03695 Mon Sep 17 00:00:00 2001
From: Jean-Louis Leysens <jloleysens@gmail.com>
Date: Wed, 22 Jan 2025 12:37:37 +0100
Subject: [PATCH] prevent the cloud upgrade CTA button from being disabled on
 8.17.2+

---
 .../overview/upgrade_step/upgrade_step.test.tsx            | 7 +++++--
 .../components/overview/upgrade_step/upgrade_step.tsx      | 5 +++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/x-pack/plugins/upgrade_assistant/__jest__/client_integration/overview/upgrade_step/upgrade_step.test.tsx b/x-pack/plugins/upgrade_assistant/__jest__/client_integration/overview/upgrade_step/upgrade_step.test.tsx
index 1681ec7c89291..1dd085a700e5d 100644
--- a/x-pack/plugins/upgrade_assistant/__jest__/client_integration/overview/upgrade_step/upgrade_step.test.tsx
+++ b/x-pack/plugins/upgrade_assistant/__jest__/client_integration/overview/upgrade_step/upgrade_step.test.tsx
@@ -63,7 +63,7 @@ describe('Overview - Upgrade Step', () => {
       );
     });
 
-    test('When not ready for upgrade, the CTA button is disabled', async () => {
+    test('When not ready for upgrade on 8.17, the CTA button is still enabled', async () => {
       httpRequestsMockHelpers.setGetUpgradeStatusResponse({
         readyForUpgrade: false,
         details: 'Resolve critical deprecations first',
@@ -76,7 +76,10 @@ describe('Overview - Upgrade Step', () => {
       expect(exists('upgradeSetupDocsLink')).toBe(true);
       expect(exists('upgradeSetupCloudLink')).toBe(true);
 
-      expect(find('upgradeSetupCloudLink').props().disabled).toBe(true);
+      expect(find('upgradeSetupCloudLink').props().disabled).toBeFalsy();
+      expect(find('upgradeSetupCloudLink').props().href).toBe(
+        `${DEPLOYMENT_URL}?show_upgrade=true`
+      );
     });
 
     test('An error callout is displayed, if status check failed', async () => {
diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/overview/upgrade_step/upgrade_step.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/overview/upgrade_step/upgrade_step.tsx
index 4dba2ff92f1df..c4a535de2292d 100644
--- a/x-pack/plugins/upgrade_assistant/public/application/components/overview/upgrade_step/upgrade_step.tsx
+++ b/x-pack/plugins/upgrade_assistant/public/application/components/overview/upgrade_step/upgrade_step.tsx
@@ -87,7 +87,8 @@ const UpgradeStep = () => {
         </EuiCallOut>
       );
     } else {
-      const readyForUpgrade = upgradeStatus?.readyForUpgrade;
+      // Should re-enable this behaviour on 8.18 and 8.19
+      // const readyForUpgrade = upgradeStatus?.readyForUpgrade;
       const upgradeOnCloudUrl = cloud!.deploymentUrl + '?show_upgrade=true';
       callToAction = (
         <EuiFlexGroup alignItems="center" gutterSize="s">
@@ -99,7 +100,7 @@ const UpgradeStep = () => {
               iconSide="right"
               iconType="popout"
               isLoading={isLoading}
-              isDisabled={!readyForUpgrade}
+              // isDisabled={!readyForUpgrade}
             >
               {isLoading ? i18nTexts.loadingUpgradeStatus : i18nTexts.upgradeStepCloudLink}
             </EuiButton>