Skip to content

Commit bffcecc

Browse files
pmakode-akamaitvijay-akamaiharsh-akamai
authored
upcoming: [UIE-9670] - Add Pendo IDs for Marketplace Filter Options and Product Cards (#13393)
* Add missing pendo ids * Added changeset: Add Pendo IDs for Marketplace filter options and product cards * Some refactoring... * fix pendo id for contact sales drawer's show details button --------- Co-authored-by: tvijay-akamai <51293194+tvijay-akamai@users.noreply.github.com> Co-authored-by: Harsh Shankar Rao <hrao@akamai.com>
1 parent 51b3d92 commit bffcecc

File tree

5 files changed

+44
-1
lines changed

5 files changed

+44
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@linode/manager": Upcoming Features
3+
---
4+
5+
Add Pendo IDs for Marketplace filter options and product cards ([#13393](https://github.com/linode/manager/pull/13393))

packages/manager/src/components/SelectionCard/SelectionCard.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ export interface SelectionCardProps {
2020
* Additional CSS classes to apply to the root element.
2121
*/
2222
className?: string;
23+
/**
24+
* An optional data-pendo-id for analytics tracking
25+
*/
26+
'data-pendo-id'?: string;
2327
/**
2428
* An optional custom data-testid
2529
* @default selection-card
@@ -172,6 +176,7 @@ export const SelectionCard = React.memo((props: SelectionCardProps) => {
172176
const cardGrid = (
173177
<StyledGrid
174178
className={className}
179+
data-pendo-id={props['data-pendo-id']}
175180
data-qa-selection-card
176181
data-qa-selection-card-checked={checked}
177182
data-testid={props['data-testid'] ?? 'selection-card'}

packages/manager/src/features/Marketplace/MarketplaceLanding/MarketplaceLanding.tsx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
Box,
55
ErrorState,
66
LinkButton,
7+
SelectedIcon,
78
Stack,
89
Typography,
910
} from '@linode/ui';
@@ -21,6 +22,7 @@ import { CategorySection } from './CategorySection';
2122
import { filterProducts } from './utils';
2223

2324
import type { Category, Product, Type } from '../shared';
25+
import type { AutocompleteRenderOptionState } from '@mui/material';
2426

2527
export const MarketplaceLanding = () => {
2628
const navigate = useNavigate();
@@ -88,6 +90,34 @@ export const MarketplaceLanding = () => {
8890
updateSearchParam('query', searchString || undefined);
8991
};
9092

93+
const renderAutocompleteOption = React.useCallback(
94+
(prefix: string) =>
95+
(
96+
props: React.HTMLAttributes<HTMLLIElement> & { key: string },
97+
option: { label: string },
98+
state: AutocompleteRenderOptionState
99+
) => {
100+
const { key, ...rest } = props;
101+
return (
102+
<li
103+
{...rest}
104+
data-pendo-id={`Cloud Marketplace Catalog-${option.label}`}
105+
key={`${prefix}-${key}`}
106+
>
107+
<Box
108+
sx={{
109+
flexGrow: 1,
110+
}}
111+
>
112+
{option.label}
113+
</Box>
114+
<SelectedIcon visible={state.selected} />
115+
</li>
116+
);
117+
},
118+
[]
119+
);
120+
91121
// Filter products here based on category, search and type filters. If no filters are set, shows all available products.
92122
const filteredProducts = React.useMemo(
93123
() =>
@@ -208,6 +238,7 @@ export const MarketplaceLanding = () => {
208238
}
209239
options={categoryOptions}
210240
placeholder="Category"
241+
renderOption={renderAutocompleteOption('category')}
211242
textFieldProps={{
212243
hideLabel: true,
213244
}}
@@ -225,6 +256,7 @@ export const MarketplaceLanding = () => {
225256
}
226257
options={typeOptions}
227258
placeholder="Type"
259+
renderOption={renderAutocompleteOption('type')}
228260
textFieldProps={{
229261
hideLabel: true,
230262
}}

packages/manager/src/features/Marketplace/MarketplaceLanding/ProductSelectionCard.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ export const ProductSelectionCard = React.memo(
157157

158158
return (
159159
<SelectionCard
160+
data-pendo-id={`Cloud Marketplace-${productName}`}
160161
disabled={disabled}
161162
gridSize={PRODUCT_CARD_GRID_SIZE}
162163
heading={productName}

packages/manager/src/features/Marketplace/ProductDetails/ContactSalesDrawer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ export const ContactSalesDrawer = (props: ContactSalesDrawerProps) => {
598598
</Typography>
599599
)}
600600
<LinkButton
601-
data-pendo-id={`Cloud Marketplace Contact Sales-${showConsentDetails ? 'Show Details' : 'Hide Details'}`}
601+
data-pendo-id={`Cloud Marketplace Contact Sales-${showConsentDetails ? 'Hide Details' : 'Show Details'}`}
602602
onClick={() => setShowConsentDetails(!showConsentDetails)}
603603
sx={(theme) => ({
604604
'&:hover': {

0 commit comments

Comments
 (0)