Skip to content

Commit

Permalink
fix: Remove template literal in Cohesion snippet (#27)
Browse files Browse the repository at this point in the history
EDX-932 RV
  • Loading branch information
julianajlk authored Nov 7, 2024
1 parent 4493f8d commit 461089f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions cohesion.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ const cohesionConfig = {
postTypeGql: '',
homepageGql: '',
siteUrl: process.env.MARKETING_SITE_BASE_URL,
cmsUrl: process.env.NEXT_PUBLIC_WORDPRESS_URL || '',
cmsUser: process.env.WP_USER || '',
cmsPwd: process.env.WP_PWD || '',
cmsUrl: '',
cmsUser: '',
cmsPwd: '',
logoUrl: '',
studyMatchUrl: '',
voyagerUrl: '/discover',
Expand Down
16 changes: 8 additions & 8 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
<% } %>

<% /* NOTE: Adding Red Ventures related cohesion/tagular code for the launch of the new marketing website. */ %>
<% if (htmlWebpackPlugin.options.cohesionConfig) { %>
<% if (htmlWebpackPlugin?.options?.cohesionConfig) { %>
<script>
{`!function(co,h,e,s,i,o,n){var d='documentElement';var a='className';h[d][a]+=' preampjs';
n.k=e;co._Cohesion=n;co._Preamp={k:s,start:new Date};co._Fuse={k:i};co._Tagular={k:o};
!function(co,h,e,s,i,o,n){console.log('Cohesion script running'); var d='documentElement';var a='className';h[d][a]+=' preampjs';
n.k=e;co._Cohesion=n;co._Preamp={k:s,start:new Date};co._Fuse={k:i};co._Tagular={k:o}; co.tagular = o;
[e,s,i,o].map(function(x){co[x]=co[x]||function(){(co[x].q=co[x].q||[]).push([].slice.call(arguments))}});
var b=function(){var u=h[d][a];h[d][a]=u.replace(/ ?preampjs/g,'')};
h.addEventListener('DOMContentLoaded',function(){co.setTimeout(b,3e3);
Expand All @@ -34,15 +34,15 @@
(window,document,'cohesion','preamp','fuse','tagular',{
tagular: {
apiHost: 'https://beam.edx.org/v2/t',
writeKey: '<%= htmlWebpackPlugin.options.cohesionConfig.tagularWriteKey %>',
sourceKey: '<%= htmlWebpackPlugin.options.cohesionConfig.tagularSourceKey %>',
cookieDomain: '<%= htmlWebpackPlugin.options.cohesionConfig.tagularCookieDomain %>',
domainWhitelist: <%= htmlWebpackPlugin.options.cohesionConfig.tagularDomainWhitelist %>,
writeKey: '<%= htmlWebpackPlugin?.options?.cohesionConfig?.tagularWriteKey %>',
sourceKey: '<%= htmlWebpackPlugin?.options?.cohesionConfig?.tagularSourceKey %>',
cookieDomain: '<%= htmlWebpackPlugin?.options?.cohesionConfig?.tagularCookieDomain %>',
domainWhitelist: `<%= htmlWebpackPlugin?.options?.cohesionConfig?.tagularDomainWhitelist %>`,
apiVersion: 'v2/t',
multiparty: true,
taggy: { enabled: true },
}
})`}
})
</script>
<% } %>
</head>
Expand Down
2 changes: 1 addition & 1 deletion src/feedback/AlertMessage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const AlertMessage = (props) => {
useEffect(() => {
const observerCallback = (entries) => {
entries.forEach(entry => {
if (entry.isIntersecting && messageType === 'success' && userMessage.includes('added to basket')) {
if (entry.isIntersecting && entry.target?.innerText.includes('added to basket')) {
const tagularElement = {
title: PaymentTitle,
url: entry.target?.baseURI,
Expand Down

0 comments on commit 461089f

Please sign in to comment.