Skip to content

Commit

Permalink
ref(ui): Add missing types to project sourcemaps (#79253)
Browse files Browse the repository at this point in the history
  • Loading branch information
scttcper authored Oct 17, 2024
1 parent 47a2266 commit bca4b1d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,9 @@ export function SourceMapsDetails({params, location, router, project}: Props) {
key={data.id}
size={data.fileSize}
name={data.filePath}
type={debugIdBundleTypeLabels[data.fileType]}
type={
debugIdBundleTypeLabels[data.fileType as DebugIdBundleArtifactType]
}
downloadUrl={downloadUrl}
orgSlug={organization.slug}
artifactColumnDetails={
Expand Down
19 changes: 16 additions & 3 deletions static/app/views/settings/projectSourceMaps/sourceMapsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {t, tct} from 'sentry/locale';
import {space} from 'sentry/styles/space';
import type {KeyValueListData} from 'sentry/types/group';
import type {RouteComponentProps} from 'sentry/types/legacyReactRouter';
import type {Organization} from 'sentry/types/organization';
import type {Project} from 'sentry/types/project';
import type {SourceMapsArchive} from 'sentry/types/release';
import type {DebugIdBundle, DebugIdBundleAssociation} from 'sentry/types/sourceMaps';
Expand Down Expand Up @@ -69,7 +70,19 @@ function mergeReleaseAndDebugIdBundles(
return [...debugIdUploads, ...releaseUploads] as SourceMapUpload[];
}

function useSourceMapUploads({organization, project, query, cursor}) {
interface UseSourceMapUploadsProps {
cursor: string | undefined;
organization: Organization;
project: Project;
query: string | undefined;
}

function useSourceMapUploads({
organization,
project,
query,
cursor,
}: UseSourceMapUploadsProps) {
const {
data: archivesData,
getResponseHeader: archivesHeaders,
Expand Down Expand Up @@ -108,7 +121,7 @@ function useSourceMapUploads({organization, project, query, cursor}) {

return {
data: mergeReleaseAndDebugIdBundles(archivesData, debugIdBundlesData),
headers: header => {
headers: (header: string) => {
return debugIdBundlesHeaders?.(header) ?? archivesHeaders?.(header);
},
isPending: archivesLoading || debugIdBundlesLoading,
Expand Down Expand Up @@ -306,7 +319,7 @@ interface SourceMapUploadDeleteButtonProps {
export function SourceMapUploadDeleteButton({
onDelete,
}: SourceMapUploadDeleteButtonProps) {
const tooltipTitle = useCallback((hasAccess, canDelete) => {
const tooltipTitle = useCallback((hasAccess: boolean, canDelete: boolean) => {
if (hasAccess) {
if (canDelete) {
return t('Delete Source Maps');
Expand Down

0 comments on commit bca4b1d

Please sign in to comment.