-
Notifications
You must be signed in to change notification settings - Fork 367
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
upcoming: [M3-7878] - Linode Create UI Refactor - Part 3 - Details Section #10297
upcoming: [M3-7878] - Linode Create UI Refactor - Part 3 - Details Section #10297
Conversation
Coverage Report: β
|
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 broke this out into its own component so that it can subscribe to region
state changes without causing the other fields (label
and tags
) to re-render. This is probably an over optimization, but I think it's still acceptable and clean. Open to feedback on this
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.
Understood - this may warrant component naming changes down the line but totally fine for now π
control={control} | ||
name="tags" | ||
/> | ||
{showPlacementGroups && <PlacementGroupPanel />} |
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 intentionally separated PlacementGroupPanel
out. Refer to my other comment
const { control } = useFormContext<CreateLinodeRequest>(); | ||
|
||
const regionId = useWatch({ control, name: 'region' }); |
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.
Oops!
You don't need to use useFormContext
for this. useWatch
will automatically use the context
@abailly-akamai Placement groups should be hooked up, but I haven't been able to test it with dev probably because of the API changes? Let me know if I need to adjust anything! |
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.
Nice work with this, so easy to follow now
@@ -29,6 +30,7 @@ export const LinodeCreatev2 = () => { | |||
const { mutateAsync: createLinode } = useCreateLinodeMutation(); | |||
|
|||
const onSubmit: SubmitHandler<CreateLinodeRequest> = async (data) => { | |||
alert(JSON.stringify(data, null, 2)); |
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'm guessing we're keeping this until the refactor is done, right?
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.
Yeah, I figured it wouldn't hurt to leave it in. It's helpful to see what payload is being sent.
It will 100% be removed before we get close to shipping this.
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.
Understood - this may warrant component naming changes down the line but totally fine for now π
packages/manager/src/features/Linodes/LinodeCreatev2/Details/PlacementGroupPanel.test.tsx
Show resolved
Hide resolved
packages/manager/src/features/Linodes/LinodeCreatev2/Details/PlacementGroupPanel.tsx
Show resolved
Hide resolved
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.
Carry on! looks good - thanks for the consideration for the placement group component and the test π
β¦bel-and-details
@bnussman-akamai |
I've noticed that as well and forgot to comment on the latest PR. We do need to add this back |
Description π
Preview π·
How to test π§ͺ
As an Author I have considered π€