Skip to content

Commit

Permalink
fix: Remove template literal
Browse files Browse the repository at this point in the history
  • Loading branch information
julianajlk committed Nov 7, 2024
1 parent c07502f commit dd08ad2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
27 changes: 16 additions & 11 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,22 @@

<% /* TEMP: testing cohesionConfig access */ %>
<script>
if (htmlWebpackPlugin && htmlWebpackPlugin.options && htmlWebpackPlugin.options.cohesionConfig) {
console.log('htmlWebpackPlugin attribute exists', htmlWebpackPlugin.options.cohesionConfig.tagularDomainWhitelist);
window.cohesionConfig = htmlWebpackPlugin.options.cohesionConfig;
} else {
console.log('htmlWebpackPlugin attribute does not exists');
try {
if (htmlWebpackPlugin && htmlWebpackPlugin.options && htmlWebpackPlugin.options.cohesionConfig) {
console.log('htmlWebpackPlugin attribute exists', htmlWebpackPlugin.options.cohesionConfig.tagularDomainWhitelist);
window.cohesionConfig = htmlWebpackPlugin.options.cohesionConfig;
} else {
console.log('htmlWebpackPlugin attribute does not exists');
}
} catch (e) {
console.log('Error with htmlWebpackPlugin', e)
}

</script>

<% /* NOTE: Adding Red Ventures related cohesion/tagular code for the launch of the new marketing website. */ %>
<script>
{`!function(co,h,e,s,i,o,n){var d='documentElement';var a='className';h[d][a]+=' preampjs';
!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};
[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,'')};
Expand All @@ -43,15 +48,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>
<body>
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 dd08ad2

Please sign in to comment.