-
Notifications
You must be signed in to change notification settings - Fork 661
Chat FU: Hide download button of File when onDownload is not passed #31538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chat FU: Hide download button of File when onDownload is not passed #31538
Conversation
28e5670 to
7a84cf9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request implements conditional rendering of the attachment download button in the Chat component. The download button is now only shown when the onAttachmentDownload callback is provided, preventing users from attempting to download attachments without a proper handler.
Key changes:
- Introduces
showAttachmentDownloadButtonoption that propagates from Chat through MessageList, MessageGroup, MessageBubble, FileView to File components - The option is automatically set based on whether
onAttachmentDownloadcallback is provided - Updates tests to explicitly set
showDownloadButton: truewhere download functionality is being tested
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/devextreme/js/__internal/ui/chat/chat.ts | Derives showAttachmentDownloadButton from onAttachmentDownload presence and propagates it to MessageList |
| packages/devextreme/js/__internal/ui/chat/messagelist.ts | Adds showAttachmentDownloadButton property and passes it to MessageGroup components |
| packages/devextreme/js/__internal/ui/chat/messagegroup.ts | Adds showAttachmentDownloadButton property and passes it to MessageBubble components |
| packages/devextreme/js/__internal/ui/chat/messagebubble.ts | Adds showAttachmentDownloadButton property, stores FileView reference, and handles runtime option changes |
| packages/devextreme/js/__internal/ui/chat/file_view/file_view.ts | Adds showDownloadButton property and passes it to File components |
| packages/devextreme/js/__internal/ui/chat/file_view/file.ts | Implements conditional button rendering based on showDownloadButton option |
| packages/devextreme/testing/tests/DevExpress.ui.widgets/chatParts/messageBubble.tests.js | Updates tests to set showAttachmentDownloadButton: true |
| packages/devextreme/testing/tests/DevExpress.ui.widgets/chatParts/fileView.tests.js | Updates tests to set showDownloadButton: true |
| packages/devextreme/testing/tests/DevExpress.ui.widgets/chatParts/file.tests.js | Updates test setup and adds guards for button access |
| packages/devextreme/testing/tests/DevExpress.ui.widgets/chatParts/file.markup.tests.js | Adds tests for showDownloadButton option behavior |
| packages/devextreme/testing/tests/DevExpress.ui.widgets/chatParts/chat.tests.js | Adds test for button hiding when callback is undefined |
7a84cf9 to
69e896d
Compare
dd2ddae to
a2aad1b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
No description provided.