ContentVersion zip download should use the title, not the pathOnClien…#1267
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR updates the ContentVersion zip download functionality to use the Title for naming files when available instead of relying solely on PathOnClient. Key changes include:
- Adding the splitFilenameByExtension utility function in utils.ts.
- Updating the FILE_DOWNLOAD_FIELD_MAP and file naming logic in QueryResultsAttachmentDownload.tsx to incorporate title and extension fields.
- Adjusting query field validations in QueryResults.tsx to ensure necessary fields are included.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| libs/shared/utils/src/lib/utils.ts | Added a utility for splitting filenames by their extensions. |
| libs/shared/utils/src/lib/regex.ts | Introduced FILE_EXTENSION regex to support the new utility function. |
| libs/features/query/src/QueryResults/QueryResultsAttachmentDownload.tsx | Updated the file download mapping and logic to prefer Title and manage file naming with extensions. |
| libs/features/query/src/QueryResults/QueryResults.tsx | Modified query field validation to account for Title and extension fields in file downloads. |
Comments suppressed due to low confidence (1)
libs/features/query/src/QueryResults/QueryResultsAttachmentDownload.tsx:71
- REGEX.SAFE_FILENAME is referenced here but is not defined in the REGEX object. Please define it in regex.ts (or update the code to use the correct regex) to avoid runtime errors.
recordName = `${fileName.replaceAll(REGEX.SAFE_FILENAME, '-')}${extension || ''}`;
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.
…t #1266
Use Title if available in query for ContentVersion zip downloads
resolves #1266