-
Notifications
You must be signed in to change notification settings - Fork 20
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): Generalize settings popup #4684
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nilscognite
changed the title
Generalize settings popup
fix(react-components): Generalize settings popup
Jul 28, 2024
nilscognite
changed the title
fix(react-components): Generalize settings popup
feat(react-components): Generalize settings popup
Jul 28, 2024
pramodcog
reviewed
Jul 29, 2024
react-components/src/architecture/base/concreteCommands/SetPointColorTypeCommand.ts
Show resolved
Hide resolved
pramodcog
reviewed
Jul 29, 2024
react-components/src/architecture/base/concreteCommands/SetPointColorTypeCommand.ts
Outdated
Show resolved
Hide resolved
pramodcog
reviewed
Jul 29, 2024
react-components/src/architecture/base/concreteCommands/SetPointShapeCommand.ts
Show resolved
Hide resolved
pramodcog
reviewed
Jul 29, 2024
react-components/src/architecture/base/concreteCommands/SetPointShapeCommand.ts
Show resolved
Hide resolved
pramodcog
reviewed
Jul 29, 2024
react-components/src/architecture/base/concreteCommands/SetPointSizeCommand.ts
Show resolved
Hide resolved
pramodcog
reviewed
Jul 29, 2024
react-components/src/architecture/base/concreteCommands/SetPointSizeCommand.ts
Show resolved
Hide resolved
pramodcog
reviewed
Jul 29, 2024
react-components/src/architecture/base/concreteCommands/SetQualityCommand.ts
Show resolved
Hide resolved
pramodcog
reviewed
Jul 29, 2024
react-components/src/architecture/base/concreteCommands/SettingsCommand.ts
Show resolved
Hide resolved
pramodcog
reviewed
Jul 29, 2024
pramodcog
reviewed
Jul 29, 2024
pramodcog
reviewed
Jul 29, 2024
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.
Works really great.
Added few comments
pramodcog
reviewed
Jul 29, 2024
pramodcog
approved these changes
Jul 29, 2024
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!
One minor comment to address before you merge.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Type of change
Jira ticket 📘
https://cognitedata.atlassian.net/browse/
Description 📝
Generalize settings with the following settings as use case:
Code change in the non-React side
BaseCommand
addedisToggle
method if this command is a real toggle. This is implemented on the sub classes where it was relevant.RenderTargetCommand
as base instead ofBaseCmd
since it made the code easierBaseSliderCommand
for making sliders for numbersKeyboardSpeedCommand
made easier and more according to other similar commandsSetPointColorTypeCommand
,SetPointShapeCommand
,SetPointSizeCommand
, andSetQualityCommand
new command holding a specific toggle.SettingsCommand
for holding all the settings command aboveCode change in the React side:
CommandButtons
: check for SettingsCommand since this is special handled.OptionButton
: New property,usedInSettings
, which is true if it is a part of the settings. This will bale the appearance somewhat different. Removing the icon code, since it wasn't used. Refactored.SettingsButton
is new. Make the settings buttons and all the setting.useClickOutside
is new. Handle when click outside of theOptionButton
. Code copied from fusion.How has this been tested? 🔍
For the moment I do not know how to test it in storybook, since must settings is for the point cloud.
I have tested it by mocking it myself, but I cannot commit this change in.
The only test you can do is:
Test instructions ℹ️
Checklist ☑️