This commit is contained in:
Scott Kiener 2025-04-09 10:56:42 -04:00
parent 85c247322d
commit 442bd86e9e
6 changed files with 154 additions and 145 deletions

View file

@ -8,54 +8,59 @@ The code below is generated from salesforce but modified in the following ways:
*/ */
export function initializeSalesforceWebchatForDev() { export function initializeSalesforceWebchatForDev() {
var initESW = function(gslbBaseURL) { var initESW = function (gslbBaseURL) {
let embedded_svc = window.embedded_svc; let embedded_svc = window.embedded_svc;
embedded_svc.settings.displayHelpButton = true; //Or false embedded_svc.settings.displayHelpButton = true; //Or false
embedded_svc.settings.language = ''; //For example, enter 'en' or 'en-US' embedded_svc.settings.language = ""; //For example, enter 'en' or 'en-US'
//embedded_svc.settings.defaultMinimizedText = '...'; //(Defaults to Chat with an Expert) //embedded_svc.settings.defaultMinimizedText = '...'; //(Defaults to Chat with an Expert)
//embedded_svc.settings.disabledMinimizedText = '...'; //(Defaults to Agent Offline) //embedded_svc.settings.disabledMinimizedText = '...'; //(Defaults to Agent Offline)
//embedded_svc.settings.loadingText = ''; //(Defaults to Loading) //embedded_svc.settings.loadingText = ''; //(Defaults to Loading)
//embedded_svc.settings.storageDomain = 'yourdomain.com'; //(Sets the domain for your deployment so that visitors can navigate subdomains during a chat session) //embedded_svc.settings.storageDomain = 'yourdomain.com'; //(Sets the domain for your deployment so that visitors can navigate subdomains during a chat session)
// Settings for Chat // Settings for Chat
//embedded_svc.settings.directToButtonRouting = function(prechatFormData) { //embedded_svc.settings.directToButtonRouting = function(prechatFormData) {
// Dynamically changes the button ID based on what the visitor enters in the pre-chat form. // Dynamically changes the button ID based on what the visitor enters in the pre-chat form.
// Returns a valid button ID. // Returns a valid button ID.
//}; //};
//embedded_svc.settings.prepopulatedPrechatFields = {}; //Sets the auto-population of pre-chat form fields //embedded_svc.settings.prepopulatedPrechatFields = {}; //Sets the auto-population of pre-chat form fields
//embedded_svc.settings.fallbackRouting = []; //An array of button IDs, user IDs, or userId_buttonId //embedded_svc.settings.fallbackRouting = []; //An array of button IDs, user IDs, or userId_buttonId
//embedded_svc.settings.offlineSupportMinimizedText = '...'; //(Defaults to Contact Us) //embedded_svc.settings.offlineSupportMinimizedText = '...'; //(Defaults to Contact Us)
embedded_svc.settings.enabledFeatures = ['LiveAgent']; embedded_svc.settings.enabledFeatures = ["LiveAgent"];
embedded_svc.settings.entryFeature = 'LiveAgent'; embedded_svc.settings.entryFeature = "LiveAgent";
embedded_svc.init( embedded_svc.init(
'https://safelite2--dev.sandbox.my.salesforce.com', "https://safelite2--dev.sandbox.my.salesforce.com",
'https://safelite2--dev.sandbox.my.salesforce-sites.com/chat', "https://safelite2--dev.sandbox.my.salesforce-sites.com/chat",
gslbBaseURL, gslbBaseURL,
'00D6s0000008r6A', "00D6s0000008r6A",
'Sales_Central_Snap_in', "Sales_Central_Snap_in",
{ {
baseLiveAgentContentURL: 'https://c.la12s-core1.sfdc-8tgtt5.salesforceliveagent.com/content', baseLiveAgentContentURL:
deploymentId: '572Wr0000017xKX', "https://c.la12s-core1.sfdc-8tgtt5.salesforceliveagent.com/content",
buttonId: '573Wr000000CpgH', deploymentId: "572Wr0000017xKX",
baseLiveAgentURL: 'https://d.la12s-core1.sfdc-8tgtt5.salesforceliveagent.com/chat', buttonId: "573Wr000000CpgH",
eswLiveAgentDevName: 'EmbeddedServiceLiveAgent_Parent04IWr000003yKq9MAE_1961681659a', baseLiveAgentURL: "https://d.la12s-core1.sfdc-8tgtt5.salesforceliveagent.com/chat",
isOfflineSupportEnabled: false eswLiveAgentDevName:
} "EmbeddedServiceLiveAgent_Parent04IWr000003yKq9MAE_1961681659a",
); isOfflineSupportEnabled: false,
}; }
);
};
if (!window.embedded_svc) { if (!window.embedded_svc) {
var s = document.createElement('script'); var s = document.createElement("script");
s.setAttribute('src', 'https://safelite2--dev.sandbox.my.salesforce.com/embeddedservice/5.0/esw.min.js'); s.setAttribute(
s.onload = function() { "src",
initESW(null); "https://safelite2--dev.sandbox.my.salesforce.com/embeddedservice/5.0/esw.min.js"
}; );
document.body.appendChild(s); s.onload = function () {
} else { initESW(null);
initESW('https://service.force.com'); };
} document.body.appendChild(s);
} else {
initESW("https://service.force.com");
}
} }

