Skip to content
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

Added changes to support widget config update #392

Merged
merged 1 commit into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading