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

UI Package Deploy Routing Refactor #1265

Merged
merged 22 commits into from
Jan 31, 2023

Conversation

Noxsios
Copy link
Contributor

@Noxsios Noxsios commented Jan 25, 2023

Description

This change completely reworks the navigation flow for deploying packages via the UI.

The current method is hardcoded to be /initialize/{operation}, the new flow enables for both the init package, as well as any package to be deployed via the UI utilizing the same flow.

  1. UI opens to /
  2. If uninitialized, user clicks Initialize Cluster link
  3. --> /package/deploy?path=init (for init ONLY, the path provided is init, otherwise path is a URL encoded full path to a zarf package)
  4. UI queries backend /packages/find-init and returns init package data
  5. Package data is loaded into pkgStore
  6. If no errors are encountered --> /package/[name]/configure where [name] is a URI encoded string from the package name; e.g. zarf-package-init-package-git-server-arm64.tar.zst --> /package/init-package-git-server-arm64/configure
  7. Deployment flow from here is unchanged as the previous flow was 90% ready as a generic package deployment flow (still some work to be done with this flow, but for now it works well enough)

This opens the door to a potential use case where a user might only open the UI to deploy a single package, then close it, ie: zarf package deploy [name].tar.zst --open-ui, which would provide a URL: http://localhost:{port}/deploy?path={path to package}

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Other (security config, docs update, etc)

Checklist before merging

@Noxsios
Copy link
Contributor Author

Noxsios commented Jan 26, 2023

demo-routing.mp4

@Noxsios Noxsios marked this pull request as ready for review January 26, 2023 02:43
@Noxsios Noxsios added this to the Zarf UI milestone Jan 26, 2023
@Noxsios Noxsios self-assigned this Jan 26, 2023
@Noxsios Noxsios changed the title UI Routing Refactor UI Package Deploy Routing Refactor Jan 26, 2023
Copy link
Contributor

@jeff-mccoy jeff-mccoy left a comment

Choose a reason for hiding this comment

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

left some notes

@netlify
Copy link

netlify bot commented Jan 30, 2023

Deploy Preview for zarf-docs ready!

Name Link
🔨 Latest commit 37fe595
🔍 Latest deploy log https://app.netlify.com/sites/zarf-docs/deploys/63d809f670cc560008898500
😎 Deploy Preview https://deploy-preview-1265--zarf-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Madeline-UX
Madeline-UX previously approved these changes Jan 30, 2023
Copy link
Contributor

@Madeline-UX Madeline-UX left a comment

Choose a reason for hiding this comment

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

Flow and url paths look good

Copy link
Contributor

@jeff-mccoy jeff-mccoy left a comment

Choose a reason for hiding this comment

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

lgtm

@jeff-mccoy jeff-mccoy merged commit ee52cb2 into main Jan 31, 2023
@jeff-mccoy jeff-mccoy deleted the razzle-rework-ui-package-deployment-routing branch January 31, 2023 01:44
Noxsios added a commit that referenced this pull request Mar 8, 2023
## Description

This change completely reworks the navigation flow for deploying
packages via the UI.

The current method is hardcoded to be `/initialize/{operation}`, the new
flow enables for **both** the init package, as well as any package to be
deployed via the UI utilizing the same flow.

1. UI opens to `/`
2. If uninitialized, user clicks `Initialize Cluster` link
3. --> `/package/deploy?path=init` (for init **ONLY**, the path provided
is `init`, otherwise path is a URL encoded full path to a zarf package)
4. UI queries backend `/packages/find-init` and returns init package
data
5. Package data is loaded into `pkgStore`
6. If no errors are encountered --> `/package/[name]/configure` where
`[name]` is a URI encoded string from the package name; e.g.
`zarf-package-init-package-git-server-arm64.tar.zst -->
/package/init-package-git-server-arm64/configure`
7. Deployment flow from here is unchanged as the previous flow was 90%
ready as a generic package deployment flow (still some work to be done
with this flow, but for now it works well enough)

This opens the door to a potential use case where a user might only open
the UI to deploy a single package, then close it, ie: `zarf package
deploy [name].tar.zst --open-ui`, which would provide a URL:
`http://localhost:{port}/deploy?path={path to package}`

## Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [X] New feature (non-breaking change which adds functionality)
- [ ] Other (security config, docs update, etc)

## Checklist before merging

- [x] Test, docs, adr added or updated as needed
- [X] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/CONTRIBUTING.md#developer-workflow)
followed

---------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants