-
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
feat: [M3-7254] - Add AGLB Routes - Rule Edit Drawer #9778
feat: [M3-7254] - Add AGLB Routes - Rule Edit Drawer #9778
Conversation
alignItems: 'center', | ||
backgroundColor: theme.bg.bgPaper, |
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.
rule.match_condition.hostname ?? | ||
`Rule ${rule.match_condition.hostname}` | ||
} | ||
aria-label={`Rule ${index}`} |
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.
Is this change okay for accessibility? Rules don't have a solid way to uniquely identify them so I think index
is best here
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.
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 || |
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.
Fixes incorrect logic
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.
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:
- 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.
Not directly related to this PR:
- 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.
- 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.
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.
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}`} |
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.
Since order matters and hostname isn't unique, then I think the change makes sense.
|
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.
@bnussman-akamai
Approving, pending the typo I mentioned is addressed and follow up tickets are created.
- 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?
- 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.
- 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.
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.
Overall LGTM!
- Verified the functionality of editing a rule
- Verified add rule
- Verified re-order rules
* 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>
Description 📝
Preview 📷
How to test 🧪
Prerequisites
Verification steps
http://localhost:3000/loadbalancers/0/routes
As an Author I have considered 🤔
Check all that apply