Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIM-1818] Remove snapengage chat script #2536

Merged
merged 1 commit into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/main/resources/main.es6
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ try {
feature: 'highchart-react',
enabled: false,
},
{
feature: 'enable-chat-script',
enabled: false,
},
{
feature: 'highcharts-y-axix-title-mobile',
enabled: false,
Expand Down
18 changes: 0 additions & 18 deletions src/main/resources/site/pages/default/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,23 +188,5 @@ <h2 data-th-if="${region.view == 'card' && !region.hideTitle && region.title}" c
</footer>

<script data-th-src="${ieUrl}" defer></script>

<!-- SnapEngage code -->
<script type="text/javascript" data-th-if="${enabledChatScript}">
/*<![CDATA[*/
(function() {
const se = document.createElement('script'); se.type = 'text/javascript'; se.defer = true
se.src = '//storage.googleapis.com/code.snapengage.com/js/7aa173d9-8793-45b9-b721-9b276d42ff39.js'
let done = false
se.onload = se.onreadystatechange = function() {
if (!done && (!this.readyState || this.readyState === 'loaded' || this.readyState === 'complete')) {
done = true
}
}
const s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(se, s)
})()
/*]]>*/
</script>

</body>
</html>
3 changes: 0 additions & 3 deletions src/main/resources/site/pages/default/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ export function get(req: XP.Request): XP.Response {
)
const breadcrumbId = 'breadcrumbs'
const hideBreadcrumb = !!pageConfig?.hide_breadcrumb
const innrapporteringRegexp = /^\/ssb(\/en)?\/innrapportering/ // Skal matche alle sider under /innrapportering på norsk og engelsk

const model: DefaultModel = {
isFragment,
Expand All @@ -254,7 +253,6 @@ export function get(req: XP.Request): XP.Response {
breadcrumbsReactId: breadcrumbId,
hideHeader,
hideBreadcrumb,
enabledChatScript: isEnabled('enable-chat-script', true, 'ssb') && innrapporteringRegexp.exec(page._path),
tableView: page.type === 'mimir:table',
}

Expand Down Expand Up @@ -641,6 +639,5 @@ interface DefaultModel {
breadcrumbsReactId: string | undefined
hideHeader: boolean
hideBreadcrumb: boolean
enabledChatScript: boolean
tableView: boolean
}
Loading