123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823 |
- import {Fragment} from 'react';
- import {Link} from 'react-router';
- import {css} from '@emotion/react';
- import styled from '@emotion/styled';
- import {Location} from 'history';
- import Alert from 'sentry/components/alert';
- import {AsyncComponentProps} from 'sentry/components/asyncComponent';
- import LoadingIndicator from 'sentry/components/loadingIndicator';
- import NotAvailable from 'sentry/components/notAvailable';
- import {PanelItem} from 'sentry/components/panels';
- import PanelTable from 'sentry/components/panels/panelTable';
- import {IconArrow} from 'sentry/icons';
- import {t, tct} from 'sentry/locale';
- import space from 'sentry/styles/space';
- import {Organization, ReleaseProject} from 'sentry/types';
- import DiscoverQuery, {TableData} from 'sentry/utils/discover/discoverQuery';
- import EventView from 'sentry/utils/discover/eventView';
- import {getFieldRenderer} from 'sentry/utils/discover/fieldRenderers';
- import {MobileVital, WebVital} from 'sentry/utils/fields';
- import {
- MOBILE_VITAL_DETAILS,
- WEB_VITAL_DETAILS,
- } from 'sentry/utils/performance/vitals/constants';
- import {PROJECT_PERFORMANCE_TYPE} from 'sentry/views/performance/utils';
- type PerformanceCardTableProps = {
- allReleasesEventView: EventView;
- allReleasesTableData: TableData | null;
- isLoading: boolean;
- location: Location;
- organization: Organization;
- performanceType: string;
- project: ReleaseProject;
- releaseEventView: EventView;
- thisReleaseTableData: TableData | null;
- };
- function PerformanceCardTable({
- organization,
- location,
- project,
- releaseEventView,
- allReleasesTableData,
- thisReleaseTableData,
- performanceType,
- isLoading,
- }: PerformanceCardTableProps) {
- const miseryRenderer =
- allReleasesTableData?.meta &&
- getFieldRenderer('user_misery()', allReleasesTableData.meta, false);
- function renderChange(
- allReleasesScore: number,
- thisReleaseScore: number,
- meta: string
- ) {
- if (allReleasesScore === undefined || thisReleaseScore === undefined) {
- return <StyledNotAvailable />;
- }
- const trend = allReleasesScore - thisReleaseScore;
- const trendSeconds = trend >= 1000 ? trend / 1000 : trend;
- const trendPercentage = (allReleasesScore - thisReleaseScore) * 100;
- const valPercentage = Math.round(Math.abs(trendPercentage));
- const val = Math.abs(trendSeconds).toFixed(2);
- if (trend === 0) {
- return <SubText>{`0${meta === 'duration' ? 'ms' : '%'}`}</SubText>;
- }
- return (
- <TrendText color={trend >= 0 ? 'success' : 'error'}>
- {`${meta === 'duration' ? val : valPercentage}${
- meta === 'duration' ? (trend >= 1000 ? 's' : 'ms') : '%'
- }`}
- <StyledIconArrow
- color={trend >= 0 ? 'success' : 'error'}
- direction={trend >= 0 ? 'down' : 'up'}
- size="xs"
- />
- </TrendText>
- );
- }
- function userMiseryTrend() {
- const allReleasesUserMisery = allReleasesTableData?.data?.[0]?.['user_misery()'];
- const thisReleaseUserMisery = thisReleaseTableData?.data?.[0]?.['user_misery()'];
- return (
- <StyledPanelItem>
- {renderChange(
- allReleasesUserMisery as number,
- thisReleaseUserMisery as number,
- 'number' as string
- )}
- </StyledPanelItem>
- );
- }
- function renderFrontendPerformance() {
- const webVitals = [
- {title: WebVital.FCP, field: 'p75(measurements.fcp)'},
- {title: WebVital.FID, field: 'p75(measurements.fid)'},
- {title: WebVital.LCP, field: 'p75(measurements.lcp)'},
- {title: WebVital.CLS, field: 'p75(measurements.cls)'},
- ];
- const spans = [
- {title: 'HTTP', column: 'p75(spans.http)', field: 'p75(spans.http)'},
- {title: 'Browser', column: 'p75(spans.browser)', field: 'p75(spans.browser)'},
- {title: 'Resource', column: 'p75(spans.resource)', field: 'p75(spans.resource)'},
- ];
- const webVitalTitles = webVitals.map((vital, idx) => {
- const newView = releaseEventView.withColumns([
- {kind: 'field', field: `p75(${vital.title})`},
- ]);
- return (
- <SubTitle key={idx}>
- <Link to={newView.getResultsViewUrlTarget(organization.slug)}>
- {WEB_VITAL_DETAILS[vital.title].name} (
- {WEB_VITAL_DETAILS[vital.title].acronym})
- </Link>
- </SubTitle>
- );
- });
- const spanTitles = spans.map((span, idx) => {
- const newView = releaseEventView.withColumns([
- {kind: 'field', field: `${span.column}`},
- ]);
- return (
- <SubTitle key={idx}>
- <Link to={newView.getResultsViewUrlTarget(organization.slug)}>
- {span.title}
- </Link>
- </SubTitle>
- );
- });
- const webVitalsRenderer = webVitals.map(
- vital =>
- allReleasesTableData?.meta &&
- getFieldRenderer(vital.field, allReleasesTableData?.meta, false)
- );
- const spansRenderer = spans.map(
- span =>
- allReleasesTableData?.meta &&
- getFieldRenderer(span.field, allReleasesTableData?.meta, false)
- );
- const webReleaseTrend = webVitals.map(vital => {
- return {
- allReleasesRow: {
- data: allReleasesTableData?.data?.[0]?.[vital.field],
- meta: allReleasesTableData?.meta?.[vital.field],
- },
- thisReleaseRow: {
- data: thisReleaseTableData?.data?.[0]?.[vital.field],
- meta: thisReleaseTableData?.meta?.[vital.field],
- },
- };
- });
- const spansReleaseTrend = spans.map(span => {
- return {
- allReleasesRow: {
- data: allReleasesTableData?.data?.[0]?.[span.field],
- meta: allReleasesTableData?.meta?.[span.field],
- },
- thisReleaseRow: {
- data: thisReleaseTableData?.data?.[0]?.[span.field],
- meta: thisReleaseTableData?.meta?.[span.field],
- },
- };
- });
- const emptyColumn = (
- <div>
- <SingleEmptySubText>
- <StyledNotAvailable tooltip={t('No results found')} />
- </SingleEmptySubText>
- <StyledPanelItem>
- <TitleSpace />
- {webVitals.map((vital, index) => (
- <MultipleEmptySubText key={vital[index]}>
- {<StyledNotAvailable tooltip={t('No results found')} />}
- </MultipleEmptySubText>
- ))}
- </StyledPanelItem>
- <StyledPanelItem>
- <TitleSpace />
- {spans.map((span, index) => (
- <MultipleEmptySubText key={span[index]}>
- {<StyledNotAvailable tooltip={t('No results found')} />}
- </MultipleEmptySubText>
- ))}
- </StyledPanelItem>
- </div>
- );
- return (
- <Fragment>
- <div>
- <PanelItem>{t('User Misery')}</PanelItem>
- <StyledPanelItem>
- <div>{t('Web Vitals')}</div>
- {webVitalTitles}
- </StyledPanelItem>
- <StyledPanelItem>
- <div>{t('Span Operations')}</div>
- {spanTitles}
- </StyledPanelItem>
- </div>
- {allReleasesTableData?.data.length === 0
- ? emptyColumn
- : allReleasesTableData?.data.map((dataRow, idx) => {
- const allReleasesMisery = miseryRenderer?.(dataRow, {
- organization,
- location,
- });
- const allReleasesWebVitals = webVitalsRenderer?.map(renderer =>
- renderer?.(dataRow, {organization, location})
- );
- const allReleasesSpans = spansRenderer?.map(renderer =>
- renderer?.(dataRow, {organization, location})
- );
- return (
- <div key={idx}>
- <UserMiseryPanelItem>{allReleasesMisery}</UserMiseryPanelItem>
- <StyledPanelItem>
- <TitleSpace />
- {allReleasesWebVitals.map(webVital => webVital)}
- </StyledPanelItem>
- <StyledPanelItem>
- <TitleSpace />
- {allReleasesSpans.map(span => span)}
- </StyledPanelItem>
- </div>
- );
- })}
- {thisReleaseTableData?.data.length === 0
- ? emptyColumn
- : thisReleaseTableData?.data.map((dataRow, idx) => {
- const thisReleasesMisery = miseryRenderer?.(dataRow, {
- organization,
- location,
- });
- const thisReleasesWebVitals = webVitalsRenderer?.map(renderer =>
- renderer?.(dataRow, {organization, location})
- );
- const thisReleasesSpans = spansRenderer?.map(renderer =>
- renderer?.(dataRow, {organization, location})
- );
- return (
- <div key={idx}>
- <div>
- <UserMiseryPanelItem>{thisReleasesMisery}</UserMiseryPanelItem>
- <StyledPanelItem>
- <TitleSpace />
- {thisReleasesWebVitals.map(webVital => webVital)}
- </StyledPanelItem>
- <StyledPanelItem>
- <TitleSpace />
- {thisReleasesSpans.map(span => span)}
- </StyledPanelItem>
- </div>
- </div>
- );
- })}
- <div>
- {userMiseryTrend()}
- <StyledPanelItem>
- <TitleSpace />
- {webReleaseTrend?.map(row =>
- renderChange(
- row.allReleasesRow?.data as number,
- row.thisReleaseRow?.data as number,
- row.allReleasesRow?.meta as string
- )
- )}
- </StyledPanelItem>
- <StyledPanelItem>
- <TitleSpace />
- {spansReleaseTrend?.map(row =>
- renderChange(
- row.allReleasesRow?.data as number,
- row.thisReleaseRow?.data as number,
- row.allReleasesRow?.meta as string
- )
- )}
- </StyledPanelItem>
- </div>
- </Fragment>
- );
- }
- function renderBackendPerformance() {
- const spans = [
- {title: 'HTTP', column: 'p75(spans.http)', field: 'p75_spans_http'},
- {title: 'DB', column: 'p75(spans.db)', field: 'p75_spans_db'},
- ];
- const spanTitles = spans.map((span, idx) => {
- const newView = releaseEventView.withColumns([
- {kind: 'field', field: `${span.column}`},
- ]);
- return (
- <SubTitle key={idx}>
- <Link to={newView.getResultsViewUrlTarget(organization.slug)}>
- {span.title}
- </Link>
- </SubTitle>
- );
- });
- const apdexRenderer =
- allReleasesTableData?.meta &&
- getFieldRenderer('apdex', allReleasesTableData.meta, false);
- const spansRenderer = spans.map(
- span =>
- allReleasesTableData?.meta &&
- getFieldRenderer(span.field, allReleasesTableData?.meta, false)
- );
- const spansReleaseTrend = spans.map(span => {
- return {
- allReleasesRow: {
- data: allReleasesTableData?.data?.[0]?.[span.field],
- meta: allReleasesTableData?.meta?.[span.field],
- },
- thisReleaseRow: {
- data: thisReleaseTableData?.data?.[0]?.[span.field],
- meta: thisReleaseTableData?.meta?.[span.field],
- },
- };
- });
- function apdexTrend() {
- const allReleasesApdex = allReleasesTableData?.data?.[0]?.apdex;
- const thisReleaseApdex = thisReleaseTableData?.data?.[0]?.apdex;
- return (
- <StyledPanelItem>
- {renderChange(
- allReleasesApdex as number,
- thisReleaseApdex as number,
- 'string' as string
- )}
- </StyledPanelItem>
- );
- }
- const emptyColumn = (
- <div>
- <SingleEmptySubText>
- <StyledNotAvailable tooltip={t('No results found')} />
- </SingleEmptySubText>
- <SingleEmptySubText>
- <StyledNotAvailable tooltip={t('No results found')} />
- </SingleEmptySubText>
- <StyledPanelItem>
- <TitleSpace />
- {spans.map((span, index) => (
- <MultipleEmptySubText key={span[index]}>
- {<StyledNotAvailable tooltip={t('No results found')} />}
- </MultipleEmptySubText>
- ))}
- </StyledPanelItem>
- </div>
- );
- return (
- <Fragment>
- <div>
- <PanelItem>{t('User Misery')}</PanelItem>
- <StyledPanelItem>
- <div>{t('Apdex')}</div>
- </StyledPanelItem>
- <StyledPanelItem>
- <div>{t('Span Operations')}</div>
- {spanTitles}
- </StyledPanelItem>
- </div>
- {allReleasesTableData?.data.length === 0
- ? emptyColumn
- : allReleasesTableData?.data.map((dataRow, idx) => {
- const allReleasesMisery = miseryRenderer?.(dataRow, {
- organization,
- location,
- });
- const allReleasesApdex = apdexRenderer?.(dataRow, {organization, location});
- const allReleasesSpans = spansRenderer?.map(renderer =>
- renderer?.(dataRow, {organization, location})
- );
- return (
- <div key={idx}>
- <UserMiseryPanelItem>{allReleasesMisery}</UserMiseryPanelItem>
- <ApdexPanelItem>{allReleasesApdex}</ApdexPanelItem>
- <StyledPanelItem>
- <TitleSpace />
- {allReleasesSpans.map(span => span)}
- </StyledPanelItem>
- </div>
- );
- })}
- {thisReleaseTableData?.data.length === 0
- ? emptyColumn
- : thisReleaseTableData?.data.map((dataRow, idx) => {
- const thisReleasesMisery = miseryRenderer?.(dataRow, {
- organization,
- location,
- });
- const thisReleasesApdex = apdexRenderer?.(dataRow, {
- organization,
- location,
- });
- const thisReleasesSpans = spansRenderer?.map(renderer =>
- renderer?.(dataRow, {organization, location})
- );
- return (
- <div key={idx}>
- <UserMiseryPanelItem>{thisReleasesMisery}</UserMiseryPanelItem>
- <ApdexPanelItem>{thisReleasesApdex}</ApdexPanelItem>
- <StyledPanelItem>
- <TitleSpace />
- {thisReleasesSpans.map(span => span)}
- </StyledPanelItem>
- </div>
- );
- })}
- <div>
- {userMiseryTrend()}
- {apdexTrend()}
- <StyledPanelItem>
- <TitleSpace />
- {spansReleaseTrend?.map(row =>
- renderChange(
- row.allReleasesRow?.data as number,
- row.thisReleaseRow?.data as number,
- row.allReleasesRow?.meta as string
- )
- )}
- </StyledPanelItem>
- </div>
- </Fragment>
- );
- }
- function renderMobilePerformance() {
- const mobileVitals = [
- MobileVital.AppStartCold,
- MobileVital.AppStartWarm,
- MobileVital.FramesSlow,
- MobileVital.FramesFrozen,
- ];
- const mobileVitalTitles = mobileVitals.map(mobileVital => {
- return (
- <PanelItem key={mobileVital}>{MOBILE_VITAL_DETAILS[mobileVital].name}</PanelItem>
- );
- });
- const mobileVitalFields = [
- 'p75(measurements.app_start_cold)',
- 'p75(measurements.app_start_warm)',
- 'p75(measurements.frames_slow)',
- 'p75(measurements.frames_frozen)',
- ];
- const mobileVitalsRenderer = mobileVitalFields.map(
- field =>
- allReleasesTableData?.meta &&
- getFieldRenderer(field, allReleasesTableData?.meta, false)
- );
- const mobileReleaseTrend = mobileVitalFields.map(field => {
- return {
- allReleasesRow: {
- data: allReleasesTableData?.data?.[0]?.[field],
- meta: allReleasesTableData?.meta?.[field],
- },
- thisReleaseRow: {
- data: thisReleaseTableData?.data?.[0]?.[field],
- meta: thisReleaseTableData?.meta?.[field],
- },
- };
- });
- const emptyColumn = (
- <div>
- <SingleEmptySubText>
- <StyledNotAvailable tooltip={t('No results found')} />
- </SingleEmptySubText>
- {mobileVitalFields.map((vital, index) => (
- <SingleEmptySubText key={vital[index]}>
- <StyledNotAvailable tooltip={t('No results found')} />
- </SingleEmptySubText>
- ))}
- </div>
- );
- return (
- <Fragment>
- <div>
- <PanelItem>{t('User Misery')}</PanelItem>
- {mobileVitalTitles}
- </div>
- {allReleasesTableData?.data.length === 0
- ? emptyColumn
- : allReleasesTableData?.data.map((dataRow, idx) => {
- const allReleasesMisery = miseryRenderer?.(dataRow, {
- organization,
- location,
- });
- const allReleasesMobile = mobileVitalsRenderer?.map(renderer =>
- renderer?.(dataRow, {organization, location})
- );
- return (
- <div key={idx}>
- <UserMiseryPanelItem>{allReleasesMisery}</UserMiseryPanelItem>
- {allReleasesMobile.map((mobileVital, i) => (
- <StyledPanelItem key={i}>{mobileVital}</StyledPanelItem>
- ))}
- </div>
- );
- })}
- {thisReleaseTableData?.data.length === 0
- ? emptyColumn
- : thisReleaseTableData?.data.map((dataRow, idx) => {
- const thisReleasesMisery = miseryRenderer?.(dataRow, {
- organization,
- location,
- });
- const thisReleasesMobile = mobileVitalsRenderer?.map(renderer =>
- renderer?.(dataRow, {organization, location})
- );
- return (
- <div key={idx}>
- <UserMiseryPanelItem>{thisReleasesMisery}</UserMiseryPanelItem>
- {thisReleasesMobile.map((mobileVital, i) => (
- <StyledPanelItem key={i}>{mobileVital}</StyledPanelItem>
- ))}
- </div>
- );
- })}
- <div>
- {userMiseryTrend()}
- {mobileReleaseTrend?.map((row, idx) => (
- <StyledPanelItem key={idx}>
- {renderChange(
- row.allReleasesRow?.data as number,
- row.thisReleaseRow?.data as number,
- row.allReleasesRow?.meta as string
- )}
- </StyledPanelItem>
- ))}
- </div>
- </Fragment>
- );
- }
- function renderUnknownPerformance() {
- const emptyColumn = (
- <div>
- <SingleEmptySubText>
- <StyledNotAvailable tooltip={t('No results found')} />
- </SingleEmptySubText>
- </div>
- );
- return (
- <Fragment>
- <div>
- <PanelItem>{t('User Misery')}</PanelItem>
- </div>
- {allReleasesTableData?.data.length === 0
- ? emptyColumn
- : allReleasesTableData?.data.map((dataRow, idx) => {
- const allReleasesMisery = miseryRenderer?.(dataRow, {
- organization,
- location,
- });
- return (
- <div key={idx}>
- <UserMiseryPanelItem>{allReleasesMisery}</UserMiseryPanelItem>
- </div>
- );
- })}
- {thisReleaseTableData?.data.length === 0
- ? emptyColumn
- : thisReleaseTableData?.data.map((dataRow, idx) => {
- const thisReleasesMisery = miseryRenderer?.(dataRow, {
- organization,
- location,
- });
- return (
- <div key={idx}>
- <UserMiseryPanelItem>{thisReleasesMisery}</UserMiseryPanelItem>
- </div>
- );
- })}
- <div>{userMiseryTrend()}</div>
- </Fragment>
- );
- }
- const loader = <StyledLoadingIndicator />;
- const platformPerformanceRender = {
- [PROJECT_PERFORMANCE_TYPE.FRONTEND]: {
- title: t('Frontend Performance'),
- section: renderFrontendPerformance(),
- },
- [PROJECT_PERFORMANCE_TYPE.BACKEND]: {
- title: t('Backend Performance'),
- section: renderBackendPerformance(),
- },
- [PROJECT_PERFORMANCE_TYPE.MOBILE]: {
- title: t('Mobile Performance'),
- section: renderMobilePerformance(),
- },
- [PROJECT_PERFORMANCE_TYPE.ANY]: {
- title: t('[Unknown] Performance'),
- section: renderUnknownPerformance(),
- },
- };
- const isUnknownPlatform = performanceType === PROJECT_PERFORMANCE_TYPE.ANY;
- return (
- <Fragment>
- <HeadCellContainer>
- {platformPerformanceRender[performanceType].title}
- </HeadCellContainer>
- {isUnknownPlatform && (
- <StyledAlert type="warning" showIcon system>
- {tct(
- 'For more performance metrics, specify which platform this project is using in [link]',
- {
- link: (
- <Link to={`/settings/${organization.slug}/projects/${project.slug}/`}>
- {t('project settings.')}
- </Link>
- ),
- }
- )}
- </StyledAlert>
- )}
- <StyledPanelTable
- isLoading={isLoading}
- headers={[
- <Cell key="description" align="left">
- {t('Description')}
- </Cell>,
- <Cell key="releases" align="right">
- {t('All Releases')}
- </Cell>,
- <Cell key="release" align="right">
- {t('This Release')}
- </Cell>,
- <Cell key="change" align="right">
- {t('Change')}
- </Cell>,
- ]}
- disablePadding
- loader={loader}
- disableTopBorder={isUnknownPlatform}
- >
- {platformPerformanceRender[performanceType].section}
- </StyledPanelTable>
- </Fragment>
- );
- }
- interface Props extends AsyncComponentProps {
- allReleasesEventView: EventView;
- location: Location;
- organization: Organization;
- performanceType: string;
- project: ReleaseProject;
- releaseEventView: EventView;
- }
- function PerformanceCardTableWrapper({
- organization,
- project,
- allReleasesEventView,
- releaseEventView,
- performanceType,
- location,
- }: Props) {
- return (
- <DiscoverQuery
- eventView={allReleasesEventView}
- orgSlug={organization.slug}
- location={location}
- useEvents
- >
- {({isLoading, tableData: allReleasesTableData}) => (
- <DiscoverQuery
- eventView={releaseEventView}
- orgSlug={organization.slug}
- location={location}
- useEvents
- >
- {({isLoading: isReleaseLoading, tableData: thisReleaseTableData}) => (
- <PerformanceCardTable
- isLoading={isLoading || isReleaseLoading}
- organization={organization}
- location={location}
- project={project}
- allReleasesEventView={allReleasesEventView}
- releaseEventView={releaseEventView}
- allReleasesTableData={allReleasesTableData}
- thisReleaseTableData={thisReleaseTableData}
- performanceType={performanceType}
- />
- )}
- </DiscoverQuery>
- )}
- </DiscoverQuery>
- );
- }
- export default PerformanceCardTableWrapper;
- const emptyFieldCss = p => css`
- color: ${p.theme.chartOther};
- text-align: right;
- `;
- const StyledLoadingIndicator = styled(LoadingIndicator)`
- margin: 70px auto;
- `;
- const HeadCellContainer = styled('div')`
- font-size: ${p => p.theme.fontSizeExtraLarge};
- padding: ${space(2)};
- border-top: 1px solid ${p => p.theme.border};
- border-left: 1px solid ${p => p.theme.border};
- border-right: 1px solid ${p => p.theme.border};
- border-top-left-radius: ${p => p.theme.borderRadius};
- border-top-right-radius: ${p => p.theme.borderRadius};
- `;
- const StyledPanelTable = styled(PanelTable)<{disableTopBorder: boolean}>`
- border-top-left-radius: 0;
- border-top-right-radius: 0;
- border-top: ${p => (p.disableTopBorder ? 'none' : `1px solid ${p.theme.border}`)};
- @media (max-width: ${p => p.theme.breakpoints.large}) {
- grid-template-columns: min-content 1fr 1fr 1fr;
- }
- `;
- const StyledPanelItem = styled(PanelItem)`
- display: block;
- white-space: nowrap;
- width: 100%;
- `;
- const SubTitle = styled('div')`
- margin-left: ${space(3)};
- `;
- const TitleSpace = styled('div')`
- height: 24px;
- `;
- const UserMiseryPanelItem = styled(PanelItem)`
- justify-content: flex-end;
- `;
- const ApdexPanelItem = styled(PanelItem)`
- text-align: right;
- `;
- const SingleEmptySubText = styled(PanelItem)`
- display: block;
- ${emptyFieldCss}
- `;
- const MultipleEmptySubText = styled('div')`
- ${emptyFieldCss}
- `;
- const Cell = styled('div')<{align: 'left' | 'right'}>`
- text-align: ${p => p.align};
- margin-left: ${p => p.align === 'left' && space(2)};
- padding-right: ${p => p.align === 'right' && space(2)};
- ${p => p.theme.overflowEllipsis}
- `;
- const StyledAlert = styled(Alert)`
- border-top: 1px solid ${p => p.theme.border};
- border-right: 1px solid ${p => p.theme.border};
- border-left: 1px solid ${p => p.theme.border};
- margin-bottom: 0;
- `;
- const StyledNotAvailable = styled(NotAvailable)`
- text-align: right;
- `;
- const SubText = styled('div')`
- color: ${p => p.theme.subText};
- text-align: right;
- `;
- const TrendText = styled('div')<{color: string}>`
- color: ${p => p.theme[p.color]};
- text-align: right;
- `;
- const StyledIconArrow = styled(IconArrow)<{color: string}>`
- color: ${p => p.theme[p.color]};
- margin-left: ${space(0.5)};
- `;
|