From 9613cac11a26bcc07750dfab83d66a7e9e68538a Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Fri, 27 Feb 2026 16:51:41 +0000 Subject: [PATCH] Add all of Ben's mocks for the new root pages --- html/template/sync/communication-root.html | 302 ++++++++++++ .../integration-arcgis.html} | 0 .../integration.html} | 0 .../organization.html} | 0 .../pesticide-add.html} | 0 .../pesticide.html} | 0 .../root.html} | 19 +- .../user-add.html} | 0 .../user-list.html} | 0 html/template/sync/intelligence-root.html | 295 ++++++++++++ html/template/sync/operations-root.html | 432 ++++++++++++++++++ html/template/sync/review-root.html | 350 ++++++++++++++ sync/communication.go | 14 + sync/config.go | 15 - sync/configuration.go | 117 +++++ sync/intelligence.go | 14 + sync/operations.go | 14 + sync/review.go | 14 + sync/routes.go | 30 +- sync/setting.go | 106 +---- sync/url.go | 12 + 21 files changed, 1593 insertions(+), 141 deletions(-) create mode 100644 html/template/sync/communication-root.html rename html/template/sync/{setting-integration-arcgis.html => configuration/integration-arcgis.html} (100%) rename html/template/sync/{setting-integration.html => configuration/integration.html} (100%) rename html/template/sync/{setting-organization.html => configuration/organization.html} (100%) rename html/template/sync/{setting-pesticide-add.html => configuration/pesticide-add.html} (100%) rename html/template/sync/{setting-pesticide.html => configuration/pesticide.html} (100%) rename html/template/sync/{settings.html => configuration/root.html} (92%) rename html/template/sync/{setting-user-add.html => configuration/user-add.html} (100%) rename html/template/sync/{setting-user-list.html => configuration/user-list.html} (100%) create mode 100644 html/template/sync/intelligence-root.html create mode 100644 html/template/sync/operations-root.html create mode 100644 html/template/sync/review-root.html create mode 100644 sync/communication.go delete mode 100644 sync/config.go create mode 100644 sync/configuration.go create mode 100644 sync/intelligence.go create mode 100644 sync/operations.go create mode 100644 sync/review.go diff --git a/html/template/sync/communication-root.html b/html/template/sync/communication-root.html new file mode 100644 index 00000000..d8fea463 --- /dev/null +++ b/html/template/sync/communication-root.html @@ -0,0 +1,302 @@ +{{ template "sync/layout/authenticated.html" . }} + +{{ define "title" }}Planning{{ end }} +{{ define "extraheader" }} + + + + + +{{ end }} +{{ define "content" }} +
+ +
+
Signal Feed
+
+
+ + + + +
+ +
+ + +
+ +
+
+
+ + +
+
Select a signal
+
+ +
Map Preview
+ +
+ +
+
Report Narrative
+
+ +
Conversation
+
+ + + +
+ + +
+
Context Summary
+ +
+ Signal Type +
Adult / Standing Water
+
+ +
+ Site Attachment +
1234 Maple Ave
+ +
+ +
+ Nearby Reports (7 day window) +
3 related adult reports
+ +
+ +
+ Existing Lead Suggestions +
+ 💡 Possible matching lead in same H3 +
+ +
+ +
+ Reporter Reliability +
High , 12 prior reports
+ +
+
+
+
+
+ + +
+
Signal , Lead Tools
+
+
Lead Formation
+ + + + +
Communication Routing
+ + + + +
+ + +
+ +
+ +
Disposition
+ + +
+
+
+{{ end }} diff --git a/html/template/sync/setting-integration-arcgis.html b/html/template/sync/configuration/integration-arcgis.html similarity index 100% rename from html/template/sync/setting-integration-arcgis.html rename to html/template/sync/configuration/integration-arcgis.html diff --git a/html/template/sync/setting-integration.html b/html/template/sync/configuration/integration.html similarity index 100% rename from html/template/sync/setting-integration.html rename to html/template/sync/configuration/integration.html diff --git a/html/template/sync/setting-organization.html b/html/template/sync/configuration/organization.html similarity index 100% rename from html/template/sync/setting-organization.html rename to html/template/sync/configuration/organization.html diff --git a/html/template/sync/setting-pesticide-add.html b/html/template/sync/configuration/pesticide-add.html similarity index 100% rename from html/template/sync/setting-pesticide-add.html rename to html/template/sync/configuration/pesticide-add.html diff --git a/html/template/sync/setting-pesticide.html b/html/template/sync/configuration/pesticide.html similarity index 100% rename from html/template/sync/setting-pesticide.html rename to html/template/sync/configuration/pesticide.html diff --git a/html/template/sync/settings.html b/html/template/sync/configuration/root.html similarity index 92% rename from html/template/sync/settings.html rename to html/template/sync/configuration/root.html index 4816b596..68f1c564 100644 --- a/html/template/sync/settings.html +++ b/html/template/sync/configuration/root.html @@ -1,6 +1,6 @@ {{ template "sync/layout/authenticated.html" . }} -{{ define "title" }}Settings{{ end }} +{{ define "title" }}Planning{{ end }} {{ define "extraheader" }} {{ end }} {{ define "content" }} @@ -110,21 +110,24 @@ - +
- +
-

Notifications

+

Uploads

- Configure email alerts, SMS notifications, and reporting - preferences. + Upload files (spreadsheets, scans, notes) to make the data + available to Nidus

diff --git a/html/template/sync/setting-user-add.html b/html/template/sync/configuration/user-add.html similarity index 100% rename from html/template/sync/setting-user-add.html rename to html/template/sync/configuration/user-add.html diff --git a/html/template/sync/setting-user-list.html b/html/template/sync/configuration/user-list.html similarity index 100% rename from html/template/sync/setting-user-list.html rename to html/template/sync/configuration/user-list.html diff --git a/html/template/sync/intelligence-root.html b/html/template/sync/intelligence-root.html new file mode 100644 index 00000000..9082ed13 --- /dev/null +++ b/html/template/sync/intelligence-root.html @@ -0,0 +1,295 @@ +{{ template "sync/layout/authenticated.html" . }} + +{{ define "title" }}Planning{{ end }} +{{ define "extraheader" }} + + + + +{{ end }} +{{ define "content" }} + + +
+
+

Daily Planning Workbench

+
+ Signals and leads enter from the left, are investigated in the center, + and transformed into structured field assignments using tools on the + right. +
+
+
+ +
+ +
+
+
+ Incoming Signals & Leads +
+
+ +
+
Species
+ + +
Signal Type
+ + +
Sort By
+ +
+ +
+ + +
+
Signals
+ +
+
+ Public Report – Service Request #1024 +
+
+ Aedes aegypti • Standing Water Complaint +
+
+ +
+
+ Trap Spike – H3 8828308281fffff +
+
Culex pipiens • Adult Surge
+
+ +
+
+ Residual Expiring – Parcel 45-233-01 +
+
Reinspection Due
+
+
+ +
+ + +
+
Mosquito Control Plan Follow-Ups
+ +
+
+ Plan Follow-Up – Greenway HOA Basin +
+
+ Residential Section • Verification Required +
+ Plan +
+ +
+
+ Plan Follow-Up – Ag Irrigation Canal 7B +
+
Ag Section • Monitoring Window
+ Plan +
+
+ +
+ + +
+
Existing Leads
+ +
+
Lead #L-204
+
3 Signals • Aedes aegypti
+
+ +
+
Lead #L-198
+
2 Signals • Culex pipiens
+
+
+
+
+
+ + +
+
+
+ Active Investigation Workbench +
+
+
+ Map Placeholder
+ H3 Cells • Parcels • Signal Density • Lead Clusters +
+ +
+
+
+
+
Selected Signals
+
3 Signals Selected
+
    +
  • Public Report – Aedes aegypti
  • +
  • Trap Spike – Culex pipiens
  • +
  • Plan Follow-Up – HOA Basin
  • +
+
+
+
+ +
+
+
+
Derived Lead Strength
+
Signal Convergence Score
+
+ High Confidence +
+
+
+
+ +
+
+
+
Related Communications
+
Inbound & outbound contact
+
    +
  • Resident follow-up requested
  • +
  • HOA notification sent
  • +
+
+
+
+ +
+
+
+
Priority Context
+
Risk synthesis
+ Elevated Aedes Risk +
+
+
+
+
+
+
+ + +
+
+
Transformation Tools
+
+
+
Signal → Lead
+ + + +
+ +
+ +
+
Lead → Field Assignment
+ + + +
+ +
+ +
+
Assignment Controls
+ + + +
+
+
+
+
+{{ end }} diff --git a/html/template/sync/operations-root.html b/html/template/sync/operations-root.html new file mode 100644 index 00000000..7ff3ba76 --- /dev/null +++ b/html/template/sync/operations-root.html @@ -0,0 +1,432 @@ +{{ template "sync/layout/authenticated.html" . }} + +{{ define "title" }}Planning{{ end }} +{{ define "extraheader" }} + + + + +{{ end }} +{{ define "content" }} + + +
+
+

Operations Command Center

+
+
+ + +
+
+ + + + +
+ +
+
+ +
+
+
+ Assignments & Work Requests +
+ + +
+
+
+ +
+
+
+ +
+
+
+ Larval Habitat Inspection + Planned +
+ Residential · Backpack Blower +
+
+
+
+ +
+
+
+ Green Pool Treatment + Emergent +
+ Residential · Larvicide · Access Clearance +
+
+
+
+
+
+ + +
+
+
Routing Map
+
+ Map: Selected Assignments, Selected Technicians, Proposed Routes +
+ +
+
+ + +
+
+
+ Technicians +
+ + +
+
+
+ +
+
+
+ +
+
+
+ Technician A + Available +
+ Residential · ULV · Backpack +
+ + +
+
+
+
+
+ +
+
+
+ Technician B + In + Field +
+ Agricultural · Capacity Exceeded +
+ + +
+
+
+
+
+
+
+
+ + +
+
+
+
Proposed Routes
+
+
+ Route: Technician A
+ 5 Assignments · Est. 4.5 hrs · Equipment: Backpack +
+ + + + +
+
+
+ Route: Technician B
+ 6 Assignments · Est. 6 hrs · Equipment: ATV +
+ + + + +
+
+
+ +
+
+
+
+ + +
+
+ +
+
+
+ Assignments in Route Order +
+
+
+ Unassigned Assignments
+ 2 awaiting routing +
+
    +
  • + Green Pool Reinspection
    + Communication Pending +
  • +
  • + Storm Drain Treatment
    + In Progress +
  • +
+
+
+
+ + +
+
+ Live Map: Active Routes, Technician Position, Route Progress +
+
+ + +
+
+
Technician Status
+
+
+
+
+ Technician A + On Track +
+ 72% Complete · 1.5 hrs Remaining +
+
+
+ Technician C + Support Requested +
+ Equipment Issue +
+
+
+
+
+
+ + +
+
+
+
+ Active Routes Intelligence +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TechnicianAssignmentsEstimated CompletionRemaining TimeStatusActions
Technician A53:45 PM1 hr 30 minOn Track + + +
Technician C44:30 PM2 hrsBlocked + + +
+
+
+
+
+
+
+{{ end }} diff --git a/html/template/sync/review-root.html b/html/template/sync/review-root.html new file mode 100644 index 00000000..7bae275e --- /dev/null +++ b/html/template/sync/review-root.html @@ -0,0 +1,350 @@ +{{ template "sync/layout/authenticated.html" . }} + +{{ define "title" }}Planning{{ end }} +{{ define "extraheader" }} + + + + +{{ end }} +{{ define "content" }} + +
+ +
+
+
Daily Overview
+
+
+
+
Total Records
+ 142 +
+ +8% +
+
+
+
Acres Treated
+ 318.4 +
+ -5% +
+
+
+
Anomalies
+ 9 +
+ Above Avg +
+
+
+ +
+
System Signals
+
+
+ High acreage deviation + System +
+
+ Product-to-acre variance + System +
+
+ Rare task combination + Review +
+
+
+ +
+
Process Performance
+
+
+ Recommendation Acceptance: 78% +
+
Time Saved vs Plan: +6%
+
Override Logs: 5
+
+
+
+ + +
+
+
Geospatial Review
+
+
+
+ +
Interactive Map Placeholder
+ Spatial context for records, anomalies, and follow-ups. +
+
+
+
+ +
+
Technician Records
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IDTechnicianSectionTaskAcresProductStatusCommentsTags
REC-0142J. AlvarezAgriculturalTreatment24.5BtiFlagged + + 3 + Training + Data Quality + System: Acreage Outlier +
+
+
+
+ + +
+
+
Filters
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ +
+
Bulk Actions
+
+ + + + +
+
+
+
+ + + +{{ end }} diff --git a/sync/communication.go b/sync/communication.go new file mode 100644 index 00000000..bed9a5d4 --- /dev/null +++ b/sync/communication.go @@ -0,0 +1,14 @@ +package sync + +import ( + "context" + "net/http" + + "github.com/Gleipnir-Technology/nidus-sync/db/models" +) + +type contentCommunicationRoot struct{} + +func getCommunicationRoot(ctx context.Context, r *http.Request, org *models.Organization, user *models.User) (*response[contentCommunicationRoot], *errorWithStatus) { + return newResponse("sync/communication-root.html", contentCommunicationRoot{}), nil +} diff --git a/sync/config.go b/sync/config.go deleted file mode 100644 index dc1e975c..00000000 --- a/sync/config.go +++ /dev/null @@ -1,15 +0,0 @@ -package sync - -import ( - "github.com/Gleipnir-Technology/nidus-sync/config" -) - -type contentConfig struct { - IsProductionEnvironment bool -} - -func newContentConfig() contentConfig { - return contentConfig{ - IsProductionEnvironment: config.IsProductionEnvironment(), - } -} diff --git a/sync/configuration.go b/sync/configuration.go new file mode 100644 index 00000000..1a2ed261 --- /dev/null +++ b/sync/configuration.go @@ -0,0 +1,117 @@ +package sync + +import ( + "context" + "net/http" + + "github.com/Gleipnir-Technology/nidus-sync/arcgis" + "github.com/Gleipnir-Technology/nidus-sync/config" + "github.com/Gleipnir-Technology/nidus-sync/db" + "github.com/Gleipnir-Technology/nidus-sync/db/models" + //"github.com/rs/zerolog/log" +) + +type contentConfig struct { + IsProductionEnvironment bool +} + +func newContentConfig() contentConfig { + return contentConfig{ + IsProductionEnvironment: config.IsProductionEnvironment(), + } +} + +type contentConfigurationRoot struct{} + +func getConfigurationRoot(ctx context.Context, r *http.Request, org *models.Organization, user *models.User) (*response[contentConfigurationRoot], *errorWithStatus) { + return newResponse("sync/configuration/root.html", contentConfigurationRoot{}), nil +} + +type contentSettingOrganization struct { + Organization *models.Organization +} + +type contentSettingIntegration struct { + ArcGISOAuth *models.OauthToken +} + +func getConfigurationOrganization(ctx context.Context, r *http.Request, org *models.Organization, u *models.User) (*response[contentSettingOrganization], *errorWithStatus) { + org, err := u.Organization().One(ctx, db.PGInstance.BobDB) + if err != nil { + return nil, newError("get organization: %w", err) + } + /* + var district contentDistrict + district, err = bob.One[contentDistrict](ctx, db.PGInstance.BobDB, psql.Select( + sm.From("import.district"), + sm.Columns( + "address", + "agency", + "area_4326_sqm", + "city1", + "city2", + "contact", + "fax1", + "general_mg", + "gid", + "phone1", + "phone2", + "postal_c_1", + "website", + psql.F("ST_AsGeoJSON", "centroid_4326"), + psql.F("ST_XMin", "extent_4326"), + psql.F("ST_YMin", "extent_4326"), + psql.F("ST_XMax", "extent_4326"), + psql.F("ST_YMax", "extent_4326"), + ), + sm.Where(psql.Quote("gid").EQ(psql.Arg(gid))), + ), scan.StructMapper[contentDistrict]()) + if err != nil { + respondError(w, "Failed to get extents", err, http.StatusInternalServerError) + return + } + */ + data := contentSettingOrganization{ + Organization: org, + } + return newResponse("sync/configuration/organization.html", data), nil +} +func getConfigurationIntegration(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/configuration/integration.html", data), nil +} +func getConfigurationIntegrationArcgis(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/configuration/integration-arcgis.html", data), nil +} + +type contentSettingPlaceholder struct{} + +func getConfigurationPesticide(ctx context.Context, r *http.Request, org *models.Organization, user *models.User) (*response[contentSettingPlaceholder], *errorWithStatus) { + content := contentSettingPlaceholder{} + return newResponse("sync/configuration/pesticide.html", content), nil +} +func getConfigurationPesticideAdd(ctx context.Context, r *http.Request, org *models.Organization, user *models.User) (*response[contentSettingPlaceholder], *errorWithStatus) { + content := contentSettingPlaceholder{} + return newResponse("sync/configuration/pesticide-add.html", content), nil +} +func getConfigurationUserAdd(ctx context.Context, r *http.Request, org *models.Organization, user *models.User) (*response[contentSettingPlaceholder], *errorWithStatus) { + content := contentSettingPlaceholder{} + return newResponse("sync/configuration/user-add.html", content), nil +} +func getConfigurationUserList(ctx context.Context, r *http.Request, org *models.Organization, user *models.User) (*response[contentSettingPlaceholder], *errorWithStatus) { + content := contentSettingPlaceholder{} + return newResponse("sync/configuration/user-list.html", content), nil +} diff --git a/sync/intelligence.go b/sync/intelligence.go new file mode 100644 index 00000000..b8c1037c --- /dev/null +++ b/sync/intelligence.go @@ -0,0 +1,14 @@ +package sync + +import ( + "context" + "net/http" + + "github.com/Gleipnir-Technology/nidus-sync/db/models" +) + +type contentIntelligenceRoot struct{} + +func getIntelligenceRoot(ctx context.Context, r *http.Request, org *models.Organization, user *models.User) (*response[contentIntelligenceRoot], *errorWithStatus) { + return newResponse("sync/intelligence-root.html", contentIntelligenceRoot{}), nil +} diff --git a/sync/operations.go b/sync/operations.go new file mode 100644 index 00000000..1930a6cb --- /dev/null +++ b/sync/operations.go @@ -0,0 +1,14 @@ +package sync + +import ( + "context" + "net/http" + + "github.com/Gleipnir-Technology/nidus-sync/db/models" +) + +type contentOperationsRoot struct{} + +func getOperationsRoot(ctx context.Context, r *http.Request, org *models.Organization, user *models.User) (*response[contentOperationsRoot], *errorWithStatus) { + return newResponse("sync/operations-root.html", contentOperationsRoot{}), nil +} diff --git a/sync/review.go b/sync/review.go new file mode 100644 index 00000000..996cbeca --- /dev/null +++ b/sync/review.go @@ -0,0 +1,14 @@ +package sync + +import ( + "context" + "net/http" + + "github.com/Gleipnir-Technology/nidus-sync/db/models" +) + +type contentReviewRoot struct{} + +func getReviewRoot(ctx context.Context, r *http.Request, org *models.Organization, user *models.User) (*response[contentReviewRoot], *errorWithStatus) { + return newResponse("sync/review-root.html", contentReviewRoot{}), nil +} diff --git a/sync/routes.go b/sync/routes.go index d38df682..5d40a382 100644 --- a/sync/routes.go +++ b/sync/routes.go @@ -48,25 +48,34 @@ func Router() chi.Router { r.Route("/api", api.AddRoutes) r.Method("GET", "/admin", authenticatedHandler(getAdminDash)) r.Method("GET", "/cell/{cell}", authenticatedHandler(getCellDetails)) + r.Method("GET", "/communication", authenticatedHandler(getCommunicationRoot)) + r.Method("GET", "/configuration", authenticatedHandler(getConfigurationRoot)) + r.Method("GET", "/configuration/upload", authenticatedHandler(getUploadList)) + r.Method("GET", "/configuration/upload/pool", authenticatedHandler(getUploadPoolCreate)) + r.Method("POST", "/configuration/upload/pool", authenticatedHandlerPostMultipart(postUploadPoolCreate)) + r.Method("GET", "/configuration/upload/{id}", authenticatedHandler(getUploadByID)) + r.Method("POST", "/configuration/upload/{id}/discard", authenticatedHandlerPost(postUploadDiscard)) r.Method("GET", "/download", authenticatedHandler(getDownloadList)) + r.Method("GET", "/intelligence", authenticatedHandler(getIntelligenceRoot)) r.Method("GET", "/layout-test", authenticatedHandler(getLayoutTest)) r.Method("GET", "/message", authenticatedHandler(getMessageList)) r.Method("GET", "/notification", authenticatedHandler(getNotificationList)) + r.Method("GET", "/operations", authenticatedHandler(getOperationsRoot)) r.Method("GET", "/planning", authenticatedHandler(getPlanningRoot)) r.Method("GET", "/pool", authenticatedHandler(getPoolList)) r.Method("GET", "/pool/create", authenticatedHandler(getPoolCreate)) r.Method("GET", "/pool/{id}", authenticatedHandler(getPoolByID)) r.Method("GET", "/radar", authenticatedHandler(getRadar)) + r.Method("GET", "/review", authenticatedHandler(getReviewRoot)) 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/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)) - r.Method("GET", "/setting/user/add", authenticatedHandler(getSettingUserAdd)) + r.Method("GET", "/configuration/integration", authenticatedHandler(getConfigurationIntegration)) + r.Method("GET", "/configuration/integration/arcgis", authenticatedHandler(getConfigurationIntegrationArcgis)) + r.Method("GET", "/configuration/organization", authenticatedHandler(getConfigurationOrganization)) + r.Method("GET", "/configuration/pesticide", authenticatedHandler(getConfigurationPesticide)) + r.Method("GET", "/configuration/pesticide/add", authenticatedHandler(getConfigurationPesticideAdd)) + r.Method("GET", "/configuration/user", authenticatedHandler(getConfigurationUserList)) + r.Method("GET", "/configuration/user/add", authenticatedHandler(getConfigurationUserAdd)) r.Method("GET", "/signout", auth.NewEnsureAuth(getSignout)) r.Method("GET", "/source/{globalid}", authenticatedHandler(getSource)) r.Method("GET", "/stadia", authenticatedHandler(getStadia)) @@ -75,11 +84,6 @@ func Router() chi.Router { r.Method("POST", "/sudo/sms", authenticatedHandlerPost(postSudoSMS)) r.Method("GET", "/trap/{globalid}", authenticatedHandler(getTrap)) r.Method("GET", "/text/{destination}", authenticatedHandler(getTextMessages)) - r.Method("GET", "/upload", authenticatedHandler(getUploadList)) - r.Method("GET", "/upload/pool", authenticatedHandler(getUploadPoolCreate)) - r.Method("POST", "/upload/pool", authenticatedHandlerPostMultipart(postUploadPoolCreate)) - r.Method("GET", "/upload/{id}", authenticatedHandler(getUploadByID)) - r.Method("POST", "/upload/{id}/discard", authenticatedHandlerPost(postUploadDiscard)) html.AddStaticRoute(r, "/static") return r diff --git a/sync/setting.go b/sync/setting.go index 5584fb2f..0bf471b0 100644 --- a/sync/setting.go +++ b/sync/setting.go @@ -1,107 +1,3 @@ package sync -import ( - "context" - "net/http" - - "github.com/Gleipnir-Technology/nidus-sync/arcgis" - "github.com/Gleipnir-Technology/nidus-sync/db" - "github.com/Gleipnir-Technology/nidus-sync/db/models" - //"github.com/rs/zerolog/log" -) - -type contentSettingOrganization struct { - Organization *models.Organization -} - -type contentSettingIntegration struct { - ArcGISOAuth *models.OauthToken -} - -type contentAuthenticatedPlaceholder struct { -} - -func getSetting(ctx context.Context, r *http.Request, org *models.Organization, u *models.User) (*response[contentAuthenticatedPlaceholder], *errorWithStatus) { - data := contentAuthenticatedPlaceholder{} - return newResponse("sync/settings.html", data), nil -} -func getSettingOrganization(ctx context.Context, r *http.Request, org *models.Organization, u *models.User) (*response[contentSettingOrganization], *errorWithStatus) { - org, err := u.Organization().One(ctx, db.PGInstance.BobDB) - if err != nil { - return nil, newError("get organization: %w", err) - } - /* - var district contentDistrict - district, err = bob.One[contentDistrict](ctx, db.PGInstance.BobDB, psql.Select( - sm.From("import.district"), - sm.Columns( - "address", - "agency", - "area_4326_sqm", - "city1", - "city2", - "contact", - "fax1", - "general_mg", - "gid", - "phone1", - "phone2", - "postal_c_1", - "website", - psql.F("ST_AsGeoJSON", "centroid_4326"), - psql.F("ST_XMin", "extent_4326"), - psql.F("ST_YMin", "extent_4326"), - psql.F("ST_XMax", "extent_4326"), - psql.F("ST_YMax", "extent_4326"), - ), - sm.Where(psql.Quote("gid").EQ(psql.Arg(gid))), - ), scan.StructMapper[contentDistrict]()) - if err != nil { - respondError(w, "Failed to get extents", err, http.StatusInternalServerError) - return - } - */ - data := contentSettingOrganization{ - Organization: org, - } - return newResponse("sync/setting-organization.html", data), nil -} -func getSettingIntegration(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.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{} - -func getSettingPesticide(ctx context.Context, r *http.Request, org *models.Organization, user *models.User) (*response[contentSettingPlaceholder], *errorWithStatus) { - content := contentSettingPlaceholder{} - return newResponse("sync/setting-pesticide.html", content), nil -} -func getSettingPesticideAdd(ctx context.Context, r *http.Request, org *models.Organization, user *models.User) (*response[contentSettingPlaceholder], *errorWithStatus) { - content := contentSettingPlaceholder{} - return newResponse("sync/setting-pesticide-add.html", content), nil -} -func getSettingUserAdd(ctx context.Context, r *http.Request, org *models.Organization, user *models.User) (*response[contentSettingPlaceholder], *errorWithStatus) { - content := contentSettingPlaceholder{} - return newResponse("sync/setting-user-add.html", content), nil -} -func getSettingUserList(ctx context.Context, r *http.Request, org *models.Organization, user *models.User) (*response[contentSettingPlaceholder], *errorWithStatus) { - content := contentSettingPlaceholder{} - return newResponse("sync/setting-user-list.html", content), nil -} +import () diff --git a/sync/url.go b/sync/url.go index e3641d61..c2f49a51 100644 --- a/sync/url.go +++ b/sync/url.go @@ -5,6 +5,7 @@ import ( ) type contentURL struct { + Configuration contentURLConfiguration OAuthRefreshArcGIS string Root string Route string @@ -17,6 +18,7 @@ type contentURL struct { func newContentURL() contentURL { return contentURL{ + Configuration: newContentURLConfiguration(), OAuthRefreshArcGIS: config.MakeURLNidus("/arcgis/oauth/begin"), Root: config.MakeURLNidus("/"), Route: config.MakeURLNidus("/route"), @@ -28,6 +30,16 @@ func newContentURL() contentURL { } } +type contentURLConfiguration struct { + Upload string +} + +func newContentURLConfiguration() contentURLConfiguration { + return contentURLConfiguration{ + Upload: config.MakeURLNidus("/configuration/upload"), + } +} + type contentURLSidebar struct { Communication string Configuration string