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

Convert instance form #760

Merged
merged 39 commits into from
Apr 11, 2022
Merged

Convert instance form #760

merged 39 commits into from
Apr 11, 2022

Conversation

zephraph
Copy link
Contributor

@zephraph zephraph commented Apr 1, 2022

Fixes #734, #733, #732, #730, #331, #308

Converts the instance create form to the new form structure, implements a lot of missing UI, and wires up most of the form to the API. This is actually a rather large task and I won't be able to finish everything up in this one PR. I'll make issues for things that are deferred.

image

@zephraph zephraph self-assigned this Apr 1, 2022
@vercel
Copy link

vercel bot commented Apr 1, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/oxidecomputer/console-ui-storybook/FkAYrTSBXQJ9TKueGtosRqukREWH
✅ Preview: https://console-ui-storybook-git-update-instance-page-oxidecomputer.vercel.app

@github-actions
Copy link
Contributor

github-actions bot commented Apr 1, 2022

Preview will be deployed at https://console-git-update-instance-page.internal.oxide.computer

@zephraph zephraph force-pushed the update-instance-page branch from ef6c020 to 914efff Compare April 1, 2022 14:59
@zephraph zephraph temporarily deployed to Preview VM April 1, 2022 15:02 Inactive
@zephraph zephraph temporarily deployed to Preview VM April 1, 2022 15:58 Inactive
@zephraph zephraph temporarily deployed to Preview VM April 1, 2022 17:48 Inactive
@zephraph zephraph temporarily deployed to Preview VM April 1, 2022 20:36 Inactive
@zephraph zephraph temporarily deployed to Preview VM April 2, 2022 22:44 Inactive
@zephraph zephraph temporarily deployed to Preview VM April 4, 2022 01:22 Inactive
@zephraph zephraph temporarily deployed to Preview VM April 8, 2022 16:44 Inactive
@zephraph zephraph temporarily deployed to Preview VM April 8, 2022 17:41 Inactive
@david-crespo david-crespo temporarily deployed to Preview VM April 8, 2022 21:07 Inactive
* it works!

* fully inline disks MiniTable

* DisksTable -> DisksTableField

* move DisksTableField to its own file to reduce noise in instant create

* convert VPC subnets and delete useForm
@david-crespo david-crespo temporarily deployed to Preview VM April 9, 2022 04:41 Inactive
@david-crespo david-crespo temporarily deployed to Preview VM April 9, 2022 13:43 Inactive
const attachDisk = useApiMutation('instanceDisksAttach', {
onSuccess(data) {
const { instanceName, ...others } = pathParams
invariant(instanceName, 'instanceName is required')
Copy link
Collaborator

Choose a reason for hiding this comment

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

what does it mean to require instanceName at submit time but not at render time?

PrebuiltFormProps<infer V, any>
>
? V
: never
Copy link
Collaborator

@david-crespo david-crespo Apr 10, 2022

Choose a reason for hiding this comment

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

These types are complicated enough that it suggests to me we might be doing something we don't need to be doing, but I'm fine leaving it and mulling that over as we use it

Copy link
Collaborator

@david-crespo david-crespo left a comment

Choose a reason for hiding this comment

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

Let's go! Just a couple more comments here and there, no dealbreakers.

I could be wrong but I don't think this closes #730. If so, remove that from the description before merging so it doesn't get auto-closed. Also I'm not sure, but I think each issue needs its own "fixes" for the magic to work. Maybe not though.

<TextField
id="hostname"
description="Will be generated if not provided"
/>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since this is still not doing anything on the API side, it might make more sense to leave this field out for now and just pass the name value for hostname in the POST.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Given it's already in the API (even if not wired up yet) I think we should keep it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

K. I just put the issue for fixing this on the API side on our board. oxidecomputer/omicron#68

@zephraph zephraph temporarily deployed to Preview VM April 11, 2022 16:36 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment