Browse Source

ref(grid-editable): Remove unused location prop (#72120)

Remove the unused `location` prop from `GridEditable`.
ArthurKnaus 9 months ago
parent
commit
06c8955955

+ 0 - 4
static/app/components/events/eventStatisticalDetector/eventRegressionTable.tsx

@@ -12,7 +12,6 @@ import {defined} from 'sentry/utils';
 import {RateUnit} from 'sentry/utils/discover/fields';
 import {Container, NumberContainer} from 'sentry/utils/discover/styles';
 import {formatPercentage, formatRate} from 'sentry/utils/formatters';
-import {useLocation} from 'sentry/utils/useLocation';
 
 type RawDataRow<K extends string> = Record<K, any>;
 
@@ -51,8 +50,6 @@ interface EventRegressionTableProps<K extends string> {
 export function EventRegressionTable<K extends string>(
   props: EventRegressionTableProps<K>
 ) {
-  const location = useLocation();
-
   const columnOrder = useMemo(() => {
     if (props.causeType === 'throughput') {
       return [
@@ -87,7 +84,6 @@ export function EventRegressionTable<K extends string>(
       error={props.isError}
       isLoading={props.isLoading}
       data={props.data}
-      location={location}
       columnOrder={columnOrder}
       columnSortBy={[]}
       grid={{renderHeadCell, renderBodyCell}}

+ 0 - 1
static/app/components/events/eventStatisticalDetector/spanOpBreakdown.tsx

@@ -164,7 +164,6 @@ function EventSpanOpBreakdown({event}: {event: Event}) {
       <GridEditable
         isLoading={false}
         data={spanOpDiffs}
-        location={location}
         columnOrder={[
           {key: 'span_op', name: t('Span Operation'), width: 200},
           {key: 'p95', name: t('p95'), width: COL_WIDTH_UNDEFINED},

+ 1 - 28
static/app/components/gridEditable/index.stories.tsx

@@ -1,5 +1,4 @@
 import {Fragment, useCallback, useState} from 'react';
-import type {Location} from 'history';
 
 import {Button} from 'sentry/components/button';
 import type {GridColumnOrder} from 'sentry/components/gridEditable';
@@ -29,26 +28,8 @@ export default storyBook(GridEditable, story => {
     ...backend.slice(0, 3).map(name => ({name, category: 'backend' as const})),
   ];
 
-  const mockLocation: Location = {
-    key: '',
-    search: '',
-    hash: '',
-    action: 'PUSH',
-    state: null,
-    query: {},
-    pathname: '/mock-pathname/',
-  };
-
   story('Minimal', () => {
-    return (
-      <GridEditable
-        data={[]}
-        columnOrder={columns}
-        columnSortBy={[]}
-        grid={{}}
-        location={mockLocation}
-      />
-    );
+    return <GridEditable data={[]} columnOrder={columns} columnSortBy={[]} grid={{}} />;
   });
 
   const columnsWithWidth: GridColumnOrder<keyof ExampleDataItem | 'other'>[] =
@@ -86,7 +67,6 @@ export default storyBook(GridEditable, story => {
             renderHeadCell,
             renderBodyCell,
           }}
-          location={mockLocation}
         />
       </Fragment>
     );
@@ -104,7 +84,6 @@ export default storyBook(GridEditable, story => {
           columnOrder={columns}
           columnSortBy={[]}
           grid={{}}
-          location={mockLocation}
         />
       </div>
       <div>
@@ -117,7 +96,6 @@ export default storyBook(GridEditable, story => {
           columnOrder={columns}
           columnSortBy={[]}
           grid={{}}
-          location={mockLocation}
         />
       </div>
     </SideBySide>
@@ -143,7 +121,6 @@ export default storyBook(GridEditable, story => {
           columnOrder={columns}
           columnSortBy={[]}
           grid={{}}
-          location={mockLocation}
           onRowMouseOver={(_dataRow, key) => {
             setActiveRowKey(key);
           }}
@@ -208,7 +185,6 @@ export default storyBook(GridEditable, story => {
                 renderBodyCell,
                 onResizeColumn: statefulColumnResize.handleResizeColumn,
               }}
-              location={mockLocation}
             />
           </div>
           <div>
@@ -225,7 +201,6 @@ export default storyBook(GridEditable, story => {
                 renderBodyCell,
                 onResizeColumn: queryBasedColumnResize.handleResizeColumn,
               }}
-              location={mockLocation}
             />
           </div>
         </SideBySide>
@@ -242,7 +217,6 @@ export default storyBook(GridEditable, story => {
         renderHeadCell,
         renderBodyCell,
       }}
-      location={mockLocation}
       height={200}
       stickyHeader
     />
@@ -256,7 +230,6 @@ export default storyBook(GridEditable, story => {
         columnOrder: [columns],
         columnSortBy: [[]],
         grid: [{}],
-        location: [mockLocation],
         headerButtons: [undefined, () => <Button>Take Action</Button>],
         title: [undefined, 'GridEditable Title'],
       }}

+ 0 - 2
static/app/components/gridEditable/index.tsx

@@ -1,6 +1,5 @@
 import type {ReactNode} from 'react';
 import {Component, createRef, Fragment} from 'react';
-import type {Location} from 'history';
 
 import EmptyStateWarning from 'sentry/components/emptyStateWarning';
 import InteractionStateLayer from 'sentry/components/interactionStateLayer';
@@ -94,7 +93,6 @@ type GridEditableProps<DataRow, ColumnKey> = {
       rowIndex?: number
     ) => React.ReactNode[];
   };
-  location: Location;
   'aria-label'?: string;
   emptyMessage?: React.ReactNode;
   error?: unknown | null;

+ 0 - 1
static/app/components/metrics/metricSamplesTable.tsx

@@ -323,7 +323,6 @@ export function MetricSamplesTable({
           renderBodyCell: _renderBodyCell,
           renderHeadCell: _renderHeadCell,
         }}
-        location={location}
         emptyMessage={emptyMessage}
         minimumColWidth={60}
       />

+ 0 - 3
static/app/components/modals/widgetViewerModal.tsx

@@ -521,7 +521,6 @@ function WidgetViewerModal(props: Props) {
             }),
             onResizeColumn,
           }}
-          location={location}
         />
         {(links?.previous?.results || links?.next?.results) && (
           <Pagination
@@ -586,7 +585,6 @@ function WidgetViewerModal(props: Props) {
             }),
             onResizeColumn,
           }}
-          location={location}
         />
         {(links?.previous?.results || links?.next?.results) && (
           <Pagination
@@ -663,7 +661,6 @@ function WidgetViewerModal(props: Props) {
             }),
             onResizeColumn,
           }}
-          location={location}
         />
         {!tableWidget.queries[0].orderby.match(/^-?release$/) &&
           (links?.previous?.results || links?.next?.results) && (

+ 0 - 1
static/app/components/profiling/profileEventsTable.tsx

@@ -84,7 +84,6 @@ export function ProfileEventsTable<F extends FieldType>(
           {location, organization, projects}
         ),
       }}
-      location={location}
     />
   );
 }

+ 0 - 1
static/app/components/profiling/suspectFunctions/functionsTable.tsx

@@ -101,7 +101,6 @@ function FunctionsTable(props: FunctionsTableProps) {
         }),
         renderBodyCell: renderFunctionsTableCell,
       }}
-      location={location}
     />
   );
 }

+ 0 - 1
static/app/views/alerts/rules/metric/details/relatedTransactions.tsx

@@ -146,7 +146,6 @@ function RelatedTransactions({
             ) as any,
             renderBodyCell: renderBodyCellWithData(tableData) as any,
           }}
-          location={location}
         />
       )}
     </DiscoverQuery>

+ 1 - 2
static/app/views/discover/table/tableView.tsx

@@ -638,7 +638,7 @@ function TableView(props: TableViewProps) {
     );
   }
 
-  const {error, eventView, isLoading, location, tableData} = props;
+  const {error, eventView, isLoading, tableData} = props;
 
   const columnOrder = eventView.getColumns();
   const columnSortBy = eventView.getSorts();
@@ -665,7 +665,6 @@ function TableView(props: TableViewProps) {
         prependColumnWidths,
       }}
       headerButtons={renderHeaderButtons}
-      location={location}
     />
   );
 }

Some files were not shown because too many files changed in this diff