This is an automated email from the ASF dual-hosted git repository.

arshad pushed a commit to branch frontend-refactor
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/frontend-refactor by this push:
     new f0f73dcd9d AMBARI-26382: Ambari Web React: Kerberos Wizard - Step7: 
kerberize cluster, Step8: Start & Test Services (#4059)
f0f73dcd9d is described below

commit f0f73dcd9d7e1ce8158cec0899b5ccc19f4e9e4c
Author: Sandeep  Kumar <[email protected]>
AuthorDate: Tue Sep 9 14:24:41 2025 +0530

    AMBARI-26382: Ambari Web React: Kerberos Wizard - Step7: kerberize cluster, 
Step8: Start & Test Services (#4059)
    
    * AMBARI-26381: Ambari Web React: Kerberos Wizard - Step7 Kerberize Cluster
    
    * AMBARI-26382: Ambari Web React: Kerberos Wizard - Step8: Start and Test 
Services
---
 .../screens/KerberosWizard/KerberizeCluster.tsx    | 123 ++++++++++++++++++++
 .../KerberosWizard/StartAndTestServices.tsx        | 128 +++++++++++++++++++++
 .../screens/KerberosWizard/kerberosWizardSteps.tsx |   6 +-
 3 files changed, 255 insertions(+), 2 deletions(-)

diff --git a/ambari-web/latest/src/screens/KerberosWizard/KerberizeCluster.tsx 
b/ambari-web/latest/src/screens/KerberosWizard/KerberizeCluster.tsx
new file mode 100644
index 0000000000..58109a1f87
--- /dev/null
+++ b/ambari-web/latest/src/screens/KerberosWizard/KerberizeCluster.tsx
@@ -0,0 +1,123 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { useContext, useEffect, useState } from "react";
+import { AppContext } from "../../store/context";
+import { Alert } from "react-bootstrap";
+import { translate } from "../../Utils/Utility";
+import { get } from "lodash";
+// import useKDCSessionState from "../../hooks/useKDCSessionState";
+import { EnableKerberosContext } from "./KerberosStore/context";
+import { RequestApi } from "../../api/requestApi";
+import OperationsProgress from "../../components/OperationProgress";
+import { ActionTypes } from "./KerberosStore/types";
+import WizardFooter from "../../components/StepWizard/WizardFooter";
+
+function KerberizeCluster() {
+  const {
+    state,
+    dispatch,
+    flushStateToDb,
+    onExitPopUp,
+    stepWizardUtilities: { currentStep, wizardSteps, handleNextImperitive, 
handleBackImperitive},
+  } = useContext(EnableKerberosContext);
+
+  const [completionStatus, setCompletionStatus] = useState(false);
+  const [nextEnabled, setNextEnabled] = useState(false);
+  const { clusterName } = useContext(AppContext);
+  // const { getKDCSessionState } = useKDCSessionState(() => {});
+
+  useEffect(() => {
+    if (completionStatus) {
+      setNextEnabled(true);
+    }
+  }, [completionStatus]);
+
+  const operations = [
+    {
+      id: "1",
+      label: "Preparing Operations",
+      skippable: false,
+      context: "Preparing Operations",
+      callback: async () => {
+        // return new Promise((resolve) => {
+          // getKDCSessionState(async () => {
+            const preparingOperationsPayload = {
+              Clusters: {
+                security_type: "KERBEROS",
+              },
+            };
+            const requestData = await RequestApi.preparingOperations(
+              clusterName,
+              preparingOperationsPayload
+            );
+            // resolve(requestData);
+            return requestData;
+          // });
+        // });
+      },
+    },
+  ];
+  return (
+    <>
+      { completionStatus &&
+        <Alert 
variant="success">{translate("admin.kerberos.wizard.step7.notice.completed")}</Alert>
+      }
+      <OperationsProgress
+        operations={
+          (get(
+            state,
+            `kerberosWizardSteps.${wizardSteps[7].name}.data.operationsState`,
+            
+          ) as any) ||
+          (operations as any)}
+        title="Kerberize Cluster"
+        description="Kerberize Cluster"
+        setCompletionStatus={setCompletionStatus}
+        dispatch={(operationsState: any) => {
+          dispatch({
+            type: ActionTypes.STORE_INFORMATION,
+            payload: {
+              step: currentStep.name,
+              data: {
+                operationsState,
+              },
+            },
+          });
+        }}
+      />
+      <WizardFooter
+        isNextEnabled={nextEnabled}
+        step={currentStep}
+        onNext={() => {
+          flushStateToDb("next");
+          handleNextImperitive();
+        }}
+        onCancel={() => {
+          onExitPopUp(true, false);
+        }}
+        onBack={() => {
+          flushStateToDb("back");
+          handleBackImperitive();
+        }}
+      />
+    </>
+  );
+}
+
+export default KerberizeCluster;
\ No newline at end of file
diff --git 
a/ambari-web/latest/src/screens/KerberosWizard/StartAndTestServices.tsx 
b/ambari-web/latest/src/screens/KerberosWizard/StartAndTestServices.tsx
new file mode 100644
index 0000000000..a3189a36fd
--- /dev/null
+++ b/ambari-web/latest/src/screens/KerberosWizard/StartAndTestServices.tsx
@@ -0,0 +1,128 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { useContext, useEffect, useState } from "react";
+import { AppContext } from "../../store/context";
+import { Alert } from "react-bootstrap";
+import { translate } from "../../Utils/Utility";
+import { get } from "lodash";
+import { useNavigate } from "react-router";
+import { RequestApi } from "../../api/requestApi";
+import OperationsProgress from "../../components/OperationProgress";
+import WizardFooter from "../../components/StepWizard/WizardFooter";
+import { EnableKerberosContext } from "./KerberosStore/context";
+import { ActionTypes } from "./KerberosStore/types";
+
+function StartAndTestServices() {
+
+  const {
+    state,
+    dispatch,
+    flushStateToDb,
+    stepWizardUtilities: { wizardSteps, currentStep, handleBackImperitive},
+  } = useContext(EnableKerberosContext);
+
+  const [completionStatus, setCompletionStatus] = useState(false);
+  const [ nextEnabled, setNextEnabled ] = useState(false)
+  const { clusterName } = useContext(AppContext);
+  const navigate = useNavigate();
+  
+  useEffect(()=>{
+    if(completionStatus){
+      setNextEnabled(true);
+    }
+  },[completionStatus])
+
+  const operations = [
+    {
+      id: "1",
+      label: "Start And Test Services",
+      skippable: false,
+      context: "Start services",
+      callback: async () => {
+        const startAndTestServicesPayload = {
+            "RequestInfo": {
+                "context": "Start services",
+                "operation_level": {
+                    "level": "CLUSTER",
+                    "cluster_name": `${clusterName}`
+                }
+            },
+            "Body": {
+                "ServiceInfo": {
+                    "state": "STARTED"
+                }
+            }
+        };
+        const requestData = await RequestApi.startServices(
+          clusterName,
+          startAndTestServicesPayload,
+          "run_smoke_test=true"
+        );
+        return requestData;
+      },
+    },
+  ];
+
+  return (
+    <>
+      { completionStatus &&
+        <Alert 
variant="success">{translate("admin.kerberos.wizard.step8.notice.completed")}</Alert>
+      }
+      <OperationsProgress
+        operations={
+          (get(
+            state,
+            `kerberosWizardSteps.${wizardSteps[8].name}.data.operationsState`,
+            null
+          ) as any) ||
+          (operations as any)}
+        title="Start And Test Services"
+        description="Start and Test Services"
+        setCompletionStatus={setCompletionStatus}
+        dispatch={(operationsState: any) => {
+          dispatch({
+            type: ActionTypes.STORE_INFORMATION,
+            payload: {
+              step: currentStep.name,
+              data: {
+                operationsState,
+              },
+            },
+          });
+        }}
+      />
+      <WizardFooter
+        isNextEnabled={nextEnabled}
+        step={currentStep}
+        onNext={() => {
+          navigate(`/main/admin/kerberos/`);
+        }}
+        onCancel={() => {
+          navigate(`/main/admin/kerberos/`);
+        }}
+        onBack={() => {
+          flushStateToDb("back");
+          handleBackImperitive();
+        }}
+      />
+    </>
+  );
+}
+
+export default StartAndTestServices;
\ No newline at end of file
diff --git 
a/ambari-web/latest/src/screens/KerberosWizard/kerberosWizardSteps.tsx 
b/ambari-web/latest/src/screens/KerberosWizard/kerberosWizardSteps.tsx
index 11fcd78e48..aa6f4786e2 100644
--- a/ambari-web/latest/src/screens/KerberosWizard/kerberosWizardSteps.tsx
+++ b/ambari-web/latest/src/screens/KerberosWizard/kerberosWizardSteps.tsx
@@ -18,6 +18,8 @@
 
 import StartAndTestKerberosClient from "./StartAndTestKerberosClient";
 import StopServices from "./StopServices";
+import KerberizeCluster from "./KerberizeCluster";
+import StartAndTestServices from "./StartAndTestServices";
 
 export default {
   1: {
@@ -107,7 +109,7 @@ export default {
   7: {
     label: "Kerberize cluster",
     completed: false,
-    Component: <h1>Kerberize cluster</h1>,
+    Component: <KerberizeCluster />,
     canGoBack: true,
     isNextEnabled: false,
     name: "KERBERIZE_CLUSTER",
@@ -116,7 +118,7 @@ export default {
   8: {
     label: "Start and Test Services",
     completed: false,
-    Component: <h1>Start and Test Services</h1>,
+    Component: <StartAndTestServices />,
     canGoBack: true,
     isNextEnabled: false,
     name: "START_AND_TEST_SERVICES",


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to