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

feat(react-components): Generalize settings popup #4684

Merged
merged 11 commits into from
Jul 29, 2024
Merged

Conversation

nilscognite
Copy link
Contributor

@nilscognite nilscognite commented Jul 28, 2024

Type of change

Feat

Jira ticket 📘

https://cognitedata.atlassian.net/browse/

Description 📝

image

Generalize settings with the following settings as use case:

  • High/low Quality
  • Point size
  • Point color
  • Point shape

Code change in the non-React side

  • Some fixes of comments and small code changes around
  • BaseCommand added isToggle method if this command is a real toggle. This is implemented on the sub classes where it was relevant.
  • Used RenderTargetCommand as base instead of BaseCmd since it made the code easier
  • BaseSliderCommand for making sliders for numbers
  • KeyboardSpeedCommand made easier and more according to other similar commands
  • SetPointColorTypeCommand, SetPointShapeCommand, SetPointSizeCommand, and SetQualityCommand new command holding a specific toggle.
  • SettingsCommand for holding all the settings command above

Code change in the React side:

  • Let the tooltip can be undefined. Then it is disabled. Used for the the settings, since it jives too much information.
  • 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 the OptionButton. 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:

  1. Open storybook/architecture.
  2. Click in the settings icon in the toolbar
  3. Change the quility toggle

Test instructions ℹ️

Checklist ☑️

  • I am proud of this feature.
  • I have performed a self-review of my own code.
  • I have added PR type (Feat, Bug, Chore, Test, Docs, Style, Refactor) to the PR title.
  • I have manually tested this for different scenarios (different models, formats, devices, browsers).
  • I have commented my code in hard-to-understand areas.
  • I have made corresponding changes to the public documentation.
  • I have added unit and visuals tests to prove that my feature works to the best of my ability.
  • I have refactored the code for readability to the best of my ability.
  • I have checked that my changes do not introduce regressions in the public documentation.
  • I have outlined any known defects / lacking capabilities in the contents of this PR.
  • I have listed any remaining work that should follow this PR in the description or jira/miro/etc.
  • I have added TSDoc to any public facing changes.
  • I have added "developer documentation" in any package README.md that is related / applicable to this PR.
  • I have noted down and am currently tracking any technical debt introduced in this PR.
  • I have thoroughly thought about the architecture of this implementation.
  • I have asked peers to test this feature.

@nilscognite nilscognite requested a review from a team as a code owner July 28, 2024 20:46
@nilscognite nilscognite marked this pull request as draft July 28, 2024 20:46
@nilscognite nilscognite changed the title Generalize settings popup fix(react-components): Generalize settings popup Jul 28, 2024
@nilscognite nilscognite changed the title fix(react-components): Generalize settings popup feat(react-components): Generalize settings popup Jul 28, 2024
@nilscognite nilscognite marked this pull request as ready for review July 28, 2024 21:02
Copy link
Contributor

@pramodcog pramodcog left a 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

Copy link
Contributor

@pramodcog pramodcog left a 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.

@nilscognite nilscognite enabled auto-merge (squash) July 29, 2024 11:45
@nilscognite nilscognite merged commit 5630fa7 into master Jul 29, 2024
14 checks passed
@nilscognite nilscognite deleted the np/annotations branch July 29, 2024 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants