Skip to content

Commit

Permalink
Merge pull request #354 from dymaptic/bug/353-basemap-layer-list-error
Browse files Browse the repository at this point in the history
Fix for BasemapLayerListWidget error
  • Loading branch information
TimPurdum authored Aug 10, 2024
2 parents 753a22f + 9e5ed4b commit 39c6203
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 11 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 /p:UpdateTemplates=false -c Release
run: dotnet build ./src/dymaptic.GeoBlazor.Core/dymaptic.GeoBlazor.Core.csproj --no-restore /p:OptOutFromCoreEsBuild=true /p:GenerateDocs=false /p:UpdateTemplates=false -c Release
- name: Install xmllint
shell: bash
run: |
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<PropertyGroup>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<CoreVersion>3.1.0</CoreVersion>
<CoreVersion>3.1.1</CoreVersion>
</PropertyGroup>
</Project>
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 @@ -81,7 +81,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="dymaptic.GeoBlazor.Core" Version="3.1.0" />
<PackageReference Include="dymaptic.GeoBlazor.Core" Version="3.1.1" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="dymaptic.GeoBlazor.Core" Version="3.1.0" />
<PackageReference Include="dymaptic.GeoBlazor.Core" Version="3.1.1" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="dymaptic.GeoBlazor.Core" Version="3.1.0" />
<PackageReference Include="dymaptic.GeoBlazor.Core" Version="3.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.7" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.7" PrivateAssets="all" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<ItemGroup>
<ProjectReference Include="..\dymaptic.GeoBlazor.Template.WebApp.Client\dymaptic.GeoBlazor.Template.WebApp.Client.csproj" />
<PackageReference Include="dymaptic.GeoBlazor.Core" Version="3.1.0" />
<PackageReference Include="dymaptic.GeoBlazor.Core" Version="3.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.7" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="dymaptic.GeoBlazor.Core" Version="3.1.0" />
<PackageReference Include="dymaptic.GeoBlazor.Core" Version="3.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.7" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.7" PrivateAssets="all" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion templates/dymaptic.GeoBlazor.Templates.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<PackageId>dymaptic.GeoBlazor.Templates</PackageId>
<Title>GeoBlazor Project Templates</Title>
<PackageVersion>3.1.0</PackageVersion>
<PackageVersion>3.1.1</PackageVersion>
<Version>2.5.2</Version>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Company>dymaptic</Company>
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 39c6203

Please sign in to comment.