From 7080222fbc23ffaba61c78d75cee7b67b8ea4894 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Wed, 25 Feb 2026 17:36:19 +0000 Subject: [PATCH] Add page for configuring ArcGIS integration. --- .../sync/setting-integration-arcgis.html | 237 ++++++++++++++++++ html/template/sync/setting-integration.html | 39 ++- sync/routes.go | 3 +- sync/setting.go | 10 + sync/url.go | 2 + 5 files changed, 282 insertions(+), 9 deletions(-) create mode 100644 html/template/sync/setting-integration-arcgis.html diff --git a/html/template/sync/setting-integration-arcgis.html b/html/template/sync/setting-integration-arcgis.html new file mode 100644 index 00000000..9609f874 --- /dev/null +++ b/html/template/sync/setting-integration-arcgis.html @@ -0,0 +1,237 @@ +{{ template "sync/layout/authenticated.html" . }} + +{{ define "title" }}Settings - Integrations{{ end }} +{{ define "extraheader" }} +{{ end }} +{{ define "content" }} +
+
+
+ +
+ +
+

ArcGIS Integration

+

Configure your Esri ArcGIS connection

+
+
+ + +
+
+
+ +
+
+ OAuth + Authentication +
+ +
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
+ + +
+ + +
+
+ +
+ + +
+
+ Feature Layer + Configuration +
+ +
+
+ + +
+ Select the feature layer for satellite imagery data +
+
+ +
+ + +
+ Select the feature layer for parcel boundary data +
+
+
+
+ + +
+ + +
+
+
+
+ + + +
+
+
+ + + +{{ end }} diff --git a/html/template/sync/setting-integration.html b/html/template/sync/setting-integration.html index cd9f6154..7ac89e9b 100644 --- a/html/template/sync/setting-integration.html +++ b/html/template/sync/setting-integration.html @@ -48,17 +48,17 @@ - -
+ +
-

Frontier Precision's FieldSeeker GIS

+

Esri's ArcGIS

FieldSeeker Logo
@@ -103,12 +103,35 @@ Refresh OAuth Token - + + Configure +
+ +
+
+
+

Frontier Precision's FieldSeeker GIS

+
+ FieldSeeker Logo +
+
+
+ + +
+
+
+
+
diff --git a/sync/routes.go b/sync/routes.go index 1ea8991b..02485413 100644 --- a/sync/routes.go +++ b/sync/routes.go @@ -59,8 +59,9 @@ func Router() chi.Router { r.Method("GET", "/service-request", authenticatedHandler(getServiceRequestList)) r.Method("GET", "/service-request/{id}", authenticatedHandler(getServiceRequestDetail)) r.Method("GET", "/setting", authenticatedHandler(getSetting)) - r.Method("GET", "/setting/organization", authenticatedHandler(getSettingOrganization)) r.Method("GET", "/setting/integration", authenticatedHandler(getSettingIntegration)) + r.Method("GET", "/setting/integration/arcgis", authenticatedHandler(getSettingIntegrationArcgis)) + r.Method("GET", "/setting/organization", authenticatedHandler(getSettingOrganization)) r.Method("GET", "/setting/pesticide", authenticatedHandler(getSettingPesticide)) r.Method("GET", "/setting/pesticide/add", authenticatedHandler(getSettingPesticideAdd)) r.Method("GET", "/setting/user", authenticatedHandler(getSettingUserList)) diff --git a/sync/setting.go b/sync/setting.go index cab6cf66..5584fb2f 100644 --- a/sync/setting.go +++ b/sync/setting.go @@ -76,6 +76,16 @@ func getSettingIntegration(ctx context.Context, r *http.Request, org *models.Org } return newResponse("sync/setting-integration.html", data), nil } +func getSettingIntegrationArcgis(ctx context.Context, r *http.Request, org *models.Organization, u *models.User) (*response[contentSettingIntegration], *errorWithStatus) { + oauth, err := arcgis.GetOAuthForUser(ctx, u) + if err != nil { + return nil, newError("Failed to get oauth: %w", err) + } + data := contentSettingIntegration{ + ArcGISOAuth: oauth, + } + return newResponse("sync/setting-integration-arcgis.html", data), nil +} type contentSettingPlaceholder struct{} diff --git a/sync/url.go b/sync/url.go index cd6d4dd0..516ad6e7 100644 --- a/sync/url.go +++ b/sync/url.go @@ -15,6 +15,7 @@ type contentURL struct { } type contentURLSetting struct { + ArcGIS string Fieldseeker string Integration string Organization string @@ -38,6 +39,7 @@ func newContentURL() contentURL { } func newContentURLSetting() contentURLSetting { return contentURLSetting{ + ArcGIS: config.MakeURLNidus("/setting/integration/arcgis"), Fieldseeker: config.MakeURLNidus("/setting/integration/fieldseeker"), Integration: config.MakeURLNidus("/setting/integration"), Organization: config.MakeURLNidus("/setting/organization"),