Skip to content

Commit

Permalink
chore(FilterPanel): deprecate filter panel and its sub components (#6431
Browse files Browse the repository at this point in the history
)

* chore(FilterPanel): deprecare filter panel and its sub components

* chore: change headind to Deprecation notice

---------

Co-authored-by: David Menendez <damenend@gmail.com>
Co-authored-by: elysia <elysia.hwang@gmail.com>
  • Loading branch information
3 people authored Nov 20, 2024
1 parent a59dd7c commit 5fb804a
Show file tree
Hide file tree
Showing 29 changed files with 216 additions and 8 deletions.
2 changes: 1 addition & 1 deletion e2e/components/FilterPanel/FilterPanel-test.avt.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test.describe('FilterPanel @avt', () => {
test('@avt-default-state', async ({ page }) => {
await visitStory(page, {
component: 'FilterPanel',
id: 'experimental-components-filter-panel-filterpanel--default',
id: 'deprecated-filter-panel-filterpanel--default',
globals: {
carbonTheme: 'white',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ const componentName = 'FilterPanel';

/**
* The container for filter panel subcomponents.
* @deprecated This component is deprecated
*/

export let FilterPanel = React.forwardRef(
({ children, className, title, ...rest }, ref) => {
return (
Expand All @@ -35,6 +37,10 @@ export let FilterPanel = React.forwardRef(
);
}
);
FilterPanel.deprecated = {
level: 'warn',
details: `This component is deprecated`,
};

// Return a placeholder if not released and not enabled by feature flag
FilterPanel = pkg.checkComponentEnabled(FilterPanel, componentName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ import * as FilterPanelStories from './FilterPanel.stories';
- [Example usage](#example-usage)
- [Component API](#component-api)

## Deprecation notice

> This component is deprecated and will be removed in the next major version.

## Overview

The `FilterPanel` is the container for its subcomponents.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ import {
import mdx from './FilterPanel.mdx';

import styles from './_storybook-styles.scss?inline';
import { Annotation } from '../../../../core/.storybook/Annotation';

const storyClass = 'filter-panel-stories';

export default {
title: 'Experimental/Components/Filter panel/FilterPanel',
title: 'Deprecated/Filter panel/FilterPanel',
component: FilterPanel,
tags: ['autodocs'],
parameters: {
Expand Down Expand Up @@ -64,6 +65,21 @@ export default {
args: {
title: 1,
},
decorators: [
(story) => (
<Annotation
type="deprecation-notice"
text={
<div>
This component is deprecated and will be removed in the next major
version.
</div>
}
>
{story()}
</Annotation>
),
],
};

const demoData = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ const renderComponent = ({ ...rest } = {}) =>
render(<FilterPanel data-testid={dataTestId} {...{ ...rest }} />);

describe(componentName, () => {
beforeEach(() => {
jest.spyOn(console, 'warn').mockImplementation(() => {});
});
it('renders a component FilterPanel', async () => {
renderComponent();
expect(screen.getByTestId(dataTestId)).toBeInTheDocument();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const defaults = {

/**
* A container with a label and optional count.
* @deprecated This component is deprecated
*/
export let FilterPanelAccordion = React.forwardRef(
(
Expand Down Expand Up @@ -62,6 +63,11 @@ export let FilterPanelAccordion = React.forwardRef(
}
);

FilterPanelAccordion.deprecated = {
level: 'warn',
details: `This component is deprecated`,
};

// Return a placeholder if not released and not enabled by feature flag
FilterPanelAccordion = pkg.checkComponentEnabled(
FilterPanelAccordion,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ import * as FilterPanelAccordionStories from './FilterPanelAccordion.stories';
- [Example usage](#example-usage)
- [Component API](#component-api)

## Deprecation notice

> This component is deprecated and will be removed in the next major version.

## Overview

The `FilterPanelAccordion` is a container required for grouping
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ import mdx from './FilterPanelAccordion.mdx';
import uuidv4 from '../../../global/js/utils/uuidv4';

import styles from '../_storybook-styles.scss?inline';
import { Annotation } from '../../../../../core/.storybook/Annotation';

const storyClass = 'filter-panel-stories';

export default {
title: 'Experimental/Components/Filter panel/FilterPanelAccordion',
title: 'Deprecated/Filter panel/FilterPanelAccordion',
component: FilterPanelAccordion,
tags: ['autodocs'],
parameters: {
Expand Down Expand Up @@ -74,6 +75,21 @@ export default {
count: 1,
labelText: 0,
},
decorators: [
(story) => (
<Annotation
type="deprecation-notice"
text={
<div>
This component is deprecated and will be removed in the next major
version.
</div>
}
>
{story()}
</Annotation>
),
],
};

const Template = (args) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ const renderComponent = ({ ...rest } = {}) =>
);

describe(componentName, () => {
beforeEach(() => {
jest.spyOn(console, 'warn').mockImplementation(() => {});
});
const { getComputedStyle } = window;

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const defaults = {

/**
* A container with a label and optional count.
* @deprecated This component is deprecated
*/
export let FilterPanelAccordionItem = React.forwardRef(
(
Expand Down Expand Up @@ -72,6 +73,10 @@ export let FilterPanelAccordionItem = React.forwardRef(
}
);

FilterPanelAccordionItem.deprecated = {
level: 'warn',
details: `This component is deprecated`,
};
// Return a placeholder if not released and not enabled by feature flag
FilterPanelAccordionItem = pkg.checkComponentEnabled(
FilterPanelAccordionItem,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ import * as FilterPanelAccordionItemStories from './FilterPanelAccordionItem.sto
- [Truncated usage](#truncated-usage)
- [Component API](#component-api)

## Deprecation notice

> This component is deprecated and will be removed in the next major version.

## Overview

The `FilterPanelAccordionItem` can be expanded and collapsed and will accept any
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ import mdx from './FilterPanelAccordionItem.mdx';
import uuidv4 from '../../../global/js/utils/uuidv4';

import styles from '../_storybook-styles.scss?inline';
import { Annotation } from '../../../../../core/.storybook/Annotation';

const storyClass = 'filter-panel-stories';

export default {
title: 'Experimental/Components/Filter panel/FilterPanelAccordionItem',
title: 'Deprecated/Filter panel/FilterPanelAccordionItem',
component: FilterPanelAccordionItem,
tags: ['autodocs'],
parameters: {
Expand Down Expand Up @@ -77,6 +78,21 @@ export default {
count: 1,
labelText: 0,
},
decorators: [
(story) => (
<Annotation
type="deprecation-notice"
text={
<div>
This component is deprecated and will be removed in the next major
version.
</div>
}
>
{story()}
</Annotation>
),
],
};

const Template = (args) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ const renderComponent = ({ ...rest } = {}) =>
);

describe(componentName, () => {
beforeEach(() => {
jest.spyOn(console, 'warn').mockImplementation(() => {});
});
it('renders a component FilterPanelAccordionItem', async () => {
const { container } = renderComponent();
const component = container.querySelector(`.${blockClass}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const componentName = 'FilterPanelCheckbox';
*
* All of Carbon Checkbox's props are directly available
* through "...rest", including id, onClick, etc.
* @deprecated This component is deprecated
*/
export let FilterPanelCheckbox = React.forwardRef(
({ className, count, id, labelText, title, ...rest }, ref) => {
Expand All @@ -44,6 +45,11 @@ export let FilterPanelCheckbox = React.forwardRef(
}
);

FilterPanelCheckbox.deprecated = {
level: 'warn',
details: `This component is deprecated`,
};

// Return a placeholder if not released and not enabled by feature flag
FilterPanelCheckbox = pkg.checkComponentEnabled(
FilterPanelCheckbox,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ import * as FilterPanelCheckboxStories from './FilterPanelCheckbox.stories';
- [Example usage](#example-usage)
- [Component API](#component-api)

## Deprecation notice

> This component is deprecated and will be removed in the next major version.

## Overview

The `FilterPanelCheckbox` is a modified Carbon `Checkbox` and accepts both a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ import { FilterPanel, FilterPanelCheckbox } from '..';
import mdx from './FilterPanelCheckbox.mdx';

import styles from '../_storybook-styles.scss?inline';
import { Annotation } from '../../../../../core/.storybook/Annotation';

const storyClass = 'filter-panel-stories';

export default {
title: 'Experimental/Components/Filter panel/FilterPanelCheckbox',
title: 'Deprecated/Filter panel/FilterPanelCheckbox',
component: FilterPanelCheckbox,
tags: ['autodocs'],
argTypes: {
Expand Down Expand Up @@ -72,6 +73,21 @@ export default {
page: mdx,
},
},
decorators: [
(story) => (
<Annotation
type="deprecation-notice"
text={
<div>
This component is deprecated and will be removed in the next major
version.
</div>
}
>
{story()}
</Annotation>
),
],
};

const Template = (args) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ const renderComponent = ({ ...rest } = {}) =>
);

describe(componentName, () => {
beforeEach(() => {
jest.spyOn(console, 'warn').mockImplementation(() => {});
});
it('renders a component FilterPanelCheckbox', async () => {
const { container } = renderComponent();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const defaults = {
* just like FilterPanelCheckbox.
*
* Use `overflowMenuProps` for properties specific to the OverflowMenu.
* @deprecated This component is deprecated
*/
export let FilterPanelCheckboxWithOverflow = React.forwardRef(
(
Expand Down Expand Up @@ -122,6 +123,11 @@ export let FilterPanelCheckboxWithOverflow = React.forwardRef(
}
);

FilterPanelCheckboxWithOverflow.deprecated = {
level: 'warn',
details: `This component is deprecated`,
};

// Return a placeholder if not released and not enabled by feature flag
FilterPanelCheckboxWithOverflow = pkg.checkComponentEnabled(
FilterPanelCheckboxWithOverflow,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ import * as FilterPanelCheckboxWithOverflowStories from './FilterPanelCheckboxWi
- [Example usage](#example-usage)
- [Component API](#component-api)

## Deprecation notice

> This component is deprecated and will be removed in the next major version.

## Overview

The `FilterPanelCheckboxWithOverflow` is like `FilterPanelCheckbox`, but
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ import { FilterPanelCheckboxWithOverflow } from '.';
import mdx from './FilterPanelCheckboxWithOverflow.mdx';

import styles from '../_storybook-styles.scss?inline';
import { Annotation } from '../../../../../core/.storybook/Annotation';

const storyClass = 'filter-panel-stories';

export default {
title: 'Experimental/Components/Filter panel/FilterPanelCheckboxWithOverflow',
title: 'Deprecated/Filter panel/FilterPanelCheckboxWithOverflow',
component: FilterPanelCheckboxWithOverflow,
tags: ['autodocs'],
argTypes: {
Expand Down Expand Up @@ -75,6 +76,21 @@ export default {
page: mdx,
},
},
decorators: [
(story) => (
<Annotation
type="deprecation-notice"
text={
<div>
This component is deprecated and will be removed in the next major
version.
</div>
}
>
{story()}
</Annotation>
),
],
};

const Template = (args) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ const renderComponent = ({ ...rest } = {}) =>
);

describe(componentName, () => {
beforeEach(() => {
jest.spyOn(console, 'warn').mockImplementation(() => {});
});
it('renders a component FilterPanelCheckboxWithOverflow', async () => {
renderComponent();
expect(screen.getByRole('checkbox')).toBeInTheDocument();
Expand Down
Loading

0 comments on commit 5fb804a

Please sign in to comment.