Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated the react-menu library to the latest version. #8061 #8062

Merged
merged 1 commit into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"@mui/x-date-pickers": "^7.7.1",
"@projectstorm/react-diagrams": "^7.0.4",
"@simonwep/pickr": "^1.5.1",
"@szhsin/react-menu": "^2.2.0",
"@szhsin/react-menu": "^4.2.2",
"@tanstack/react-query": "5.37.1",
"@tanstack/react-table": "^8.16.0",
"@tanstack/react-virtual": "^3.8.4",
Expand Down
11 changes: 7 additions & 4 deletions web/pgadmin/static/js/components/Menu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import PropTypes from 'prop-types';
import {
MenuItem,
ControlledMenu,
applyStatics,
Menu,
SubMenu,
} from '@szhsin/react-menu';
Expand Down Expand Up @@ -48,13 +47,17 @@ PgMenu.propTypes = {
menuButton: PropTypes.element,
};

export const PgSubMenu = applyStatics(SubMenu)(({label, ...props})=>{
export const PgSubMenu = (({label, ...props})=>{
return (
<SubMenu label={label} itemProps={{'data-label': label}} {...props} />
);
});

export const PgMenuItem = applyStatics(MenuItem)(({hasCheck=false, checked=false, accesskey, shortcut, children, closeOnCheck=false, ...props})=>{
PgSubMenu.propTypes = {
label: PropTypes.string
};

export const PgMenuItem = (({hasCheck=false, checked=false, accesskey, shortcut, children, closeOnCheck=false, ...props})=>{

let onClick = props.onClick;
if(hasCheck) {
Expand Down Expand Up @@ -83,7 +86,7 @@ PgMenuItem.propTypes = {
children: CustomPropTypes.children,
closeOnCheck: PropTypes.bool,
onClick: PropTypes.func,
dataLabel: PropTypes.string,
datalabel: PropTypes.string,
};

export function usePgMenuGroup() {
Expand Down
2 changes: 1 addition & 1 deletion web/regression/javascript/components/Menu.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('Menu', ()=>{
};
it('init', ()=>{
ctrlMount();
const menu = screen.getByRole('menu');
const menu = screen.getByRole('menu',{hidden: true});
expect(menu.getAttribute('data-state')).toBe('closed');
});

Expand Down
24 changes: 12 additions & 12 deletions web/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3033,16 +3033,16 @@ __metadata:
languageName: node
linkType: hard

"@szhsin/react-menu@npm:^2.2.0":
version: 2.3.4
resolution: "@szhsin/react-menu@npm:2.3.4"
"@szhsin/react-menu@npm:^4.2.2":
version: 4.2.2
resolution: "@szhsin/react-menu@npm:4.2.2"
dependencies:
prop-types: ^15.7.2
react-transition-state: ^1.1.3
react-transition-state: ^2.1.0
peerDependencies:
react: ">=16.8.0"
react-dom: ">=16.8.0"
checksum: 94d8b78166a69816852b53e1cf7929ffbbbb54010958d9124e48fcea4a72bc0572b242efb176d3c3cec003014ef7d26b9d191f5baf11825bedabf13ff1c525a9
react: ">=16.14.0"
react-dom: ">=16.14.0"
checksum: b65c231e5a5fb258aa3211c6acc93b805df2992b55dcbd791535745b1a1670ce4ee3ecdf83e271621cfc3f78fed5e8768c32004fc0fe3d1ef4f93c6a53b41086
languageName: node
linkType: hard

Expand Down Expand Up @@ -13364,13 +13364,13 @@ __metadata:
languageName: node
linkType: hard

"react-transition-state@npm:^1.1.3":
version: 1.1.5
resolution: "react-transition-state@npm:1.1.5"
"react-transition-state@npm:^2.1.0":
version: 2.1.3
resolution: "react-transition-state@npm:2.1.3"
peerDependencies:
react: ">=16.8.0"
react-dom: ">=16.8.0"
checksum: 4ca616583cd12825706be94886cf1512e0995170709435971787c7d5adf3d95d6349df17f45d74e805453e338a220e2ebe1b54a5d696bcad4617a71e24e02c59
checksum: 6a5fd4d729695b42fc220903f0ea6faf19fe2ed576350cf58fdfcffb98e838ed1ea789b707996297fcf13b7e4b052cfc84004d90e5b9667fe01538226aa2cec6
languageName: node
linkType: hard

Expand Down Expand Up @@ -13824,7 +13824,7 @@ __metadata:
"@projectstorm/react-diagrams": ^7.0.4
"@simonwep/pickr": ^1.5.1
"@svgr/webpack": ^8.1.0
"@szhsin/react-menu": ^2.2.0
"@szhsin/react-menu": ^4.2.2
"@tanstack/react-query": 5.37.1
"@tanstack/react-table": ^8.16.0
"@tanstack/react-virtual": ^3.8.4
Expand Down
Loading