Skip to content

Commit

Permalink
Merge pull request #392 from communityconnectlabs/feature/combined-ui
Browse files Browse the repository at this point in the history
Added changes to support widget config update
  • Loading branch information
teehamaral authored Oct 24, 2023
2 parents a24d480 + bf244c8 commit 50efbf1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 10 additions & 1 deletion templates/channels/channel_update.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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(",") : [];

Expand All @@ -374,6 +378,8 @@
channelUUID: '{{ object.uuid }}',
title: title,
autoOpen: true,
allowAttachments: allowAttachments,
enableLanguageSelector: enableLanguageSelector,
hostApi: 'https://{{ hostname }}',
icon: icon,
welcomeMessage: welcomeMessage,
Expand All @@ -382,6 +388,7 @@
inputTextPlaceholderI18n: inputTextDict,
welcomeMessageQuickReplies: welcomeMessageQuickReplies,
storeHistory: storeHistory,
fabText: enableTextButton ? fabText : undefined,
theme: {
widgetBackgroundColor: widgetBackgroundColor,
chatHeaderBackgroundColor: chatHeaderBackgroundColor,
Expand All @@ -397,7 +404,9 @@
sideOfScreen: sideOfScreen,
googleFont: googleFont,
width: width,
height: height
height: height,
fabTextColor: chatHeaderTextColor,
fabBackgroundColor: chatHeaderBackgroundColor
},
meta: {
icon: {
Expand Down
2 changes: 2 additions & 0 deletions templates/channels/types/webchat/config.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit 50efbf1

Please sign in to comment.