Browse Source

ref(ui): Add missing types to project sourcemaps (#79253)

Scott Cooper 4 months ago
parent
commit
bca4b1dc80

+ 3 - 1
static/app/views/settings/projectSourceMaps/sourceMapsDetails.tsx

@@ -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={

+ 16 - 3
static/app/views/settings/projectSourceMaps/sourceMapsList.tsx

@@ -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';
@@ -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,
@@ -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,
@@ -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');