From bf244c80ebf3096ef0f27354bfbf3bda04ce24bb Mon Sep 17 00:00:00 2001 From: ihor-palii Date: Tue, 24 Oct 2023 17:19:54 +0300 Subject: [PATCH] Added changes to support widget config update --- templates/channels/channel_update.haml | 11 ++++++++++- templates/channels/types/webchat/config.haml | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/templates/channels/channel_update.haml b/templates/channels/channel_update.haml index df858cdabe0..e64b256a092 100644 --- a/templates/channels/channel_update.haml +++ b/templates/channels/channel_update.haml @@ -366,6 +366,10 @@ } var storeHistory = $("#id_store_history").val() === 1; + var allowAttachments = $("#id_allow_attachments").val() === 1; + var enableLanguageSelector = $("#id_allow_multi_language").val() === 1; + var enableTextButton = $("#id_fab_text_toggle").val() === 1; + var fabText = $("#id_fab_text").val(); welcomeMessageQuickReplies = (welcomeMessageQuickReplies !== "" && welcomeMessageQuickReplies !== undefined) ? welcomeMessageQuickReplies.split(",") : []; @@ -374,6 +378,8 @@ channelUUID: '{{ object.uuid }}', title: title, autoOpen: true, + allowAttachments: allowAttachments, + enableLanguageSelector: enableLanguageSelector, hostApi: 'https://{{ hostname }}', icon: icon, welcomeMessage: welcomeMessage, @@ -382,6 +388,7 @@ inputTextPlaceholderI18n: inputTextDict, welcomeMessageQuickReplies: welcomeMessageQuickReplies, storeHistory: storeHistory, + fabText: enableTextButton ? fabText : undefined, theme: { widgetBackgroundColor: widgetBackgroundColor, chatHeaderBackgroundColor: chatHeaderBackgroundColor, @@ -397,7 +404,9 @@ sideOfScreen: sideOfScreen, googleFont: googleFont, width: width, - height: height + height: height, + fabTextColor: chatHeaderTextColor, + fabBackgroundColor: chatHeaderBackgroundColor }, meta: { icon: { diff --git a/templates/channels/types/webchat/config.haml b/templates/channels/types/webchat/config.haml index a87ea747fc9..982b7a1d614 100644 --- a/templates/channels/types/webchat/config.haml +++ b/templates/channels/types/webchat/config.haml @@ -43,6 +43,8 @@ googleFont: '{{ channel.config.google_font }}', width: '{{channel.config.width}}px', height: '{{channel.config.height}}px', + fabTextColor: '{{ "#"|add:channel.config.chat_header_text_color }}', + fabBackgroundColor: '{{ "#"|add:channel.config.chat_header_bg_color }}', }, meta: { icon: {