Skip to content

Commit

Permalink
chore(rebase v6): Rebase v6 branch
Browse files Browse the repository at this point in the history
  • Loading branch information
tlabaj committed Nov 20, 2023
2 parents e097336 + fc8f6eb commit c6b20d1
Show file tree
Hide file tree
Showing 218 changed files with 9,163 additions and 9,118 deletions.
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Javascript builds
node_modules
dist
__tests__
thirdparty
tsc_out
.out
Expand Down
9 changes: 9 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,15 @@
"rules": {
"patternfly-react/no-anonymous-functions": "off"
}
},
{
"files": ["**/*.test.[jt]s?(x)"],
"extends": ["plugin:testing-library/react"],
"rules": {
"testing-library/no-node-access": "off",
"react/jsx-key": "off",
"no-console": "off"
}
}
]
}
2 changes: 1 addition & 1 deletion .github/workflows/pr-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
node_modules
**/node_modules
~/.cache/Cypress
key: ${{ runner.os }}-yarn-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }}
key: ${{ runner.os }}-yarn-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock', 'packages/*/package.json') }}
- run: yarn install --frozen-lockfile
if: steps.yarn-cache.outputs.cache-hit != 'true'
- uses: actions/cache@v2
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = {
],
roots: ['<rootDir>/packages'],
transform: {
'^.+\\.[jt]sx?$': 'babel-jest',
'^.+\\.m?[jt]sx?$': 'babel-jest',
'^.+\\.svg$': 'jest-transform-stub'
},
setupFilesAfterEnv: ['<rootDir>/packages/testSetup.ts'],
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "14.5.1",
"@types/jest": "29.5.5",
"@types/jest": "29.5.8",
"@types/react": "^18",
"@types/react-dom": "^18",
"@typescript-eslint/eslint-plugin": "^5.59.2",
Expand All @@ -50,6 +50,7 @@
"eslint-plugin-markdown": "^3.0.0",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-testing-library": "^6.1.0",
"fs-extra": "^11.1.1",
"glob": "^9.3.0",
"husky": "^4.3.0",
Expand All @@ -64,7 +65,8 @@
"react-dom": "^18",
"surge": "^0.23.1",
"ts-patch": "^2.1.0",
"typescript": "^4.7.4"
"typescript": "^4.7.4",
"ts-node": "^10.9.1"
},
"scripts": {
"build": "yarn clean && yarn build:generate && yarn build:esm && yarn build:cjs && yarn build:subpaths && yarn build:single:packages",
Expand All @@ -84,6 +86,7 @@
"lint:md": "yarn eslint packages --ext md --no-eslintrc --config .eslintrc-md.json --cache",
"lint:ts": "yarn lint packages/*/src",
"lint:versions": "node scripts/verifyPatternflyVersions.js",
"lint:tests": "yarn lint packages/*/src/components/*/__tests__/*.test.*",
"prepare": "ts-patch install -s",
"serve:docs": "yarn workspace @patternfly/react-docs serve",
"serve:integration": "lerna run serve:demo-app",
Expand Down
8 changes: 8 additions & 0 deletions packages/react-charts/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline

**Note:** Version bump only for package @patternfly/react-charts

# 7.2.0-prerelease.7 (2023-11-10)

**Note:** Version bump only for package @patternfly/react-charts

# 7.2.0-prerelease.6 (2023-11-03)

**Note:** Version bump only for package @patternfly/react-charts

# 7.2.0-prerelease.5 (2023-10-26)

**Note:** Version bump only for package @patternfly/react-charts
Expand Down
48 changes: 48 additions & 0 deletions packages/react-code-editor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,54 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline

**Note:** Version bump only for package @patternfly/react-code-editor

# [5.2.0-prerelease.31](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-code-editor@5.2.0-prerelease.30...@patternfly/react-code-editor@5.2.0-prerelease.31) (2023-11-17)

**Note:** Version bump only for package @patternfly/react-code-editor

# [5.2.0-prerelease.30](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-code-editor@5.2.0-prerelease.29...@patternfly/react-code-editor@5.2.0-prerelease.30) (2023-11-16)

**Note:** Version bump only for package @patternfly/react-code-editor

# [5.2.0-prerelease.29](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-code-editor@5.2.0-prerelease.28...@patternfly/react-code-editor@5.2.0-prerelease.29) (2023-11-14)

**Note:** Version bump only for package @patternfly/react-code-editor

# [5.2.0-prerelease.28](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-code-editor@5.2.0-prerelease.27...@patternfly/react-code-editor@5.2.0-prerelease.28) (2023-11-14)

**Note:** Version bump only for package @patternfly/react-code-editor

# [5.2.0-prerelease.27](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-code-editor@5.2.0-prerelease.26...@patternfly/react-code-editor@5.2.0-prerelease.27) (2023-11-14)

**Note:** Version bump only for package @patternfly/react-code-editor

# [5.2.0-prerelease.26](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-code-editor@5.2.0-prerelease.25...@patternfly/react-code-editor@5.2.0-prerelease.26) (2023-11-13)

**Note:** Version bump only for package @patternfly/react-code-editor

# [5.2.0-prerelease.25](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-code-editor@5.2.0-prerelease.24...@patternfly/react-code-editor@5.2.0-prerelease.25) (2023-11-10)

**Note:** Version bump only for package @patternfly/react-code-editor

# [5.2.0-prerelease.24](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-code-editor@5.2.0-prerelease.23...@patternfly/react-code-editor@5.2.0-prerelease.24) (2023-11-03)

**Note:** Version bump only for package @patternfly/react-code-editor

# [5.2.0-prerelease.23](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-code-editor@5.2.0-prerelease.22...@patternfly/react-code-editor@5.2.0-prerelease.23) (2023-11-03)

**Note:** Version bump only for package @patternfly/react-code-editor

# [5.2.0-prerelease.22](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-code-editor@5.2.0-prerelease.21...@patternfly/react-code-editor@5.2.0-prerelease.22) (2023-11-02)

**Note:** Version bump only for package @patternfly/react-code-editor

# [5.2.0-prerelease.21](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-code-editor@5.2.0-prerelease.20...@patternfly/react-code-editor@5.2.0-prerelease.21) (2023-11-02)

**Note:** Version bump only for package @patternfly/react-code-editor

# [5.2.0-prerelease.20](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-code-editor@5.2.0-prerelease.19...@patternfly/react-code-editor@5.2.0-prerelease.20) (2023-11-02)

**Note:** Version bump only for package @patternfly/react-code-editor

# [5.2.0-prerelease.19](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-code-editor@5.2.0-prerelease.18...@patternfly/react-code-editor@5.2.0-prerelease.19) (2023-10-30)

**Note:** Version bump only for package @patternfly/react-code-editor
Expand Down
70 changes: 70 additions & 0 deletions packages/react-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,76 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline

- **Drawer:** Added start and end to position props, updated resizing to work with RTL ([#9627](https://github.com/patternfly/patternfly-react/issues/9627)) ([e12b872](https://github.com/patternfly/patternfly-react/commit/e12b8726b9ebc2fec921b7316a270a9c09decf96))

# [5.2.0-prerelease.31](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-core@5.2.0-prerelease.30...@patternfly/react-core@5.2.0-prerelease.31) (2023-11-17)

**Note:** Version bump only for package @patternfly/react-core

# [5.2.0-prerelease.30](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-core@5.2.0-prerelease.29...@patternfly/react-core@5.2.0-prerelease.30) (2023-11-16)

### Bug Fixes

- **Chip:** update tooltip vis when chip updates ([#9819](https://github.com/patternfly/patternfly-react/issues/9819)) ([18c140a](https://github.com/patternfly/patternfly-react/commit/18c140a2adcc1833e4b095755aa7495d1d88a177))

# [5.2.0-prerelease.29](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-core@5.2.0-prerelease.28...@patternfly/react-core@5.2.0-prerelease.29) (2023-11-14)

**Note:** Version bump only for package @patternfly/react-core

# [5.2.0-prerelease.28](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-core@5.2.0-prerelease.27...@patternfly/react-core@5.2.0-prerelease.28) (2023-11-14)

**Note:** Version bump only for package @patternfly/react-core

# [5.2.0-prerelease.27](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-core@5.2.0-prerelease.26...@patternfly/react-core@5.2.0-prerelease.27) (2023-11-14)

**Note:** Version bump only for package @patternfly/react-core

# [5.2.0-prerelease.26](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-core@5.2.0-prerelease.25...@patternfly/react-core@5.2.0-prerelease.26) (2023-11-13)

### Bug Fixes

- **DatePicker:** updated logic for parsing and focus management ([#9794](https://github.com/patternfly/patternfly-react/issues/9794)) ([a12cf31](https://github.com/patternfly/patternfly-react/commit/a12cf313f0924a61a8cf20ee78b4b27290b9c05f))

# [5.2.0-prerelease.25](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-core@5.2.0-prerelease.24...@patternfly/react-core@5.2.0-prerelease.25) (2023-11-10)

**Note:** Version bump only for package @patternfly/react-core

# [5.2.0-prerelease.24](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-core@5.2.0-prerelease.23...@patternfly/react-core@5.2.0-prerelease.24) (2023-11-03)

### Bug Fixes

- **ClipboardCopy:** kepp caret position ([#9772](https://github.com/patternfly/patternfly-react/issues/9772)) ([981361e](https://github.com/patternfly/patternfly-react/commit/981361e0de354bbe06c4a799b6e7c92228dab51f))

### Features

- **Datalist:** implement full page Basic demo to match HTML [#9048](https://github.com/patternfly/patternfly-react/issues/9048) ([#9087](https://github.com/patternfly/patternfly-react/issues/9087)) ([ab18059](https://github.com/patternfly/patternfly-react/commit/ab1805993ed5e2b5ed3d2f1be4131e035152b468))

# [5.2.0-prerelease.23](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-core@5.2.0-prerelease.22...@patternfly/react-core@5.2.0-prerelease.23) (2023-11-03)

**Note:** Version bump only for package @patternfly/react-core

# [5.2.0-prerelease.22](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-core@5.2.0-prerelease.21...@patternfly/react-core@5.2.0-prerelease.22) (2023-11-02)

### Bug Fixes

- **TreeView:** define button type ([#9770](https://github.com/patternfly/patternfly-react/issues/9770)) ([a772c6d](https://github.com/patternfly/patternfly-react/commit/a772c6d67bfa4154979ee14a34ec954406503109))

# [5.2.0-prerelease.21](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-core@5.2.0-prerelease.20...@patternfly/react-core@5.2.0-prerelease.21) (2023-11-02)

### Bug Fixes

- **Notification Drawer:** Added screen reader text for notification drawer item read state ([#9569](https://github.com/patternfly/patternfly-react/issues/9569)) ([bc19f91](https://github.com/patternfly/patternfly-react/commit/bc19f9148e872fb62d8cd2bf644a771d9c5650d7))
- **Text input:** Added aria-expanded ([#9705](https://github.com/patternfly/patternfly-react/issues/9705)) ([7f6a62c](https://github.com/patternfly/patternfly-react/commit/7f6a62c1a3f860a8759c63cde17da6b763dd7b48))
- **Wizard:** onStepChange - skip isDisabled & isHidden ([#9748](https://github.com/patternfly/patternfly-react/issues/9748)) ([4d4d623](https://github.com/patternfly/patternfly-react/commit/4d4d623d294bbc7821c6dc9156980f2b8c609c96))

### Features

- **Wizard:** ability to add props to WizardFooter buttons ([#9709](https://github.com/patternfly/patternfly-react/issues/9709)) ([9f21cee](https://github.com/patternfly/patternfly-react/commit/9f21cee5438c8ec4d0e2c5c938f9fffda013757b))

# [5.2.0-prerelease.20](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-core@5.2.0-prerelease.19...@patternfly/react-core@5.2.0-prerelease.20) (2023-11-02)

### Bug Fixes

- **RTL:** added right-to-left page demo ([#9694](https://github.com/patternfly/patternfly-react/issues/9694)) ([d7308ae](https://github.com/patternfly/patternfly-react/commit/d7308aebec1e3ff22df548b5613f058c9ba35262))

# [5.2.0-prerelease.19](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-core@5.2.0-prerelease.18...@patternfly/react-core@5.2.0-prerelease.19) (2023-10-30)

**Note:** Version bump only for package @patternfly/react-core
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ import { render } from '@testing-library/react';
import { AboutModalBox } from '../AboutModalBox';

test('AboutModalBox Test', () => {
const { asFragment } = render(
<AboutModalBox aria-labelledby="id">
This is a AboutModalBox
</AboutModalBox>
);
const { asFragment } = render(<AboutModalBox aria-labelledby="id">This is a AboutModalBox</AboutModalBox>);
expect(asFragment()).toMatchSnapshot();
});
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ test('Renders children', () => {
});

test('Matches the snapshot', () => {
const { asFragment } = render(
<AccordionItem>Test</AccordionItem>
);
const { asFragment } = render(<AccordionItem>Test</AccordionItem>);
expect(asFragment()).toMatchSnapshot();
});
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ test('Alert Group renders without children', () => {
});

test('Alert Group works with n children', () => {
const { asFragment } = render(
render(
<AlertGroup data-testid="container">
<Alert variant="success" title="alert title" />
<Alert variant="warning" title="another alert title" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,11 @@ test('Clicking backToTop scrolls back to top of the element passed via scrollabl
const user = userEvent.setup();
const wrapper = document.getElementById('backToTopWrapper');
fireEvent.scroll(wrapper as HTMLElement, { target: { scrollY: 401 } });
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
wrapper!.scrollTo = jest.fn();
await user.click(screen.getByRole(`button`).parentElement as Element);

expect(wrapper?.scrollTo).toBeCalledTimes(1);
expect(wrapper?.scrollTo).toHaveBeenCalledTimes(1);
});

test('Passes correct text content to button child component', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-core/src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import styles from '@patternfly/react-styles/css/components/Button/button';
import { css } from '@patternfly/react-styles';
import { Spinner, spinnerSize } from '../Spinner';
import { useOUIAProps, OUIAProps } from '../../helpers';
import { useOUIAProps, OUIAProps } from '../../helpers/OUIA/ouia';
import { Badge } from '../Badge';

export enum ButtonVariant {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from 'react';

import { render, screen } from '@testing-library/react';

import CartArrowDownIcon from '@patternfly/react-icons/dist/esm/icons/cart-arrow-down-icon';
import { Button, ButtonVariant } from '../Button';

Object.values(ButtonVariant).forEach((variant) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ test('Next year dates have correct year in aria label', () => {
});

test('InlineProps render correct wrapper component and attributes', () => {
render(<CalendarMonth inlineProps={{component: 'article', title: <div id="hi">Title</div>, ariaLabelledby: "hi"}} />);
render(
<CalendarMonth inlineProps={{ component: 'article', title: <div id="hi">Title</div>, ariaLabelledby: 'hi' }} />
);

const article = screen.getByRole('article');
expect(article).toHaveAttribute('aria-labelledby', 'hi');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('CardBody', () => {
test('allows passing in a React Component as the component', () => {
const Component = () => <div>im a div</div>;

render(<CardBody component={(Component as unknown) as keyof JSX.IntrinsicElements} />);
render(<CardBody component={Component as unknown as keyof JSX.IntrinsicElements} />);
expect(screen.getByText('im a div')).toBeInTheDocument();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('CardFooter', () => {

test('allows passing in a React Component as the component', () => {
const Component = () => <div>im a div</div>;
render(<CardFooter component={(Component as unknown) as keyof JSX.IntrinsicElements} />);
render(<CardFooter component={Component as unknown as keyof JSX.IntrinsicElements} />);
expect(screen.getByText('im a div')).toBeInTheDocument();
});
});
11 changes: 11 additions & 0 deletions packages/react-core/src/components/Chip/Chip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,17 @@ class Chip extends React.Component<ChipProps, ChipState> {
});
}

componentDidUpdate(_prevProps: ChipProps, prevState: ChipState) {
const nextIsTooltipVisible = Boolean(
this.span.current && this.span.current.offsetWidth < this.span.current.scrollWidth
);
if (prevState.isTooltipVisible !== nextIsTooltipVisible) {
this.setState({
isTooltipVisible: nextIsTooltipVisible
});
}
}

setChipStyle = () => ({
[cssChipTextMaxWidth.name]: this.props.textMaxWidth
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ test('chip group with closeBtnAriaLabel', () => {
</ChipGroup>
);
expect(screen.getByLabelText('close button aria label')).toBeInTheDocument();
expect(screen.getByLabelText('close button aria label')).toHaveAccessibleName("close button aria label category");
expect(screen.getByLabelText('close button aria label')).toHaveAccessibleName('close button aria label category');
});

test('chip group onClick', async () => {
Expand Down Expand Up @@ -169,8 +169,6 @@ test('chip group expanded', async () => {
});

test('overflow chip does not render by default when < 4 children are passed', async () => {
const user = userEvent.setup();

render(
<ChipGroup>
<Chip>1</Chip>
Expand All @@ -183,8 +181,6 @@ test('overflow chip does not render by default when < 4 children are passed', as
});

test('overflow chip collapsed by default', async () => {
const user = userEvent.setup();

render(
<ChipGroup>
<Chip>1</Chip>
Expand Down
Loading

0 comments on commit c6b20d1

Please sign in to comment.