Skip to content

ERA-12933: Add Community Input#1516

Open
jeslefcourt wants to merge 11 commits intodevelopfrom
ERA-12933
Open

ERA-12933: Add Community Input#1516
jeslefcourt wants to merge 11 commits intodevelopfrom
ERA-12933

Conversation

@jeslefcourt
Copy link
Copy Markdown
Contributor

@jeslefcourt jeslefcourt commented Mar 30, 2026

Summary

  • Adds a new CommunityPage component for Community Input functionality
  • Updates ReportManager with location picker improvements and detail view refactoring
  • Extends event schemas/types duck and event utilities to support community input

Test plan

  • Verify Community Input page renders correctly via computer and mobile devices.
  • Test mobile usability for all input types.
  • Confirm location picker works as expected in report forms
  • Smoke test report creation, viewing and editing flows throughout typical web event entry processes

- Created a new SCSS file for CommunityPage styles.
- Updated ActivitySection to conditionally render section header based on isCommunity prop.
- Modified ErrorMessages component to improve error message display.
- Enhanced GetUserLocationButton to handle errors via onError callback.
- Integrated location error handling in LocationPicker and MenuPopover components.
- Updated DetailsSection to conditionally hide reported by and priority fields based on props.
- Adjusted ReportDetailView to handle community-specific logic and save actions.
- Refactored event schema fetching to support additional parameters.
- Improved event creation and updating actions to accept extra parameters.
- Updated i18n version for localization files.
- Fixed minor issues in map utility functions and save action generation.
@jeslefcourt jeslefcourt self-assigned this Mar 30, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 30, 2026

🚀 PR Environment Deployed

App Sync Health Image
pr-web-era-12933 ✅ Synced ✅ Healthy 6d84778604556570702b41ce9cdc65a1de02cee9

Access: https://era-12933.dev.pamdas.org

View in ArgoCD

@jeslefcourt jeslefcourt changed the title feat: Add Community Input ERA-12933: Add Community Input Mar 31, 2026
jeslefcourt and others added 3 commits March 30, 2026 17:52
Community event types, schemas, and activity (events, notes, files) now
use path-based community URLs instead of passing community_input as a
query parameter.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new unauthenticated “Community Input” entry flow and refactors report creation/detail flows to support community-specific schema fetching and save parameters, while also introducing a new “review” event state across list/detail/context-menu UX.

Changes:

  • Introduces CommunityPage routed at /community/:value/* with type selection, search, and submission flow.
  • Extends schema fetching + save actions to accept extra params/axios config (e.g., community_input, skipAuth) and updates ReportManager/DetailView to support community mode.
  • Adds “review” state support throughout UI and translations; improves LocationPicker error UX for geolocation failures.

Reviewed changes

Copilot reviewed 62 out of 63 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/utils/save.js Passes extraParams through report/patrol save action creators.
src/utils/map.js Adjusts buildGeoSpanFilter bbox output shape (lon handling change).
src/utils/events.js Extends REPORT_SAVE_ACTIONS to accept extraParams.
src/RequestConfigManager/index.js Avoids 401 auth reset/redirect when skipAuth is set.
src/ReportManager/ReportDetailView/styles.module.scss Minor layout tweaks + dropdown item button sizing.
src/ReportManager/ReportDetailView/index.test.js Updates schema fetch expectations for new params/config args.
src/ReportManager/ReportDetailView/index.js Adds community-mode behaviors, schema fetch params/config, and review-state save options.
src/ReportManager/index.test.js Updates schema URL helper usage for tests.
src/ReportManager/index.js Adds community/report customization props; supports external reportId/newReportTypeId.
src/ReportManager/Header/index.js Hides report menu in community mode.
src/ReportManager/DetailsSection/styles.module.scss Adjusts layout + adds review styling hook.
src/ReportManager/DetailsSection/SchemaForm/utils/getFormDataWithFixedTimezones/index.test.js Aligns TIME parsing expectation with “today” date handling.
src/ReportManager/DetailsSection/index.test.js Updates expected state dropdown items to include “review”.
src/ReportManager/DetailsSection/index.js Supports hidePriority/hideReportedBy/community mode; schema rendering condition tweaks.
src/ReportListItem/index.js Displays “resolved” or “review” state badge with dynamic i18n key.
src/ReportFormSummary/index.test.js Updates schema URL helper usage for tests.
src/LocationPicker/styles.module.scss Adds styling for inline location access error message.
src/LocationPicker/MenuPopover/index.js Adds MapContext gating for “Set on map” + wires geolocation error callback.
src/LocationPicker/index.js Displays geolocation access error inline; clears error on change.
src/index.js Adds lazy-loaded CommunityPage route.
src/i18n.js Bumps i18n file version.
src/GetUserLocationButton/index.js Adds onError override to handle geolocation failures without toast.
src/EventItemContextMenu/index.test.js Updates expected warning text copy.
src/EventItemContextMenu/index.js Adds “review” transition option and refactors state update handling.
src/ErrorMessages/index.js Avoids rendering : undefined when error message is missing; simplifies Accordion.Header.
src/EditableItem/styles.module.scss Ensures dropdown item buttons fill available width.
src/EditableItem/Header.js Shows “resolved”/“review” label via dynamic i18n key.
src/EditableItem/Footer.js Adds review/activate transitions in split save button for details-view footer.
src/ducks/events.js Allows extra request params for create/update/note/file actions.
src/ducks/event-types/index.test.js Adds tests asserting version-filtered fetching behavior.
src/ducks/event-types/index.js Adds params/config support and merges v1/v2 event types by value.
src/ducks/event-schemas/sanitizeSchemas.js Hardens enum handling for unresolved template strings/non-array enums.
src/ducks/event-schemas/index.test.js Updates schema URL helper usage for tests.
src/ducks/event-schemas/index.js Adds v1 URL helper, supports extra params/config, and handles alternate v2 schema shapes.
src/DetailViewComponents/ActivitySection/index.test.js Updates schema URL helper usage for tests.
src/DetailViewComponents/ActivitySection/index.js Hides section header in community mode.
src/DetailViewComponents/ActivitySection/ContainedReportListItem/index.test.js Updates schema URL helper usage for tests.
src/constants/index.js Adds “review” to state choices and EVENT_FORM_STATES.
src/CommunityPage/styles.module.scss Adds styling for the new community flow page.
src/CommunityPage/index.test.js Adds comprehensive tests for community flow, fetch params, navigation, and submission UX.
src/CommunityPage/index.js Implements community type selection/search + community-scoped schema/type fetching.
public/locales/sw/reports.json Adds/updates strings for review state and updated warning copy.
public/locales/sw/filters.json Adds “review” filter label.
public/locales/sw/details-view.json Adds review/activate footer strings + review header label.
public/locales/pt/reports.json Adds/updates strings for review state and updated warning copy (also reformat).
public/locales/pt/filters.json Adds “review” filter label (also reformat).
public/locales/pt/details-view.json Adds review/activate footer strings + review header label (also reformat).
public/locales/ne-NP/reports.json Adds/updates strings for review state and updated warning copy (also reformat).
public/locales/ne-NP/filters.json Adds “review” filter label (also reformat).
public/locales/ne-NP/details-view.json Adds review/activate footer strings + review header label (also reformat).
public/locales/fr/reports.json Adds/updates strings for review state and updated warning copy.
public/locales/fr/filters.json Adds “review” filter label.
public/locales/fr/details-view.json Adds review/activate footer strings + review header label.
public/locales/es/reports.json Adds/updates strings for review state and updated warning copy.
public/locales/es/filters.json Adds “review” filter label.
public/locales/es/details-view.json Adds review/activate footer strings + review header label.
public/locales/en-US/reports.json Adds/updates strings for review state and updated warning copy.
public/locales/en-US/filters.json Adds “review” filter label.
public/locales/en-US/details-view.json Adds review/activate footer strings + review header label.
public/locales/en-US/components.json Adds community page strings + geolocation access error text.
mock-api/api/v1.0/index.js Adds mock route wiring for /activity/eventtypes.
mock-api/api/v1.0/activity/eventtypes/index.js Adds mock endpoint for /:eventTypeValue/schema.
.gitignore Ignores .idea directory.
Comments suppressed due to low confidence (1)

src/ReportManager/ReportDetailView/index.js:393

  • onSaveReport closes over saveExtraParams (passed into generateSaveActionsForReportLikeObject(...)), but saveExtraParams is missing from this useCallback dependency array. If saveExtraParams changes (e.g. when navigating between communities or when caller updates extra params), saves may continue using stale params.

Add saveExtraParams to the dependency list (or otherwise ensure it’s stable and intentionally excluded).

Comment thread src/ducks/event-types/index.js
Comment thread src/EventItemContextMenu/index.js
Comment thread src/EventItemContextMenu/index.js
Comment thread src/ReportListItem/index.js
@jeslefcourt jeslefcourt requested a review from JoshuaVulcan April 2, 2026 00:55
@jeslefcourt
Copy link
Copy Markdown
Contributor Author

@JoshuaVulcan We also need to prevent the heavy libraries (mapbox, turf) from loading. The download size for this simple form is kinda ridiculous right now. I had Claude do that, but I didn't like its solution. Wanted to ask you what your preferred method is for this.

I also plan to update this to grab individual event type icons instead of the 15 MB icon sprite.

…ity paths don't import it.

Break out loading of event type icons to individual svgs instead of huge sprite.
@jeslefcourt
Copy link
Copy Markdown
Contributor Author

@JoshuaVulcan Went ahead and made the change to avoid mapbox from being loaded, since that was also loading the sprite. There's still an unnecessary 3 MB load of Turf, but fixing that touches a ton of code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants