Skip to content

Commit

Permalink
another round
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Dec 28, 2024
1 parent 4b6eb1a commit 0da9c23
Show file tree
Hide file tree
Showing 20 changed files with 15 additions and 39 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 @@ -17,7 +17,7 @@
"aria-label": { "type": { "name": "string" } },
"aria-labelledby": { "type": { "name": "string" } },
"autoHeight": {
"type": { "name": "custom", "description": "bool" },
"type": { "name": "bool" },
"default": "false",
"deprecated": true,
"deprecationInfo": "Use flex parent container instead: <a href=\"https://mui.com/r/x-grid-deprecate-auto-height\">https://mui.com/r/x-grid-deprecate-auto-height</a>."
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 @@ -8,7 +8,7 @@
"aria-label": { "type": { "name": "string" } },
"aria-labelledby": { "type": { "name": "string" } },
"autoHeight": {
"type": { "name": "custom", "description": "bool" },
"type": { "name": "bool" },
"default": "false",
"deprecated": true,
"deprecationInfo": "Use flex parent container instead: <a href=\"https://mui.com/r/x-grid-deprecate-auto-height\">https://mui.com/r/x-grid-deprecate-auto-height</a>."
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 @@ -8,7 +8,7 @@
"aria-label": { "type": { "name": "string" } },
"aria-labelledby": { "type": { "name": "string" } },
"autoHeight": {
"type": { "name": "custom", "description": "bool" },
"type": { "name": "bool" },
"default": "false",
"deprecated": true,
"deprecationInfo": "Use flex parent container instead: <a href=\"https://mui.com/r/x-grid-deprecate-auto-height\">https://mui.com/r/x-grid-deprecate-auto-height</a>."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
"description": "The id of the element containing a label for the Data Grid."
},
"autoHeight": {
"description": "If <code>true</code>, the Data Grid height is dynamic and follows the number of rows in the Data Grid.",
"deprecated": "<em>Deprecated</em>. Use flex parent container instead: <a href=\"https://mui.com/r/x-grid-deprecate-auto-height\">https://mui.com/r/x-grid-deprecate-auto-height</a>.<br><br>"
"description": "If <code>true</code>, the Data Grid height is dynamic and follows the number of rows in the Data Grid."
},
"autoPageSize": {
"description": "If <code>true</code>, the pageSize is calculated according to the container size and the max number of rows to avoid rendering a vertical scroll bar."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"description": "The id of the element containing a label for the Data Grid."
},
"autoHeight": {
"description": "If <code>true</code>, the Data Grid height is dynamic and follows the number of rows in the Data Grid.",
"deprecated": "<em>Deprecated</em>. Use flex parent container instead: <a href=\"https://mui.com/r/x-grid-deprecate-auto-height\">https://mui.com/r/x-grid-deprecate-auto-height</a>.<br><br>"
"description": "If <code>true</code>, the Data Grid height is dynamic and follows the number of rows in the Data Grid."
},
"autoPageSize": {
"description": "If <code>true</code>, the pageSize is calculated according to the container size and the max number of rows to avoid rendering a vertical scroll bar."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"description": "The id of the element containing a label for the Data Grid."
},
"autoHeight": {
"description": "If <code>true</code>, the Data Grid height is dynamic and follows the number of rows in the Data Grid.",
"deprecated": "<em>Deprecated</em>. Use flex parent container instead: <a href=\"https://mui.com/r/x-grid-deprecate-auto-height\">https://mui.com/r/x-grid-deprecate-auto-height</a>.<br><br>"
"description": "If <code>true</code>, the Data Grid height is dynamic and follows the number of rows in the Data Grid."
},
"autoPageSize": {
"description": "If <code>true</code>, the pageSize is calculated according to the container size and the max number of rows to avoid rendering a vertical scroll bar."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import * as React from 'react';
import PropTypes from 'prop-types';
import { useLicenseVerifier, Watermark } from '@mui/x-license';
import deprecatedPropType from '@mui/utils/deprecatedPropType';
import {
GridBody,
GridFooterPlaceholder,
Expand Down Expand Up @@ -118,10 +117,7 @@ DataGridPremiumRaw.propTypes = {
* <DataGrid />
* </div>
*/
autoHeight: deprecatedPropType(
PropTypes.bool,
'Use flex parent container instead: https://mui.com/r/x-grid-deprecate-auto-height.',
),
autoHeight: PropTypes.bool,
/**
* If `true`, the pageSize is calculated according to the container size and the max number of rows to avoid rendering a vertical scroll bar.
* @default false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import { expect } from 'chai';
import Excel from 'exceljs';
import { spyApi } from 'test/utils/helperFn';

const isJSDOM = /jsdom/.test(window.navigator.userAgent);

describe('<DataGridPremium /> - Export Excel', () => {
const { render } = createRenderer();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ import {
} from '@mui/x-data-grid-premium';
import { spy } from 'sinon';

const isJSDOM = /jsdom/.test(window.navigator.userAgent);

interface BaselineProps extends DataGridPremiumProps {
rows: GridRowsProp;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import { createRenderer, act } from '@mui/internal-test-utils';
import { expect } from 'chai';
import { getColumnValues } from 'test/utils/helperFn';

const isJSDOM = /jsdom/.test(window.navigator.userAgent);

const rows: GridRowsProp = [
{ id: 0, category: 'Cat A' },
{ id: 1, category: 'Cat A' },
Expand Down
6 changes: 1 addition & 5 deletions packages/x-data-grid-pro/src/DataGridPro/DataGridPro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
} from '@mui/x-data-grid';
import { validateProps } from '@mui/x-data-grid/internals';
import { forwardRef } from '@mui/x-internals/forwardRef';
import deprecatedPropType from '@mui/utils/deprecatedPropType';
import { useDataGridProComponent } from './useDataGridProComponent';
import { DataGridProProps } from '../models/dataGridProProps';
import { useDataGridProProps } from './useDataGridProProps';
Expand Down Expand Up @@ -105,10 +104,7 @@ DataGridProRaw.propTypes = {
* <DataGrid />
* </div>
*/
autoHeight: deprecatedPropType(
PropTypes.bool,
'Use flex parent container instead: https://mui.com/r/x-grid-deprecate-auto-height.',
),
autoHeight: PropTypes.bool,
/**
* If `true`, the pageSize is calculated according to the container size and the max number of rows to avoid rendering a vertical scroll bar.
* @default false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ describe('<DataGridPro /> - Detail panel', () => {
const getDetailPanelHeight = spy(() => 100);
const { setProps } = render(
<TestCase
autoHeight
columns={[{ field: 'brand' }]}
rows={[
{ id: 0, brand: 'Nike' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ import * as React from 'react';
import { spy } from 'sinon';
import { getColumnHeaderCell, getColumnValues, getSelectInput, grid } from 'test/utils/helperFn';

const isJSDOM = /jsdom/.test(window.navigator.userAgent);

const SUBMIT_FILTER_STROKE_TIME = DATA_GRID_PRO_PROPS_DEFAULT_VALUES.filterDebounceMs;

const isJSDOM = /jsdom/.test(window.navigator.userAgent);

describe('<DataGridPro /> - Filter', () => {
const { clock, render } = createRenderer({ clock: 'fake' });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ describe('<DataGridPro /> - Layout', () => {
<div style={{ width: 300, height: 300 }}>
<DataGridPro
{...baselineProps}
autoHeight
headerFilters
columnHeaderHeight={20}
headerFilterHeight={32}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import {
getColumnValues,
} from 'test/utils/helperFn';

const isJSDOM = /jsdom/.test(window.navigator.userAgent);

const rows: GridRowsProp = [
{ id: 0, category: 'Cat A' },
{ id: 1, category: 'Cat A' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ import {
GridPaginationModel,
} from '@mui/x-data-grid-pro';

const isJSDOM = /jsdom/.test(window.navigator.userAgent);

const rowsWithoutGap: GridRowsProp = [
{ name: 'A' },
{ name: 'A.A' },
Expand Down
6 changes: 1 addition & 5 deletions packages/x-data-grid/src/DataGrid/DataGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import * as React from 'react';
import PropTypes from 'prop-types';
import { forwardRef } from '@mui/x-internals/forwardRef';
import deprecatedPropType from '@mui/utils/deprecatedPropType';
import { GridBody, GridFooterPlaceholder, GridHeader, GridRoot } from '../components';
import { useGridAriaAttributes } from '../hooks/utils/useGridAriaAttributes';
import { useGridRowAriaAttributes } from '../hooks/features/rows/useGridRowAriaAttributes';
Expand Down Expand Up @@ -115,10 +114,7 @@ DataGridRaw.propTypes = {
* <DataGrid />
* </div>
*/
autoHeight: deprecatedPropType(
PropTypes.bool,
'Use flex parent container instead: https://mui.com/r/x-grid-deprecate-auto-height.',
),
autoHeight: PropTypes.bool,
/**
* If `true`, the pageSize is calculated according to the container size and the max number of rows to avoid rendering a vertical scroll bar.
* @default false
Expand Down
2 changes: 0 additions & 2 deletions packages/x-data-grid/src/tests/filterPanel.DataGrid.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ function CustomInputValue(props: GridFilterInputValueProps) {
);
}

const isJSDOM = /jsdom/.test(window.navigator.userAgent);

describe('<DataGrid /> - Filter panel', () => {
const { render, clock } = createRenderer({ clock: 'fake' });

Expand Down
1 change: 1 addition & 0 deletions packages/x-data-grid/src/tests/keyboard.DataGrid.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ describe('<DataGrid /> - Keyboard', () => {
return (
<div style={{ width: 300, height: HEIGHT }}>
<DataGrid
autoHeight={isJSDOM}
rows={data.rows}
columns={transformColSizes(data.columns)}
initialState={{ pagination: { paginationModel: { pageSize: PAGE_SIZE } } }}
Expand Down
2 changes: 1 addition & 1 deletion packages/x-data-grid/src/tests/rows.DataGrid.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,7 @@ describe('<DataGrid /> - Rows', () => {

it('should throw a console error if autoPageSize is used with autoHeight', () => {
expect(() => {
render(<TestCase autoPageSize />);
render(<TestCase autoPageSize autoHeight />);
}).toErrorDev(
[
'MUI X: `<DataGrid autoPageSize={true} autoHeight={true} />` are not valid props.',
Expand Down

0 comments on commit 0da9c23

Please sign in to comment.