From 8e22060af846ba13a50111c6036b7a5439a8e14d Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Tue, 18 Jun 2024 18:46:09 +0530 Subject: [PATCH 01/65] Updating the stepper --- src/renderer/components/common/Stepper.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/components/common/Stepper.tsx b/src/renderer/components/common/Stepper.tsx index d3402ccd..aa75fa7d 100644 --- a/src/renderer/components/common/Stepper.tsx +++ b/src/renderer/components/common/Stepper.tsx @@ -176,7 +176,7 @@ export default function HorizontalLinearStepper({stages, initialization}:{stages const getStepIcon = (error: any, stageId: number, isSubStep?: boolean, subStepId?: number) => { - if (!error || (isSubStep && getProgress(stages[stageId].subStages[subStepId].statusKey)) || (!isSubStep && getProgress(stages[stageId].statusKey))) { + if ((isSubStep && getProgress(stages[stageId].subStages[subStepId].statusKey)) || (!isSubStep && getProgress(stages[stageId].statusKey))) { return } />; } From 79cff237c77145a11e9aadec1fc47b701bcdb3ab Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Tue, 18 Jun 2024 18:46:43 +0530 Subject: [PATCH 02/65] Passthrough --- src/renderer/components/stages/installation/Installation.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/renderer/components/stages/installation/Installation.tsx b/src/renderer/components/stages/installation/Installation.tsx index 684f8ed6..99d0a50f 100644 --- a/src/renderer/components/stages/installation/Installation.tsx +++ b/src/renderer/components/stages/installation/Installation.tsx @@ -173,6 +173,7 @@ const Installation = () => { }) dispatch(setNextStepEnabled(getProgress('datasetInstallationStatus'))); + dispatch(setNextStepEnabled(true)); if(installationType === 'smpe') { const status = getProgress('datasetInstallationStatus'); From f86dfc4a71c7bd8f260727f8972b2b37260804db Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Mon, 24 Jun 2024 09:47:12 +0530 Subject: [PATCH 03/65] regression fix --- src/renderer/components/common/Stepper.tsx | 9 ++- .../components/stages/Certificates.tsx | 4 +- .../components/stages/InitApfAuth.tsx | 4 +- src/renderer/components/stages/Security.tsx | 4 +- src/renderer/components/stages/Stcs.tsx | 4 +- src/renderer/components/stages/Unpax.tsx | 19 +++-- src/renderer/components/stages/Vsam.tsx | 4 +- .../stages/connection/Connection.tsx | 4 +- .../stages/installation/Installation.tsx | 4 +- .../stages/progress/StageProgressStatus.ts | 76 ++++++++++++++++--- src/services/StageDetails.ts | 22 +++++- src/types/stateInterfaces.ts | 11 ++- 12 files changed, 126 insertions(+), 39 deletions(-) diff --git a/src/renderer/components/common/Stepper.tsx b/src/renderer/components/common/Stepper.tsx index aa75fa7d..d6e0b125 100644 --- a/src/renderer/components/common/Stepper.tsx +++ b/src/renderer/components/common/Stepper.tsx @@ -28,7 +28,7 @@ import eventDispatcher from '../../../services/eventDispatcher'; import Warning from '@mui/icons-material/Warning'; import CheckCircle from '@mui/icons-material/CheckCircle'; import { TYPE_YAML, TYPE_OUTPUT, TYPE_JCL, INIT_STAGE_LABEL, REVIEW_INSTALL_STAGE_LABEL } from '../common/Constants'; -import { getProgress, getCompleteProgress, mapAndSetSkipStatus, mapAndGetSkipStatus } from '../stages/progress/StageProgressStatus'; +import { getProgress, getCompleteProgress, mapAndSetSubStepSkipStatus, mapAndGetSubStepSkipStatus, mapAndSetStepSkipStatus, mapAndGetStepSkipStatus } from '../stages/progress/StageProgressStatus'; import '../../styles/Stepper.css'; import { StepIcon } from '@mui/material'; @@ -123,9 +123,10 @@ export default function HorizontalLinearStepper({stages, initialization}:{stages const handleSkip = () => { stages[activeStep].isSkipped = true; + mapAndSetStepSkipStatus(activeStep, true); if(stages[activeStep].subStages){ stages[activeStep].subStages[activeSubStep].isSkipped = true; - mapAndSetSkipStatus(activeSubStep, true); + mapAndSetSubStepSkipStatus(activeSubStep, true); } handleNext(); } @@ -176,11 +177,11 @@ export default function HorizontalLinearStepper({stages, initialization}:{stages const getStepIcon = (error: any, stageId: number, isSubStep?: boolean, subStepId?: number) => { - if ((isSubStep && getProgress(stages[stageId].subStages[subStepId].statusKey)) || (!isSubStep && getProgress(stages[stageId].statusKey))) { + if ((isSubStep && getProgress(stages[stageId].subStages[subStepId].statusKey)) || (!isSubStep && ((stageId == 0 && connectionStatus) || (getProgress(stages[stageId].statusKey))))) { return } />; } - if ((isSubStep && mapAndGetSkipStatus(subStepId)) || (error && activeStep>stageId && !isSubStep) || (error && isSubStep && stages[stageId].subStages[subStepId].isSkipped)) { + if ((isSubStep && mapAndGetSubStepSkipStatus(subStepId)) || (!isSubStep && mapAndGetStepSkipStatus(stageId))) { return } />; } diff --git a/src/renderer/components/stages/Certificates.tsx b/src/renderer/components/stages/Certificates.tsx index 9990a267..ec13adbf 100644 --- a/src/renderer/components/stages/Certificates.tsx +++ b/src/renderer/components/stages/Certificates.tsx @@ -26,7 +26,7 @@ import { createTheme } from '@mui/material/styles'; import { stages } from "../configuration-wizard/Wizard"; import { setActiveStep } from "./progress/activeStepSlice"; import { getStageDetails, getSubStageDetails } from "../../../services/StageDetails"; -import { setProgress, getProgress, setCertificateInitState, getCertificateInitState, mapAndSetSkipStatus, getInstallationArguments } from "./progress/StageProgressStatus"; +import { setProgress, getProgress, setCertificateInitState, getCertificateInitState, mapAndSetSubStepSkipStatus, getInstallationArguments } from "./progress/StageProgressStatus"; import { CertInitSubStepsState } from "../../../types/stateInterfaces"; import { TYPE_YAML, TYPE_JCL, TYPE_OUTPUT, FALLBACK_YAML, FALLBACK_SCHEMA } from "../common/Constants"; @@ -175,7 +175,7 @@ const Certificates = () => { const setStageSkipStatus = (status: boolean) => { stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped = status; stages[STAGE_ID].isSkipped = status; - mapAndSetSkipStatus(SUB_STAGE_ID, status); + mapAndSetSubStepSkipStatus(SUB_STAGE_ID, status); } const updateProgress = (status: boolean) => { diff --git a/src/renderer/components/stages/InitApfAuth.tsx b/src/renderer/components/stages/InitApfAuth.tsx index e59ba015..e57ca10d 100644 --- a/src/renderer/components/stages/InitApfAuth.tsx +++ b/src/renderer/components/stages/InitApfAuth.tsx @@ -25,7 +25,7 @@ import { alertEmitter } from "../Header"; import { stages } from "../configuration-wizard/Wizard"; import { setActiveStep, selectActiveStepIndex, selectActiveSubStepIndex, selectIsSubstep } from "./progress/activeStepSlice"; import { getStageDetails, getSubStageDetails } from "../../../services/StageDetails"; -import { setProgress, getProgress, setApfAuthState, getApfAuthState, mapAndSetSkipStatus, getInstallationArguments } from "./progress/StageProgressStatus"; +import { setProgress, getProgress, setApfAuthState, getApfAuthState, mapAndSetSubStepSkipStatus, getInstallationArguments } from "./progress/StageProgressStatus"; import { InitSubStepsState } from "../../../types/stateInterfaces"; import { JCL_UNIX_SCRIPT_OK, FALLBACK_SCHEMA, FALLBACK_YAML } from "../common/Constants"; @@ -173,7 +173,7 @@ const InitApfAuth = () => { const setStageSkipStatus = (status: boolean) => { stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped = status; stages[STAGE_ID].isSkipped = status; - mapAndSetSkipStatus(SUB_STAGE_ID, status); + mapAndSetSubStepSkipStatus(SUB_STAGE_ID, status); } const updateProgress = (status: boolean) => { diff --git a/src/renderer/components/stages/Security.tsx b/src/renderer/components/stages/Security.tsx index 72f86060..d4dd5637 100644 --- a/src/renderer/components/stages/Security.tsx +++ b/src/renderer/components/stages/Security.tsx @@ -26,7 +26,7 @@ import { createTheme } from '@mui/material/styles'; import { stages } from "../configuration-wizard/Wizard"; import { setActiveStep } from "./progress/activeStepSlice"; import { getStageDetails, getSubStageDetails } from "../../../services/StageDetails"; -import { setProgress, getProgress, setSecurityInitState, getSecurityInitState, mapAndSetSkipStatus, getInstallationArguments } from "./progress/StageProgressStatus"; +import { setProgress, getProgress, setSecurityInitState, getSecurityInitState, mapAndSetSubStepSkipStatus, getInstallationArguments } from "./progress/StageProgressStatus"; import { InitSubStepsState } from "../../../types/stateInterfaces"; import { JCL_UNIX_SCRIPT_OK, FALLBACK_SCHEMA, FALLBACK_YAML } from '../common/Constants'; import { alertEmitter } from "../Header"; @@ -173,7 +173,7 @@ const Security = () => { const setStageSkipStatus = (status: boolean) => { stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped = status; stages[STAGE_ID].isSkipped = status; - mapAndSetSkipStatus(SUB_STAGE_ID, status); + mapAndSetSubStepSkipStatus(SUB_STAGE_ID, status); } const updateProgress = (status: boolean) => { diff --git a/src/renderer/components/stages/Stcs.tsx b/src/renderer/components/stages/Stcs.tsx index 4890c935..4ab9c6ba 100644 --- a/src/renderer/components/stages/Stcs.tsx +++ b/src/renderer/components/stages/Stcs.tsx @@ -23,7 +23,7 @@ import { createTheme } from '@mui/material/styles'; import { stages } from "../configuration-wizard/Wizard"; import { setActiveStep } from "./progress/activeStepSlice"; import { getStageDetails, getSubStageDetails } from "../../../services/StageDetails"; -import { getProgress, setStcsInitState, getStcsInitState, mapAndSetSkipStatus, getInstallationArguments } from "./progress/StageProgressStatus"; +import { getProgress, setStcsInitState, getStcsInitState, mapAndSetSubStepSkipStatus, getInstallationArguments } from "./progress/StageProgressStatus"; import { InitSubStepsState } from "../../../types/stateInterfaces"; import { alertEmitter } from "../Header"; import { FALLBACK_SCHEMA, FALLBACK_YAML } from "../common/Constants"; @@ -182,7 +182,7 @@ const Stcs = () => { const setStageSkipStatus = (status: boolean) => { stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped = status; stages[STAGE_ID].isSkipped = status; - mapAndSetSkipStatus(SUB_STAGE_ID, status); + mapAndSetSubStepSkipStatus(SUB_STAGE_ID, status); } const updateProgress = (status: boolean) => { diff --git a/src/renderer/components/stages/Unpax.tsx b/src/renderer/components/stages/Unpax.tsx index a925cf6f..fa706e10 100644 --- a/src/renderer/components/stages/Unpax.tsx +++ b/src/renderer/components/stages/Unpax.tsx @@ -19,7 +19,7 @@ import CheckCircle from '@mui/icons-material/CheckCircle'; import { setActiveStep } from "./progress/activeStepSlice"; import { getStageDetails } from "../../../services/StageDetails"; import { setDownloadUnpaxStatus } from './progress/progressSlice'; -import { downloadUnpaxStatus, getDownloadUnpaxState, getInstallationTypeStatus, getProgress, setDownloadUnpaxState } from "./progress/StageProgressStatus"; +import { downloadUnpaxStatus, getDownloadUnpaxState, getInstallationTypeStatus, getProgress, setDownloadUnpaxState, mapAndSetStepSkipStatus } from "./progress/StageProgressStatus"; import React from "react"; import ProgressCard from "../common/ProgressCard"; import { alertEmitter } from "../Header"; @@ -55,8 +55,7 @@ const Unpax = () => { setDownloadUnpaxProgress(res); setDownloadUnpaxState(res); if(stageComplete){ - dispatch(setNextStepEnabled(true)); - dispatch(setDownloadUnpaxStatus(true)); + setStageSkipStatus(true); clearInterval(timer); } }) @@ -69,10 +68,9 @@ const Unpax = () => { const process = (event: any) => { event.preventDefault(); + setStageSkipStatus(false); setShowProgress(true); - dispatch(setDownloadUnpaxStatus(false)); setDownloadUnpaxProgress(downloadUnpaxStatus); - dispatch(setNextStepEnabled(false)); window.electron.ipcRenderer.downloadButtonOnClick(connectionArgs, installationArgs, version, yaml).then((res: IResponse) => { if(!res.status){ //errors during runInstallation() alertEmitter.emit('showAlert', res.details, 'error'); @@ -81,12 +79,11 @@ const Unpax = () => { dispatch(setYaml(res.details.mergedYaml)); window.electron.ipcRenderer.setConfig(res.details.mergedYaml); } - dispatch(setNextStepEnabled(res.status)); - dispatch(setDownloadUnpaxStatus(res.status)); + setStageSkipStatus(res.status); clearInterval(timer); }).catch(() => { clearInterval(timer); - dispatch(setNextStepEnabled(false)); + setStageSkipStatus(false); }); } @@ -108,6 +105,12 @@ const Unpax = () => { } }, []); + const setStageSkipStatus = (status: boolean) => { + dispatch(setNextStepEnabled(status)); + dispatch(setDownloadUnpaxStatus(status)); + mapAndSetStepSkipStatus(STAGE_ID, !status); + } + return (<> {installValue === "smpe" && diff --git a/src/renderer/components/stages/Vsam.tsx b/src/renderer/components/stages/Vsam.tsx index 053f157c..37f13e62 100644 --- a/src/renderer/components/stages/Vsam.tsx +++ b/src/renderer/components/stages/Vsam.tsx @@ -25,7 +25,7 @@ import { createTheme } from '@mui/material/styles'; import { stages } from "../configuration-wizard/Wizard"; import { setActiveStep } from "./progress/activeStepSlice"; import { getStageDetails, getSubStageDetails } from "../../../services/StageDetails"; -import { setProgress, getProgress, setVsamInitState, mapAndSetSkipStatus, getInstallationArguments, getVsamInitState } from "./progress/StageProgressStatus"; +import { setProgress, getProgress, setVsamInitState, mapAndSetSubStepSkipStatus, getInstallationArguments, getVsamInitState } from "./progress/StageProgressStatus"; import { InitSubStepsState } from "../../../types/stateInterfaces"; import { alertEmitter } from "../Header"; @@ -159,7 +159,7 @@ const Vsam = () => { const setStageSkipStatus = (status: boolean) => { stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped = status; stages[STAGE_ID].isSkipped = status; - mapAndSetSkipStatus(SUB_STAGE_ID, status); + mapAndSetSubStepSkipStatus(SUB_STAGE_ID, status); } const updateProgress = (status: boolean) => { diff --git a/src/renderer/components/stages/connection/Connection.tsx b/src/renderer/components/stages/connection/Connection.tsx index 8c3a42c7..bb4f9839 100644 --- a/src/renderer/components/stages/connection/Connection.tsx +++ b/src/renderer/components/stages/connection/Connection.tsx @@ -33,7 +33,7 @@ import { setYaml, setSchema, setLoading, setNextStepEnabled, selectZoweCLIVersio import { setConnectionStatus, selectConnectionStatus} from '../progress/progressSlice'; import { Container } from "@mui/material"; import { alertEmitter } from "../../Header"; -import { getStageDetails, initStageSkipStatus } from "../../../../services/StageDetails"; +import { getStageDetails, initSubStageSkipStatus, initStageSkipStatus } from "../../../../services/StageDetails"; import { initializeProgress, getActiveStage } from "../progress/StageProgressStatus"; import eventDispatcher from "../../../../services/eventDispatcher"; import { FALLBACK_YAML, FALLBACK_SCHEMA } from "../../common/Constants"; @@ -137,7 +137,9 @@ const FTPConnectionForm = () => { dispatch(setConnectionStatus(res.status)); if(res.status) { dispatch(setNextStepEnabled(true)); + dispatch(setConnectionStatus(true)); initializeProgress(connectionArgs.host, connectionArgs.user); + initSubStageSkipStatus(); initStageSkipStatus(); setYamlAndConfig(); } diff --git a/src/renderer/components/stages/installation/Installation.tsx b/src/renderer/components/stages/installation/Installation.tsx index 99d0a50f..c1bb2484 100644 --- a/src/renderer/components/stages/installation/Installation.tsx +++ b/src/renderer/components/stages/installation/Installation.tsx @@ -27,7 +27,7 @@ import {stages} from "../../configuration-wizard/Wizard"; import { setActiveStep } from "../progress/activeStepSlice"; import { TYPE_YAML, TYPE_OUTPUT, TYPE_JCL, JCL_UNIX_SCRIPT_OK, FALLBACK_SCHEMA, FALLBACK_YAML } from '../../common/Constants'; import { getStageDetails, getSubStageDetails } from "../../../../services/StageDetails"; -import { setProgress, getProgress, setDatasetInstallationState, getDatasetInstallationState, getInstallationTypeStatus, mapAndSetSkipStatus, getInstallationArguments, datasetInstallationStatus } from "../progress/StageProgressStatus"; +import { setProgress, getProgress, setDatasetInstallationState, getDatasetInstallationState, getInstallationTypeStatus, mapAndSetSubStepSkipStatus, getInstallationArguments, datasetInstallationStatus } from "../progress/StageProgressStatus"; import { DatasetInstallationState } from "../../../../types/stateInterfaces"; import eventDispatcher from '../../../../services/eventDispatcher'; @@ -234,7 +234,7 @@ const Installation = () => { const setStageSkipStatus = (status: boolean) => { stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped = status; stages[STAGE_ID].isSkipped = status; - mapAndSetSkipStatus(SUB_STAGE_ID, status); + mapAndSetSubStepSkipStatus(SUB_STAGE_ID, status); } const updateProgress = (status: boolean) => { setStateUpdated(!stateUpdated); diff --git a/src/renderer/components/stages/progress/StageProgressStatus.ts b/src/renderer/components/stages/progress/StageProgressStatus.ts index de54efb9..a112205d 100644 --- a/src/renderer/components/stages/progress/StageProgressStatus.ts +++ b/src/renderer/components/stages/progress/StageProgressStatus.ts @@ -9,7 +9,7 @@ */ import { flatten, unflatten } from 'flat'; -import { ProgressState, PlanningState, InstallationType, ActiveState, DatasetInstallationState, InitSubStepsState, CertInitSubStepsState, PlanningValidationDetails, SkipState, InstallationArgs, DownloadUnpaxState} from '../../../../types/stateInterfaces'; +import { ProgressState, PlanningState, InstallationType, ActiveState, DatasetInstallationState, InitSubStepsState, CertInitSubStepsState, PlanningValidationDetails, subStepSkipState, stepSkipState, InstallationArgs, DownloadUnpaxState} from '../../../../types/stateInterfaces'; import { stages } from '../../configuration-wizard/Wizard'; const installationTypeStatus: InstallationType = { @@ -99,8 +99,7 @@ const planningValidationDetailsStatus: PlanningValidationDetails = { error: '' } -const stepSkipStatus: SkipState = { - downloadUnpax: false, +const subStepSkipStatus: subStepSkipState = { datasetInstallation: false, networking: false, apfAuth: false, @@ -110,6 +109,14 @@ const stepSkipStatus: SkipState = { launchConfig: false } +const stepSkipStatus: stepSkipState = { + planning: false, + installationType: false, + unpax: false, + initialization: false, + reviewInstallation: false +} + const installationArgsStatus: InstallationArgs = { installationDir: '', workspaceDir: '', @@ -143,10 +150,12 @@ let certificateKey = 'certificate_init'; let vsamKey = 'vsam_init'; let planningValidationDetailsKey = `planning_validation_details`; let prevInstallationKey = `prev_installation`; +let skipSubStateKey = `skip_sub_state`; let skipStateKey = `skip_state`; let installationArgsKey = `intallation_args`; -let skipKeysArray: (keyof SkipState)[] = Object.keys(stepSkipStatus) as (keyof SkipState)[]; +let subStepSkipKeysArray: (keyof subStepSkipState)[] = Object.keys(subStepSkipStatus) as (keyof subStepSkipState)[]; +let stepSkipKeysArray: (keyof stepSkipState)[] = Object.keys(stepSkipStatus) as (keyof stepSkipState)[]; const setKeys = (id: string) => { progressStateKey = `${progressStateKey}_${id}`; @@ -161,6 +170,7 @@ const setKeys = (id: string) => { certificateKey = `${certificateKey}_${id}`; vsamKey = `${vsamKey}_${id}`; planningValidationDetailsKey = `${planningValidationDetailsKey}_${id}`; + skipSubStateKey = `${skipSubStateKey}_${id}`; skipStateKey = `${skipStateKey}_${id}`; installationArgsKey = `${installationArgsKey}_${id}`; } @@ -241,6 +251,12 @@ export const initializeProgress = (host: string, user: string) => { localStorage.setItem(planningValidationDetailsKey, JSON.stringify(flattenedData)); } + const subStepSkipStatusState = localStorage.getItem(skipSubStateKey); + if(!subStepSkipStatusState) { + const flattenedData = flatten(subStepSkipStatus); + localStorage.setItem(skipSubStateKey, JSON.stringify(flattenedData)); + } + const stepSkipStatusState = localStorage.getItem(skipStateKey); if(!stepSkipStatusState) { const flattenedData = flatten(stepSkipStatus); @@ -254,14 +270,13 @@ export const initializeProgress = (host: string, user: string) => { } } -export const mapAndSetSkipStatus = (subStageId: number, value: boolean): void => { - setSubStageSkipStatus(skipKeysArray[subStageId], value); +export const mapAndSetSubStepSkipStatus = (subStageId: number, value: boolean): void => { + setSubStageSkipStatus(subStepSkipKeysArray[subStageId], value); } -export const mapAndGetSkipStatus = (subStageId: number): boolean => { +export const mapAndGetSubStepSkipStatus = (subStageId: number): boolean => { const skipStatus = getSubStageSkipStatus(); const skipStatusArray = [ - skipStatus.downloadUnpax, skipStatus.datasetInstallation, skipStatus.networking, skipStatus.apfAuth, @@ -274,11 +289,50 @@ export const mapAndGetSkipStatus = (subStageId: number): boolean => { return skipStatusArray[subStageId]; } -export const setSubStageSkipStatus = (key: keyof SkipState, newValue: boolean): void => { +export const mapAndSetStepSkipStatus = (stageId: number, value: boolean): void => { + setStageSkipStatus(stepSkipKeysArray[stageId-1], value); +} + +export const mapAndGetStepSkipStatus = (subStageId: number): boolean => { + const skipStatus = getStageSkipStatus(); + const skipStatusArray = [ + skipStatus.planning, + skipStatus.installationType, + skipStatus.unpax, + skipStatus.initialization, + skipStatus.reviewInstallation + ] + + return skipStatusArray[subStageId-1]; +} + +export const setSubStageSkipStatus = (key: keyof subStepSkipState, newValue: boolean): void => { + const skipStatus = localStorage.getItem(skipSubStateKey); + if (skipStatus) { + const flattenedData = JSON.parse(skipStatus); + const unFlattenedData = unflatten(flattenedData) as subStepSkipState; + Object.assign(subStepSkipStatus, unFlattenedData); + } + subStepSkipStatus[key] = newValue; + const flattenedData = flatten(subStepSkipStatus); + localStorage.setItem(skipSubStateKey, JSON.stringify(flattenedData)); +} + +export const getSubStageSkipStatus = () : subStepSkipState => { + const skipStatus = localStorage.getItem(skipSubStateKey); + if(skipStatus) { + const flattenedData = JSON.parse(skipStatus); + return unflatten(flattenedData); + } else { + return subStepSkipStatus; + } +} + +export const setStageSkipStatus = (key: keyof stepSkipState, newValue: boolean): void => { const skipStatus = localStorage.getItem(skipStateKey); if (skipStatus) { const flattenedData = JSON.parse(skipStatus); - const unFlattenedData = unflatten(flattenedData) as SkipState; + const unFlattenedData = unflatten(flattenedData) as stepSkipState; Object.assign(stepSkipStatus, unFlattenedData); } stepSkipStatus[key] = newValue; @@ -286,7 +340,7 @@ export const setSubStageSkipStatus = (key: keyof SkipState, newValue: boolean): localStorage.setItem(skipStateKey, JSON.stringify(flattenedData)); } -export const getSubStageSkipStatus = () : SkipState => { +export const getStageSkipStatus = () : stepSkipState => { const skipStatus = localStorage.getItem(skipStateKey); if(skipStatus) { const flattenedData = JSON.parse(skipStatus); diff --git a/src/services/StageDetails.ts b/src/services/StageDetails.ts index b8afb6b8..bf02f03a 100644 --- a/src/services/StageDetails.ts +++ b/src/services/StageDetails.ts @@ -8,7 +8,7 @@ * Copyright Contributors to the Zowe Project. */ -import { getSubStageSkipStatus } from '../renderer/components/stages/progress/StageProgressStatus'; +import { getStageSkipStatus, getSubStageSkipStatus } from '../renderer/components/stages/progress/StageProgressStatus'; import { stages } from '../renderer/components/configuration-wizard/Wizard'; export const getStageDetails = (stageLabel: string) => { @@ -25,6 +25,26 @@ export const getSubStageDetails = (stageId: number, subStageLabel: string) => { } export const initStageSkipStatus = (): void => { + const skipStatus = getStageSkipStatus(); + + const stageSkipStatus = [ + skipStatus.planning, + skipStatus.installationType, + skipStatus.unpax, + skipStatus.initialization, + skipStatus.reviewInstallation + ]; + + let iterator = 0; + stages.map(stage => { + if(stage.id !== 0) { + stage.isSkipped = stageSkipStatus[iterator]; + } + iterator++; + }) +} + +export const initSubStageSkipStatus = (): void => { const skipStatus = getSubStageSkipStatus(); const subStageSkipStatus = [ diff --git a/src/types/stateInterfaces.ts b/src/types/stateInterfaces.ts index 66bd97db..3a49f378 100644 --- a/src/types/stateInterfaces.ts +++ b/src/types/stateInterfaces.ts @@ -80,8 +80,15 @@ export interface PlanningValidationDetails { error: string } -export interface SkipState { - downloadUnpax: boolean, +export interface stepSkipState { + planning: boolean, + installationType: boolean, + unpax: boolean, + initialization: boolean, + reviewInstallation: boolean +} + +export interface subStepSkipState { datasetInstallation: boolean, networking: boolean, apfAuth: boolean, From 4f7ca4b9153f9adb8c602b4a9fdb08c9cd8c8a43 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Tue, 25 Jun 2024 17:29:00 +0530 Subject: [PATCH 04/65] Updating the stepper icon logic --- src/renderer/components/common/Stepper.tsx | 2 +- src/renderer/components/stages/progress/StageProgressStatus.ts | 1 + src/services/StageDetails.ts | 2 ++ src/types/stateInterfaces.ts | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/renderer/components/common/Stepper.tsx b/src/renderer/components/common/Stepper.tsx index 97ac54b3..4696620c 100644 --- a/src/renderer/components/common/Stepper.tsx +++ b/src/renderer/components/common/Stepper.tsx @@ -181,7 +181,7 @@ export default function HorizontalLinearStepper({stages, initialization}:{stages return } />; } - if ((isSubStep && mapAndGetSubStepSkipStatus(subStepId)) || (!isSubStep && mapAndGetStepSkipStatus(stageId))) { + if ((isSubStep && mapAndGetSubStepSkipStatus(subStepId) && stages[stageId].subStages[subStepId].isSkipped) || (!isSubStep && mapAndGetStepSkipStatus(stageId))) { return } />; } diff --git a/src/renderer/components/stages/progress/StageProgressStatus.ts b/src/renderer/components/stages/progress/StageProgressStatus.ts index a112205d..70262b09 100644 --- a/src/renderer/components/stages/progress/StageProgressStatus.ts +++ b/src/renderer/components/stages/progress/StageProgressStatus.ts @@ -104,6 +104,7 @@ const subStepSkipStatus: subStepSkipState = { networking: false, apfAuth: false, security: false, + stcs: false, certificate: false, vsam: false, launchConfig: false diff --git a/src/services/StageDetails.ts b/src/services/StageDetails.ts index bf02f03a..80bde377 100644 --- a/src/services/StageDetails.ts +++ b/src/services/StageDetails.ts @@ -52,7 +52,9 @@ export const initSubStageSkipStatus = (): void => { skipStatus.networking, skipStatus.apfAuth, skipStatus.security, + skipStatus.stcs, skipStatus.certificate, + skipStatus.vsam, skipStatus.launchConfig ]; diff --git a/src/types/stateInterfaces.ts b/src/types/stateInterfaces.ts index 3a49f378..a9fa1ed3 100644 --- a/src/types/stateInterfaces.ts +++ b/src/types/stateInterfaces.ts @@ -93,6 +93,7 @@ export interface subStepSkipState { networking: boolean, apfAuth: boolean, security: boolean, + stcs: boolean, certificate: boolean, vsam: boolean, launchConfig: boolean From f756077f7fbb4c4816fa5eaf67f6c7935f7cad38 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Tue, 25 Jun 2024 18:02:28 +0530 Subject: [PATCH 05/65] Removing the space --- src/renderer/components/common/Stepper.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/renderer/components/common/Stepper.tsx b/src/renderer/components/common/Stepper.tsx index 4696620c..c64a51db 100644 --- a/src/renderer/components/common/Stepper.tsx +++ b/src/renderer/components/common/Stepper.tsx @@ -64,8 +64,6 @@ export default function HorizontalLinearStepper({stages, initialization}:{stages completeProgress.launchConfigStatus ]) - - const [activeStep, setActiveStep] = initialization ? useState(0) : useState(useAppSelector(selectActiveStepIndex)); const [activeSubStep, setActiveSubStep] = initialization ? useState(0) : useState(useAppSelector(selectActiveSubStepIndex)); const [nextText, setNextText] = useState("Continue"); From 46d51422c603223e8f248217805a4f6ae99dbe31 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Tue, 25 Jun 2024 18:04:47 +0530 Subject: [PATCH 06/65] Updating the interface name --- .../stages/progress/StageProgressStatus.ts | 12 ++++++------ src/types/stateInterfaces.ts | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/renderer/components/stages/progress/StageProgressStatus.ts b/src/renderer/components/stages/progress/StageProgressStatus.ts index 70262b09..061f73db 100644 --- a/src/renderer/components/stages/progress/StageProgressStatus.ts +++ b/src/renderer/components/stages/progress/StageProgressStatus.ts @@ -9,7 +9,7 @@ */ import { flatten, unflatten } from 'flat'; -import { ProgressState, PlanningState, InstallationType, ActiveState, DatasetInstallationState, InitSubStepsState, CertInitSubStepsState, PlanningValidationDetails, subStepSkipState, stepSkipState, InstallationArgs, DownloadUnpaxState} from '../../../../types/stateInterfaces'; +import { ProgressState, PlanningState, InstallationType, ActiveState, DatasetInstallationState, InitSubStepsState, CertInitSubStepsState, PlanningValidationDetails, subStepState, stepSkipState, InstallationArgs, DownloadUnpaxState} from '../../../../types/stateInterfaces'; import { stages } from '../../configuration-wizard/Wizard'; const installationTypeStatus: InstallationType = { @@ -99,7 +99,7 @@ const planningValidationDetailsStatus: PlanningValidationDetails = { error: '' } -const subStepSkipStatus: subStepSkipState = { +const subStepSkipStatus: subStepState = { datasetInstallation: false, networking: false, apfAuth: false, @@ -155,7 +155,7 @@ let skipSubStateKey = `skip_sub_state`; let skipStateKey = `skip_state`; let installationArgsKey = `intallation_args`; -let subStepSkipKeysArray: (keyof subStepSkipState)[] = Object.keys(subStepSkipStatus) as (keyof subStepSkipState)[]; +let subStepSkipKeysArray: (keyof subStepState)[] = Object.keys(subStepSkipStatus) as (keyof subStepState)[]; let stepSkipKeysArray: (keyof stepSkipState)[] = Object.keys(stepSkipStatus) as (keyof stepSkipState)[]; const setKeys = (id: string) => { @@ -307,11 +307,11 @@ export const mapAndGetStepSkipStatus = (subStageId: number): boolean => { return skipStatusArray[subStageId-1]; } -export const setSubStageSkipStatus = (key: keyof subStepSkipState, newValue: boolean): void => { +export const setSubStageSkipStatus = (key: keyof subStepState, newValue: boolean): void => { const skipStatus = localStorage.getItem(skipSubStateKey); if (skipStatus) { const flattenedData = JSON.parse(skipStatus); - const unFlattenedData = unflatten(flattenedData) as subStepSkipState; + const unFlattenedData = unflatten(flattenedData) as subStepState; Object.assign(subStepSkipStatus, unFlattenedData); } subStepSkipStatus[key] = newValue; @@ -319,7 +319,7 @@ export const setSubStageSkipStatus = (key: keyof subStepSkipState, newValue: boo localStorage.setItem(skipSubStateKey, JSON.stringify(flattenedData)); } -export const getSubStageSkipStatus = () : subStepSkipState => { +export const getSubStageSkipStatus = () : subStepState => { const skipStatus = localStorage.getItem(skipSubStateKey); if(skipStatus) { const flattenedData = JSON.parse(skipStatus); diff --git a/src/types/stateInterfaces.ts b/src/types/stateInterfaces.ts index a9fa1ed3..2ce0defb 100644 --- a/src/types/stateInterfaces.ts +++ b/src/types/stateInterfaces.ts @@ -88,7 +88,7 @@ export interface stepSkipState { reviewInstallation: boolean } -export interface subStepSkipState { +export interface subStepState { datasetInstallation: boolean, networking: boolean, apfAuth: boolean, From 214427a74e32f99d4d70c99225b187ac71c8ff89 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Tue, 25 Jun 2024 19:31:44 +0530 Subject: [PATCH 07/65] indendations --- src/renderer/components/stages/Stcs.tsx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/renderer/components/stages/Stcs.tsx b/src/renderer/components/stages/Stcs.tsx index 4ab9c6ba..4cab2864 100644 --- a/src/renderer/components/stages/Stcs.tsx +++ b/src/renderer/components/stages/Stcs.tsx @@ -218,16 +218,16 @@ const Stcs = () => { updateProgress(false); event.preventDefault(); window.electron.ipcRenderer.initStcsButtonOnClick(connectionArgs, installationArgs, (await window.electron.ipcRenderer.getConfig()).details ?? yaml).then((res: IResponse) => { - updateProgress(res.status); - if(res.error) { - alertEmitter.emit('showAlert', res.errorMsg+" "+defaultErrorMessage, 'error'); - } - clearInterval(timer); - }).catch((error: any) => { - clearInterval(timer); - updateProgress(false); - console.warn('zwe init stcs failed'); - }); + updateProgress(res.status); + if(res.error) { + alertEmitter.emit('showAlert', res.errorMsg+" "+defaultErrorMessage, 'error'); + } + clearInterval(timer); + }).catch((error: any) => { + clearInterval(timer); + updateProgress(false); + console.warn('zwe init stcs failed'); + }); } const handleFormChange = (data: any) => { From 2161a8b78069d477462679c7931679a759bd0428 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Wed, 26 Jun 2024 17:11:46 +0530 Subject: [PATCH 08/65] Updating the stepper --- src/renderer/components/common/Stepper.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/renderer/components/common/Stepper.tsx b/src/renderer/components/common/Stepper.tsx index c64a51db..b11e09f3 100644 --- a/src/renderer/components/common/Stepper.tsx +++ b/src/renderer/components/common/Stepper.tsx @@ -54,7 +54,7 @@ export default function HorizontalLinearStepper({stages, initialization}:{stages completeProgress.reviewStatus ]; - const [subStageProgressStatus, setProgressStatus] = useState([ + const [subStageProgressStatus, setSubStageProgressStatus] = useState([ completeProgress.datasetInstallationStatus, completeProgress.networkingStatus, completeProgress.apfAuthStatus, @@ -73,11 +73,11 @@ export default function HorizontalLinearStepper({stages, initialization}:{stages useEffect(() => { const mvsCompleteListener = (completed: boolean) => { - setProgressStatus([true, completeProgress.networkingStatus, - completeProgress.apfAuthStatus, - completeProgress.securityStatus, - completeProgress.certificateStatus, - completeProgress.launchConfigStatus]) + // setProgressStatus([true, completeProgress.networkingStatus, + // completeProgress.apfAuthStatus, + // completeProgress.securityStatus, + // completeProgress.certificateStatus, + // completeProgress.launchConfigStatus]) }; eventDispatcher.on('updateActiveStep', updateActiveStepListener); eventDispatcher.on('initMvsComplete', mvsCompleteListener); From 5ab1fb417e21cfc2c5f502efb7265cfd59412946 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Wed, 26 Jun 2024 17:12:14 +0530 Subject: [PATCH 09/65] Updating the dataset instllation --- src/renderer/components/stages/installation/Installation.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/renderer/components/stages/installation/Installation.tsx b/src/renderer/components/stages/installation/Installation.tsx index c1bb2484..30533c40 100644 --- a/src/renderer/components/stages/installation/Installation.tsx +++ b/src/renderer/components/stages/installation/Installation.tsx @@ -210,7 +210,6 @@ const Installation = () => { timer = setInterval(() => { window.electron.ipcRenderer.getInstallationProgress().then((res: any) => { setMvsDatasetInitializationProgress(res); - dispatch(setDatasetInstallationStatus(stageComplete)) eventDispatcher.emit('initMvsComplete', true); }) }, 3000); @@ -236,6 +235,7 @@ const Installation = () => { stages[STAGE_ID].isSkipped = status; mapAndSetSubStepSkipStatus(SUB_STAGE_ID, status); } + const updateProgress = (status: boolean) => { setStateUpdated(!stateUpdated); setStageSkipStatus(!status); @@ -283,7 +283,6 @@ const Installation = () => { toggleEditorVisibility("output"); }) updateProgress(false); - installProceedActions(false); stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped = true; clearInterval(timer); } else { From 0fb7d121dac2682ecbad8e3ac1a2d86b1cadb6c0 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Wed, 26 Jun 2024 17:14:07 +0530 Subject: [PATCH 10/65] Removing the eventlisterner --- src/renderer/components/common/Stepper.tsx | 9 --------- .../components/stages/installation/Installation.tsx | 2 -- 2 files changed, 11 deletions(-) diff --git a/src/renderer/components/common/Stepper.tsx b/src/renderer/components/common/Stepper.tsx index b11e09f3..59be4489 100644 --- a/src/renderer/components/common/Stepper.tsx +++ b/src/renderer/components/common/Stepper.tsx @@ -72,18 +72,9 @@ export default function HorizontalLinearStepper({stages, initialization}:{stages const [editorContent, setEditorContent] = useState(''); useEffect(() => { - const mvsCompleteListener = (completed: boolean) => { - // setProgressStatus([true, completeProgress.networkingStatus, - // completeProgress.apfAuthStatus, - // completeProgress.securityStatus, - // completeProgress.certificateStatus, - // completeProgress.launchConfigStatus]) - }; eventDispatcher.on('updateActiveStep', updateActiveStepListener); - eventDispatcher.on('initMvsComplete', mvsCompleteListener); return () => { eventDispatcher.off('updateActiveStep', updateActiveStepListener); - eventDispatcher.off('initMvsComplete', mvsCompleteListener); }; }, []); diff --git a/src/renderer/components/stages/installation/Installation.tsx b/src/renderer/components/stages/installation/Installation.tsx index 30533c40..6fe6d501 100644 --- a/src/renderer/components/stages/installation/Installation.tsx +++ b/src/renderer/components/stages/installation/Installation.tsx @@ -210,7 +210,6 @@ const Installation = () => { timer = setInterval(() => { window.electron.ipcRenderer.getInstallationProgress().then((res: any) => { setMvsDatasetInitializationProgress(res); - eventDispatcher.emit('initMvsComplete', true); }) }, 3000); } @@ -226,7 +225,6 @@ const Installation = () => { if(allAttributesTrue) { dispatch(setNextStepEnabled(true)); dispatch(setDatasetInstallationStatus(true)); - eventDispatcher.emit('initMvsComplete', true) } } From 539b60686b2bd074bb7b598ffb05352d411b68a3 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Wed, 26 Jun 2024 18:41:48 +0530 Subject: [PATCH 11/65] Handling edge cases for instllation --- .../components/stages/installation/Installation.tsx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/renderer/components/stages/installation/Installation.tsx b/src/renderer/components/stages/installation/Installation.tsx index 6fe6d501..43d39a92 100644 --- a/src/renderer/components/stages/installation/Installation.tsx +++ b/src/renderer/components/stages/installation/Installation.tsx @@ -201,6 +201,7 @@ const Installation = () => { if(allAttributesTrue) { dispatch(setNextStepEnabled(true)); dispatch(setDatasetInstallationStatus(true)); + setStageSkipStatus(false); } }, [mvsDatasetInitProgress]); @@ -210,6 +211,9 @@ const Installation = () => { timer = setInterval(() => { window.electron.ipcRenderer.getInstallationProgress().then((res: any) => { setMvsDatasetInitializationProgress(res); + if(res.success){ + clearInterval(timer); + } }) }, 3000); } @@ -225,6 +229,7 @@ const Installation = () => { if(allAttributesTrue) { dispatch(setNextStepEnabled(true)); dispatch(setDatasetInstallationStatus(true)); + setStageSkipStatus(false); } } @@ -246,7 +251,7 @@ const Installation = () => { const allAttributesTrue = Object.values(mvsDatasetInitProgress).every(value => value === true); status = allAttributesTrue ? true : false; installProceedActions(status); - // setMvsDatasetInitializationProgress(getDatasetInstallationState()); + setMvsDatasetInitializationProgress(getDatasetInstallationState()); } const toggleEditorVisibility = (type: any) => { @@ -260,7 +265,6 @@ const Installation = () => { updateProgress(false); event.preventDefault(); dispatch(setLoading(true)); - setMvsDatasetInitProgress(datasetInstallationStatus) // FIXME: runtime dir is hardcoded, fix there and in InstallActions.ts - Unpax and Install functions Promise.all([ @@ -281,19 +285,14 @@ const Installation = () => { toggleEditorVisibility("output"); }) updateProgress(false); - stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped = true; clearInterval(timer); } else { updateProgress(res.status); - stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped = !res.status; clearInterval(timer); } }).catch((err: any) => { clearInterval(timer); updateProgress(false); - installProceedActions(false); - stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped = true; - stages[STAGE_ID].isSkipped = true; if (typeof err === "string") { console.warn('Installation failed', err); } else { From 25f111d38a36fa33da9dde2ec0d81123b1500c72 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Wed, 26 Jun 2024 18:52:32 +0530 Subject: [PATCH 12/65] code cleanup --- src/renderer/components/stages/InitApfAuth.tsx | 4 ---- src/renderer/components/stages/Security.tsx | 4 ---- 2 files changed, 8 deletions(-) diff --git a/src/renderer/components/stages/InitApfAuth.tsx b/src/renderer/components/stages/InitApfAuth.tsx index e57ca10d..54ea2185 100644 --- a/src/renderer/components/stages/InitApfAuth.tsx +++ b/src/renderer/components/stages/InitApfAuth.tsx @@ -220,12 +220,10 @@ const InitApfAuth = () => { }) updateProgress(false); //res.status may not necessarily be false, even if things go wrong apfAuthProceedActions(false); - stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped = true; clearInterval(timer); } else { updateProgress(res.status); apfAuthProceedActions(res.status); - stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped = !res.status; clearInterval(timer); } }).catch((err: any) => { @@ -234,8 +232,6 @@ const InitApfAuth = () => { updateProgress(false); // TODO: Test this //alertEmitter.emit('showAlert', err.toString(), 'error'); - stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped = true; - stages[STAGE_ID].isSkipped = true; if (typeof err === "string") { console.warn('zwe init apfauth failed', err); } else { diff --git a/src/renderer/components/stages/Security.tsx b/src/renderer/components/stages/Security.tsx index d4dd5637..81f2dac5 100644 --- a/src/renderer/components/stages/Security.tsx +++ b/src/renderer/components/stages/Security.tsx @@ -219,11 +219,9 @@ const Security = () => { }) updateProgress(false); securityProceedActions(false); - stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped = true; clearInterval(timer); } else { securityProceedActions(res.status); - stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped = !res.status; clearInterval(timer); } }).catch((err: any) => { @@ -232,8 +230,6 @@ const Security = () => { updateProgress(false); clearInterval(timer); securityProceedActions(false); - stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped = true; - stages[STAGE_ID].isSkipped = true; if (typeof err === "string") { console.warn('zwe init security failed', err); } else { From 4937dcbc2f3405b65d56142da26c0c6ca8d08089 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Wed, 26 Jun 2024 19:35:34 +0530 Subject: [PATCH 13/65] Updating the substep skip array --- src/renderer/components/stages/InitApfAuth.tsx | 1 - src/renderer/components/stages/Security.tsx | 1 + src/renderer/components/stages/installation/Installation.tsx | 1 - src/renderer/components/stages/progress/StageProgressStatus.ts | 1 + 4 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderer/components/stages/InitApfAuth.tsx b/src/renderer/components/stages/InitApfAuth.tsx index 54ea2185..4f353493 100644 --- a/src/renderer/components/stages/InitApfAuth.tsx +++ b/src/renderer/components/stages/InitApfAuth.tsx @@ -280,7 +280,6 @@ const InitApfAuth = () => { setIsFormValid(isValid); setFormError(errorMsg); setSetupYaml(data); - updateProgress(proceed); } return ( diff --git a/src/renderer/components/stages/Security.tsx b/src/renderer/components/stages/Security.tsx index 81f2dac5..abf65fb6 100644 --- a/src/renderer/components/stages/Security.tsx +++ b/src/renderer/components/stages/Security.tsx @@ -221,6 +221,7 @@ const Security = () => { securityProceedActions(false); clearInterval(timer); } else { + updateProgress(res.status); securityProceedActions(res.status); clearInterval(timer); } diff --git a/src/renderer/components/stages/installation/Installation.tsx b/src/renderer/components/stages/installation/Installation.tsx index 43d39a92..b0b41209 100644 --- a/src/renderer/components/stages/installation/Installation.tsx +++ b/src/renderer/components/stages/installation/Installation.tsx @@ -173,7 +173,6 @@ const Installation = () => { }) dispatch(setNextStepEnabled(getProgress('datasetInstallationStatus'))); - dispatch(setNextStepEnabled(true)); if(installationType === 'smpe') { const status = getProgress('datasetInstallationStatus'); diff --git a/src/renderer/components/stages/progress/StageProgressStatus.ts b/src/renderer/components/stages/progress/StageProgressStatus.ts index 061f73db..11603375 100644 --- a/src/renderer/components/stages/progress/StageProgressStatus.ts +++ b/src/renderer/components/stages/progress/StageProgressStatus.ts @@ -282,6 +282,7 @@ export const mapAndGetSubStepSkipStatus = (subStageId: number): boolean => { skipStatus.networking, skipStatus.apfAuth, skipStatus.security, + skipStatus.stcs, skipStatus.certificate, skipStatus.vsam, skipStatus.launchConfig From 5da1eff15e69ac1a0aec2103c42021da270c2522 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Wed, 26 Jun 2024 19:52:41 +0530 Subject: [PATCH 14/65] Removing error prop --- src/renderer/components/common/Stepper.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/renderer/components/common/Stepper.tsx b/src/renderer/components/common/Stepper.tsx index 59be4489..988011cd 100644 --- a/src/renderer/components/common/Stepper.tsx +++ b/src/renderer/components/common/Stepper.tsx @@ -164,7 +164,7 @@ export default function HorizontalLinearStepper({stages, initialization}:{stages } } - const getStepIcon = (error: any, stageId: number, isSubStep?: boolean, subStepId?: number) => { + const getStepIcon = (stageId: number, isSubStep?: boolean, subStepId?: number) => { if ((isSubStep && getProgress(stages[stageId].subStages[subStepId].statusKey)) || (!isSubStep && ((stageId == 0 && connectionStatus) || (getProgress(stages[stageId].statusKey))))) { return } />; @@ -256,8 +256,7 @@ export default function HorizontalLinearStepper({stages, initialization}:{stages boxShadow: 'rgb(0 0 0 / 15%) 0px 6px 4px -1px inset'} : {}}> : }> - icon={getStepIcon(labelProps.error, stage.id)}> + icon={getStepIcon(stage.id)}> handleStepperClick(stage.id, !!stage.subStage)}>{stage.label} @@ -275,8 +274,7 @@ export default function HorizontalLinearStepper({stages, initialization}:{stages : }> - icon={getStepIcon(labelProps.error, activeStep, true, index)}> + icon={getStepIcon(activeStep, true, index)}> handleStepperClick(activeStep, true, stage.id )}>{stage.label} From 58702ea0809d2dcfd20ef5060f0fd8082a7abedc Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Thu, 27 Jun 2024 11:59:56 +0530 Subject: [PATCH 15/65] Removing error attr --- src/renderer/components/common/Stepper.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/renderer/components/common/Stepper.tsx b/src/renderer/components/common/Stepper.tsx index 988011cd..5bea1dee 100644 --- a/src/renderer/components/common/Stepper.tsx +++ b/src/renderer/components/common/Stepper.tsx @@ -255,7 +255,6 @@ export default function HorizontalLinearStepper({stages, initialization}:{stages borderTopLeftRadius: '7px', boxShadow: 'rgb(0 0 0 / 15%) 0px 6px 4px -1px inset'} : {}}> handleStepperClick(stage.id, !!stage.subStage)}>{stage.label} @@ -273,7 +272,6 @@ export default function HorizontalLinearStepper({stages, initialization}:{stages return ( handleStepperClick(activeStep, true, stage.id )}>{stage.label} From 8573f1d1109b89311d40d90b4957e8bc76e79072 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Thu, 27 Jun 2024 12:09:56 +0530 Subject: [PATCH 16/65] Adding some coditions --- .../components/stages/progress/StageProgressStatus.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/renderer/components/stages/progress/StageProgressStatus.ts b/src/renderer/components/stages/progress/StageProgressStatus.ts index 11603375..a93876c2 100644 --- a/src/renderer/components/stages/progress/StageProgressStatus.ts +++ b/src/renderer/components/stages/progress/StageProgressStatus.ts @@ -272,6 +272,9 @@ export const initializeProgress = (host: string, user: string) => { } export const mapAndSetSubStepSkipStatus = (subStageId: number, value: boolean): void => { + if(subStageId < 0 || subStageId > 7) { + return; + } setSubStageSkipStatus(subStepSkipKeysArray[subStageId], value); } @@ -292,6 +295,9 @@ export const mapAndGetSubStepSkipStatus = (subStageId: number): boolean => { } export const mapAndSetStepSkipStatus = (stageId: number, value: boolean): void => { + if(stageId < 0 || stageId > 5) { + return; + } setStageSkipStatus(stepSkipKeysArray[stageId-1], value); } From 47dbe7ff757a0570d3a262f4f9e5d1202b06ebd8 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Thu, 27 Jun 2024 12:19:38 +0530 Subject: [PATCH 17/65] Updating the consitions --- .../components/stages/progress/StageProgressStatus.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/renderer/components/stages/progress/StageProgressStatus.ts b/src/renderer/components/stages/progress/StageProgressStatus.ts index a93876c2..31f4b13f 100644 --- a/src/renderer/components/stages/progress/StageProgressStatus.ts +++ b/src/renderer/components/stages/progress/StageProgressStatus.ts @@ -279,6 +279,9 @@ export const mapAndSetSubStepSkipStatus = (subStageId: number, value: boolean): } export const mapAndGetSubStepSkipStatus = (subStageId: number): boolean => { + if(subStageId < 0 || subStageId > 7) { + return true; // Skip the sub-stage if the id is out of the valid range of the sub-stages (0-5) + } const skipStatus = getSubStageSkipStatus(); const skipStatusArray = [ skipStatus.datasetInstallation, @@ -301,7 +304,10 @@ export const mapAndSetStepSkipStatus = (stageId: number, value: boolean): void = setStageSkipStatus(stepSkipKeysArray[stageId-1], value); } -export const mapAndGetStepSkipStatus = (subStageId: number): boolean => { +export const mapAndGetStepSkipStatus = (stageId: number): boolean => { + if(stageId < 0 || stageId > 5) { + return true; // Skip the stage if the stageId is out of the valid range of the stages (0-5) + } const skipStatus = getStageSkipStatus(); const skipStatusArray = [ skipStatus.planning, @@ -311,7 +317,7 @@ export const mapAndGetStepSkipStatus = (subStageId: number): boolean => { skipStatus.reviewInstallation ] - return skipStatusArray[subStageId-1]; + return skipStatusArray[stageId-1]; } export const setSubStageSkipStatus = (key: keyof subStepState, newValue: boolean): void => { From 10dff9fee3a53e54f3375bfb668d92ea5157ba01 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Thu, 27 Jun 2024 20:00:20 +0530 Subject: [PATCH 18/65] Bugfix --- src/renderer/components/stages/Certificates.tsx | 2 +- src/renderer/components/stages/InitApfAuth.tsx | 2 +- src/renderer/components/stages/Security.tsx | 2 +- src/renderer/components/stages/Stcs.tsx | 3 ++- src/renderer/components/stages/Vsam.tsx | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/renderer/components/stages/Certificates.tsx b/src/renderer/components/stages/Certificates.tsx index ec13adbf..309d11da 100644 --- a/src/renderer/components/stages/Certificates.tsx +++ b/src/renderer/components/stages/Certificates.tsx @@ -116,7 +116,7 @@ const Certificates = () => { } setShowProgress(initClicked || getProgress('certificateStatus')); - updateProgress(getProgress('certificateStatus')); + updateProgress(getProgress('certificateStatus') && !stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped); setIsFormInit(true); return () => { diff --git a/src/renderer/components/stages/InitApfAuth.tsx b/src/renderer/components/stages/InitApfAuth.tsx index 4f353493..62a2a28f 100644 --- a/src/renderer/components/stages/InitApfAuth.tsx +++ b/src/renderer/components/stages/InitApfAuth.tsx @@ -110,7 +110,7 @@ const InitApfAuth = () => { nextPosition?.scrollIntoView({behavior: 'smooth'}); } - updateProgress(getProgress('apfAuthStatus')); + // updateProgress(getProgress('apfAuthStatus') && !stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped); setInit(true); return () => { diff --git a/src/renderer/components/stages/Security.tsx b/src/renderer/components/stages/Security.tsx index abf65fb6..564d771c 100644 --- a/src/renderer/components/stages/Security.tsx +++ b/src/renderer/components/stages/Security.tsx @@ -114,7 +114,7 @@ const Security = () => { nextPosition?.scrollIntoView({behavior: 'smooth'}); } - updateProgress(getProgress('securityStatus')); + // updateProgress(getProgress('securityStatus')); setInit(true); return () => { diff --git a/src/renderer/components/stages/Stcs.tsx b/src/renderer/components/stages/Stcs.tsx index 4cab2864..7b86c0ad 100644 --- a/src/renderer/components/stages/Stcs.tsx +++ b/src/renderer/components/stages/Stcs.tsx @@ -114,7 +114,8 @@ const Stcs = () => { nextPosition?.scrollIntoView({behavior: 'smooth'}); } - updateProgress(getProgress('stcsStatus')); + updateProgress(getProgress('stcsStatus') && !stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped); + // setNextStepEnabled(getProgress('stcsStatus') && !stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped); setInit(true); if(!setupYaml) { diff --git a/src/renderer/components/stages/Vsam.tsx b/src/renderer/components/stages/Vsam.tsx index 37f13e62..245b8672 100644 --- a/src/renderer/components/stages/Vsam.tsx +++ b/src/renderer/components/stages/Vsam.tsx @@ -99,7 +99,7 @@ const Vsam = () => { nextPosition?.scrollIntoView({behavior: 'smooth'}); } - updateProgress(getProgress('vsamStatus')); + // updateProgress(getProgress('vsamStatus')); setInit(true); return () => { From 15a3fa44f8b0c81734f0e940851aaccc738742ba Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Thu, 27 Jun 2024 20:30:42 +0530 Subject: [PATCH 19/65] Updating progress in edge cases --- src/renderer/components/stages/InitApfAuth.tsx | 2 +- src/renderer/components/stages/Security.tsx | 2 +- src/renderer/components/stages/Stcs.tsx | 1 - src/renderer/components/stages/Vsam.tsx | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/renderer/components/stages/InitApfAuth.tsx b/src/renderer/components/stages/InitApfAuth.tsx index 62a2a28f..8b8ccb87 100644 --- a/src/renderer/components/stages/InitApfAuth.tsx +++ b/src/renderer/components/stages/InitApfAuth.tsx @@ -110,7 +110,7 @@ const InitApfAuth = () => { nextPosition?.scrollIntoView({behavior: 'smooth'}); } - // updateProgress(getProgress('apfAuthStatus') && !stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped); + updateProgress(getProgress('apfAuthStatus') && !stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped); setInit(true); return () => { diff --git a/src/renderer/components/stages/Security.tsx b/src/renderer/components/stages/Security.tsx index 564d771c..a214bbfe 100644 --- a/src/renderer/components/stages/Security.tsx +++ b/src/renderer/components/stages/Security.tsx @@ -114,7 +114,7 @@ const Security = () => { nextPosition?.scrollIntoView({behavior: 'smooth'}); } - // updateProgress(getProgress('securityStatus')); + updateProgress(getProgress('securityStatus') && !stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped); setInit(true); return () => { diff --git a/src/renderer/components/stages/Stcs.tsx b/src/renderer/components/stages/Stcs.tsx index 7b86c0ad..d8e2f075 100644 --- a/src/renderer/components/stages/Stcs.tsx +++ b/src/renderer/components/stages/Stcs.tsx @@ -115,7 +115,6 @@ const Stcs = () => { } updateProgress(getProgress('stcsStatus') && !stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped); - // setNextStepEnabled(getProgress('stcsStatus') && !stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped); setInit(true); if(!setupYaml) { diff --git a/src/renderer/components/stages/Vsam.tsx b/src/renderer/components/stages/Vsam.tsx index 245b8672..fa26d880 100644 --- a/src/renderer/components/stages/Vsam.tsx +++ b/src/renderer/components/stages/Vsam.tsx @@ -99,7 +99,7 @@ const Vsam = () => { nextPosition?.scrollIntoView({behavior: 'smooth'}); } - // updateProgress(getProgress('vsamStatus')); + updateProgress(getProgress('vsamStatus') && !stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped); setInit(true); return () => { From 32a763264895ae113500d05484f18acecab579a1 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Thu, 27 Jun 2024 20:43:59 +0530 Subject: [PATCH 20/65] Fixing the status of the networking and the launch config stage --- src/renderer/components/stages/LaunchConfig.tsx | 3 +-- src/renderer/components/stages/Networking.tsx | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/renderer/components/stages/LaunchConfig.tsx b/src/renderer/components/stages/LaunchConfig.tsx index 4b4b760a..b2a19dd6 100644 --- a/src/renderer/components/stages/LaunchConfig.tsx +++ b/src/renderer/components/stages/LaunchConfig.tsx @@ -470,8 +470,7 @@ const LaunchConfig = () => { nextPosition.scrollIntoView({behavior: 'smooth'}); dispatch(setNextStepEnabled(getProgress('launchConfigStatus'))); - stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped = false; - stages[STAGE_ID].isSkipped = isInitializationSkipped; + setIsFormInit(true); return () => { diff --git a/src/renderer/components/stages/Networking.tsx b/src/renderer/components/stages/Networking.tsx index 09b7aa6b..efafb76d 100644 --- a/src/renderer/components/stages/Networking.tsx +++ b/src/renderer/components/stages/Networking.tsx @@ -681,8 +681,7 @@ const Networking = () => { if(nextPosition) nextPosition.scrollIntoView({behavior: 'smooth'}); dispatch(setNextStepEnabled(getProgress('networkingStatus'))); - stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped = false; - stages[STAGE_ID].isSkipped = isInitializationSkipped; + setIsFormInit(true); return () => { From c10f623f090b2ffec8119161b8428d9c5f3f9099 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Tue, 2 Jul 2024 13:50:19 +0530 Subject: [PATCH 21/65] updating unpax stage --- src/renderer/components/stages/Unpax.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/renderer/components/stages/Unpax.tsx b/src/renderer/components/stages/Unpax.tsx index 324f3ccf..dfacdbc6 100644 --- a/src/renderer/components/stages/Unpax.tsx +++ b/src/renderer/components/stages/Unpax.tsx @@ -54,7 +54,7 @@ const Unpax = () => { setDownloadUnpaxProgress(res); setDownloadUnpaxState(res); if(stageComplete){ - setStageSkipStatus(true); + setStageStatus(true); clearInterval(timer); } }) @@ -67,7 +67,7 @@ const Unpax = () => { const process = (event: any) => { event.preventDefault(); - setStageSkipStatus(false); + setStageStatus(false); setShowProgress(true); setDownloadUnpaxProgress(downloadUnpaxStatus); dispatch(setNextStepEnabled(false)); @@ -79,11 +79,11 @@ const Unpax = () => { dispatch(setYaml(res.details.mergedYaml)); window.electron.ipcRenderer.setConfig(res.details.mergedYaml); } - setStageSkipStatus(res.status); + setStageStatus(res.status); clearInterval(timer); }).catch(() => { clearInterval(timer); - setStageSkipStatus(false); + setStageStatus(false); }); } @@ -128,7 +128,7 @@ const Unpax = () => { } }, []); - const setStageSkipStatus = (status: boolean) => { + const setStageStatus = (status: boolean) => { dispatch(setNextStepEnabled(status)); dispatch(setDownloadUnpaxStatus(status)); mapAndSetStepSkipStatus(STAGE_ID, !status); From 32c820d1e660ce89f302ee59797eb79dcbbab2d4 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Wed, 3 Jul 2024 11:40:03 +0530 Subject: [PATCH 22/65] Code cleanup --- src/renderer/components/common/Stepper.tsx | 2 +- src/renderer/components/stages/connection/Connection.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderer/components/common/Stepper.tsx b/src/renderer/components/common/Stepper.tsx index b06a1d64..d71262f0 100644 --- a/src/renderer/components/common/Stepper.tsx +++ b/src/renderer/components/common/Stepper.tsx @@ -195,7 +195,7 @@ export default function HorizontalLinearStepper({stages, initialization}:{stages return } />; } - if ((isSubStep && mapAndGetSubStepSkipStatus(subStepId) && stages[stageId].subStages[subStepId].isSkipped) || (!isSubStep && mapAndGetStepSkipStatus(stageId))) { + if ((isSubStep && stages[stageId].subStages[subStepId].isSkipped) || (!isSubStep && stages[stageId].isSkipped)) { return } />; } diff --git a/src/renderer/components/stages/connection/Connection.tsx b/src/renderer/components/stages/connection/Connection.tsx index f62a8b1d..70b9bf73 100644 --- a/src/renderer/components/stages/connection/Connection.tsx +++ b/src/renderer/components/stages/connection/Connection.tsx @@ -135,9 +135,9 @@ const FTPConnectionForm = () => { if(res.status) { dispatch(setNextStepEnabled(true)); dispatch(setConnectionStatus(true)); - initSubStageSkipStatus(); initializeProgress(connectionArgs.host, connectionArgs.user, isResume); initStageSkipStatus(); + initSubStageSkipStatus(); setResume(); } toggleFormProcessed(true); From f9c9543363ec191fb8b69bafc7d590ae60d12b8c Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Wed, 3 Jul 2024 12:44:23 +0530 Subject: [PATCH 23/65] Optimizing installation --- .../components/stages/installation/Installation.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/renderer/components/stages/installation/Installation.tsx b/src/renderer/components/stages/installation/Installation.tsx index eb1a5ec8..ea63ef99 100644 --- a/src/renderer/components/stages/installation/Installation.tsx +++ b/src/renderer/components/stages/installation/Installation.tsx @@ -8,7 +8,7 @@ * Copyright Contributors to the Zowe Project. */ -import React, {useCallback, useEffect, useState} from "react"; +import React, {useCallback, useEffect, useRef, useState} from "react"; import { Box, Button, FormControl, Typography, debounce } from '@mui/material'; import { useAppSelector, useAppDispatch } from '../../../hooks'; import { selectYaml, setYaml, selectSchema, setNextStepEnabled, setLoading} from '../../configuration-wizard/wizardSlice'; @@ -60,14 +60,19 @@ const Installation = () => { const [mvsDatasetInitProgress, setMvsDatasetInitProgress] = useState(getDatasetInstallationState()); const [stateUpdated, setStateUpdated] = useState(false); const [initClicked, setInitClicked] = useState(false); - const [installationArgs, setInstArgs] = useState(getInstallationArguments()); const [version] = useState(useAppSelector(selectZoweVersion)); + const [stageStatus, setStageStatus] = useState(stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped); + const stageStatusRef = useRef(stageStatus); + let timer: any; const [installationType] = useState(getInstallationTypeStatus().installationType); const [validate] = useState(() => ajv.getSchema("https://zowe.org/schemas/v2/server-base") || ajv.compile(setupSchema)); + useEffect(() => { + stageStatusRef.current = stageStatus; + }, [stageStatus]); useEffect(() => { dispatch(setInitializationStatus(isInitComplete())); @@ -167,6 +172,7 @@ const Installation = () => { } return () => { + mapAndSetSubStepSkipStatus(SUB_STAGE_ID, stageStatusRef.current); dispatch(setActiveStep({ activeStepIndex: STAGE_ID, isSubStep: SUB_STAGES, activeSubStepIndex: SUB_STAGE_ID })); } }, []); @@ -221,7 +227,7 @@ const Installation = () => { const setStageSkipStatus = (status: boolean) => { stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped = status; stages[STAGE_ID].isSkipped = status; - mapAndSetSubStepSkipStatus(SUB_STAGE_ID, status); + setStageStatus(status); } const updateProgress = (status: boolean) => { From d0da7f6746ddb22f1468328861b7b23111260abc Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Wed, 3 Jul 2024 12:45:38 +0530 Subject: [PATCH 24/65] Optimizing the apf auth --- src/renderer/components/stages/InitApfAuth.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/renderer/components/stages/InitApfAuth.tsx b/src/renderer/components/stages/InitApfAuth.tsx index 2bc61d95..a28c83e9 100644 --- a/src/renderer/components/stages/InitApfAuth.tsx +++ b/src/renderer/components/stages/InitApfAuth.tsx @@ -8,7 +8,7 @@ * Copyright Contributors to the Zowe Project. */ -import React, {useEffect, useState} from "react"; +import React, {useEffect, useRef, useState} from "react"; import { Box, Button, FormControl, TextField, Typography } from '@mui/material'; import { useAppSelector, useAppDispatch } from '../../hooks'; import { selectYaml, selectSchema, setNextStepEnabled } from '../configuration-wizard/wizardSlice'; @@ -51,11 +51,17 @@ const InitApfAuth = () => { const [stateUpdated, setStateUpdated] = useState(false); const [initClicked, setInitClicked] = useState(false); const [reinit, setReinit] = useState(false); + const [stageStatus, setStageStatus] = useState(stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped); + const stageStatusRef = useRef(stageStatus); const [installationArgs] = useState(getInstallationArguments()); let timer: any; const [validate] = useState(() => ajv.getSchema("https://zowe.org/schemas/v2/server-base") || ajv.compile(schema?.properties?.zowe?.properties?.setup?.properties?.dataset)); + useEffect(() => { + stageStatusRef.current = stageStatus; + }, [stageStatus]); + useEffect(() => { dispatch(setInitializationStatus(isInitComplete())); let nextPosition; @@ -71,6 +77,7 @@ const InitApfAuth = () => { setInit(true); return () => { + mapAndSetSubStepSkipStatus(SUB_STAGE_ID, stageStatusRef.current); dispatch(setActiveStep({ activeStepIndex: STAGE_ID, isSubStep: SUB_STAGES, activeSubStepIndex: SUB_STAGE_ID })); } }, []); @@ -132,7 +139,7 @@ const InitApfAuth = () => { const setStageSkipStatus = (status: boolean) => { stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped = status; stages[STAGE_ID].isSkipped = status; - mapAndSetSubStepSkipStatus(SUB_STAGE_ID, status); + setStageStatus(status); } const updateProgress = (status: boolean) => { From 09ea0109e6bf27318d6ef92a3f49b50243d5b7c4 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Wed, 3 Jul 2024 12:46:29 +0530 Subject: [PATCH 25/65] optimizing the certs --- src/renderer/components/stages/Certificates.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/renderer/components/stages/Certificates.tsx b/src/renderer/components/stages/Certificates.tsx index 52740f44..5f8d408a 100644 --- a/src/renderer/components/stages/Certificates.tsx +++ b/src/renderer/components/stages/Certificates.tsx @@ -8,7 +8,7 @@ * Copyright Contributors to the Zowe Project. */ -import { useState, useEffect } from "react"; +import { useState, useEffect, useRef } from "react"; import { Box, Button, FormControl, FormHelperText, MenuItem, Select } from '@mui/material'; import { useAppSelector, useAppDispatch } from '../../hooks'; import { setInitializationStatus, setCertificateStatus } from './progress/progressSlice'; @@ -54,11 +54,17 @@ const Certificates = () => { const [stateUpdated, setStateUpdated] = useState(false); const [initClicked, setInitClicked] = useState(false); const [reinit, setReinit] = useState(false); + const [stageStatus, setStageStatus] = useState(stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped); + const stageStatusRef = useRef(stageStatus); let timer: any; const [validate] = useState(() => ajv.getSchema("https://zowe.org/schemas/v2/server-base") || ajv.compile(setupSchema)) + useEffect(() => { + stageStatusRef.current = stageStatus; + }, [stageStatus]); + useEffect(() => { dispatch(setInitializationStatus(isInitComplete())); if(getProgress('certificateStatus')) { @@ -74,6 +80,7 @@ const Certificates = () => { setIsFormInit(true); return () => { + mapAndSetSubStepSkipStatus(SUB_STAGE_ID, stageStatusRef.current); dispatch(setActiveStep({ activeStepIndex: STAGE_ID, isSubStep: SUB_STAGES, activeSubStepIndex: SUB_STAGE_ID })); } }, []); @@ -129,7 +136,7 @@ const Certificates = () => { const setStageSkipStatus = (status: boolean) => { stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped = status; stages[STAGE_ID].isSkipped = status; - mapAndSetSubStepSkipStatus(SUB_STAGE_ID, status); + setStageStatus(status); } const updateProgress = (status: boolean) => { From 52db7ddd71fda131b36aba358e95864fa1b3c521 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Wed, 3 Jul 2024 12:48:14 +0530 Subject: [PATCH 26/65] Updating the vsam stage --- src/renderer/components/stages/Vsam.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/renderer/components/stages/Vsam.tsx b/src/renderer/components/stages/Vsam.tsx index 67980f4a..926dc161 100644 --- a/src/renderer/components/stages/Vsam.tsx +++ b/src/renderer/components/stages/Vsam.tsx @@ -8,7 +8,7 @@ * Copyright Contributors to the Zowe Project. */ -import { useState, useEffect } from "react"; +import { useState, useEffect, useRef } from "react"; import { Box, Button, FormControl, TextField } from '@mui/material'; import { useAppSelector, useAppDispatch } from '../../hooks'; import { selectYaml, selectSchema, setNextStepEnabled, setYaml } from '../configuration-wizard/wizardSlice'; @@ -56,15 +56,21 @@ const Vsam = () => { const [stateUpdated, setStateUpdated] = useState(false); const [initClicked, setInitClicked] = useState(false); const [isDsNameValid, setIsDsNameValid] = useState(true); - const [installationArgs] = useState(getInstallationArguments()); const [connectionArgs] = useState(useAppSelector(selectConnectionArgs)); + const [stageStatus, setStageStatus] = useState(stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped); + const stageStatusRef = useRef(stageStatus); + let timer: any; const [defaultErrorMessage] = useState("Please ensure that the volume, storage class & dataset values are accurate."); const [validate] = useState(() => ajv.getSchema("https://zowe.org/schemas/v2/server-base") || ajv.compile(setupSchema)) + useEffect(() => { + stageStatusRef.current = stageStatus; + }, [stageStatus]); + useEffect(() => { dispatch(setInitializationStatus(isInitComplete())); setShowProgress(initClicked || getProgress('vsamStatus')); @@ -88,6 +94,7 @@ const Vsam = () => { return () => { alertEmitter.emit('hideAlert'); + mapAndSetSubStepSkipStatus(SUB_STAGE_ID, stageStatusRef.current); dispatch(setActiveStep({ activeStepIndex: STAGE_ID, isSubStep: SUB_STAGES, activeSubStepIndex: SUB_STAGE_ID })); } }, []); @@ -143,7 +150,7 @@ const Vsam = () => { const setStageSkipStatus = (status: boolean) => { stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped = status; stages[STAGE_ID].isSkipped = status; - mapAndSetSubStepSkipStatus(SUB_STAGE_ID, status); + setStageStatus(status); } const updateProgress = (status: boolean) => { From 100cd2953fc6ce96910f3c65396e810c368b74a7 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Wed, 3 Jul 2024 12:56:35 +0530 Subject: [PATCH 27/65] optimizing the security stage --- src/renderer/components/stages/Security.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/renderer/components/stages/Security.tsx b/src/renderer/components/stages/Security.tsx index 88a23923..da966da9 100644 --- a/src/renderer/components/stages/Security.tsx +++ b/src/renderer/components/stages/Security.tsx @@ -8,7 +8,7 @@ * Copyright Contributors to the Zowe Project. */ -import { useState, useEffect } from "react"; +import { useState, useEffect, useRef } from "react"; import { Box, Button, FormControl } from '@mui/material'; import { useAppSelector, useAppDispatch } from '../../hooks'; import { selectYaml, selectSchema, setNextStepEnabled, setYaml } from '../configuration-wizard/wizardSlice'; @@ -53,6 +53,8 @@ const Security = () => { const [securityInitProgress, setSecurityInitProgress] = useState(getSecurityInitState()); const [stateUpdated, setStateUpdated] = useState(false); const [initClicked, setInitClicked] = useState(false); + const [stageStatus, setStageStatus] = useState(stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped); + const stageStatusRef = useRef(stageStatus); const [installationArgs] = useState(getInstallationArguments()); const [connectionArgs] = useState(useAppSelector(selectConnectionArgs)); @@ -60,6 +62,10 @@ const Security = () => { let timer: any; const [validate] = useState(() => ajv.getSchema("https://zowe.org/schemas/v2/server-base") || ajv.compile(setupSchema)); + useEffect(() => { + stageStatusRef.current = stageStatus; + }, [stageStatus]); + useEffect(() => { dispatch(setInitializationStatus(isInitComplete())); setShowProgress(initClicked || getProgress('securityStatus')); @@ -77,6 +83,7 @@ const Security = () => { setInit(true); return () => { + mapAndSetSubStepSkipStatus(SUB_STAGE_ID, stageStatusRef.current); dispatch(setActiveStep({ activeStepIndex: STAGE_ID, isSubStep: SUB_STAGES, activeSubStepIndex: SUB_STAGE_ID })); } }, []); @@ -132,7 +139,7 @@ const Security = () => { const setStageSkipStatus = (status: boolean) => { stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped = status; stages[STAGE_ID].isSkipped = status; - mapAndSetSubStepSkipStatus(SUB_STAGE_ID, status); + setStageStatus(status); } const updateProgress = (status: boolean) => { From 0dcfd071fde0906787b0c1e840e456411accd267 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Wed, 3 Jul 2024 12:57:10 +0530 Subject: [PATCH 28/65] updating stcs --- src/renderer/components/stages/Stcs.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/renderer/components/stages/Stcs.tsx b/src/renderer/components/stages/Stcs.tsx index 456e5aae..07af20ca 100644 --- a/src/renderer/components/stages/Stcs.tsx +++ b/src/renderer/components/stages/Stcs.tsx @@ -8,7 +8,7 @@ * Copyright Contributors to the Zowe Project. */ -import { useState, useEffect } from "react"; +import { useState, useEffect, useRef } from "react"; import { Box, Button, FormControl, TextField, Typography } from '@mui/material'; import { useAppSelector, useAppDispatch } from '../../hooks'; import { selectYaml, selectSchema, setNextStepEnabled, setYaml } from '../configuration-wizard/wizardSlice'; @@ -52,6 +52,8 @@ const Stcs = () => { const [stcsInitProgress, setStcsInitProgress] = useState(getStcsInitState()); const [stateUpdated, setStateUpdated] = useState(false); const [initClicked, setInitClicked] = useState(false); + const [stageStatus, setStageStatus] = useState(stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped); + const stageStatusRef = useRef(stageStatus); const [installationArgs] = useState(getInstallationArguments()); const [connectionArgs] = useState(useAppSelector(selectConnectionArgs)); @@ -63,6 +65,10 @@ const Stcs = () => { const [defaultErrorMessage] = useState("Please ensure that the values for security.stcs attributes and dataset.proclib are accurate."); const [validate] = useState(() => ajv.getSchema("https://zowe.org/schemas/v2/server-base") || ajv.compile(schema?.properties?.zowe?.properties?.setup?.properties?.security?.properties?.stcs)) + useEffect(() => { + stageStatusRef.current = stageStatus; + }, [stageStatus]); + useEffect(() => { dispatch(setInitializationStatus(isInitComplete())); setShowProgress(initClicked || getProgress('stcsStatus')); @@ -89,6 +95,7 @@ const Stcs = () => { return () => { alertEmitter.emit('hideAlert'); + mapAndSetSubStepSkipStatus(SUB_STAGE_ID, stageStatusRef.current); dispatch(setActiveStep({ activeStepIndex: STAGE_ID, isSubStep: SUB_STAGES, activeSubStepIndex: SUB_STAGE_ID })); } }, []); @@ -144,7 +151,7 @@ const Stcs = () => { const setStageSkipStatus = (status: boolean) => { stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped = status; stages[STAGE_ID].isSkipped = status; - mapAndSetSubStepSkipStatus(SUB_STAGE_ID, status); + setStageStatus(status); } const updateProgress = (status: boolean) => { From 7f6ad0d07087b7327b71992a4eb20741dd462e59 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Wed, 3 Jul 2024 14:02:22 +0530 Subject: [PATCH 29/65] Updating the progress slice --- .../components/stages/progress/progressSlice.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/renderer/components/stages/progress/progressSlice.ts b/src/renderer/components/stages/progress/progressSlice.ts index 841a0934..719bed0f 100644 --- a/src/renderer/components/stages/progress/progressSlice.ts +++ b/src/renderer/components/stages/progress/progressSlice.ts @@ -12,6 +12,7 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit'; import { RootState } from '../../../store'; import { setProgress, getProgress } from './StageProgressStatus'; import { ProgressState } from '../../../../types/stateInterfaces'; +import { stages } from '../../configuration-wizard/Wizard'; const initialState: ProgressState = { connectionStatus: getProgress('connectionStatus') || false, @@ -50,8 +51,14 @@ export const progressSlice = createSlice({ setProgress('downloadUnpaxStatus', action.payload); }, setInitializationStatus: (state, action: PayloadAction) => { - state.initializationStatus = action.payload; - setProgress('initializationStatus', action.payload); + let status = false; + stages.map(stage => { + if(stage.subStages) { + status = stage.subStages.map(subStage => subStage.isSkipped).every(skip => skip === false); + } + }) + state.initializationStatus = status; + setProgress('initializationStatus', status); }, setDatasetInstallationStatus: (state, action: PayloadAction) => { state.datasetInstallationStatus = action.payload; From 7df8753c326d5ca6d40eef1461c9e6178ca5945b Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Wed, 3 Jul 2024 14:07:21 +0530 Subject: [PATCH 30/65] Updating the launch config and the network state --- .../components/stages/LaunchConfig.tsx | 33 +++++++++++++--- src/renderer/components/stages/Networking.tsx | 38 ++++++++++++++----- 2 files changed, 56 insertions(+), 15 deletions(-) diff --git a/src/renderer/components/stages/LaunchConfig.tsx b/src/renderer/components/stages/LaunchConfig.tsx index f0613c5a..29f4c55a 100644 --- a/src/renderer/components/stages/LaunchConfig.tsx +++ b/src/renderer/components/stages/LaunchConfig.tsx @@ -8,7 +8,7 @@ * Copyright Contributors to the Zowe Project. */ -import { useState, useEffect } from "react"; +import { useState, useEffect, useRef } from "react"; import { Box, Button } from '@mui/material'; import { useAppSelector, useAppDispatch } from '../../hooks'; import { selectYaml,setNextStepEnabled, setYaml } from '../configuration-wizard/wizardSlice'; @@ -22,7 +22,7 @@ import { selectInitializationStatus, setInitializationStatus, setLaunchConfigSta import { setActiveStep } from "./progress/activeStepSlice"; import { TYPE_YAML, TYPE_OUTPUT, FALLBACK_YAML, ajv, INIT_STAGE_LABEL, LAUNCH_CONFIG_STAGE_LABEL } from "../common/Utils"; import { IResponse } from "../../../types/interfaces"; -import { getInstallationArguments, getProgress, isInitComplete } from "./progress/StageProgressStatus"; +import { getInstallationArguments, getProgress, isInitComplete, mapAndSetSubStepSkipStatus } from "./progress/StageProgressStatus"; import { selectConnectionArgs } from "./connection/connectionSlice"; import { alertEmitter } from "../Header"; @@ -442,6 +442,14 @@ const LaunchConfig = () => { const [isInitializationSkipped] = useState(!useAppSelector(selectInitializationStatus)); + const [stateUpdated, setStateUpdated] = useState(false); + const [stageStatus, setStageStatus] = useState(stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped); + const stageStatusRef = useRef(stageStatus); + + useEffect(() => { + stageStatusRef.current = stageStatus; + }, [stageStatus]); + useEffect(() => { if(!yaml){ @@ -461,12 +469,27 @@ const LaunchConfig = () => { dispatch(setNextStepEnabled(getProgress('launchConfigStatus'))); setIsFormInit(true); + updateProgress(!stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped); return () => { + mapAndSetSubStepSkipStatus(SUB_STAGE_ID, stageStatusRef.current); dispatch(setActiveStep({ activeStepIndex: STAGE_ID, isSubStep: SUB_STAGES, activeSubStepIndex: SUB_STAGE_ID })); } }, []); + const setStageSkipStatus = (status: boolean) => { + stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped = status; + stages[STAGE_ID].isSkipped = status; + setStageStatus(status); + } + + const updateProgress = (status: boolean) => { + setStateUpdated(!setStateUpdated); + setStageSkipStatus(!status); + dispatch(setLaunchConfigStatus(status)); + dispatch(setNextStepEnabled(status)); + } + const toggleEditorVisibility = (type: any) => { setContentType(type); setEditorVisible(!editorVisible); @@ -506,15 +529,15 @@ const LaunchConfig = () => { const onSaveYaml = (e: any) => { e.preventDefault(); + updateProgress(false); dispatch(setLaunchConfigStatus(false)); alertEmitter.emit('showAlert', 'Uploading yaml...', 'info'); window.electron.ipcRenderer.uploadLatestYaml(connectionArgs, installationArgs).then((res: IResponse) => { if(res && res.status) { - dispatch(setNextStepEnabled(true)); - dispatch(setLaunchConfigStatus(true)); + updateProgress(true); alertEmitter.emit('showAlert', res.details, 'success'); } else { - dispatch(setLaunchConfigStatus(false)); + updateProgress(false); alertEmitter.emit('showAlert', res.details, 'error'); } dispatch(setInitializationStatus(isInitComplete())); diff --git a/src/renderer/components/stages/Networking.tsx b/src/renderer/components/stages/Networking.tsx index 78a0c2e3..a179ec39 100644 --- a/src/renderer/components/stages/Networking.tsx +++ b/src/renderer/components/stages/Networking.tsx @@ -8,7 +8,7 @@ * Copyright Contributors to the Zowe Project. */ -import { useState, useEffect } from "react"; +import { useState, useEffect, useRef } from "react"; import { Box, Button, Checkbox, FormControlLabel, IconButton, SvgIcon, SvgIconProps, TextField } from '@mui/material'; import { useAppSelector, useAppDispatch } from '../../hooks'; import { selectYaml, setNextStepEnabled, setYaml } from '../configuration-wizard/wizardSlice'; @@ -22,7 +22,7 @@ import { setActiveStep } from "./progress/activeStepSlice"; import { TYPE_YAML, TYPE_JCL, TYPE_OUTPUT, ajv } from "../common/Utils"; import { IResponse } from "../../../types/interfaces"; import { selectConnectionArgs } from "./connection/connectionSlice"; -import { getInstallationArguments, getProgress, isInitComplete } from "./progress/StageProgressStatus"; +import { getInstallationArguments, getProgress, isInitComplete, mapAndSetSubStepSkipStatus } from "./progress/StageProgressStatus"; import { alertEmitter } from "../Header"; // const schema = useAppSelector(selectSchema); @@ -555,14 +555,16 @@ const Networking = () => { const [validate] = useState(() => ajv.getSchema("https://zowe.org/schemas/v2/server-base") || ajv.compile(schema)); const [LOOP_LIMIT] = useState(1024); - - // useEffect(() => { - // // dispatch(setYaml(yaml)); - // setModdedYaml(createModdedYaml(yaml)); - // }, [yaml]); + const [stateUpdated, setStateUpdated] = useState(false); + const [stageStatus, setStageStatus] = useState(stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped); + const stageStatusRef = useRef(stageStatus); const isInitializationSkipped = !useAppSelector(selectInitializationStatus); + useEffect(() => { + stageStatusRef.current = stageStatus; + }, [stageStatus]); + useEffect(() => { const nextPosition = document.getElementById('container-box-id'); if(nextPosition) nextPosition.scrollIntoView({behavior: 'smooth'}); @@ -570,11 +572,27 @@ const Networking = () => { dispatch(setNextStepEnabled(getProgress('networkingStatus'))); dispatch(setInitializationStatus(isInitComplete())); + updateProgress(!stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped); + return () => { + mapAndSetSubStepSkipStatus(SUB_STAGE_ID, stageStatusRef.current); dispatch(setActiveStep({ activeStepIndex: STAGE_ID, isSubStep: SUB_STAGES, activeSubStepIndex: SUB_STAGE_ID })); } }, []); + const setStageSkipStatus = (status: boolean) => { + stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped = status; + stages[STAGE_ID].isSkipped = status; + setStageStatus(status); + } + + const updateProgress = (status: boolean) => { + setStateUpdated(!setStateUpdated); + setStageSkipStatus(!status); + dispatch(setNetworkingStatus(status)); + dispatch(setNextStepEnabled(status)); + } + const toggleEditorVisibility = (type: any) => { setContentType(type); setEditorVisible(!editorVisible); @@ -609,15 +627,15 @@ const Networking = () => { const onSaveYaml = (e: any) => { e.preventDefault(); + updateProgress(false); alertEmitter.emit('showAlert', 'Uploading yaml...', 'info'); dispatch(setNetworkingStatus(false)); window.electron.ipcRenderer.uploadLatestYaml(connectionArgs, installationArgs).then((res: IResponse) => { if(res && res.status) { - dispatch(setNextStepEnabled(true)); - dispatch(setNetworkingStatus(true)); + updateProgress(true); alertEmitter.emit('showAlert', res.details, 'success'); } else { - dispatch(setNetworkingStatus(false)); + updateProgress(false); alertEmitter.emit('showAlert', res.details, 'error'); } dispatch(setInitializationStatus(isInitComplete())); From e87c70ae47d04ac19609bbf7cedc7ff8112f2c76 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Wed, 3 Jul 2024 14:54:22 +0530 Subject: [PATCH 31/65] Updating the progress slice --- .../components/stages/progress/progressSlice.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/renderer/components/stages/progress/progressSlice.ts b/src/renderer/components/stages/progress/progressSlice.ts index 719bed0f..f2faf24e 100644 --- a/src/renderer/components/stages/progress/progressSlice.ts +++ b/src/renderer/components/stages/progress/progressSlice.ts @@ -51,14 +51,8 @@ export const progressSlice = createSlice({ setProgress('downloadUnpaxStatus', action.payload); }, setInitializationStatus: (state, action: PayloadAction) => { - let status = false; - stages.map(stage => { - if(stage.subStages) { - status = stage.subStages.map(subStage => subStage.isSkipped).every(skip => skip === false); - } - }) - state.initializationStatus = status; - setProgress('initializationStatus', status); + state.initializationStatus = action.payload; + setProgress('initializationStatus', action.payload); }, setDatasetInstallationStatus: (state, action: PayloadAction) => { state.datasetInstallationStatus = action.payload; From 770dfbc0082a3832950f8c69e4f2977fc9472ad9 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Wed, 3 Jul 2024 14:54:49 +0530 Subject: [PATCH 32/65] Updating the launch config --- src/renderer/components/stages/LaunchConfig.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/renderer/components/stages/LaunchConfig.tsx b/src/renderer/components/stages/LaunchConfig.tsx index 29f4c55a..e107523f 100644 --- a/src/renderer/components/stages/LaunchConfig.tsx +++ b/src/renderer/components/stages/LaunchConfig.tsx @@ -467,9 +467,10 @@ const LaunchConfig = () => { nextPosition.scrollIntoView({behavior: 'smooth'}); dispatch(setNextStepEnabled(getProgress('launchConfigStatus'))); + dispatch(setInitializationStatus(isInitComplete())); setIsFormInit(true); - updateProgress(!stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped); + updateProgress(getProgress('launchConfigStatus') && !stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped); return () => { mapAndSetSubStepSkipStatus(SUB_STAGE_ID, stageStatusRef.current); From da1f59c945b0ba773085ce18616f0daa278d3d1d Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Wed, 3 Jul 2024 18:53:52 +0530 Subject: [PATCH 33/65] Complete code cleanup for the unpax stage --- src/renderer/components/stages/Unpax.tsx | 124 +++++++++++++++-------- 1 file changed, 84 insertions(+), 40 deletions(-) diff --git a/src/renderer/components/stages/Unpax.tsx b/src/renderer/components/stages/Unpax.tsx index 21f2fb9d..2dafb5a6 100644 --- a/src/renderer/components/stages/Unpax.tsx +++ b/src/renderer/components/stages/Unpax.tsx @@ -8,7 +8,7 @@ * Copyright Contributors to the Zowe Project. */ -import {useEffect, useState} from "react"; +import {useEffect, useRef, useState} from "react"; import { Box, Button, Link, Typography } from '@mui/material'; import ContainerCard from '../common/ContainerCard'; import { useAppSelector, useAppDispatch } from '../../hooks'; @@ -24,7 +24,8 @@ import ProgressCard from "../common/ProgressCard"; import { alertEmitter } from "../Header"; import { IResponse } from "../../../types/interfaces"; import { UNPAX_STAGE_LABEL } from "../common/Utils"; - +import { stages } from "../configuration-wizard/Wizard"; +import { DownloadUnpaxState } from "../../../../src/types/stateInterfaces"; const Unpax = () => { // TODO: Display granular details of installation - downloading - unpacking - running zwe command @@ -43,16 +44,46 @@ const Unpax = () => { const [yaml, setLYaml] = useState(useAppSelector(selectYaml)); const version = useAppSelector(selectZoweVersion); + const [stateUpdated, setStateUpdated] = useState(false); + const [stageStatus, setStageStatus] = useState(stages[STAGE_ID].isSkipped); + const stageStatusRef = useRef(stageStatus); + const [installationArgs, setInstArgs] = useState(getInstallationArguments()); let timer: any; + useEffect(() => { + stageStatusRef.current = stageStatus; + }, [stageStatus]); + + useEffect(() => { + window.electron.ipcRenderer.getConfigByKey("installationArgs").then((res: IResponse) => { + if(res != undefined){ + setInstArgs((res as any)); + } + }) + let nextPosition; + if(getProgress('downloadUnpaxStatus')) { + nextPosition = document.getElementById('download-progress-card'); + nextPosition?.scrollIntoView({ behavior: 'smooth', block: 'start' }); + } + + updateProgress(getProgress('downloadUnpaxStatus') && !stages[STAGE_ID].isSkipped); + + dispatch(setNextStepEnabled(getProgress('downloadUnpaxStatus'))); + dispatch(setDownloadUnpaxStatus(getProgress('downloadUnpaxStatus'))); + + return () => { + mapAndSetStepSkipStatus(STAGE_ID, stageStatusRef.current); + dispatch(setActiveStep({ activeStepIndex: STAGE_ID, isSubStep: SUB_STAGES, activeSubStepIndex: 0 })); + } + }, []); + useEffect(() => { const stageComplete = downloadUnpaxProgress.uploadYaml && downloadUnpaxProgress.download && downloadUnpaxProgress.upload && downloadUnpaxProgress.unpax; if(!stageComplete && showProgress) { timer = setInterval(() => { window.electron.ipcRenderer.getDownloadUnpaxProgress().then((res: any) => { - setDownloadUnpaxProgress(res); - setDownloadUnpaxState(res); + setDownloadAndUnpaxProgress(res) if(stageComplete){ setStageStatus(true); clearInterval(timer); @@ -63,77 +94,90 @@ const Unpax = () => { return () => { clearInterval(timer); }; - }, [showProgress]); + }, [showProgress, stateUpdated]); + + useEffect(() => { + const allAttributesTrue = Object.values(downloadUnpaxProgress).every(value => value === true); + if(allAttributesTrue) { + dispatch(setDownloadUnpaxStatus(true)); + dispatch(setNextStepEnabled(true)); + setShowProgress(getProgress('downloadUnpaxStatus')); + } + }, [downloadUnpaxProgress]); + + const setDownloadAndUnpaxProgress = (downloadUnpaxState: DownloadUnpaxState) => { + setDownloadUnpaxProgress(downloadUnpaxState); + setDownloadUnpaxState(downloadUnpaxState); + const allAttributesTrue = Object.values(downloadUnpaxState).every(value => value === true); + if(allAttributesTrue) { + dispatch(setDownloadUnpaxStatus(true)); + dispatch(setNextStepEnabled(true)); + } + } + + const setStageSkipStatus = (status: boolean) => { + stages[STAGE_ID].isSkipped = status; + setStageStatus(status); + } + + const updateProgress = (status: boolean) => { + setStateUpdated(!stateUpdated); + setStageSkipStatus(!status); + if(!status) { + for (let key in downloadUnpaxProgress) { + downloadUnpaxProgress[key as keyof DownloadUnpaxState] = false; + setDownloadUnpaxState(downloadUnpaxProgress); + } + } + const allAttributesTrue = Object.values(downloadUnpaxProgress).every(value => value === true); + status = allAttributesTrue ? true : false; + dispatch(setDownloadUnpaxStatus(status)); + dispatch(setNextStepEnabled(status)); + setDownloadAndUnpaxProgress(getDownloadUnpaxState()); + } const process = (event: any) => { event.preventDefault(); - setStageStatus(false); + updateProgress(false); setShowProgress(true); - setDownloadUnpaxProgress(downloadUnpaxStatus); - dispatch(setNextStepEnabled(false)); window.electron.ipcRenderer.downloadButtonOnClick(connectionArgs, {...installationArgs, userUploadedPaxPath: paxPath}, version).then((res: IResponse) => { if(!res.status){ //errors during runInstallation() alertEmitter.emit('showAlert', res.details, 'error'); + updateProgress(false); } if(res.details?.mergedYaml != undefined){ dispatch(setYaml(res.details.mergedYaml)); window.electron.ipcRenderer.setConfig(res.details.mergedYaml); } - setStageStatus(res.status); clearInterval(timer); + updateProgress(res.status); }).catch(() => { clearInterval(timer); - setStageStatus(false); + updateProgress(false); }); } const fetchExampleYaml = (event: any) => { event.preventDefault(); setShowProgress(true); - dispatch(setDownloadUnpaxStatus(false)); - setDownloadUnpaxProgress(downloadUnpaxStatus); - dispatch(setNextStepEnabled(false)); + updateProgress(false); window.electron.ipcRenderer.fetchExampleYamlBtnOnClick(connectionArgs, installationArgs).then((res: IResponse) => { if(!res.status){ //errors during runInstallation() alertEmitter.emit('showAlert', res.details.message ? res.details.message : res.details, 'error'); + updateProgress(false); } if(res.details?.mergedYaml != undefined){ dispatch(setYaml(res.details.mergedYaml)); window.electron.ipcRenderer.setConfig(res.details.mergedYaml); } - dispatch(setNextStepEnabled(res.status)); - dispatch(setDownloadUnpaxStatus(res.status)); + updateProgress(res.status); clearInterval(timer); }).catch(() => { clearInterval(timer); - dispatch(setNextStepEnabled(false)); + updateProgress(false); }); } - useEffect(() => { - window.electron.ipcRenderer.getConfigByKey("installationArgs").then((res: IResponse) => { - if(res != undefined){ - setInstArgs((res as any)); - } - }) - let nextPosition; - if(getProgress('downloadUnpaxStatus')) { - nextPosition = document.getElementById('download-progress-card'); - nextPosition?.scrollIntoView({ behavior: 'smooth', block: 'start' }); - } - dispatch(setNextStepEnabled(getProgress('downloadUnpaxStatus'))); - dispatch(setDownloadUnpaxStatus(getProgress('downloadUnpaxStatus'))); - return () => { - dispatch(setActiveStep({ activeStepIndex: STAGE_ID, isSubStep: SUB_STAGES, activeSubStepIndex: 0 })); - } - }, []); - - const setStageStatus = (status: boolean) => { - dispatch(setNextStepEnabled(status)); - dispatch(setDownloadUnpaxStatus(status)); - mapAndSetStepSkipStatus(STAGE_ID, !status); - } - return (<> {installValue === "smpe" && From 7ec4f9a8d72a1e320a769f62549edf56cd267e49 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Wed, 3 Jul 2024 19:08:02 +0530 Subject: [PATCH 34/65] minor cleanuo --- src/renderer/components/stages/progress/StageProgressStatus.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/components/stages/progress/StageProgressStatus.ts b/src/renderer/components/stages/progress/StageProgressStatus.ts index 55971484..a8aa7f85 100644 --- a/src/renderer/components/stages/progress/StageProgressStatus.ts +++ b/src/renderer/components/stages/progress/StageProgressStatus.ts @@ -580,7 +580,7 @@ export const getCompleteProgress = () : ProgressState => { export const isInitComplete = (): boolean => { const progress = localStorage.getItem(progressStateKey); if(progress) { - const data:any = unflatten(JSON.parse(progress)); + const data:any = unflatten(JSON.parse(progress)); return data.datasetInstallationStatus && data.networkingStatus && data.apfAuthStatus && data.securityStatus && data.stcsStatus && data.certificateStatus && data.vsamStatus && data.launchConfigStatus; } else { return false; From 6659c792a2ee4aa52f9382c5d5655b92ace4916c Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Wed, 3 Jul 2024 19:20:28 +0530 Subject: [PATCH 35/65] code fix --- src/renderer/components/stages/Initialization.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/renderer/components/stages/Initialization.tsx b/src/renderer/components/stages/Initialization.tsx index 9f37ece3..a60fe812 100644 --- a/src/renderer/components/stages/Initialization.tsx +++ b/src/renderer/components/stages/Initialization.tsx @@ -12,14 +12,16 @@ import React, {useEffect} from "react"; import { useAppDispatch } from '../../hooks'; import ContainerCard from '../common/ContainerCard'; import { setActiveStep } from "./progress/activeStepSlice"; +import { getStageDetails } from "../../../../src/services/StageDetails"; const Initialization = () => { - const STAGE_ID = 3; - const SUB_STAGES = true; - const dispatch = useAppDispatch(); + const stageLabel = 'Initialization'; + const STAGE_ID = getStageDetails(stageLabel).id; + const SUB_STAGES = true; + useEffect(() => { return () => { dispatch(setActiveStep({ activeStepIndex: STAGE_ID, isSubStep: SUB_STAGES, activeSubStepIndex: 0 })); From 1475c72aebce9ca9e763a023a9194d2875e93a3b Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Wed, 3 Jul 2024 19:29:47 +0530 Subject: [PATCH 36/65] Code cleanup --- src/renderer/components/stages/Certificates.tsx | 6 +++--- src/renderer/components/stages/InitApfAuth.tsx | 6 +++--- src/renderer/components/stages/LaunchConfig.tsx | 6 +++--- src/renderer/components/stages/Networking.tsx | 6 +++--- src/renderer/components/stages/Security.tsx | 8 ++++---- src/renderer/components/stages/Stcs.tsx | 6 +++--- src/renderer/components/stages/Vsam.tsx | 6 +++--- .../components/stages/installation/Installation.tsx | 6 +++--- .../components/stages/progress/StageProgressStatus.ts | 6 ++++-- 9 files changed, 29 insertions(+), 27 deletions(-) diff --git a/src/renderer/components/stages/Certificates.tsx b/src/renderer/components/stages/Certificates.tsx index 5f8d408a..d8af1c60 100644 --- a/src/renderer/components/stages/Certificates.tsx +++ b/src/renderer/components/stages/Certificates.tsx @@ -24,7 +24,7 @@ import { createTheme } from '@mui/material/styles'; import { stages } from "../configuration-wizard/Wizard"; import { setActiveStep } from "./progress/activeStepSlice"; import { getStageDetails, getSubStageDetails } from "../../../services/StageDetails"; -import { getProgress, setCertificateInitState, getCertificateInitState, mapAndSetSubStepSkipStatus, getInstallationArguments, isInitComplete } from "./progress/StageProgressStatus"; +import { getProgress, setCertificateInitState, getCertificateInitState, mapAndSetSubStepSkipStatus, getInstallationArguments, isInitializationStageComplete } from "./progress/StageProgressStatus"; import { CertInitSubStepsState } from "../../../types/stateInterfaces"; import { TYPE_YAML, TYPE_OUTPUT, INIT_STAGE_LABEL, CERTIFICATES_STAGE_LABEL, ajv, deepMerge } from "../common/Utils"; @@ -66,7 +66,7 @@ const Certificates = () => { }, [stageStatus]); useEffect(() => { - dispatch(setInitializationStatus(isInitComplete())); + dispatch(setInitializationStatus(isInitializationStageComplete())); if(getProgress('certificateStatus')) { const nextPosition = document.getElementById('start-certificate-progress'); nextPosition.scrollIntoView({ behavior: 'smooth', block: 'start' }); @@ -152,7 +152,7 @@ const Certificates = () => { const allAttributesTrue = Object.values(certificateInitProgress).every(value => value === true); status = allAttributesTrue ? true : false; dispatch(setNextStepEnabled(status)); - dispatch(setInitializationStatus(isInitComplete())); + dispatch(setInitializationStatus(isInitializationStageComplete())); dispatch(setCertificateStatus(status)); setCertificateInitializationProgress(getCertificateInitState()); } diff --git a/src/renderer/components/stages/InitApfAuth.tsx b/src/renderer/components/stages/InitApfAuth.tsx index a28c83e9..8af2a3c8 100644 --- a/src/renderer/components/stages/InitApfAuth.tsx +++ b/src/renderer/components/stages/InitApfAuth.tsx @@ -23,7 +23,7 @@ import { alertEmitter } from "../Header"; import { stages } from "../configuration-wizard/Wizard"; import { setActiveStep } from "./progress/activeStepSlice"; import { getStageDetails, getSubStageDetails } from "../../../services/StageDetails"; -import { getProgress, setApfAuthState, getApfAuthState, mapAndSetSubStepSkipStatus, getInstallationArguments, isInitComplete } from "./progress/StageProgressStatus"; +import { getProgress, setApfAuthState, getApfAuthState, mapAndSetSubStepSkipStatus, getInstallationArguments, isInitializationStageComplete } from "./progress/StageProgressStatus"; import { InitSubStepsState } from "../../../types/stateInterfaces"; import { JCL_UNIX_SCRIPT_OK, FALLBACK_YAML, INIT_STAGE_LABEL, APF_AUTH_STAGE_LABEL, ajv, SERVER_COMMON } from "../common/Utils"; @@ -63,7 +63,7 @@ const InitApfAuth = () => { }, [stageStatus]); useEffect(() => { - dispatch(setInitializationStatus(isInitComplete())); + dispatch(setInitializationStatus(isInitializationStageComplete())); let nextPosition; if(getProgress('apfAuthStatus')) { nextPosition = document.getElementById('start-apf-progress'); @@ -155,7 +155,7 @@ const InitApfAuth = () => { const allAttributesTrue = Object.values(apfAuthInitProgress).every(value => value === true); status = allAttributesTrue ? true : false; dispatch(setNextStepEnabled(status)); - dispatch(setInitializationStatus(isInitComplete())); + dispatch(setInitializationStatus(isInitializationStageComplete())); dispatch(setApfAuthStatus(status)); setApfAuthorizationInitProgress(getApfAuthState()); } diff --git a/src/renderer/components/stages/LaunchConfig.tsx b/src/renderer/components/stages/LaunchConfig.tsx index e107523f..d1de351c 100644 --- a/src/renderer/components/stages/LaunchConfig.tsx +++ b/src/renderer/components/stages/LaunchConfig.tsx @@ -22,7 +22,7 @@ import { selectInitializationStatus, setInitializationStatus, setLaunchConfigSta import { setActiveStep } from "./progress/activeStepSlice"; import { TYPE_YAML, TYPE_OUTPUT, FALLBACK_YAML, ajv, INIT_STAGE_LABEL, LAUNCH_CONFIG_STAGE_LABEL } from "../common/Utils"; import { IResponse } from "../../../types/interfaces"; -import { getInstallationArguments, getProgress, isInitComplete, mapAndSetSubStepSkipStatus } from "./progress/StageProgressStatus"; +import { getInstallationArguments, getProgress, isInitializationStageComplete, mapAndSetSubStepSkipStatus } from "./progress/StageProgressStatus"; import { selectConnectionArgs } from "./connection/connectionSlice"; import { alertEmitter } from "../Header"; @@ -467,7 +467,7 @@ const LaunchConfig = () => { nextPosition.scrollIntoView({behavior: 'smooth'}); dispatch(setNextStepEnabled(getProgress('launchConfigStatus'))); - dispatch(setInitializationStatus(isInitComplete())); + dispatch(setInitializationStatus(isInitializationStageComplete())); setIsFormInit(true); updateProgress(getProgress('launchConfigStatus') && !stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped); @@ -541,7 +541,7 @@ const LaunchConfig = () => { updateProgress(false); alertEmitter.emit('showAlert', res.details, 'error'); } - dispatch(setInitializationStatus(isInitComplete())); + dispatch(setInitializationStatus(isInitializationStageComplete())); }); } diff --git a/src/renderer/components/stages/Networking.tsx b/src/renderer/components/stages/Networking.tsx index a179ec39..a2836c9f 100644 --- a/src/renderer/components/stages/Networking.tsx +++ b/src/renderer/components/stages/Networking.tsx @@ -22,7 +22,7 @@ import { setActiveStep } from "./progress/activeStepSlice"; import { TYPE_YAML, TYPE_JCL, TYPE_OUTPUT, ajv } from "../common/Utils"; import { IResponse } from "../../../types/interfaces"; import { selectConnectionArgs } from "./connection/connectionSlice"; -import { getInstallationArguments, getProgress, isInitComplete, mapAndSetSubStepSkipStatus } from "./progress/StageProgressStatus"; +import { getInstallationArguments, getProgress, isInitializationStageComplete, mapAndSetSubStepSkipStatus } from "./progress/StageProgressStatus"; import { alertEmitter } from "../Header"; // const schema = useAppSelector(selectSchema); @@ -570,7 +570,7 @@ const Networking = () => { if(nextPosition) nextPosition.scrollIntoView({behavior: 'smooth'}); dispatch(setNextStepEnabled(getProgress('networkingStatus'))); - dispatch(setInitializationStatus(isInitComplete())); + dispatch(setInitializationStatus(isInitializationStageComplete())); updateProgress(!stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped); @@ -638,7 +638,7 @@ const Networking = () => { updateProgress(false); alertEmitter.emit('showAlert', res.details, 'error'); } - dispatch(setInitializationStatus(isInitComplete())); + dispatch(setInitializationStatus(isInitializationStageComplete())); }); } diff --git a/src/renderer/components/stages/Security.tsx b/src/renderer/components/stages/Security.tsx index da966da9..747a3afc 100644 --- a/src/renderer/components/stages/Security.tsx +++ b/src/renderer/components/stages/Security.tsx @@ -24,7 +24,7 @@ import { createTheme } from '@mui/material/styles'; import { stages } from "../configuration-wizard/Wizard"; import { setActiveStep } from "./progress/activeStepSlice"; import { getStageDetails, getSubStageDetails } from "../../../services/StageDetails"; -import { setProgress, getProgress, setSecurityInitState, getSecurityInitState, mapAndSetSubStepSkipStatus, getInstallationArguments, isInitComplete } from "./progress/StageProgressStatus"; +import { setProgress, getProgress, setSecurityInitState, getSecurityInitState, mapAndSetSubStepSkipStatus, getInstallationArguments, isInitializationStageComplete } from "./progress/StageProgressStatus"; import { InitSubStepsState } from "../../../types/stateInterfaces"; import { JCL_UNIX_SCRIPT_OK, INIT_STAGE_LABEL, SECURITY_STAGE_LABEL, ajv, SERVER_COMMON } from '../common/Utils'; import { alertEmitter } from "../Header"; @@ -67,7 +67,7 @@ const Security = () => { }, [stageStatus]); useEffect(() => { - dispatch(setInitializationStatus(isInitComplete())); + dispatch(setInitializationStatus(isInitializationStageComplete())); setShowProgress(initClicked || getProgress('securityStatus')); let nextPosition; @@ -153,7 +153,7 @@ const Security = () => { } const allAttributesTrue = Object.values(securityInitProgress).every(value => value === true); status = allAttributesTrue ? true : false; - dispatch(setInitializationStatus(isInitComplete())); + dispatch(setInitializationStatus(isInitializationStageComplete())); dispatch(setSecurityStatus(status)); dispatch(setNextStepEnabled(status)); setSecurityInitializationProgress(getSecurityInitState()); @@ -203,7 +203,7 @@ const Security = () => { const securityProceedActions = (status: boolean) => { dispatch(setNextStepEnabled(status)); dispatch(setSecurityStatus(status)); - dispatch(setInitializationStatus(isInitComplete())); + dispatch(setInitializationStatus(isInitializationStageComplete())); } const handleFormChange = (data: any) => { diff --git a/src/renderer/components/stages/Stcs.tsx b/src/renderer/components/stages/Stcs.tsx index 07af20ca..9de91d17 100644 --- a/src/renderer/components/stages/Stcs.tsx +++ b/src/renderer/components/stages/Stcs.tsx @@ -22,7 +22,7 @@ import { createTheme } from '@mui/material/styles'; import { stages } from "../configuration-wizard/Wizard"; import { setActiveStep } from "./progress/activeStepSlice"; import { getStageDetails, getSubStageDetails } from "../../../services/StageDetails"; -import { getProgress, setStcsInitState, getStcsInitState, mapAndSetSubStepSkipStatus, getInstallationArguments, isInitComplete } from "./progress/StageProgressStatus"; +import { getProgress, setStcsInitState, getStcsInitState, mapAndSetSubStepSkipStatus, getInstallationArguments, isInitializationStageComplete } from "./progress/StageProgressStatus"; import { InitSubStepsState } from "../../../types/stateInterfaces"; import { alertEmitter } from "../Header"; import { INIT_STAGE_LABEL, STC_STAGE_LABEL, ajv } from "../common/Utils"; @@ -70,7 +70,7 @@ const Stcs = () => { }, [stageStatus]); useEffect(() => { - dispatch(setInitializationStatus(isInitComplete())); + dispatch(setInitializationStatus(isInitializationStageComplete())); setShowProgress(initClicked || getProgress('stcsStatus')); let nextPosition; @@ -165,7 +165,7 @@ const Stcs = () => { } const allAttributesTrue = Object.values(stcsInitProgress).every(value => value === true); status = allAttributesTrue ? true : false; - dispatch(setInitializationStatus(isInitComplete())); + dispatch(setInitializationStatus(isInitializationStageComplete())); dispatch(setStcsStatus(status)); dispatch(setNextStepEnabled(status)); setStcsInitializationProgress(getStcsInitState()); diff --git a/src/renderer/components/stages/Vsam.tsx b/src/renderer/components/stages/Vsam.tsx index 926dc161..27fe94d6 100644 --- a/src/renderer/components/stages/Vsam.tsx +++ b/src/renderer/components/stages/Vsam.tsx @@ -24,7 +24,7 @@ import { createTheme } from '@mui/material/styles'; import { stages } from "../configuration-wizard/Wizard"; import { setActiveStep } from "./progress/activeStepSlice"; import { getStageDetails, getSubStageDetails } from "../../../services/StageDetails"; -import { getProgress, setVsamInitState, mapAndSetSubStepSkipStatus, getInstallationArguments, getVsamInitState, isInitComplete } from "./progress/StageProgressStatus"; +import { getProgress, setVsamInitState, mapAndSetSubStepSkipStatus, getInstallationArguments, getVsamInitState, isInitializationStageComplete } from "./progress/StageProgressStatus"; import { InitSubStepsState } from "../../../types/stateInterfaces"; import { alertEmitter } from "../Header"; import { INIT_STAGE_LABEL, ajv } from "../common/Utils"; @@ -72,7 +72,7 @@ const Vsam = () => { }, [stageStatus]); useEffect(() => { - dispatch(setInitializationStatus(isInitComplete())); + dispatch(setInitializationStatus(isInitializationStageComplete())); setShowProgress(initClicked || getProgress('vsamStatus')); let nextPosition; @@ -164,7 +164,7 @@ const Vsam = () => { } const allAttributesTrue = Object.values(vsamInitProgress).every(value => value === true); status = allAttributesTrue ? true : false; - dispatch(setInitializationStatus(isInitComplete())); + dispatch(setInitializationStatus(isInitializationStageComplete())); dispatch(setVsamStatus(status)); dispatch(setNextStepEnabled(status)); setVsamInitializationProgress(getVsamInitState()); diff --git a/src/renderer/components/stages/installation/Installation.tsx b/src/renderer/components/stages/installation/Installation.tsx index ea63ef99..af1f4345 100644 --- a/src/renderer/components/stages/installation/Installation.tsx +++ b/src/renderer/components/stages/installation/Installation.tsx @@ -26,7 +26,7 @@ import {stages} from "../../configuration-wizard/Wizard"; import { setActiveStep } from "../progress/activeStepSlice"; import { TYPE_YAML, TYPE_OUTPUT, JCL_UNIX_SCRIPT_OK, FALLBACK_YAML, ajv, INIT_STAGE_LABEL, INSTALL_STAGE_LABEL} from '../../common/Utils'; import { getStageDetails, getSubStageDetails } from "../../../../services/StageDetails"; -import { getProgress, setDatasetInstallationState, getDatasetInstallationState, getInstallationTypeStatus, mapAndSetSubStepSkipStatus, getInstallationArguments, datasetInstallationStatus, isInitComplete } from "../progress/StageProgressStatus"; +import { getProgress, setDatasetInstallationState, getDatasetInstallationState, getInstallationTypeStatus, mapAndSetSubStepSkipStatus, getInstallationArguments, datasetInstallationStatus, isInitializationStageComplete } from "../progress/StageProgressStatus"; import { DatasetInstallationState } from "../../../../types/stateInterfaces"; import eventDispatcher from '../../../../services/eventDispatcher'; @@ -75,7 +75,7 @@ const Installation = () => { }, [stageStatus]); useEffect(() => { - dispatch(setInitializationStatus(isInitComplete())); + dispatch(setInitializationStatus(isInitializationStageComplete())); if(getProgress("datasetInstallationStatus")) { const nextPosition = document.getElementById('save-installation-progress'); if(nextPosition) nextPosition.scrollIntoView({ behavior: 'smooth', block: 'start' }); @@ -296,7 +296,7 @@ const Installation = () => { const installProceedActions = (status: boolean) => { dispatch(setNextStepEnabled(status)); dispatch(setDatasetInstallationStatus(status)); - dispatch(setInitializationStatus(isInitComplete())); + dispatch(setInitializationStatus(isInitializationStageComplete())); } const debouncedChange = useCallback( diff --git a/src/renderer/components/stages/progress/StageProgressStatus.ts b/src/renderer/components/stages/progress/StageProgressStatus.ts index a8aa7f85..00880071 100644 --- a/src/renderer/components/stages/progress/StageProgressStatus.ts +++ b/src/renderer/components/stages/progress/StageProgressStatus.ts @@ -11,6 +11,7 @@ import { flatten, unflatten } from 'flat'; import { ProgressState, PlanningState, InstallationType, ActiveState, DatasetInstallationState, InitSubStepsState, CertInitSubStepsState, PlanningValidationDetails, subStepState, stepSkipState, InstallationArgs, DownloadUnpaxState} from '../../../../types/stateInterfaces'; import { stages } from '../../configuration-wizard/Wizard'; +// import { getStageDetails } from '../../../../../src/services/StageDetails'; const installationTypeStatus: InstallationType = { installationType: 'download', @@ -577,11 +578,12 @@ export const getCompleteProgress = () : ProgressState => { } } -export const isInitComplete = (): boolean => { +export const isInitializationStageComplete = (): boolean => { const progress = localStorage.getItem(progressStateKey); if(progress) { const data:any = unflatten(JSON.parse(progress)); - return data.datasetInstallationStatus && data.networkingStatus && data.apfAuthStatus && data.securityStatus && data.stcsStatus && data.certificateStatus && data.vsamStatus && data.launchConfigStatus; + const status = data.datasetInstallationStatus && data.networkingStatus && data.apfAuthStatus && data.securityStatus && data.stcsStatus && data.certificateStatus && data.vsamStatus && data.launchConfigStatus; + return status; } else { return false; } From f91ccbc03bfcfbf259865e48428b082081aea2cf Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Wed, 3 Jul 2024 19:39:17 +0530 Subject: [PATCH 37/65] More cleanup --- .../components/stages/progress/StageProgressStatus.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/renderer/components/stages/progress/StageProgressStatus.ts b/src/renderer/components/stages/progress/StageProgressStatus.ts index 00880071..b2ed484c 100644 --- a/src/renderer/components/stages/progress/StageProgressStatus.ts +++ b/src/renderer/components/stages/progress/StageProgressStatus.ts @@ -11,7 +11,6 @@ import { flatten, unflatten } from 'flat'; import { ProgressState, PlanningState, InstallationType, ActiveState, DatasetInstallationState, InitSubStepsState, CertInitSubStepsState, PlanningValidationDetails, subStepState, stepSkipState, InstallationArgs, DownloadUnpaxState} from '../../../../types/stateInterfaces'; import { stages } from '../../configuration-wizard/Wizard'; -// import { getStageDetails } from '../../../../../src/services/StageDetails'; const installationTypeStatus: InstallationType = { installationType: 'download', @@ -582,8 +581,7 @@ export const isInitializationStageComplete = (): boolean => { const progress = localStorage.getItem(progressStateKey); if(progress) { const data:any = unflatten(JSON.parse(progress)); - const status = data.datasetInstallationStatus && data.networkingStatus && data.apfAuthStatus && data.securityStatus && data.stcsStatus && data.certificateStatus && data.vsamStatus && data.launchConfigStatus; - return status; + return data.datasetInstallationStatus && data.networkingStatus && data.apfAuthStatus && data.securityStatus && data.stcsStatus && data.certificateStatus && data.vsamStatus && data.launchConfigStatus; } else { return false; } From 41e3fad3eae814e0c0458254d453f1053127051e Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Wed, 3 Jul 2024 20:42:59 +0530 Subject: [PATCH 38/65] Updating the substages logic --- src/renderer/components/stages/Certificates.tsx | 5 ++--- src/renderer/components/stages/InitApfAuth.tsx | 5 ++--- src/renderer/components/stages/LaunchConfig.tsx | 4 ++-- src/renderer/components/stages/Networking.tsx | 4 ++-- src/renderer/components/stages/Security.tsx | 4 ++-- src/renderer/components/stages/Stcs.tsx | 4 ++-- src/renderer/components/stages/Vsam.tsx | 4 ++-- src/renderer/components/stages/installation/Installation.tsx | 4 ++-- 8 files changed, 16 insertions(+), 18 deletions(-) diff --git a/src/renderer/components/stages/Certificates.tsx b/src/renderer/components/stages/Certificates.tsx index d8af1c60..918c6432 100644 --- a/src/renderer/components/stages/Certificates.tsx +++ b/src/renderer/components/stages/Certificates.tsx @@ -135,14 +135,12 @@ const Certificates = () => { const setStageSkipStatus = (status: boolean) => { stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped = status; - stages[STAGE_ID].isSkipped = status; + stages[STAGE_ID].isSkipped = !isInitializationStageComplete(); setStageStatus(status); } const updateProgress = (status: boolean) => { setStateUpdated(!stateUpdated); - setStageSkipStatus(!status); - if(!status) { for (let key in certificateInitProgress) { certificateInitProgress[key as keyof(CertInitSubStepsState)] = false; @@ -155,6 +153,7 @@ const Certificates = () => { dispatch(setInitializationStatus(isInitializationStageComplete())); dispatch(setCertificateStatus(status)); setCertificateInitializationProgress(getCertificateInitState()); + setStageSkipStatus(!status); } const reinitialize = (event: any) => { diff --git a/src/renderer/components/stages/InitApfAuth.tsx b/src/renderer/components/stages/InitApfAuth.tsx index 8af2a3c8..d95a8b50 100644 --- a/src/renderer/components/stages/InitApfAuth.tsx +++ b/src/renderer/components/stages/InitApfAuth.tsx @@ -138,14 +138,12 @@ const InitApfAuth = () => { const setStageSkipStatus = (status: boolean) => { stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped = status; - stages[STAGE_ID].isSkipped = status; + stages[STAGE_ID].isSkipped = !isInitializationStageComplete(); setStageStatus(status); } const updateProgress = (status: boolean) => { setStateUpdated(!stateUpdated); - setStageSkipStatus(!status); - if(!status) { for (let key in apfAuthInitProgress) { apfAuthInitProgress[key as keyof(InitSubStepsState)] = false; @@ -158,6 +156,7 @@ const InitApfAuth = () => { dispatch(setInitializationStatus(isInitializationStageComplete())); dispatch(setApfAuthStatus(status)); setApfAuthorizationInitProgress(getApfAuthState()); + setStageSkipStatus(!status); } const toggleEditorVisibility = (type: any) => { diff --git a/src/renderer/components/stages/LaunchConfig.tsx b/src/renderer/components/stages/LaunchConfig.tsx index d1de351c..d339d15f 100644 --- a/src/renderer/components/stages/LaunchConfig.tsx +++ b/src/renderer/components/stages/LaunchConfig.tsx @@ -480,15 +480,15 @@ const LaunchConfig = () => { const setStageSkipStatus = (status: boolean) => { stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped = status; - stages[STAGE_ID].isSkipped = status; + stages[STAGE_ID].isSkipped = !isInitializationStageComplete(); setStageStatus(status); } const updateProgress = (status: boolean) => { setStateUpdated(!setStateUpdated); - setStageSkipStatus(!status); dispatch(setLaunchConfigStatus(status)); dispatch(setNextStepEnabled(status)); + setStageSkipStatus(!status); } const toggleEditorVisibility = (type: any) => { diff --git a/src/renderer/components/stages/Networking.tsx b/src/renderer/components/stages/Networking.tsx index a2836c9f..106f784c 100644 --- a/src/renderer/components/stages/Networking.tsx +++ b/src/renderer/components/stages/Networking.tsx @@ -582,15 +582,15 @@ const Networking = () => { const setStageSkipStatus = (status: boolean) => { stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped = status; - stages[STAGE_ID].isSkipped = status; + stages[STAGE_ID].isSkipped = !isInitializationStageComplete(); setStageStatus(status); } const updateProgress = (status: boolean) => { setStateUpdated(!setStateUpdated); - setStageSkipStatus(!status); dispatch(setNetworkingStatus(status)); dispatch(setNextStepEnabled(status)); + setStageSkipStatus(!status); } const toggleEditorVisibility = (type: any) => { diff --git a/src/renderer/components/stages/Security.tsx b/src/renderer/components/stages/Security.tsx index 747a3afc..66a1565c 100644 --- a/src/renderer/components/stages/Security.tsx +++ b/src/renderer/components/stages/Security.tsx @@ -138,13 +138,12 @@ const Security = () => { const setStageSkipStatus = (status: boolean) => { stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped = status; - stages[STAGE_ID].isSkipped = status; + stages[STAGE_ID].isSkipped = !isInitializationStageComplete(); setStageStatus(status); } const updateProgress = (status: boolean) => { setStateUpdated(!stateUpdated); - setStageSkipStatus(!status); if(!status) { for (let key in securityInitProgress) { securityInitProgress[key as keyof(InitSubStepsState)] = false; @@ -157,6 +156,7 @@ const Security = () => { dispatch(setSecurityStatus(status)); dispatch(setNextStepEnabled(status)); setSecurityInitializationProgress(getSecurityInitState()); + setStageSkipStatus(!status); } const toggleEditorVisibility = (type: any) => { diff --git a/src/renderer/components/stages/Stcs.tsx b/src/renderer/components/stages/Stcs.tsx index 9de91d17..eba6de64 100644 --- a/src/renderer/components/stages/Stcs.tsx +++ b/src/renderer/components/stages/Stcs.tsx @@ -150,13 +150,12 @@ const Stcs = () => { const setStageSkipStatus = (status: boolean) => { stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped = status; - stages[STAGE_ID].isSkipped = status; + stages[STAGE_ID].isSkipped = !isInitializationStageComplete(); setStageStatus(status); } const updateProgress = (status: boolean) => { setStateUpdated(!stateUpdated); - setStageSkipStatus(!status); if(!status) { for (let key in stcsInitProgress) { stcsInitProgress[key as keyof(InitSubStepsState)] = false; @@ -169,6 +168,7 @@ const Stcs = () => { dispatch(setStcsStatus(status)); dispatch(setNextStepEnabled(status)); setStcsInitializationProgress(getStcsInitState()); + setStageSkipStatus(!status); } const toggleEditorVisibility = (type: any) => { diff --git a/src/renderer/components/stages/Vsam.tsx b/src/renderer/components/stages/Vsam.tsx index 27fe94d6..4f500c11 100644 --- a/src/renderer/components/stages/Vsam.tsx +++ b/src/renderer/components/stages/Vsam.tsx @@ -149,13 +149,12 @@ const Vsam = () => { const setStageSkipStatus = (status: boolean) => { stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped = status; - stages[STAGE_ID].isSkipped = status; + stages[STAGE_ID].isSkipped = !isInitializationStageComplete(); setStageStatus(status); } const updateProgress = (status: boolean) => { setStateUpdated(!stateUpdated); - setStageSkipStatus(!status); if(!status) { for (let key in vsamInitProgress) { vsamInitProgress[key as keyof(InitSubStepsState)] = false; @@ -168,6 +167,7 @@ const Vsam = () => { dispatch(setVsamStatus(status)); dispatch(setNextStepEnabled(status)); setVsamInitializationProgress(getVsamInitState()); + setStageSkipStatus(!status); } const toggleEditorVisibility = (type: any) => { diff --git a/src/renderer/components/stages/installation/Installation.tsx b/src/renderer/components/stages/installation/Installation.tsx index af1f4345..6698cc2b 100644 --- a/src/renderer/components/stages/installation/Installation.tsx +++ b/src/renderer/components/stages/installation/Installation.tsx @@ -226,13 +226,12 @@ const Installation = () => { const setStageSkipStatus = (status: boolean) => { stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped = status; - stages[STAGE_ID].isSkipped = status; + stages[STAGE_ID].isSkipped = !isInitializationStageComplete(); setStageStatus(status); } const updateProgress = (status: boolean) => { setStateUpdated(!stateUpdated); - setStageSkipStatus(!status); if(!status) { for (let key in mvsDatasetInitProgress) { mvsDatasetInitProgress[key as keyof(DatasetInstallationState)] = false; @@ -243,6 +242,7 @@ const Installation = () => { status = allAttributesTrue ? true : false; installProceedActions(status); setMvsDatasetInitializationProgress(getDatasetInstallationState()); + setStageSkipStatus(!status); } const toggleEditorVisibility = (type: any) => { From b9987fd2c515eba76ec423e78125fabcdbdea005 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Wed, 3 Jul 2024 20:58:23 +0530 Subject: [PATCH 39/65] code cleanup for review instllation --- .../components/stages/ReviewInstallation.tsx | 26 +++++++------------ 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/src/renderer/components/stages/ReviewInstallation.tsx b/src/renderer/components/stages/ReviewInstallation.tsx index 340ec70a..cd2840b3 100644 --- a/src/renderer/components/stages/ReviewInstallation.tsx +++ b/src/renderer/components/stages/ReviewInstallation.tsx @@ -8,7 +8,7 @@ * Copyright Contributors to the Zowe Project. */ -import React, {useEffect, useState} from "react"; +import React, {useEffect, useRef, useState} from "react"; import { useSelector } from 'react-redux'; import {Box, Button, Typography, Tooltip} from '@mui/material'; import CheckCircleIcon from '@mui/icons-material/CheckCircle'; @@ -25,7 +25,7 @@ import { setActiveStep } from './progress/activeStepSlice'; import { setNextStepEnabled } from '../configuration-wizard/wizardSlice'; import { getStageDetails } from "../../../services/StageDetails"; import { TYPE_YAML, TYPE_OUTPUT } from '../common/Utils'; -import { getCompleteProgress } from "./progress/StageProgressStatus"; +import { getCompleteProgress, mapAndSetStepSkipStatus } from "./progress/StageProgressStatus"; import '../../styles/ReviewInstallation.css'; @@ -66,28 +66,15 @@ const ReviewInstallation = () => { completeProgress.launchConfigStatus ]; - - useEffect(() => { const stageProgress = stageProgressStatus.every(status => status === true); const subStageProgress = subStageProgressStatus.every(status => status === true); - const setStageSkipStatus = (status: boolean) => { - stages[STAGE_ID].isSkipped = status; - } - - const setDsInstallStageStatus = (status: boolean) => { - dispatch(setNextStepEnabled(status)); - dispatch(setReviewStatus(status)); - } - if(stageProgress && subStageProgress) { - setStageSkipStatus(false); - setDsInstallStageStatus(true); + updateProgress(true); } else { - setStageSkipStatus(true); - setDsInstallStageStatus(false); + updateProgress(false); } return () => { @@ -95,6 +82,11 @@ const ReviewInstallation = () => { } }, []); + const updateProgress = (status: boolean) => { + dispatch(setNextStepEnabled(status)); + dispatch(setReviewStatus(status)); + } + const toggleEditorVisibility = (type: any) => { setContentType(type); setEditorVisible(!editorVisible); From db4f4a916cc0cdd921d51cecdeb831c46e8c71ec Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Wed, 3 Jul 2024 21:09:54 +0530 Subject: [PATCH 40/65] updating networking stage --- src/renderer/components/stages/Networking.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/renderer/components/stages/Networking.tsx b/src/renderer/components/stages/Networking.tsx index 106f784c..1d218d81 100644 --- a/src/renderer/components/stages/Networking.tsx +++ b/src/renderer/components/stages/Networking.tsx @@ -572,8 +572,6 @@ const Networking = () => { dispatch(setNextStepEnabled(getProgress('networkingStatus'))); dispatch(setInitializationStatus(isInitializationStageComplete())); - updateProgress(!stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped); - return () => { mapAndSetSubStepSkipStatus(SUB_STAGE_ID, stageStatusRef.current); dispatch(setActiveStep({ activeStepIndex: STAGE_ID, isSubStep: SUB_STAGES, activeSubStepIndex: SUB_STAGE_ID })); From 95f7d69d3782a0fd5342d5c9512a9d453448d77f Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Wed, 3 Jul 2024 22:11:27 +0530 Subject: [PATCH 41/65] Code renaming --- src/renderer/components/common/Stepper.tsx | 6 +-- .../components/stages/Certificates.tsx | 4 +- .../components/stages/InitApfAuth.tsx | 4 +- .../components/stages/LaunchConfig.tsx | 4 +- src/renderer/components/stages/Networking.tsx | 4 +- .../components/stages/ReviewInstallation.tsx | 2 +- src/renderer/components/stages/Security.tsx | 4 +- src/renderer/components/stages/Stcs.tsx | 4 +- src/renderer/components/stages/Unpax.tsx | 4 +- src/renderer/components/stages/Vsam.tsx | 4 +- .../stages/installation/Installation.tsx | 4 +- .../stages/progress/StageProgressStatus.ts | 39 +------------------ 12 files changed, 24 insertions(+), 59 deletions(-) diff --git a/src/renderer/components/common/Stepper.tsx b/src/renderer/components/common/Stepper.tsx index d71262f0..fcd69e5d 100644 --- a/src/renderer/components/common/Stepper.tsx +++ b/src/renderer/components/common/Stepper.tsx @@ -28,7 +28,7 @@ import eventDispatcher from '../../../services/eventDispatcher'; import Warning from '@mui/icons-material/Warning'; import CheckCircle from '@mui/icons-material/CheckCircle'; import { TYPE_YAML, TYPE_OUTPUT, TYPE_JCL, INIT_STAGE_LABEL, REVIEW_INSTALL_STAGE_LABEL, UNPAX_STAGE_LABEL } from '../common/Utils'; -import { getProgress, getCompleteProgress, mapAndSetSubStepSkipStatus, mapAndGetSubStepSkipStatus, mapAndSetStepSkipStatus, mapAndGetStepSkipStatus } from '../stages/progress/StageProgressStatus'; +import { getProgress, getCompleteProgress, updateSubStepSkipStatus, updateStepSkipStatus } from '../stages/progress/StageProgressStatus'; import '../../styles/Stepper.css'; import { StepIcon } from '@mui/material'; import { getStageDetails } from '../../../services/StageDetails'; @@ -117,10 +117,10 @@ export default function HorizontalLinearStepper({stages, initialization}:{stages const handleSkip = async () => { stages[activeStep].isSkipped = true; - mapAndSetStepSkipStatus(activeStep, true); + updateStepSkipStatus(activeStep, true); if(stages[activeStep].subStages){ stages[activeStep].subStages[activeSubStep].isSkipped = true; - mapAndSetSubStepSkipStatus(activeSubStep, true); + updateSubStepSkipStatus(activeSubStep, true); } if(stages[activeStep].label === UNPAX_STAGE_LABEL && installationArgs.installationType != "smpe"){ alertEmitter.emit('showAlert', 'Retrieving example-zowe.yaml and latest schemas from Zowe runtime files...', 'info'); diff --git a/src/renderer/components/stages/Certificates.tsx b/src/renderer/components/stages/Certificates.tsx index 918c6432..b0e46350 100644 --- a/src/renderer/components/stages/Certificates.tsx +++ b/src/renderer/components/stages/Certificates.tsx @@ -24,7 +24,7 @@ import { createTheme } from '@mui/material/styles'; import { stages } from "../configuration-wizard/Wizard"; import { setActiveStep } from "./progress/activeStepSlice"; import { getStageDetails, getSubStageDetails } from "../../../services/StageDetails"; -import { getProgress, setCertificateInitState, getCertificateInitState, mapAndSetSubStepSkipStatus, getInstallationArguments, isInitializationStageComplete } from "./progress/StageProgressStatus"; +import { getProgress, setCertificateInitState, getCertificateInitState, updateSubStepSkipStatus, getInstallationArguments, isInitializationStageComplete } from "./progress/StageProgressStatus"; import { CertInitSubStepsState } from "../../../types/stateInterfaces"; import { TYPE_YAML, TYPE_OUTPUT, INIT_STAGE_LABEL, CERTIFICATES_STAGE_LABEL, ajv, deepMerge } from "../common/Utils"; @@ -80,7 +80,7 @@ const Certificates = () => { setIsFormInit(true); return () => { - mapAndSetSubStepSkipStatus(SUB_STAGE_ID, stageStatusRef.current); + updateSubStepSkipStatus(SUB_STAGE_ID, stageStatusRef.current); dispatch(setActiveStep({ activeStepIndex: STAGE_ID, isSubStep: SUB_STAGES, activeSubStepIndex: SUB_STAGE_ID })); } }, []); diff --git a/src/renderer/components/stages/InitApfAuth.tsx b/src/renderer/components/stages/InitApfAuth.tsx index d95a8b50..9c94862f 100644 --- a/src/renderer/components/stages/InitApfAuth.tsx +++ b/src/renderer/components/stages/InitApfAuth.tsx @@ -23,7 +23,7 @@ import { alertEmitter } from "../Header"; import { stages } from "../configuration-wizard/Wizard"; import { setActiveStep } from "./progress/activeStepSlice"; import { getStageDetails, getSubStageDetails } from "../../../services/StageDetails"; -import { getProgress, setApfAuthState, getApfAuthState, mapAndSetSubStepSkipStatus, getInstallationArguments, isInitializationStageComplete } from "./progress/StageProgressStatus"; +import { getProgress, setApfAuthState, getApfAuthState, updateSubStepSkipStatus, getInstallationArguments, isInitializationStageComplete } from "./progress/StageProgressStatus"; import { InitSubStepsState } from "../../../types/stateInterfaces"; import { JCL_UNIX_SCRIPT_OK, FALLBACK_YAML, INIT_STAGE_LABEL, APF_AUTH_STAGE_LABEL, ajv, SERVER_COMMON } from "../common/Utils"; @@ -77,7 +77,7 @@ const InitApfAuth = () => { setInit(true); return () => { - mapAndSetSubStepSkipStatus(SUB_STAGE_ID, stageStatusRef.current); + updateSubStepSkipStatus(SUB_STAGE_ID, stageStatusRef.current); dispatch(setActiveStep({ activeStepIndex: STAGE_ID, isSubStep: SUB_STAGES, activeSubStepIndex: SUB_STAGE_ID })); } }, []); diff --git a/src/renderer/components/stages/LaunchConfig.tsx b/src/renderer/components/stages/LaunchConfig.tsx index d339d15f..8ac94670 100644 --- a/src/renderer/components/stages/LaunchConfig.tsx +++ b/src/renderer/components/stages/LaunchConfig.tsx @@ -22,7 +22,7 @@ import { selectInitializationStatus, setInitializationStatus, setLaunchConfigSta import { setActiveStep } from "./progress/activeStepSlice"; import { TYPE_YAML, TYPE_OUTPUT, FALLBACK_YAML, ajv, INIT_STAGE_LABEL, LAUNCH_CONFIG_STAGE_LABEL } from "../common/Utils"; import { IResponse } from "../../../types/interfaces"; -import { getInstallationArguments, getProgress, isInitializationStageComplete, mapAndSetSubStepSkipStatus } from "./progress/StageProgressStatus"; +import { getInstallationArguments, getProgress, isInitializationStageComplete, updateSubStepSkipStatus } from "./progress/StageProgressStatus"; import { selectConnectionArgs } from "./connection/connectionSlice"; import { alertEmitter } from "../Header"; @@ -473,7 +473,7 @@ const LaunchConfig = () => { updateProgress(getProgress('launchConfigStatus') && !stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped); return () => { - mapAndSetSubStepSkipStatus(SUB_STAGE_ID, stageStatusRef.current); + updateSubStepSkipStatus(SUB_STAGE_ID, stageStatusRef.current); dispatch(setActiveStep({ activeStepIndex: STAGE_ID, isSubStep: SUB_STAGES, activeSubStepIndex: SUB_STAGE_ID })); } }, []); diff --git a/src/renderer/components/stages/Networking.tsx b/src/renderer/components/stages/Networking.tsx index 1d218d81..421676f8 100644 --- a/src/renderer/components/stages/Networking.tsx +++ b/src/renderer/components/stages/Networking.tsx @@ -22,7 +22,7 @@ import { setActiveStep } from "./progress/activeStepSlice"; import { TYPE_YAML, TYPE_JCL, TYPE_OUTPUT, ajv } from "../common/Utils"; import { IResponse } from "../../../types/interfaces"; import { selectConnectionArgs } from "./connection/connectionSlice"; -import { getInstallationArguments, getProgress, isInitializationStageComplete, mapAndSetSubStepSkipStatus } from "./progress/StageProgressStatus"; +import { getInstallationArguments, getProgress, isInitializationStageComplete, updateSubStepSkipStatus } from "./progress/StageProgressStatus"; import { alertEmitter } from "../Header"; // const schema = useAppSelector(selectSchema); @@ -573,7 +573,7 @@ const Networking = () => { dispatch(setInitializationStatus(isInitializationStageComplete())); return () => { - mapAndSetSubStepSkipStatus(SUB_STAGE_ID, stageStatusRef.current); + updateSubStepSkipStatus(SUB_STAGE_ID, stageStatusRef.current); dispatch(setActiveStep({ activeStepIndex: STAGE_ID, isSubStep: SUB_STAGES, activeSubStepIndex: SUB_STAGE_ID })); } }, []); diff --git a/src/renderer/components/stages/ReviewInstallation.tsx b/src/renderer/components/stages/ReviewInstallation.tsx index cd2840b3..693cf6d7 100644 --- a/src/renderer/components/stages/ReviewInstallation.tsx +++ b/src/renderer/components/stages/ReviewInstallation.tsx @@ -25,7 +25,7 @@ import { setActiveStep } from './progress/activeStepSlice'; import { setNextStepEnabled } from '../configuration-wizard/wizardSlice'; import { getStageDetails } from "../../../services/StageDetails"; import { TYPE_YAML, TYPE_OUTPUT } from '../common/Utils'; -import { getCompleteProgress, mapAndSetStepSkipStatus } from "./progress/StageProgressStatus"; +import { getCompleteProgress, updateStepSkipStatus } from "./progress/StageProgressStatus"; import '../../styles/ReviewInstallation.css'; diff --git a/src/renderer/components/stages/Security.tsx b/src/renderer/components/stages/Security.tsx index 66a1565c..8583bc6a 100644 --- a/src/renderer/components/stages/Security.tsx +++ b/src/renderer/components/stages/Security.tsx @@ -24,7 +24,7 @@ import { createTheme } from '@mui/material/styles'; import { stages } from "../configuration-wizard/Wizard"; import { setActiveStep } from "./progress/activeStepSlice"; import { getStageDetails, getSubStageDetails } from "../../../services/StageDetails"; -import { setProgress, getProgress, setSecurityInitState, getSecurityInitState, mapAndSetSubStepSkipStatus, getInstallationArguments, isInitializationStageComplete } from "./progress/StageProgressStatus"; +import { setProgress, getProgress, setSecurityInitState, getSecurityInitState, updateSubStepSkipStatus, getInstallationArguments, isInitializationStageComplete } from "./progress/StageProgressStatus"; import { InitSubStepsState } from "../../../types/stateInterfaces"; import { JCL_UNIX_SCRIPT_OK, INIT_STAGE_LABEL, SECURITY_STAGE_LABEL, ajv, SERVER_COMMON } from '../common/Utils'; import { alertEmitter } from "../Header"; @@ -83,7 +83,7 @@ const Security = () => { setInit(true); return () => { - mapAndSetSubStepSkipStatus(SUB_STAGE_ID, stageStatusRef.current); + updateSubStepSkipStatus(SUB_STAGE_ID, stageStatusRef.current); dispatch(setActiveStep({ activeStepIndex: STAGE_ID, isSubStep: SUB_STAGES, activeSubStepIndex: SUB_STAGE_ID })); } }, []); diff --git a/src/renderer/components/stages/Stcs.tsx b/src/renderer/components/stages/Stcs.tsx index eba6de64..98998dd8 100644 --- a/src/renderer/components/stages/Stcs.tsx +++ b/src/renderer/components/stages/Stcs.tsx @@ -22,7 +22,7 @@ import { createTheme } from '@mui/material/styles'; import { stages } from "../configuration-wizard/Wizard"; import { setActiveStep } from "./progress/activeStepSlice"; import { getStageDetails, getSubStageDetails } from "../../../services/StageDetails"; -import { getProgress, setStcsInitState, getStcsInitState, mapAndSetSubStepSkipStatus, getInstallationArguments, isInitializationStageComplete } from "./progress/StageProgressStatus"; +import { getProgress, setStcsInitState, getStcsInitState, updateSubStepSkipStatus, getInstallationArguments, isInitializationStageComplete } from "./progress/StageProgressStatus"; import { InitSubStepsState } from "../../../types/stateInterfaces"; import { alertEmitter } from "../Header"; import { INIT_STAGE_LABEL, STC_STAGE_LABEL, ajv } from "../common/Utils"; @@ -95,7 +95,7 @@ const Stcs = () => { return () => { alertEmitter.emit('hideAlert'); - mapAndSetSubStepSkipStatus(SUB_STAGE_ID, stageStatusRef.current); + updateSubStepSkipStatus(SUB_STAGE_ID, stageStatusRef.current); dispatch(setActiveStep({ activeStepIndex: STAGE_ID, isSubStep: SUB_STAGES, activeSubStepIndex: SUB_STAGE_ID })); } }, []); diff --git a/src/renderer/components/stages/Unpax.tsx b/src/renderer/components/stages/Unpax.tsx index 2dafb5a6..4c672076 100644 --- a/src/renderer/components/stages/Unpax.tsx +++ b/src/renderer/components/stages/Unpax.tsx @@ -18,7 +18,7 @@ import { selectConnectionArgs } from './connection/connectionSlice'; import { setActiveStep } from "./progress/activeStepSlice"; import { getStageDetails } from "../../../services/StageDetails"; import { setDownloadUnpaxStatus } from './progress/progressSlice'; -import { downloadUnpaxStatus, getDownloadUnpaxState, getInstallationArguments, getInstallationTypeStatus, getProgress, setDownloadUnpaxState, mapAndSetStepSkipStatus } from "./progress/StageProgressStatus"; +import { downloadUnpaxStatus, getDownloadUnpaxState, getInstallationArguments, getInstallationTypeStatus, getProgress, setDownloadUnpaxState, updateStepSkipStatus } from "./progress/StageProgressStatus"; import React from "react"; import ProgressCard from "../common/ProgressCard"; import { alertEmitter } from "../Header"; @@ -73,7 +73,7 @@ const Unpax = () => { dispatch(setDownloadUnpaxStatus(getProgress('downloadUnpaxStatus'))); return () => { - mapAndSetStepSkipStatus(STAGE_ID, stageStatusRef.current); + updateStepSkipStatus(STAGE_ID, stageStatusRef.current); dispatch(setActiveStep({ activeStepIndex: STAGE_ID, isSubStep: SUB_STAGES, activeSubStepIndex: 0 })); } }, []); diff --git a/src/renderer/components/stages/Vsam.tsx b/src/renderer/components/stages/Vsam.tsx index 4f500c11..254aaa33 100644 --- a/src/renderer/components/stages/Vsam.tsx +++ b/src/renderer/components/stages/Vsam.tsx @@ -24,7 +24,7 @@ import { createTheme } from '@mui/material/styles'; import { stages } from "../configuration-wizard/Wizard"; import { setActiveStep } from "./progress/activeStepSlice"; import { getStageDetails, getSubStageDetails } from "../../../services/StageDetails"; -import { getProgress, setVsamInitState, mapAndSetSubStepSkipStatus, getInstallationArguments, getVsamInitState, isInitializationStageComplete } from "./progress/StageProgressStatus"; +import { getProgress, setVsamInitState, updateSubStepSkipStatus, getInstallationArguments, getVsamInitState, isInitializationStageComplete } from "./progress/StageProgressStatus"; import { InitSubStepsState } from "../../../types/stateInterfaces"; import { alertEmitter } from "../Header"; import { INIT_STAGE_LABEL, ajv } from "../common/Utils"; @@ -94,7 +94,7 @@ const Vsam = () => { return () => { alertEmitter.emit('hideAlert'); - mapAndSetSubStepSkipStatus(SUB_STAGE_ID, stageStatusRef.current); + updateSubStepSkipStatus(SUB_STAGE_ID, stageStatusRef.current); dispatch(setActiveStep({ activeStepIndex: STAGE_ID, isSubStep: SUB_STAGES, activeSubStepIndex: SUB_STAGE_ID })); } }, []); diff --git a/src/renderer/components/stages/installation/Installation.tsx b/src/renderer/components/stages/installation/Installation.tsx index 6698cc2b..83c68293 100644 --- a/src/renderer/components/stages/installation/Installation.tsx +++ b/src/renderer/components/stages/installation/Installation.tsx @@ -26,7 +26,7 @@ import {stages} from "../../configuration-wizard/Wizard"; import { setActiveStep } from "../progress/activeStepSlice"; import { TYPE_YAML, TYPE_OUTPUT, JCL_UNIX_SCRIPT_OK, FALLBACK_YAML, ajv, INIT_STAGE_LABEL, INSTALL_STAGE_LABEL} from '../../common/Utils'; import { getStageDetails, getSubStageDetails } from "../../../../services/StageDetails"; -import { getProgress, setDatasetInstallationState, getDatasetInstallationState, getInstallationTypeStatus, mapAndSetSubStepSkipStatus, getInstallationArguments, datasetInstallationStatus, isInitializationStageComplete } from "../progress/StageProgressStatus"; +import { getProgress, setDatasetInstallationState, getDatasetInstallationState, getInstallationTypeStatus, updateSubStepSkipStatus, getInstallationArguments, datasetInstallationStatus, isInitializationStageComplete } from "../progress/StageProgressStatus"; import { DatasetInstallationState } from "../../../../types/stateInterfaces"; import eventDispatcher from '../../../../services/eventDispatcher'; @@ -172,7 +172,7 @@ const Installation = () => { } return () => { - mapAndSetSubStepSkipStatus(SUB_STAGE_ID, stageStatusRef.current); + updateSubStepSkipStatus(SUB_STAGE_ID, stageStatusRef.current); dispatch(setActiveStep({ activeStepIndex: STAGE_ID, isSubStep: SUB_STAGES, activeSubStepIndex: SUB_STAGE_ID })); } }, []); diff --git a/src/renderer/components/stages/progress/StageProgressStatus.ts b/src/renderer/components/stages/progress/StageProgressStatus.ts index b2ed484c..a95c3193 100644 --- a/src/renderer/components/stages/progress/StageProgressStatus.ts +++ b/src/renderer/components/stages/progress/StageProgressStatus.ts @@ -271,55 +271,20 @@ export const initializeProgress = (host: string, user: string, isResume: boolean } } -export const mapAndSetSubStepSkipStatus = (subStageId: number, value: boolean): void => { +export const updateSubStepSkipStatus = (subStageId: number, value: boolean): void => { if(subStageId < 0 || subStageId > 7) { return; } setSubStageSkipStatus(subStepSkipKeysArray[subStageId], value); } -export const mapAndGetSubStepSkipStatus = (subStageId: number): boolean => { - if(subStageId < 0 || subStageId > 7) { - return true; // Skip the sub-stage if the id is out of the valid range of the sub-stages (0-5) - } - const skipStatus = getSubStageSkipStatus(); - const skipStatusArray = [ - skipStatus.datasetInstallation, - skipStatus.networking, - skipStatus.apfAuth, - skipStatus.security, - skipStatus.stcs, - skipStatus.certificate, - skipStatus.vsam, - skipStatus.launchConfig - ] - - return skipStatusArray[subStageId]; -} - -export const mapAndSetStepSkipStatus = (stageId: number, value: boolean): void => { +export const updateStepSkipStatus = (stageId: number, value: boolean): void => { if(stageId < 0 || stageId > 5) { return; } setStageSkipStatus(stepSkipKeysArray[stageId-1], value); } -export const mapAndGetStepSkipStatus = (stageId: number): boolean => { - if(stageId < 0 || stageId > 5) { - return true; // Skip the stage if the stageId is out of the valid range of the stages (0-5) - } - const skipStatus = getStageSkipStatus(); - const skipStatusArray = [ - skipStatus.planning, - skipStatus.installationType, - skipStatus.unpax, - skipStatus.initialization, - skipStatus.reviewInstallation - ] - - return skipStatusArray[stageId-1]; -} - export const setSubStageSkipStatus = (key: keyof subStepState, newValue: boolean): void => { const skipStatus = localStorage.getItem(skipSubStateKey); if (skipStatus) { From ad16570d21587d0a71d12621db06bec56950471c Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Thu, 4 Jul 2024 17:15:14 +0530 Subject: [PATCH 42/65] Updating the security code --- src/renderer/components/stages/Security.tsx | 26 +++++++-------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/src/renderer/components/stages/Security.tsx b/src/renderer/components/stages/Security.tsx index 8583bc6a..eea95c04 100644 --- a/src/renderer/components/stages/Security.tsx +++ b/src/renderer/components/stages/Security.tsx @@ -94,8 +94,8 @@ const Security = () => { if(initClicked) { let nextPosition = document.getElementById('start-security-progress'); nextPosition?.scrollIntoView({ behavior: 'smooth', block: 'start' }); + dispatchActions(false); setStateUpdated(!stateUpdated); - dispatch(setSecurityStatus(false)); } }, [initClicked]); @@ -120,9 +120,8 @@ const Security = () => { useEffect(() => { const allAttributesTrue = Object.values(securityInitProgress).every(value => value === true); if(allAttributesTrue) { - dispatch(setSecurityStatus(true)); - dispatch(setNextStepEnabled(true)); setShowProgress(initClicked || getProgress('securityStatus')); + dispatchActions(true); } }, [securityInitProgress]); @@ -131,8 +130,7 @@ const Security = () => { setSecurityInitState(securityInitState); const allAttributesTrue = Object.values(securityInitState).every(value => value === true); if(allAttributesTrue) { - dispatch(setSecurityStatus(true)); - dispatch(setNextStepEnabled(true)); + dispatchActions(true); } } @@ -152,10 +150,14 @@ const Security = () => { } const allAttributesTrue = Object.values(securityInitProgress).every(value => value === true); status = allAttributesTrue ? true : false; - dispatch(setInitializationStatus(isInitializationStageComplete())); + setSecurityInitializationProgress(getSecurityInitState()); + dispatchActions(status); + } + + const dispatchActions = (status: boolean) => { dispatch(setSecurityStatus(status)); + dispatch(setInitializationStatus(isInitializationStageComplete())); dispatch(setNextStepEnabled(status)); - setSecurityInitializationProgress(getSecurityInitState()); setStageSkipStatus(!status); } @@ -180,11 +182,9 @@ const Security = () => { toggleEditorVisibility("output"); }) updateProgress(false); - securityProceedActions(false); clearInterval(timer); } else { updateProgress(res.status); - securityProceedActions(res.status); clearInterval(timer); } }).catch((err: any) => { @@ -192,20 +192,12 @@ const Security = () => { //alertEmitter.emit('showAlert', err.toString(), 'error'); updateProgress(false); clearInterval(timer); - securityProceedActions(false); window.electron.ipcRenderer.setStandardOutput(`zwe init security failed: ${typeof err === "string" ? err : err.toString()}`).then((res: any) => { toggleEditorVisibility("output"); }) }); } - // True - a proceed, False - blocked - const securityProceedActions = (status: boolean) => { - dispatch(setNextStepEnabled(status)); - dispatch(setSecurityStatus(status)); - dispatch(setInitializationStatus(isInitializationStageComplete())); - } - const handleFormChange = (data: any) => { let newData = init ? (Object.keys(setupYaml).length > 0 ? setupYaml : data?.zowe?.setup?.security) : (data?.zowe?.setup?.security ? data?.zowe?.setup?.security : data); setInit(false); From 4407652b0f21960e0b8f6c10e282a1362cca82d7 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Thu, 4 Jul 2024 17:25:49 +0530 Subject: [PATCH 43/65] Updating the stcs stage --- src/renderer/components/stages/Stcs.tsx | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/renderer/components/stages/Stcs.tsx b/src/renderer/components/stages/Stcs.tsx index 98998dd8..f1870d87 100644 --- a/src/renderer/components/stages/Stcs.tsx +++ b/src/renderer/components/stages/Stcs.tsx @@ -106,8 +106,8 @@ const Stcs = () => { if(initClicked) { let nextPosition = document.getElementById('start-stcs-progress'); nextPosition?.scrollIntoView({ behavior: 'smooth', block: 'start' }); + dispatchActions(false); setStateUpdated(!stateUpdated); - dispatch(setStcsStatus(false)); } }, [initClicked]); @@ -116,6 +116,9 @@ const Stcs = () => { timer = setInterval(() => { window.electron.ipcRenderer.getInitStcsProgress().then((res: any) => { setStcsInitializationProgress(res); + if(res.success){ + clearInterval(timer); + } }) }, 3000); @@ -132,8 +135,7 @@ const Stcs = () => { useEffect(() => { const allAttributesTrue = Object.values(stcsInitProgress).every(value => value === true); if(allAttributesTrue) { - dispatch(setStcsStatus(true)); - dispatch(setNextStepEnabled(true)); + dispatchActions(true); setShowProgress(initClicked || getProgress('stcsStatus')); } }, [stcsInitProgress]); @@ -143,8 +145,7 @@ const Stcs = () => { setStcsInitState(stcsInitState); const allAttributesTrue = Object.values(stcsInitState).every(value => value === true); if(allAttributesTrue) { - dispatch(setStcsStatus(true)); - dispatch(setNextStepEnabled(true)); + dispatchActions(true); } } @@ -164,10 +165,14 @@ const Stcs = () => { } const allAttributesTrue = Object.values(stcsInitProgress).every(value => value === true); status = allAttributesTrue ? true : false; - dispatch(setInitializationStatus(isInitializationStageComplete())); + setStageSkipStatus(!status); + dispatchActions(status); + } + + const dispatchActions = (status: boolean) => { dispatch(setStcsStatus(status)); + dispatch(setInitializationStatus(isInitializationStageComplete())); dispatch(setNextStepEnabled(status)); - setStcsInitializationProgress(getStcsInitState()); setStageSkipStatus(!status); } From e4edd332c55ddfb15be9e47b76443057101b0e88 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Thu, 4 Jul 2024 17:40:27 +0530 Subject: [PATCH 44/65] Updating the certificates stage --- .../components/stages/Certificates.tsx | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/renderer/components/stages/Certificates.tsx b/src/renderer/components/stages/Certificates.tsx index b0e46350..f5720309 100644 --- a/src/renderer/components/stages/Certificates.tsx +++ b/src/renderer/components/stages/Certificates.tsx @@ -91,6 +91,8 @@ const Certificates = () => { if(initClicked) { let nextPosition = document.getElementById('start-certificate-progress'); nextPosition?.scrollIntoView({ behavior: 'smooth', block: 'start' }); + dispatchActions(false); + setStateUpdated(!stateUpdated); } }, [initClicked]); @@ -99,7 +101,10 @@ const Certificates = () => { if(!getProgress('certificateStatus') && initClicked) { timer = setInterval(() => { window.electron.ipcRenderer.getCertificateProgress().then((res: any) => { - setCertificateInitializationProgress(res) + setCertificateInitializationProgress(res); + if(res.success){ + clearInterval(timer); + } }) }, 3000); } @@ -117,8 +122,7 @@ const Certificates = () => { useEffect(() => { const allAttributesTrue = Object.values(certificateInitProgress).every(value => value === true); if(allAttributesTrue) { - dispatch(setNextStepEnabled(true)); - dispatch(setCertificateStatus(true)); + dispatchActions(true); setShowProgress(initClicked || getProgress('certificateStatus')); } }, [certificateInitProgress]); @@ -128,8 +132,7 @@ const Certificates = () => { setCertificateInitState(certificateInitState); const allAttributesTrue = Object.values(certificateInitState).every(value => value === true); if(allAttributesTrue) { - dispatch(setNextStepEnabled(true)); - dispatch(setCertificateStatus(true)); + dispatchActions(true); } } @@ -149,10 +152,14 @@ const Certificates = () => { } const allAttributesTrue = Object.values(certificateInitProgress).every(value => value === true); status = allAttributesTrue ? true : false; - dispatch(setNextStepEnabled(status)); - dispatch(setInitializationStatus(isInitializationStageComplete())); - dispatch(setCertificateStatus(status)); setCertificateInitializationProgress(getCertificateInitState()); + dispatchActions(status); + } + + const dispatchActions = (status: boolean) => { + dispatch(setCertificateStatus(status)); + dispatch(setInitializationStatus(isInitializationStageComplete())); + dispatch(setNextStepEnabled(status)); setStageSkipStatus(!status); } @@ -203,8 +210,6 @@ const Certificates = () => { setIsFormInit(false); if (newData) { - dispatch(setCertificateStatus(false)); - if(validate) { validate(newData); if(validate.errors) { @@ -247,7 +252,7 @@ const Certificates = () => { id="demo-simple-select" value={verifyCerts} onChange={(e) => { - dispatch(setCertificateStatus(false)); + dispatchActions(false); const newConfig = {...yaml, zowe: {...yaml?.zowe, verifyCertificates: e.target.value, setup: {...yaml.zowe.setup}}}; window.electron.ipcRenderer.setConfig(newConfig); setLYaml(newConfig) From 55c544da79090564be8e173895917d7a5d53aa38 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Thu, 4 Jul 2024 17:41:13 +0530 Subject: [PATCH 45/65] Updating the vsam stage --- src/renderer/components/stages/Vsam.tsx | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/renderer/components/stages/Vsam.tsx b/src/renderer/components/stages/Vsam.tsx index 254aaa33..9fe3cffb 100644 --- a/src/renderer/components/stages/Vsam.tsx +++ b/src/renderer/components/stages/Vsam.tsx @@ -106,7 +106,7 @@ const Vsam = () => { let nextPosition = document.getElementById('start-vsam-progress'); nextPosition?.scrollIntoView({ behavior: 'smooth', block: 'start' }); setStateUpdated(!stateUpdated); - dispatch(setVsamStatus(false)); + dispatchActions(false); } }, [initClicked]); @@ -115,6 +115,9 @@ const Vsam = () => { timer = setInterval(() => { window.electron.ipcRenderer.getInitVsamProgress().then((res: any) => { setVsamInitializationProgress(res); + if(res.success){ + clearInterval(timer); + } }) }, 3000); @@ -131,8 +134,7 @@ const Vsam = () => { useEffect(() => { const allAttributesTrue = Object.values(vsamInitProgress).every(value => value === true); if(allAttributesTrue) { - dispatch(setVsamStatus(true)); - dispatch(setNextStepEnabled(true)); + dispatchActions(true); setShowProgress(initClicked || getProgress('vsamStatus')); } }, [vsamInitProgress]); @@ -142,8 +144,7 @@ const Vsam = () => { setVsamInitState(vsamInitState); const allAttributesTrue = Object.values(vsamInitState).every(value => value === true); if(allAttributesTrue) { - dispatch(setVsamStatus(true)); - dispatch(setNextStepEnabled(true)); + dispatchActions(true); } } @@ -163,10 +164,14 @@ const Vsam = () => { } const allAttributesTrue = Object.values(vsamInitProgress).every(value => value === true); status = allAttributesTrue ? true : false; - dispatch(setInitializationStatus(isInitializationStageComplete())); + setVsamInitializationProgress(getVsamInitState()); + dispatchActions(status); + } + + const dispatchActions = (status: boolean) => { dispatch(setVsamStatus(status)); + dispatch(setInitializationStatus(isInitializationStageComplete())); dispatch(setNextStepEnabled(status)); - setVsamInitializationProgress(getVsamInitState()); setStageSkipStatus(!status); } From 25dd906fcb67931544504108765e75fcc73d79e0 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Thu, 4 Jul 2024 17:41:56 +0530 Subject: [PATCH 46/65] Updating the initapfauth stage --- .../components/stages/InitApfAuth.tsx | 29 +++++++------------ 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/src/renderer/components/stages/InitApfAuth.tsx b/src/renderer/components/stages/InitApfAuth.tsx index 9c94862f..9cea3271 100644 --- a/src/renderer/components/stages/InitApfAuth.tsx +++ b/src/renderer/components/stages/InitApfAuth.tsx @@ -93,17 +93,16 @@ const InitApfAuth = () => { nextPosition = document.getElementById('start-apf-progress'); nextPosition.scrollIntoView({ behavior: 'smooth', block: 'start' }); } + dispatchActions(false); setStateUpdated(!stateUpdated); - dispatch(setApfAuthStatus(false)); } }, [initClicked]); useEffect(() => { const allAttributesTrue = Object.values(apfAuthInitProgress).every(value => value === true); if(allAttributesTrue) { - dispatch(setNextStepEnabled(true)); - dispatch(setApfAuthStatus(true)); setShowProgress(initClicked || getProgress('apfAuthStatus')); + dispatchActions(true); } }, [apfAuthInitProgress]); @@ -113,7 +112,6 @@ const InitApfAuth = () => { timer = setInterval(() => { window.electron.ipcRenderer.getApfAuthProgress().then((res: any) => { setApfAuthorizationInitProgress(res); - dispatch(setApfAuthStatus(stageComplete)) if(res.success){ clearInterval(timer); } @@ -131,8 +129,7 @@ const InitApfAuth = () => { setApfAuthInitProgress(aftAuthorizationState); const allAttributesTrue = Object.values(aftAuthorizationState).every(value => value === true); if(allAttributesTrue) { - dispatch(setNextStepEnabled(true)); - dispatch(setApfAuthStatus(true)); + dispatchActions(true); } } @@ -152,10 +149,14 @@ const InitApfAuth = () => { } const allAttributesTrue = Object.values(apfAuthInitProgress).every(value => value === true); status = allAttributesTrue ? true : false; - dispatch(setNextStepEnabled(status)); - dispatch(setInitializationStatus(isInitializationStageComplete())); - dispatch(setApfAuthStatus(status)); setApfAuthorizationInitProgress(getApfAuthState()); + dispatchActions(status); + } + + const dispatchActions = (status: boolean) => { + dispatch(setApfAuthStatus(status)); + dispatch(setInitializationStatus(isInitializationStageComplete())); + dispatch(setNextStepEnabled(status)); setStageSkipStatus(!status); } @@ -173,7 +174,6 @@ const InitApfAuth = () => { setInitClicked(true); updateProgress(false); event.preventDefault(); - dispatch(setApfAuthStatus(false)); window.electron.ipcRenderer.apfAuthButtonOnClick(connectionArgs, installationArgs).then((res: IResponse) => { // Some parts of Zen pass the response as a string directly into the object if (res.status == false && typeof res.details == "string") { @@ -185,16 +185,13 @@ const InitApfAuth = () => { toggleEditorVisibility("output"); }) updateProgress(false); //res.status may not necessarily be false, even if things go wrong - apfAuthProceedActions(false); clearInterval(timer); } else { updateProgress(res.status); - apfAuthProceedActions(res.status); clearInterval(timer); } }).catch((err: any) => { clearInterval(timer); - apfAuthProceedActions(false); updateProgress(false); // TODO: Test this //alertEmitter.emit('showAlert', err.toString(), 'error'); @@ -204,12 +201,6 @@ const InitApfAuth = () => { }); } - // True - a proceed, False - blocked - const apfAuthProceedActions = (status: boolean) => { - dispatch(setNextStepEnabled(status)); - dispatch(setApfAuthStatus(status)); - } - const formChangeHandler = (data: any, isYamlUpdated?: boolean) => { let updatedData = init ? (Object.keys(yaml?.zowe.setup.dataset).length > 0 ? yaml?.zowe.setup.dataset : data) : (data ? data : yaml?.zowe.setup.dataset); From 5bf59d7fcac2e4142a2a01d94010f785804e9084 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Thu, 4 Jul 2024 17:42:52 +0530 Subject: [PATCH 47/65] Updating the stepper to update the skip button anabling logic --- src/renderer/components/common/Stepper.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/components/common/Stepper.tsx b/src/renderer/components/common/Stepper.tsx index fcd69e5d..00c6b699 100644 --- a/src/renderer/components/common/Stepper.tsx +++ b/src/renderer/components/common/Stepper.tsx @@ -242,7 +242,7 @@ export default function HorizontalLinearStepper({stages, initialization}:{stages } else if(stages[activeStep].subStages) { if(stages[activeStep].subStages[activeSubStep].label === ("Installation")) { return true; - } else if(getProgress(stages[activeStep].subStages[activeSubStep].statusKey)) { + } else if(!stages[activeStep].subStages[activeSubStep].isSkipped) { return true; } else { return false; From e3101cbf20fd403de120e7b18dcfa5638b213e28 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Thu, 4 Jul 2024 17:58:46 +0530 Subject: [PATCH 48/65] Updating the unpax stage --- src/renderer/components/stages/Unpax.tsx | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/renderer/components/stages/Unpax.tsx b/src/renderer/components/stages/Unpax.tsx index 4c672076..afe30685 100644 --- a/src/renderer/components/stages/Unpax.tsx +++ b/src/renderer/components/stages/Unpax.tsx @@ -69,9 +69,6 @@ const Unpax = () => { updateProgress(getProgress('downloadUnpaxStatus') && !stages[STAGE_ID].isSkipped); - dispatch(setNextStepEnabled(getProgress('downloadUnpaxStatus'))); - dispatch(setDownloadUnpaxStatus(getProgress('downloadUnpaxStatus'))); - return () => { updateStepSkipStatus(STAGE_ID, stageStatusRef.current); dispatch(setActiveStep({ activeStepIndex: STAGE_ID, isSubStep: SUB_STAGES, activeSubStepIndex: 0 })); @@ -85,7 +82,6 @@ const Unpax = () => { window.electron.ipcRenderer.getDownloadUnpaxProgress().then((res: any) => { setDownloadAndUnpaxProgress(res) if(stageComplete){ - setStageStatus(true); clearInterval(timer); } }) @@ -99,8 +95,7 @@ const Unpax = () => { useEffect(() => { const allAttributesTrue = Object.values(downloadUnpaxProgress).every(value => value === true); if(allAttributesTrue) { - dispatch(setDownloadUnpaxStatus(true)); - dispatch(setNextStepEnabled(true)); + dispatchActions(true); setShowProgress(getProgress('downloadUnpaxStatus')); } }, [downloadUnpaxProgress]); @@ -110,8 +105,7 @@ const Unpax = () => { setDownloadUnpaxState(downloadUnpaxState); const allAttributesTrue = Object.values(downloadUnpaxState).every(value => value === true); if(allAttributesTrue) { - dispatch(setDownloadUnpaxStatus(true)); - dispatch(setNextStepEnabled(true)); + dispatchActions(true); } } @@ -131,9 +125,14 @@ const Unpax = () => { } const allAttributesTrue = Object.values(downloadUnpaxProgress).every(value => value === true); status = allAttributesTrue ? true : false; + setDownloadAndUnpaxProgress(getDownloadUnpaxState()); + dispatchActions(status); + } + + const dispatchActions = (status: boolean) => { dispatch(setDownloadUnpaxStatus(status)); dispatch(setNextStepEnabled(status)); - setDownloadAndUnpaxProgress(getDownloadUnpaxState()); + setStageSkipStatus(!status); } const process = (event: any) => { From 9435c7eed9be77f04e3ae17974ab50b96c658486 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Thu, 4 Jul 2024 18:20:04 +0530 Subject: [PATCH 49/65] More updates to stcs stage --- src/renderer/components/stages/Stcs.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/components/stages/Stcs.tsx b/src/renderer/components/stages/Stcs.tsx index f1870d87..cac21fda 100644 --- a/src/renderer/components/stages/Stcs.tsx +++ b/src/renderer/components/stages/Stcs.tsx @@ -165,7 +165,7 @@ const Stcs = () => { } const allAttributesTrue = Object.values(stcsInitProgress).every(value => value === true); status = allAttributesTrue ? true : false; - setStageSkipStatus(!status); + setStcsInitializationProgress(status); dispatchActions(status); } From eb12bb2d258c5ee5a3efae28d4407552e756ea8d Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Thu, 4 Jul 2024 18:22:31 +0530 Subject: [PATCH 50/65] Some more updates to stcs stage --- src/renderer/components/stages/Stcs.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/components/stages/Stcs.tsx b/src/renderer/components/stages/Stcs.tsx index cac21fda..6a71c70e 100644 --- a/src/renderer/components/stages/Stcs.tsx +++ b/src/renderer/components/stages/Stcs.tsx @@ -165,7 +165,7 @@ const Stcs = () => { } const allAttributesTrue = Object.values(stcsInitProgress).every(value => value === true); status = allAttributesTrue ? true : false; - setStcsInitializationProgress(status); + setStcsInitializationProgress(getStcsInitState()); dispatchActions(status); } From 4c7ada5ad8e121afb8288378ead99881cf033f2e Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Thu, 4 Jul 2024 18:27:34 +0530 Subject: [PATCH 51/65] Updating the installation stage --- .../stages/installation/Installation.tsx | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/renderer/components/stages/installation/Installation.tsx b/src/renderer/components/stages/installation/Installation.tsx index 83c68293..42e8d223 100644 --- a/src/renderer/components/stages/installation/Installation.tsx +++ b/src/renderer/components/stages/installation/Installation.tsx @@ -183,6 +183,7 @@ const Installation = () => { if(initClicked) { const nextPosition = document.getElementById('installation-progress'); if(nextPosition) nextPosition.scrollIntoView({ behavior: 'smooth', block: 'end' }); + installProceedActions(false); setStateUpdated(!stateUpdated); } }, [initClicked]); @@ -190,8 +191,7 @@ const Installation = () => { useEffect(() => { const allAttributesTrue = Object.values(mvsDatasetInitProgress).every(value => value === true); if(allAttributesTrue) { - dispatch(setNextStepEnabled(true)); - dispatch(setDatasetInstallationStatus(true)); + installProceedActions(true); setStageSkipStatus(false); } }, [mvsDatasetInitProgress]); @@ -218,9 +218,7 @@ const Installation = () => { setDatasetInstallationState(datasetInitState); const allAttributesTrue = Object.values(datasetInitState).every(value => value === true); if(allAttributesTrue) { - dispatch(setNextStepEnabled(true)); - dispatch(setDatasetInstallationStatus(true)); - setStageSkipStatus(false); + installProceedActions(true); } } @@ -240,8 +238,15 @@ const Installation = () => { } const allAttributesTrue = Object.values(mvsDatasetInitProgress).every(value => value === true); status = allAttributesTrue ? true : false; - installProceedActions(status); setMvsDatasetInitializationProgress(getDatasetInstallationState()); + installProceedActions(status); + } + + // True - a proceed, False - blocked + const installProceedActions = (status: boolean) => { + dispatch(setDatasetInstallationStatus(status)); + dispatch(setInitializationStatus(isInitializationStageComplete())); + dispatch(setNextStepEnabled(status)); setStageSkipStatus(!status); } @@ -292,13 +297,6 @@ const Installation = () => { }) } - // True - a proceed, False - blocked - const installProceedActions = (status: boolean) => { - dispatch(setNextStepEnabled(status)); - dispatch(setDatasetInstallationStatus(status)); - dispatch(setInitializationStatus(isInitializationStageComplete())); - } - const debouncedChange = useCallback( debounce((state: any)=>{handleFormChange(state)}, 1000), [] From 153d67fb4773cc03b32e41c65d121f0f48628460 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Thu, 4 Jul 2024 20:05:02 +0530 Subject: [PATCH 52/65] unpax stage bugfix --- src/renderer/components/stages/Unpax.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/renderer/components/stages/Unpax.tsx b/src/renderer/components/stages/Unpax.tsx index afe30685..9ea66db3 100644 --- a/src/renderer/components/stages/Unpax.tsx +++ b/src/renderer/components/stages/Unpax.tsx @@ -47,6 +47,7 @@ const Unpax = () => { const [stateUpdated, setStateUpdated] = useState(false); const [stageStatus, setStageStatus] = useState(stages[STAGE_ID].isSkipped); const stageStatusRef = useRef(stageStatus); + const [isYamlFetched, setIsYamlFetched] = useState(false); const [installationArgs, setInstArgs] = useState(getInstallationArguments()); let timer: any; @@ -103,7 +104,11 @@ const Unpax = () => { const setDownloadAndUnpaxProgress = (downloadUnpaxState: DownloadUnpaxState) => { setDownloadUnpaxProgress(downloadUnpaxState); setDownloadUnpaxState(downloadUnpaxState); - const allAttributesTrue = Object.values(downloadUnpaxState).every(value => value === true); + let allAttributesTrue = Object.values(downloadUnpaxState).every(value => value === true); + if(isYamlFetched) { + allAttributesTrue = downloadUnpaxState.getSchemas && downloadUnpaxState.getExampleYaml; + setIsYamlFetched(false); + } if(allAttributesTrue) { dispatchActions(true); } @@ -157,6 +162,7 @@ const Unpax = () => { } const fetchExampleYaml = (event: any) => { + setIsYamlFetched(true); event.preventDefault(); setShowProgress(true); updateProgress(false); From bb6bff46bc62a959c4c88e6223dbcc9fa46488e4 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Thu, 4 Jul 2024 20:15:22 +0530 Subject: [PATCH 53/65] More changes to the stepper --- src/renderer/components/common/Stepper.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/components/common/Stepper.tsx b/src/renderer/components/common/Stepper.tsx index 00c6b699..fcd69e5d 100644 --- a/src/renderer/components/common/Stepper.tsx +++ b/src/renderer/components/common/Stepper.tsx @@ -242,7 +242,7 @@ export default function HorizontalLinearStepper({stages, initialization}:{stages } else if(stages[activeStep].subStages) { if(stages[activeStep].subStages[activeSubStep].label === ("Installation")) { return true; - } else if(!stages[activeStep].subStages[activeSubStep].isSkipped) { + } else if(getProgress(stages[activeStep].subStages[activeSubStep].statusKey)) { return true; } else { return false; From 4c22f0a3c6dae700ed26768ad40cb56676623366 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Thu, 4 Jul 2024 20:21:42 +0530 Subject: [PATCH 54/65] More changes to all substages --- src/renderer/components/stages/Certificates.tsx | 1 - src/renderer/components/stages/InitApfAuth.tsx | 1 - src/renderer/components/stages/LaunchConfig.tsx | 1 - src/renderer/components/stages/Security.tsx | 1 - src/renderer/components/stages/Stcs.tsx | 1 - src/renderer/components/stages/Vsam.tsx | 1 - 6 files changed, 6 deletions(-) diff --git a/src/renderer/components/stages/Certificates.tsx b/src/renderer/components/stages/Certificates.tsx index f5720309..49b5963b 100644 --- a/src/renderer/components/stages/Certificates.tsx +++ b/src/renderer/components/stages/Certificates.tsx @@ -76,7 +76,6 @@ const Certificates = () => { } setShowProgress(initClicked || getProgress('certificateStatus')); - updateProgress(getProgress('certificateStatus') && !stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped); setIsFormInit(true); return () => { diff --git a/src/renderer/components/stages/InitApfAuth.tsx b/src/renderer/components/stages/InitApfAuth.tsx index 9cea3271..9b021f0b 100644 --- a/src/renderer/components/stages/InitApfAuth.tsx +++ b/src/renderer/components/stages/InitApfAuth.tsx @@ -73,7 +73,6 @@ const InitApfAuth = () => { nextPosition?.scrollIntoView({behavior: 'smooth'}); } - updateProgress(getProgress('apfAuthStatus') && !stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped); setInit(true); return () => { diff --git a/src/renderer/components/stages/LaunchConfig.tsx b/src/renderer/components/stages/LaunchConfig.tsx index 8ac94670..84307cc2 100644 --- a/src/renderer/components/stages/LaunchConfig.tsx +++ b/src/renderer/components/stages/LaunchConfig.tsx @@ -470,7 +470,6 @@ const LaunchConfig = () => { dispatch(setInitializationStatus(isInitializationStageComplete())); setIsFormInit(true); - updateProgress(getProgress('launchConfigStatus') && !stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped); return () => { updateSubStepSkipStatus(SUB_STAGE_ID, stageStatusRef.current); diff --git a/src/renderer/components/stages/Security.tsx b/src/renderer/components/stages/Security.tsx index eea95c04..018bc751 100644 --- a/src/renderer/components/stages/Security.tsx +++ b/src/renderer/components/stages/Security.tsx @@ -79,7 +79,6 @@ const Security = () => { nextPosition?.scrollIntoView({behavior: 'smooth'}); } - updateProgress(getProgress('securityStatus') && !stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped); setInit(true); return () => { diff --git a/src/renderer/components/stages/Stcs.tsx b/src/renderer/components/stages/Stcs.tsx index 6a71c70e..249f40a3 100644 --- a/src/renderer/components/stages/Stcs.tsx +++ b/src/renderer/components/stages/Stcs.tsx @@ -82,7 +82,6 @@ const Stcs = () => { nextPosition?.scrollIntoView({behavior: 'smooth'}); } - updateProgress(getProgress('stcsStatus') && !stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped); setInit(true); if(!setupYaml) { diff --git a/src/renderer/components/stages/Vsam.tsx b/src/renderer/components/stages/Vsam.tsx index 9fe3cffb..2c02b2a2 100644 --- a/src/renderer/components/stages/Vsam.tsx +++ b/src/renderer/components/stages/Vsam.tsx @@ -89,7 +89,6 @@ const Vsam = () => { nextPosition?.scrollIntoView({behavior: 'smooth'}); } - updateProgress(getProgress('vsamStatus') && !stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped); setInit(true); return () => { From 52992d725a85f5958d5b7d38f2097eff52ccf44b Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Thu, 4 Jul 2024 20:34:16 +0530 Subject: [PATCH 55/65] Updates to the unpax stage --- src/renderer/components/stages/Unpax.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/components/stages/Unpax.tsx b/src/renderer/components/stages/Unpax.tsx index 9ea66db3..76b6ccbe 100644 --- a/src/renderer/components/stages/Unpax.tsx +++ b/src/renderer/components/stages/Unpax.tsx @@ -82,7 +82,7 @@ const Unpax = () => { timer = setInterval(() => { window.electron.ipcRenderer.getDownloadUnpaxProgress().then((res: any) => { setDownloadAndUnpaxProgress(res) - if(stageComplete){ + if(res.success){ clearInterval(timer); } }) From 0d85a045c3217d1c4d6fd618475091580cd5e45e Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Thu, 4 Jul 2024 20:56:58 +0530 Subject: [PATCH 56/65] Updating the stepper --- src/renderer/components/common/Stepper.tsx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/renderer/components/common/Stepper.tsx b/src/renderer/components/common/Stepper.tsx index fcd69e5d..7f7756e9 100644 --- a/src/renderer/components/common/Stepper.tsx +++ b/src/renderer/components/common/Stepper.tsx @@ -229,7 +229,19 @@ export default function HorizontalLinearStepper({stages, initialization}:{stages eventDispatcher.emit('saveAndCloseEvent'); } - const isNextStepEnabled = useAppSelector(selectNextStepEnabled); + const nextStepButtonDisabled = (stages: any, activeStep: number, activeSubStep: number) => { + if(stages[activeStep]) { + if(stages[activeStep].subStages) { + const completion = getProgress(stages[activeStep].subStages[activeSubStep].statusKey); + return !completion; + } else { + const completion = getProgress(stages[activeStep].statusKey); + return !completion; + } + } else { + return true; + } + } const skipButtonDisabled = (stages: any, activeStep: number, activeSubStep: number) => { if(stages[activeStep]) { @@ -354,7 +366,7 @@ export default function HorizontalLinearStepper({stages, initialization}:{stages } {stages[activeStep] && stages[activeStep].nextButton &&