View file

@ -8,54 +8,56 @@ The code below is generated from salesforce but modified in the following ways:
*/ */
export function initializeSalesforceWebchatForProd(embedded_svc) { export function initializeSalesforceWebchatForProd(embedded_svc) {
var initESW = function(gslbBaseURL) { var initESW = function (gslbBaseURL) {
let embedded_svc = window.embedded_svc; let embedded_svc = window.embedded_svc;
embedded_svc.settings.displayHelpButton = true; //Or false embedded_svc.settings.displayHelpButton = true; //Or false
embedded_svc.settings.language = ''; //For example, enter 'en' or 'en-US' embedded_svc.settings.language = ""; //For example, enter 'en' or 'en-US'
//embedded_svc.settings.defaultMinimizedText = '...'; //(Defaults to Chat with an Expert) //embedded_svc.settings.defaultMinimizedText = '...'; //(Defaults to Chat with an Expert)
//embedded_svc.settings.disabledMinimizedText = '...'; //(Defaults to Agent Offline) //embedded_svc.settings.disabledMinimizedText = '...'; //(Defaults to Agent Offline)
//embedded_svc.settings.loadingText = ''; //(Defaults to Loading) //embedded_svc.settings.loadingText = ''; //(Defaults to Loading)
//embedded_svc.settings.storageDomain = 'yourdomain.com'; //(Sets the domain for your deployment so that visitors can navigate subdomains during a chat session) //embedded_svc.settings.storageDomain = 'yourdomain.com'; //(Sets the domain for your deployment so that visitors can navigate subdomains during a chat session)
// Settings for Chat // Settings for Chat
//embedded_svc.settings.directToButtonRouting = function(prechatFormData) { //embedded_svc.settings.directToButtonRouting = function(prechatFormData) {
// Dynamically changes the button ID based on what the visitor enters in the pre-chat form. // Dynamically changes the button ID based on what the visitor enters in the pre-chat form.
// Returns a valid button ID. // Returns a valid button ID.
//}; //};
//embedded_svc.settings.prepopulatedPrechatFields = {}; //Sets the auto-population of pre-chat form fields //embedded_svc.settings.prepopulatedPrechatFields = {}; //Sets the auto-population of pre-chat form fields
//embedded_svc.settings.fallbackRouting = []; //An array of button IDs, user IDs, or userId_buttonId //embedded_svc.settings.fallbackRouting = []; //An array of button IDs, user IDs, or userId_buttonId
//embedded_svc.settings.offlineSupportMinimizedText = '...'; //(Defaults to Contact Us) //embedded_svc.settings.offlineSupportMinimizedText = '...'; //(Defaults to Contact Us)
embedded_svc.settings.enabledFeatures = ['LiveAgent']; embedded_svc.settings.enabledFeatures = ["LiveAgent"];
embedded_svc.settings.entryFeature = 'LiveAgent'; embedded_svc.settings.entryFeature = "LiveAgent";
embedded_svc.init( embedded_svc.init(
'https://safelite2.my.salesforce.com', "https://safelite2.my.salesforce.com",
'https://safelite2.my.salesforce-sites.com/chat', "https://safelite2.my.salesforce-sites.com/chat",
gslbBaseURL, gslbBaseURL,
'00D3t000004nvsT', "00D3t000004nvsT",
'Sales_Central_Snap_in', "Sales_Central_Snap_in",
{ {
baseLiveAgentContentURL: 'https://c.la13-core2.sfdc-lywfpd.salesforceliveagent.com/content', baseLiveAgentContentURL:
deploymentId: '5723t0000008wWB', "https://c.la13-core2.sfdc-lywfpd.salesforceliveagent.com/content",
buttonId: '5733t000000D90z', deploymentId: "5723t0000008wWB",
baseLiveAgentURL: 'https://d.la13-core2.sfdc-lywfpd.salesforceliveagent.com/chat', buttonId: "5733t000000D90z",
eswLiveAgentDevName: 'EmbeddedServiceLiveAgent_Parent04I3t000000Cq0SEAS_188de1871ea', baseLiveAgentURL: "https://d.la13-core2.sfdc-lywfpd.salesforceliveagent.com/chat",
isOfflineSupportEnabled: false eswLiveAgentDevName:
} "EmbeddedServiceLiveAgent_Parent04I3t000000Cq0SEAS_188de1871ea",
); isOfflineSupportEnabled: false,
}; }
);
};
if (!window.embedded_svc) { if (!window.embedded_svc) {
var s = document.createElement('script'); var s = document.createElement("script");
s.setAttribute('src', 'https://safelite2.my.salesforce.com/embeddedservice/5.0/esw.min.js'); s.setAttribute("src", "https://safelite2.my.salesforce.com/embeddedservice/5.0/esw.min.js");
s.onload = function() { s.onload = function () {
initESW(null); initESW(null);
}; };
document.body.appendChild(s); document.body.appendChild(s);
} else { } else {
initESW('https://service.force.com'); initESW("https://service.force.com");
} }
} }

