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

[Maps] clean-up IDynamicStyleProperty #59914

Closed
nreese opened this issue Mar 11, 2020 · 2 comments · Fixed by #62466
Closed

[Maps] clean-up IDynamicStyleProperty #59914

nreese opened this issue Mar 11, 2020 · 2 comments · Fixed by #62466
Labels
[Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation discuss

Comments

@nreese
Copy link
Contributor

nreese commented Mar 11, 2020

Creating the IDynamicStyleProperty interface has highlighted some uglyness in the existing API. See #59707 (comment) for details.

Screen Shot 2020-04-03 at 9 13 49 AM

@nreese nreese added discuss [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation labels Mar 11, 2020
@elasticmachine
Copy link
Contributor

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

@nreese
Copy link
Contributor Author

nreese commented Apr 3, 2020

getFieldName: usages in dynamic_[color|label|orientation|size]_form
It also highlights an unnecessary double lookup here:

const getField = () => {
    const fieldName = styleProperty.getFieldName();
    if (!fieldName) {
      return null;
    }

    return fields.find(field => {
      return field.name === fieldName;
    });
  };

That is not actually a double look up. The field returned from DynamicStyleProperty.getField is an IField. The fields passed into DynamicColorForm do not have a type defined but look like { label, name, origin, type }. This lookup is needed to pull the correct object from the fields array and the contents of the field array are not whats returned from DynamicStyleProperty.getField

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation discuss
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants