-
Notifications
You must be signed in to change notification settings - Fork 357
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
Changes from all commits
5d8d563
97a00a7
b9cf65a
e0d7b0f
7a8505a
b5ca24f
acf7c93
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@linode/manager": Upcoming Features | ||
--- | ||
|
||
Add AGLB Routes - Rule Edit Drawer ([#9778](https://github.com/linode/manager/pull/9778)) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ import type { MatchField, Route } from '@linode/api-v4'; | |
|
||
interface Props { | ||
loadbalancerId: number; | ||
onEditRule: (ruleIndex: number) => void; | ||
route: Route; | ||
} | ||
|
||
|
@@ -42,7 +43,7 @@ const matchFieldMap: Record<MatchField, string> = { | |
const screenReaderMessage = | ||
'Some screen readers may require you to enter focus mode to interact with Loadbalancer rule list items. In focus mode, press spacebar to begin a drag or tab to access item actions.'; | ||
|
||
export const RulesTable = ({ loadbalancerId, route }: Props) => { | ||
export const RulesTable = ({ loadbalancerId, onEditRule, route }: Props) => { | ||
const { label, protocol, rules } = route; | ||
const theme = useTheme(); | ||
const { enqueueSnackbar } = useSnackbar(); | ||
|
@@ -146,10 +147,7 @@ export const RulesTable = ({ loadbalancerId, route }: Props) => { | |
> | ||
{(provided) => ( | ||
<li | ||
aria-label={ | ||
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 commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
aria-roledescription={screenReaderMessage} | ||
aria-selected={false} | ||
ref={provided.innerRef} | ||
|
@@ -158,7 +156,6 @@ export const RulesTable = ({ loadbalancerId, route }: Props) => { | |
{...provided.dragHandleProps} | ||
> | ||
<StyledRuleBox | ||
aria-label={`Rule ${rule.match_condition.hostname}`} | ||
key={index} | ||
sx={{ backgroundColor: theme.bg.bgPaper }} | ||
> | ||
|
@@ -219,22 +216,26 @@ export const RulesTable = ({ loadbalancerId, route }: Props) => { | |
}} | ||
aria-label={`Service Targets: ${rule.service_targets.length}`} | ||
> | ||
<TextTooltip | ||
displayText={String( | ||
rule.service_targets.length | ||
)} | ||
tooltipText={ | ||
<> | ||
{rule.service_targets.map( | ||
({ id, label }) => ( | ||
<div key={label}> | ||
{label}:{id} | ||
</div> | ||
) | ||
)} | ||
</> | ||
} | ||
/> | ||
{rule.service_targets.length > 0 ? ( | ||
<TextTooltip | ||
displayText={String( | ||
rule.service_targets.length | ||
)} | ||
tooltipText={ | ||
<> | ||
{rule.service_targets.map( | ||
({ id, label }) => ( | ||
<div key={label}> | ||
{label}:{id} | ||
</div> | ||
) | ||
)} | ||
</> | ||
} | ||
/> | ||
) : ( | ||
'None' | ||
)} | ||
</Box> | ||
</Hidden> | ||
<Hidden smDown> | ||
|
@@ -253,7 +254,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 commentThe reason will be displayed to describe this comment to others. Learn more. Fixes incorrect logic |
||
rule.match_condition.session_stickiness_ttl | ||
? 'Yes' | ||
: 'No'} | ||
|
@@ -270,7 +271,10 @@ export const RulesTable = ({ loadbalancerId, route }: Props) => { | |
{/** TODO: AGLB: The Edit and Delete Action menu behavior should be implemented in future AGLB tickets. */} | ||
<ActionMenu | ||
actionsList={[ | ||
{ onClick: () => null, title: 'Edit' }, | ||
{ | ||
onClick: () => onEditRule(index), | ||
title: 'Edit', | ||
}, | ||
{ | ||
disabled: index === 0, | ||
onClick: () => handleMoveUp(index), | ||
|
@@ -283,7 +287,7 @@ export const RulesTable = ({ loadbalancerId, route }: Props) => { | |
}, | ||
{ onClick: () => null, title: 'Remove' }, | ||
]} | ||
ariaLabel={`Action Menu for Rule ${rule.match_condition.match_value}`} | ||
ariaLabel={`Action Menu for Rule ${index}`} | ||
/> | ||
</Box> | ||
</StyledRuleBox> | ||
|
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.
This caused a UI regression. I don't think we want notices to have a background unless they are
important