-
Notifications
You must be signed in to change notification settings - Fork 15
Add option to provide callback function to iModel action disable prop #197
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
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.
Pull request overview
This PR adds the ability to conditionally disable iModel context menu actions based on the iModel's properties by accepting a callback function for the disabled prop.
Changes:
- Modified
ContextMenuBuilderIteminterface to allowdisabledto be either a boolean or a callback function that receives the iModel value - Updated the menu building logic to evaluate the
disabledprop dynamically when it's a function - Added a new Storybook story demonstrating the disabled callback functionality
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/modules/imodel-browser/src/utils/_buildMenuOptions.tsx | Extended the ContextMenuBuilderItem interface to support callback functions for the disabled prop and updated the menu builder to evaluate it |
| packages/apps/storybook/src/imodel-browser/IModelGrid.stories.tsx | Added example story showing disabled actions based on iModel properties and improved alert message formatting |
| common/changes/@itwin/imodel-browser-react/omar-disable-imodel-action-callback_2026-02-04-21-29.json | Added changelog entry for the new feature |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
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.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Added option to disable iModel action depending on the iModel
