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

feat: [M3-7254] - Add AGLB Routes - Rule Edit Drawer #9778

Merged

Conversation

bnussman-akamai
Copy link
Member

@bnussman-akamai bnussman-akamai commented Oct 10, 2023

Description 📝

  • Allows users to edit AGLB Route rules ✏️

Preview 📷

Screenshot 2023-10-10 at 1 21 49 PM

How to test 🧪

Prerequisites

  • Turn on the MSW

Verification steps

  • Go to http://localhost:3000/loadbalancers/0/routes
  • Test the general functionality of editing a rule
  • Verify you can still add a rule
  • Verify you can still re-order rules

As an Author I have considered 🤔

Check all that apply

  • 👀 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 added the ACLB Relating to the Akamai Cloud Load Balancer label Oct 10, 2023
@bnussman-akamai bnussman-akamai self-assigned this Oct 10, 2023
@bnussman-akamai bnussman-akamai marked this pull request as ready for review October 10, 2023 18:06
@bnussman-akamai bnussman-akamai requested a review from a team as a code owner October 10, 2023 18:06
@bnussman-akamai bnussman-akamai requested review from mjac0bs and hana-akamai and removed request for a team October 10, 2023 18:06
alignItems: 'center',
backgroundColor: theme.bg.bgPaper,
Copy link
Member Author

Choose a reason for hiding this comment

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

This caused a UI regression. I don't think we want notices to have a background unless they are important

Screenshot 2023-10-10 at 2 17 36 PM

rule.match_condition.hostname ??
`Rule ${rule.match_condition.hostname}`
}
aria-label={`Rule ${index}`}
Copy link
Member Author

Choose a reason for hiding this comment

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

Is this change okay for accessibility? Rules don't have a solid way to uniquely identify them so I think index is best here

Copy link
Contributor

Choose a reason for hiding this comment

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

Since order matters and hostname isn't unique, then I think the change makes sense.

@@ -253,7 +250,7 @@ export const RulesTable = ({ loadbalancerId, route }: Props) => {
}}
>
{rule.match_condition
.session_stickiness_cookie &&
.session_stickiness_cookie ||
Copy link
Member Author

Choose a reason for hiding this comment

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

Fixes incorrect logic

Copy link
Contributor

@mjac0bs mjac0bs left a comment

Choose a reason for hiding this comment

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

Overall, adding, editing, and reordering rules looks good. The drawer works in add and edit mode. The UI updates accordingly, populates the form with data in edit mode, and displays the updates in the table after the request is submitted.

A few questions (sorry if these have already been addressed in past PRs -- would appreciate a reminder):

Related directly to this PR:

  1. Is the API spec for the request payload for PUT /v4beta/aglb/{id}/routes/{id} out of date? I noticed some slight discrepancies.
  • API spec includes route label in the request; our request payload in Cloud does not.
  • API spec does not include service target label in the request; our payload in Cloud does.

Screenshot 2023-10-11 at 12 19 42 PM

Not directly related to this PR:

  1. Have we talked about expanding the width of this tooltip? It's a lot of text and a little hard to read with how thin it is.

Screenshot 2023-10-11 at 12 25 33 PM

  1. Should we add some logic to not display the tooltip on rules where there are no service targets? Currently, we display a blank tooltip popover, which is a little weird.

Screenshot 2023-10-11 at 12 25 16 PM

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we fix the typo in the helper text for TCP rules?

"A TCP rule consists a percent allocation to a Service Target." -> "A TCP rule consists of a percent allocation to a Service Target."

rule.match_condition.hostname ??
`Rule ${rule.match_condition.hostname}`
}
aria-label={`Rule ${index}`}
Copy link
Contributor

Choose a reason for hiding this comment

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

Since order matters and hostname isn't unique, then I think the change makes sense.

@bnussman-akamai
Copy link
Member Author

bnussman-akamai commented Oct 11, 2023

@mjac0bs

  1. We do have label in the PUT request type but we don't need it in the actual requets. All Linode API PUTs assume all fields are optional. You are correct about the fact service target should not have label as a type but I hesitate to fix it as part of this PR because it will add a significant amount of code.
  2. I wanted to expand the tooltip but at the time of its creation it wasn't possible. @abailly-akamai said I should be able to widen it after feat: [M3-7114] - Allow user to choose resize migration type when resizing Linode #9677 but I don't think this is true because feat: [M3-7114] - Allow user to choose resize migration type when resizing Linode #9677 didn't touch the TextField component
  3. I'll see if I can add something for the empty state or just hide the tooltip

Copy link
Contributor

@mjac0bs mjac0bs left a comment

Choose a reason for hiding this comment

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

@bnussman-akamai
Approving, pending the typo I mentioned is addressed and follow up tickets are created.

  1. We do have label in the PUT request type but we don't need it in the actual requets. All Linode API PUTs assume all fields are optional.

Oops, yeah, you're right!

You are correct about the fact service target should not have label as a type but I hesitate to fix it as part of this PR because it will add a significant amount of code.

That's fair and a good call about not wanting to expand the scope of this PR. Can we make a follow up ticket for this?

  1. I wanted to expand the tooltip but at the time of its creation it wasn't possible. @abailly-akamai said I should be able to widen it after feat: [M3-7114] - Allow user to choose resize migration type when resizing Linode #9677 but I don't think this is true because feat: [M3-7114] - Allow user to choose resize migration type when resizing Linode #9677 didn't touch the TextField component

Good context -- thank you for looking into and linking. I felt like this had been discussed before, but didn't remember exactly where. TBH, I don't understand how this styled component is working, but I see it in Storybook... a template literal tacked on after the styled function? Didn't know you could do that.

It looks like TextfField has a tooltipClasses prop and we've used that in the past to pass in a minWidth... but from what I can tell, it seems like this is not actually working on the label field Database Create form.

Anyway, this is minor and not worth holding up the PR over or expanding the scope too much. (Unless @jaalah-akamai can help do this cleanly.) A follow up ticket would be nice to address at some point in the future since it sounds like we're in consensus that wider is better.

  1. I'll see if I can add something for the empty state or just hide the tooltip

Empty state of "None" looks good now; thanks for the add.

@mjac0bs mjac0bs added the Add'tl Approval Needed Waiting on another approval! label Oct 12, 2023
Copy link
Contributor

@cpathipa cpathipa left a comment

Choose a reason for hiding this comment

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

Overall LGTM!

  • Verified the functionality of editing a rule
  • Verified add rule
  • Verified re-order rules

@bnussman-akamai bnussman-akamai added Approved Multiple approvals and ready to merge! and removed Add'tl Approval Needed Waiting on another approval! labels Oct 17, 2023
@bnussman-akamai bnussman-akamai merged commit 609c64b into linode:develop Oct 17, 2023
12 of 13 checks passed
abailly-akamai pushed a commit to abailly-akamai/manager that referenced this pull request Oct 17, 2023
* initial edit flow and e2e test

* fix notice regression

* a few small fixes

* Added changeset: Add AGLB Routes - Rule Edit Drawer

* add empty state for no service targets

---------

Co-authored-by: Banks Nussman <banks@nussman.us>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ACLB Relating to the Akamai Cloud Load Balancer Approved Multiple approvals and ready to merge!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants