Skip to content

Commit

Permalink
merge in from develop
Browse files Browse the repository at this point in the history
  • Loading branch information
TimPurdum committed Aug 10, 2024
2 parents 72aaeac + 39c6203 commit c7be8e3
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main-release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
./assetCopy.ps1
cd ../..
- name: Build Core
run: dotnet build ./src/dymaptic.GeoBlazor.Core/dymaptic.GeoBlazor.Core.csproj --no-restore /p:OptOutFromCoreEsBuild=false /p:GenerateDocs=false -c Release
run: dotnet build ./src/dymaptic.GeoBlazor.Core/dymaptic.GeoBlazor.Core.csproj --no-restore /p:OptOutFromCoreEsBuild=true /p:GenerateDocs=false -c Release
- name: Install xmllint
shell: bash
run: |
Expand Down
6 changes: 3 additions & 3 deletions src/dymaptic.GeoBlazor.Core/Scripts/arcGisJsInterop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2034,7 +2034,7 @@ async function createWidget(widget: any, viewId: string): Promise<Widget | null>
});
newWidget = layerListWidget;

if (hasValue(widget.hasCustomHandler)) {
if (hasValue(widget.hasCustomHandler) && widget.hasCustomHandler) {
layerListWidget.listItemCreatedFunction = async (evt) => {
let dotNetListItem = buildDotNetListItem(evt.item);
let returnItem = await widget.layerListWidgetObjectReference.invokeMethodAsync('OnListItemCreated', dotNetListItem) as DotNetListItem;
Expand All @@ -2051,7 +2051,7 @@ async function createWidget(widget: any, viewId: string): Promise<Widget | null>
});
newWidget = basemapLayerListWidget;

if (hasValue(widget.hasCustomBaseListHandler)) {
if (hasValue(widget.hasCustomBaseListHandler) && widget.hasCustomBaseListHandler) {
basemapLayerListWidget.baseListItemCreatedFunction = async (evt) => {
let dotNetBaseListItem = buildDotNetListItem(evt.item);
let returnItem = await widget.baseLayerListWidgetObjectReference.invokeMethodAsync('OnBaseListItemCreated', dotNetBaseListItem) as DotNetListItem;
Expand All @@ -2060,7 +2060,7 @@ async function createWidget(widget: any, viewId: string): Promise<Widget | null>
}
};
}
if (hasValue(widget.hasCustomReferenceListHandler)) {
if (hasValue(widget.hasCustomReferenceListHandler) && widget.hasCustomReferenceListHandler) {
basemapLayerListWidget.baseListItemCreatedFunction = async (evt) => {
let dotNetReferenceListItem = buildDotNetListItem(evt.item);
let returnItem = await widget.baseLayerListWidgetObjectReference.invokeMethodAsync('OnReferenceListItemCreated', dotNetReferenceListItem) as DotNetListItem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,30 @@
Assert.IsTrue(handlerWasCalled);
}

[TestMethod]
public async Task TestCanRenderBasemapLayerListWidgetWithoutHandler(Action renderHandler)
{
AddMapRenderFragment(
@<MapView class="map-view" OnViewRendered="renderHandler">

<Map>
<Basemap>
<TileLayer>
<PortalItem Id="1b243539f4514b6ba35e7d995890db1d" />
</TileLayer>
<VectorTileLayer Opacity="0.75">
<PortalItem Id="6976148c11bd497d8624206f9ee03e30" />
</VectorTileLayer>
</Basemap>
</Map>
<BasemapLayerListWidget />

</MapView>);

await WaitForMapToRender();
await AssertJavaScript("assertWidgetExists", args: "esri.widgets.BasemapLayerList");
}

[TestMethod]
public async Task TestBasemapToggleFailsWithoutNextBasemap(Action renderHandler)
{
Expand Down

0 comments on commit c7be8e3

Please sign in to comment.