Add workspace rules PDF document upload, view, and management UI#87684
Draft
ishpaul777 wants to merge 2 commits intoExpensify:mainfrom
Draft
Add workspace rules PDF document upload, view, and management UI#87684ishpaul777 wants to merge 2 commits intoExpensify:mainfrom
ishpaul777 wants to merge 2 commits intoExpensify:mainfrom
Conversation
Allow workspace admins to upload, replace, and remove a PDF document on the workspace overview page. Non-admins can view and download it. PDFs are stored in a private S3 bucket and served through an authenticated streaming endpoint.
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
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
Adds frontend support for workspace admins to upload, replace, view, and delete a PDF document on the workspace overview page. Non-admins can view/download the document.
Changes
AttachmentPickerfor upload,PDFThumbnailfor preview, three-dots menu for replace/delete, and tap-to-view viaAttachmentModalScreenupdateWorkspaceRulesDocument,deleteWorkspaceRulesDocumentactions with optimistic/failure/finally Onyx updates. Usesfile.uri(local blob) for optimistic display (same pattern as workspace avatar)getPolicyDocumentSourceURLutility that constructs the authenticated streaming URL with cache-busting parameter, or returns local blob URIs directlyWorkspaceAvatarModalContent) for viewing the PDF in the attachment modalWORKSPACE_DOCUMENTroute and screen following theWORKSPACE_AVATARpatternpolicyDocumentURLtoPolicy.tstype, new API parameter typesKey decisions:
file.uri(local blob URL) for instant display — same proven pattern as workspace avatar uploads&cacheBuster=parameter encoding the fullpolicyDocumentURL— ensures the streaming URL is unique per PDF version, preventing stale browser cacheWORKSPACE_DOCUMENTroute instead of reusingREPORT_ATTACHMENTS— workspace documents are not report attachmentsapi.phpstreaming endpoint (not direct CDN) — required for CORS compatibility with pdfjs and for privacy (private S3 bucket)Fixed Issues
$ https://github.com/Expensify/Expensify/issues/610806
Tests
Manual tests: