-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dataset Validation On Installation Stage #233
Conversation
Signed-off-by: Sakshi Bobade <[email protected]>
for (const key of Object.keys(setupYaml)) { | ||
let value = setupYaml[key]; | ||
|
||
if (typeof value === 'object' && value !== null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this part is hardcoded to the current state of zowe.yaml, assuming that there is just one value in the parmlibMembers object - {zis: ZWESIP00}.
If we add one more value there later it would not be validated, so instead we should recursively go to validateDatasets with that new object or flatten data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updates this. Thank you.
return false; | ||
} | ||
} | ||
if(Object.keys(setupYaml).length < 8) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, now we have 8 values there but it can easily change, moreover for instance zowe.setup.dataset.authLoadlib is actually optional.
This better to be controlled by schema, but i can't see it for zowe.setup.dataset, so i guess for now we can remove hardcoded numbers and just validate it in the UI by not allowing empty values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed these changes. Thank you.
<JsonForm schema={setupSchema} onChange={handleFormChange} formData={setupYaml}/> | ||
{!isFormValid && formError && | ||
<div style={{ display: 'flex', marginBottom: '10px' }}> | ||
<ErrorIcon color="error" sx={{ fontSize: 20 }}/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we have some unified errors popup in the header? why we have different approach here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I initially considered displaying the form errors right below the form after clicking "Install MVS Datasets." However, let's stick to using the unified error messages in the header instead.
Update this. Thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, however, in future i would prefer it to be validated via schema like https://github.com/zowe/zowe-install-packaging/blob/v2.x/staging/schemas/server-common.json#L39
But we need to update schema for that
Proposed changes
This PR addresses Issue: This PR adds the dataset validations on the installation stage
This PR depends upon the following PRs:
Type of change
Please delete options that are not relevant.
PR Checklist
Please delete options that are not relevant.
Testing
Further comments