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

Choose custom router on subnet create/edit forms #2393

Merged
merged 15 commits into from
Aug 22, 2024

Conversation

charliepark
Copy link
Contributor

@charliepark charliepark commented Aug 21, 2024

Add a field on the subnet create/edit form, enabling linking a custom router to the subnet.

Screenshot 2024-08-21 at 9 53 36 AM

Fixes #2379

Copy link

vercel bot commented Aug 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
console ✅ Ready (Inspect) Visit Preview Aug 22, 2024 11:25pm

@david-crespo david-crespo changed the title Allow user to link custom router to subnet from subnet create/edit forms Choose custom router on subnet create/edit forms Aug 22, 2024
await expect(rows.nth(1).getByText('10.1.1.2/24')).toBeVisible()
// little hack to catch a bug where we weren't handling empty input here properly
await dialog.getByRole('textbox', { name: 'IPv6 block' }).fill('abc')
await dialog.getByRole('textbox', { name: 'IPv6 block' }).clear()
Copy link
Collaborator

@david-crespo david-crespo Aug 22, 2024

Choose a reason for hiding this comment

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

Confirmed this bit breaks the test without the fix for the ipv6Block field. This is a bug in v9!

image

@david-crespo david-crespo marked this pull request as ready for review August 22, 2024 22:18
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.

I think this is solid. I like the string sentinel value pattern for a clearable listbox. It might make sense to build this logic into the listbox field itself somehow, so we don't have to manually wire up the conversion between form values and JSON values. On the other hand, it seems like the way we're doing it is kinda how you're supposed to do it — RHF doesn't seem to like it when you try to store the processed maybe-not-a-string value in the form state.

@charliepark charliepark enabled auto-merge (squash) August 22, 2024 23:25
@charliepark charliepark merged commit 8028f9a into main Aug 22, 2024
8 checks passed
@charliepark charliepark deleted the add-router-to-subnet-form branch August 22, 2024 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Subnet: Show linked custom router
2 participants