-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
fix: fixed shortcuts population #7016
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This pull request addresses issue #6776 by modifying the command menu functionality to filter out deactivated objects, preventing users from accessing them through shortcuts or the command menu.
- Added 'nameSingular' property to Command type and CommandMenuCommands for object identification
- Updated PageChangeEffect to use objectMetadataItemsState for filtering active items
- Modified useCommandMenu hook to include filterCommandMenu function and update setToInitialCommandMenu
- Adjusted CommandMenu.stories to incorporate changes for handling active/inactive object metadata items
- Implemented filtering logic to exclude deactivated objects from the command menu and shortcuts
5 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings
setToInitialCommandMenu, | ||
openCreateActivity, | ||
objectMetadataItems, | ||
filterCommandMenu, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: filterCommandMenu is unused in this component
@FelixMalfait I have made changes to pick all data directly from object data. Shortcuts are still functional as all initials are different and we won't run into any issues right now, in future we'll have to add a key for shortcut into object data itself (in case conflicts arise). Note for reviewers: CommandMenu items' id has change from |
Please see in |
@lucasbordeau had to use a hacky way to to call react hooks dynamically in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Used this PR to refactor a bit the app components and util into a module.
That's not really hacky as it's the only proper way to create a loop of hook render ! |
Thanks @sid0-0 for your contribution! |
This PR fixes twentyhq#6776 Screenshots: <img width="1728" alt="image" src="https://github.com/user-attachments/assets/ca061c30-ddb7-40ff-8c54-8b0d85d40864"> --------- Co-authored-by: sid0-0 <[email protected]> Co-authored-by: Lucas Bordeau <[email protected]>
This PR fixes #6776
Screenshots: