Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Upcoming Features
---

Add pendo ids for VM Host Maintenance analytics ([#12983](https://github.com/linode/manager/pull/12983))
8 changes: 8 additions & 0 deletions packages/manager/src/components/Link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ export interface LinkProps extends Omit<_LinkProps, 'to'> {
* Optional prop to pass a onClick handler to the link.
*/
onClick?: (e: React.MouseEvent<HTMLAnchorElement>) => void;
/**
* Optional prop to pass a pendo id to the link.
*/
pendoId?: string;
/**
* Optional prop to pass a sx style to the link.
*/
Expand Down Expand Up @@ -99,6 +103,7 @@ export const Link = React.forwardRef<HTMLAnchorElement, LinkProps>(
forceCopyColor,
hideIcon,
onClick,
pendoId,
style,
title,
to,
Expand Down Expand Up @@ -131,6 +136,7 @@ export const Link = React.forwardRef<HTMLAnchorElement, LinkProps>(
'external',
'forceCopyColor',
'to',
'pendoId',
]);

return shouldOpenInNewTab ? (
Expand All @@ -143,6 +149,7 @@ export const Link = React.forwardRef<HTMLAnchorElement, LinkProps>(
},
className
)}
data-pendo-id={pendoId}
data-testid={external ? 'external-site-link' : 'external-link'}
href={processedUrl()}
onClick={onClick}
Expand All @@ -166,6 +173,7 @@ export const Link = React.forwardRef<HTMLAnchorElement, LinkProps>(
) : (
<RouterLink
aria-label={ariaLabel}
data-pendo-id={pendoId}
data-testid="internal-link"
{...routerLinkProps}
className={cx(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,13 @@ export const LinodeMaintenanceBanner = ({ linodeId }: Props) => {
)}
</strong>
. For more details, view{' '}
<Link to="/account/maintenance">Account Maintenance</Link>.
<Link
pendoId="linode-maintenance-banner-link"
to="/account/maintenance"
>
Account Maintenance
</Link>
.
</Typography>
</Notice>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ export const MaintenanceBannerV2 = () => {
<span data-testid="maintenance-link-section">
{' '}
For more details, view{' '}
<Link to="/maintenance">Account Maintenance</Link>.
<Link pendoId="maintenance-banner-link" to="/maintenance">
Account Maintenance
</Link>
.
</span>
)}
</Typography>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export const MaintenancePolicySelect = (

return (
<Autocomplete
data-pendo-id="maintenance-policy-select"
disableClearable={!!selectedOption}
disabled={disabled}
errorText={errorText}
Expand All @@ -75,7 +76,7 @@ export const MaintenancePolicySelect = (
renderOption={(props, policy, state) => {
const { key } = props;
return (
<li {...props} key={key}>
<li {...props} data-pendo-id={policy.slug} key={key}>
<Stack gap={0.5} width="100%">
<Stack
alignItems="center"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ export const PlatformMaintenanceBanner = () => {
<span data-testid="platform-maintenance-link-section">
{' '}
See which Linodes are <strong>scheduled</strong> for reboot on the{' '}
<Link to="/maintenance">Account Maintenance</Link> page.
<Link pendoId="platform-maintenance-banner-link" to="/maintenance">
Account Maintenance
</Link>{' '}
page.
</span>
)}
</Typography>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export const MaintenancePolicy = () => {
<Box marginTop={2}>
<Button
buttonType="outlined"
data-pendo-id="maintenance-policy-save-button"
disabled={!isDirty || !permissions.update_account_settings}
loading={isSubmitting}
type="submit"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,13 @@ export const MaintenancePolicy = () => {
subHeading={
<>
{MAINTENANCE_POLICY_DESCRIPTION}{' '}
<Link to={MAINTENANCE_POLICY_LEARN_MORE_URL}>Learn more</Link>.
<Link
data-pendo-id="linode-create-maintenance-policy-learn-more"
to={MAINTENANCE_POLICY_LEARN_MORE_URL}
>
Learn more
</Link>
.
</>
}
summaryProps={{ sx: { p: 0 } }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,13 @@ export const LinodeSettingsMaintenancePolicyPanel = (props: Props) => {
<Stack spacing={2}>
<Typography>
{MAINTENANCE_POLICY_DESCRIPTION}{' '}
<Link to={MAINTENANCE_POLICY_LEARN_MORE_URL}>Learn more</Link>.
<Link
data-pendo-id="linode-detail-maintenance-policy-learn-more"
to={MAINTENANCE_POLICY_LEARN_MORE_URL}
>
Learn more
</Link>
.
</Typography>
{showUpcomingMaintenanceNotice && (
<Notice variant="warning">
Expand Down Expand Up @@ -133,6 +139,7 @@ export const LinodeSettingsMaintenancePolicyPanel = (props: Props) => {
<Box>
<Button
buttonType="outlined"
data-pendo-id="linode-maintenance-policy-save-button"
disabled={!isDirty || isDisabled}
loading={isSubmitting}
type="submit"
Expand Down