projectReleaseDetails.tsx 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. import styled from '@emotion/styled';
  2. import Count from 'sentry/components/count';
  3. import DateTime from 'sentry/components/dateTime';
  4. import {KeyValueTable, KeyValueTableRow} from 'sentry/components/keyValueTable';
  5. import Link from 'sentry/components/links/link';
  6. import * as SidebarSection from 'sentry/components/sidebarSection';
  7. import TextOverflow from 'sentry/components/textOverflow';
  8. import TimeSince from 'sentry/components/timeSince';
  9. import Version from 'sentry/components/version';
  10. import {t, tn} from 'sentry/locale';
  11. import {ReleaseMeta, ReleaseWithHealth} from 'sentry/types';
  12. type Props = {
  13. orgSlug: string;
  14. projectSlug: string;
  15. release: ReleaseWithHealth;
  16. releaseMeta: ReleaseMeta;
  17. };
  18. function ProjectReleaseDetails({release, releaseMeta, orgSlug, projectSlug}: Props) {
  19. const {version, versionInfo, dateCreated, firstEvent, lastEvent} = release;
  20. const {releaseFileCount, isArtifactBundle} = releaseMeta;
  21. return (
  22. <SidebarSection.Wrap>
  23. <SidebarSection.Title>{t('Project Release Details')}</SidebarSection.Title>
  24. <SidebarSection.Content>
  25. <KeyValueTable>
  26. <KeyValueTableRow
  27. keyName={t('Created')}
  28. value={<DateTime date={dateCreated} seconds={false} />}
  29. />
  30. <KeyValueTableRow
  31. keyName={t('Version')}
  32. value={<Version version={version} anchor={false} />}
  33. />
  34. <KeyValueTableRow
  35. keyName={t('Package')}
  36. value={
  37. <StyledTextOverflow ellipsisDirection="left">
  38. {versionInfo.package ?? '\u2014'}
  39. </StyledTextOverflow>
  40. }
  41. />
  42. <KeyValueTableRow
  43. keyName={t('First Event')}
  44. value={firstEvent ? <TimeSince date={firstEvent} /> : '\u2014'}
  45. />
  46. <KeyValueTableRow
  47. keyName={t('Last Event')}
  48. value={lastEvent ? <TimeSince date={lastEvent} /> : '\u2014'}
  49. />
  50. <KeyValueTableRow
  51. keyName={t('Source Maps')}
  52. value={
  53. <Link
  54. to={
  55. isArtifactBundle
  56. ? `/settings/${orgSlug}/projects/${projectSlug}/source-maps/artifact-bundles/?query=${encodeURIComponent(
  57. version
  58. )}`
  59. : `/settings/${orgSlug}/projects/${projectSlug}/source-maps/release-bundles/${encodeURIComponent(
  60. version
  61. )}/`
  62. }
  63. >
  64. <Count value={releaseFileCount} />{' '}
  65. {tn('artifact', 'artifacts', releaseFileCount)}
  66. </Link>
  67. }
  68. />
  69. </KeyValueTable>
  70. </SidebarSection.Content>
  71. </SidebarSection.Wrap>
  72. );
  73. }
  74. const StyledTextOverflow = styled(TextOverflow)`
  75. line-height: inherit;
  76. text-align: right;
  77. `;
  78. export default ProjectReleaseDetails;