Use Supabase views for review queues and split reviews page into new vs. existing edits - #45
Open
tayloraj10 wants to merge 4 commits into
Open
Use Supabase views for review queues and split reviews page into new vs. existing edits#45tayloraj10 wants to merge 4 commits into
tayloraj10 wants to merge 4 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.
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.
Use Supabase views for review queues and split reviews page into new vs. existing edits
Problem
The reviews and dashboard pages were pulling data by scanning the full
resource_editstable directly, rather than using the purpose-builtresource_edit_countsandresource_change_logviews. The reviews index page also lumped new site submissions and edits to existing resources into a single table, making it harder to review either group on its own.Solution
resource_edit_countsandresource_change_logviews via newgetEditCounts,getChangeLog, andgetChangeLogForResourceAPI methods, instead of scanningresource_editsdirectly.Reference
Closes #43. Partially addresses #35 (splits new-resource vs. existing-edit review queues; the duplicate-detection confidence rating from #35 is not part of this PR).
Screenshots
Checklist