diff --git a/src/renderer/components/Home.tsx b/src/renderer/components/Home.tsx index 559bb099..ebf8ab5b 100644 --- a/src/renderer/components/Home.tsx +++ b/src/renderer/components/Home.tsx @@ -12,10 +12,9 @@ import '../global.css'; import { useEffect, useState } from "react"; import { Link } from 'react-router-dom'; import { Box, Card, CardContent, CardMedia, Typography, Button, DialogContent, DialogActions } from '@mui/material'; -import Dialog from '@mui/material/Dialog'; -import DialogTitle from '@mui/material/DialogTitle'; +import flatten, { unflatten } from 'flat'; import { IResponse, IIpcConnectionArgs } from '../../types/interfaces'; -import { setConnectionArgs, selectConnectionArgs, selectInitJobStatement } from './stages/connection/connectionSlice'; +import { setConnectionArgs, setResumeProgress, selectInitJobStatement } from './stages/connection/connectionSlice'; import { setJobStatement } from './stages/PlanningSlice'; import { setZoweCLIVersion } from './configuration-wizard/wizardSlice'; import { useAppDispatch, useAppSelector } from '../hooks'; @@ -28,6 +27,8 @@ import { selectConnectionStatus} from './stages/progress/progressSlice'; import HorizontalLinearStepper from './common/Stepper'; import Wizard from './configuration-wizard/Wizard' import Connection from './stages/connection/Connection'; +import { ActiveState } from '../../types/stateInterfaces'; +import { getPreviousInstallation } from './stages/progress/StageProgressStatus'; // REVIEW: Get rid of routing @@ -85,19 +86,28 @@ const makeCard = (card: ICard) => { const Home = () => { const dispatch = useAppDispatch(); - const activeStepIndex = useAppSelector(selectActiveStepIndex); - const isSubStep = useAppSelector(selectIsSubstep); - const activeSubStepIndex = useAppSelector(selectActiveSubStepIndex); const connectionStatus = useAppSelector(selectConnectionStatus); - const lastActiveDate = useAppSelector(selectActiveStepDate); - const initJobStatement = useAppSelector(selectInitJobStatement); - const [showWizard, setShowWizard] = useState(false); const [showLoginDialog, setShowLogin] = useState(false); + + const { activeStepIndex, isSubStep, activeSubStepIndex, lastActiveDate } = getPreviousInstallation(); + + const prevInstallationKey = "prev_installation"; + const lastActiveState: ActiveState = { + activeStepIndex: 0, + isSubStep: false, + activeSubStepIndex: 0, + }; + const [isNewInstallation, setIsNewInstallation] = useState(false); + const stages: any = []; + const defaultTooltip: string = "Resume"; + const resumeTooltip = connectionStatus ? defaultTooltip : `Validate Credentials & ${defaultTooltip}`; useEffect(() => { eventDispatcher.on('saveAndCloseEvent', () => setShowWizard(false)); + + window.electron.ipcRenderer.checkZoweCLI().then((res: IResponse) => { if (res.status) { dispatch(setZoweCLIVersion(res.details)); @@ -121,6 +131,18 @@ const Home = () => { // TODO: Add support for other types console.warn('Connection types other than FTP are not supported yet'); } + + const lastInstallation = localStorage.getItem(prevInstallationKey); + if (!lastInstallation) { + const flattenedData = flatten(lastActiveState); + localStorage.setItem(prevInstallationKey, JSON.stringify(flattenedData)); + setIsNewInstallation(true); + } else { + const data: ActiveState = unflatten(JSON.parse(lastInstallation)); + setIsNewInstallation(!(data && data.lastActiveDate)); + } + + }); return () => { eventDispatcher.off('saveAndCloseEvent', () => setShowWizard(true)); @@ -129,33 +151,24 @@ const Home = () => { const resumeProgress = () => { setShowWizard(true); - setShowLogin(!connectionStatus); - eventDispatcher.emit('updateActiveStep', activeStepIndex, isSubStep, activeSubStepIndex); + dispatch(setResumeProgress(!connectionStatus)); } return ( <> - {}} open={showLoginDialog} style={{fontSize: '14px'}} fullWidth={true} - maxWidth={"lg"}> - Re-enter FTP Credentials - - - - - {!showWizard &&
- {!connectionStatus &&
} + {!connectionStatus &&
}
{cards.map(card => makeCard(card))}
- {connectionStatus &&
+ {!isNewInstallation &&
@@ -165,7 +178,7 @@ const Home = () => {
Last updated on: {lastActiveDate}
- + diff --git a/src/renderer/components/common/Stepper.tsx b/src/renderer/components/common/Stepper.tsx index e128b854..bbfb681e 100644 --- a/src/renderer/components/common/Stepper.tsx +++ b/src/renderer/components/common/Stepper.tsx @@ -30,9 +30,11 @@ import eventDispatcher from '../../../utils/eventDispatcher'; import Warning from '@mui/icons-material/Warning'; import CheckCircle from '@mui/icons-material/CheckCircle'; import Home from '../Home'; +import { getProgress, getCompleteProgress, mapAndSetSkipStatus, mapAndGetSkipStatus } from '../stages/progress/StageProgressStatus'; import '../../styles/Stepper.css'; import { StepIcon } from '@mui/material'; +import { stages } from '../configuration-wizard/Wizard'; // TODO: define props, stages, stage interfaces // TODO: One rule in the store to enable/disable button @@ -43,21 +45,23 @@ export default function HorizontalLinearStepper({stages, initialization}:{stages const INIT_STAGE_ID = 3; const REVIEW_STAGE_ID = 4; + const completeProgress = getCompleteProgress(); + const stageProgressStatus = [ useSelector(selectConnectionStatus), - useSelector(selectPlanningStatus), - useSelector(selectInstallationTypeStatus), - useSelector(selectInitializationStatus), - useSelector(selectReviewStatus), + completeProgress.planningStatus, + completeProgress.installationTypeStatus, + completeProgress.initializationStatus, + completeProgress.reviewStatus ]; const subStageProgressStatus = [ - useSelector(selectDatasetInstallationStatus), - useSelector(selectNetworkingStatus), - useSelector(selectApfAuthStatus), - useSelector(selectSecurityStatus), - useSelector(selectCertificateStatus), - useSelector(selectLaunchConfigStatus), + completeProgress.datasetInstallationStatus, + completeProgress.networkingStatus, + completeProgress.apfAuthStatus, + completeProgress.securityStatus, + completeProgress.certificateStatus, + completeProgress.launchConfigStatus ] const TYPE_YAML = "yaml"; @@ -113,6 +117,7 @@ export default function HorizontalLinearStepper({stages, initialization}:{stages const handleSkip = () => { stages[activeStep].isSkipped = true; stages[activeStep].subStages[activeSubStep].isSkipped = true; + mapAndSetSkipStatus(activeSubStep, true); handleNext(); } @@ -165,18 +170,18 @@ export default function HorizontalLinearStepper({stages, initialization}:{stages setActiveStep(newActiveStep); const newSubStep = isSubStep ? subStepIndex : 0; setActiveSubStep(newSubStep); - }; + } const getStepIcon = (error: any, stageId: number, isSubStep?: boolean, subStepId?: number) => { - if ((error && activeStep>stageId && !isSubStep) || (error && isSubStep && stages[stageId].subStages[subStepId].isSkipped)) { - return } />; - } - - if (!error) { + if (!error || (isSubStep && getProgress(stages[stageId].subStages[subStepId].statusKey)) || (!isSubStep && getProgress(stages[stageId].statusKey))) { return } />; } + if ((isSubStep && mapAndGetSkipStatus(subStepId)) || (error && activeStep>stageId && !isSubStep) || (error && isSubStep && stages[stageId].subStages[subStepId].isSkipped)) { + return } />; + } + else { return ( , hasJCL: false, isSkippable: false, isSkipped: false, hasOutput: false, steps: 1, nextButton: 'Continue'}, - {id: 1, label: 'Planning', component: , hasJCL: false, isSkippable: false, isSkipped: false, hasOutput: true, steps: 3, nextButton: 'Continue to Installation Options'}, - {id: 2, label: 'Installation Type', component: , hasJCL: false, isSkippable: false, isSkipped: false, hasOutput: false, steps: 1, nextButton: 'Continue to Components Installation'}, + {id: 0, label: 'Connection', component: , hasJCL: false, isSkippable: false, isSkipped: false, hasOutput: false, steps: 1, nextButton: 'Continue', statusKey: 'connectionStatus'}, + {id: 1, label: 'Planning', component: , hasJCL: false, isSkippable: false, isSkipped: false, hasOutput: true, steps: 3, nextButton: 'Continue to Installation Options', statusKey: 'planningStatus'}, + {id: 2, label: 'Installation Type', component: , hasJCL: false, isSkippable: false, isSkipped: false, hasOutput: false, steps: 1, nextButton: 'Continue to Components Installation', statusKey: 'installationTypeStatus'}, {id: 3, label: 'Initialization', component: , hasJCL: true, isSkippable: true, isSkipped: false, hasYaml: true, hasOutput: true, steps: 1, subStages: [ - {id: 0, label: 'Installation', component: , hasJCL: true, isSkippable: true, isSkipped: false, hasYaml: true, hasOutput: true, steps: 1, nextButton: 'Continue to Network Setup'}, - {id: 1, label: 'Networking', component: , hasJCL: true, isSkippable: true, isSkipped: false, hasYaml: true, hasOutput: true, steps: 1, nextButton: 'Continue to APF Auth Setup'}, - {id: 2, label: 'APF Auth', component: , hasJCL: true, isSkippable: true, isSkipped: false, hasYaml: true, hasOutput: true, steps: 1, nextButton: 'Continue to Security Setup'}, - {id: 3, label: 'Security', component: , hasJCL: true, isSkippable: true, isSkipped: false, hasYaml: true, hasOutput: true, steps: 1, nextButton: 'Continue to Certificates Setup'}, - {id: 4, label: 'Certificates', component: , hasJCL: true, isSkippable: true, isSkipped: false, hasYaml: true, hasOutput: true, steps: 1, nextButton: 'Continue to Launch Setup'}, - {id: 5, label: 'Launch Config', component: , hasJCL: true, isSkippable: true, isSkipped: false, hasYaml: true, hasOutput: true, steps: 1, nextButton: 'Continue to Instance Setup'}, - ], nextButton: 'Review'}, - {id: 4, label: 'Review Installation', component: , hasJCL: false, isSkippable: false, hasOutput: false, steps: 1, nextButton: 'Finish Installation'}, - {id: 5, label: 'Finish Installation', component: , hasJCL: false, isSkippable: false, isSkipped: false, hasOutput: false, steps: 1}, + {id: 0, label: 'Installation', component: , hasJCL: true, isSkippable: true, isSkipped: false, hasYaml: true, hasOutput: true, steps: 1, nextButton: 'Continue to Network Setup', statusKey: 'datasetInstallationStatus'}, + {id: 1, label: 'Networking', component: , hasJCL: true, isSkippable: true, isSkipped: false, hasYaml: true, hasOutput: true, steps: 1, nextButton: 'Continue to APF Auth Setup', statusKey: 'networkingStatus'}, + {id: 2, label: 'APF Auth', component: , hasJCL: true, isSkippable: true, isSkipped: false, hasYaml: true, hasOutput: true, steps: 1, nextButton: 'Continue to Security Setup', statusKey: 'apfAuthStatus'}, + {id: 3, label: 'Security', component: , hasJCL: true, isSkippable: true, isSkipped: false, hasYaml: true, hasOutput: true, steps: 1, nextButton: 'Continue to Certificates Setup', statusKey: 'securityStatus'}, + {id: 4, label: 'Certificates', component: , hasJCL: true, isSkippable: true, isSkipped: false, hasYaml: true, hasOutput: true, steps: 1, nextButton: 'Continue to Launch Setup', statusKey: 'certificateStatus'}, + {id: 5, label: 'Launch Config', component: , hasJCL: true, isSkippable: true, isSkipped: false, hasYaml: true, hasOutput: true, steps: 1, nextButton: 'Continue to Instance Setup', statusKey: 'launchConfigStatus'}, + ], nextButton: 'Review', statusKey: 'initializationStatus'}, + {id: 4, label: 'Review Installation', component: , hasJCL: false, isSkippable: false, hasOutput: false, steps: 1, nextButton: 'Finish Installation', statusKey: 'reviewStatus'}, + {id: 5, label: 'Finish Installation', component: , hasJCL: false, isSkippable: false, isSkipped: false, hasOutput: false, steps: 1, statusKey: 'finishStatus'}, ] const Wizard = ({initialization}: {initialization: boolean}) => { diff --git a/src/renderer/components/stages/Certificates.tsx b/src/renderer/components/stages/Certificates.tsx index 954e0263..c202b85c 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 "../../../utils/StageDetails"; -import { setProgress, getProgress, setCertificateInitState, getCertificateInitState } from "./progress/StageProgressStatus"; +import { setProgress, getProgress, setCertificateInitState, getCertificateInitState, mapAndSetSkipStatus, getInstallationArguments } from "./progress/StageProgressStatus"; import { CertInitSubStepsState } from "../../../types/stateInterfaces"; const Certificates = () => { @@ -44,7 +44,7 @@ const Certificates = () => { const schema = useAppSelector(selectSchema); const [yaml, setLYaml] = useState(useAppSelector(selectYaml)); const connectionArgs = useAppSelector(selectConnectionArgs); - const installationArgs = useAppSelector(selectInstallationArgs); + const installationArgs = getInstallationArguments(); const setupSchema = schema ? schema.properties.zowe.properties.setup.properties.certificate : ""; const verifyCertsSchema = schema ? {"type": "object", "properties": {"verifyCertificates": schema.properties.zowe.properties.verifyCertificates}} : ""; const [setupYaml, setSetupYaml] = useState(yaml?.zowe?.setup?.certificate); @@ -154,10 +154,16 @@ 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); + } + const updateProgress = (status: boolean) => { setStateUpdated(!stateUpdated); - stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped = !status; - stages[STAGE_ID].isSkipped = !status; + setStageSkipStatus(!status); + if(!status) { for (let key in certificateInitProgress) { certificateInitProgress[key as keyof(CertInitSubStepsState)] = false; diff --git a/src/renderer/components/stages/InitApfAuth.tsx b/src/renderer/components/stages/InitApfAuth.tsx index eb411ea9..2c3e1b16 100644 --- a/src/renderer/components/stages/InitApfAuth.tsx +++ b/src/renderer/components/stages/InitApfAuth.tsx @@ -24,7 +24,7 @@ import { createTheme } from '@mui/material/styles'; import { stages } from "../configuration-wizard/Wizard"; import { setActiveStep, selectActiveStepIndex, selectActiveSubStepIndex, selectIsSubstep } from "./progress/activeStepSlice"; import { getStageDetails, getSubStageDetails } from "../../../utils/StageDetails"; -import { setProgress, getProgress, setApfAuthState, getApfAuthState } from "./progress/StageProgressStatus"; +import { setProgress, getProgress, setApfAuthState, getApfAuthState, mapAndSetSkipStatus, getInstallationArguments } from "./progress/StageProgressStatus"; import { InitSubStepsState } from "../../../types/stateInterfaces"; const InitApfAuth = () => { @@ -61,7 +61,7 @@ const InitApfAuth = () => { const [initClicked, setInitClicked] = useState(false); const [reinit, setReinit] = useState(false); - const installationArgs = useAppSelector(selectInstallationArgs); + const installationArgs = getInstallationArguments(); let timer: any; const section = 'dataset'; @@ -148,10 +148,16 @@ 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); + } + const updateProgress = (status: boolean) => { setStateUpdated(!stateUpdated); - stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped = !status; - stages[STAGE_ID].isSkipped = !status; + setStageSkipStatus(!status); + if(!status) { for (let key in apfAuthInitProgress) { apfAuthInitProgress[key as keyof(InitSubStepsState)] = false; diff --git a/src/renderer/components/stages/Initialization.tsx b/src/renderer/components/stages/Initialization.tsx index 9997c08a..9f37ece3 100644 --- a/src/renderer/components/stages/Initialization.tsx +++ b/src/renderer/components/stages/Initialization.tsx @@ -10,8 +10,6 @@ import React, {useEffect} from "react"; import { useAppDispatch } from '../../hooks'; -import Button from '@mui/material/Button'; -import ProgressCard from '../common/ProgressCard'; import ContainerCard from '../common/ContainerCard'; import { setActiveStep } from "./progress/activeStepSlice"; diff --git a/src/renderer/components/stages/Networking.tsx b/src/renderer/components/stages/Networking.tsx index 3ab635cb..3f48c008 100644 --- a/src/renderer/components/stages/Networking.tsx +++ b/src/renderer/components/stages/Networking.tsx @@ -127,7 +127,7 @@ const Networking = () => { const theme = createTheme(); const stageLabel = 'Initialization'; - const subStageLabel = 'APF Auth'; + const subStageLabel = 'Networking'; const STAGE_ID = getStageDetails(stageLabel).id; const SUB_STAGES = !!getStageDetails(stageLabel).subStages; diff --git a/src/renderer/components/stages/Planning.tsx b/src/renderer/components/stages/Planning.tsx index ff45eae3..407113e7 100644 --- a/src/renderer/components/stages/Planning.tsx +++ b/src/renderer/components/stages/Planning.tsx @@ -30,1207 +30,12 @@ import { setActiveStep } from './progress/activeStepSlice'; import EditorDialog from "../common/EditorDialog"; import { getStageDetails } from "../../../utils/StageDetails"; import { getProgress, getPlanningStageStatus, setPlanningValidationDetailsState, getPlanningValidationDetailsState } from "./progress/StageProgressStatus"; +import { EXAMPLE_YAML, YAML_SCHEMA } from "../../config/constants"; // TODO: Our current theoretical cap is 72 (possibly minus a couple for "\n", 70?) But we force more chars in InstallationHandler.tsx // This is all I want to manually test for now. Future work can min/max this harder const JCL_UNIX_SCRIPT_CHARS = 55; -const EXAMPLE_YAML = { - "node": { - "home": "" - }, - "java": { - "home": "" - }, - "zOSMF": { - "host": "dvipa.my-company.com", - "port": 443, - "applId": "IZUDFLT" - }, - "zowe": { - "rbacProfileIdentifier": "1", - "logDirectory": "/global/zowe/logs", - "job": { - "prefix": "ZWE1", - "name": "ZWE1SV" - }, - "sysMessages": [ - "ZWEL0021I", - "ZWEL0018I", - "ZWEL0006I", - "ZWES1601I", - "ZWEL0008I", - "ZWEL0022I", - "ZWEL0001I", - "ZWEL0002I", - "ZWEAM000I", - "ZWED0031I", - "ZWES1013I" - ], - "launchScript": { - "logLevel": "info", - "onComponentConfigureFail": "warn" - }, - "extensionDirectory": "/global/zowe/extensions", - "certificate": { - "keystore": { - "alias": "localhost", - "password": "password", - "type": "PKCS12", - "file": "/global/zowe/keystore/localhost/localhost.keystore.p12" - }, - "pem": { - "key": "/global/zowe/keystore/localhost/localhost.key", - "certificate": "/global/zowe/keystore/localhost/localhost.cer", - "certificateAuthorities": "/global/zowe/keystore/local_ca/local_ca.cer" - }, - "truststore": { - "password": "password", - "type": "PKCS12", - "file": "/global/zowe/keystore/localhost/localhost.truststore.p12" - } - }, - "cookieIdentifier": "1", - "verifyCertificates": "STRICT", - "setup": { - "dataset": { - "authLoadlib": "IBMUSER.ZWEV2.SZWEAUTH", - "proclib": "USER.PROCLIB", - "authPluginLib": "IBMUSER.ZWEV2.CUST.ZWESAPL", - "prefix": "IBMUSER.ZWEV2", - "parmlib": "IBMUSER.ZWEV2.CUST.PARMLIB", - "loadlib": "IBMUSER.ZWEV2.SZWELOAD", - "parmlibMembers": { - "zis": "ZWESIP00" - }, - "jcllib": "IBMUSER.ZWEV2.CUST.JCLLIB" - }, - "certificate": { - "type": "PKCS12", - "pkcs12": { - "directory": "/var/zowe/keystore" - } - }, - "vsam": { - "volume": "", - "mode": "NONRLS", - "storageClass": "" - } - }, - "externalDomains": [ - "sample-domain.com" - ], - "externalPort": 7554, - "configmgr": { - "validation": "COMPONENT-COMPAT" - }, - "workspaceDirectory": "/global/zowe/workspace", - "runtimeDirectory": "", - "useConfigmgr": true - }, - "components": { - "metrics-service": { - "debug": false, - "enabled": false, - "port": 7551 - }, - "zss": { - "tls": true, - "enabled": true, - "crossMemoryServerName": "ZWESIS_STD", - "port": 7557, - "agent": { - "jwt": { - "fallback": true - } - } - }, - "explorer-uss": { - "enabled": true - }, - "jobs-api": { - "debug": false, - "enabled": false, - "port": 7558 - }, - "files-api": { - "debug": false, - "enabled": false, - "port": 7559 - }, - "explorer-mvs": { - "enabled": true - }, - "cloud-gateway": { - "debug": false, - "enabled": false, - "port": 7563 - }, - "explorer-jes": { - "enabled": true - }, - "api-catalog": { - "debug": false, - "enabled": true, - "port": 7552 - }, - "gateway": { - "debug": false, - "enabled": true, - "port": 7554, - "apiml": { - "security": { - "x509": { - "enabled": false - }, - "auth": { - "zosmf": { - "jwtAutoconfiguration": "auto", - "serviceId": "zosmf" - }, - "provider": "zosmf" - }, - "authorization": { - "endpoint": { - "enabled": false - }, - "provider": "" - } - } - }, - "server": { - "internal": { - "ssl": { - "enabled": false - }, - "enabled": false, - "port": 7550 - } - } - }, - "app-server": { - "debug": false, - "enabled": true, - "port": 7556 - }, - "caching-service": { - "debug": false, - "enabled": true, - "storage": { - "evictionStrategy": "reject", - "size": 10000, - "infinispan": { - "jgroups": { - "port": 7600 - } - }, - "mode": "VSAM", - "vsam": { - "name": "" - } - }, - "port": 7555 - }, - "discovery": { - "debug": false, - "enabled": true, - "port": 7553 - } - } -} - -var YAML_SCHEMA: any = { - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "https://zowe.org/schemas/v2/server-base", - "title": "Zowe configuration file", - "description": "Configuration file for Zowe (zowe.org) version 2.", - "type": "object", - "additionalProperties": false, - "properties": { - "zowe": { - "type": "object", - "additionalProperties": false, - "properties": { - "setup": { - "type": "object", - "additionalProperties": false, - "description": "Zowe setup configurations used by \"zwe install\" and \"zwe init\" commands.", - "properties": { - "dataset": { - "type": "object", - "additionalProperties": false, - "description": "MVS data set related configurations", - "properties": { - "prefix": { - "type": "string", - "description": "Where Zowe MVS data sets will be installed" - }, - "proclib": { - "type": "string", - "description": "PROCLIB where Zowe STCs will be copied over" - }, - "parmlib": { - "type": "string", - "description": "Zowe PARMLIB" - }, - "parmlibMembers": { - "type": "object", - "additionalProperties": false, - "description": "Holds Zowe PARMLIB members for plugins", - "properties": { - "zis": { - "description": "PARMLIB member used by ZIS", - "type": "string", - "pattern": "^([A-Z$#@]){1}([A-Z0-9$#@]){0,7}$", - "minLength": 1, - "maxLength": 8 - } - } - }, - "jcllib": { - "type": "string", - "description": "JCL library where Zowe will store temporary JCLs during initialization" - }, - "loadlib": { - "type": "string", - "description": "States the dataset where Zowe executable utilities are located", - "default": ".SZWELOAD" - }, - "authLoadlib": { - "type": "string", - "description": "The dataset that contains any Zowe core code that needs to run APF-authorized, such as ZIS", - "default": ".SZWEAUTH" - }, - "authPluginLib": { - "type": "string", - "description": "APF authorized LOADLIB for Zowe ZIS Plugins" - } - } - }, - "zis": { - "type": "object", - "additionalProperties": false, - "description": "ZIS related configurations. This setup is optional.", - "properties": { - "parmlib": { - "type": "object", - "additionalProperties": false, - "description": "ZIS related PARMLIB configurations. This setup is optional.", - "properties": { - "keys": { - "type": "object", - "additionalProperties": true, - "description": "Used to specify special ZIS key types with key-value pairs", - "examples": [ - "key.sample.1: list", - "key.sample.2: list" - ] - } - } - } - } - }, - "security": { - "type": "object", - "additionalProperties": false, - "description": "Security related configurations. This setup is optional.", - "properties": { - "product": { - "type": "string", - "description": "Security product name. Can be RACF, ACF2 or TSS", - "enum": ["RACF", "ACF2", "TSS"], - "default": "RACF" - }, - "groups": { - "type": "object", - "additionalProperties": false, - "description": "security group name", - "properties": { - "admin": { - "type": "string", - "description": "Zowe admin user group", - "default": "ZWEADMIN" - }, - "stc": { - "type": "string", - "description": "Zowe STC group", - "default": "ZWEADMIN" - }, - "sysProg": { - "type": "string", - "description": "Zowe SysProg group", - "default": "ZWEADMIN" - } - } - }, - "users": { - "type": "object", - "additionalProperties": false, - "description": "security user name", - "properties": { - "zowe": { - "type": "string", - "description": "Zowe runtime user name of main service", - "default": "ZWESVUSR" - }, - "zis": { - "type": "string", - "description": "Zowe runtime user name of ZIS", - "default": "ZWESIUSR" - } - } - }, - "stcs": { - "type": "object", - "additionalProperties": false, - "description": "STC names", - "properties": { - "zowe": { - "type": "string", - "description": "STC name of main service", - "default": "ZWESLSTC" - }, - "zis": { - "type": "string", - "description": "STC name of ZIS", - "default": "ZWESISTC" - }, - "aux": { - "type": "string", - "description": "STC name of Auxiliary Service", - "default": "ZWESASTC" - } - } - } - } - }, - "certificate": { - "type": "object", - "additionalProperties": false, - "if": { - "properties": { - "type": { - "const": "PKCS12" - } - } - }, - "then": { - "required": ["pkcs12"] - }, - "else": { - "required": ["keyring"] - }, - "description": "Certificate related configurations", - "properties": { - "type": { - "type": "string", - "description": "Type of certificate storage method.", - "enum": ["PKCS12", "JCEKS", "JCECCAKS", "JCERACFKS", "JCECCARACFKS", "JCEHYBRIDRACFKS"], - "default": "PKCS12" - }, - "pkcs12": { - "type": "object", - "additionalProperties": false, - "description": "PKCS#12 keystore settings", - "properties": { - "directory": { - "description": "Keystore directory", - "type": "string", - "pattern": "^([^\\0]){1,1024}$", - "minLength": 1, - "maxLength": 1024 - }, - "name": { - "type": "string", - "description": "Certificate alias name. Note: please use all lower cases as alias.", - "default": "localhost" - }, - "password": { - "type": "string", - "description": "Keystore password", - "default": "password" - }, - "caAlias": { - "type": "string", - "description": "Alias name of self-signed certificate authority. Note: please use all lower cases as alias.", - "default": "local_ca" - }, - "caPassword": { - "type": "string", - "description": "Password of keystore stored self-signed certificate authority.", - "default": "local_ca_password" - }, - "lock": { - "type": "boolean", - "description": "Whether to restrict the permissions of the keystore after creation" - }, - "import": { - "type": "object", - "additionalProperties": false, - "description": "Configure this section if you want to import certificate from another PKCS#12 keystore.", - "properties": { - "keystore": { - "type": "string", - "description": "Existing PKCS#12 keystore which holds the certificate issued by external CA." - }, - "password": { - "type": "string", - "description": "Password of the above keystore" - }, - "alias": { - "type": "string", - "description": "Certificate alias will be imported. Note: please use all lower cases as alias." - } - } - } - } - }, - "keyring": { - "type": "object", - "additionalProperties": false, - "description": "Configure this section if you are using z/OS keyring", - "properties": { - "owner": { - "type": "string", - "description": "keyring owner. If this is empty, Zowe will use the user ID defined as zowe.setup.security.users.zowe." - }, - "name": { - "type": "string", - "description": "keyring name" - }, - "label": { - "type": "string", - "description": "Label of Zowe certificate.", - "default": "localhost" - }, - "caLabel": { - "type": "string", - "description": "label of Zowe CA certificate.", - "default": "localca" - }, - "connect": { - "type": "object", - "additionalProperties": false, - "description": "Configure this section if you want to connect existing certificate in keyring to Zowe.", - "properties": { - "user": { - "type": "string", - "description": "Current owner of the existing certificate, can be SITE or an user ID." - }, - "label": { - "type": "string", - "description": "Label of the existing certificate will be connected to Zowe keyring." - } - } - }, - "import": { - "type": "object", - "additionalProperties": false, - "description": "Configure this section if you want to import existing certificate stored in data set to Zowe.", - "properties": { - "dsName": { - "type": "string", - "description": "Name of the data set holds the certificate issued by other CA. This data set should be in PKCS12 format and contain private key." - }, - "password": { - "type": "string", - "description": "Password for the PKCS12 data set." - } - } - }, - "zOSMF": { - "type": "object", - "additionalProperties": false, - "description": "Configure this section if you want to trust z/OSMF certificate authority in Zowe keyring.", - "properties": { - "ca": { - "type": "string", - "description": "z/OSMF certificate authority alias" - }, - "user": { - "type": "string", - "description": "z/OSMF user. Zowe initialization utility can detect alias of z/OSMF CA for RACF security system. The automated detection requires this z/OSMF user as input." - } - } - } - } - }, - "dname": { - "type": "object", - "additionalProperties": false, - "description": "Certificate distinguish name", - "properties": { - "caCommonName": { - "type": "string", - "description": "Common name of certificate authority generated by Zowe." - }, - "commonName": { - "type": "string", - "description": "Common name of certificate generated by Zowe." - }, - "orgUnit": { - "type": "string", - "description": "Organization unit of certificate generated by Zowe." - }, - "org": { - "type": "string", - "description": "Organization of certificate generated by Zowe." - }, - "locality": { - "type": "string", - "description": "Locality of certificate generated by Zowe. This is usually the city name." - }, - "state": { - "type": "string", - "description": "State of certificate generated by Zowe. You can also put province name here." - }, - "country": { - "type": "string", - "description": "2 letters country code of certificate generated by Zowe." - } - } - }, - "validity": { - "type": "integer", - "description": "Validity days for Zowe generated certificates", - "default": 3650 - }, - "san": { - "type": "array", - "description": "Domain names and IPs should be added into certificate SAN. If this field is not defined, `zwe init` command will use `zowe.externalDomains`.", - "items": { - "type": "string" - } - }, - "importCertificateAuthorities": { - "type": "array", - "description": "PEM format certificate authorities will also be imported and trusted. If you have other certificate authorities want to be trusted in Zowe keyring, list the certificate labels here. **NOTE**, due to the limitation of RACDCERT command, this field should contain maximum 2 entries.", - "items": { - "type": "string" - } - } - } - }, - "vsam": { - "type": "object", - "additionalProperties": false, - "description": "VSAM configurations if you are using VSAM as Caching Service storage", - "properties": { - "mode": { - "type": "string", - "description": "VSAM data set with Record-Level-Sharing enabled or not", - "enum": ["NONRLS", "RLS"], - "default": "NONRLS" - }, - "volume": { - "type": "string", - "description": "Volume name if you are using VSAM in NONRLS mode" - }, - "storageClass": { - "type": "string", - "description": "Storage class name if you are using VSAM in RLS mode" - } - } - } - } - }, - "runtimeDirectory": { - "$ref": "#/$defs/zowePath", - "description": "Path to where you installed Zowe." - }, - "logDirectory": { - "$ref": "#/$defs/zowePath", - "description": "Path to where you want to store Zowe log files." - }, - "workspaceDirectory": { - "$ref": "#/$defs/zowePath", - "description": "Path to where you want to store Zowe workspace files. Zowe workspace are used by Zowe component runtime to store temporary files." - }, - "extensionDirectory": { - "$ref": "#/$defs/zowePath", - "description": "Path to where you want to store Zowe extensions. \"zwe components install\" will install new extensions into this directory." - }, - "job": { - "type": "object", - "additionalProperties": false, - "description": "Customize your Zowe z/OS JES job.", - "properties": { - "name": { - "type": "string", - "description": "Job name of Zowe primary ZWESLSTC started task." - }, - "prefix": { - "type": "string", - "description": "A short prefix to customize address spaces created by Zowe job." - } - } - }, - "network": { - "$ref": "#/$defs/networkSettings" - }, - "extensionRegistry": { - "type": "object", - "description": "Defines optional configuration for downloading extensions from an online or offline registry", - "required": ["defaultHandler", "handlers"], - "properties": { - "defaultHandler": { - "type": "string", - "description": "The name of a handler specified in the handlers section. Will be used as the default for 'zwe components' commands" - }, - "handlers": { - "type": "object", - "patternProperties": { - "^.*$": { - "$ref": "#/$defs/registryHandler" - } - } - } - } - }, - "launcher": { - "type": "object", - "description": "Set default behaviors of how the Zowe launcher will handle components", - "additionalProperties": false, - "properties": { - "restartIntervals": { - "type": "array", - "description": "Intervals of seconds to wait before restarting a component if it fails before the minUptime value.", - "items": { - "type": "integer" - } - }, - "minUptime": { - "type": "integer", - "default": 90, - "description": "The minimum amount of seconds before a component is considered running and the restart counter is reset." - }, - "shareAs": { - "type": "string", - "description": "Determines which SHAREAS mode should be used when starting a component", - "enum": ["no", "yes", "must", ""], - "default": "yes" - }, - "unsafeDisableZosVersionCheck": { - "type": "boolean", - "description": "Used to allow Zowe to warn, instead of error, when running on a version of z/OS that this version of Zowe hasn't been verified as working with", - "default": false - } - } - }, - "rbacProfileIdentifier": { - "type": "string", - "description": "An ID used for determining resource names used in RBAC authorization checks" - }, - "cookieIdentifier": { - "type": "string", - "description": "An ID that can be used by servers that distinguish their cookies from unrelated Zowe installs" - }, - "externalDomains": { - "type": "array", - "description": "List of domain names of how you access Zowe from your local computer.", - "minItems": 1, - "uniqueItems": true, - "items": { - "type": ["string"] - } - }, - "externalPort": { - "$ref": "#/$defs/port", - "description": "Port number of how you access Zowe APIML Gateway from your local computer." - }, - "environments": { - "type": "object", - "description": "Global environment variables can be applied to all Zowe high availability instances." - }, - "launchScript": { - "type": "object", - "description": "Customize Zowe launch scripts (zwe commands) behavior.", - "properties": { - "logLevel": { - "type": "string", - "description": "Log level for Zowe launch scripts.", - "enum": ["", "info", "debug", "trace"] - }, - "onComponentConfigureFail": { - "type": "string", - "description": "Chooses how 'zwe start' behaves if a component configure script fails", - "enum": ["warn", "exit"], - "default": "warn" - } - } - }, - "certificate": { - "$ref": "#/$defs/certificate", - "description": "Zowe certificate setup." - }, - "verifyCertificates": { - "type": "string", - "description": "Customize how Zowe should validate certificates used by components or other services.", - "enum": ["STRICT", "NONSTRICT", "DISABLED"] - }, - "sysMessages": { - "type": "array", - "description": "List of Zowe message portions when matched will be additionally logged into the system's log (such as syslog on z/OS). Note: Some messages extremely early in the Zowe lifecycle may not be added to the system's log", - "uniqueItems": true, - "items": { - "type": "string" - } - }, - "useConfigmgr": { - "type": "boolean", - "default": false, - "description": "Determines whether or not to use the features of configmgr such as multi-config, parmlib config, config templates, and schema validation. This effects the zwe command." - }, - "configmgr": { - "type": "object", - "description": "Controls how configmgr will be used by zwe", - "required": ["validation"], - "properties": { - "validation": { - "type": "string", - "enum": ["STRICT", "COMPONENT-COMPAT"], - "description": "States how configmgr will do validation: Will it quit on any error (STRICT) or quit on any error except the case of a component not having a schema file (COMPONENT-COMPAT)" - } - } - } - } - }, - "java": { - "type": "object", - "properties": { - "home": { - "$ref": "#/$defs/zowePath", - "description": "Path to Java home directory." - } - } - }, - "node": { - "type": "object", - "properties": { - "home": { - "$ref": "#/$defs/zowePath", - "description": "Path to node.js home directory." - } - } - }, - "zOSMF": { - "type": "object", - "additionalProperties": false, - "properties": { - "host": { - "type": "string", - "description": "Host or domain name of your z/OSMF instance." - }, - "port": { - "$ref": "#/$defs/port", - "description": "Port number of your z/OSMF instance." - }, - "scheme": { - "$ref" : "#/$defs/scheme", - "description": "Scheme used to connect to z/OSMF instance. Optional for outbout AT-TLS, defaults to https" - }, - "applId": { - "type": "string", - "description": "Appl ID of your z/OSMF instance." - } - } - }, - "components": { - "type": "object", - "patternProperties": { - "^.*$": { - "$ref": "#/$defs/component" - } - } - }, - "haInstances": { - "type": "object", - "patternProperties": { - "^.*$": { - "type": "object", - "description": "Configuration of Zowe high availability instance.", - "required": ["hostname", "sysname"], - "properties": { - "hostname": { - "type": "string", - "description": "Host name of the Zowe high availability instance. This is hostname for internal communications." - }, - "sysname": { - "type": "string", - "description": "z/OS system name of the Zowe high availability instance. Some JES command will be routed to this system name." - }, - "components": { - "type": "object", - "patternProperties": { - "^.*$": { - "$ref": "#/$defs/component" - } - } - } - } - } - } - } - }, - "$defs": { - "port": { - "type": "integer", - "minimum": 0, - "maximum": 65535 - }, - "scheme": { - "type": "string", - "enum": [ - "http", - "https" - ], - "default": "https" - }, - "certificate": { - "oneOf": [ - { "$ref": "#/$defs/pkcs12-certificate" }, - { "$ref": "#/$defs/keyring-certificate" } - ] - }, - "pkcs12-certificate": { - "type": "object", - "additionalProperties": false, - "required": ["keystore", "truststore", "pem"], - "properties": { - "keystore": { - "type": "object", - "additionalProperties": false, - "description": "Certificate keystore.", - "required": ["type", "file", "alias"], - "properties": { - "type": { - "type": "string", - "description": "Keystore type.", - "const": "PKCS12" - }, - "file": { - "$ref": "#/$defs/zowePath", - "description": "Path to your PKCS#12 keystore." - }, - "password": { - "type": "string", - "description": "Password of your PKCS#12 keystore." - }, - "alias": { - "type": "string", - "description": "Certificate alias name of defined in your PKCS#12 keystore" - } - } - }, - "truststore": { - "type": "object", - "additionalProperties": false, - "description": "Certificate truststore.", - "required": ["type", "file"], - "properties": { - "type": { - "type": "string", - "description": "Truststore type.", - "const": "PKCS12" - }, - "file": { - "$ref": "#/$defs/zowePath", - "description": "Path to your PKCS#12 keystore." - }, - "password": { - "type": "string", - "description": "Password of your PKCS#12 keystore." - } - } - }, - "pem": { - "type": "object", - "additionalProperties": false, - "description": "Certificate in PEM format.", - "required": ["key", "certificate"], - "properties": { - "key": { - "$ref": "#/$defs/zowePath", - "description": "Path to the certificate private key stored in PEM format." - }, - "certificate": { - "$ref": "#/$defs/zowePath", - "description": "Path to the certificate stored in PEM format." - }, - "certificateAuthorities": { - "description": "List of paths to the certificate authorities stored in PEM format.", - "oneOf": [{ - "$ref": "#/$defs/zowePath", - "description": "Paths to the certificate authorities stored in PEM format. You can separate multiple certificate authorities by comma." - }, - { - "type": "array", - "description": "Path to the certificate authority stored in PEM format.", - "items": { - "$ref": "#/$defs/zowePath" - } - } - ] - } - } - } - } - }, - "keyring-certificate": { - "type": "object", - "additionalProperties": false, - "required": ["keystore", "truststore"], - "properties": { - "keystore": { - "type": "object", - "additionalProperties": false, - "description": "Certificate keystore.", - "required": ["type", "file", "alias"], - "properties": { - "type": { - "type": "string", - "description": "Keystore type.", - "enum": ["JCEKS", "JCECCAKS", "JCERACFKS", "JCECCARACFKS", "JCEHYBRIDRACFKS"] - }, - "file": { - "type": "string", - "description": "Path of your z/OS keyring, including ring owner and ring name. Case sensitivity and spaces matter.", - "pattern": "^safkeyring:\/\/.*" - }, - "password": { - "type": "string", - "description": "Literally 'password' may be needed when using keyrings for compatibility with java servers.", - "enum": ["", "password"] - }, - "alias": { - "type": "string", - "description": "Certificate label of z/OS keyring. Case sensitivity and spaces matter." - } - } - }, - "truststore": { - "type": "object", - "additionalProperties": false, - "description": "Certificate truststore.", - "required": ["type", "file"], - "properties": { - "type": { - "type": "string", - "description": "Truststore type.", - "enum": ["JCEKS", "JCECCAKS", "JCERACFKS", "JCECCARACFKS", "JCEHYBRIDRACFKS"] - }, - "file": { - "type": "string", - "description": "Path of your z/OS keyring, including ring owner and ring name. Case sensitivity and spaces matter.", - "pattern": "^safkeyring:\/\/.*" - }, - "password": { - "type": "string", - "description": "Literally 'password' may be needed when using keyrings for compatibility with java servers.", - "enum": ["", "password"] - } - } - }, - "pem": { - "type": "object", - "additionalProperties": false, - "description": "Certificate in PEM format.", - "properties": { - "key": { - "type": "string", - "description": "Path to the certificate private key stored in PEM format." - }, - "certificate": { - "type": "string", - "description": "Path to the certificate stored in PEM format." - }, - "certificateAuthorities": { - "description": "List of paths to the certificate authorities stored in PEM format.", - "oneOf": [{ - "type": "string", - "description": "Paths to the certificate authorities stored in PEM format. You can separate multiple certificate authorities by comma." - }, - { - "type": "array", - "description": "Path to the certificate authority stored in PEM format.", - "items": { - "type": "string" - } - } - ] - } - } - } - } - }, - "component": { - "$anchor": "zoweComponent", - "type": "object", - "properties": { - "enabled": { - "type": "boolean", - "description": "Whether to enable or disable this component", - "default": false - }, - "certificate": { - "$ref": "#/$defs/certificate", - "description": "Certificate for current component." - }, - "launcher": { - "type": "object", - "description": "Set behavior of how the Zowe launcher will handle this particular component", - "additionalProperties": true, - "properties": { - "restartIntervals": { - "type": "array", - "description": "Intervals of seconds to wait before restarting a component if it fails before the minUptime value.", - "items": { - "type": "integer" - } - }, - "minUptime": { - "type": "integer", - "default": 90, - "description": "The minimum amount of seconds before a component is considered running and the restart counter is reset." - }, - "shareAs": { - "type": "string", - "description": "Determines which SHAREAS mode should be used when starting a component", - "enum": ["no", "yes", "must", ""], - "default": "yes" - } - } - }, - "zowe": { - "type": "object", - "description": "Component level overrides for top level Zowe network configuration.", - "additionalProperties": true, - "properties": { - "network": { - "$ref": "#/$defs/networkSettings" - }, - "job": { - "$ref": "#/$defs/componentJobSettings" - } - } - } - } - }, - "componentJobSettings": { - "$anchor": "componentJobSettings", - "type": "object", - "description": "Component level overrides for job execution behavior", - "properties": { - "suffix": { - "type": "string", - "description": "Can be used by components to declare a jobname suffix to append to their job. This is not currently used by Zowe itself, it is up to components to use this value if desired. Zowe may use this value in the future." - } - } - }, - "tlsSettings": { - "$anchor": "tlsSettings", - "type": "object", - "properties": { - "ciphers": { - "type": "array", - "description": "Acceptable TLS cipher suites for network connections, in IANA format.", - "items": { - "type": "string" - } - }, - "curves": { - "type": "array", - "description": "Acceptable key exchange elliptic curves for network connections.", - "items": { - "type": "string" - } - }, - "maxTls": { - "type": "string", - "enum": ["TLSv1.2", "TLSv1.3"], - "default": "TLSv1.3", - "description": "Maximum TLS version allowed for network connections." - }, - "minTls": { - "type": "string", - "enum": ["TLSv1.2", "TLSv1.3"], - "default": "TLSv1.2", - "description": "Minimum TLS version allowed for network connections, and less than or equal to network.maxTls." - } - } - }, - "networkSettings": { - "type": "object", - "$anchor": "networkSettings", - "additionalProperties": false, - "description": "Optional, advanced network configuration parameters", - "properties": { - "server": { - "type": "object", - "additionalProperties": false, - "description": "Optional, advanced network configuration parameters for Zowe servers", - "properties": { - "tls": { - "$ref": "#/$defs/tlsSettings" - }, - "listenAddresses": { - "type": "array", - "description": "The IP addresses which all of the Zowe servers will be binding on and listening to. Some servers may only support listening on the first element.", - "items": { - "type": "string", - "pattern": "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$" - } - }, - "vipaIp": { - "type": "string", - "description": "The IP address which all of the Zowe servers will be binding to. If you are using multiple DIPVA addresses, do not use this option." - }, - "validatePortFree": { - "type": "boolean", - "default": true, - "description": "Whether or not to ensure that the port a server is about to use is available. Usually, servers will know this when they attempt to bind to a port, so this option allows you to disable the additional verification step." - } - } - }, - "client": { - "type": "object", - "additionalProperties": false, - "description": "Optional, advanced network configuration parameters for Zowe servers when sending requests as clients.", - "properties": { - "tls": { - "$ref": "#/$defs/tlsSettings" - } - } - } - } - }, - "registryHandler": { - "$anchor": "registryHandler", - "type": "object", - "required": ["registry", "path"], - "properties": { - "registry": { - "type": "string", - "description": "The location of the default registry for this handler. It could be a URL, path, dataset, whatever this handler supports" - }, - "path": { - "$ref": "#/$defs/zowePath", - "description": "Unix file path to the configmgr-compatible JS file which implements the handler API" - } - } - }, - "zowePath": { - "$anchor": "zowePath", - "type": "string", - "pattern": "^([^\\0]){1,1024}$", - "minLength": 1, - "maxLength": 1024 - }, - } -} - - - const Planning = () => { const [stageLabel] = useState('Planning'); diff --git a/src/renderer/components/stages/ReviewInstallation.tsx b/src/renderer/components/stages/ReviewInstallation.tsx index 5c0828fb..e28cf7a1 100644 --- a/src/renderer/components/stages/ReviewInstallation.tsx +++ b/src/renderer/components/stages/ReviewInstallation.tsx @@ -24,6 +24,7 @@ import { selectConnectionStatus, selectPlanningStatus, selectInstallationTypeSta import { setActiveStep } from './progress/activeStepSlice'; import { setNextStepEnabled } from '../configuration-wizard/wizardSlice'; import { getStageDetails, getSubStageDetails } from "../../../utils/StageDetails"; +import { getCompleteProgress } from "./progress/StageProgressStatus"; import '../../styles/ReviewInstallation.css'; @@ -43,20 +44,22 @@ const ReviewInstallation = () => { const theme = createTheme(); + const completeProgress = getCompleteProgress(); + const stageProgressStatus = [ useSelector(selectConnectionStatus), - useSelector(selectPlanningStatus), - useSelector(selectInstallationTypeStatus), - useSelector(selectInitializationStatus), + completeProgress.planningStatus, + completeProgress.installationTypeStatus, + completeProgress.initializationStatus, ]; const subStageProgressStatus = [ - useSelector(selectDatasetInstallationStatus), - useSelector(selectNetworkingStatus), - useSelector(selectApfAuthStatus), - useSelector(selectSecurityStatus), - useSelector(selectCertificateStatus), - useSelector(selectLaunchConfigStatus), + completeProgress.datasetInstallationStatus, + completeProgress.networkingStatus, + completeProgress.apfAuthStatus, + completeProgress.securityStatus, + completeProgress.certificateStatus, + completeProgress.launchConfigStatus ]; const TYPE_YAML = "yaml"; diff --git a/src/renderer/components/stages/Security.tsx b/src/renderer/components/stages/Security.tsx index 1ea8f290..b4f6e847 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 "../../../utils/StageDetails"; -import { setProgress, getProgress, setSecurityInitState, getSecurityInitState } from "./progress/StageProgressStatus"; +import { setProgress, getProgress, setSecurityInitState, getSecurityInitState, mapAndSetSkipStatus, getInstallationArguments } from "./progress/StageProgressStatus"; import { InitSubStepsState } from "../../../types/stateInterfaces"; const Security = () => { @@ -58,7 +58,7 @@ const Security = () => { const [initClicked, setInitClicked] = useState(false); const [reinit, setReinit] = useState(false); - const installationArgs = useAppSelector(selectInstallationArgs); + const installationArgs = getInstallationArguments(); const connectionArgs = useAppSelector(selectConnectionArgs); let timer: any; @@ -82,11 +82,9 @@ const Security = () => { let nextPosition; if(getProgress('securityStatus')) { - console.log('security: start-security-progress'); nextPosition = document.getElementById('security-progress'); nextPosition?.scrollIntoView({ behavior: 'smooth', block: 'end' }); } else { - console.log('security: container-box-id'); nextPosition = document.getElementById('container-box-id'); nextPosition?.scrollIntoView({behavior: 'smooth'}); } @@ -149,10 +147,15 @@ 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); + } + const updateProgress = (status: boolean) => { setStateUpdated(!stateUpdated); - stages[STAGE_ID].subStages[SUB_STAGE_ID].isSkipped = !status; - stages[STAGE_ID].isSkipped = !status; + setStageSkipStatus(!status); if(!status) { for (let key in securityInitProgress) { securityInitProgress[key as keyof(InitSubStepsState)] = false; diff --git a/src/renderer/components/stages/connection/Connection.tsx b/src/renderer/components/stages/connection/Connection.tsx index 9e7aadf7..1763e5b2 100644 --- a/src/renderer/components/stages/connection/Connection.tsx +++ b/src/renderer/components/stages/connection/Connection.tsx @@ -30,15 +30,16 @@ import ContainerCard from '../../common/ContainerCard'; import { useAppSelector, useAppDispatch } from '../../../hooks'; import { IResponse } from '../../../../types/interfaces'; import { setConnectionArgs, setConnectionValidationDetails, setHost, setPort, - setUser, setPassword, setSecure, setSecureOptions, selectConnectionArgs, setAcceptCertificates, selectConnectionSecure, selectConnectionValidationDetails, selectAcceptCertificates} from './connectionSlice'; -import { setLoading, setNextStepEnabled, selectZoweCLIVersion } from '../../configuration-wizard/wizardSlice'; + setUser, setPassword, setSecure, setSecureOptions, selectConnectionArgs, setAcceptCertificates, selectConnectionSecure, selectConnectionValidationDetails, selectAcceptCertificates, selectResumeProgress} from './connectionSlice'; +import { setYaml, setSchema, setLoading, setNextStepEnabled, selectZoweCLIVersion } from '../../configuration-wizard/wizardSlice'; import { setConnectionStatus, selectConnectionStatus} from '../progress/progressSlice'; -import { setActiveStep } from '../progress/activeStepSlice'; -import { selectActiveStepIndex, selectIsSubstep, selectActiveSubStepIndex} from '../progress/activeStepSlice'; import { Container } from "@mui/material"; import { alertEmitter } from "../../Header"; -import { getStageDetails } from "../../../../utils/StageDetails"; -import { initializeProgress } from "../progress/StageProgressStatus"; +import { getStageDetails, initStageSkipStatus } from "../../../../utils/StageDetails"; +import { initializeProgress, getActiveStage } from "../progress/StageProgressStatus"; +import eventDispatcher from "../../../../utils/eventDispatcher"; +import { setZoweVersion, setInstallationArgs, selectInstallationArgs, selectZoweVersion } from '../installation/installationSlice'; +import { EXAMPLE_YAML, YAML_SCHEMA } from "../../../config/constants"; const Connection = () => { @@ -59,9 +60,6 @@ const Connection = () => { useEffect(() => { connectionStatus ? dispatch(setNextStepEnabled(true)) : dispatch(setNextStepEnabled(false)); - return () => { - dispatch(setActiveStep({ activeStepIndex: STAGE_ID, isSubStep: SUB_STAGES, activeSubStepIndex: 0 })); - } }, []); return ( @@ -125,15 +123,7 @@ const FTPConnectionForm = () => { const [formProcessed, toggleFormProcessed] = React.useState(false); const [validationDetails, setValidationDetails] = React.useState(''); - const activeStepIndex = useAppSelector(selectActiveStepIndex); - const isSubStep = useAppSelector(selectIsSubstep); - const activeSubStepIndex = useAppSelector(selectActiveSubStepIndex); - - useEffect(() => { - return () => { - dispatch(setActiveStep({ activeStepIndex: STAGE_ID, isSubStep: SUB_STAGES, activeSubStepIndex: 0 })); - } - }, []) + const [isResume, setIsResume] = useState(useAppSelector(selectResumeProgress)); const handleFormChange = (ftpConnection?:boolean, acceptCerts?:boolean) => { dispatch(setConnectionStatus(false)); @@ -154,6 +144,8 @@ const FTPConnectionForm = () => { if(res.status) { dispatch(setNextStepEnabled(true)); initializeProgress(connectionArgs.host, connectionArgs.user); + initStageSkipStatus(); + setYamlAndConfig(); } toggleFormProcessed(true); setValidationDetails(res.details); @@ -162,6 +154,31 @@ const FTPConnectionForm = () => { }); }; + const setYamlAndConfig = () => { + window.electron.ipcRenderer.getConfig().then((res: IResponse) => { + if (res && res.status && res.details) { + dispatch(setYaml(res.details.config)); + const schema = res.details.schema; + dispatch(setSchema(schema)); + } else { + dispatch(setYaml(EXAMPLE_YAML)); + dispatch(setSchema(YAML_SCHEMA)); + window.electron.ipcRenderer.setConfig(EXAMPLE_YAML).then((res: IResponse) => { + // yaml response + }); + window.electron.ipcRenderer.setSchema(YAML_SCHEMA).then((res: IResponse) => { + // schema response + }); + } + const { activeStepIndex, isSubStep, activeSubStepIndex } = getActiveStage(); + + if(isResume) { + eventDispatcher.emit('updateActiveStep', activeStepIndex, isSubStep, activeSubStepIndex); + setIsResume(false); + } + }) + } + return ( {e.preventDefault(); processForm();}} @@ -300,11 +317,13 @@ const FTPConnectionForm = () => { } +
{connectionStatus && }
diff --git a/src/renderer/components/stages/connection/connectionSlice.ts b/src/renderer/components/stages/connection/connectionSlice.ts index fb0f88bd..fbb4a1f8 100644 --- a/src/renderer/components/stages/connection/connectionSlice.ts +++ b/src/renderer/components/stages/connection/connectionSlice.ts @@ -16,6 +16,7 @@ export interface ConnectionState { connectionArgs: IIpcConnectionArgs; connectionValidationDetails: string; acceptCertificates: boolean; + resumeProgress: boolean; } //TODO also seen in ConnectionStore. Necessary or duplication? @@ -40,6 +41,7 @@ const initialState: ConnectionState = { }, connectionValidationDetails: 'connectionValidationDetails', acceptCertificates: false, + resumeProgress: false }; export const connectionSlice = createSlice({ @@ -76,11 +78,14 @@ export const connectionSlice = createSlice({ setAcceptCertificates: (state, action: PayloadAction) => { state.acceptCertificates = action.payload; }, + setResumeProgress: (state, action: PayloadAction) => { + state.resumeProgress = action.payload; + } }, }); export const { setConnectionArgs, setHost, setPort, - setUser, setPassword, setJobStatementVal, setSecure, setSecureOptions, setConnectionValidationDetails, setAcceptCertificates, + setUser, setPassword, setJobStatementVal, setSecure, setSecureOptions, setConnectionValidationDetails, setAcceptCertificates, setResumeProgress, } = connectionSlice.actions; export const selectConnectionArgs = (state: RootState) => state.connection.connectionArgs; @@ -88,5 +93,6 @@ export const selectConnectionSecure= (state: RootState) => state.connection.conn export const selectConnectionValidationDetails = (state: RootState) => state.connection.connectionValidationDetails; export const selectAcceptCertificates = (state: RootState) => state.connection.acceptCertificates; export const selectInitJobStatement = (state: RootState) => state.connection.connectionArgs.jobStatement; +export const selectResumeProgress = (state: RootState) => state.connection.resumeProgress; export default connectionSlice.reducer; diff --git a/src/renderer/components/stages/installation/Installation.tsx b/src/renderer/components/stages/installation/Installation.tsx index 6df1312b..9c8a6d54 100644 --- a/src/renderer/components/stages/installation/Installation.tsx +++ b/src/renderer/components/stages/installation/Installation.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 "../../../../utils/StageDetails"; -import { setProgress, getProgress, setDatasetInstallationState, getDatasetInstallationState, getInstallationTypeStatus } from "../progress/StageProgressStatus"; +import { setProgress, getProgress, setDatasetInstallationState, getDatasetInstallationState, getInstallationTypeStatus, mapAndSetSkipStatus, getInstallationArguments } from "../progress/StageProgressStatus"; import { DatasetInstallationState } from "../../../../types/stateInterfaces"; const Installation = () => { @@ -60,7 +60,7 @@ const Installation = () => { const [stateUpdated, setStateUpdated] = useState(false); const [initClicked, setInitClicked] = useState(false); - const installationArgs = useAppSelector(selectInstallationArgs); + const installationArgs = getInstallationArguments(); const version = useAppSelector(selectZoweVersion); let timer: any; const installationType = getInstallationTypeStatus().installationType; @@ -160,6 +160,7 @@ const Installation = () => { const setStageSkipStatus = (status: boolean) => { stages[stageId].subStages[subStageId].isSkipped = status; stages[stageId].isSkipped = status; + mapAndSetSkipStatus(subStageId, status); } const setDsInstallStageStatus = (status: boolean) => { diff --git a/src/renderer/components/stages/installation/installationSlice.ts b/src/renderer/components/stages/installation/installationSlice.ts index ea2deb53..c8a7a280 100644 --- a/src/renderer/components/stages/installation/installationSlice.ts +++ b/src/renderer/components/stages/installation/installationSlice.ts @@ -10,28 +10,11 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit'; import { RootState } from '../../../store'; -import { setInstallationTypeStatus, getInstallationTypeStatus } from '../progress/StageProgressStatus'; +import { setInstallationTypeStatus, getInstallationTypeStatus, setInstallationArguments } from '../progress/StageProgressStatus'; +import { InstallationArgs } from '../../../../types/stateInterfaces'; interface InstallationState { - installationArgs: { - installationDir: string; - workspaceDir: string; - logDir: string, - extensionDir: string, - installationType?: string; - downloadDir: string; - userUploadedPaxPath?: string; - javaHome: string; - nodeHome: string; - setupConfig: any; - jobName: string; - jobPrefix: string; - rbacProfile: string; - cookieId: string; - zosmfHost: string, - zosmfPort: string, - zosmfApplId: string - }; + installationArgs: InstallationArgs; zoweVersion: string; licenseAgreement: boolean; } @@ -66,6 +49,7 @@ export const installationSlice = createSlice({ reducers: { setInstallationArgs: (state, action: PayloadAction) => { state.installationArgs = action.payload; + setInstallationArguments(action.payload); }, setZoweVersion: (state, action: PayloadAction) => { state.zoweVersion = action.payload; diff --git a/src/renderer/components/stages/progress/StageProgressStatus.ts b/src/renderer/components/stages/progress/StageProgressStatus.ts index 46e42c1b..66187e1f 100644 --- a/src/renderer/components/stages/progress/StageProgressStatus.ts +++ b/src/renderer/components/stages/progress/StageProgressStatus.ts @@ -9,7 +9,8 @@ */ import { flatten, unflatten } from 'flat'; -import { ProgressState, PlanningState, InstallationType, ActiveState, DatasetInstallationState, InitSubStepsState, CertInitSubStepsState, PlanningValidationDetails} from '../../../../types/stateInterfaces'; +import { ProgressState, PlanningState, InstallationType, ActiveState, DatasetInstallationState, InitSubStepsState, CertInitSubStepsState, PlanningValidationDetails, SkipState, InstallationArgs} from '../../../../types/stateInterfaces'; +import { stages } from '../../configuration-wizard/Wizard'; const installationTypeStatus: InstallationType = { installationType: 'download', @@ -77,6 +78,35 @@ const planningValidationDetailsStatus: PlanningValidationDetails = { error: '' } +const stepSkipStatus: SkipState = { + datasetInstallation: false, + networking: false, + apfAuth: false, + security: false, + certificate: false, + launchConfig: false +} + +const installationArgsStatus: InstallationArgs = { + installationDir: '', + workspaceDir: '', + logDir:'', + extensionDir:'', + installationType: 'download', + userUploadedPaxPath: '', + downloadDir: '', + javaHome: '', + nodeHome: '', + setupConfig: {}, + jobName: 'ZWE1SV', + jobPrefix: 'ZWE1', + rbacProfile: '1', + cookieId: '1', + zosmfHost: '', + zosmfPort: '443', + zosmfApplId: 'IZUDFLT' +} + let progressStateKey = 'stage_progress'; let activeStateKey = 'active_state'; let planningStateKey = 'planning_stage'; @@ -86,6 +116,11 @@ let apfAuthKey = 'apf_auth'; let securityKey = 'security_init'; let certificateKey = 'certificate_init'; let planningValidationDetailsKey = `planning_validation_details`; +let prevInstallationKey = `prev_installation`; +let skipStateKey = `skip_state`; +let installationArgsKey = `intallation_args`; + +let skipKeysArray: (keyof SkipState)[] = Object.keys(stepSkipStatus) as (keyof SkipState)[]; const setKeys = (id: string) => { progressStateKey = `${progressStateKey}_${id}`; @@ -97,6 +132,8 @@ const setKeys = (id: string) => { securityKey = `${securityKey}_${id}`; certificateKey = `${certificateKey}_${id}`; planningValidationDetailsKey = `${planningValidationDetailsKey}_${id}`; + skipStateKey = `${skipStateKey}_${id}`; + installationArgsKey = `${installationArgsKey}_${id}`; } export const initializeProgress = (host: string, user: string) => { @@ -156,6 +193,58 @@ export const initializeProgress = (host: string, user: string) => { const flattenedData = flatten(planningValidationDetailsStatus); localStorage.setItem(planningValidationDetailsKey, JSON.stringify(flattenedData)); } + + const stepSkipStatusState = localStorage.getItem(skipStateKey); + if(!stepSkipStatusState) { + const flattenedData = flatten(stepSkipStatus); + localStorage.setItem(skipStateKey, JSON.stringify(flattenedData)); + } + + const installationArgsState = localStorage.getItem(installationArgsKey); + if(!installationArgsState) { + const flattenedData = flatten(installationArgsStatus); + localStorage.setItem(installationArgsKey, JSON.stringify(flattenedData)); + } +} + +export const mapAndSetSkipStatus = (subStageId: number, value: boolean): void => { + setSubStageSkipStatus(skipKeysArray[subStageId], value); +} + +export const mapAndGetSkipStatus = (subStageId: number): boolean => { + const skipStatus = getSubStageSkipStatus(); + const skipStatusArray = [ + skipStatus.datasetInstallation, + skipStatus.networking, + skipStatus.apfAuth, + skipStatus.security, + skipStatus.certificate, + skipStatus.launchConfig + ] + + return skipStatusArray[subStageId]; +} + +export const setSubStageSkipStatus = (key: keyof SkipState, newValue: boolean): void => { + const skipStatus = localStorage.getItem(skipStateKey); + if (skipStatus) { + const flattenedData = JSON.parse(skipStatus); + const unFlattenedData = unflatten(flattenedData) as SkipState; + Object.assign(stepSkipStatus, unFlattenedData); + } + stepSkipStatus[key] = newValue; + const flattenedData = flatten(stepSkipStatus); + localStorage.setItem(skipStateKey, JSON.stringify(flattenedData)); +} + +export const getSubStageSkipStatus = () : SkipState => { + const skipStatus = localStorage.getItem(skipStateKey); + if(skipStatus) { + const flattenedData = JSON.parse(skipStatus); + return unflatten(flattenedData); + } else { + return stepSkipStatus; + } } export const setPlanningValidationDetailsState = (planningValidationsDetails: PlanningValidationDetails): void => { @@ -277,6 +366,22 @@ export const getPlanningStageStatus = (): PlanningState => { } } +export const setInstallationArguments = (newInstallationArgs: InstallationArgs): void => { + Object.assign(installationArgsStatus, newInstallationArgs); + const flattenedData = flatten(installationArgsStatus); + localStorage.setItem(installationArgsKey, JSON.stringify(flattenedData)); +} + +export const getInstallationArguments = () : InstallationArgs => { + const installArgs = localStorage.getItem(installationArgsKey); + if(installArgs) { + const flattenedData = JSON.parse(installArgs); + return unflatten(flattenedData); + } else { + return installationArgsStatus; + } +} + export const setProgress = (key: keyof ProgressState, newValue: boolean): void => { const progress = localStorage.getItem(progressStateKey); if (progress) { @@ -313,7 +418,7 @@ export const getCompleteProgress = () : ProgressState => { export const setActiveStage = (stageId: number, isSubStage: boolean, date: string, subStageId?: number): void => { activeStatus.activeStepIndex = stageId; activeStatus.isSubStep = isSubStage; - activeStatus.date = date; + activeStatus.lastActiveDate = date; if(!isSubStage) { activeStatus.activeSubStepIndex = 0; @@ -323,6 +428,7 @@ export const setActiveStage = (stageId: number, isSubStage: boolean, date: strin const flattenedData = flatten(activeStatus); localStorage.setItem(activeStateKey, JSON.stringify(flattenedData)); + localStorage.setItem(prevInstallationKey, JSON.stringify(flattenedData)); } export const getActiveStage = () : ActiveState => { @@ -335,4 +441,14 @@ export const getActiveStage = () : ActiveState => { } } +export const getPreviousInstallation = () : ActiveState => { + const activeStage = localStorage.getItem(prevInstallationKey); + if(activeStage) { + const flattenedData = JSON.parse(activeStage); + return unflatten(flattenedData); + } else { + return activeStatus; + } +} + diff --git a/src/renderer/components/stages/progress/activeStepSlice.ts b/src/renderer/components/stages/progress/activeStepSlice.ts index 9bbf7a2f..ca13fa15 100644 --- a/src/renderer/components/stages/progress/activeStepSlice.ts +++ b/src/renderer/components/stages/progress/activeStepSlice.ts @@ -33,8 +33,8 @@ export const activeStepSlice = createSlice({ state.activeStepIndex = action.payload.activeStepIndex; state.isSubStep = action.payload.isSubStep; state.activeSubStepIndex = action.payload.activeSubStepIndex; - state.date = getCurrentDate(); - setActiveStage(action.payload.activeStepIndex, action.payload.isSubStep, state.date, action.payload.activeSubStepIndex); + state.lastActiveDate = getCurrentDate(); + setActiveStage(action.payload.activeStepIndex, action.payload.isSubStep, state.lastActiveDate, action.payload.activeSubStepIndex); }, } }); @@ -44,7 +44,7 @@ export const { setActiveStep } = activeStepSlice.actions; export const selectActiveStepIndex = (state: RootState) => state.activeStep.activeStepIndex; export const selectIsSubstep = (state: RootState) => state.activeStep.isSubStep; export const selectActiveSubStepIndex = (state: RootState) => state.activeStep.activeSubStepIndex; -export const selectActiveStepDate = (state: RootState) => state.activeStep.date; +export const selectActiveStepDate = (state: RootState) => state.activeStep.lastActiveDate; export default activeStepSlice.reducer; diff --git a/src/renderer/config/constants.ts b/src/renderer/config/constants.ts new file mode 100644 index 00000000..e915203b --- /dev/null +++ b/src/renderer/config/constants.ts @@ -0,0 +1,1193 @@ +export const EXAMPLE_YAML = { + "node": { + "home": "" + }, + "java": { + "home": "" + }, + "zOSMF": { + "host": "dvipa.my-company.com", + "port": 443, + "applId": "IZUDFLT" + }, + "zowe": { + "rbacProfileIdentifier": "1", + "logDirectory": "/global/zowe/logs", + "job": { + "prefix": "ZWE1", + "name": "ZWE1SV" + }, + "sysMessages": [ + "ZWEL0021I", + "ZWEL0018I", + "ZWEL0006I", + "ZWES1601I", + "ZWEL0008I", + "ZWEL0022I", + "ZWEL0001I", + "ZWEL0002I", + "ZWEAM000I", + "ZWED0031I", + "ZWES1013I" + ], + "launchScript": { + "logLevel": "info", + "onComponentConfigureFail": "warn" + }, + "extensionDirectory": "/global/zowe/extensions", + "certificate": { + "keystore": { + "alias": "localhost", + "password": "password", + "type": "PKCS12", + "file": "/global/zowe/keystore/localhost/localhost.keystore.p12" + }, + "pem": { + "key": "/global/zowe/keystore/localhost/localhost.key", + "certificate": "/global/zowe/keystore/localhost/localhost.cer", + "certificateAuthorities": "/global/zowe/keystore/local_ca/local_ca.cer" + }, + "truststore": { + "password": "password", + "type": "PKCS12", + "file": "/global/zowe/keystore/localhost/localhost.truststore.p12" + } + }, + "cookieIdentifier": "1", + "verifyCertificates": "STRICT", + "setup": { + "dataset": { + "authLoadlib": "IBMUSER.ZWEV2.SZWEAUTH", + "proclib": "USER.PROCLIB", + "authPluginLib": "IBMUSER.ZWEV2.CUST.ZWESAPL", + "prefix": "IBMUSER.ZWEV2", + "parmlib": "IBMUSER.ZWEV2.CUST.PARMLIB", + "loadlib": "IBMUSER.ZWEV2.SZWELOAD", + "parmlibMembers": { + "zis": "ZWESIP00" + }, + "jcllib": "IBMUSER.ZWEV2.CUST.JCLLIB" + }, + "certificate": { + "type": "PKCS12", + "pkcs12": { + "directory": "/var/zowe/keystore" + } + }, + "vsam": { + "volume": "", + "mode": "NONRLS", + "storageClass": "" + } + }, + "externalDomains": [ + "sample-domain.com" + ], + "externalPort": 7554, + "configmgr": { + "validation": "COMPONENT-COMPAT" + }, + "workspaceDirectory": "/global/zowe/workspace", + "runtimeDirectory": "", + "useConfigmgr": true + }, + "components": { + "metrics-service": { + "debug": false, + "enabled": false, + "port": 7551 + }, + "zss": { + "tls": true, + "enabled": true, + "crossMemoryServerName": "ZWESIS_STD", + "port": 7557, + "agent": { + "jwt": { + "fallback": true + } + } + }, + "explorer-uss": { + "enabled": true + }, + "jobs-api": { + "debug": false, + "enabled": false, + "port": 7558 + }, + "files-api": { + "debug": false, + "enabled": false, + "port": 7559 + }, + "explorer-mvs": { + "enabled": true + }, + "cloud-gateway": { + "debug": false, + "enabled": false, + "port": 7563 + }, + "explorer-jes": { + "enabled": true + }, + "api-catalog": { + "debug": false, + "enabled": true, + "port": 7552 + }, + "gateway": { + "debug": false, + "enabled": true, + "port": 7554, + "apiml": { + "security": { + "x509": { + "enabled": false + }, + "auth": { + "zosmf": { + "jwtAutoconfiguration": "auto", + "serviceId": "zosmf" + }, + "provider": "zosmf" + }, + "authorization": { + "endpoint": { + "enabled": false + }, + "provider": "" + } + } + }, + "server": { + "internal": { + "ssl": { + "enabled": false + }, + "enabled": false, + "port": 7550 + } + } + }, + "app-server": { + "debug": false, + "enabled": true, + "port": 7556 + }, + "caching-service": { + "debug": false, + "enabled": true, + "storage": { + "evictionStrategy": "reject", + "size": 10000, + "infinispan": { + "jgroups": { + "port": 7600 + } + }, + "mode": "VSAM", + "vsam": { + "name": "" + } + }, + "port": 7555 + }, + "discovery": { + "debug": false, + "enabled": true, + "port": 7553 + } + } + } + + export const YAML_SCHEMA: any = { + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://zowe.org/schemas/v2/server-base", + "title": "Zowe configuration file", + "description": "Configuration file for Zowe (zowe.org) version 2.", + "type": "object", + "additionalProperties": false, + "properties": { + "zowe": { + "type": "object", + "additionalProperties": false, + "properties": { + "setup": { + "type": "object", + "additionalProperties": false, + "description": "Zowe setup configurations used by \"zwe install\" and \"zwe init\" commands.", + "properties": { + "dataset": { + "type": "object", + "additionalProperties": false, + "description": "MVS data set related configurations", + "properties": { + "prefix": { + "type": "string", + "description": "Where Zowe MVS data sets will be installed" + }, + "proclib": { + "type": "string", + "description": "PROCLIB where Zowe STCs will be copied over" + }, + "parmlib": { + "type": "string", + "description": "Zowe PARMLIB" + }, + "parmlibMembers": { + "type": "object", + "additionalProperties": false, + "description": "Holds Zowe PARMLIB members for plugins", + "properties": { + "zis": { + "description": "PARMLIB member used by ZIS", + "type": "string", + "pattern": "^([A-Z$#@]){1}([A-Z0-9$#@]){0,7}$", + "minLength": 1, + "maxLength": 8 + } + } + }, + "jcllib": { + "type": "string", + "description": "JCL library where Zowe will store temporary JCLs during initialization" + }, + "loadlib": { + "type": "string", + "description": "States the dataset where Zowe executable utilities are located", + "default": ".SZWELOAD" + }, + "authLoadlib": { + "type": "string", + "description": "The dataset that contains any Zowe core code that needs to run APF-authorized, such as ZIS", + "default": ".SZWEAUTH" + }, + "authPluginLib": { + "type": "string", + "description": "APF authorized LOADLIB for Zowe ZIS Plugins" + } + } + }, + "zis": { + "type": "object", + "additionalProperties": false, + "description": "ZIS related configurations. This setup is optional.", + "properties": { + "parmlib": { + "type": "object", + "additionalProperties": false, + "description": "ZIS related PARMLIB configurations. This setup is optional.", + "properties": { + "keys": { + "type": "object", + "additionalProperties": true, + "description": "Used to specify special ZIS key types with key-value pairs", + "examples": [ + "key.sample.1: list", + "key.sample.2: list" + ] + } + } + } + } + }, + "security": { + "type": "object", + "additionalProperties": false, + "description": "Security related configurations. This setup is optional.", + "properties": { + "product": { + "type": "string", + "description": "Security product name. Can be RACF, ACF2 or TSS", + "enum": ["RACF", "ACF2", "TSS"], + "default": "RACF" + }, + "groups": { + "type": "object", + "additionalProperties": false, + "description": "security group name", + "properties": { + "admin": { + "type": "string", + "description": "Zowe admin user group", + "default": "ZWEADMIN" + }, + "stc": { + "type": "string", + "description": "Zowe STC group", + "default": "ZWEADMIN" + }, + "sysProg": { + "type": "string", + "description": "Zowe SysProg group", + "default": "ZWEADMIN" + } + } + }, + "users": { + "type": "object", + "additionalProperties": false, + "description": "security user name", + "properties": { + "zowe": { + "type": "string", + "description": "Zowe runtime user name of main service", + "default": "ZWESVUSR" + }, + "zis": { + "type": "string", + "description": "Zowe runtime user name of ZIS", + "default": "ZWESIUSR" + } + } + }, + "stcs": { + "type": "object", + "additionalProperties": false, + "description": "STC names", + "properties": { + "zowe": { + "type": "string", + "description": "STC name of main service", + "default": "ZWESLSTC" + }, + "zis": { + "type": "string", + "description": "STC name of ZIS", + "default": "ZWESISTC" + }, + "aux": { + "type": "string", + "description": "STC name of Auxiliary Service", + "default": "ZWESASTC" + } + } + } + } + }, + "certificate": { + "type": "object", + "additionalProperties": false, + "if": { + "properties": { + "type": { + "const": "PKCS12" + } + } + }, + "then": { + "required": ["pkcs12"] + }, + "else": { + "required": ["keyring"] + }, + "description": "Certificate related configurations", + "properties": { + "type": { + "type": "string", + "description": "Type of certificate storage method.", + "enum": ["PKCS12", "JCEKS", "JCECCAKS", "JCERACFKS", "JCECCARACFKS", "JCEHYBRIDRACFKS"], + "default": "PKCS12" + }, + "pkcs12": { + "type": "object", + "additionalProperties": false, + "description": "PKCS#12 keystore settings", + "properties": { + "directory": { + "description": "Keystore directory", + "type": "string", + "pattern": "^([^\\0]){1,1024}$", + "minLength": 1, + "maxLength": 1024 + }, + "name": { + "type": "string", + "description": "Certificate alias name. Note: please use all lower cases as alias.", + "default": "localhost" + }, + "password": { + "type": "string", + "description": "Keystore password", + "default": "password" + }, + "caAlias": { + "type": "string", + "description": "Alias name of self-signed certificate authority. Note: please use all lower cases as alias.", + "default": "local_ca" + }, + "caPassword": { + "type": "string", + "description": "Password of keystore stored self-signed certificate authority.", + "default": "local_ca_password" + }, + "lock": { + "type": "boolean", + "description": "Whether to restrict the permissions of the keystore after creation" + }, + "import": { + "type": "object", + "additionalProperties": false, + "description": "Configure this section if you want to import certificate from another PKCS#12 keystore.", + "properties": { + "keystore": { + "type": "string", + "description": "Existing PKCS#12 keystore which holds the certificate issued by external CA." + }, + "password": { + "type": "string", + "description": "Password of the above keystore" + }, + "alias": { + "type": "string", + "description": "Certificate alias will be imported. Note: please use all lower cases as alias." + } + } + } + } + }, + "keyring": { + "type": "object", + "additionalProperties": false, + "description": "Configure this section if you are using z/OS keyring", + "properties": { + "owner": { + "type": "string", + "description": "keyring owner. If this is empty, Zowe will use the user ID defined as zowe.setup.security.users.zowe." + }, + "name": { + "type": "string", + "description": "keyring name" + }, + "label": { + "type": "string", + "description": "Label of Zowe certificate.", + "default": "localhost" + }, + "caLabel": { + "type": "string", + "description": "label of Zowe CA certificate.", + "default": "localca" + }, + "connect": { + "type": "object", + "additionalProperties": false, + "description": "Configure this section if you want to connect existing certificate in keyring to Zowe.", + "properties": { + "user": { + "type": "string", + "description": "Current owner of the existing certificate, can be SITE or an user ID." + }, + "label": { + "type": "string", + "description": "Label of the existing certificate will be connected to Zowe keyring." + } + } + }, + "import": { + "type": "object", + "additionalProperties": false, + "description": "Configure this section if you want to import existing certificate stored in data set to Zowe.", + "properties": { + "dsName": { + "type": "string", + "description": "Name of the data set holds the certificate issued by other CA. This data set should be in PKCS12 format and contain private key." + }, + "password": { + "type": "string", + "description": "Password for the PKCS12 data set." + } + } + }, + "zOSMF": { + "type": "object", + "additionalProperties": false, + "description": "Configure this section if you want to trust z/OSMF certificate authority in Zowe keyring.", + "properties": { + "ca": { + "type": "string", + "description": "z/OSMF certificate authority alias" + }, + "user": { + "type": "string", + "description": "z/OSMF user. Zowe initialization utility can detect alias of z/OSMF CA for RACF security system. The automated detection requires this z/OSMF user as input." + } + } + } + } + }, + "dname": { + "type": "object", + "additionalProperties": false, + "description": "Certificate distinguish name", + "properties": { + "caCommonName": { + "type": "string", + "description": "Common name of certificate authority generated by Zowe." + }, + "commonName": { + "type": "string", + "description": "Common name of certificate generated by Zowe." + }, + "orgUnit": { + "type": "string", + "description": "Organization unit of certificate generated by Zowe." + }, + "org": { + "type": "string", + "description": "Organization of certificate generated by Zowe." + }, + "locality": { + "type": "string", + "description": "Locality of certificate generated by Zowe. This is usually the city name." + }, + "state": { + "type": "string", + "description": "State of certificate generated by Zowe. You can also put province name here." + }, + "country": { + "type": "string", + "description": "2 letters country code of certificate generated by Zowe." + } + } + }, + "validity": { + "type": "integer", + "description": "Validity days for Zowe generated certificates", + "default": 3650 + }, + "san": { + "type": "array", + "description": "Domain names and IPs should be added into certificate SAN. If this field is not defined, `zwe init` command will use `zowe.externalDomains`.", + "items": { + "type": "string" + } + }, + "importCertificateAuthorities": { + "type": "array", + "description": "PEM format certificate authorities will also be imported and trusted. If you have other certificate authorities want to be trusted in Zowe keyring, list the certificate labels here. **NOTE**, due to the limitation of RACDCERT command, this field should contain maximum 2 entries.", + "items": { + "type": "string" + } + } + } + }, + "vsam": { + "type": "object", + "additionalProperties": false, + "description": "VSAM configurations if you are using VSAM as Caching Service storage", + "properties": { + "mode": { + "type": "string", + "description": "VSAM data set with Record-Level-Sharing enabled or not", + "enum": ["NONRLS", "RLS"], + "default": "NONRLS" + }, + "volume": { + "type": "string", + "description": "Volume name if you are using VSAM in NONRLS mode" + }, + "storageClass": { + "type": "string", + "description": "Storage class name if you are using VSAM in RLS mode" + } + } + } + } + }, + "runtimeDirectory": { + "$ref": "#/$defs/zowePath", + "description": "Path to where you installed Zowe." + }, + "logDirectory": { + "$ref": "#/$defs/zowePath", + "description": "Path to where you want to store Zowe log files." + }, + "workspaceDirectory": { + "$ref": "#/$defs/zowePath", + "description": "Path to where you want to store Zowe workspace files. Zowe workspace are used by Zowe component runtime to store temporary files." + }, + "extensionDirectory": { + "$ref": "#/$defs/zowePath", + "description": "Path to where you want to store Zowe extensions. \"zwe components install\" will install new extensions into this directory." + }, + "job": { + "type": "object", + "additionalProperties": false, + "description": "Customize your Zowe z/OS JES job.", + "properties": { + "name": { + "type": "string", + "description": "Job name of Zowe primary ZWESLSTC started task." + }, + "prefix": { + "type": "string", + "description": "A short prefix to customize address spaces created by Zowe job." + } + } + }, + "network": { + "$ref": "#/$defs/networkSettings" + }, + "extensionRegistry": { + "type": "object", + "description": "Defines optional configuration for downloading extensions from an online or offline registry", + "required": ["defaultHandler", "handlers"], + "properties": { + "defaultHandler": { + "type": "string", + "description": "The name of a handler specified in the handlers section. Will be used as the default for 'zwe components' commands" + }, + "handlers": { + "type": "object", + "patternProperties": { + "^.*$": { + "$ref": "#/$defs/registryHandler" + } + } + } + } + }, + "launcher": { + "type": "object", + "description": "Set default behaviors of how the Zowe launcher will handle components", + "additionalProperties": false, + "properties": { + "restartIntervals": { + "type": "array", + "description": "Intervals of seconds to wait before restarting a component if it fails before the minUptime value.", + "items": { + "type": "integer" + } + }, + "minUptime": { + "type": "integer", + "default": 90, + "description": "The minimum amount of seconds before a component is considered running and the restart counter is reset." + }, + "shareAs": { + "type": "string", + "description": "Determines which SHAREAS mode should be used when starting a component", + "enum": ["no", "yes", "must", ""], + "default": "yes" + }, + "unsafeDisableZosVersionCheck": { + "type": "boolean", + "description": "Used to allow Zowe to warn, instead of error, when running on a version of z/OS that this version of Zowe hasn't been verified as working with", + "default": false + } + } + }, + "rbacProfileIdentifier": { + "type": "string", + "description": "An ID used for determining resource names used in RBAC authorization checks" + }, + "cookieIdentifier": { + "type": "string", + "description": "An ID that can be used by servers that distinguish their cookies from unrelated Zowe installs" + }, + "externalDomains": { + "type": "array", + "description": "List of domain names of how you access Zowe from your local computer.", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": ["string"] + } + }, + "externalPort": { + "$ref": "#/$defs/port", + "description": "Port number of how you access Zowe APIML Gateway from your local computer." + }, + "environments": { + "type": "object", + "description": "Global environment variables can be applied to all Zowe high availability instances." + }, + "launchScript": { + "type": "object", + "description": "Customize Zowe launch scripts (zwe commands) behavior.", + "properties": { + "logLevel": { + "type": "string", + "description": "Log level for Zowe launch scripts.", + "enum": ["", "info", "debug", "trace"] + }, + "onComponentConfigureFail": { + "type": "string", + "description": "Chooses how 'zwe start' behaves if a component configure script fails", + "enum": ["warn", "exit"], + "default": "warn" + } + } + }, + "certificate": { + "$ref": "#/$defs/certificate", + "description": "Zowe certificate setup." + }, + "verifyCertificates": { + "type": "string", + "description": "Customize how Zowe should validate certificates used by components or other services.", + "enum": ["STRICT", "NONSTRICT", "DISABLED"] + }, + "sysMessages": { + "type": "array", + "description": "List of Zowe message portions when matched will be additionally logged into the system's log (such as syslog on z/OS). Note: Some messages extremely early in the Zowe lifecycle may not be added to the system's log", + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "useConfigmgr": { + "type": "boolean", + "default": false, + "description": "Determines whether or not to use the features of configmgr such as multi-config, parmlib config, config templates, and schema validation. This effects the zwe command." + }, + "configmgr": { + "type": "object", + "description": "Controls how configmgr will be used by zwe", + "required": ["validation"], + "properties": { + "validation": { + "type": "string", + "enum": ["STRICT", "COMPONENT-COMPAT"], + "description": "States how configmgr will do validation: Will it quit on any error (STRICT) or quit on any error except the case of a component not having a schema file (COMPONENT-COMPAT)" + } + } + } + } + }, + "java": { + "type": "object", + "properties": { + "home": { + "$ref": "#/$defs/zowePath", + "description": "Path to Java home directory." + } + } + }, + "node": { + "type": "object", + "properties": { + "home": { + "$ref": "#/$defs/zowePath", + "description": "Path to node.js home directory." + } + } + }, + "zOSMF": { + "type": "object", + "additionalProperties": false, + "properties": { + "host": { + "type": "string", + "description": "Host or domain name of your z/OSMF instance." + }, + "port": { + "$ref": "#/$defs/port", + "description": "Port number of your z/OSMF instance." + }, + "scheme": { + "$ref" : "#/$defs/scheme", + "description": "Scheme used to connect to z/OSMF instance. Optional for outbout AT-TLS, defaults to https" + }, + "applId": { + "type": "string", + "description": "Appl ID of your z/OSMF instance." + } + } + }, + "components": { + "type": "object", + "patternProperties": { + "^.*$": { + "$ref": "#/$defs/component" + } + } + }, + "haInstances": { + "type": "object", + "patternProperties": { + "^.*$": { + "type": "object", + "description": "Configuration of Zowe high availability instance.", + "required": ["hostname", "sysname"], + "properties": { + "hostname": { + "type": "string", + "description": "Host name of the Zowe high availability instance. This is hostname for internal communications." + }, + "sysname": { + "type": "string", + "description": "z/OS system name of the Zowe high availability instance. Some JES command will be routed to this system name." + }, + "components": { + "type": "object", + "patternProperties": { + "^.*$": { + "$ref": "#/$defs/component" + } + } + } + } + } + } + } + }, + "$defs": { + "port": { + "type": "integer", + "minimum": 0, + "maximum": 65535 + }, + "scheme": { + "type": "string", + "enum": [ + "http", + "https" + ], + "default": "https" + }, + "certificate": { + "oneOf": [ + { "$ref": "#/$defs/pkcs12-certificate" }, + { "$ref": "#/$defs/keyring-certificate" } + ] + }, + "pkcs12-certificate": { + "type": "object", + "additionalProperties": false, + "required": ["keystore", "truststore", "pem"], + "properties": { + "keystore": { + "type": "object", + "additionalProperties": false, + "description": "Certificate keystore.", + "required": ["type", "file", "alias"], + "properties": { + "type": { + "type": "string", + "description": "Keystore type.", + "const": "PKCS12" + }, + "file": { + "$ref": "#/$defs/zowePath", + "description": "Path to your PKCS#12 keystore." + }, + "password": { + "type": "string", + "description": "Password of your PKCS#12 keystore." + }, + "alias": { + "type": "string", + "description": "Certificate alias name of defined in your PKCS#12 keystore" + } + } + }, + "truststore": { + "type": "object", + "additionalProperties": false, + "description": "Certificate truststore.", + "required": ["type", "file"], + "properties": { + "type": { + "type": "string", + "description": "Truststore type.", + "const": "PKCS12" + }, + "file": { + "$ref": "#/$defs/zowePath", + "description": "Path to your PKCS#12 keystore." + }, + "password": { + "type": "string", + "description": "Password of your PKCS#12 keystore." + } + } + }, + "pem": { + "type": "object", + "additionalProperties": false, + "description": "Certificate in PEM format.", + "required": ["key", "certificate"], + "properties": { + "key": { + "$ref": "#/$defs/zowePath", + "description": "Path to the certificate private key stored in PEM format." + }, + "certificate": { + "$ref": "#/$defs/zowePath", + "description": "Path to the certificate stored in PEM format." + }, + "certificateAuthorities": { + "description": "List of paths to the certificate authorities stored in PEM format.", + "oneOf": [{ + "$ref": "#/$defs/zowePath", + "description": "Paths to the certificate authorities stored in PEM format. You can separate multiple certificate authorities by comma." + }, + { + "type": "array", + "description": "Path to the certificate authority stored in PEM format.", + "items": { + "$ref": "#/$defs/zowePath" + } + } + ] + } + } + } + } + }, + "keyring-certificate": { + "type": "object", + "additionalProperties": false, + "required": ["keystore", "truststore"], + "properties": { + "keystore": { + "type": "object", + "additionalProperties": false, + "description": "Certificate keystore.", + "required": ["type", "file", "alias"], + "properties": { + "type": { + "type": "string", + "description": "Keystore type.", + "enum": ["JCEKS", "JCECCAKS", "JCERACFKS", "JCECCARACFKS", "JCEHYBRIDRACFKS"] + }, + "file": { + "type": "string", + "description": "Path of your z/OS keyring, including ring owner and ring name. Case sensitivity and spaces matter.", + "pattern": "^safkeyring:\/\/.*" + }, + "password": { + "type": "string", + "description": "Literally 'password' may be needed when using keyrings for compatibility with java servers.", + "enum": ["", "password"] + }, + "alias": { + "type": "string", + "description": "Certificate label of z/OS keyring. Case sensitivity and spaces matter." + } + } + }, + "truststore": { + "type": "object", + "additionalProperties": false, + "description": "Certificate truststore.", + "required": ["type", "file"], + "properties": { + "type": { + "type": "string", + "description": "Truststore type.", + "enum": ["JCEKS", "JCECCAKS", "JCERACFKS", "JCECCARACFKS", "JCEHYBRIDRACFKS"] + }, + "file": { + "type": "string", + "description": "Path of your z/OS keyring, including ring owner and ring name. Case sensitivity and spaces matter.", + "pattern": "^safkeyring:\/\/.*" + }, + "password": { + "type": "string", + "description": "Literally 'password' may be needed when using keyrings for compatibility with java servers.", + "enum": ["", "password"] + } + } + }, + "pem": { + "type": "object", + "additionalProperties": false, + "description": "Certificate in PEM format.", + "properties": { + "key": { + "type": "string", + "description": "Path to the certificate private key stored in PEM format." + }, + "certificate": { + "type": "string", + "description": "Path to the certificate stored in PEM format." + }, + "certificateAuthorities": { + "description": "List of paths to the certificate authorities stored in PEM format.", + "oneOf": [{ + "type": "string", + "description": "Paths to the certificate authorities stored in PEM format. You can separate multiple certificate authorities by comma." + }, + { + "type": "array", + "description": "Path to the certificate authority stored in PEM format.", + "items": { + "type": "string" + } + } + ] + } + } + } + } + }, + "component": { + "$anchor": "zoweComponent", + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Whether to enable or disable this component", + "default": false + }, + "certificate": { + "$ref": "#/$defs/certificate", + "description": "Certificate for current component." + }, + "launcher": { + "type": "object", + "description": "Set behavior of how the Zowe launcher will handle this particular component", + "additionalProperties": true, + "properties": { + "restartIntervals": { + "type": "array", + "description": "Intervals of seconds to wait before restarting a component if it fails before the minUptime value.", + "items": { + "type": "integer" + } + }, + "minUptime": { + "type": "integer", + "default": 90, + "description": "The minimum amount of seconds before a component is considered running and the restart counter is reset." + }, + "shareAs": { + "type": "string", + "description": "Determines which SHAREAS mode should be used when starting a component", + "enum": ["no", "yes", "must", ""], + "default": "yes" + } + } + }, + "zowe": { + "type": "object", + "description": "Component level overrides for top level Zowe network configuration.", + "additionalProperties": true, + "properties": { + "network": { + "$ref": "#/$defs/networkSettings" + }, + "job": { + "$ref": "#/$defs/componentJobSettings" + } + } + } + } + }, + "componentJobSettings": { + "$anchor": "componentJobSettings", + "type": "object", + "description": "Component level overrides for job execution behavior", + "properties": { + "suffix": { + "type": "string", + "description": "Can be used by components to declare a jobname suffix to append to their job. This is not currently used by Zowe itself, it is up to components to use this value if desired. Zowe may use this value in the future." + } + } + }, + "tlsSettings": { + "$anchor": "tlsSettings", + "type": "object", + "properties": { + "ciphers": { + "type": "array", + "description": "Acceptable TLS cipher suites for network connections, in IANA format.", + "items": { + "type": "string" + } + }, + "curves": { + "type": "array", + "description": "Acceptable key exchange elliptic curves for network connections.", + "items": { + "type": "string" + } + }, + "maxTls": { + "type": "string", + "enum": ["TLSv1.2", "TLSv1.3"], + "default": "TLSv1.3", + "description": "Maximum TLS version allowed for network connections." + }, + "minTls": { + "type": "string", + "enum": ["TLSv1.2", "TLSv1.3"], + "default": "TLSv1.2", + "description": "Minimum TLS version allowed for network connections, and less than or equal to network.maxTls." + } + } + }, + "networkSettings": { + "type": "object", + "$anchor": "networkSettings", + "additionalProperties": false, + "description": "Optional, advanced network configuration parameters", + "properties": { + "server": { + "type": "object", + "additionalProperties": false, + "description": "Optional, advanced network configuration parameters for Zowe servers", + "properties": { + "tls": { + "$ref": "#/$defs/tlsSettings" + }, + "listenAddresses": { + "type": "array", + "description": "The IP addresses which all of the Zowe servers will be binding on and listening to. Some servers may only support listening on the first element.", + "items": { + "type": "string", + "pattern": "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$" + } + }, + "vipaIp": { + "type": "string", + "description": "The IP address which all of the Zowe servers will be binding to. If you are using multiple DIPVA addresses, do not use this option." + }, + "validatePortFree": { + "type": "boolean", + "default": true, + "description": "Whether or not to ensure that the port a server is about to use is available. Usually, servers will know this when they attempt to bind to a port, so this option allows you to disable the additional verification step." + } + } + }, + "client": { + "type": "object", + "additionalProperties": false, + "description": "Optional, advanced network configuration parameters for Zowe servers when sending requests as clients.", + "properties": { + "tls": { + "$ref": "#/$defs/tlsSettings" + } + } + } + } + }, + "registryHandler": { + "$anchor": "registryHandler", + "type": "object", + "required": ["registry", "path"], + "properties": { + "registry": { + "type": "string", + "description": "The location of the default registry for this handler. It could be a URL, path, dataset, whatever this handler supports" + }, + "path": { + "$ref": "#/$defs/zowePath", + "description": "Unix file path to the configmgr-compatible JS file which implements the handler API" + } + } + }, + "zowePath": { + "$anchor": "zowePath", + "type": "string", + "pattern": "^([^\\0]){1,1024}$", + "minLength": 1, + "maxLength": 1024 + }, + } + } \ No newline at end of file diff --git a/src/types/stateInterfaces.ts b/src/types/stateInterfaces.ts index e6d774d8..56a13a1f 100644 --- a/src/types/stateInterfaces.ts +++ b/src/types/stateInterfaces.ts @@ -38,7 +38,9 @@ export interface ActiveState { activeStepIndex: number, isSubStep: boolean, activeSubStepIndex: number, - date?: string + lastActiveDate?: string, + host?: string, + user?: string } export interface DatasetInstallationState { @@ -69,7 +71,34 @@ export interface PlanningValidationDetails { error: string } +export interface SkipState { + datasetInstallation: boolean, + networking: boolean, + apfAuth: boolean, + security: boolean, + certificate: boolean, + launchConfig: boolean +} +export interface InstallationArgs { + installationDir: string; + workspaceDir: string; + logDir: string, + extensionDir: string, + installationType?: string; + downloadDir: string; + userUploadedPaxPath?: string; + javaHome: string; + nodeHome: string; + setupConfig: any; + jobName: string; + jobPrefix: string; + rbacProfile: string; + cookieId: string; + zosmfHost: string, + zosmfPort: string, + zosmfApplId: string +}; diff --git a/src/utils/StageDetails.ts b/src/utils/StageDetails.ts index 6a1a6012..b8afb6b8 100644 --- a/src/utils/StageDetails.ts +++ b/src/utils/StageDetails.ts @@ -8,6 +8,7 @@ * Copyright Contributors to the Zowe Project. */ +import { getSubStageSkipStatus } from '../renderer/components/stages/progress/StageProgressStatus'; import { stages } from '../renderer/components/configuration-wizard/Wizard'; export const getStageDetails = (stageLabel: string) => { @@ -23,5 +24,28 @@ export const getSubStageDetails = (stageId: number, subStageLabel: string) => { return null; } +export const initStageSkipStatus = (): void => { + const skipStatus = getSubStageSkipStatus(); + + const subStageSkipStatus = [ + skipStatus.datasetInstallation, + skipStatus.networking, + skipStatus.apfAuth, + skipStatus.security, + skipStatus.certificate, + skipStatus.launchConfig + ]; + + let iterator = 0; + stages.map(stage => { + if(stage.subStages) { + stage.subStages.map(subStage => { + subStage.isSkipped = subStageSkipStatus[iterator]; + iterator++; + }) + } + }) +} +