Skip to content

Commit

Permalink
fix(insights): Adds more no value rendering to more cells in web vita…
Browse files Browse the repository at this point in the history
…ls sample table (#84690)

Adds no value elements to more empty cells in the Web Vitals Page
summary samples table to match existing no value columns.
  • Loading branch information
edwardgou-sentry authored Feb 6, 2025
1 parent 5fefa35 commit b685aef
Showing 1 changed file with 23 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ enum Datatype {

const DATATYPE_KEY = 'type';

const NO_VALUE = ' \u2014 ';

type Props = {
transaction: string;
limit?: number;
Expand Down Expand Up @@ -307,7 +309,7 @@ export function PageSamplePerformanceTable({transaction, search, limit = 9}: Pro
return (
<AlignRight>
{(row as any)[key] === undefined ? (
<NoValue>{' \u2014 '}</NoValue>
<NoValue>{NO_VALUE}</NoValue>
) : (
getFormattedDuration(((row as any)[key] as number) / 1000)
)}
Expand All @@ -318,7 +320,7 @@ export function PageSamplePerformanceTable({transaction, search, limit = 9}: Pro
return (
<AlignRight>
{(row as any)[key] === undefined ? (
<NoValue>{' \u2014 '}</NoValue>
<NoValue>{NO_VALUE}</NoValue>
) : (
Math.round(((row as any)[key] as number) * 100) / 100
)}
Expand All @@ -338,12 +340,14 @@ export function PageSamplePerformanceTable({transaction, search, limit = 9}: Pro
return (
<NoOverflow>
<AlignCenter>
{profileTarget && profileExists(profileId) && (
{profileTarget && profileExists(profileId) ? (
<Tooltip title={t('View Profile')}>
<LinkButton to={profileTarget} size="xs">
<IconProfiling size="xs" />
</LinkButton>
</Tooltip>
) : (
<NoValue>{NO_VALUE}</NoValue>
)}
</AlignCenter>
</NoOverflow>
Expand Down Expand Up @@ -375,14 +379,16 @@ export function PageSamplePerformanceTable({transaction, search, limit = 9}: Pro
<NoOverflow>
<AlignCenter>
{replayTarget &&
Object.keys(replayTarget).length > 0 &&
replayExists(row[key]) && (
<Tooltip title={t('View Replay')}>
<LinkButton to={replayTarget} size="xs">
<IconPlay size="xs" />
</LinkButton>
</Tooltip>
)}
Object.keys(replayTarget).length > 0 &&
replayExists(row[key]) ? (
<Tooltip title={t('View Replay')}>
<LinkButton to={replayTarget} size="xs">
<IconPlay size="xs" />
</LinkButton>
</Tooltip>
) : (
<NoValue>{NO_VALUE}</NoValue>
)}
</AlignCenter>
</NoOverflow>
);
Expand Down Expand Up @@ -417,8 +423,12 @@ export function PageSamplePerformanceTable({transaction, search, limit = 9}: Pro
);
}

// @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
return <NoOverflow>{row[key]}</NoOverflow>;
return (
<NoOverflow>
{/* @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message */}
{row[key] && row[key] !== '' ? row[key] : <NoValue>{NO_VALUE}</NoValue>}
</NoOverflow>
);
}

const handleSearch = useCallback(
Expand Down

0 comments on commit b685aef

Please sign in to comment.