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

Fix for coming soon link #441

Merged
merged 4 commits into from
Aug 2, 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
18 changes: 18 additions & 0 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,39 @@
import { Component, OnInit } from '@angular/core';
import { NavigationEnd, Router } from '@angular/router';
import { distinctUntilChanged } from 'rxjs/operators';

// Declare jQuery symbol
declare var $: any;
declare var gtag: Function;

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
constructor(private router: Router) { }

title = 'gear3';

ngOnInit() {
// Pad main Module by how big the top navbar is
$(document).ready(this.setNavOffsets);
$(window).resize(this.setNavOffsets);

/*
** Send analytics if page changes and the route isn't the same
** distinctUntilChanged so the observer only emits when type NavigationEnd and
** doesn't have the same route as previously emitted
*/
this.router.events.pipe(distinctUntilChanged((previous: any, current: any) => {
if(current instanceof NavigationEnd) {
return previous.url === current.url;
}
return true;
})).subscribe((x: any) => {
gtag('config', 'G-PDPL5T61V1', {'page_path': x.url});
});
}

setNavOffsets() {
Expand Down
3 changes: 1 addition & 2 deletions src/app/views/main/about/about.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ <h4>TIME</h4>

<div id="videoTutorials" class="tab-pane fade">
<div class="row justify-content-center">
<img src="https://innovationlabs.harvard.edu/wp-content/uploads/sites/5/2018/08/Coming-soon-stamp.jpg"
alt="Coming Soon" style="width: 50%;">
<p>Coming Soon...</p>
<!-- Placeholder for video tutorials -->
<!-- <div class="eavp-player-cntr row tablefix">
<div class="col-md-12">
Expand Down
3 changes: 2 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'G-PDPL5T61V1');
// moving this to app.component.ts so GA doesn't track initial load twice
// gtag('config', 'G-PDPL5T61V1');
</script>

<meta charset="utf-8">
Expand Down
Loading