Skip to content

Commit

Permalink
community - add trustarc
Browse files Browse the repository at this point in the history
Issue: AAH-2163
  • Loading branch information
himdel committed Mar 15, 2024
1 parent 345beca commit 4c08eab
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES/2163.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
community - add trustarc
1 change: 1 addition & 0 deletions community/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ WORKDIR /workspace/
RUN mkdir -p /workspace/ && \
apk add --no-cache git
COPY . /workspace/
COPY community/index.html /workspace/src/index.html
RUN npm ci && \
npm run gettext:extract && \
npm run gettext:compile && \
Expand Down
25 changes: 25 additions & 0 deletions community/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!doctype html>
<html lang="en-US">
<head>
<meta charset="UTF-8" />
<title><%= htmlWebpackPlugin.options.applicationName %></title>

<script
id="trustarc"
type="text/javascript"
src="//static.dev.redhat.com/libs/redhat/marketing/latest/trustarc/trustarc.js"
defer
data-domain="redhat2_test.com"
data-debug=""
></script>
</head>
<body>
<div id="root"></div>

<footer style="display: none">
<span id="teconsent">
<!-- trustarc -->
</span>
</footer>
</body>
</html>
9 changes: 9 additions & 0 deletions src/containers/landing/landing-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,11 @@ export class LandingPage extends Component<RouteProps, IState> {
<ListItem>
<ExternalLink href='https://www.redhat.com/en/about/digital-accessibility'>{t`Digital accessibility`}</ExternalLink>
</ListItem>
<ListItem>
<a
onClick={this.cookiePreferences}
>{t`Cookie preferences`}</a>
</ListItem>
</List>
}
/>
Expand All @@ -205,6 +210,10 @@ export class LandingPage extends Component<RouteProps, IState> {
alerts: [...this.state.alerts, alert],
});
}

private cookiePreferences() {
window.document.querySelector('#teconsent > a').click();

Check failure on line 215 in src/containers/landing/landing-page.tsx

View workflow job for this annotation

GitHub Actions / pr-checks

Property 'click' does not exist on type 'Element'.
}
}

export default withRouter(LandingPage);

0 comments on commit 4c08eab

Please sign in to comment.