From 398ef54d2036caca28a77aaae6f02ebd199173a3 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Mon, 6 May 2024 12:27:57 +0530 Subject: [PATCH 01/19] Initial Commit --- src/renderer/components/stages/Security.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/renderer/components/stages/Security.tsx b/src/renderer/components/stages/Security.tsx index 1ea8f290..d7ad8c23 100644 --- a/src/renderer/components/stages/Security.tsx +++ b/src/renderer/components/stages/Security.tsx @@ -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'}); } From 5e3809ed4e18f786d2d7fc0068433ca8044d630d Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Mon, 6 May 2024 16:55:39 +0530 Subject: [PATCH 02/19] Resume Progress --- .../stages/connection/Connection.tsx | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/renderer/components/stages/connection/Connection.tsx b/src/renderer/components/stages/connection/Connection.tsx index 9e7aadf7..ebe75d31 100644 --- a/src/renderer/components/stages/connection/Connection.tsx +++ b/src/renderer/components/stages/connection/Connection.tsx @@ -33,12 +33,12 @@ import { setConnectionArgs, setConnectionValidationDetails, setHost, setPort, setUser, setPassword, setSecure, setSecureOptions, selectConnectionArgs, setAcceptCertificates, selectConnectionSecure, selectConnectionValidationDetails, selectAcceptCertificates} from './connectionSlice'; import { 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 { setActiveStep, 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 eventDispatcher from "../../../../utils/eventDispatcher"; const Connection = () => { @@ -59,9 +59,6 @@ const Connection = () => { useEffect(() => { connectionStatus ? dispatch(setNextStepEnabled(true)) : dispatch(setNextStepEnabled(false)); - return () => { - dispatch(setActiveStep({ activeStepIndex: STAGE_ID, isSubStep: SUB_STAGES, activeSubStepIndex: 0 })); - } }, []); return ( @@ -128,12 +125,6 @@ const FTPConnectionForm = () => { 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 handleFormChange = (ftpConnection?:boolean, acceptCerts?:boolean) => { dispatch(setConnectionStatus(false)); @@ -162,6 +153,10 @@ const FTPConnectionForm = () => { }); }; + const resumeProgress = () => { + eventDispatcher.emit('updateActiveStep', activeStepIndex, isSubStep, activeSubStepIndex); + } + return ( {e.preventDefault(); processForm();}} @@ -309,6 +304,13 @@ const FTPConnectionForm = () => {
{connectionStatus && }
+ {connectionStatus && activeStepIndex>0 && + + +
resumeProgress()} />
+
+
} +
{!connectionStatus && (validationDetails && alertEmitter.emit('showAlert', validationDetails, 'error'))}
From c8410d224b9558d1e6104cd66302a0edf561a8c9 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Tue, 7 May 2024 12:00:09 +0530 Subject: [PATCH 03/19] Updating the connection file --- src/renderer/components/stages/connection/Connection.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/renderer/components/stages/connection/Connection.tsx b/src/renderer/components/stages/connection/Connection.tsx index ebe75d31..901fddc7 100644 --- a/src/renderer/components/stages/connection/Connection.tsx +++ b/src/renderer/components/stages/connection/Connection.tsx @@ -37,7 +37,7 @@ import { setActiveStep, selectActiveStepIndex, selectIsSubstep, selectActiveSubS import { Container } from "@mui/material"; import { alertEmitter } from "../../Header"; import { getStageDetails } from "../../../../utils/StageDetails"; -import { initializeProgress } from "../progress/StageProgressStatus"; +import { initializeProgress, getActiveStage } from "../progress/StageProgressStatus"; import eventDispatcher from "../../../../utils/eventDispatcher"; const Connection = () => { @@ -122,9 +122,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); + const { activeStepIndex, isSubStep, activeSubStepIndex } = getActiveStage(); const handleFormChange = (ftpConnection?:boolean, acceptCerts?:boolean) => { dispatch(setConnectionStatus(false)); From 0ac364deb7821892439d1d968008cc38e3b80714 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Tue, 7 May 2024 12:39:35 +0530 Subject: [PATCH 04/19] setting the schema --- src/renderer/components/stages/Planning.tsx | 1197 +---------------- .../stages/connection/Connection.tsx | 22 +- src/renderer/config/constants.ts | 1193 ++++++++++++++++ 3 files changed, 1214 insertions(+), 1198 deletions(-) create mode 100644 src/renderer/config/constants.ts 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/connection/Connection.tsx b/src/renderer/components/stages/connection/Connection.tsx index 901fddc7..dcc4fee1 100644 --- a/src/renderer/components/stages/connection/Connection.tsx +++ b/src/renderer/components/stages/connection/Connection.tsx @@ -31,7 +31,7 @@ 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'; +import { setYaml, setSchema, setLoading, setNextStepEnabled, selectZoweCLIVersion } from '../../configuration-wizard/wizardSlice'; import { setConnectionStatus, selectConnectionStatus} from '../progress/progressSlice'; import { setActiveStep, selectActiveStepIndex, selectIsSubstep, selectActiveSubStepIndex} from '../progress/activeStepSlice'; import { Container } from "@mui/material"; @@ -39,6 +39,8 @@ import { alertEmitter } from "../../Header"; import { getStageDetails } 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 = () => { @@ -152,7 +154,23 @@ const FTPConnectionForm = () => { }; const resumeProgress = () => { - eventDispatcher.emit('updateActiveStep', activeStepIndex, isSubStep, activeSubStepIndex); + window.electron.ipcRenderer.getConfig().then((res: IResponse) => { + if (res.status) { + 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 + }); + } + eventDispatcher.emit('updateActiveStep', activeStepIndex, isSubStep, activeSubStepIndex); + }) } return ( 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 From 43c547fc938678023cb45747ce65113a860e1149 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Wed, 8 May 2024 19:24:07 +0530 Subject: [PATCH 05/19] Updating the stage icons --- src/renderer/components/common/Stepper.tsx | 12 ++++++---- .../configuration-wizard/Wizard.tsx | 24 +++++++++---------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/renderer/components/common/Stepper.tsx b/src/renderer/components/common/Stepper.tsx index e128b854..f9eb57bd 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 } 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 @@ -165,17 +167,17 @@ 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 || (isSubStep && getProgress(stages[stageId].subStages[subStepId].statusKey)) || (!isSubStep && getProgress(stages[stageId].statusKey))) { + return } />; + } + if ((error && activeStep>stageId && !isSubStep) || (error && isSubStep && stages[stageId].subStages[subStepId].isSkipped)) { return } />; } - - if (!error) { - return } />; - } else { return ( diff --git a/src/renderer/components/configuration-wizard/Wizard.tsx b/src/renderer/components/configuration-wizard/Wizard.tsx index 735571c2..ec10c191 100644 --- a/src/renderer/components/configuration-wizard/Wizard.tsx +++ b/src/renderer/components/configuration-wizard/Wizard.tsx @@ -26,19 +26,19 @@ import Networking from '../stages/Networking'; import LaunchConfig from '../stages/LaunchConfig'; export const stages = [ - {id: 0, label: 'Connection', component: , 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}) => { From 69d533cd3148dfc9be57e8fc2616da727d97a570 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Wed, 8 May 2024 19:28:55 +0530 Subject: [PATCH 06/19] Updating the styling --- src/renderer/components/stages/connection/Connection.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderer/components/stages/connection/Connection.tsx b/src/renderer/components/stages/connection/Connection.tsx index dcc4fee1..24ff6a00 100644 --- a/src/renderer/components/stages/connection/Connection.tsx +++ b/src/renderer/components/stages/connection/Connection.tsx @@ -322,8 +322,8 @@ const FTPConnectionForm = () => { {connectionStatus && activeStepIndex>0 && - -
resumeProgress()} />
+ +
resumeProgress()} />
} From 78faacdc8accf2e9c2657e2f402064e44c9f2306 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Thu, 9 May 2024 14:27:08 +0530 Subject: [PATCH 07/19] Updating the connection UI to have the resume dialog --- .../stages/connection/Connection.tsx | 45 ++++++++++++++++--- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/src/renderer/components/stages/connection/Connection.tsx b/src/renderer/components/stages/connection/Connection.tsx index 24ff6a00..d0556ea8 100644 --- a/src/renderer/components/stages/connection/Connection.tsx +++ b/src/renderer/components/stages/connection/Connection.tsx @@ -124,7 +124,7 @@ const FTPConnectionForm = () => { const [formProcessed, toggleFormProcessed] = React.useState(false); const [validationDetails, setValidationDetails] = React.useState(''); - const { activeStepIndex, isSubStep, activeSubStepIndex } = getActiveStage(); + const { activeStepIndex, isSubStep, activeSubStepIndex, date } = getActiveStage(); const handleFormChange = (ftpConnection?:boolean, acceptCerts?:boolean) => { dispatch(setConnectionStatus(false)); @@ -311,21 +311,56 @@ const FTPConnectionForm = () => { } - + +
+ +
+ +
{connectionStatus && }
+
+ +
+ {connectionStatus && activeStepIndex>0 && +
+ + +
+ Saved Installation +
+ + +
Last updated on: {date}
+
+ + + +
+
+ +
+ +
} +
+ +
+ + {/* -
{connectionStatus && }
+
{connectionStatus && }
*/} - {connectionStatus && activeStepIndex>0 && + {/* {connectionStatus && activeStepIndex>0 &&
resumeProgress()} />
-
} +
} */}
{!connectionStatus && (validationDetails && alertEmitter.emit('showAlert', validationDetails, 'error'))} From 13707543d31de40410169ec55adad588c77a2af5 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Thu, 9 May 2024 22:08:10 +0530 Subject: [PATCH 08/19] Adding the lastinstallation obj --- src/renderer/components/Home.tsx | 31 ++++++++++++++----- .../stages/connection/Connection.tsx | 4 +-- .../stages/progress/StageProgressStatus.ts | 14 ++++++++- .../stages/progress/activeStepSlice.ts | 6 ++-- src/types/stateInterfaces.ts | 4 ++- 5 files changed, 45 insertions(+), 14 deletions(-) diff --git a/src/renderer/components/Home.tsx b/src/renderer/components/Home.tsx index 559bb099..5d333196 100644 --- a/src/renderer/components/Home.tsx +++ b/src/renderer/components/Home.tsx @@ -28,6 +28,9 @@ 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 flatten from 'flat'; +import { getPreviousInstallation } from './stages/progress/StageProgressStatus'; // REVIEW: Get rid of routing @@ -85,15 +88,20 @@ 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(true); + const stages: any = []; useEffect(() => { @@ -121,6 +129,15 @@ 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)); + } else { + setIsNewInstallation(false); + } + }); return () => { eventDispatcher.off('saveAndCloseEvent', () => setShowWizard(true)); @@ -155,7 +172,7 @@ const Home = () => { {cards.map(card => makeCard(card))}
- {connectionStatus &&
+ {!isNewInstallation &&
diff --git a/src/renderer/components/stages/connection/Connection.tsx b/src/renderer/components/stages/connection/Connection.tsx index d0556ea8..fab93cf6 100644 --- a/src/renderer/components/stages/connection/Connection.tsx +++ b/src/renderer/components/stages/connection/Connection.tsx @@ -124,7 +124,7 @@ const FTPConnectionForm = () => { const [formProcessed, toggleFormProcessed] = React.useState(false); const [validationDetails, setValidationDetails] = React.useState(''); - const { activeStepIndex, isSubStep, activeSubStepIndex, date } = getActiveStage(); + const { activeStepIndex, isSubStep, activeSubStepIndex, lastActiveDate } = getActiveStage(); const handleFormChange = (ftpConnection?:boolean, acceptCerts?:boolean) => { dispatch(setConnectionStatus(false)); @@ -329,7 +329,7 @@ const FTPConnectionForm = () => {
-
Last updated on: {date}
+
Last updated on: {lastActiveDate}
+ {!showWizard &&
@@ -182,7 +185,7 @@ const Home = () => {
Last updated on: {lastActiveDate}
- + diff --git a/src/renderer/components/common/Stepper.tsx b/src/renderer/components/common/Stepper.tsx index f9eb57bd..53997d6e 100644 --- a/src/renderer/components/common/Stepper.tsx +++ b/src/renderer/components/common/Stepper.tsx @@ -81,6 +81,7 @@ export default function HorizontalLinearStepper({stages, initialization}:{stages }, []); const updateActiveStepListener = (newActiveStep: number, isSubStep: boolean, subStepIndex?: number) => { + console.log("INSIDE UPDATE ACTIVE STEP LISTENER"); setActiveStep(newActiveStep); const newSubStep = isSubStep ? subStepIndex : 0; setActiveSubStep(newSubStep); 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/connection/Connection.tsx b/src/renderer/components/stages/connection/Connection.tsx index fab93cf6..a6d39d88 100644 --- a/src/renderer/components/stages/connection/Connection.tsx +++ b/src/renderer/components/stages/connection/Connection.tsx @@ -30,10 +30,9 @@ 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'; + 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, selectActiveStepIndex, selectIsSubstep, selectActiveSubStepIndex} from '../progress/activeStepSlice'; import { Container } from "@mui/material"; import { alertEmitter } from "../../Header"; import { getStageDetails } from "../../../../utils/StageDetails"; @@ -124,7 +123,7 @@ const FTPConnectionForm = () => { const [formProcessed, toggleFormProcessed] = React.useState(false); const [validationDetails, setValidationDetails] = React.useState(''); - const { activeStepIndex, isSubStep, activeSubStepIndex, lastActiveDate } = getActiveStage(); + const [isResume, setIsResume] = useState(useAppSelector(selectResumeProgress)); const handleFormChange = (ftpConnection?:boolean, acceptCerts?:boolean) => { dispatch(setConnectionStatus(false)); @@ -145,6 +144,9 @@ const FTPConnectionForm = () => { if(res.status) { dispatch(setNextStepEnabled(true)); initializeProgress(connectionArgs.host, connectionArgs.user); + if(isResume) { + resumeProgress(); + } } toggleFormProcessed(true); setValidationDetails(res.details); @@ -154,6 +156,8 @@ const FTPConnectionForm = () => { }; const resumeProgress = () => { + const { activeStepIndex, isSubStep, activeSubStepIndex, lastActiveDate } = getActiveStage(); + eventDispatcher.emit('updateActiveStep', activeStepIndex, isSubStep, activeSubStepIndex); window.electron.ipcRenderer.getConfig().then((res: IResponse) => { if (res.status) { dispatch(setYaml(res.details.config)); @@ -169,7 +173,7 @@ const FTPConnectionForm = () => { // schema response }); } - eventDispatcher.emit('updateActiveStep', activeStepIndex, isSubStep, activeSubStepIndex); + setIsResume(false); }) } @@ -312,55 +316,15 @@ const FTPConnectionForm = () => { -
- -
- -
{connectionStatus && }
-
- -
- {connectionStatus && activeStepIndex>0 && -
- - -
- Saved Installation -
- - -
Last updated on: {lastActiveDate}
-
- - - -
-
- -
- -
} -
- -
- - {/* + -
{connectionStatus && }
*/} - - {/* {connectionStatus && activeStepIndex>0 && - - -
resumeProgress()} />
-
-
} */} +
{connectionStatus && }
{!connectionStatus && (validationDetails && alertEmitter.emit('showAlert', validationDetails, 'error'))} 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; From cbd75c5031050c67cd1f0693b380df0cfafa9202 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Fri, 10 May 2024 17:13:49 +0530 Subject: [PATCH 10/19] fixing the on stepper click --- src/renderer/components/common/Stepper.tsx | 24 ++++++++++--------- .../stages/connection/Connection.tsx | 4 ++-- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/renderer/components/common/Stepper.tsx b/src/renderer/components/common/Stepper.tsx index 53997d6e..d95f7446 100644 --- a/src/renderer/components/common/Stepper.tsx +++ b/src/renderer/components/common/Stepper.tsx @@ -30,7 +30,7 @@ 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 } from '../stages/progress/StageProgressStatus'; +import { getProgress, getCompleteProgress } from '../stages/progress/StageProgressStatus'; import '../../styles/Stepper.css'; import { StepIcon } from '@mui/material'; @@ -45,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"; diff --git a/src/renderer/components/stages/connection/Connection.tsx b/src/renderer/components/stages/connection/Connection.tsx index a6d39d88..180ffc0b 100644 --- a/src/renderer/components/stages/connection/Connection.tsx +++ b/src/renderer/components/stages/connection/Connection.tsx @@ -156,8 +156,6 @@ const FTPConnectionForm = () => { }; const resumeProgress = () => { - const { activeStepIndex, isSubStep, activeSubStepIndex, lastActiveDate } = getActiveStage(); - eventDispatcher.emit('updateActiveStep', activeStepIndex, isSubStep, activeSubStepIndex); window.electron.ipcRenderer.getConfig().then((res: IResponse) => { if (res.status) { dispatch(setYaml(res.details.config)); @@ -173,6 +171,8 @@ const FTPConnectionForm = () => { // schema response }); } + const { activeStepIndex, isSubStep, activeSubStepIndex, lastActiveDate } = getActiveStage(); + eventDispatcher.emit('updateActiveStep', activeStepIndex, isSubStep, activeSubStepIndex); setIsResume(false); }) } From b33de2568144800a4232d2ae80a8d51907cb74d7 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Fri, 10 May 2024 17:47:38 +0530 Subject: [PATCH 11/19] Updating the home comp --- src/renderer/components/Home.tsx | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/renderer/components/Home.tsx b/src/renderer/components/Home.tsx index 74919037..69679a9d 100644 --- a/src/renderer/components/Home.tsx +++ b/src/renderer/components/Home.tsx @@ -155,21 +155,13 @@ const Home = () => { return ( <> - {}} open={showLoginDialog} style={{fontSize: '14px'}} fullWidth={true} maxWidth={"lg"}> - Re-enter FTP Credentials - - - - - - {!showWizard &&
- {!connectionStatus &&
} + {!connectionStatus &&
}
{cards.map(card => makeCard(card))} From 47de36027878100235df9fb068b2f05d8553cbf6 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Tue, 14 May 2024 18:09:30 +0530 Subject: [PATCH 12/19] No resume on first installation --- src/renderer/components/Home.tsx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/renderer/components/Home.tsx b/src/renderer/components/Home.tsx index 69679a9d..ebf8ab5b 100644 --- a/src/renderer/components/Home.tsx +++ b/src/renderer/components/Home.tsx @@ -12,8 +12,7 @@ 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, setResumeProgress, selectInitJobStatement } from './stages/connection/connectionSlice'; import { setJobStatement } from './stages/PlanningSlice'; @@ -29,7 +28,6 @@ import HorizontalLinearStepper from './common/Stepper'; import Wizard from './configuration-wizard/Wizard' import Connection from './stages/connection/Connection'; import { ActiveState } from '../../types/stateInterfaces'; -import flatten from 'flat'; import { getPreviousInstallation } from './stages/progress/StageProgressStatus'; // REVIEW: Get rid of routing @@ -100,10 +98,10 @@ const Home = () => { isSubStep: false, activeSubStepIndex: 0, }; - const [isNewInstallation, setIsNewInstallation] = useState(true); + const [isNewInstallation, setIsNewInstallation] = useState(false); const stages: any = []; - const defaultTooltip: string = "Continue to the last Active Stage"; + const defaultTooltip: string = "Resume"; const resumeTooltip = connectionStatus ? defaultTooltip : `Validate Credentials & ${defaultTooltip}`; useEffect(() => { @@ -135,13 +133,16 @@ const Home = () => { } const lastInstallation = localStorage.getItem(prevInstallationKey); - if(!lastInstallation) { + if (!lastInstallation) { const flattenedData = flatten(lastActiveState); localStorage.setItem(prevInstallationKey, JSON.stringify(flattenedData)); + setIsNewInstallation(true); } else { - setIsNewInstallation(false); + const data: ActiveState = unflatten(JSON.parse(lastInstallation)); + setIsNewInstallation(!(data && data.lastActiveDate)); } + }); return () => { eventDispatcher.off('saveAndCloseEvent', () => setShowWizard(true)); From b56d2c95f8fba7a806b27bbd38885a984d7b54f5 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Tue, 14 May 2024 18:19:27 +0530 Subject: [PATCH 13/19] updating the review state to have previous status --- .../components/stages/ReviewInstallation.tsx | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) 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"; From 1b37c59a909b1a00980b170b41a257f0f8eee8b5 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Tue, 14 May 2024 20:00:33 +0530 Subject: [PATCH 14/19] final --- src/renderer/components/common/Stepper.tsx | 3 ++- .../configuration-wizard/Wizard.tsx | 8 ++++++- src/renderer/components/stages/Planning.tsx | 4 +++- .../stages/connection/Connection.tsx | 9 +++++++- .../installation/InstallTypeSelection.tsx | 4 +++- .../stages/installation/Installation.tsx | 3 ++- .../stages/progress/StageProgressStatus.ts | 22 +++++++++++++++++++ 7 files changed, 47 insertions(+), 6 deletions(-) diff --git a/src/renderer/components/common/Stepper.tsx b/src/renderer/components/common/Stepper.tsx index d95f7446..7f769af8 100644 --- a/src/renderer/components/common/Stepper.tsx +++ b/src/renderer/components/common/Stepper.tsx @@ -30,7 +30,7 @@ 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 } from '../stages/progress/StageProgressStatus'; +import { getProgress, getCompleteProgress, setWizardStages } from '../stages/progress/StageProgressStatus'; import '../../styles/Stepper.css'; import { StepIcon } from '@mui/material'; @@ -210,6 +210,7 @@ export default function HorizontalLinearStepper({stages, initialization}:{stages const onSaveAndClose = () => { alertEmitter.emit('hideAlert'); eventDispatcher.emit('saveAndCloseEvent'); + setWizardStages(stages); } const isNextStepEnabled = useAppSelector(selectNextStepEnabled); diff --git a/src/renderer/components/configuration-wizard/Wizard.tsx b/src/renderer/components/configuration-wizard/Wizard.tsx index ec10c191..fcc9ac31 100644 --- a/src/renderer/components/configuration-wizard/Wizard.tsx +++ b/src/renderer/components/configuration-wizard/Wizard.tsx @@ -24,8 +24,9 @@ import { useAppSelector } from '../../hooks'; import InitApfAuth from '../stages/InitApfAuth'; import Networking from '../stages/Networking'; import LaunchConfig from '../stages/LaunchConfig'; +import { getWizardStages } from '../stages/progress/StageProgressStatus'; -export const stages = [ +let stages = [ {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'}, @@ -41,6 +42,11 @@ export const stages = [ {id: 5, label: 'Finish Installation', component: , hasJCL: false, isSkippable: false, isSkipped: false, hasOutput: false, steps: 1, statusKey: 'finishStatus'}, ] +const tempStages = getWizardStages(); +stages = tempStages ? tempStages : stages; + +export {stages}; + const Wizard = ({initialization}: {initialization: boolean}) => { return (
diff --git a/src/renderer/components/stages/Planning.tsx b/src/renderer/components/stages/Planning.tsx index 407113e7..181327ef 100644 --- a/src/renderer/components/stages/Planning.tsx +++ b/src/renderer/components/stages/Planning.tsx @@ -29,8 +29,9 @@ import { Checkbox, FormControlLabel } from "@mui/material"; import { setActiveStep } from './progress/activeStepSlice'; import EditorDialog from "../common/EditorDialog"; import { getStageDetails } from "../../../utils/StageDetails"; -import { getProgress, getPlanningStageStatus, setPlanningValidationDetailsState, getPlanningValidationDetailsState } from "./progress/StageProgressStatus"; +import { getProgress, getPlanningStageStatus, setPlanningValidationDetailsState, getPlanningValidationDetailsState, setWizardStages } from "./progress/StageProgressStatus"; import { EXAMPLE_YAML, YAML_SCHEMA } from "../../config/constants"; +import { stages } from "../configuration-wizard/Wizard"; // 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 @@ -97,6 +98,7 @@ const Planning = () => { } return () => { dispatch(setActiveStep({ activeStepIndex: STAGE_ID, isSubStep: SUB_STAGES, activeSubStepIndex: 0 })); + setWizardStages(stages); } }, []) diff --git a/src/renderer/components/stages/connection/Connection.tsx b/src/renderer/components/stages/connection/Connection.tsx index 180ffc0b..fd4fad2a 100644 --- a/src/renderer/components/stages/connection/Connection.tsx +++ b/src/renderer/components/stages/connection/Connection.tsx @@ -36,10 +36,11 @@ import { setConnectionStatus, selectConnectionStatus} from '../progress/progres import { Container } from "@mui/material"; import { alertEmitter } from "../../Header"; import { getStageDetails } from "../../../../utils/StageDetails"; -import { initializeProgress, getActiveStage } from "../progress/StageProgressStatus"; +import { initializeProgress, getActiveStage, setWizardStages } from "../progress/StageProgressStatus"; import eventDispatcher from "../../../../utils/eventDispatcher"; import { setZoweVersion, setInstallationArgs, selectInstallationArgs, selectZoweVersion } from '../installation/installationSlice'; import { EXAMPLE_YAML, YAML_SCHEMA } from "../../../config/constants"; +import { stages } from "../../configuration-wizard/Wizard"; const Connection = () => { @@ -125,6 +126,12 @@ const FTPConnectionForm = () => { const [isResume, setIsResume] = useState(useAppSelector(selectResumeProgress)); + useEffect(() => { + return () => { + setWizardStages(stages); + } + }) + const handleFormChange = (ftpConnection?:boolean, acceptCerts?:boolean) => { dispatch(setConnectionStatus(false)); dispatch(setNextStepEnabled(false)); diff --git a/src/renderer/components/stages/installation/InstallTypeSelection.tsx b/src/renderer/components/stages/installation/InstallTypeSelection.tsx index 69028763..4dc796ca 100644 --- a/src/renderer/components/stages/installation/InstallTypeSelection.tsx +++ b/src/renderer/components/stages/installation/InstallTypeSelection.tsx @@ -20,8 +20,9 @@ import CheckCircle from '@mui/icons-material/CheckCircle'; import LicenseDialog from "./LicenseDialog"; import { setActiveStep } from "../progress/activeStepSlice"; import { getStageDetails } from "../../../../utils/StageDetails"; -import { getInstallationTypeStatus } from "../progress/StageProgressStatus"; +import { getInstallationTypeStatus, setWizardStages } from "../progress/StageProgressStatus"; import { connect } from "http2"; +import { stages } from "../../configuration-wizard/Wizard"; const InstallationType = () => { @@ -44,6 +45,7 @@ const InstallationType = () => { useEffect(() => { return () => { dispatch(setActiveStep({ activeStepIndex: STAGE_ID, isSubStep: SUB_STAGES, activeSubStepIndex: 0 })); + setWizardStages(stages); } }, []); diff --git a/src/renderer/components/stages/installation/Installation.tsx b/src/renderer/components/stages/installation/Installation.tsx index 6df1312b..aaf40a8c 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, setWizardStages } from "../progress/StageProgressStatus"; import { DatasetInstallationState } from "../../../../types/stateInterfaces"; const Installation = () => { @@ -111,6 +111,7 @@ const Installation = () => { return () => { dispatch(setActiveStep({ activeStepIndex: STAGE_ID, isSubStep: SUB_STAGES, activeSubStepIndex: SUB_STAGE_ID })); + setWizardStages(stages); } }, []); diff --git a/src/renderer/components/stages/progress/StageProgressStatus.ts b/src/renderer/components/stages/progress/StageProgressStatus.ts index 3e8c4335..c95ff34f 100644 --- a/src/renderer/components/stages/progress/StageProgressStatus.ts +++ b/src/renderer/components/stages/progress/StageProgressStatus.ts @@ -87,6 +87,7 @@ let securityKey = 'security_init'; let certificateKey = 'certificate_init'; let planningValidationDetailsKey = `planning_validation_details`; let prevInstallationKey = `prev_installation`; +let wizardStagesKey = `wizard_stages`; const setKeys = (id: string) => { progressStateKey = `${progressStateKey}_${id}`; @@ -98,6 +99,7 @@ const setKeys = (id: string) => { securityKey = `${securityKey}_${id}`; certificateKey = `${certificateKey}_${id}`; planningValidationDetailsKey = `${planningValidationDetailsKey}_${id}`; + wizardStagesKey = `${wizardStagesKey}_${id}`; } export const initializeProgress = (host: string, user: string) => { @@ -157,6 +159,12 @@ export const initializeProgress = (host: string, user: string) => { const flattenedData = flatten(planningValidationDetailsStatus); localStorage.setItem(planningValidationDetailsKey, JSON.stringify(flattenedData)); } + + // const wizardStages = localStorage.getItem(wizardStagesKey); + // if(!wizardStages) { + // const flattenedData = flatten(wizardStages); + // localStorage.setItem(wizardStages, JSON.stringify(flattenedData)); + // } } export const setPlanningValidationDetailsState = (planningValidationsDetails: PlanningValidationDetails): void => { @@ -347,4 +355,18 @@ export const getPreviousInstallation = () : ActiveState => { } } +export const setWizardStages = (stages: any[]): void => { + localStorage.setItem(wizardStagesKey, JSON.stringify(flatten(stages))); +} + +export const getWizardStages = (): any => { + const wizardStages = localStorage.getItem(wizardStagesKey); + if(wizardStages) { + const flattenedData = JSON.parse(wizardStages); + return unflatten(flattenedData); + } else { + return null; + } +} + From 6097e2f6b1bfd818eb5d4e5c7d96b1e983a8fcea Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Wed, 15 May 2024 09:33:44 +0530 Subject: [PATCH 15/19] Revert "final" This reverts commit 1b37c59a909b1a00980b170b41a257f0f8eee8b5. --- src/renderer/components/common/Stepper.tsx | 3 +-- .../configuration-wizard/Wizard.tsx | 8 +------ src/renderer/components/stages/Planning.tsx | 4 +--- .../stages/connection/Connection.tsx | 9 +------- .../installation/InstallTypeSelection.tsx | 4 +--- .../stages/installation/Installation.tsx | 3 +-- .../stages/progress/StageProgressStatus.ts | 22 ------------------- 7 files changed, 6 insertions(+), 47 deletions(-) diff --git a/src/renderer/components/common/Stepper.tsx b/src/renderer/components/common/Stepper.tsx index 7f769af8..d95f7446 100644 --- a/src/renderer/components/common/Stepper.tsx +++ b/src/renderer/components/common/Stepper.tsx @@ -30,7 +30,7 @@ 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, setWizardStages } from '../stages/progress/StageProgressStatus'; +import { getProgress, getCompleteProgress } from '../stages/progress/StageProgressStatus'; import '../../styles/Stepper.css'; import { StepIcon } from '@mui/material'; @@ -210,7 +210,6 @@ export default function HorizontalLinearStepper({stages, initialization}:{stages const onSaveAndClose = () => { alertEmitter.emit('hideAlert'); eventDispatcher.emit('saveAndCloseEvent'); - setWizardStages(stages); } const isNextStepEnabled = useAppSelector(selectNextStepEnabled); diff --git a/src/renderer/components/configuration-wizard/Wizard.tsx b/src/renderer/components/configuration-wizard/Wizard.tsx index fcc9ac31..ec10c191 100644 --- a/src/renderer/components/configuration-wizard/Wizard.tsx +++ b/src/renderer/components/configuration-wizard/Wizard.tsx @@ -24,9 +24,8 @@ import { useAppSelector } from '../../hooks'; import InitApfAuth from '../stages/InitApfAuth'; import Networking from '../stages/Networking'; import LaunchConfig from '../stages/LaunchConfig'; -import { getWizardStages } from '../stages/progress/StageProgressStatus'; -let stages = [ +export const stages = [ {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'}, @@ -42,11 +41,6 @@ let stages = [ {id: 5, label: 'Finish Installation', component: , hasJCL: false, isSkippable: false, isSkipped: false, hasOutput: false, steps: 1, statusKey: 'finishStatus'}, ] -const tempStages = getWizardStages(); -stages = tempStages ? tempStages : stages; - -export {stages}; - const Wizard = ({initialization}: {initialization: boolean}) => { return (
diff --git a/src/renderer/components/stages/Planning.tsx b/src/renderer/components/stages/Planning.tsx index 181327ef..407113e7 100644 --- a/src/renderer/components/stages/Planning.tsx +++ b/src/renderer/components/stages/Planning.tsx @@ -29,9 +29,8 @@ import { Checkbox, FormControlLabel } from "@mui/material"; import { setActiveStep } from './progress/activeStepSlice'; import EditorDialog from "../common/EditorDialog"; import { getStageDetails } from "../../../utils/StageDetails"; -import { getProgress, getPlanningStageStatus, setPlanningValidationDetailsState, getPlanningValidationDetailsState, setWizardStages } from "./progress/StageProgressStatus"; +import { getProgress, getPlanningStageStatus, setPlanningValidationDetailsState, getPlanningValidationDetailsState } from "./progress/StageProgressStatus"; import { EXAMPLE_YAML, YAML_SCHEMA } from "../../config/constants"; -import { stages } from "../configuration-wizard/Wizard"; // 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 @@ -98,7 +97,6 @@ const Planning = () => { } return () => { dispatch(setActiveStep({ activeStepIndex: STAGE_ID, isSubStep: SUB_STAGES, activeSubStepIndex: 0 })); - setWizardStages(stages); } }, []) diff --git a/src/renderer/components/stages/connection/Connection.tsx b/src/renderer/components/stages/connection/Connection.tsx index fd4fad2a..180ffc0b 100644 --- a/src/renderer/components/stages/connection/Connection.tsx +++ b/src/renderer/components/stages/connection/Connection.tsx @@ -36,11 +36,10 @@ import { setConnectionStatus, selectConnectionStatus} from '../progress/progres import { Container } from "@mui/material"; import { alertEmitter } from "../../Header"; import { getStageDetails } from "../../../../utils/StageDetails"; -import { initializeProgress, getActiveStage, setWizardStages } from "../progress/StageProgressStatus"; +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"; -import { stages } from "../../configuration-wizard/Wizard"; const Connection = () => { @@ -126,12 +125,6 @@ const FTPConnectionForm = () => { const [isResume, setIsResume] = useState(useAppSelector(selectResumeProgress)); - useEffect(() => { - return () => { - setWizardStages(stages); - } - }) - const handleFormChange = (ftpConnection?:boolean, acceptCerts?:boolean) => { dispatch(setConnectionStatus(false)); dispatch(setNextStepEnabled(false)); diff --git a/src/renderer/components/stages/installation/InstallTypeSelection.tsx b/src/renderer/components/stages/installation/InstallTypeSelection.tsx index 4dc796ca..69028763 100644 --- a/src/renderer/components/stages/installation/InstallTypeSelection.tsx +++ b/src/renderer/components/stages/installation/InstallTypeSelection.tsx @@ -20,9 +20,8 @@ import CheckCircle from '@mui/icons-material/CheckCircle'; import LicenseDialog from "./LicenseDialog"; import { setActiveStep } from "../progress/activeStepSlice"; import { getStageDetails } from "../../../../utils/StageDetails"; -import { getInstallationTypeStatus, setWizardStages } from "../progress/StageProgressStatus"; +import { getInstallationTypeStatus } from "../progress/StageProgressStatus"; import { connect } from "http2"; -import { stages } from "../../configuration-wizard/Wizard"; const InstallationType = () => { @@ -45,7 +44,6 @@ const InstallationType = () => { useEffect(() => { return () => { dispatch(setActiveStep({ activeStepIndex: STAGE_ID, isSubStep: SUB_STAGES, activeSubStepIndex: 0 })); - setWizardStages(stages); } }, []); diff --git a/src/renderer/components/stages/installation/Installation.tsx b/src/renderer/components/stages/installation/Installation.tsx index aaf40a8c..6df1312b 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, setWizardStages } from "../progress/StageProgressStatus"; +import { setProgress, getProgress, setDatasetInstallationState, getDatasetInstallationState, getInstallationTypeStatus } from "../progress/StageProgressStatus"; import { DatasetInstallationState } from "../../../../types/stateInterfaces"; const Installation = () => { @@ -111,7 +111,6 @@ const Installation = () => { return () => { dispatch(setActiveStep({ activeStepIndex: STAGE_ID, isSubStep: SUB_STAGES, activeSubStepIndex: SUB_STAGE_ID })); - setWizardStages(stages); } }, []); diff --git a/src/renderer/components/stages/progress/StageProgressStatus.ts b/src/renderer/components/stages/progress/StageProgressStatus.ts index c95ff34f..3e8c4335 100644 --- a/src/renderer/components/stages/progress/StageProgressStatus.ts +++ b/src/renderer/components/stages/progress/StageProgressStatus.ts @@ -87,7 +87,6 @@ let securityKey = 'security_init'; let certificateKey = 'certificate_init'; let planningValidationDetailsKey = `planning_validation_details`; let prevInstallationKey = `prev_installation`; -let wizardStagesKey = `wizard_stages`; const setKeys = (id: string) => { progressStateKey = `${progressStateKey}_${id}`; @@ -99,7 +98,6 @@ const setKeys = (id: string) => { securityKey = `${securityKey}_${id}`; certificateKey = `${certificateKey}_${id}`; planningValidationDetailsKey = `${planningValidationDetailsKey}_${id}`; - wizardStagesKey = `${wizardStagesKey}_${id}`; } export const initializeProgress = (host: string, user: string) => { @@ -159,12 +157,6 @@ export const initializeProgress = (host: string, user: string) => { const flattenedData = flatten(planningValidationDetailsStatus); localStorage.setItem(planningValidationDetailsKey, JSON.stringify(flattenedData)); } - - // const wizardStages = localStorage.getItem(wizardStagesKey); - // if(!wizardStages) { - // const flattenedData = flatten(wizardStages); - // localStorage.setItem(wizardStages, JSON.stringify(flattenedData)); - // } } export const setPlanningValidationDetailsState = (planningValidationsDetails: PlanningValidationDetails): void => { @@ -355,18 +347,4 @@ export const getPreviousInstallation = () : ActiveState => { } } -export const setWizardStages = (stages: any[]): void => { - localStorage.setItem(wizardStagesKey, JSON.stringify(flatten(stages))); -} - -export const getWizardStages = (): any => { - const wizardStages = localStorage.getItem(wizardStagesKey); - if(wizardStages) { - const flattenedData = JSON.parse(wizardStages); - return unflatten(flattenedData); - } else { - return null; - } -} - From c88ac1c3b3d0fa1d98414f65b3eebc95625f6603 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Wed, 15 May 2024 16:35:58 +0530 Subject: [PATCH 16/19] Updating the icons and retaining them accordingly --- src/renderer/components/common/Stepper.tsx | 8 +-- .../components/stages/Certificates.tsx | 12 +++- .../components/stages/InitApfAuth.tsx | 12 +++- .../components/stages/Initialization.tsx | 2 - src/renderer/components/stages/Security.tsx | 11 +++- .../stages/connection/Connection.tsx | 3 +- .../stages/installation/Installation.tsx | 3 +- .../stages/progress/StageProgressStatus.ts | 62 ++++++++++++++++++- src/types/stateInterfaces.ts | 9 +++ src/utils/StageDetails.ts | 24 +++++++ 10 files changed, 128 insertions(+), 18 deletions(-) diff --git a/src/renderer/components/common/Stepper.tsx b/src/renderer/components/common/Stepper.tsx index d95f7446..deff4636 100644 --- a/src/renderer/components/common/Stepper.tsx +++ b/src/renderer/components/common/Stepper.tsx @@ -30,7 +30,7 @@ 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 } from '../stages/progress/StageProgressStatus'; +import { getProgress, getCompleteProgress, mapAndSetSkipStatus, mapAndGetSkipStatus } from '../stages/progress/StageProgressStatus'; import '../../styles/Stepper.css'; import { StepIcon } from '@mui/material'; @@ -83,7 +83,6 @@ export default function HorizontalLinearStepper({stages, initialization}:{stages }, []); const updateActiveStepListener = (newActiveStep: number, isSubStep: boolean, subStepIndex?: number) => { - console.log("INSIDE UPDATE ACTIVE STEP LISTENER"); setActiveStep(newActiveStep); const newSubStep = isSubStep ? subStepIndex : 0; setActiveSubStep(newSubStep); @@ -118,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(); } @@ -174,11 +174,11 @@ export default function HorizontalLinearStepper({stages, initialization}:{stages const getStepIcon = (error: any, stageId: number, isSubStep?: boolean, subStepId?: number) => { - if (!error || (isSubStep && getProgress(stages[stageId].subStages[subStepId].statusKey)) || (!isSubStep && getProgress(stages[stageId].statusKey))) { + if ((isSubStep && !mapAndGetSkipStatus(subStepId)) || !error || (isSubStep && getProgress(stages[stageId].subStages[subStepId].statusKey)) || (!isSubStep && getProgress(stages[stageId].statusKey))) { return } />; } - if ((error && activeStep>stageId && !isSubStep) || (error && isSubStep && stages[stageId].subStages[subStepId].isSkipped)) { + if ((isSubStep && mapAndGetSkipStatus(subStepId)) || (error && activeStep>stageId && !isSubStep) || (error && isSubStep && stages[stageId].subStages[subStepId].isSkipped)) { return } />; } diff --git a/src/renderer/components/stages/Certificates.tsx b/src/renderer/components/stages/Certificates.tsx index 954e0263..7d5e3f62 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 } from "./progress/StageProgressStatus"; import { CertInitSubStepsState } from "../../../types/stateInterfaces"; const Certificates = () => { @@ -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..9f38d360 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 } from "./progress/StageProgressStatus"; import { InitSubStepsState } from "../../../types/stateInterfaces"; const InitApfAuth = () => { @@ -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/Security.tsx b/src/renderer/components/stages/Security.tsx index d7ad8c23..8003ce5e 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 } from "./progress/StageProgressStatus"; import { InitSubStepsState } from "../../../types/stateInterfaces"; const Security = () => { @@ -147,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 180ffc0b..7b44e5ce 100644 --- a/src/renderer/components/stages/connection/Connection.tsx +++ b/src/renderer/components/stages/connection/Connection.tsx @@ -35,7 +35,7 @@ import { setYaml, setSchema, setLoading, setNextStepEnabled, selectZoweCLIVersio import { setConnectionStatus, selectConnectionStatus} from '../progress/progressSlice'; import { Container } from "@mui/material"; import { alertEmitter } from "../../Header"; -import { getStageDetails } from "../../../../utils/StageDetails"; +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'; @@ -144,6 +144,7 @@ const FTPConnectionForm = () => { if(res.status) { dispatch(setNextStepEnabled(true)); initializeProgress(connectionArgs.host, connectionArgs.user); + initStageSkipStatus(); if(isResume) { resumeProgress(); } diff --git a/src/renderer/components/stages/installation/Installation.tsx b/src/renderer/components/stages/installation/Installation.tsx index 6df1312b..3c7e1328 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 } from "../progress/StageProgressStatus"; import { DatasetInstallationState } from "../../../../types/stateInterfaces"; const Installation = () => { @@ -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/progress/StageProgressStatus.ts b/src/renderer/components/stages/progress/StageProgressStatus.ts index 3e8c4335..1e07c49d 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} from '../../../../types/stateInterfaces'; +import { stages } from '../../configuration-wizard/Wizard'; const installationTypeStatus: InstallationType = { installationType: 'download', @@ -77,6 +78,15 @@ const planningValidationDetailsStatus: PlanningValidationDetails = { error: '' } +const stepSkipStatus: SkipState = { + datasetInstallation: false, + networking: false, + apfAuth: false, + security: false, + certificate: false, + launchConfig: false +} + let progressStateKey = 'stage_progress'; let activeStateKey = 'active_state'; let planningStateKey = 'planning_stage'; @@ -87,6 +97,9 @@ let securityKey = 'security_init'; let certificateKey = 'certificate_init'; let planningValidationDetailsKey = `planning_validation_details`; let prevInstallationKey = `prev_installation`; +let skipStateKey = `skip_state`; + +let skipKeysArray: (keyof SkipState)[] = Object.keys(stepSkipStatus) as (keyof SkipState)[]; const setKeys = (id: string) => { progressStateKey = `${progressStateKey}_${id}`; @@ -98,6 +111,7 @@ const setKeys = (id: string) => { securityKey = `${securityKey}_${id}`; certificateKey = `${certificateKey}_${id}`; planningValidationDetailsKey = `${planningValidationDetailsKey}_${id}`; + skipStateKey = `${skipStateKey}_${id}`; } export const initializeProgress = (host: string, user: string) => { @@ -157,6 +171,52 @@ 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)); + } +} + +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 => { diff --git a/src/types/stateInterfaces.ts b/src/types/stateInterfaces.ts index 0935c9f1..2a5a7d8f 100644 --- a/src/types/stateInterfaces.ts +++ b/src/types/stateInterfaces.ts @@ -71,6 +71,15 @@ export interface PlanningValidationDetails { error: string } +export interface SkipState { + datasetInstallation: boolean, + networking: boolean, + apfAuth: boolean, + security: boolean, + certificate: boolean, + launchConfig: boolean +} + 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++; + }) + } + }) +} + From 0ecd66e9ea58ce600a806f5ff980ea27f82922f7 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Thu, 16 May 2024 12:36:23 +0530 Subject: [PATCH 17/19] Updating the stepper --- src/renderer/components/common/Stepper.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/components/common/Stepper.tsx b/src/renderer/components/common/Stepper.tsx index deff4636..bbfb681e 100644 --- a/src/renderer/components/common/Stepper.tsx +++ b/src/renderer/components/common/Stepper.tsx @@ -174,7 +174,7 @@ export default function HorizontalLinearStepper({stages, initialization}:{stages const getStepIcon = (error: any, stageId: number, isSubStep?: boolean, subStepId?: number) => { - if ((isSubStep && !mapAndGetSkipStatus(subStepId)) || !error || (isSubStep && getProgress(stages[stageId].subStages[subStepId].statusKey)) || (!isSubStep && getProgress(stages[stageId].statusKey))) { + if (!error || (isSubStep && getProgress(stages[stageId].subStages[subStepId].statusKey)) || (!isSubStep && getProgress(stages[stageId].statusKey))) { return } />; } From 908e32ce8c897c3fceb30e58be3e677512bff5e9 Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Thu, 16 May 2024 16:46:04 +0530 Subject: [PATCH 18/19] retaining the install args --- .../components/stages/Certificates.tsx | 4 +- .../components/stages/InitApfAuth.tsx | 4 +- src/renderer/components/stages/Security.tsx | 4 +- .../stages/installation/Installation.tsx | 4 +- .../stages/installation/installationSlice.ts | 24 ++-------- .../stages/progress/StageProgressStatus.ts | 46 ++++++++++++++++++- src/types/stateInterfaces.ts | 20 +++++++- 7 files changed, 76 insertions(+), 30 deletions(-) diff --git a/src/renderer/components/stages/Certificates.tsx b/src/renderer/components/stages/Certificates.tsx index 7d5e3f62..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, mapAndSetSkipStatus } 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); diff --git a/src/renderer/components/stages/InitApfAuth.tsx b/src/renderer/components/stages/InitApfAuth.tsx index 9f38d360..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, mapAndSetSkipStatus } 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'; diff --git a/src/renderer/components/stages/Security.tsx b/src/renderer/components/stages/Security.tsx index 8003ce5e..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, mapAndSetSkipStatus } 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; diff --git a/src/renderer/components/stages/installation/Installation.tsx b/src/renderer/components/stages/installation/Installation.tsx index 3c7e1328..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, mapAndSetSkipStatus } 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; 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 1e07c49d..66187e1f 100644 --- a/src/renderer/components/stages/progress/StageProgressStatus.ts +++ b/src/renderer/components/stages/progress/StageProgressStatus.ts @@ -9,7 +9,7 @@ */ import { flatten, unflatten } from 'flat'; -import { ProgressState, PlanningState, InstallationType, ActiveState, DatasetInstallationState, InitSubStepsState, CertInitSubStepsState, PlanningValidationDetails, SkipState} 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 = { @@ -87,6 +87,26 @@ const stepSkipStatus: SkipState = { 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'; @@ -98,6 +118,7 @@ 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)[]; @@ -112,6 +133,7 @@ const setKeys = (id: string) => { certificateKey = `${certificateKey}_${id}`; planningValidationDetailsKey = `${planningValidationDetailsKey}_${id}`; skipStateKey = `${skipStateKey}_${id}`; + installationArgsKey = `${installationArgsKey}_${id}`; } export const initializeProgress = (host: string, user: string) => { @@ -177,6 +199,12 @@ export const initializeProgress = (host: string, user: string) => { 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 => { @@ -338,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) { diff --git a/src/types/stateInterfaces.ts b/src/types/stateInterfaces.ts index 2a5a7d8f..56a13a1f 100644 --- a/src/types/stateInterfaces.ts +++ b/src/types/stateInterfaces.ts @@ -80,7 +80,25 @@ export interface SkipState { 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 +}; From ba86c08730078de482bce8fbcb1b6b1ca511874b Mon Sep 17 00:00:00 2001 From: Sakshi Bobade Date: Thu, 16 May 2024 17:07:47 +0530 Subject: [PATCH 19/19] Updating the conn stage --- .../components/stages/connection/Connection.tsx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/renderer/components/stages/connection/Connection.tsx b/src/renderer/components/stages/connection/Connection.tsx index 7b44e5ce..1763e5b2 100644 --- a/src/renderer/components/stages/connection/Connection.tsx +++ b/src/renderer/components/stages/connection/Connection.tsx @@ -145,9 +145,7 @@ const FTPConnectionForm = () => { dispatch(setNextStepEnabled(true)); initializeProgress(connectionArgs.host, connectionArgs.user); initStageSkipStatus(); - if(isResume) { - resumeProgress(); - } + setYamlAndConfig(); } toggleFormProcessed(true); setValidationDetails(res.details); @@ -156,9 +154,9 @@ const FTPConnectionForm = () => { }); }; - const resumeProgress = () => { + const setYamlAndConfig = () => { window.electron.ipcRenderer.getConfig().then((res: IResponse) => { - if (res.status) { + if (res && res.status && res.details) { dispatch(setYaml(res.details.config)); const schema = res.details.schema; dispatch(setSchema(schema)); @@ -172,9 +170,12 @@ const FTPConnectionForm = () => { // schema response }); } - const { activeStepIndex, isSubStep, activeSubStepIndex, lastActiveDate } = getActiveStage(); - eventDispatcher.emit('updateActiveStep', activeStepIndex, isSubStep, activeSubStepIndex); - setIsResume(false); + const { activeStepIndex, isSubStep, activeSubStepIndex } = getActiveStage(); + + if(isResume) { + eventDispatcher.emit('updateActiveStep', activeStepIndex, isSubStep, activeSubStepIndex); + setIsResume(false); + } }) }