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

Enhance layer visibility status display #299

Merged
merged 4 commits into from
Feb 28, 2023

Conversation

junqiu-lei
Copy link
Member

Description

Enhance layer visibility status display.

Priority 0: When layer visibility is none: 1) show tooltip "layer is hidden" and 2) gray out the icon and layer name

image

Priority 1: When layer setting zoom level range is out of current zoom level, 1) show tooltip "layer is not visible outside of zoom range a to b" and 2) gray out the icon and layer name
image

Issues Resolved

Closes #298

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.

Signed-off-by: Junqiu Lei <junqiu@amazon.com>
@junqiu-lei junqiu-lei requested a review from a team February 27, 2023 23:43
};

const layerIsVisible = (layer: MapLayerSpecification) => {
const layerIsVisible = (layer: MapLayerSpecification): boolean => {
if (layer.visibility === 'none') {
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 in other places we decides whether a layer is visible or not based on value 'visible'. Let's not add multiple definition and keep with check layer.visibility === 'visible' as visibility check.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks let me know, updated

@@ -226,14 +226,20 @@ export const LayerControlPanel = memo(
};

const getLayerTooltipContent = (layer: MapLayerSpecification) => {
if (layer.visibility === 'none') {
return 'Layer is hidden';
Copy link
Member

Choose a reason for hiding this comment

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

We might need translation here

Copy link
Member Author

Choose a reason for hiding this comment

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

Added i18n here

Signed-off-by: Junqiu Lei <junqiu@amazon.com>
@junqiu-lei junqiu-lei requested review from VijayanB and a team February 28, 2023 17:44
@codecov-commenter
Copy link

Codecov Report

Merging #299 (1de446c) into main (f88aa15) will not change coverage.
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     #299   +/-   ##
=======================================
  Coverage   91.42%   91.42%           
=======================================
  Files          11       11           
  Lines         280      280           
  Branches       37       37           
=======================================
  Hits          256      256           
  Misses         17       17           
  Partials        7        7           

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

Signed-off-by: Junqiu Lei <junqiu@amazon.com>
VijayanB
VijayanB previously approved these changes Feb 28, 2023
@junqiu-lei
Copy link
Member Author

Hi @kolchfa-aws, could you help review the PR from document perspective? Thank you!

@kolchfa-aws
Copy link

The first tooltip is fine. Here's a suggestion for the second one:
Layer is hidden outside of zoom range 2--22
Note: there should be an en dash (not a hyphen) between 2 and 22, and no space before or after the en dash.

@junqiu-lei
Copy link
Member Author

The first tooltip is fine. Here's a suggestion for the second one: Layer is hidden outside of zoom range 2--22 Note: there should be an en dash (not a hyphen) between 2 and 22, and no space before or after the en dash.

Thanks @kolchfa-aws suggestion. It will be:

image

@kolchfa-aws
Copy link

Yup, LGTM.

Signed-off-by: Junqiu Lei <junqiu@amazon.com>
Copy link

@kolchfa-aws kolchfa-aws left a comment

Choose a reason for hiding this comment

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

LGTM

@VijayanB VijayanB merged commit 70d5f9e into opensearch-project:main Feb 28, 2023
opensearch-trigger-bot bot pushed a commit that referenced this pull request Feb 28, 2023
* Gray out layer name and icon on invisible layer
* Add i18n

Signed-off-by: Junqiu Lei <junqiu@amazon.com>
(cherry picked from commit 70d5f9e)
junqiu-lei added a commit that referenced this pull request Feb 28, 2023
* Gray out layer name and icon on invisible layer
* Add i18n

Signed-off-by: Junqiu Lei <junqiu@amazon.com>
(cherry picked from commit 70d5f9e)

Co-authored-by: Junqiu Lei <junqiu@amazon.com>
VijayanB pushed a commit to VijayanB/dashboards-maps that referenced this pull request Mar 20, 2023
…nsearch-project#302)

* Gray out layer name and icon on invisible layer
* Add i18n

Signed-off-by: Junqiu Lei <junqiu@amazon.com>
(cherry picked from commit 70d5f9e)

Co-authored-by: Junqiu Lei <junqiu@amazon.com>
(cherry picked from commit 87c2422)
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.

[Enhancement] gray out layer name and layer icon on hidden layer
4 participants