Skip to content

ContentVersion zip download should use the title, not the pathOnClien…#1267

Merged
paustint merged 1 commit into
mainfrom
feature/1266
May 29, 2025
Merged

ContentVersion zip download should use the title, not the pathOnClien…#1267
paustint merged 1 commit into
mainfrom
feature/1266

Conversation

@paustint

Copy link
Copy Markdown
Contributor

…t #1266

Use Title if available in query for ContentVersion zip downloads

resolves #1266

…#1266

Use Title if available in query for ContentVersion zip downloads

resolves #1266
@paustint paustint requested a review from Copilot May 28, 2025 14:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@paustint paustint requested a review from Copilot May 29, 2025 01:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 || ''}`;

@paustint paustint merged commit 9932f5e into main May 29, 2025
8 checks passed
@paustint paustint deleted the feature/1266 branch May 29, 2025 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ContentVersion zip download should use the title, not the pathOnClient

2 participants