Skip to content

Commit

Permalink
Updating the completion status for the inifinispan
Browse files Browse the repository at this point in the history
  • Loading branch information
sakshibobade21 committed Oct 10, 2024
1 parent f7176b3 commit a22af3f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/renderer/components/stages/ReviewInstallation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const ReviewInstallation = () => {
const stageProgress = stageProgressStatus.every(status => status === true);
const subStageProgress = subStageProgressStatus.every(status => status === true);

if (stageProgress && subStageProgress) {
if(stageProgress && subStageProgress) {
updateProgress(true);
} else {
updateProgress(false);
Expand Down
40 changes: 22 additions & 18 deletions src/renderer/components/stages/Vsam.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ const Vsam = () => {

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

if(storageMode.toUpperCase() !== 'VSAM' && zowePaxVersion >= 3) {
dispatchActions(true);
setShowProgress(false);
return;
}

let nextPosition;
const stepProgress = getProgress('vsamStatus');

Expand All @@ -98,7 +104,7 @@ const Vsam = () => {

if(stepProgress) {
nextPosition = document.getElementById('vsam-progress');
nextPosition?.scrollIntoView({ behavior: 'smooth', block: 'end' });
nextPosition?.scrollIntoView({ behavior: 'smooth', block: 'center' });
} else {
nextPosition = document.getElementById('container-box-id');
nextPosition?.scrollIntoView({behavior: 'smooth'});
Expand All @@ -111,10 +117,6 @@ const Vsam = () => {
alertEmitter.emit('hideAlert');
updateSubStepSkipStatus(SUB_STAGE_ID, stageStatusRef.current);
dispatch(setActiveStep({ activeStepIndex: STAGE_ID, isSubStep: SUB_STAGES, activeSubStepIndex: SUB_STAGE_ID }));

if(storageMode.toUpperCase() != 'VSAM') {
dispatch(setVsamStatus(false));
}
}
}, []);

Expand Down Expand Up @@ -151,19 +153,23 @@ const Vsam = () => {
}, [showProgress, stateUpdated]);

useEffect(() => {
const allAttributesTrue = Object.values(vsamInitProgress).every(value => value === true);
if(allAttributesTrue) {
dispatchActions(true);
setShowProgress(initClicked || getProgress('vsamStatus'));
}
verifyAndSetVsamInitCompletion(vsamInitProgress);
}, [vsamInitProgress]);

const setVsamInitializationProgress = (vsamInitState: InitSubStepsState) => {
setVsamInitProgress(vsamInitState);
setVsamInitState(vsamInitState);
verifyAndSetVsamInitCompletion(vsamInitState);
}

const verifyAndSetVsamInitCompletion = (vsamInitState: InitSubStepsState, selectedStorageMode?: string) => {
const allAttributesTrue = Object.values(vsamInitState).every(value => value === true);
if(allAttributesTrue) {
dispatchActions(true);
setShowProgress(initClicked || getProgress('vsamStatus'));
} else if (selectedStorageMode && selectedStorageMode.toUpperCase() == 'VSAM') {
dispatchActions(false);
setShowProgress(false);
}
}

Expand Down Expand Up @@ -302,7 +308,6 @@ const Vsam = () => {
setAllowInitialization(regEx.test(dsName));
}


const cachingServiceChangeHandler = (newValue: string) => {
alertEmitter.emit('hideAlert');
datasetValidation(newValue);
Expand All @@ -326,14 +331,13 @@ const Vsam = () => {
}
};
setYamlConfig(updatedYaml);

if(event.target.value.toUpperCase() !== 'VSAM') {
Object.keys(vsamInitProgress).forEach(key => {
vsamInitProgress[key as keyof InitSubStepsState] = false;
});
setVsamInitializationProgress(vsamInitProgress);
dispatchActions(true);
setShowProgress(false);
} else {
verifyAndSetVsamInitCompletion(vsamInitProgress, event.target.value);
}
setShowProgress(false);
dispatchActions(false);
}

return (
Expand Down Expand Up @@ -409,7 +413,7 @@ const Vsam = () => {
null
}

<Box sx={{height: showProgress ? 'calc(100vh - 220px)' : 'auto'}} id="start-vsam-progress">
<Box sx={{height: showProgress ? 'calc(100vh - 70vh)' : 'auto'}} id="start-vsam-progress">
{!showProgress ? null :
<React.Fragment>
<ProgressCard label={`Write configuration file locally to temp directory`} id="init-vsam-progress-card" status={vsamInitProgress?.writeYaml}/>
Expand Down

0 comments on commit a22af3f

Please sign in to comment.