Skip to content

Commit 2b3b3f8

Browse files
feat: [UIE-10505] IAM Parent/Child - pendo tags (#13530)
* upcoming: [UIE-10505] IAM Parent/Child - pendo tags * Added changeset: IAM: Add Pendo IDs for Parent/Child
1 parent 28d5bf9 commit 2b3b3f8

16 files changed

Lines changed: 157 additions & 3 deletions
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@linode/manager": Added
3+
---
4+
5+
IAM: Add Pendo IDs for Parent/Child ([#13530](https://github.com/linode/manager/pull/13530))

packages/manager/src/features/IAM/Delegations/AccountDelegationsTableRow.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { TableCell } from 'src/components/TableCell';
66
import { TableRow } from 'src/components/TableRow/TableRow';
77

88
import { usePermissions } from '../hooks/usePermissions';
9+
import { IAM_PARENT_USERS_PENDO_IDS } from '../Shared/constants';
910
import { TruncatedList } from '../Shared/TruncatedList';
1011
import { UpdateDelegationsDrawer } from './UpdateDelegationsDrawer';
1112

@@ -126,6 +127,7 @@ export const AccountDelegationsTableRow = ({ delegation, index }: Props) => {
126127
<InlineMenuAction
127128
actionText="Update Delegation"
128129
buttonHeight={40}
130+
data-pendo-id={IAM_PARENT_USERS_PENDO_IDS.updateDelegation}
129131
disabled={!permissions.update_delegate_users}
130132
onClick={handleUpdateDelegations}
131133
tooltip={

packages/manager/src/features/IAM/Delegations/UpdateDelegationForm.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import * as React from 'react';
2020
import { Controller, FormProvider, useForm } from 'react-hook-form';
2121

2222
import { usePermissions } from '../hooks/usePermissions';
23+
import { IAM_PARENT_USERS_PENDO_IDS } from '../Shared/constants';
2324
import { INTERNAL_ERROR_NO_CHANGES_SAVED } from '../Shared/constants';
2425
import { getPlaceholder } from '../Shared/Entities/utils';
2526

@@ -296,6 +297,7 @@ export const UpdateDelegationForm = ({
296297
primaryButtonProps={{
297298
'data-testid': 'submit',
298299
label: 'Save Changes',
300+
'data-pendo-id': IAM_PARENT_USERS_PENDO_IDS.updateDelegationSave,
299301
loading: isSubmitting,
300302
type: 'submit',
301303
disabled: !permissions?.update_delegate_users,

packages/manager/src/features/IAM/Roles/Defaults/DefaultRolesPanel.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { Box, Button, Paper, Typography } from '@linode/ui';
22
import { useNavigate } from '@tanstack/react-router';
33
import * as React from 'react';
44

5+
import { IAM_ROLES_PENDO_IDS } from '../../Shared/constants';
6+
57
export const DefaultRolesPanel = () => {
68
const navigate = useNavigate();
79

@@ -23,6 +25,7 @@ export const DefaultRolesPanel = () => {
2325
<Box>
2426
<Button
2527
buttonType="outlined"
28+
data-pendo-id={IAM_ROLES_PENDO_IDS.viewDefaultRoles}
2629
onClick={() => navigate({ to: '/iam/roles/defaults/roles' })}
2730
>
2831
View Default Roles

packages/manager/src/features/IAM/Roles/RolesTable/AssignSelectedRolesDrawer.tsx

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,12 @@ import { Link } from 'src/components/Link';
2323
import { StyledLinkButtonBox } from 'src/components/SelectFirewallPanel/SelectFirewallPanel';
2424
import { AssignSingleSelectedRole } from 'src/features/IAM/Roles/RolesTable/AssignSingleSelectedRole';
2525

26+
import { useDelegationRole } from '../../hooks/useDelegationRole';
2627
import { usePermissions } from '../../hooks/usePermissions';
27-
import { INTERNAL_ERROR_NO_CHANGES_SAVED } from '../../Shared/constants';
28+
import {
29+
IAM_ROLES_PENDO_IDS,
30+
INTERNAL_ERROR_NO_CHANGES_SAVED,
31+
} from '../../Shared/constants';
2832
import { DelegateUserChip } from '../../Shared/DelegateUserChip';
2933
import { mergeAssignedRolesIntoExistingRoles } from '../../Shared/utilities';
3034

@@ -47,6 +51,8 @@ export const AssignSelectedRolesDrawer = ({
4751
}: Props) => {
4852
const theme = useTheme();
4953

54+
const { isParentUserType } = useDelegationRole();
55+
5056
const values = {
5157
roles: selectedRoles.map((r) => ({
5258
role: {
@@ -213,7 +219,15 @@ export const AssignSelectedRolesDrawer = ({
213219
options={getUserOptions() || []}
214220
placeholder="Select a User"
215221
renderOption={(props, option) => (
216-
<li {...props} key={option.value}>
222+
<li
223+
{...props}
224+
data-pendo-id={
225+
option.userType === 'delegate'
226+
? IAM_ROLES_PENDO_IDS.assignSelectedRoleToUserDelegate
227+
: IAM_ROLES_PENDO_IDS.assignSelectedRoleToChildUser
228+
}
229+
key={option.value}
230+
>
217231
<Stack alignItems="center" direction="row" spacing={1}>
218232
<Typography>{option.label}</Typography>
219233
{option.userType === 'delegate' && <DelegateUserChip />}
@@ -223,6 +237,10 @@ export const AssignSelectedRolesDrawer = ({
223237
slotProps={{
224238
listbox: {
225239
onScroll: handleScroll,
240+
// @ts-expect-error - MUI doesn't have a built in way to add data attributes to the options in Autocomplete, so we need to add it to the listboxProps and then check for it in the onChange handler
241+
'data-pendo-id': isParentUserType
242+
? IAM_ROLES_PENDO_IDS.assignSelectedRoleToUserParent
243+
: IAM_ROLES_PENDO_IDS.assignSelectedRoleToUserDelegate,
226244
},
227245
}}
228246
textFieldProps={{
@@ -278,6 +296,8 @@ export const AssignSelectedRolesDrawer = ({
278296
primaryButtonProps={{
279297
'data-testid': 'submit',
280298
label: 'Assign',
299+
'data-pendo-id':
300+
IAM_ROLES_PENDO_IDS.assignSelectedRoleToUserAssign,
281301
type: 'submit',
282302
loading: isPending || formState.isSubmitting,
283303
}}

packages/manager/src/features/IAM/Roles/RolesTable/RolesTable.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import {
2929
import { usePaginationV2 } from 'src/hooks/usePaginationV2';
3030

3131
import { usePermissions } from '../../hooks/usePermissions';
32+
import { IAM_ROLES_PENDO_IDS } from '../../Shared/constants';
3233
import {
3334
ROLES_LEARN_MORE_LINK,
3435
ROLES_TABLE_PREFERENCE_KEY,
@@ -213,6 +214,7 @@ export const RolesTable = ({ roles = [] }: Props) => {
213214
</Grid>
214215
<Button
215216
buttonType="primary"
217+
data-pendo-id={IAM_ROLES_PENDO_IDS.assignSelectedRoles}
216218
disabled={selectedRows.length === 0 || !isAccountAdmin}
217219
onClick={() => handleAssignSelectedRoles()}
218220
sx={{ height: 34 }}
@@ -298,6 +300,10 @@ export const RolesTable = ({ roles = [] }: Props) => {
298300
selected={selectedRows.includes(roleRow)}
299301
>
300302
<TableCell
303+
// data-pendo-id={IAM_ROLES_PENDO_IDS.rolesChecked}
304+
{...(selectedRows.includes(roleRow) && {
305+
'data-pendo-id': IAM_ROLES_PENDO_IDS.rolesChecked,
306+
})}
301307
disabled={!isAccountAdmin}
302308
style={{
303309
wordBreak: 'break-word',

packages/manager/src/features/IAM/Roles/RolesTable/RolesTableActionMenu.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import * as React from 'react';
22

33
import { InlineMenuAction } from 'src/components/InlineMenuAction/InlineMenuAction';
44

5+
import { IAM_ROLES_PENDO_IDS } from '../../Shared/constants';
6+
57
interface Props {
68
canUpdateUserGrants: boolean;
79
onClick?: () => void;
@@ -16,6 +18,7 @@ export const RolesTableActionMenu = ({
1618
<InlineMenuAction
1719
actionText={'Assign Role'}
1820
buttonHeight={40}
21+
data-pendo-id={IAM_ROLES_PENDO_IDS.assignRole}
1922
disabled={!canUpdateUserGrants}
2023
onClick={onClick}
2124
sx={{

packages/manager/src/features/IAM/Shared/AssignedRolesTable/AssignedRolesActionMenu.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import React from 'react';
33
import { ActionMenu } from 'src/components/ActionMenu/ActionMenu';
44

55
import { useIsDefaultDelegationRolesForChildAccount } from '../../hooks/useDelegationRole';
6+
import { IAM_ROLES_PENDO_IDS } from '../constants';
67

78
import type { ExtendedRoleView } from '../types';
89
import type { PickPermissions } from '@linode/api-v4';
@@ -109,6 +110,11 @@ export const AssignedRolesActionMenu = ({
109110
<ActionMenu
110111
actionsList={actions}
111112
ariaLabel={`Action menu for role ${role.name}`}
113+
pendoId={
114+
isDefaultDelegationRolesForChildAccount
115+
? IAM_ROLES_PENDO_IDS.delegateUsersActionMenu
116+
: undefined
117+
}
112118
/>
113119
);
114120
};

packages/manager/src/features/IAM/Shared/AssignedRolesTable/AssignedRolesTable.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import { AssignedEntities } from '../../Users/UserRoles/AssignedEntities';
2727
import { AssignNewRoleDrawer } from '../../Users/UserRoles/AssignNewRoleDrawer';
2828
import {
2929
ASSIGNED_ROLES_TABLE_PREFERENCE_KEY,
30+
IAM_ROLES_PENDO_IDS,
3031
ROLES_LEARN_MORE_LINK,
3132
} from '../constants';
3233
import { Permissions } from '../Permissions/Permissions';
@@ -472,6 +473,11 @@ export const AssignedRolesTable = () => {
472473
<Grid sx={{ alignSelf: 'flex-start' }}>
473474
<Button
474475
buttonType="primary"
476+
data-pendo-id={
477+
isDefaultDelegationRolesForChildAccount
478+
? IAM_ROLES_PENDO_IDS.addNewDefaultRoles
479+
: undefined
480+
}
475481
disabled={!permissionToCheck}
476482
onClick={() => setIsAssignNewRoleDrawerOpen(true)}
477483
tooltipText={

packages/manager/src/features/IAM/Shared/NoAssignedRoles/NoAssignedRoles.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import EmptyState from 'src/assets/icons/empty-state-cloud.svg';
66
import { useIsDefaultDelegationRolesForChildAccount } from '../../hooks/useDelegationRole';
77
import { usePermissions } from '../../hooks/usePermissions';
88
import { AssignNewRoleDrawer } from '../../Users/UserRoles/AssignNewRoleDrawer';
9+
import { IAM_ROLES_PENDO_IDS } from '../constants';
910

1011
interface Props {
1112
hasAssignNewRoleDrawer: boolean;
@@ -54,6 +55,11 @@ export const NoAssignedRoles = (props: Props) => {
5455
{hasAssignNewRoleDrawer && (
5556
<Button
5657
buttonType="primary"
58+
data-pendo-id={
59+
isDefaultDelegationRolesForChildAccount
60+
? IAM_ROLES_PENDO_IDS.addNewDefaultRoles
61+
: undefined
62+
}
5763
disabled={!permissionToCheck}
5864
onClick={() => setIsAssignNewRoleDrawerOpen(true)}
5965
tooltipText={

0 commit comments

Comments
 (0)