-
Notifications
You must be signed in to change notification settings - Fork 21
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
feat(react-components): add hotkeys P to toggle the Poi tool and Esc to remove the Poi creation - including the floating panel #4909
Conversation
…on - including the floating panel
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.
LGTM, just a few nitpicks
@@ -281,8 +281,12 @@ export abstract class BaseTool extends RenderTargetCommand { | |||
/** | |||
* AnchorDialog | |||
*/ | |||
|
|||
type CustomListener = { eventName: string; callback: (event: Event) => void }; |
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.
Strictly speaking, this should be exported, since it's part of the other exported type
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.
dialogContent.customListeners.forEach((listener) => { | ||
window.addEventListener(listener.eventName, listener.callback, true); | ||
}); |
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.
Very nitpicky, but this could be a little shorter with dialogContent.customListeners?.forEach(...
and removing the if-check
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.
ops.. ofc
if (dialogContent === undefined || isSomeEnabled !== true) { | ||
return undefined; | ||
} | ||
|
||
if (renderTarget === undefined) { | ||
return <></>; | ||
} | ||
|
||
if (activeTool === undefined) { | ||
return <></>; | ||
} |
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.
I think we can just combine all of these to one if-check? 🤔
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.
yep
07d2588
… danpriori/hotkeys-for-pois
Type of change
Jira ticket 📘
https://cognitedata.atlassian.net/browse/
Add hotkeys for Point of Interests.
P to toggle the tool and Esc to close/exit the creation
Test instructions ℹ️
Checklist ☑️