Skip to content

[Maps] Autocomplete for custom color palettes and custom icon palettes#56446

Merged
nreese merged 17 commits intoelastic:masterfrom
nreese:category_suggestions
Feb 12, 2020
Merged

[Maps] Autocomplete for custom color palettes and custom icon palettes#56446
nreese merged 17 commits intoelastic:masterfrom
nreese:category_suggestions

Conversation

@nreese
Copy link
Copy Markdown
Contributor

@nreese nreese commented Jan 30, 2020

fixes #54921 and #56049

Screen Shot 2020-01-30 at 4 29 34 PM

Screen Shot 2020-01-31 at 8 27 58 AM

@nreese nreese added release_note:enhancement WIP Work in progress Team:Geo Former Team Label for Geo Team. Now use Team:Presentation v8.0.0 v7.7.0 labels Jan 30, 2020
@nreese nreese requested a review from a team as a code owner January 30, 2020 21:31
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-gis (Team:Geo)

@nreese nreese requested a review from thomasneirynck January 31, 2020 13:22
@nreese nreese removed the WIP Work in progress label Jan 31, 2020
@nreese
Copy link
Copy Markdown
Contributor Author

nreese commented Jan 31, 2020

@elasticmachine merge upstream

@nreese
Copy link
Copy Markdown
Contributor Author

nreese commented Feb 3, 2020

@elasticmachine merge upstream

Copy link
Copy Markdown
Contributor

@jsanz jsanz left a comment

Choose a reason for hiding this comment

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

Tested in Firefox and Chromium and working nicely, this is great 👍

Copy link
Copy Markdown
Contributor

@thomasneirynck thomasneirynck left a comment

Choose a reason for hiding this comment

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

Some small comments.

I would either disable auto-complete for IPs/boolean-fields, or try and have some custom best-effort (e.g booleans could be do-able on Maps-side).

@nreese nreese requested a review from thomasneirynck February 9, 2020 12:52
@nreese
Copy link
Copy Markdown
Contributor Author

nreese commented Feb 12, 2020

@elasticmachine merge upstream

Copy link
Copy Markdown
Contributor

@thomasneirynck thomasneirynck left a comment

Choose a reason for hiding this comment

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

Really cool addition.

I think there's a small bug when dealing with a field-selection change.

Steps:

  1. select a string-field in by-value styling
  2. select "custom palette" and enter some stop values using the auto-complete
  3. select a different string-field
  4. use drop-down to modify existing value in a stop (or add new stop and use drop-down)
    -> the auto-complete shows options from the field selected in (1)
    (typing in to trigger a new "suggestion-load" will start showing correct suggestions).

stops

@nreese
Copy link
Copy Markdown
Contributor Author

nreese commented Feb 12, 2020

I think there's a small bug when dealing with a field-selection change.

Thanks for pointing this out. I have pushed a fix. I found this article about using key to force new component instance in cases like this. That way, when the field changes, a new component instance is created so there is no lingering state to cleanup/ keep track of.

I think we should use this pattern in other places where we rely on componentDidUpdate to change state if some prop changes.


return (
<StopInput
key={field.getName()} // force new component instance when field changes
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is really clever

@kibanamachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@nreese nreese merged commit be7daa8 into elastic:master Feb 12, 2020
nreese added a commit to nreese/kibana that referenced this pull request Feb 12, 2020
elastic#56446)

* [Maps] type ahead for stop values for custom color maps and custom icon maps

* use Popover to show type ahead suggestions

* datalist version

* use EuiComboBox

* clean up

* wire ColorStopsCategorical to use StopInput component for autocomplete

* clean up

* cast suggestion values to string so boolean fields work

* review feedback

* fix problem with stall suggestions from previous field

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
nreese added a commit that referenced this pull request Feb 12, 2020
#56446) (#57504)

* [Maps] type ahead for stop values for custom color maps and custom icon maps

* use Popover to show type ahead suggestions

* datalist version

* use EuiComboBox

* clean up

* wire ColorStopsCategorical to use StopInput component for autocomplete

* clean up

* cast suggestion values to string so boolean fields work

* review feedback

* fix problem with stall suggestions from previous field

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
gmmorris added a commit to gmmorris/kibana that referenced this pull request Feb 13, 2020
…ibana into backport/7.x/pr-57404

* 'backport/7.x/pr-57404' of https://github.com/gmmorris/kibana:
  [Maps] Autocomplete for custom color palettes and custom icon palettes (elastic#56446) (elastic#57504)
  Add "coerce" to dev tools autocomplete (elastic#56862) (elastic#57498)
  [DOCS] Fixes typo in release highlights (elastic#57487)
mbondyra added a commit to mbondyra/kibana that referenced this pull request Feb 13, 2020
* master: (22 commits)
  Use log4j pattern syntax (elastic#57433)
  [ML] Categorization field example endpoint tests (elastic#57471)
  [Lens] Filter out pinned filters from saved object of Lens (elastic#57197)
  Lens client side shim cleanup (elastic#56976)
  [Maps] do not show border color for icon in legend when border width is zero (elastic#57501)
  refactors 'data-providers' tests (elastic#57474)
  add `absolute` option to `getUrlForApp` (elastic#57193)
  [Telemetry] Migrate public to NP (elastic#56285)
  address flaky test where instances might have different start… (elastic#57506)
  fix(NA): support legacy plugins path in plugins (elastic#57472)
  build immutable bundles for new platform plugins (elastic#53976)
  [SIEM] [Detection Engine] Reject if duplicate rule_id in request payload (elastic#57057)
  Add autocomplete="off" for input type="password" to appease the scanners (elastic#56922)
  Use default spaces suffix for signals index if spaces disabled (elastic#57244)
  [Alerting] Create alert design cleanup (elastic#56929)
  Management Api - add to migration guide (elastic#56892)
  fixing maps (elastic#56706)
  [Maps] Autocomplete for custom color palettes and custom icon palettes (elastic#56446)
  [Alerting] make actionGroup name's i18n-able (elastic#57404)
  fixed flaky test (elastic#57490)
  ...

# Conflicts:
#	src/legacy/core_plugins/telemetry/public/components/__snapshots__/telemetry_form.test.js.snap
#	src/plugins/telemetry/public/components/telemetry_management_section.tsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release_note:enhancement Team:Geo Former Team Label for Geo Team. Now use Team:Presentation v7.7.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Maps] Autocomplete values in custom color palettes

5 participants