Skip to content
Open
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
---

Private Image Sharing: properly tag Images search bar and docs links for Pendo ([#13543](https://github.com/linode/manager/pull/13543))
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ export interface DebouncedSearchProps extends TextFieldProps {
* Function to perform when searching for query
*/
onSearch: (query: string) => void;
/**
* Value for data-pendo-id attribute for search input, used for analytics tracking.
*/
pendoId?: string;
/**
* Placeholder text for the input.
*/
Expand All @@ -68,6 +72,7 @@ export const DebouncedSearchTextField = React.memo(
isSearching,
label,
onSearch,
pendoId,
placeholder,
value,
...restOfTextFieldProps
Expand Down Expand Up @@ -111,6 +116,7 @@ export const DebouncedSearchTextField = React.memo(
return (
<TextField
className={className}
data-pendo-id={pendoId}
data-qa-debounced-search
defaultValue={defaultValue}
hideLabel={hideLabel}
Expand Down
7 changes: 5 additions & 2 deletions packages/manager/src/components/DocsLink/DocsLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Link } from 'src/components/Link';
import { sendHelpButtonClickEvent } from 'src/utilities/analytics/customEventAnalytics';

export interface DocsLinkProps {
/** The label to use for analytics purposes */
/** DEPRECATED: The label to use for Adobe Analytics purposes */
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I considered just repurposing this prop, but it is used in other places in the code currently, and I didn't want junk data being sent to Pendo.

analyticsLabel?: string;
/** The URL to link to */
href: string;
Expand All @@ -20,6 +20,8 @@ export interface DocsLinkProps {
label?: string;
/** A callback function when the link is clicked */
onClick?: () => void;
/** The Pendo ID to use for tracking purposes */
pendoId?: string;
}

/**
Expand All @@ -28,7 +30,7 @@ export interface DocsLinkProps {
* - Consider displaying the title of a key guide or product document as the link instead of the generic β€œDocs”.
*/
export const DocsLink = (props: DocsLinkProps) => {
const { analyticsLabel, href, label, onClick, icon } = props;
const { analyticsLabel, href, label, onClick, icon, pendoId } = props;

return (
<StyledDocsLink
Expand All @@ -40,6 +42,7 @@ export const DocsLink = (props: DocsLinkProps) => {
onClick();
}
}}
pendoId={pendoId}
to={href}
>
{icon ?? <DocsIcon />}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,9 @@ export const ImagesTable = (props: ImagesTableProps) => {
>
{headerProps.docsLink && (
<DocsLink
analyticsLabel={headerProps.title}
data-pendo-id={headerProps.docsLink.dataPendoId}
href={headerProps.docsLink.href}
label={headerProps.docsLink.label}
pendoId={headerProps.docsLink.dataPendoId}
/>
)}
{headerProps.buttonProps && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ export const ImagesView = (props: Props) => {
isSearching={imagesIsFetching}
label="Search"
onSearch={onSearch}
pendoId={config.searchBarPendoId}
placeholder="Search Images"
value={search.query ?? ''}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import {
MANUAL_IMAGES_DEFAULT_ORDER,
MANUAL_IMAGES_DEFAULT_ORDER_BY,
MANUAL_IMAGES_PREFERENCE_KEY,
OWNED_BY_ME_IMAGES_TAB_PENDO_IDS,
RECOVERY_IMAGES_TAB_PENDO_IDS,
SHARED_IMAGES_DEFAULT_ORDER,
SHARED_IMAGES_DEFAULT_ORDER_BY,
SHARED_IMAGES_PREFERENCE_KEY,
Expand Down Expand Up @@ -54,6 +56,7 @@ export interface ImageConfig {
orderByDefault: string;
orderDefault: 'asc' | 'desc';
preferenceKey: string;
searchBarPendoId: string;
title: string;
type: Image['type'];
}
Expand Down Expand Up @@ -160,6 +163,7 @@ export const IMAGES_CONFIG: Record<ImageLibraryType, ImageConfig> = {
instruction:
'Click \u2018Create Image\u2019 to create your first custom image',
},
searchBarPendoId: OWNED_BY_ME_IMAGES_TAB_PENDO_IDS.searchImagesBar,
},
'recovery-images': {
title: 'Recovery images',
Expand All @@ -179,7 +183,9 @@ export const IMAGES_CONFIG: Record<ImageLibraryType, ImageConfig> = {
emptyMessage: {
main: 'No recovery images to display',
},
searchBarPendoId: RECOVERY_IMAGES_TAB_PENDO_IDS.searchImagesBar,
docsLink: {
dataPendoId: RECOVERY_IMAGES_TAB_PENDO_IDS.recoverDeletedLinodeDocsLink,
label: 'Recover a deleted Linode',
href: 'https://techdocs.akamai.com/cloud-computing/docs/images#recover-a-deleted',
},
Expand Down Expand Up @@ -225,5 +231,6 @@ export const IMAGES_CONFIG: Record<ImageLibraryType, ImageConfig> = {
href: 'https://techdocs.akamai.com/cloud-computing/docs/image-sharing',
dataPendoId: SHARED_WITH_ME_IMAGES_TAB_PENDO_IDS.imageSharingDocsLink,
},
searchBarPendoId: SHARED_WITH_ME_IMAGES_TAB_PENDO_IDS.searchImagesBar,
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ export const ShareGroupsTable = (props: ShareGroupsTableProps) => {
>
{headerProps.docsLink && (
<DocsLink
analyticsLabel={headerProps.title}
href={headerProps.docsLink.href}
label={headerProps.docsLink.label}
pendoId={headerProps.docsLink.pendoId}
/>
)}
{headerProps.buttonProps && (
Expand Down Expand Up @@ -183,7 +183,7 @@ export const ShareGroupsTable = (props: ShareGroupsTableProps) => {
style={{
display: 'flex',
justifyContent: 'center',
padding: 0
padding: 0,
}}
>
<Box
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ export const ShareGroupsView = (props: Props) => {
isSearching={shareGroupsIsFetching}
label="Search"
onSearch={onSearch}
pendoId={config.searchFieldPendoId}
placeholder="Search share groups"
value={search.query ?? ''}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export const SHAREGROUPS_CONFIG: Record<
docsLink: {
href: `https://techdocs.akamai.com/cloud-computing/docs/image-sharing`,
label: 'Image sharing',
pendoId: 'Images Groups Owned-Docs Link',
pendoId: 'Images Groups Owned-Docs',
},
columns: OWNED_GROUPS_TABLE_COLUMNS,
emptyMessage: {
Expand Down
9 changes: 9 additions & 0 deletions packages/manager/src/features/Images/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ export const SHARED_IMAGES_DEFAULT_ORDER_BY = 'label';
export const SHARE_GROUP_COLUMN_HEADER_TOOLTIP =
"Displays the share group for images shared with you; your custom images don't display a group name.";

export const OWNED_BY_ME_IMAGES_TAB_PENDO_IDS = {
searchImagesBar: 'Images Library Owned-Search',
};

export const SHARED_WITH_ME_IMAGES_TAB_PENDO_IDS = {
searchImagesBar: 'Images Library Shared-Search',
imageSharingDocsLink: 'Images Library Shared-Docs',
Expand All @@ -32,3 +36,8 @@ export const SHARED_WITH_ME_IMAGES_TAB_PENDO_IDS = {
rebuildLinode: 'Images Library Shared-Rebuild an Existing Linode',
},
};

export const RECOVERY_IMAGES_TAB_PENDO_IDS = {
searchImagesBar: 'Images Library Recovery-Search',
recoverDeletedLinodeDocsLink: 'Images Library Recovery-Docs',
};
Loading