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

Introduce disable tooltip on hover property #313

Merged
merged 1 commit into from
Mar 3, 2023

Conversation

VijayanB
Copy link
Member

@VijayanB VijayanB commented Mar 2, 2023

Description

Added new property that allows users to disable tooltip on hover. The default value is false to keep
backward compatability. We will revisit the ideal
default value based on user's feedback in later release.

Issues Resolved

#259

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@VijayanB VijayanB requested a review from a team March 2, 2023 18:23
@VijayanB VijayanB self-assigned this Mar 2, 2023
@VijayanB VijayanB added enhancement New feature or request backport 2.x v2.7.0 labels Mar 2, 2023
@codecov-commenter
Copy link

Codecov Report

Merging #313 (2078889) into main (26aea7a) will increase coverage by 0.02%.
The diff coverage is n/a.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##             main     #313      +/-   ##
==========================================
+ Coverage   91.66%   91.69%   +0.02%     
==========================================
  Files          12       12              
  Lines         288      289       +1     
  Branches       38       38              
==========================================
+ Hits          264      265       +1     
  Misses         17       17              
  Partials        7        7              
Impacted Files Coverage Δ
...Dashboards/plugins/dashboards-maps/common/index.ts 100.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

export function isTooltipEnabledOnHover(
layer: MapLayerSpecification
): layer is DocumentLayerSpecification {
return isTooltipEnabledLayer(layer) && !layer.source.disableTooltipsOnHover;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return isTooltipEnabledLayer(layer) && !layer.source.disableTooltipsOnHover;
if (!isTooltipEnabledLayer(layer)) {
return false;
}
return !layer.source?.disableTooltipsOnHover;

Copy link
Member Author

Choose a reason for hiding this comment

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

why?

Copy link
Member

Choose a reason for hiding this comment

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

I think this way the logic can be more clear, and adding ? can prevent errors if the source property is missing.

Copy link
Member Author

Choose a reason for hiding this comment

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

source is not optional parameters in DocumentLayerSpecification. I assume typescript would have complained if '?' is missing. TBH, suggestion looks very verbose.

Copy link
Member Author

@VijayanB VijayanB Mar 2, 2023

Choose a reason for hiding this comment

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

i made this parameter is optional and added '?', but still i believe splitting in inside block is verbose. If you are strongly against it i can change it.

Copy link
Member

@junqiu-lei junqiu-lei Mar 2, 2023

Choose a reason for hiding this comment

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

Thanks on the change, I think either splitting or not is okay, IMO splitting is easier for reading the code.

@VijayanB VijayanB requested a review from junqiu-lei March 2, 2023 22:05
Added new property that allows users to disable tooltip
on hover. The default value is false to keep
backward compatability. We will revisit the ideal
default value based on user's feedback in later release.

Signed-off-by: Vijayan Balasubramanian <[email protected]>
@VijayanB VijayanB force-pushed the add-props-tooltip branch from 2078889 to 25da75c Compare March 2, 2023 22:57
@VijayanB VijayanB merged commit 03b0ee4 into opensearch-project:main Mar 3, 2023
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 3, 2023
Added new property that allows users to disable tooltip
on hover. The default value is false to keep
backward compatability. We will revisit the ideal
default value based on user's feedback in later release.

Signed-off-by: Vijayan Balasubramanian <[email protected]>
(cherry picked from commit 03b0ee4)
VijayanB pushed a commit that referenced this pull request Mar 4, 2023
Added new property that allows users to disable tooltip
on hover. The default value is false to keep
backward compatability. We will revisit the ideal
default value based on user's feedback in later release.

Signed-off-by: Vijayan Balasubramanian <[email protected]>
VijayanB pushed a commit to VijayanB/dashboards-maps that referenced this pull request Mar 20, 2023
…pensearch-project#314)

Added new property that allows users to disable tooltip
on hover. The default value is false to keep
backward compatability. We will revisit the ideal
default value based on user's feedback in later release.

Signed-off-by: Vijayan Balasubramanian <[email protected]>
(cherry picked from commit d0ef1fd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants