Repository navigation
Add google maps and street view preview during submission review - #46
Open
tayloraj10 wants to merge 7 commits into
Open
tayloraj10 wants to merge 7 commits into
tayloraj10 wants to merge 7 commits into
Conversation
Convert the "Save changes" button on the review detail page from a bare onClick handler to a <fetcher.Form onSubmit>, matching the approve/reject actions that already use <Form>. The payload is a nested object rather than flat fields, so it's still sent as JSON via fetcher.submit, but routing it through a real form gives us proper submit semantics (Enter-to-submit, pending state, progressive enhancement) instead of a plain button click. Also swap the deprecated FormEvent type for SubmitEvent, and convert logout to a POST action (was a GET loader) triggered via a <Form> in the sidebar, since a GET route shouldn't perform a mutation like signing out.
- Introduced new API methods for fetching edit counts and change logs, enhancing the resource edit management capabilities. - Updated the dashboard to utilize these new methods, allowing for a comprehensive view of pending edits and historical changes. - Modified the reviews detail page to display the change log for individual resources, improving audit trail visibility. - Enhanced the reviews index page to show pending edit counts for resources, aiding in resource management and review prioritization.
- Introduced separate types for edit and new row data, improving type safety and clarity. - Updated table columns to include a submitted date for both edits and new resources, enhancing the review process. - Refactored the ReviewQueueTable component to handle sorting and rendering more efficiently. - Improved the overall layout by incorporating a Stack component for better spacing and organization.
- Introduced ResourceLocationPanel and ResourceStreetView components to render a map and street view for resource locations on the review detail page. - Updated .env configuration to include VITE_GOOGLE_MAPS_API_KEY for client-side access. - Added dependencies for Google Maps API and types in package.json. - Enhanced the build process to include the new environment variable. - Updated the reviews detail page to incorporate the new components, improving the user experience for reviewers.
- Updated imports for MUI icons in ThemeToggle, authenticated layout, dashboard, reviews detail, login, reset-password, and chipColors files to use default imports instead of named imports, enhancing code readability and consistency.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add map + Street View preview to review detail, fix dev server EMFILE crash
Problem
Reviewers approving/rejecting resource edits had no way to visually confirm a submission's location without leaving the dashboard. Separately,
pnpm run devwas crashing on Windows withEMFILE: too many open files— several files imported icons via the@mui/icons-materialbarrel export, forcing Vite to resolve/watch the entire package (thousands of files) instead of just the icons in use.Solution
ResourceLocationPanelandResourceStreetViewcomponents, rendering a Google Map (with a pin at the proposed lat/lng) and a Street View panel side-by-side on the/reviews/:iddetail page, so reviewers can visually confirm a location before approving.gpId) when available, falling back to the stored lat/lng.VITE_GOOGLE_MAPS_API_KEY(client-exposed, reused from thephlask-maprepo, HTTP-referrer restricted in GCP Console) to.example.envand wired it into the Amplify build (amplify.yml).nullif the resource has no valid coordinates.@mui/icons-materialbarrel imports to per-icon imports (e.g.import ArrowBack from "@mui/icons-material/ArrowBack") acrossThemeToggle.tsx,_layout.tsx,dashboard.tsx,reviews/detail.tsx,login.tsx,reset-password.tsx, andchipColors.tsx.biome check --writeto normalize CRLF line endings on the two new components to match repo formatting.Reference
Closes #36
Screenshots
Checklist