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

upcoming: [M3-7925] - Linode Create Refactor - Add Firewall - Part 5 #10315

Conversation

bnussman-akamai
Copy link
Contributor

@bnussman-akamai bnussman-akamai commented Mar 25, 2024

Description πŸ“

  • Adds the ability to attach a Firewall to a Linode in the new Linode Create Flow πŸ”₯

Preview πŸ“·

Screenshot 2024-03-25 at 7 33 58β€―PM

How to test πŸ§ͺ

Prerequisites

  • Turn on the Linode Create v2 feature flag using the local dev tools

Verification steps

  • Test creating a Linode with a firewall attached
  • Verify you can create a Firewall from the Linode Create Flow
  • Verify functionality is the same as the existing create flow

As an Author I have considered πŸ€”

  • πŸ‘€ Doing a self review
  • ❔ Our contribution guidelines
  • 🀏 Splitting feature into small PRs
  • βž• Adding a changeset
  • πŸ§ͺ Providing/Improving test coverage
  • πŸ” Removing all sensitive information from the code and PR description
  • 🚩 Using a feature flag to protect the release
  • πŸ‘£ Providing comprehensive reproduction steps
  • πŸ“‘ Providing or updating our documentation
  • πŸ•› Scheduling a pair reviewing session
  • πŸ“± Providing mobile support
  • β™Ώ Providing accessibility support

@bnussman-akamai bnussman-akamai marked this pull request as ready for review March 26, 2024 13:28
@bnussman-akamai bnussman-akamai requested a review from a team as a code owner March 26, 2024 13:28
@bnussman-akamai bnussman-akamai requested review from carrillo-erik, hkhalil-akamai, jaalah-akamai and abailly-akamai and removed request for a team March 26, 2024 13:28
Comment on lines +45 to +55
<Autocomplete
disabled={isLinodeCreateRestricted}
errorText={fieldState.error?.message ?? error?.[0].reason}
label="Assign Firewall"
loading={isLoading}
noMarginTop
onChange={(e, firewall) => field.onChange(firewall?.id ?? null)}
options={firewalls ?? []}
placeholder="None"
value={selectedFirewall}
/>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm tempted to build a FirewallSelect. Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

Not a bad idea considering what we've done for others

Copy link
Contributor

Choose a reason for hiding this comment

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

Would SelectFirewallPanel be applicable here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could use SelectFirewallPanel and just wrap it in a controller, but I've been trying to make the new create flow more "pure".

I decided to write a new component to avoid the extra mapping and one off styling found in SelectFirewallPanel. We also get the ability to use useController without needing a "wrapping" component.

I'm open to re-using SelectFirewallPanel but I think I slightly prefer a dedicated component.

Copy link
Contributor

Choose a reason for hiding this comment

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

We'll probably use the FirewallSelect is several places too, so I'm good with creating a new component.

Copy link
Contributor

@abailly-akamai abailly-akamai left a comment

Choose a reason for hiding this comment

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

Code looks good and clean! Couple things to address:

  1. We're missing the firewall autocomplete value when creating the firewall on the spot (does not populate the select after having been created). This is a regression with the current behavior
  2. The placeholder for the select says "None", others on the create flow say ex: "Select a Placement Group". Coming to think of it, "None" feels right but we should pick one and be consistent.

Comment on lines +45 to +55
<Autocomplete
disabled={isLinodeCreateRestricted}
errorText={fieldState.error?.message ?? error?.[0].reason}
label="Assign Firewall"
loading={isLoading}
noMarginTop
onChange={(e, firewall) => field.onChange(firewall?.id ?? null)}
options={firewalls ?? []}
placeholder="None"
value={selectedFirewall}
/>
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a bad idea considering what we've done for others

@bnussman-akamai
Copy link
Contributor Author

I'm unable to reproduce 1 @abailly-akamai

For 2, I just copied the existing placeholder of "None". I don't mind it, but I can add this to the list of things to bring up with UX!

@abailly-akamai
Copy link
Contributor

@bnussman-akamai i see what happened with #1 - i was on Alpha and it took a couple seconds to appear. Unrelated to this PR and not blocking, but we could consider adding loading state for those selects eventually

Comment on lines +45 to +55
<Autocomplete
disabled={isLinodeCreateRestricted}
errorText={fieldState.error?.message ?? error?.[0].reason}
label="Assign Firewall"
loading={isLoading}
noMarginTop
onChange={(e, firewall) => field.onChange(firewall?.id ?? null)}
options={firewalls ?? []}
placeholder="None"
value={selectedFirewall}
/>
Copy link
Contributor

Choose a reason for hiding this comment

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

We'll probably use the FirewallSelect is several places too, so I'm good with creating a new component.

@jaalah-akamai jaalah-akamai added the Approved Multiple approvals and ready to merge! label Mar 26, 2024
@bnussman-akamai
Copy link
Contributor Author

Created M3-7933 for building a FirewallSelect

@bnussman-akamai bnussman-akamai merged commit efc2fb4 into linode:develop Mar 26, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved Multiple approvals and ready to merge! Linode Create Refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants