Allow viewing and uploading access source CSVs#1164
Open
gearnode wants to merge 3 commits into
Open
Conversation
The CSV access source flow accepted only pasted text, and once a source was created its CSV content was not viewable in the console. Customers asked to upload CSV files directly and to inspect what was stored. Replace the textarea on the create page with a Dropzone that reads the file in the browser and submits its content through the existing csvData mutation argument, so the GraphQL contract is unchanged. Add a "View CSV" action on each CSV access source row that opens a dialog lazy-loading csvData and rendering it in a read-only textarea. Signed-off-by: Bryan Frimin <bryan@getprobo.com>
Contributor
There was a problem hiding this comment.
1 issue found across 3 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/console/src/pages/organizations/access-reviews/CreateCsvAccessSourcePage.tsx">
<violation number="1" location="apps/console/src/pages/organizations/access-reviews/CreateCsvAccessSourcePage.tsx:242">
P2: Disable the Remove button while the file is still being read to avoid stale async updates repopulating csvContent after a user clears the file.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Drop the unused id field from the lazy-loaded query and wrap the multiline JSX fallback passed to Suspense in parentheses to satisfy @stylistic/jsx-wrap-multilines. Signed-off-by: Bryan Frimin <bryan@getprobo.com>
If a user clicked Remove between dropping a file and its async text() resolving, the late resolution would call setCsvContent and repopulate the just-cleared form state. Disable the button while the read is in flight so the click can't fire during that window. Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Bryan FRIMIN <bryan@frimin.fr>
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.
Summary
Customer feedback (in French) on the Access Review feature was: "Pouvoir voir les CSV uploadés (écrits) serait top; QUID d'upload des CSV directement" — i.e. (1) be able to view CSVs that were submitted, and (2) upload CSV files directly instead of pasting them. This PR addresses both.
AccessReviewSourcesTab. The action opens a read-only dialog that lazy-loadsAccessSource.csvData(already exposed by the backend) only when clicked, so the table page payload is unchanged. The CSV is shown in aTextareawithreadOnly,font-mono,whitespace-pre. The action is gated on the source not having a connector (i.e. CSV-only).CreateCsvAccessSourcePagewith aDropzone(drag-and-drop + click-to-browse), restricted to.csv(text/csv/application/csv) at 10MB max. The picked file is read in the browser viafile.text()and submitted through the existingcsvDatastring argument ofcreateAccessSource, so the GraphQL schema, mutation, and worker pipeline are all unchanged.Namefrom the file name (without extension) when the user hasn't typed one, shows a small file summary (KB and parsed row count), and exposes a Remove button to re-pick a file before submitting.No backend changes —
csvDatais already a queryable field onAccessSourceand the create/update mutations already accept it as a string. The existinge2e/console/access_review_test.goalready exercises both paths via the GraphQL contract this PR reuses.Test plan
.xlsx): verify the Dropzone shows the not supported error..csv: verify the inline empty file error and that the submit button stays disabled.csvDataonce, and renders it in the read-only textarea. Re-open: verify the cached payload is reused (no extra network call).core:access-source:createcannot reach the create page; a viewer withoutcore:access-source:deletestill sees View CSV on CSV sources but no Delete.make relayandnpm run check --workspace=@probo/consoleare clean.Summary by cubic
Adds CSV upload to the create flow and a read-only View CSV dialog, so users can upload files instead of pasting and inspect stored data. Reuses the existing
csvDatafield and lazy-loads content to keep the table fast.New Features
Dropzonefrom@probo/ui; accepts.csvup to 10MB, reads in-browser, and submits via existingcsvData; auto-suggests name from filename; shows size/row count; includes Remove.csvDataon open and displays it read-only; hidden for connector-backed sources.Bug Fixes
ViewCsvAccessSourceDialoglints (removed unused field, wrapped Suspense fallback).Written for commit 2a77097. Summary will update on new commits.