Skip to content

Commit

Permalink
Fix spelling corrections throughout the source code
Browse files Browse the repository at this point in the history
  • Loading branch information
jolzee committed May 20, 2020
1 parent 897c465 commit 826a243
Show file tree
Hide file tree
Showing 16 changed files with 87 additions and 101 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ You can inject Leopard Chat UI into a specific element on a page. This might be
| [Sentry and LogRocket](https://jolzee.gitbook.io/leopard/logging-reporting) - Logging and Reporting | ✔️ |
| [Split Answers](https://jolzee.gitbook.io/leopard/configuration/response-options/splitting-a-response) | ✔️ |
| [Tables](https://jolzee.gitbook.io/leopard/configuration/components/modals/table) | ✔️ |
| Themable | ✔️ |
| Themeable | ✔️ |
| [Toasts](https://jolzee.gitbook.io/leopard/configuration/response-options/toasts) | ✔️ |
| [Video Player](https://jolzee.gitbook.io/leopard/configuration/components/modals/video) (YouTube, Vimeo, mp4) | ✔️ |
| [i18n](https://jolzee.gitbook.io/leopard/configuration/asr-and-tts#supported-languages) | ✔️ |
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "leopard-chat-teneo-vue",
"name": "leopard-chat-ui-teneo",
"version": "2.0.5",
"description": "A Teneo Chat Client based on Vue and Vuetify",
"author": "Peter Joles",
"repository": {
"type": "git",
"url": "https://github.com/jolzee/chat-teneo-vue.git"
"url": "https://github.com/jolzee/leopard-chat-ui-teneo.git"
},
"homepage": "https://jolzee.gitbook.io/leopard/",
"license": "Apache-2.0",
Expand Down
10 changes: 5 additions & 5 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
}"
>
<vue-snotify></vue-snotify>
<!-- <AssistiveText ref="assistiveText" v-model="accessibleAnouncement"></AssistiveText> -->
<!-- <AssistiveText ref="assistiveText" v-model="accessibleAnnouncement"></AssistiveText> -->
<transition
name="system-bar-transition"
enter-active-class="fadeInRightBig"
Expand Down Expand Up @@ -724,7 +724,7 @@ export default {
...mapGetters([
"emergencyConfig",
"isLiveAgentAssist",
"accessibleAnouncement",
"accessibleAnnouncement",
"mustCloseBecauseOfEscape",
"accentStyling",
"authenticated",
Expand Down Expand Up @@ -919,7 +919,7 @@ export default {
}
},
keepBranding() {
return !window.leopardConfig.hideArtificalSolutionsBranding;
return !window.leopardConfig.hideArtificialSolutionsBranding;
},
isLightColor(themeColorName) {
if (!this.$vuetify.theme.dark) {
Expand Down Expand Up @@ -994,7 +994,7 @@ export default {
},
sendMessageToParent(message) {
if (parent) {
parent.postMessage(message, "*"); // post multiple times to each domain you want leopard on. Specifiy origin for each post.
parent.postMessage(message, "*"); // post multiple times to each domain you want leopard on. Specify origin for each post.
logger.debug("Message from Leopard >> Embed : " + message);
}
return true;
Expand Down Expand Up @@ -1367,7 +1367,7 @@ code.language-json {
}
.chat-card {
cursor: defaul;
cursor: default;
}
#leopardSystemBarMinimized:focus {
Expand Down
17 changes: 1 addition & 16 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import "element-matches";
import smoothscroll from "smoothscroll-polyfill";
smoothscroll.polyfill();
const logger = require("@/utils/logging").getLogger("main.js");
import { doesParameterExist } from "@/utils/utils";
import Vue from "vue";
import App from "@/App";
import router from "@/router";
import { leopardLogBanner } from "./utils/leopardLogBanner";
leopardLogBanner();

import(/* webpackChunkName: "leopardConfig" */ "@/utils/leopardConfig").then(config => {
Expand All @@ -30,18 +30,3 @@ import(/* webpackChunkName: "leopardConfig" */ "@/utils/leopardConfig").then(con
logger.error("Leopard Setup Error", error);
});
});

function leopardLogBanner() {
if (!doesParameterExist("embed") && !doesParameterExist("button")) {
console.groupCollapsed(
`%c Powered by %c Leopard Chat UI 💬 %c`,
"background:#35495e ; padding: 1px; border-radius: 3px 0 0 3px; color: #fff",
"background:#41b883 ; padding: 1px; border-radius: 0 3px 3px 0; color: #fff",
"background:transparent"
);
console.log("Author: Peter Joles - peter.joles@artificial-solutions.com");
// console.log("Documentation: https://jolzee.gitbook.io/leopard/");
// console.log("Code: https://github.com/jolzee/chat-teneo-vue");
console.groupEnd();
}
}
50 changes: 25 additions & 25 deletions src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function storeSetup(vuetify) {
stopAudioCapture: false,
asr: null
},
accessibleAnouncement: "",
accessibleAnnouncement: "",
chatConfig: setupConfig.chatConfig,
activeSolution: setupConfig.activeSolution,
connection: {
Expand Down Expand Up @@ -229,8 +229,8 @@ function storeSetup(vuetify) {
fullscreenEmbed(state) {
return state.ui.embed && state.ui.parent.width && state.ui.parent.width <= 480;
},
accessibleAnouncement(state) {
return state.accessibleAnouncement;
accessibleAnnouncement(state) {
return state.accessibleAnnouncement;
},
responseDelay(state) {
return state.activeSolution.responseDelay;
Expand Down Expand Up @@ -1071,8 +1071,8 @@ function storeSetup(vuetify) {
SHOW_508_CONTENT(state) {
state.hide508 = false;
},
SET_ACCESIBLE_ANOUNCEMENT(state, message) {
state.accessibleAnouncement = stripHtml(message);
SET_ACCESSIBLE_ANNOUNCEMENT(state, message) {
state.accessibleAnnouncement = stripHtml(message);
},
SHOW_OVERLAY_ALERT(state, message) {
state.overlay.overlayAlertMessage = message;
Expand All @@ -1092,7 +1092,7 @@ function storeSetup(vuetify) {
RESET_MUST_CLOSE(state) {
state.ui.closeChatEsc = false;
},
CLOSE_OVERY_ALERT(state) {
CLOSE_OVERLAY_ALERT(state) {
state.overlay.showOverlayAlert = false;
state.overlay.overlayAlertMessage = "";
},
Expand Down Expand Up @@ -1197,7 +1197,7 @@ function storeSetup(vuetify) {
borderPosition: "left",
alertType: null,
color: "info",
primient: false,
prominent: false,
outlined: false,
icon: null,
bodyText: "",
Expand Down Expand Up @@ -1226,7 +1226,7 @@ function storeSetup(vuetify) {
borderPosition: borderPosition,
alertType: type,
color: color,
primient: prominent,
prominent: prominent,
outlined: outlined,
icon: icon,
bodyText: "",
Expand Down Expand Up @@ -1353,7 +1353,7 @@ function storeSetup(vuetify) {

//state.userInput.userInput = ""; // reset the user input to nothing

// deal with persiting the chat history
// deal with persisting the chat history
if (!setupConfig.USE_SESSION_STORAGE) {
localStorage.setItem(
STORAGE_KEY + setupConfig.TENEO_CHAT_HISTORY,
Expand All @@ -1372,7 +1372,7 @@ function storeSetup(vuetify) {
}
state.conversation.dialogHistory.push(newReply);
}
// save the dislaog history in session storage
// save the dialog history in session storage
sessionStorage.setItem(
STORAGE_KEY + setupConfig.TENEO_CHAT_HISTORY,
JSON.stringify(state.conversation.dialogHistory)
Expand Down Expand Up @@ -1545,7 +1545,7 @@ function storeSetup(vuetify) {
.send(config)
.then(res => {
// res.body = json, res.headers, res.status
logger.debug("Agent Assist: Canned Resposne Created", res.body);
logger.debug("Agent Assist: Canned Response Created", res.body);
})
.catch(err => {
// err.message, err.response
Expand Down Expand Up @@ -1711,12 +1711,12 @@ function storeSetup(vuetify) {
}
});
} else {
let retyCount = 0;
let retryCount = 0;
let checkExist = setInterval(function () {
retyCount++;
retryCount++;

if (getters.firebase) {
logger.debug(`SET USER INFORMATION > Firebase > Found on retry: ${retyCount}`);
logger.debug(`SET USER INFORMATION > Firebase > Found on retry: ${retryCount}`);
getters.firebase.auth().onAuthStateChanged(function (user) {
if (user && !getters.authenticated) {
commit("USER_INFO", { user: user }); // user is still signed in
Expand All @@ -1725,7 +1725,7 @@ function storeSetup(vuetify) {
clearInterval(checkExist);
}

if (retyCount++ > 80) {
if (retryCount++ > 80) {
logger.debug("SET USER INFORMATION > Firebase > Giving up trying waiting!!");
clearInterval(checkExist);
}
Expand Down Expand Up @@ -1955,7 +1955,7 @@ function storeSetup(vuetify) {
handleLoginResponse(context, json, vuetify, resolve);
})
.catch(err => {
handleTieErrorReponse(context, err, reject);
handleTieErrorResponse(context, err, reject);
});
});
},
Expand Down Expand Up @@ -2040,7 +2040,7 @@ function setupI18n() {
Vue.i18n.set(setupConfig.LOCALE);
}

function handleTieErrorReponse(context, err, reject) {
function handleTieErrorResponse(context, err, reject) {
context.commit("HIDE_CHAT_LOADING");
const errResp = {
error: err,
Expand Down Expand Up @@ -2083,12 +2083,12 @@ async function handleTeneoResponse(currentUserInput, context, params, vuetify) {
// (json.responseData.isNewSession || json.responseData.extraData.newsession)
// ) {
// logger.debug("Session is stale.. keep chat open and continue with the new session");
// const awayMessage = "This is a new chatbot session.";
// const awayMessage = "This is a new chat bot session.";
// context.commit("SHOW_SIMPLE_MESSAGE_IN_CHAT", {
// message: awayMessage,
// icon: "mdi-timer"
// });
// context.commit("SET_ACCESIBLE_ANOUNCEMENT", awayMessage);
// context.commit("SET_ACCESSIBLE_ANNOUNCEMENT", awayMessage);
// }

handleScriptResponse(tResp, context);
Expand All @@ -2110,7 +2110,7 @@ async function handleTeneoResponse(currentUserInput, context, params, vuetify) {
if (tResp.hasParameter("tts")) {
ttsText = stripHtml(tResp.getParameter("tts"));
}
context.commit("SET_ACCESIBLE_ANOUNCEMENT", "Chat Bot Said. " + ttsText + ".");
context.commit("SET_ACCESSIBLE_ANNOUNCEMENT", "Chat Bot Said. " + ttsText + ".");
// check if this browser supports the Web Speech API
if (
Object.prototype.hasOwnProperty.call(window, "webkitSpeechRecognition") &&
Expand All @@ -2132,7 +2132,7 @@ async function handleTeneoResponse(currentUserInput, context, params, vuetify) {

context.commit("UPDATE_CHAT_WINDOW_AND_STORAGE", finalLeopardPayload);
context.commit("HIDE_PROGRESS_BAR");
handleSignalToStartLiveChatReponse(tResp, context);
handleSignalToStartLiveChatResponse(tResp, context);
handleChangeChatTitleResponse(tResp, context);
handleTieUrlSwitchResponse(tResp, context);
}
Expand All @@ -2152,7 +2152,7 @@ async function handleTeneoResponse(currentUserInput, context, params, vuetify) {
logger.error("Request To Teneo Timed Out: 400", errResp);
context.commit(
"SHOW_MESSAGE_IN_CHAT",
"I'm sorry, I wasn't able to communicate with the virtual assitant. Please check your internet connection."
"I'm sorry, I wasn't able to communicate with the virtual assistant. Please check your internet connection."
);
} else {
logger.error("Could not communicate with Teneo", errResp);
Expand All @@ -2171,7 +2171,7 @@ function handleChangeChatTitleResponse(tResp, context) {
}
}

function handleSignalToStartLiveChatReponse(tResp, context) {
function handleSignalToStartLiveChatResponse(tResp, context) {
if (tResp.hasParameter("liveChat")) {
context.commit("START_LIVE_CHAT");
}
Expand Down Expand Up @@ -2336,7 +2336,7 @@ function handleDelayResponse(tResp, context, params) {
.then(logger.debug(`Continue with long operation`))
.catch(err => {
logger.error("Unable to continue conversation", err);
context.commit("SHOW_MESSAGE_IN_CHAT", "We're sorry for the inconvience: " + err.message);
context.commit("SHOW_MESSAGE_IN_CHAT", "We're sorry for the inconvenience: " + err.message);
});
}
if (params.indexOf("command=continue") !== -1) {
Expand Down Expand Up @@ -2557,7 +2557,7 @@ function handleLoginResponse(context, json, vuetify, resolve) {
};
// sessionStorage.setItem(STORAGE_KEY + TENEO_CHAT_HISTORY, JSON.stringify(response))
context.commit("PUSH_RESPONSE_TO_DIALOG", response); // push the getting message onto the dialog
context.commit("SET_ACCESIBLE_ANOUNCEMENT", response.text);
context.commit("SET_ACCESSIBLE_ANNOUNCEMENT", response.text);
if (hasExtraData) {
context.commit("SHOW_CHAT_MODAL", response);
}
Expand Down
2 changes: 1 addition & 1 deletion src/teneo-assets/ExtensionHelper.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class ExtensionHelper {

static String displayImageCarousel(Map config) {
Map params = [images: config.images]
Map attachment = [name: 'displayImageCarousel', title: config.get("title", ""), aria: config.get("aria", config.get("title", "Showing an Image Caroucel")), parameters: params, inline: config.get('inline', true)]
Map attachment = [name: 'displayImageCarousel', title: config.get("title", ""), aria: config.get("aria", config.get("title", "Showing an Image Carousel")), parameters: params, inline: config.get('inline', true)]
JsonOutput.toJson(attachment)
}

Expand Down
16 changes: 8 additions & 8 deletions src/utils/asr-tts.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,26 +89,26 @@ export function initializeASR(store, asrCorrections) {
store.state.asr.asr = store.state.tts.tts.newDictation({
soundex: true,
continuous: false, // Enable continuous if HTTPS connection
onResult: function(text) {
onResult: function (text) {
clearTimeout(timeoutVar);
// Do something with the text
if (text) {
//text = text.replace(/^\w/, c => c.toUpperCase()); // upercases first letter of user input -- use cautiously
//text = text.replace(/^\w/, c => c.toUpperCase()); // uppercase first letter of user input -- use cautiously
text = text.replace(/what's/gi, "what is");
store.commit("SET_USER_INPUT", text);
}
timeoutVar = setTimeout(function() {
timeoutVar = setTimeout(function () {
logger.debug("timeout - aborting recognition");
store.state.asr.asr.stop();
if (text) {
store.commit("SET_USER_INPUT", text); // final transcript from ASR
}
}, 800);
},
onStart: function() {
onStart: function () {
logger.debug("ASR capture started");
},
onEnd: function() {
onEnd: function () {
store.commit("HIDE_LISTENING_OVERLAY");

if (store.getters.stopAudioCapture) {
Expand All @@ -118,7 +118,7 @@ export function initializeASR(store, asrCorrections) {
// store.state.asr.stopAudioCapture = false;
return;
}
// let's fix sany ASR transcription erros
// let's fix any ASR transcription errors

if (store.getters.userInput) {
let fixedUserInput = store.getters.userInput;
Expand All @@ -133,7 +133,7 @@ export function initializeASR(store, asrCorrections) {
replacement[1].toLowerCase()
);
} else {
let search = replacement[0].replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); // escase any special characters
let search = replacement[0].replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); // escape any special characters
var re = new RegExp("\\b" + search + "\\b", "gi");
// fixedUserInput = fixedUserInput.toLowerCase().replace(re, replacement[1].toLowerCase());
fixedUserInput = fixedUserInput.replace(re, replacement[1]);
Expand All @@ -155,7 +155,7 @@ export function initializeASR(store, asrCorrections) {
logger.debug(`Final Transcription: ${fixedUserInput}`);
}

setTimeout(function() {
setTimeout(function () {
store.commit("USER_INPUT_READY_FOR_SENDING");
}, 500);
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/leopardConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default {
ipUrl: getEnvValue("VUE_APP_IP_URL"),
geoUrl: getEnvValue("VUE_APP_GEO_URL"),
hideConfigMenu: getEnvValue("VUE_APP_HIDE_CONFIG_MENU", true),
hideArtificalSolutionsBranding: getEnvValue("VUE_APP_HIDE_AS_BRANDING", false),
hideArtificialSolutionsBranding: getEnvValue("VUE_APP_HIDE_AS_BRANDING", false),
loadFreshConfigForNewSessions: getEnvValue("VUE_APP_LOAD_FRESH_CONFIG_FOR_NEW_SESSIONS", false),
mustGetStaticDefaultConfig: getEnvValue("VUE_APP_GET_STATIC_DEFAULT_CONFIG", false),
requestParams:
Expand Down
15 changes: 15 additions & 0 deletions src/utils/leopardLogBanner.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { doesParameterExist } from "@/utils/utils";
export function leopardLogBanner() {
if (!doesParameterExist("embed") && !doesParameterExist("button")) {
console.groupCollapsed(
`%c Powered by %c Leopard Chat UI 💬 %c`,
"background:#35495e ; padding: 1px; border-radius: 3px 0 0 3px; color: #fff",
"background:#41b883 ; padding: 1px; border-radius: 0 3px 3px 0; color: #fff",
"background:transparent"
);
console.log("Author: Peter Joles - peter.joles@artificial-solutions.com");
// console.log("Documentation: https://jolzee.gitbook.io/leopard/");
// console.log("Code: https://github.com/jolzee/chat-teneo-vue");
console.groupEnd();
}
}
Loading

0 comments on commit 826a243

Please sign in to comment.