Skip to content

Commit

Permalink
[DataGrid] Rename ErrorOverlay to GridErrorOverlay (#6946)
Browse files Browse the repository at this point in the history
  • Loading branch information
MBilalShafi authored Nov 23, 2022
1 parent cbdd8fb commit afdb823
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/pages/x/api/data-grid/data-grid-premium.json
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@
"DensityStandardIcon": { "default": "GridTableRowsIcon", "type": { "name": "elementType" } },
"DetailPanelCollapseIcon": { "default": "GridRemoveIcon", "type": { "name": "elementType" } },
"DetailPanelExpandIcon": { "default": "GridAddIcon", "type": { "name": "elementType" } },
"ErrorOverlay": { "default": "ErrorOverlay", "type": { "name": "elementType" } },
"ErrorOverlay": { "default": "GridErrorOverlay", "type": { "name": "elementType" } },
"ExportIcon": { "default": "GridSaveAltIcon", "type": { "name": "elementType" } },
"FilterPanel": { "default": "GridFilterPanel", "type": { "name": "elementType" } },
"FilterPanelDeleteIcon": { "default": "GridCloseIcon", "type": { "name": "elementType" } },
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/x/api/data-grid/data-grid-pro.json
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@
"DensityStandardIcon": { "default": "GridTableRowsIcon", "type": { "name": "elementType" } },
"DetailPanelCollapseIcon": { "default": "GridRemoveIcon", "type": { "name": "elementType" } },
"DetailPanelExpandIcon": { "default": "GridAddIcon", "type": { "name": "elementType" } },
"ErrorOverlay": { "default": "ErrorOverlay", "type": { "name": "elementType" } },
"ErrorOverlay": { "default": "GridErrorOverlay", "type": { "name": "elementType" } },
"ExportIcon": { "default": "GridSaveAltIcon", "type": { "name": "elementType" } },
"FilterPanel": { "default": "GridFilterPanel", "type": { "name": "elementType" } },
"FilterPanelDeleteIcon": { "default": "GridCloseIcon", "type": { "name": "elementType" } },
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/x/api/data-grid/data-grid.json
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
"DensityStandardIcon": { "default": "GridTableRowsIcon", "type": { "name": "elementType" } },
"DetailPanelCollapseIcon": { "default": "GridRemoveIcon", "type": { "name": "elementType" } },
"DetailPanelExpandIcon": { "default": "GridAddIcon", "type": { "name": "elementType" } },
"ErrorOverlay": { "default": "ErrorOverlay", "type": { "name": "elementType" } },
"ErrorOverlay": { "default": "GridErrorOverlay", "type": { "name": "elementType" } },
"ExportIcon": { "default": "GridSaveAltIcon", "type": { "name": "elementType" } },
"FilterPanel": { "default": "GridFilterPanel", "type": { "name": "elementType" } },
"FilterPanelDeleteIcon": { "default": "GridCloseIcon", "type": { "name": "elementType" } },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ import { GridOverlay, GridOverlayProps } from './containers/GridOverlay';
import { useGridSelector } from '../hooks/utils/useGridSelector';
import { gridDensityRowHeightSelector } from '../hooks/features/density/densitySelector';

export interface ErrorOverlayProps extends GridOverlayProps {
export interface GridErrorOverlayProps extends GridOverlayProps {
error?: Error;
hasError: boolean;
errorInfo: any;
}

// TODO v6: rename to GridErrorOverlay
export const ErrorOverlay = React.forwardRef<HTMLDivElement, ErrorOverlayProps>(
function ErrorOverlay(props: ErrorOverlayProps, ref) {
export const GridErrorOverlay = React.forwardRef<HTMLDivElement, GridErrorOverlayProps>(
function GridErrorOverlay(props, ref) {
const { error, hasError, errorInfo, ...other } = props;
const apiRef = useGridApiContext();
const defaultLabel = apiRef.current.getLocaleText('errorOverlayDefaultLabel');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const useUtilityClasses = (ownerState: OwnerState) => {
const GridOverlayRoot = styled('div', {
name: 'MuiDataGrid',
slot: 'Overlay',
overridesResolver: (props, styles) => styles.overlay,
overridesResolver: (_, styles) => styles.overlay,
})(({ theme }) => ({
width: '100%',
height: '100%',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import {
GridSearchIcon,
} from '../components';
import { GridColumnUnsortedIcon } from '../components/columnHeaders/GridColumnUnsortedIcon';
import { ErrorOverlay } from '../components/ErrorOverlay';
import { GridErrorOverlay } from '../components/GridErrorOverlay';
import { GridNoResultsOverlay } from '../components/GridNoResultsOverlay';

const DEFAULT_GRID_ICON_SLOTS_COMPONENTS: GridIconSlotsComponent = {
Expand Down Expand Up @@ -92,7 +92,7 @@ export const DATA_GRID_DEFAULT_SLOTS_COMPONENTS: GridSlotsComponent = {
SkeletonCell: GridSkeletonCell,
ColumnHeaderFilterIconButton: GridColumnHeaderFilterIconButton,
ColumnMenu: GridColumnMenu,
ErrorOverlay,
ErrorOverlay: GridErrorOverlay,
Footer: GridFooter,
Header: GridHeader,
Toolbar: null,
Expand Down
2 changes: 1 addition & 1 deletion packages/grid/x-data-grid/src/models/gridSlotsComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export interface GridSlotsComponent extends GridIconSlotsComponent {
ColumnMenu: React.JSXElementConstructor<any>;
/**
* Error overlay component rendered above the grid when an error is caught.
* @default ErrorOverlay
* @default GridErrorOverlay
*/
ErrorOverlay: React.JSXElementConstructor<any>;
/**
Expand Down

0 comments on commit afdb823

Please sign in to comment.