From cbd236603afde43657571f033c50959cdb83f25e Mon Sep 17 00:00:00 2001 From: Peter Joles Date: Tue, 24 Nov 2020 12:43:37 -0600 Subject: [PATCH] :sparkles: feat: Expose ability to define open chat icon --- src/App.vue | 7 +-- src/components/ConfigAddEditSolution.vue | 58 +++++++++++++++++++++++- src/constants/solution-config-default.js | 4 +- src/store.js | 3 ++ src/utils/utils.js | 12 +++-- 5 files changed, 74 insertions(+), 10 deletions(-) diff --git a/src/App.vue b/src/App.vue index ec8d662f..ec061682 100644 --- a/src/App.vue +++ b/src/App.vue @@ -18,7 +18,7 @@ :class="`leopard-open-close-button embed-button-center pulse ${textColor('primary')}`" :style="customCssButtonToolbar" > - mdi-message-text + {{ getChatOpenIcon }} @@ -61,7 +61,7 @@ @click="maximizeChat = true" v-on:keydown.enter.prevent="maximizeChat = true" > - mdi-message-text + {{ getChatOpenIcon }} Continue conversation.. mdi-arrow-expand-all @@ -86,7 +86,7 @@ }`" :style="customCssButtonToolbar" > - + @@ -805,6 +805,7 @@ export default { "dialogs", "chatTitle", "customCssButtonToolbar", + "getChatOpenIcon", "getAnimatedIn", "getAnimatedOut", "embed", diff --git a/src/components/ConfigAddEditSolution.vue b/src/components/ConfigAddEditSolution.vue index f7b3461f..3550d5d4 100644 --- a/src/components/ConfigAddEditSolution.vue +++ b/src/components/ConfigAddEditSolution.vue @@ -241,7 +241,7 @@ filled validate-on-blur color="teal darken-4" - label="Response Icon - MDI Icons (mdi-icon-name)" + label="Bot Response Icon on the Left 👈 - MDI Icons (mdi-icon-name)" :append-icon="solution.responseIcon" :rules="[ruleMustHaveValue]" > @@ -271,7 +271,7 @@ filled validate-on-blur color="teal darken-4" - label="User Icon - MDI Icons (mdi-icon-name)" + label="User/Customer Icon on the Right 👉 - MDI Icons (mdi-icon-name)" :aria-label="`Set the icon representing the customer in the chat UI`" :append-icon="solution.userIcon" :rules="[ruleMustHaveValue]" @@ -295,6 +295,38 @@ + + + + + + + + + + {{ icon }} + + + (item, name) => { let extensions = getters.itemExtensions(item); let foundExtension = null; diff --git a/src/utils/utils.js b/src/utils/utils.js index adb8a5f5..667c2b8a 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -26,13 +26,17 @@ export const hasConflictingSolution = (solution, allSolutions) => { export const fixSolution = solution => { if (!("id" in solution)) { const id = uuid(); - // TODO: I know I need to fix this... - // if (solution.name === allSolutions.activeSolution) { - // allSolutions.activeSolution = id; - // } solution.id = id; } + if (!("asrLangCode" in solution)) { + solution.enableTts = solutionDefault.asrLangCode; + } + + if (!("chatOpenIcon" in solution)) { + solution.enableTts = solutionDefault.chatOpenIcon; + } + if (!("enableTts" in solution)) { solution.enableTts = solutionDefault.enableTts; }