Skip to content

Commit

Permalink
Bump antd to 3.26.20 (jaegertracing#1247)
Browse files Browse the repository at this point in the history
## Which problem is this PR solving?
- Contributes towards jaegertracing#1199 

## Short description of the changes
With the TS update it now seems possible to update `antd`. There are two
eventual benefits:
* antd v4 contains React 18-compatible typings,
* antd v4 supports [treeshakeable SVG
icons](https://github.com/ant-design/ant-design/blob/4.24.8/docs/react/migration-v4.en-US.md#icon-upgrade),
reducing the bundle size.

The [migration
guide](https://github.com/ant-design/ant-design/blob/4.24.8/docs/react/migration-v4.en-US.md)
recommends updating to the latest v3 release before going to v4.

Apart from ubiquitous snapshot changes, a few adjustments were necessary
in components and tests:
* The test case for the `<Page />` component that aimed to verify that
the header was not rendered in embedded mode was only working by
accident since 53937eb—the `Header`
component didn't have a display name, so the test wouldn't find it even
though the test setup was no longer correct. Fix the test setup to setup
the `embedded` prop accordingly.
* antd's `Menu` component is now wrapped in a `Context.Consumer`, so
tests using enzyme's shallow rendering need to `dive` into it to be able
to find the child components they are looking for.
* The `Upload` component has more strictly typed props now, so the
signature of the `loadJsonFile` prop had to be adjusted accordingly. The
handling code was only accessing the `file` property of `FileList`, and
the real type supplied by the event handler also has a `file` property,
so no code changes were required apart from the typing update.
* The `Table` component has one more internal wrapper (each passing down
the `className` prop to the next), so the test in `TraceSpanView` had to
be updated accordingly.
* The `onCell` event handler for `Table`s is now strictly typed, so
`DetailTable` needed an update to return an empty object `{}` if it
intends to set no props. This is consistent with the upstream
[examples](https://github.com/react-component/table/blob/83cce50ddb0a55d63bb0f435d3f4ff7e3301ebad/docs/examples/colspan-rowspan.tsx#L25).
* `KeyboardShortcutsHelp` was setting a spurious `align` prop on
`Modal`, which was already not part of its typings in 3.9.0 but was
still present as a prop type. This caused a type error now that the prop
type was removed.
* In manual testing, I observed that the name selectors (e.g. "Group
By") on the trace statistics view were not functioning—they would
immediately close when clicking to open them. I thought this was a
regression caused by the update, but experienced the same behavior on
`main`. This was fixed by deferring event handler registration to ensure
the event handlers don't end up catching the same event that triggered
the original state change.

## Screenshots
![Screenshot 2023-03-09 at 23 05
09](https://user-images.githubusercontent.com/2721291/224171058-cda04376-b4b0-4fbd-84db-e190c4980394.png)
![Screenshot 2023-03-09 at 23 05
28](https://user-images.githubusercontent.com/2721291/224171065-55553175-c47c-4d6b-995b-2911715be1bb.png)
![Screenshot 2023-03-09 at 23 05
45](https://user-images.githubusercontent.com/2721291/224171068-ed533a61-ccb9-4f1c-8a0c-8e0088826b79.png)
![Screenshot 2023-03-09 at 23 06
07](https://user-images.githubusercontent.com/2721291/224171072-ec84393d-e402-4bd2-b422-cd37b8e21977.png)

---------

Signed-off-by: Máté Szabó <mszabo@fandom.com>
  • Loading branch information
mszabo-wikia committed Mar 10, 2023
1 parent ee7ce64 commit cda1746
Show file tree
Hide file tree
Showing 40 changed files with 3,343 additions and 3,140 deletions.
2 changes: 1 addition & 1 deletion packages/jaeger-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"@types/react-virtualized-select": "^3.0.7",
"@types/recompose": "^0.30.5",
"@types/redux-actions": "2.2.1",
"antd": "3.9.0",
"antd": "3.26.20",
"chance": "^1.0.10",
"classnames": "^2.2.5",
"combokeys": "^3.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/jaeger-ui/src/components/App/Page.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ describe('<Page>', () => {
trackPageView.mockReset();
props = {
pathname: String(Math.random()),
search: 'embed=v0&hideGraph',
search: 'hideGraph',
};
wrapper = mount(<Page {...props} />);
wrapper = mount(<Page embedded {...props} />);
});

it('does not explode', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/jaeger-ui/src/components/App/TopNav.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ describe('<TopNav>', () => {

it('renders sub-menu links', () => {
dropdownItems.slice(1, 2).forEach(itemConfig => {
const item = subMenu.find(`[href="${itemConfig.url}"]`);
const item = subMenu.dive().find(`[href="${itemConfig.url}"]`);
expect(item.length).toBe(1);
expect(item.prop('target')).toBe(itemConfig.anchorTarget || '_blank');
expect(item.text()).toBe(itemConfig.label);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,36 @@ exports[`<TraceIDSearchInput /> renders as expected 1`] = `
className="ant-input-prefix"
>
<i
aria-label="icon: search"
className="anticon anticon-search"
>
<svg
aria-hidden="true"
className=""
data-icon="search"
fill="currentColor"
focusable="false"
height="1em"
key="svg-search"
viewBox="0 0 1024 1024"
viewBox="64 64 896 896"
width="1em"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M608 112c-167.9 0-304 136.1-304 304 0 70.3 23.9 135 63.9 186.5L114.3 856.1c-3.1 3.1-3.1 8.2 0 11.3l42.3 42.3c3.1 3.1 8.2 3.1 11.3 0l253.6-253.6C473 696.1 537.7 720 608 720c167.9 0 304-136.1 304-304S775.9 112 608 112zm161.2 465.2C726.2 620.3 668.9 644 608 644s-118.2-23.7-161.2-66.8C403.7 534.2 380 476.9 380 416s23.7-118.2 66.8-161.2c43-43.1 100.3-66.8 161.2-66.8s118.2 23.7 161.2 66.8c43.1 43 66.8 100.3 66.8 161.2s-23.7 118.2-66.8 161.2z"
d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0 0 11.6 0l43.6-43.5a8.2 8.2 0 0 0 0-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"
key="svg-search-svg-0"
/>
</svg>
</i>
</span>
<input
className="ant-input"
disabled={false}
name="idInput"
onChange={[Function]}
onKeyDown={[Function]}
placeholder="Lookup by Trace ID..."
style={null}
type="text"
value=""
/>
</span>
</form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1388,7 +1388,6 @@ exports[`<DdgNodeContent> renders the number of operations if there are multiple
mouseLeaveDelay={0.1}
overlayStyle={Object {}}
placement="bottom"
prefixCls="ant-popover"
title="Select Operation to Filter Graph"
transitionName="zoom-big"
trigger="hover"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ exports[`Selector renders buttons with expected text and classNames 1`] = `
mouseLeaveDelay={0.1}
overlayStyle={Object {}}
placement="bottom"
prefixCls="ant-popover"
title="Visible downstream hops"
transitionName="zoom-big"
trigger="hover"
Expand Down Expand Up @@ -215,7 +214,6 @@ exports[`Selector renders upstream hops with negative distance correctly 1`] = `
mouseLeaveDelay={0.1}
overlayStyle={Object {}}
placement="bottom"
prefixCls="ant-popover"
title="Visible upstream hops"
transitionName="zoom-big"
trigger="hover"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ exports[`<SidePanel> render renders detailLink 1`] = `
mouseEnterDelay={0.1}
mouseLeaveDelay={0.1}
placement="top"
prefixCls="ant-tooltip"
title="More Info"
transitionName="zoom-big-fast"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

exports[`<SidePanel> info button opens info modal 1`] = `
Object {
"content": <Table
bordered={false}
className=""
"content": <withStore(Table)
columns={
Array [
Object {
Expand Down Expand Up @@ -38,14 +36,7 @@ Object {
},
]
}
indentSize={20}
loading={false}
locale={Object {}}
prefixCls="ant-table"
rowKey={[Function]}
showHeader={true}
size="default"
useFixedHeader={false}
/>,
"maskClosable": true,
"title": "Decoration Options",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ exports[`<MonitorATMEmptyState> ATM snapshot test 1`] = `
block={false}
className="button-empty-state"
ghost={false}
htmlType="button"
loading={false}
onClick={[Function]}
prefixCls="ant-btn"
>
Read the Documentation
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,8 @@ exports[`<MonitorATMServicesView> ATM snapshot test 1`] = `
className="select-operation-input"
disabled={false}
enterButton={false}
inputPrefixCls="ant-input"
onChange={[Function]}
placeholder="Search operation"
prefixCls="ant-input-search"
value=""
/>
</Col>
Expand Down Expand Up @@ -638,10 +636,8 @@ exports[`<MonitorATMServicesView> ATM snapshot test with no metrics 1`] = `
className="select-operation-input"
disabled={false}
enterButton={false}
inputPrefixCls="ant-input"
onChange={[Function]}
placeholder="Search operation"
prefixCls="ant-input-search"
value=""
/>
</Col>
Expand Down Expand Up @@ -963,10 +959,8 @@ exports[`<MonitorATMServicesView> render one service latency 1`] = `
className="select-operation-input"
disabled={false}
enterButton={false}
inputPrefixCls="ant-input"
onChange={[Function]}
placeholder="Search operation"
prefixCls="ant-input-search"
value=""
/>
</Col>
Expand Down
Loading

0 comments on commit cda1746

Please sign in to comment.