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

Moved useColorPicker to services #3067

Merged
merged 13 commits into from
Mar 26, 2020

Conversation

mridulgogia
Copy link
Contributor

Summary

#2895
Moved useColorPicker from src-docs/src/views/color_picker/utils.js ->src/services
Summarize your PR. If it includes design elements include a screenshot or gif.

Checklist

  • Check against all themes for compatibility in both light and dark modes
  • Checked in mobile
  • Checked in IE11 and Firefox
  • Props have proper autodocs
  • Added documentation examples
  • Added or updated jest tests
  • Checked for breaking changes and labeled appropriately
  • Checked for accessibility including keyboard-only and screenreader modes
  • A changelog entry exists and is marked appropriately

@kibanamachine
Copy link

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

@mridulgogia mridulgogia changed the title Moved useColorPicker from src-docs/src/views/color_picker/utils.js ->… Moved useColorPicker to services Mar 13, 2020
@anishagg17
Copy link
Contributor

someone is already working on this issue PR: #2918

@thompsongl thompsongl self-requested a review March 13, 2020 22:38
@thompsongl
Copy link
Contributor

jenkins test this

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3067/

Copy link
Contributor

@thompsongl thompsongl left a comment

Choose a reason for hiding this comment

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

Thanks for this, @mridulgogia

Moving and renaming to useColorPickerState looks good.

I think we need to add to the API of useColorStop to have it be worthwhile as a global export:

  • Rename to useColorStopsState for consistency
  • Like useColorPickerState, useColorStopsState should accept an array of ColorStops so consumers can initialize with a given state.

CHANGELOG.md Outdated Show resolved Hide resolved
src/services/color_picker/color_picker.ts Outdated Show resolved Hide resolved
mridulgogia and others added 2 commits March 17, 2020 23:35
Co-Authored-By: Greg Thompson <thompsongl@users.noreply.github.com>
Co-Authored-By: Greg Thompson <thompsongl@users.noreply.github.com>
@thompsongl
Copy link
Contributor

jenkins test this

Copy link
Contributor

@thompsongl thompsongl left a comment

Choose a reason for hiding this comment

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

Just about ready.

The name should be useColorStopsState, not useColorStopState (the component is name EuiColorStops, so consistency is important).

After that and fixing the merge conflict, this will be ready to merge

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3067/

@thompsongl
Copy link
Contributor

jenkins test this

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3067/

Comment on lines 12 to 13
export const useColorStopsState = (
initialColorStops: colorStopsType[] = [
Copy link
Contributor

Choose a reason for hiding this comment

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

Just noticed this, sorry.

The function signature changed from (useRandomColor: boolean) to (initialColorStops: colorStopsType[], useRandomColor: boolean) so any example that was using useColorStopsState(true) now causes errors.
You'll need to update the files where this service is used to pass the correct params.

@thompsongl
Copy link
Contributor

jenkins test this

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3067/

@thompsongl
Copy link
Contributor

jenkins test this

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3067/

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.

4 participants