From 1d5b2bba06ddb6874b85a83a2717cb4e0f8e451e Mon Sep 17 00:00:00 2001 From: Cee Chen Date: Fri, 22 Mar 2024 09:36:21 -0700 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=94=A5=20Remove=20completely=20unused?= =?UTF-8?q?=20`EuiTableHeaderButton`=20component?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No idea what's going on with this export?? It's not used in EUI or anywhere in Elastic. Just going to get rid of it --- .../table_header_button.test.tsx.snap | 12 ----- src/components/table/index.ts | 2 - .../table/table_header_button.test.tsx | 21 -------- src/components/table/table_header_button.tsx | 53 ------------------- 4 files changed, 88 deletions(-) delete mode 100644 src/components/table/__snapshots__/table_header_button.test.tsx.snap delete mode 100644 src/components/table/table_header_button.test.tsx delete mode 100644 src/components/table/table_header_button.tsx diff --git a/src/components/table/__snapshots__/table_header_button.test.tsx.snap b/src/components/table/__snapshots__/table_header_button.test.tsx.snap deleted file mode 100644 index 4233eccc4b4..00000000000 --- a/src/components/table/__snapshots__/table_header_button.test.tsx.snap +++ /dev/null @@ -1,12 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`EuiTableHeaderButton is rendered 1`] = ` - -`; diff --git a/src/components/table/index.ts b/src/components/table/index.ts index 6946313be67..2492b31fc61 100644 --- a/src/components/table/index.ts +++ b/src/components/table/index.ts @@ -15,8 +15,6 @@ export type { EuiTableFooterCellProps } from './table_footer_cell'; export { EuiTableFooterCell } from './table_footer_cell'; export type { EuiTableHeaderProps } from './table_header'; export { EuiTableHeader } from './table_header'; -export type { EuiTableHeaderButtonProps } from './table_header_button'; -export { EuiTableHeaderButton } from './table_header_button'; export type { EuiTableHeaderCellProps } from './table_header_cell'; export { EuiTableHeaderCell } from './table_header_cell'; export type { EuiTableHeaderCellCheckboxProps } from './table_header_cell_checkbox'; diff --git a/src/components/table/table_header_button.test.tsx b/src/components/table/table_header_button.test.tsx deleted file mode 100644 index 0edd06ab3b8..00000000000 --- a/src/components/table/table_header_button.test.tsx +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import React from 'react'; -import { requiredProps } from '../../test/required_props'; -import { render } from '../../test/rtl'; - -import { EuiTableHeaderButton } from './table_header_button'; - -describe('EuiTableHeaderButton', () => { - test('is rendered', () => { - const { container } = render(); - - expect(container.firstChild).toMatchSnapshot(); - }); -}); diff --git a/src/components/table/table_header_button.tsx b/src/components/table/table_header_button.tsx deleted file mode 100644 index 4bcc4208a84..00000000000 --- a/src/components/table/table_header_button.tsx +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import React, { ButtonHTMLAttributes, FunctionComponent } from 'react'; -import classNames from 'classnames'; -import { CommonProps } from '../common'; -import { EuiInnerText } from '../inner_text'; - -import { IconType, EuiIcon } from '../icon'; - -export type EuiTableHeaderButtonProps = CommonProps & - ButtonHTMLAttributes & { - iconType?: IconType; - }; - -export const EuiTableHeaderButton: FunctionComponent< - EuiTableHeaderButtonProps -> = ({ children, className, iconType, ...rest }) => { - const classes = classNames('euiTableHeaderButton', className); - - // Add an icon to the button if one exists. - let buttonIcon; - - if (iconType) { - buttonIcon = ( -