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

Feature/51 bookmarks widget #200

Merged
merged 39 commits into from
Jul 21, 2023
Merged

Conversation

AndersenBell
Copy link
Collaborator

closes #51

Adds support for the bookmark widget.
Adds missing properties on the Expander widget
Adds deprecated comments to deprecated properties
Adds Widget re-render support

@AndersenBell AndersenBell requested a review from seahro July 18, 2023 15:40
@AndersenBell AndersenBell requested a review from TimPurdum July 18, 2023 15:40
@AndersenBell AndersenBell self-assigned this Jul 18, 2023
if (!(dnBookmark.thumbnail == null)) {
//ESRI has this as an "object" with url property
let thumbnail = new Object();
thumbnail.url = dnBookmark.thumbnail;
Copy link
Collaborator

Choose a reason for hiding this comment

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

In the future, does it make sense to give thumbnails their own class? Other than bookmarks, I would think popups and some other items could use them.

@@ -25,13 +26,15 @@ public class ExpandWidget : Widget

/// <summary>
/// Icon font used to style the Expand button when collapsed.
/// Deprecated
/// </summary>
[Parameter]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? CollapseIconClass { get; set; }
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we want to simply remove these since they are deprecated?

Copy link
Collaborator

Choose a reason for hiding this comment

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

No, @AndersenBell we should use the C# [Obsolete] attribute for deprecated properties.

Copy link
Collaborator

@seahro seahro left a comment

Choose a reason for hiding this comment

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

Looks good. Good job integrating the variety of items that go into implementing each bookmark.
One question about keeping the Deprecated properties.

Copy link
Collaborator

@TimPurdum TimPurdum left a comment

Choose a reason for hiding this comment

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

A few odds and ends, clarifying the two samples, adding [Obsolete] to deprecated properties, etc.


<div class="links-div">
<a class="btn btn-secondary" target="_blank" href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html">ArcGIS API for JavaScript Reference</a>
<a class="btn btn-primary" target="_blank" href="https://www.arcgis.com/home/item.html?id=70b726074af04a7e9839d8a07f64c039">Bookmarks widget</a>
Copy link
Collaborator

Choose a reason for hiding this comment

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

The text on this line should say "Hurricanes", i.e., the name of the layer.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Still need to update the text here.

@@ -25,13 +26,15 @@ public class ExpandWidget : Widget

/// <summary>
/// Icon font used to style the Expand button when collapsed.
/// Deprecated
/// </summary>
[Parameter]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? CollapseIconClass { get; set; }
Copy link
Collaborator

Choose a reason for hiding this comment

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

No, @AndersenBell we should use the C# [Obsolete] attribute for deprecated properties.

<div class="col-12">
<p>Click on a bookmark to navigate to its location.</p>
<BookmarksWidget />
</div>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this page not finished? Or does the BookmarksWidget really work with no parameters?

{
<ExpandWidget Position="OverlayPosition.TopRight" Expanded="true" ExpandIcon="refresh" CollapseIcon="submit" >
<BookmarksWidget @ref="_bookmarkWidget" EditingEnabled="true">
@*<Bookmark Name="InlineExample">
Copy link
Collaborator

Choose a reason for hiding this comment

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

What if we moved the inline markup example to the Bookmarks.razor page?

}

}

Copy link
Collaborator

Choose a reason for hiding this comment

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

There's one more method I'd like us to get in the habit of overriding, internal override ValidateRequiredChildren(). In that, you call each "registered" child like Child.ValidateRequiredChildren(). This is what makes the [RequiredProperty] attribute work.

Copy link
Collaborator

Choose a reason for hiding this comment

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

In this case, I don't think any of your children have required props, but it's still good if we do this everywhere.

}

[JsonConverter(typeof(EnumToKebabCaseStringConverter<Mode>))]
public enum Mode
Copy link
Collaborator

Choose a reason for hiding this comment

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

this will need an xml doc comment.


if (!(dnBookmark.thumbnail == null)) {
//ESRI has this as an "object" with url property
let thumbnail = new Object();
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be definable as

let thumbnail = {
    url: dnBookmark.thumbnail
};

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

thanks, I tried that it couldn't find the syntax to get it to work, works now.

@AndersenBell AndersenBell requested a review from TimPurdum July 19, 2023 15:05
@AndersenBell AndersenBell requested a review from seahro July 21, 2023 19:40
Copy link
Collaborator

@TimPurdum TimPurdum left a comment

Choose a reason for hiding this comment

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

Just a few odds and ends to wrap up, looking good!

#timeSliderDiv {
width: 300px;
}
</style>
Copy link
Collaborator

Choose a reason for hiding this comment

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

This stuff still seems non-standard for a Blazor page. If we really need these values, they should be in Bookmarks.razor.css, probably just leftovers from testing?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this is copied from the ESRI example... so maybe?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think you need the line or the <style> tag.


<div class="links-div">
<a class="btn btn-secondary" target="_blank" href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html">ArcGIS API for JavaScript Reference</a>
<a class="btn btn-primary" target="_blank" href="https://www.arcgis.com/home/item.html?id=70b726074af04a7e9839d8a07f64c039">Bookmarks widget</a>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Still need to update the text here.

src/dymaptic.GeoBlazor.Core/Events/BookmarkSelectEvent.cs Outdated Show resolved Hide resolved
src/dymaptic.GeoBlazor.Core/Scripts/jsBuilder.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@seahro seahro left a comment

Choose a reason for hiding this comment

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

looks great. "Effects", "Time" and "Filter" will be nice additions to built out in future iterations.

@AndersenBell AndersenBell merged commit 0ca7b69 into develop Jul 21, 2023
@AndersenBell AndersenBell deleted the feature/51-bookmarks-widget branch July 21, 2023 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Bookmarks Widget
3 participants