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

Add tooltip to draw shape filter #330

Merged
merged 2 commits into from
Mar 10, 2023

Conversation

VijayanB
Copy link
Member

@VijayanB VijayanB commented Mar 8, 2023

Description

Add tooltip with instruction how to draw filter on map. This will not allow user to draw. It just provides
instructions on how to draw filter based on selection.

Issues Resolved

#213

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.

Screen.Recording.2023-03-07.at.10.14.07.PM.mov

@VijayanB VijayanB requested a review from a team March 8, 2023 06:11
@VijayanB VijayanB self-assigned this Mar 8, 2023
@VijayanB VijayanB force-pushed the add-tooltip-filter branch 2 times, most recently from ef27257 to b759a13 Compare March 8, 2023 06:21
@codecov-commenter
Copy link

codecov-commenter commented Mar 8, 2023

Codecov Report

❗ No coverage uploaded for pull request base (main@9fffd01). Click here to learn what that means.
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     #330   +/-   ##
=======================================
  Coverage        ?   84.17%           
=======================================
  Files           ?       17           
  Lines           ?      436           
  Branches        ?       58           
=======================================
  Hits            ?      367           
  Misses          ?       52           
  Partials        ?       17           

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

1. Changes cursor
2. Add instruction on how to proceed.
3. Revert once cancel is seleted.

Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>
public/components/map_container/map_container.tsx Outdated Show resolved Hide resolved
@@ -265,6 +266,7 @@ export const MapContainer = ({
{mounted && tooltipState === TOOLTIP_STATE.DISPLAY_FEATURES && (
<DisplayFeatures map={maplibreRef.current!} layers={layers} />
)}
{mounted && <DrawTooltip map={maplibreRef.current!} mode={filterProperties.mode} />}
Copy link
Member

Choose a reason for hiding this comment

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

I'd rather do this instead of non-null assertion, that usually leads to runtime exceptions.

mounted && Boolean(maplibreRef.current) && <DrawTooltip map={maplibreRef.current} mode={filterProperties.mode} />

Copy link
Member

Choose a reason for hiding this comment

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

My bad, actually we can only get rid of non-null assertion if we do this:

mounted && maplibreRef.current && <DrawTooltip map={maplibreRef.current} mode={filterProperties.mode} />

public/components/toolbar/spatial_filter/draw_tooltip.tsx Outdated Show resolved Hide resolved
public/components/toolbar/spatial_filter/draw_tooltip.tsx Outdated Show resolved Hide resolved
public/components/toolbar/spatial_filter/draw_tooltip.tsx Outdated Show resolved Hide resolved
Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>
@VijayanB VijayanB merged commit 3a20e81 into opensearch-project:main Mar 10, 2023
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 10, 2023
* Add tooltip to draw filter shape

1. Changes cursor
2. Add instruction on how to proceed.
3. Revert once cancel is selected.

Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>
(cherry picked from commit 3a20e81)
junqiu-lei pushed a commit that referenced this pull request Mar 10, 2023
* Add tooltip to draw filter shape

1. Changes cursor
2. Add instruction on how to proceed.
3. Revert once cancel is selected.

Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>
(cherry picked from commit 3a20e81)

Co-authored-by: Vijayan Balasubramanian <vijayan.balasubramanian@gmail.com>
VijayanB pushed a commit to VijayanB/dashboards-maps that referenced this pull request Mar 20, 2023
…-project#337)

* Add tooltip to draw filter shape

1. Changes cursor
2. Add instruction on how to proceed.
3. Revert once cancel is selected.

Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>
(cherry picked from commit 3a20e81)

Co-authored-by: Vijayan Balasubramanian <vijayan.balasubramanian@gmail.com>
(cherry picked from commit c8523be)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants