From a7225f0f27bd14bd5bc824a674b2415fc8395d1d Mon Sep 17 00:00:00 2001 From: hasyed-akamai Date: Fri, 1 Nov 2024 20:54:11 +0530 Subject: [PATCH] fix: [M3-8743] - fix aria label of action menu in IP address table row. (#11167) * fix: [M3-8743] - fix aria label of action menu in IP address table row. * Added changeset: fix aria label of action menu button in IP address table row. * Update changeset Description. Co-authored-by: Mariah Jacobs <114685994+mjac0bs@users.noreply.github.com> * remove the optional chaining '?' Co-authored-by: Mariah Jacobs <114685994+mjac0bs@users.noreply.github.com> * Make ipAddress prop required. * remove ipAddress check in condition Co-authored-by: Banks Nussman <115251059+bnussman-akamai@users.noreply.github.com> --------- Co-authored-by: Mariah Jacobs <114685994+mjac0bs@users.noreply.github.com> Co-authored-by: Banks Nussman <115251059+bnussman-akamai@users.noreply.github.com> --- .../.changeset/pr-11167-fixed-1730095848948.md | 5 +++++ .../LinodeNetworkingActionMenu.tsx | 15 ++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 packages/manager/.changeset/pr-11167-fixed-1730095848948.md diff --git a/packages/manager/.changeset/pr-11167-fixed-1730095848948.md b/packages/manager/.changeset/pr-11167-fixed-1730095848948.md new file mode 100644 index 00000000000..1aeb90eeca0 --- /dev/null +++ b/packages/manager/.changeset/pr-11167-fixed-1730095848948.md @@ -0,0 +1,5 @@ +--- +"@linode/manager": Fixed +--- + +aria label of action menu button in IP address table row ([#11167](https://github.com/linode/manager/pull/11167)) diff --git a/packages/manager/src/features/Linodes/LinodesDetail/LinodeNetworking/LinodeNetworkingActionMenu.tsx b/packages/manager/src/features/Linodes/LinodesDetail/LinodeNetworking/LinodeNetworkingActionMenu.tsx index 0bb9e1ac7ae..d5afac3024a 100644 --- a/packages/manager/src/features/Linodes/LinodesDetail/LinodeNetworking/LinodeNetworkingActionMenu.tsx +++ b/packages/manager/src/features/Linodes/LinodesDetail/LinodeNetworking/LinodeNetworkingActionMenu.tsx @@ -14,7 +14,7 @@ import type { Theme } from '@mui/material/styles'; import type { Action } from 'src/components/ActionMenu/ActionMenu'; interface Props { - ipAddress?: IPAddress | IPRange; + ipAddress: IPAddress | IPRange; ipType: IPTypes; isOnlyPublicIP: boolean; isVPCOnlyLinode: boolean; @@ -59,6 +59,14 @@ export const LinodeNetworkingActionMenu = (props: Props) => { ? 'Linodes must have at least one public IP' : undefined; + const getAriaLabel = (): string => { + if ('address' in ipAddress) { + return `Action menu for IP Address ${ipAddress.address}`; + } else { + return `Action menu for IP Address ${ipAddress.range}`; + } + }; + const actions = [ onRemove && ipAddress && !is116Range && deletableIPTypes.includes(ipType) ? { @@ -110,10 +118,7 @@ export const LinodeNetworkingActionMenu = (props: Props) => { ); })} {matchesMdDown && ( - + )} ) : (