import {Fragment, useCallback} from 'react'; import {RouteComponentProps} from 'react-router'; import styled from '@emotion/styled'; import {Role} from 'sentry/components/acl/role'; import {Button} from 'sentry/components/button'; import FileSize from 'sentry/components/fileSize'; import Link from 'sentry/components/links/link'; import Pagination from 'sentry/components/pagination'; import PanelTable from 'sentry/components/panels/panelTable'; import SearchBar from 'sentry/components/searchBar'; import Tag from 'sentry/components/tag'; import TimeSince from 'sentry/components/timeSince'; import {Tooltip} from 'sentry/components/tooltip'; import {IconClock, IconDownload} from 'sentry/icons'; import {t, tct} from 'sentry/locale'; import {space} from 'sentry/styles/space'; import {Artifact, DebugIdBundleArtifact, Project} from 'sentry/types'; import {useApiQuery} from 'sentry/utils/queryClient'; import {decodeScalar} from 'sentry/utils/queryString'; import useApi from 'sentry/utils/useApi'; import useOrganization from 'sentry/utils/useOrganization'; import {normalizeUrl} from 'sentry/utils/withDomainRequired'; import SettingsPageHeader from 'sentry/views/settings/components/settingsPageHeader'; import {Associations} from 'sentry/views/settings/projectSourceMaps/associations'; import {DebugIdBundlesTags} from 'sentry/views/settings/projectSourceMaps/debugIdBundlesTags'; enum DebugIdBundleArtifactType { INVALID = 0, SOURCE = 1, MINIFIED_SOURCE = 2, SOURCE_MAP = 3, INDEXED_RAM_BUNDLE = 4, } const debugIdBundleTypeLabels = { [DebugIdBundleArtifactType.INVALID]: t('Invalid'), [DebugIdBundleArtifactType.SOURCE]: t('Source'), [DebugIdBundleArtifactType.MINIFIED_SOURCE]: t('Minified'), [DebugIdBundleArtifactType.SOURCE_MAP]: t('Source Map'), [DebugIdBundleArtifactType.INDEXED_RAM_BUNDLE]: t('Indexed RAM Bundle'), }; function ArtifactsTableRow({ name, downloadRole, downloadUrl, size, orgSlug, artifactColumnDetails, }: { artifactColumnDetails: React.ReactNode; downloadRole: string; downloadUrl: string; name: string; orgSlug: string; size: number; }) { return ( {name || `(${t('empty')})`} {artifactColumnDetails} {({hasRole}) => { return ( , } )} disabled={hasRole} isHoverable >