Browse Source

chore(ts): Use UPPER_CASE for ExportQueryType (#50359)

Evan Purkhiser 1 year ago
parent
commit
bd107e3a1e

+ 2 - 2
static/app/components/dataExport.tsx

@@ -12,8 +12,8 @@ import withOrganization from 'sentry/utils/withOrganization';
 
 // NOTE: Coordinate with other ExportQueryType (src/sentry/data_export/base.py)
 export enum ExportQueryType {
-  IssuesByTag = 'Issues-by-Tag',
-  Discover = 'Discover',
+  ISSUES_BY_TAG = 'Issues-by-Tag',
+  DISCOVER = 'Discover',
 }
 
 interface DataExportPayload {

+ 3 - 3
static/app/views/dataExport/dataDownload.spec.jsx

@@ -56,7 +56,7 @@ describe('DataDownload', function () {
 
   it("should render the 'Expired' view when appropriate", function () {
     const status = DownloadStatus.Expired;
-    const response = {status, query: {type: ExportQueryType.IssuesByTag}};
+    const response = {status, query: {type: ExportQueryType.ISSUES_BY_TAG}};
     getDataExportDetails(response);
 
     render(<DataDownload params={mockRouteParams} />);
@@ -90,7 +90,7 @@ describe('DataDownload', function () {
       dateExpired,
       status,
       query: {
-        type: ExportQueryType.Discover,
+        type: ExportQueryType.DISCOVER,
         info: {},
       },
     });
@@ -105,7 +105,7 @@ describe('DataDownload', function () {
       dateExpired,
       status,
       query: {
-        type: ExportQueryType.IssuesByTag,
+        type: ExportQueryType.ISSUES_BY_TAG,
         info: {},
       },
     });

+ 4 - 4
static/app/views/dataExport/dataDownload.tsx

@@ -71,9 +71,9 @@ class DataDownload extends AsyncView<Props, State> {
   getActionLink(queryType): string {
     const {orgId} = this.props.params;
     switch (queryType) {
-      case ExportQueryType.IssuesByTag:
+      case ExportQueryType.ISSUES_BY_TAG:
         return `/organizations/${orgId}/issues/`;
-      case ExportQueryType.Discover:
+      case ExportQueryType.DISCOVER:
         return `/organizations/${orgId}/discover/queries/`;
       default:
         return '/';
@@ -161,7 +161,7 @@ class DataDownload extends AsyncView<Props, State> {
     const {
       download: {
         query = {
-          type: ExportQueryType.IssuesByTag,
+          type: ExportQueryType.ISSUES_BY_TAG,
           info: {},
         },
       },
@@ -169,7 +169,7 @@ class DataDownload extends AsyncView<Props, State> {
 
     // default to IssuesByTag because we don't want to
     // display this unless we're sure its a discover query
-    const {type = ExportQueryType.IssuesByTag} = query;
+    const {type = ExportQueryType.ISSUES_BY_TAG} = query;
 
     return type === 'Discover' ? (
       <Fragment>

+ 1 - 1
static/app/views/discover/table/tableActions.tsx

@@ -77,7 +77,7 @@ function renderAsyncExportButton(canEdit: boolean, props: Props) {
   return (
     <DataExport
       payload={{
-        queryType: ExportQueryType.Discover,
+        queryType: ExportQueryType.DISCOVER,
         queryInfo: eventView.getEventsAPIPayload(location),
       }}
       disabled={disabled}

+ 1 - 1
static/app/views/issueDetails/groupTagValues.tsx

@@ -257,7 +257,7 @@ class GroupTagValues extends AsyncComponent<
               </Button>
               <DataExport
                 payload={{
-                  queryType: ExportQueryType.IssuesByTag,
+                  queryType: ExportQueryType.ISSUES_BY_TAG,
                   queryInfo: {
                     project: group.project.id,
                     group: group.id,