Skip to content

Conversation

chriscollins3456
Copy link
Collaborator

This PR builds a new extension that allows us to drag and drop files into our rich text Editor component and upload them to S3, completing the desired flow of requesting a presigned URL, uploading to S3, then rendering a classic markdown link/image with a reference to our own file service REST API (what this PR is built on top of).

Right now this is only enabled on the new summary tab, but we have another PR coming out where we can support this for all entity documentation and extend support elsewhere as well.

Screen.Recording.2025-10-14.at.12.49.30.PM.mov

@github-actions github-actions bot added the product PR or Issue related to the DataHub UI/UX label Oct 14, 2025
@datahub-cyborg datahub-cyborg bot added the needs-review Label for PRs that need review from a maintainer. label Oct 14, 2025
Copy link

alwaysmeticulous bot commented Oct 14, 2025

🔴 Meticulous spotted visual differences in 18 of 1093 screens tested: view and approve differences detected.

Meticulous evaluated ~9 hours of user flows against your PR.

Last updated for commit 2feca70. This comment will update as new commits are pushed.

Copy link

codecov bot commented Oct 14, 2025

Bundle Report

Changes will increase total bundle size by 8.11kB (0.03%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
datahub-react-web-esm 28.58MB 8.11kB (0.03%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: datahub-react-web-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/index-*.js 8.11kB 18.92MB 0.04%

Files in assets/index-*.js:

  • ./src/alchemy-components/components/Editor/extensions/fileDragDrop/fileUtils.ts → Total Size: 3.42kB

  • ./src/alchemy-components/components/Editor/extensions/fileDragDrop/FileNodeView.tsx → Total Size: 1.66kB

  • ./src/alchemy-components/components/Editor/extensions/fileDragDrop/FileDragDropExtension.tsx → Total Size: 7.25kB

  • ./src/app/entityV2/summary/documentation/EditDescriptionModal.tsx → Total Size: 1.7kB

  • ./src/app/shared/Loading.tsx → Total Size: 852 bytes

  • ./src/alchemy-components/components/Editor/Editor.tsx → Total Size: 2.85kB

  • ./src/app/shared/hooks/useFileUpload.ts → Total Size: 1.13kB

  • ./src/alchemy-components/components/Editor/extensions/htmlToMarkdown.tsx → Total Size: 4.57kB

  • ./src/alchemy-components/components/Editor/extensions/markdownToHtml.tsx → Total Size: 592 bytes

Copy link

codecov bot commented Oct 14, 2025

Codecov Report

❌ Patch coverage is 98.35165% with 3 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...components/Editor/extensions/fileDragDrop/index.ts 0.00% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

removeEditingParam();
};

const { uploadFile } = useFileUpload({ scenario: UploadDownloadScenario.AssetDocumentation, assetUrn });
Copy link
Contributor

Choose a reason for hiding this comment

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

Somewhere we have to add checking of our feature flag to enable/disable uploading

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added this to useFileUpload

url.includes('amazonaws.com') || // Other AWS storage
url.includes('storage.googleapis.com') || // Google Cloud Storage
url.includes('blob.core.windows.net') || // Azure Blob Storage
url.match(/\.(pdf|doc|docx|xls|xlsx|ppt|pptx|txt|jpg|jpeg|png|gif|webp|mp4|mp3|zip|rar)$/i) !== null // File extensions
Copy link
Contributor

Choose a reason for hiding this comment

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

can we generate the pattern from EXTENSION_TO_FILE_TYPE to keep them in sync?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes good call, let me try and do that

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

actually i opted to simplify this function since we only really need the check for our own urls which begin with openapi/v1/files

@chriscollins3456 chriscollins3456 changed the base branch from cc--ch-823-download-rest-endpoint to master October 18, 2025 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-review Label for PRs that need review from a maintainer. product PR or Issue related to the DataHub UI/UX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants