Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Major Refactor #180

Merged
merged 139 commits into from
Jun 27, 2024
Merged

Major Refactor #180

merged 139 commits into from
Jun 27, 2024

Conversation

timgerstel
Copy link
Contributor

@timgerstel timgerstel commented Jun 12, 2024

  1. Make sure yaml and schema are ALWAYS set
  2. Change the description of smpe on the "Installation Type" stage as per @struga0258 's suggestion
  3. Wrap all global variables in components in useState() to reduce memory cost *Edit: this is still here but it was actually useless lol
  4. Fix scrolling on most stages
  5. Fix Initialization stage status not updating when all substeps are complete
  6. Add popup messages for upload yaml button on Launch Config/Networking stages
  7. Make editor use entire Zowe schema
  8. Use more Constants.tsx
  9. Add ability to retrieve example-zowe.yaml and JSON schemas when using SMPE mode
  10. Remove duplicate and unused vars
  11. Fix cursor jumping to end of port input on networking stage
  12. "Skip" on Unpax stage now fetches example-zowe.yaml and schemas
  13. Integrate @skurnevich's method of downloading example-zowe.yaml and schemas instead of parsing cat commands🐈
  14. Fix upload not working
  15. Fix improper merging of example-zowe.yaml and current config thanks to @skurnevich deep merge method
  16. Remove unused imports
  17. Reduce duplication
  18. Remove unused or unnecessary function args
  19. Fix schema errors
  20. Fix difference between smpe install dir and download/upload. Download/upload will no longer unpax to /runtime
  21. Fix makeDir infinite loop on planning stage with invalid dirs
  22. Fix yaml encoding so that zwe start can be run
  23. Make editor wider
  24. Fix certificates stage resetting zowe.setup.certificate values when changing zowe.verifyCertificates
  25. Increase editor width and height
  26. Probably more i forgot

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Change in a documentation
  • Refactor the code
  • Chore, repository cleanup, updates the dependencies.
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

PR Checklist

Please delete options that are not relevant.

  • If the changes in this PR are meant for the next release / mainline, this PR targets a "staging" branch.
  • My code follows the style guidelines of this project (see: Contributing guideline)
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • New and existing unit tests pass locally with my changes
  • video or image is included if visual changes are made
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works, or describe a test method below

Testing

Further comments

Signed-off-by: Timothy Gerstel <[email protected]>
…e editor was making things too tedious given the deadline

Signed-off-by: Timothy Gerstel <[email protected]>
Signed-off-by: Timothy Gerstel <[email protected]>
Signed-off-by: Timothy Gerstel <[email protected]>
…, and installation args are now set on the Home component. Wrap naked component global vars in useState calls. Fix auto scrolling when a stage has been complete

Signed-off-by: Timothy Gerstel <[email protected]>
Signed-off-by: Timothy Gerstel <[email protected]>
Signed-off-by: Timothy Gerstel <[email protected]>
Signed-off-by: Timothy Gerstel <[email protected]>
Signed-off-by: Timothy Gerstel <[email protected]>
…perly, remove unneeded ipcRenderer hooks

Signed-off-by: Timothy Gerstel <[email protected]>
Signed-off-by: Timothy Gerstel <[email protected]>
Signed-off-by: Timothy Gerstel <[email protected]>
Signed-off-by: Timothy Gerstel <[email protected]>
Signed-off-by: Timothy Gerstel <[email protected]>
Signed-off-by: Timothy Gerstel <[email protected]>
Signed-off-by: Timothy Gerstel <[email protected]>
@skurnevich
Copy link
Collaborator

skurnevich commented Jun 13, 2024

Does not work for me:

Local pax file uploading fails
Screenshot 2024-06-13 at 14 34 53

While downloading pax fails on schema parsing

14:43:42.429 › error setting schema from pax: SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)

For the last one i have created the PR 179 to replace cat command output parsing with files downloading.
You can merge it first, or incorporate changes into this PR. The factual change is smaller than it looks, you just need to replace readExampleYamlAndSchema function and remove parseExampleYamlFromPax blocks as downloaded yaml and json files are ready to use

@skurnevich
Copy link
Collaborator

Hi @timgerstel is this PR ready for review/merge or would you like to add more changes?

@DivergentEuropeans
Copy link
Member

Created PR: #194

DivergentEuropeans and others added 19 commits June 24, 2024 15:19
Revert create recursive dirs + add edgecase
Signed-off-by: Timothy Gerstel <[email protected]>
Signed-off-by: Timothy Gerstel <[email protected]>
…t longer attempt to create these

Signed-off-by: Timothy Gerstel <[email protected]>
Signed-off-by: Timothy Gerstel <[email protected]>
Signed-off-by: Timothy Gerstel <[email protected]>
Signed-off-by: Timothy Gerstel <[email protected]>
Signed-off-by: Timothy Gerstel <[email protected]>
Signed-off-by: Leanid Astrakou <[email protected]>
Reset counter properly + don't forget the current char
Signed-off-by: Leanid Astrakou <[email protected]>
Signed-off-by: Timothy Gerstel <[email protected]>
ipcMain.handle('download-unpax', async (event, connectionArgs, installationArgs, version, zoweConfig) => {
const res = await installActions.downloadUnpax(connectionArgs, installationArgs, version, zoweConfig);
ipcMain.handle('get-yaml-schema', async (event, connectionArgs, installationArgs) => {
const res = await installActions.smpeGetExampleYamlAndSchemas(connectionArgs, installationArgs);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be called "getExampleYamlAndSchemas"

I only see this used in 2 places, 1 in Stepper which is conditional to not SMPE and 2 in
Unpax step which is also not SMPE

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

<Card id={`card-${id}`} square={true} >
<Link key={`link-${id}`} to={link} >
<Box sx={{ width: '40vw', height: '40vh'}} onClick={(e) => {
const flattenedData = flatten(lastActiveState);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lastActiveState is already a flat object with no nested properties, at a quick glance, don't see it set anywhere. Is this essential?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah youre right but that's pretty minor i dont that one time call when the user clicks "new installation" would cause a noticeable performance impact

src/renderer/components/Home.tsx Show resolved Hide resolved
const STAGE_ID = getStageDetails(stageLabel).id;
const SUB_STAGES = !!getStageDetails(stageLabel).subStages;
const SUB_STAGE_ID = SUB_STAGES ? getSubStageDetails(STAGE_ID, subStageLabel).id : 0;
const [STAGE_ID] = useState(getStageDetails(INIT_STAGE_LABEL).id);

This comment was marked as resolved.

"minimum": 0,
"maximum": 65535,
"description": "Port number of how you access Zowe APIML Gateway from your local computer."
const schema: any = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if BASE_SCHEMA is AJV "fixed", can't we remove the schemas in Networking + Launch Config and use BASE_SCHEMA? Or lmk I might be missing something

src/renderer/components/stages/Networking.tsx Show resolved Hide resolved
} else {
console.warn('zwe init security failed', err?.toString()); // toString() throws run-time error on undefined or null
}
window.electron.ipcRenderer.setStandardOutput(`zwe init security failed: ${typeof err === "string" ? err : err.toString()}`).then((res: any) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this was tested, then you want to add:
alertEmitter.emit('showAlert', 'Please view Job Output for more details', 'error');

Copy link
Contributor Author

@timgerstel timgerstel Jul 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if BASE_SCHEMA is AJV "fixed", can't we remove the schemas in Networking + Launch Config and use BASE_SCHEMA? Or lmk I might be missing something

No because the networking stage had some caveats that required its own schema which is modified from the one packaged with Zowe, maybe it can now be amended ill have to look into it

src/renderer/components/stages/Unpax.tsx Show resolved Hide resolved
Signed-off-by: Timothy Gerstel <[email protected]>
Signed-off-by: Timothy Gerstel <[email protected]>
Signed-off-by: Timothy Gerstel <[email protected]>
Signed-off-by: Timothy Gerstel <[email protected]>
@DivergentEuropeans DivergentEuropeans merged commit 5c46605 into v2.x/staging Jun 27, 2024
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

3 participants