Skip to content

Commit

Permalink
remaning vars related to zowe version
Browse files Browse the repository at this point in the history
  • Loading branch information
sakshibobade21 committed Oct 14, 2024
1 parent 7c513cb commit 753e218
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions src/renderer/components/stages/Unpax.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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, setZoweVersion, updateStepSkipStatus } from "./progress/StageProgressStatus";
import { downloadUnpaxStatus, getDownloadUnpaxState, getInstallationArguments, getInstallationTypeStatus, getProgress, setDownloadUnpaxState, setAndStoreZoweVersion, updateStepSkipStatus } from "./progress/StageProgressStatus";
import React from "react";
import ProgressCard from "../common/ProgressCard";
import { alertEmitter } from "../Header";
Expand Down Expand Up @@ -173,7 +173,7 @@ const Unpax = () => {
}

if(res.details?.manifestFile?.version) {
setZowePaxVersion(res.details?.manifestFile?.version);
setZoweVersion(res.details?.manifestFile?.version);
}

if(res.details?.mergedYaml != undefined){
Expand All @@ -199,13 +199,13 @@ const Unpax = () => {
}
}

const setZowePaxVersion = (version: string): void => {
const setZoweVersion = (version: string): void => {
if(!version) {
return;
}
const versionString = version;
const majorVersion = parseInt(versionString.split('.')[0], 10);
setZoweVersion(majorVersion);
setAndStoreZoweVersion(majorVersion);
}

const fetchExampleYaml = (event: any) => {
Expand All @@ -226,7 +226,7 @@ const Unpax = () => {
updateProgress(false);
}
if(res.details?.manifestFile?.version) {
setZowePaxVersion(res.details?.manifestFile?.version);
setZoweVersion(res.details?.manifestFile?.version);
}
if(res.details?.mergedYaml != undefined){
dispatch(setYaml(res.details.mergedYaml));
Expand Down
8 changes: 4 additions & 4 deletions src/renderer/components/stages/Vsam.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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, updateSubStepSkipStatus, getInstallationArguments, getVsamInitState, isInitializationStageComplete, getZoweVersion } from "./progress/StageProgressStatus";
import { getProgress, setVsamInitState, updateSubStepSkipStatus, getInstallationArguments, getVsamInitState, isInitializationStageComplete, getCachedZoweVersion } from "./progress/StageProgressStatus";
import { InitSubStepsState } from "../../../types/stateInterfaces";
import { alertEmitter } from "../Header";
import { INIT_STAGE_LABEL, ajv } from "../common/Utils";
Expand Down Expand Up @@ -63,7 +63,7 @@ const Vsam = () => {
const [showVsameDatsetName, setShowVsamDatasetName] = useState(false);
const [storageMode, setStorageMode] = useState(yaml?.components[`caching-service`]?.storage?.mode);
const storageModeOptions = ['VSAM', 'INFINISPAN'];
const zowePaxVersion: number = getZoweVersion();
const zoweVersion: number = getCachedZoweVersion();
const [showStorageModeOptions, setShowStorageModeOptions] = useState(false);

let timer: any;
Expand All @@ -78,9 +78,9 @@ const Vsam = () => {

useEffect(() => {

(zowePaxVersion < 3) ? setStorageMode('VSAM') : setShowStorageModeOptions(true);
(zoweVersion < 3) ? setStorageMode('VSAM') : setShowStorageModeOptions(true);

if(storageMode.toUpperCase() !== 'VSAM' && zowePaxVersion >= 3) {
if(storageMode.toUpperCase() !== 'VSAM' && zoweVersion >= 3) {
dispatchActions(true);
setShowProgress(false);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -591,11 +591,11 @@ export const getPreviousInstallation = () : ActiveState => {
}
}

export const setZoweVersion = (version: number): void => {
export const setAndStoreZoweVersion = (version: number): void => {
localStorage.setItem(paxVersionKey, version.toString());
}

export const getZoweVersion = () : number => {
export const getCachedZoweVersion = () : number => {
const version = localStorage.getItem(paxVersionKey);
return version ? Number(version) : NaN;
}
Expand Down

0 comments on commit 753e218

Please sign in to comment.