chatwoot/app/javascript/widget/components
Muhsin Keloth 116ed54c7e
fix: Prioritize SDK enableFileUpload flag when explicitly set (#13091)
### Problem
Currently, the attachment button visibility in the widget uses both the
SDK's `enableFileUpload` flag AND the inbox's attachment settings with
an AND condition. This creates an issue for users who want to control
attachments solely through inbox settings, since the SDK flag defaults
to `true` even when not explicitly provided.

  **Before:**
- SDK not set → `enableFileUpload: true` (default) + inbox setting =
attachment shown only if both true
- SDK set to false → `enableFileUpload: false` + inbox setting =
attachment always hidden
- SDK set to true → `enableFileUpload: true` + inbox setting =
attachment shown only if both true
  
This meant users couldn't rely solely on inbox settings when the SDK
flag wasn't explicitly provided.

  ### Solution

Changed the logic to prioritize explicit SDK configuration when
provided, and fall back to inbox settings when not provided:

  **After:**
  - SDK not set → `enableFileUpload: undefined` → use inbox setting only
- SDK set to false → `enableFileUpload: false` → hide attachment (SDK
controls)
- SDK set to true → `enableFileUpload: true` → show attachment (SDK
controls)

---------

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
2025-12-17 19:03:54 +05:30
..
Availability fix: Widget shows 'away' on initial load despite agents being online (#12869) 2025-11-20 20:27:44 +05:30
Form feat: Add RTL Support to Widget (#11022) 2025-03-21 09:39:03 -07:00
layouts feat: Support customizable welcome text, availability messages, and UI toggles (#11891) 2025-07-08 14:26:00 -07:00
pageComponents/Home/Article fix: TypeError: Cannot read properties of null (reading 'config') (#12356) 2025-09-03 17:07:34 +05:30
PreChat feat: Migrate availability mixins to composable and helper (#11596) 2025-08-22 00:43:34 +05:30
template chore: Remove older UI (#11720) 2025-07-01 09:43:44 +05:30
AgentMessage.vue chore: Replace Thumbnail with Avatar (#12119) 2025-08-11 15:47:17 +05:30
AgentMessageBubble.vue feat: Improve CSAT responses (#11485) 2025-05-16 14:18:52 +05:30
AgentTypingBubble.vue feat: Add RTL Support to Widget (#11022) 2025-03-21 09:39:03 -07:00
Banner.vue feat: Add RTL Support to Widget (#11022) 2025-03-21 09:39:03 -07:00
ChatAttachment.vue fix: Prioritize SDK enableFileUpload flag when explicitly set (#13091) 2025-12-17 19:03:54 +05:30
ChatFooter.vue feat: Migrate availability mixins to composable and helper (#11596) 2025-08-22 00:43:34 +05:30
ChatHeader.vue feat: Migrate availability mixins to composable and helper (#11596) 2025-08-22 00:43:34 +05:30
ChatHeaderExpanded.vue feat: Support customizable welcome text, availability messages, and UI toggles (#11891) 2025-07-08 14:26:00 -07:00
ChatInputWrap.vue fix: Prioritize SDK enableFileUpload flag when explicitly set (#13091) 2025-12-17 19:03:54 +05:30
ChatMessage.vue feat: Add RTL Support to Widget (#11022) 2025-03-21 09:39:03 -07:00
ChatSendButton.vue feat: Add RTL Support to Widget (#11022) 2025-03-21 09:39:03 -07:00
ConversationWrap.vue feat: Add RTL Support to Widget (#11022) 2025-03-21 09:39:03 -07:00
DragWrapper.vue style: apply fixes for eslint issues [cw-3590] (#10210) 2024-10-03 15:02:12 +05:30
FileBubble.vue feat: Add RTL Support to Widget (#11022) 2025-03-21 09:39:03 -07:00
FooterReplyTo.vue chore: Remove older UI (#11720) 2025-07-01 09:43:44 +05:30
GroupedAvatars.vue chore: Replace Thumbnail with Avatar (#12119) 2025-08-11 15:47:17 +05:30
HeaderActions.vue feat: Support customizable welcome text, availability messages, and UI toggles (#11891) 2025-07-08 14:26:00 -07:00
ImageBubble.vue feat: Add RTL Support to Widget (#11022) 2025-03-21 09:39:03 -07:00
MessageReplyButton.vue chore: Remove older UI (#11720) 2025-07-01 09:43:44 +05:30
ReplyToChip.vue chore: Remove older UI (#11720) 2025-07-01 09:43:44 +05:30
TeamAvailability.vue feat: Migrate availability mixins to composable and helper (#11596) 2025-08-22 00:43:34 +05:30
UnreadMessage.vue chore: Replace Thumbnail with Avatar (#12119) 2025-08-11 15:47:17 +05:30
UnreadMessageList.vue chore: Remove older UI (#11720) 2025-07-01 09:43:44 +05:30
UserMessage.vue feat: Add RTL Support to Widget (#11022) 2025-03-21 09:39:03 -07:00
UserMessageBubble.vue feat: Add RTL Support to Widget (#11022) 2025-03-21 09:39:03 -07:00
VideoBubble.vue feat: Eslint rules (#9839) 2024-08-05 14:02:16 +05:30