View file

@ -8,11 +8,11 @@ The code below is generated from salesforce but modified in the following ways:
*/ */
export function initializeSalesforceWebchatForQa() { export function initializeSalesforceWebchatForQa() {
var initESW = function(gslbBaseURL) { var initESW = function (gslbBaseURL) {
let embedded_svc = window.embedded_svc; let embedded_svc = window.embedded_svc;
embedded_svc.settings.displayHelpButton = true; //Or false embedded_svc.settings.displayHelpButton = true; //Or false
embedded_svc.settings.language = ''; //For example, enter 'en' or 'en-US' embedded_svc.settings.language = ""; //For example, enter 'en' or 'en-US'
//embedded_svc.settings.defaultMinimizedText = '...'; //(Defaults to Chat with an Expert) //embedded_svc.settings.defaultMinimizedText = '...'; //(Defaults to Chat with an Expert)
//embedded_svc.settings.disabledMinimizedText = '...'; //(Defaults to Agent Offline) //embedded_svc.settings.disabledMinimizedText = '...'; //(Defaults to Agent Offline)
@ -22,41 +22,46 @@ export function initializeSalesforceWebchatForQa() {
// Settings for Chat // Settings for Chat
//embedded_svc.settings.directToButtonRouting = function(prechatFormData) { //embedded_svc.settings.directToButtonRouting = function(prechatFormData) {
// Dynamically changes the button ID based on what the visitor enters in the pre-chat form. // Dynamically changes the button ID based on what the visitor enters in the pre-chat form.
// Returns a valid button ID. // Returns a valid button ID.
//}; //};
//embedded_svc.settings.prepopulatedPrechatFields = {}; //Sets the auto-population of pre-chat form fields //embedded_svc.settings.prepopulatedPrechatFields = {}; //Sets the auto-population of pre-chat form fields
//embedded_svc.settings.fallbackRouting = []; //An array of button IDs, user IDs, or userId_buttonId //embedded_svc.settings.fallbackRouting = []; //An array of button IDs, user IDs, or userId_buttonId
//embedded_svc.settings.offlineSupportMinimizedText = '...'; //(Defaults to Contact Us) //embedded_svc.settings.offlineSupportMinimizedText = '...'; //(Defaults to Contact Us)
embedded_svc.settings.enabledFeatures = ['LiveAgent']; embedded_svc.settings.enabledFeatures = ["LiveAgent"];
embedded_svc.settings.entryFeature = 'LiveAgent'; embedded_svc.settings.entryFeature = "LiveAgent";
embedded_svc.init( embedded_svc.init(
'https://safelite2--safeliteua.sandbox.my.salesforce.com', "https://safelite2--safeliteua.sandbox.my.salesforce.com",
'https://safelite2--safeliteua.sandbox.my.salesforce-sites.com/chat', "https://safelite2--safeliteua.sandbox.my.salesforce-sites.com/chat",
gslbBaseURL, gslbBaseURL,
'00DDJ000000HRqO', "00DDJ000000HRqO",
'Sales_Central_Snap_in', "Sales_Central_Snap_in",
{ {
baseLiveAgentContentURL: 'https://c.la12s-core1.sfdc-8tgtt5.salesforceliveagent.com/content', baseLiveAgentContentURL:
deploymentId: '572DJ00000001j3', "https://c.la12s-core1.sfdc-8tgtt5.salesforceliveagent.com/content",
buttonId: '573DJ00000001ur', deploymentId: "572DJ00000001j3",
baseLiveAgentURL: 'https://d.la12s-core1.sfdc-8tgtt5.salesforceliveagent.com/chat', buttonId: "573DJ00000001ur",
eswLiveAgentDevName: 'EmbeddedServiceLiveAgent_Parent04IDJ0000008OZk2AM_1883057c9a6', baseLiveAgentURL: "https://d.la12s-core1.sfdc-8tgtt5.salesforceliveagent.com/chat",
isOfflineSupportEnabled: false eswLiveAgentDevName:
} "EmbeddedServiceLiveAgent_Parent04IDJ0000008OZk2AM_1883057c9a6",
isOfflineSupportEnabled: false,
}
); );
}; };
if (!window.embedded_svc) { if (!window.embedded_svc) {
var s = document.createElement('script'); var s = document.createElement("script");
s.setAttribute('src', 'https://safelite2--safeliteua.sandbox.my.salesforce.com/embeddedservice/5.0/esw.min.js'); s.setAttribute(
s.onload = function() { "src",
initESW(null); "https://safelite2--safeliteua.sandbox.my.salesforce.com/embeddedservice/5.0/esw.min.js"
);
s.onload = function () {
initESW(null);
}; };
document.body.appendChild(s); document.body.appendChild(s);
} else { } else {
initESW('https://service.force.com'); initESW("https://service.force.com");
} }
} }

View file

@ -11,14 +11,13 @@ import { initializeSalesforceWebchatForProd } from "./salesforce-helper-prod";
export default { export default {
name: "salesforceWebchat", name: "salesforceWebchat",
data() { data() {
return { return {};
}
}, },
props: { props: {
hideSalesforceWebchatLaunchButton: { hideSalesforceWebchatLaunchButton: {
type: Boolean, type: Boolean,
default: false default: false,
} },
}, },
mounted() { mounted() {
// Load in script from salesforce CDN // Load in script from salesforce CDN
@ -27,25 +26,22 @@ export default {
script.onload = () => { script.onload = () => {
switch (process.env.VUE_APP_CURRENT_ENVIRONMENT) { switch (process.env.VUE_APP_CURRENT_ENVIRONMENT) {
case "Prod": case "Prod":
initializeSalesforceWebchatForProd() initializeSalesforceWebchatForProd();
break; break;
case "QA": case "QA":
case "SysTest": case "SysTest":
initializeSalesforceWebchatForQa() initializeSalesforceWebchatForQa();
break; break;
case "Dev": case "Dev":
case "Localhost": case "Localhost":
initializeSalesforceWebchatForDev() initializeSalesforceWebchatForDev();
break; break;
} }
};
}
document.body.appendChild(script); document.body.appendChild(script);
}, },
methods: { methods: {},
}, computed: {},
computed: {
},
components: {}, components: {},
}; };
</script> </script>

View file

@ -2,9 +2,7 @@
<div <div
class="funnel-header d-flex justify-content-center align-items-center flex-column" class="funnel-header d-flex justify-content-center align-items-center flex-column"
v-if="imageSrc"> v-if="imageSrc">
<salesforceWebchat <salesforceWebchat hideSalesforceWebchatLaunchButton />
hideSalesforceWebchatLaunchButton
/>
<img class="logo-image img-fluid" :src="imageSrc" alt="Safelite logo" /> <img class="logo-image img-fluid" :src="imageSrc" alt="Safelite logo" />
<menuModal /> <menuModal />
</div> </div>
@ -43,8 +41,8 @@ export default {
cmsWidgetName: String, cmsWidgetName: String,
hideSalesforceWebchatLaunchButton: { hideSalesforceWebchatLaunchButton: {
type: Boolean, type: Boolean,
default: false default: false,
} },
}, },
computed: { computed: {
imageSrc() { imageSrc() {
@ -68,7 +66,7 @@ export default {
components: { components: {
alert, alert,
menuModal, menuModal,
salesforceWebchat salesforceWebchat,
}, },
mounted() { mounted() {
// Check if alert event is on the bus // Check if alert event is on the bus

View file

@ -5,7 +5,10 @@
<div class="container-fluid pb-2"> <div class="container-fluid pb-2">
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-md-6"> <div class="col-md-6">
<funnelHeader cmsWidgetName="FunnelHeaderWidget" ref="funnelHeader" hideSalesforceWebchatLaunchButton /> <funnelHeader
cmsWidgetName="FunnelHeaderWidget"
ref="funnelHeader"
hideSalesforceWebchatLaunchButton />
</div> </div>
</div> </div>
<div class="row justify-content-center"> <div class="row justify-content-center">