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

fix popup actions #208

Merged
merged 4 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions src/dymaptic.GeoBlazor.Core.sln
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dymaptic.GeoBlazor.Core.Sam
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dymaptic.GeoBlazor.Core.Sample.ServerOAuth", "..\samples\dymaptic.GeoBlazor.Core.Sample.ServerOAuth\dymaptic.GeoBlazor.Core.Sample.ServerOAuth.csproj", "{3DED106E-5ED1-4506-87CA-50C40465D6A1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dymaptic.GeoBlazor.Core.Test.Blazor", "..\tests\dymaptic.GeoBlazor.Core.Test.Blazor\dymaptic.GeoBlazor.Core.Test.Blazor.csproj", "{FACB8396-34A0-4BB0-98B0-463BC26BE349}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dymaptic.GeoBlazor.Core.Test.Blazor.Server", "..\test\dymaptic.GeoBlazor.Core.Test.Blazor.Server\dymaptic.GeoBlazor.Core.Test.Blazor.Server.csproj", "{915558F0-1755-42D9-81EC-805774ECEB42}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dymaptic.GeoBlazor.Core.Test.Blazor.Shared", "..\test\dymaptic.GeoBlazor.Core.Test.Blazor.Shared\dymaptic.GeoBlazor.Core.Test.Blazor.Shared.csproj", "{41CD66DB-1487-4F37-B2C6-3DB569116E89}"
Expand Down Expand Up @@ -72,10 +70,6 @@ Global
{3DED106E-5ED1-4506-87CA-50C40465D6A1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3DED106E-5ED1-4506-87CA-50C40465D6A1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3DED106E-5ED1-4506-87CA-50C40465D6A1}.Release|Any CPU.Build.0 = Release|Any CPU
{FACB8396-34A0-4BB0-98B0-463BC26BE349}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FACB8396-34A0-4BB0-98B0-463BC26BE349}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FACB8396-34A0-4BB0-98B0-463BC26BE349}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FACB8396-34A0-4BB0-98B0-463BC26BE349}.Release|Any CPU.Build.0 = Release|Any CPU
{915558F0-1755-42D9-81EC-805774ECEB42}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{915558F0-1755-42D9-81EC-805774ECEB42}.Debug|Any CPU.Build.0 = Debug|Any CPU
{915558F0-1755-42D9-81EC-805774ECEB42}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
16 changes: 10 additions & 6 deletions src/dymaptic.GeoBlazor.Core/Scripts/jsBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ import ComboBoxInput from "@arcgis/core/form/elements/inputs/ComboBoxInput";
import RadioButtonsInput from "@arcgis/core/form/elements/inputs/RadioButtonsInput";
import SwitchInput from "@arcgis/core/form/elements/inputs/SwitchInput";
import Domain from "@arcgis/core/layers/support/Domain";
import * as reactiveUtils from "@arcgis/core/core/reactiveUtils";


export function buildJsSpatialReference(dotNetSpatialReference: DotNetSpatialReference): SpatialReference {
Expand Down Expand Up @@ -260,9 +261,12 @@ export function buildJsPopupTemplate(popupTemplateObject: DotNetPopupTemplate, v
if (hasValue(templateTriggerActionHandler)) {
templateTriggerActionHandler.remove();
}
templateTriggerActionHandler = view.popup.on("trigger-action", async (event: PopupTriggerActionEvent) => {
await popupTemplateObject.dotNetPopupTemplateReference.invokeMethodAsync("OnTriggerAction", event.action.id);
});
reactiveUtils.once(() => view.popup.on !== undefined)
.then(() => {
templateTriggerActionHandler = view.popup.on("trigger-action", async (event: PopupTriggerActionEvent) => {
await popupTemplateObject.dotNetPopupTemplateReference.invokeMethodAsync("OnTriggerAction", event.action.id);
});
})
}
catch (error) {
console.debug(error);
Expand Down Expand Up @@ -727,9 +731,9 @@ export function buildJsQuery(dotNetQuery: DotNetQuery): Query {
where: dotNetQuery.where ?? "1=1",
spatialRelationship: dotNetQuery.spatialRelationship as any ?? "intersects",
distance: dotNetQuery.distance ?? undefined,
units: dotNetQuery.units as any ?? null,
Copy link
Collaborator

Choose a reason for hiding this comment

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

units: dotNetQuery.units as any ?? undefined,
returnGeometry: dotNetQuery.returnGeometry ?? false,
outFields: dotNetQuery.outFields ?? null,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I haven't actually improved anything here, but I also didn't hurt anything. I think I made this change as part of an investigation into an issue, and it seemed to make more sense to me to keep it undefined as more consistent.

outFields: dotNetQuery.outFields ?? undefined,
orderByFields: dotNetQuery.orderByFields ?? undefined,
outStatistics: dotNetQuery.outStatistics ?? undefined,
groupByFieldsForStatistics: dotNetQuery.groupByFieldsForStatistics ?? undefined,
Expand All @@ -748,7 +752,7 @@ export function buildJsQuery(dotNetQuery: DotNetQuery): Query {
having: dotNetQuery.having ?? undefined,
historicMoment: dotNetQuery.historicMoment ?? undefined,
maxRecordCountFactor: dotNetQuery.maxRecordCountFactor ?? 1,
text: dotNetQuery.text ?? null,
text: dotNetQuery.text ?? undefined,
parameterValues: dotNetQuery.parameterValues ?? undefined,
quantizationParameters: dotNetQuery.quantizationParameters ?? undefined,
rangeValues: dotNetQuery.rangeValues ?? undefined,
Expand Down
2 changes: 1 addition & 1 deletion src/dymaptic.GeoBlazor.Core/assetCopy.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$SourceFiles = "./node_modules/@arcgis/core/assets/*"
$SourceFiles = "./node_modules/@arcgis/core/assets"
$OutputDir = "./wwwroot/assets"
$packageJson = (Get-Content "package.json" -Raw) | ConvertFrom-Json
# read the version from package.json
Expand Down
5 changes: 2 additions & 3 deletions src/dymaptic.GeoBlazor.Core/dymaptic.GeoBlazor.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
</Description>
<Title>GeoBlazor</Title>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageVersion>2.2.1</PackageVersion>
<Version>2.2.1</Version>
<PackageVersion>2.3.0-beta-1</PackageVersion>
<Version>2.3.0-beta-1</Version>
<Authors>Tim Purdum, Christopher Moravec, Mara Stoica, Tim Rawson</Authors>
<Company>dymaptic</Company>
<Copyright>©2023 by dymaptic</Copyright>
Expand Down Expand Up @@ -68,7 +68,6 @@
</ItemGroup>

<ItemGroup>
<Folder Include="wwwroot\assets" />
<Content Remove="node_modules\**" />
</ItemGroup>

Expand Down
4 changes: 2 additions & 2 deletions src/dymaptic.GeoBlazor.Core/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/dymaptic.GeoBlazor.Core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dymaptic.GeoBlazor.Core",
"version": "2.2.1",
"version": "2.3.0-beta-1",
"description": "https://www.geoblazor.com",
"main": "arcGisInterop.js",
"scripts": {
Expand Down