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

WRR-14756: Publish ColorPicker component #1803

Open
wants to merge 37 commits into
base: develop
Choose a base branch
from

Conversation

adrian-cocoara-lgp
Copy link
Contributor

@adrian-cocoara-lgp adrian-cocoara-lgp commented Jan 17, 2025

Checklist

  • I have read and understand the contribution guide
  • A CHANGELOG entry is included
  • At least one test case is included for this feature or bug fix
  • Documentation was added or is not needed
  • This is an API breaking change

Issue Resolved / Feature Added

Publish new ColorPicker component

  • added JS docs
  • added unit/ui/screenshot tests
  • added Storybook story

Resolution

Additional Considerations

Renamed previous ColorPicker with ColorPickerSettingsApp. After ColorPicker is published, ColorPickerSettingsApp can be deleted.

Links

WRR-14756

Comments

Enact-DCO-1.0-Signed-off-by: Adrian Cocoara adrian.cocoara@lgepartner.com

ion-andrusciac-lgp and others added 30 commits August 1, 2024 14:51
* Created component skeleton for ColorPickerPOC

* Added propTypes

* Fixed lint warnings
* added color picker grid component

* added logic for new color picker grid component

* fixed story name

* adjueste component size

* fixed color array values

* updated cell size

* unified colorpickerpoc and colorpickergrid

* removed unwanted story

* lint fixes

* renamed util function
* Created component skeleton for ColorPickerPOC

* Added propTypes

* Fixed lint warnings

* Added option to remove favorite color on long press

* Applied design changes for the Favorite Colors section

* Added shake animation for delete action
* added opposite color for focus on colorpickergrid

* added box shadow for focused color
* Added ColorPickerSlider functionality to ColorPickerPOC.

* Small fix for ColorPickerSlider.

* Transparent knob with border.

* Merge with main branch.

* Lint fix.

* Review fix.

* Review fix.
* *WIP* implement spectrum color picker

* added positionPointer, wrapped ColorPicker in Spottable, code cleanup

* fixed spottable div

* *WIP* added 5-way navigation to indicator

* color selection via 5-way, code cleanup, fix lint

* code review fixes

---------

Co-authored-by: Daniel Stoian <daniel.stoian@lgepartner.com>
* *WIP* implement spectrum color picker

* added positionPointer, wrapped ColorPicker in Spottable, code cleanup

* fixed spottable div

* *WIP* added 5-way navigation to indicator

* color selection via 5-way, code cleanup, fix lint

* added accelerator to spectrum color picker

* fixed review issues

---------

Co-authored-by: Adrian Cocoara <adrian.cocoara@lgepartner.com>
Co-authored-by: Daniel Stoian <daniel.stoian@lgepartner.com>
…favorite color is removed (#1660)

* Created component skeleton for ColorPickerPOC

* Added propTypes

* Fixed lint warnings

* Added option to remove favorite color on long press

* Applied design changes for the Favorite Colors section

* Added shake animation for delete action

* Added shake animation for delete action

* Added handler to display colors state in actions log when favorite color is removed

* Added pointer events

* Review fixes

* Changed alignment for favorite colors

* Fixed spotlight navigation on favorite colors
* Fixed problem with knob size and added a version of HSL for ColorPickerSlider.

* Small fix

* Review fixes
* handle resize of canvas

* code cleanup

* sorted props

---------

Co-authored-by: Stanca <stanca.pop@lgepartner.com>
* Added useEffect, so the sliders change when selecting a new color from favorites.

* Added a switch to chose between HSL or RGB format.

* Revert npm-shrinkwrap override

* style improvements

* spacing adjustments

---------

Co-authored-by: Stanca <stanca.pop@lgepartner.com>
* fixed deletion of favorite colors for ColorPicker

* save component state when props change

* removed unnecessary code

* added back useEffect

* changed outputText color to be more visible

* added handler for Enter key to edit favorite colors

* code review fix

---------

Co-authored-by: Stanca <stanca.pop@lgepartner.com>
* Added a dropdown to chose between HSL or RGB format and an input for hex values.

* styling fixes

---------

Co-authored-by: Stanca <stanca.pop@lgepartner.com>
* added JS Docs

* removed @module and indented code

* fixed JS docs

* fixed `too many doclets` error

* fixed js docs warning

* fixed JS docs

* fixed js docs

* added JD docs for SpectrumIndicator.js

* refactored rgbStringToHex function and added `willReadFrequently: true` parameter in ColorPickerSpectrum for optimization

* made ColorPicker main component public and ColorPickerGrid component props private

* fixed qa sampler

* removed forgotten console.log

* removed transform as it conflicted with 5-way navigation

* review fixes

* modified example in JS docs

* modified JS docs for ColorPicker example

* JS docs fix

* fixed JS docs

* added default colors

* fixed typo

* fixed JS docs

* changed slider names and adjusted tabLayout width

* updated deprecated max-width value

* moved max-width properties to target tabs class

* corrected selector

* fixed typo

* added `type` and `disabled` props

* changed type prop to public

* added disabled style and behavior for each subcomponent of ColorPicker

* added missing dependency

* review fixes

* added missing dependency

* review fix

* WRR-3979: Updated storybook to 8.4 (#1739)

* updated storybook to 8.4

* updated to latest storybook

* updated storybook-utils

* review fix

* dummy commit to fix cla license

* revert dummy commit

* removed spotlightDisabled from Dropdown as it is not recognized as a custom prop

* undo spotlightDisabled removal - warning has different cause

---------

Co-authored-by: Daniel Stoian <63335068+daniel-stoian-lgp@users.noreply.github.com>
* added JS Docs

* removed @module and indented code

* fixed JS docs

* fixed `too many doclets` error

* fixed js docs warning

* fixed JS docs

* fixed js docs

* added JD docs for SpectrumIndicator.js

* refactored rgbStringToHex function and added `willReadFrequently: true` parameter in ColorPickerSpectrum for optimization

* made ColorPicker main component public and ColorPickerGrid component props private

* fixed qa sampler

* removed forgotten console.log

* added unit tests for Grid and Sliders ColorPickers

* removed transform as it conflicted with 5-way navigation

* review fixes

* modified example in JS docs

* modified JS docs for ColorPicker example

* JS docs fix

* fixed JS docs

* *WIP* add ui tests for ColorPicker

* added default colors

* fixed typo

* fixed JS docs

* changed slider names and adjusted tabLayout width

* updated deprecated max-width value

* added ui tests for sliders color picker and one extra unit test

* moved max-width properties to target tabs class

* corrected selector

* fixed typo

* added screenshot tests for ColorPicker

* fix lint

* added `type` and `disabled` props

* changed type prop to public

* added unit tests for Spectrum

* added disabled style and behavior for each subcomponent of ColorPicker

* added missing dependency

* review fixes

* added missing dependency

* merge with WRR-12000 and update tests

* updated ui/ss tests

* review fix

* removed spotlightDisabled from Dropdown as it is not recognized as a custom prop

* added type to SliderColorPicker and extra unit tests

* added extra unit tests

* restore unit tests file

* added extra tests for FavoriteColors

* added utils unit tests and fix lint

* fix travis

* fix docs

* Update tests/ui/specs/ColorPicker/ColorPickerPage.js

* Apply suggestions from code review

* lint warning fixes

---------

Co-authored-by: Stanca <stanca.pop@lgepartner.com>
Co-authored-by: Daniel Stoian <63335068+daniel-stoian-lgp@users.noreply.github.com>
Co-authored-by: Daniel Stoian <daniel.stoian@lgepartner.com>
adrian-cocoara-lgp and others added 6 commits January 17, 2025 11:43
…ut` (#1801)

* refactor ColorPicker to use `TabGroup` instead of `TabLayout`

* fix lint

* layout fixes

* layout fixes

* layout fixes and minor refactoring

* updated ui-tests for the new layout

* added CSS variables

* add missing variables file

* fix import typo

* refactoring of css variables and styles

* added css variables and fixed failed unit tests

* minor fix in hex value

---------

Co-authored-by: Stanca <stanca.pop@lgepartner.com>
Copy link

codecov bot commented Jan 17, 2025

Codecov Report

Attention: Patch coverage is 87.22986% with 65 lines in your changes missing coverage. Please review.

Project coverage is 81.16%. Comparing base (bde642e) to head (34cf660).

Files with missing lines Patch % Lines
ColorPicker/ColorPicker.js 75.24% 19 Missing and 6 partials ⚠️
ColorPicker/ColorPickerSpectrum.js 81.48% 15 Missing ⚠️
ColorPicker/SpectrumIndicator.js 77.61% 12 Missing and 3 partials ⚠️
ColorPicker/ColorPickerSlider.js 88.57% 4 Missing and 4 partials ⚠️
ColorPicker/utils.js 97.14% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1803      +/-   ##
===========================================
+ Coverage    80.95%   81.16%   +0.20%     
===========================================
  Files          148      154       +6     
  Lines         6695     7124     +429     
  Branches      2006     2100      +94     
===========================================
+ Hits          5420     5782     +362     
- Misses         969     1023      +54     
- Partials       306      319      +13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@adrian-cocoara-lgp
Copy link
Contributor Author

ColorPicker's overall code coverage is at 82.22%. Missing lines could not be tested by React Testing Library, but they are covered by ui-tests.
image

Copy link
Contributor

@daniel-stoian-lgp daniel-stoian-lgp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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.

7 participants