Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating planning stage #65

Merged
merged 7 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
238 changes: 206 additions & 32 deletions src/renderer/components/stages/Planning.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { useAppDispatch, useAppSelector } from '../../hooks';
import { IResponse } from '../../../types/interfaces';
import Alert from "@mui/material/Alert";
import { alertEmitter } from "../Header";
import { Checkbox, FormControlLabel } from "@mui/material";

const serverSchema = {
"$schema": "https://json-schema.org/draft/2019-09/schema",
Expand Down Expand Up @@ -133,6 +134,7 @@ const Planning = () => {
const [jobStatementValidation, setJobStatementValidation] = useState('');
const [locationsValidated, setLocationsValidated] = useState(false);
const [validationDetails, setValidationDetails] = useState({javaVersion: '', nodeVersion: '', spaceAvailableMb: '', error: ''});
const [showZosmfAttributes, setShowZosmfAttributes] = useState(false);

const zoweVersion = useAppSelector(selectZoweVersion);
const installationArgs: any = useAppSelector(selectInstallationArgs);
Expand Down Expand Up @@ -183,7 +185,8 @@ const Planning = () => {
}, []);

useEffect(() => {
dispatch(setNextStepEnabled(jobHeaderSaved && locationsValidated));
// dispatch(setNextStepEnabled(jobHeaderSaved && locationsValidated));
dispatch(setNextStepEnabled(true));
}, [jobHeaderSaved, locationsValidated]);

useEffect(() => {
Expand Down Expand Up @@ -340,44 +343,215 @@ Please customize job statement below to match your system requirements.
<Typography id="position-1" sx={{ mb: 2, whiteSpace: 'pre-wrap' }} color="text.secondary">
{`Now let's define general USS locations`}
</Typography>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<div style={{ flex: 1 }}>
<FormControl>
<TextField
id="installation-input"
required
style={{marginLeft: 0}}
label="Installation location"
variant="standard"
helperText="Location for Zowe source files"
value={installationArgs.installationDir}
onChange={(e) => dispatch(setInstallationArgs({...installationArgs, installationDir: e.target.value}))}
/>
<div>
<TextField
id="installation-input"
required
style={{marginLeft: 0}}
label="Installation location (Runtime Directory)"
variant="standard"
value={installationArgs.installationDir}
onChange={(e) => dispatch(setInstallationArgs({...installationArgs, installationDir: e.target.value}))}
/>
<p style={{ marginTop: '5px', marginBottom: '0', fontSize: 'smaller', color: 'grey' }}>Location for Zowe source files</p>
</div>
</FormControl>
<FormControl>
<TextField
id="java-home-input"
required
style={{marginLeft: 0}}
label="Java location"
variant="standard"
helperText="Location of Java in USS"
value={installationArgs.javaHome}
onChange={(e) => dispatch(setInstallationArgs({...installationArgs, javaHome: e.target.value}))}
/>
<div>
<TextField
id="workspace-input"
required
style={{marginLeft: 0}}
label="Workspace Directory"
variant="standard"
value={installationArgs.workspaceDir}
onChange={(e) => dispatch(setInstallationArgs({...installationArgs, workspaceDir: e.target.value}))}
/>
<p style={{ marginTop: '5px', marginBottom: '0', fontSize: 'smaller', color: 'grey' }}>Location for Zowe workspace dir</p>
</div>
</FormControl>
<FormControl>
<TextField
id="node-home-input"
required
style={{marginLeft: 0}}
label="Node JS location"
variant="standard"
helperText="Location of Node JS in USS"
value={installationArgs.nodeHome}
onChange={(e) => dispatch(setInstallationArgs({...installationArgs, nodeHome: e.target.value}))}
/>
<div>
<TextField
id="log-input"
required
style={{marginLeft: 0}}
label="Log Directory"
variant="standard"
value={installationArgs.logDir}
onChange={(e) => dispatch(setInstallationArgs({...installationArgs, logDir: e.target.value}))}
/>
<p style={{ marginTop: '5px', marginBottom: '0', fontSize: 'smaller', color: 'grey' }}>Location for Zowe Log dir</p>
</div>
</FormControl>
<FormControl>
<div>
<TextField
id="extention-input"
required
style={{marginLeft: 0}}
label="Extention Directory"
variant="standard"
value={installationArgs.extentionDir}
onChange={(e) => dispatch(setInstallationArgs({...installationArgs, extentionDir: e.target.value}))}
/>
<p style={{ marginTop: '5px', marginBottom: '0', fontSize: 'smaller', color: 'grey' }}>Location for Zowe extention dir</p>
</div>
</FormControl>
<FormControl>
<div>
<TextField
id="rbac-input"
required
style={{marginLeft: 0}}
label="Rbac Profile Identifier"
variant="standard"
value={installationArgs.rbacProfile}
onChange={(e) => dispatch(setInstallationArgs({...installationArgs, rbacProfile: e.target.value}))}
/>
<p style={{ marginTop: '5px', marginBottom: '0', fontSize: 'smaller', color: 'grey' }}>An ID used for determining resource names used in RBAC authorization checks</p>
</div>
</FormControl>
</div>
<div style={{ flex: 1 }}>
<FormControl>
<div>
<TextField
id="job-name-input"
required
style={{marginLeft: 0}}
label="Job Name"
variant="standard"
value={installationArgs.jobName}
onChange={(e) => dispatch(setInstallationArgs({...installationArgs, jobName: e.target.value}))}
/>
<p style={{ marginTop: '5px', marginBottom: '0', fontSize: 'smaller', color: 'grey' }}>Job name of Zowe primary ZWESLSTC started task.</p>
</div>
</FormControl>
<FormControl>
<div>
<TextField
id="job-prefix-input"
required
style={{marginLeft: 0}}
label="Job Prefix"
variant="standard"
value={installationArgs.jobPrefix}
onChange={(e) => dispatch(setInstallationArgs({...installationArgs, jobPrefix: e.target.value}))}
/>
<p style={{ marginTop: '5px', marginBottom: '0', fontSize: 'smaller', color: 'grey' }}>A short prefix to customize address spaces created by Zowe job.</p>
</div>
</FormControl>
<FormControl>
<div>
<TextField
id="cookie-input"
required
style={{marginLeft: 0}}
label="Cookie Identifier"
variant="standard"
value={installationArgs.cookieId}
onChange={(e) => dispatch(setInstallationArgs({...installationArgs, rbacProfile: e.target.value}))}
/>
<p style={{ marginTop: '5px', marginBottom: '0', fontSize: 'smaller', color: 'grey' }}>An ID that can be used by servers that distinguish their cookies from unrelated Zowe installs</p>
</div>
</FormControl>
<FormControl>
<div>
<TextField
id="java-home-input"
required
style={{marginLeft: 0}}
label="Java location"
variant="standard"
value={installationArgs.javaHome}
onChange={(e) => dispatch(setInstallationArgs({...installationArgs, javaHome: e.target.value}))}
/>
<p style={{ marginTop: '5px', marginBottom: '0', fontSize: 'smaller', color: 'grey' }}>Location of Java in USS</p>
</div>
</FormControl>
<FormControl>
<div>
<TextField
id="node-home-input"
required
style={{marginLeft: 0}}
label="Node JS location"
variant="standard"
value={installationArgs.nodeHome}
onChange={(e) => dispatch(setInstallationArgs({...installationArgs, nodeHome: e.target.value}))}
/>
<p style={{ marginTop: '5px', marginBottom: '0', fontSize: 'smaller', color: 'grey' }}>Location for Zowe workspace dir</p>
</div>
</FormControl>
</div>
</div>
<FormControlLabel
control={
<Checkbox
checked={showZosmfAttributes}
onChange={(e) => setShowZosmfAttributes(e.target.checked)}
/>
}
label="Set Zosmf Attributes"
/>

{showZosmfAttributes && (
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<div style={{ flex: 1 }}>
<FormControl>
<div>
<TextField
id="zosmf-host"
required
style={{marginLeft: 0}}
label="Zosmf Host"
variant="standard"
value={installationArgs.zosmfHost}
onChange={(e) => dispatch(setInstallationArgs({...installationArgs, zosmfHost: e.target.value}))}
/>
<p style={{ marginTop: '5px', marginBottom: '0', fontSize: 'smaller', color: 'grey' }}>Host or domain name of your z/OSMF instance.</p>
</div>
</FormControl>
<FormControl>
<div>
<TextField
id="zosmf-port"
required
style={{marginLeft: 0}}
label="Zosmf Port"
variant="standard"
value={installationArgs.zosmfPort}
onChange={(e) => dispatch(setInstallationArgs({...installationArgs, zosmfPort: e.target.value}))}
/>
<p style={{ marginTop: '5px', marginBottom: '0', fontSize: 'smaller', color: 'grey' }}>Port number of your z/OSMF instance.</p>
</div>
</FormControl>
</div>
<div style={{ flex: 1 }}>
<FormControl>
<div>
<TextField
id="zosmf-appl-id"
required
style={{marginLeft: 0}}
label="Zosmf Application Id"
variant="standard"
value={installationArgs.zosmfApplId}
onChange={(e) => dispatch(setInstallationArgs({...installationArgs, zosmfApplId: e.target.value}))}
/>
<p style={{ marginTop: '5px', marginBottom: '0', fontSize: 'smaller', color: 'grey' }}>Port number of your z/OSMF instance.</p>

</div>
</FormControl>
</div>
</div>
)}
<FormControl sx={{display: 'flex', alignItems: 'center', maxWidth: '72ch', justifyContent: 'center'}}>
<Button sx={{boxShadow: 'none', mr: '12px'}} type={step === 1 ? "submit" : "button"} variant="text" onClick={e => validateLocations(e)}>Validate locations</Button>
<Button sx={{boxShadow: 'none', mr: '12px', marginLeft: '50%'}} type={step === 1 ? "submit" : "button"} variant="text" onClick={e => validateLocations(e)}>Validate locations</Button>
{locationsValidated ? <CheckCircleOutlineIcon color="success" sx={{ fontSize: 32 }}/> : validationDetails.error ? null: null}
</FormControl>
</Box>
Expand Down
20 changes: 20 additions & 0 deletions src/renderer/components/stages/installation/installationSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,23 @@ interface InstallationState {
installationStatus: boolean;
installationArgs: {
installationDir: string;
workspaceDir: string;
logDir: string,
extentionDir: string,
installationType?: string;
downloadDir: string;
userUploadedPaxPath?: string;
smpeDir?: string;
javaHome: string;
nodeHome: string;
setupConfig: any;
jobName: string;
jobPrefix: string;
rbacProfile: string;
cookieId: string;
zosmfHost: string,
zosmfPort: string,
zosmfApplId: string
};
zoweVersion: string;
}
Expand All @@ -30,13 +40,23 @@ const initialState: InstallationState = {
installationStatus: false,
installationArgs: {
installationDir: '',
workspaceDir: '',
logDir:'',
extentionDir:'',
installationType: 'download',
userUploadedPaxPath: '',
smpeDir: '',
downloadDir: '',
javaHome: '',
nodeHome: '',
setupConfig: {},
jobName: 'ZWE1SV',
jobPrefix: 'ZWE1',
rbacProfile: '1',
cookieId: '1',
zosmfHost: '',
zosmfPort: '',
zosmfApplId: ''
},
zoweVersion: '',
};
Expand Down
Loading