Skip to content

Commit cd78dab

Browse files
authored
tl-its-umich-edu#1646 Cookie consent banner hotfix (tl-its-umich-edu#1647)
* tl-its-umich-edu#1646 Cookie consent banner hotfix * implement feedback - less config settings needed * turn off privacystatement to drop the failing link * correction, remove privacy Url for broken link
1 parent 6789b85 commit cd78dab

File tree

4 files changed

+80
-602
lines changed

4 files changed

+80
-602
lines changed

assets/src/containers/App.js

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,9 @@ import Course from './Course'
55
import WarningBanner from '../components/WarningBanner'
66
import AlertBanner from '../components/AlertBanner'
77
import { Helmet } from 'react-helmet'
8-
import {useGoogleAnalytics, useUmConsent} from '@tl-its-umich-edu/react-ga-onetrust-consent'
98

109
function App (props) {
11-
const { user, gaId, cspNonce } = props
12-
const { gaInitialized, gaHandlers } = useGoogleAnalytics({ googleAnalyticsId: gaId, nonce: cspNonce })
13-
const { umConsentInitialize, umConsentInitialized } = useUmConsent()
14-
15-
if (
16-
!umConsentInitialized &&
17-
gaInitialized &&
18-
gaHandlers.onConsentApprove &&
19-
gaHandlers.onConsentReject
20-
) {
21-
const consentParams = {
22-
developmentMode: false,
23-
alwaysShow: false,
24-
onConsentApprove: gaHandlers.onConsentApprove,
25-
onConsentReject: gaHandlers.onConsentReject,
26-
};
27-
umConsentInitialize(consentParams)
28-
}
29-
10+
const { user } = props
3011
if (!user.isLoggedIn) {
3112
if (user.loginURL === '') {
3213
return (<WarningBanner>This tool needs to be launched from a Canvas course.</WarningBanner>)

dashboard/templates/base.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,20 @@
2828
}
2929
</style>
3030
{{ myla_globals|json_script:"myla_globals" }}
31+
<script>
32+
window.umConsentManager = {
33+
googleAnalyticsID: "{{ myla_globals.google_analytics_id }}",
34+
googleAnalyticsCustom:
35+
{
36+
streamConfig: {
37+
cookie_flags: 'SameSite=None; Secure'
38+
}
39+
},
40+
externalLinkBlank: true,
41+
privacyUrl: false
42+
};
43+
</script>
44+
<script async src="https://umich.edu/apis/umconsentmanager/consentmanager.js"></script>
3145
</head>
3246
<body>
3347
{% include "su/is_su.html" %}

0 commit comments

Comments
 (0)