Skip to content

Commit

Permalink
Merge pull request tmobile#44 in CAP/jazz_webapp from ga-tracking to …
Browse files Browse the repository at this point in the history
…master

* commit '2da4cf9cb98b5ce1388ed1eb0e5983867a118041':
  remove dev ga tracking
  ga tracking
  • Loading branch information
Satish Malireddi authored and Satish Malireddi committed Jul 31, 2018
2 parents 8e28a94 + 2da4cf9 commit 9f0a066
Show file tree
Hide file tree
Showing 4 changed files with 125 additions and 110 deletions.
105 changes: 60 additions & 45 deletions app/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,75 +1,90 @@

import { Component } from '@angular/core';
import {AfterViewInit, Component, ElementRef, OnInit} from '@angular/core';
import {ToasterContainerComponent, ToasterService, ToasterConfig} from 'angular2-toaster';
import {Idle, DEFAULT_INTERRUPTSOURCES} from '@ng-idle/core';
import {Keepalive} from '@ng-idle/keepalive';
import { AuthenticationService, MessageService } from './core/services/index';
import { Router } from '@angular/router';
import { Location } from '@angular/common';
import {AuthenticationService, MessageService} from './core/services/index';
import {NavigationEnd, Router} from '@angular/router';
import {Location} from '@angular/common';
import {BodyOutputType} from 'angular2-toaster';

import {environment} from "../environments/environment";
declare let ga;
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
// directives: [ToasterContainerComponent],
// directives: [ToasterContainerComponent],
providers: [ToasterService, MessageService],
styleUrls: ['./app.component.scss']
})
export class AppComponent {
idleState = 'Not started.';
export class AppComponent implements OnInit{
idleState = 'Not started.';
timedOut = false;
lastPing?: Date = null;
public wrapperClass = '';
tst:any;
public wrapperClass = '';
tst: any;

constructor(
private toasterService: ToasterService,
private idle: Idle,
private location: Location,
private keepalive: Keepalive,
private messageservice: MessageService,
private authenticationservice: AuthenticationService,
private router: Router
) {

constructor(
private toasterService: ToasterService,
private idle: Idle,
private location: Location,
private keepalive: Keepalive,private router: Router,
private messageservice:MessageService,
private authenticationservice:AuthenticationService
) {

// sets an idle timeout of 15 mins, for testing purposes.
idle.setIdle(60*15);
// sets an idle timeout of 15 mins, for testing purposes.
idle.setIdle(60 * 15);
// sets a timeout period of 15 mins. after 30 mins of inactivity, the user will be considered timed out.
idle.setTimeout(60*15);
idle.setTimeout(60 * 15);
// sets the default interrupts, in this case, things like clicks, scrolls, touches to the document
idle.setInterrupts(DEFAULT_INTERRUPTSOURCES);

idle.onTimeout.subscribe(() => {
if(this.authenticationservice.isLoggedIn()){
this.authenticationservice.logout();
this.router.navigate(['']);//location.path routed to landing page
let msg = this.messageservice.sessionEnd("true");
this.toasterService.pop('error','Oops!',msg);
}
if (this.authenticationservice.isLoggedIn()) {
this.authenticationservice.logout();
this.router.navigate(['']);//location.path routed to landing page
let msg = this.messageservice.sessionEnd("true");
this.toasterService.pop('error', 'Oops!', msg);
}

this.idleState = 'Timed out!';
this.timedOut = true;
this.reset();
this.timedOut = true;
this.reset();
});

this.reset();
//location.path routed to landing page
this.reset();
//location.path routed to landing page
if (location.path() == '') {
this.wrapperClass = 'landing';
}
this.toasterService = toasterService;
}
reset() {
this.toasterService = toasterService;
}

ngOnInit() {
if(environment.gaTrackingId) {
ga('create', environment.gaTrackingId, 'auto');
this.router.events.subscribe(event => {
if(event instanceof NavigationEnd){
ga('set', 'page', event.urlAfterRedirects);
ga('send', 'pageview');
}
})
}

}

reset() {
this.idle.watch();
this.idleState = 'Started.';
this.timedOut = false;
}

public toasterconfig : ToasterConfig =
new ToasterConfig({
showCloseButton: true,
tapToDismiss: false,
timeout: 4000,
limit:1
});
public toasterconfig: ToasterConfig =
new ToasterConfig({
showCloseButton: true,
tapToDismiss: false,
timeout: 4000,
limit: 1

});
}
3 changes: 2 additions & 1 deletion app/src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ export const environment = {
},
userJourney: {
registrationMessage: ''
}
},
gaTrackingId: 'UA-121896506-1'
};
3 changes: 2 additions & 1 deletion app/src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ export const environment = {
},
userJourney: {
registrationMessage: ''
}
},
gaTrackingId: ''
};
124 changes: 61 additions & 63 deletions app/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,99 +2,97 @@
<html class="jazz">

<head>
<meta charset="utf-8">
<title>Jazz Serverless Platform</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<link rel="icon" type="image/x-icon" href="assets/images/favicon.png">
<!-- <script src="../node_modules/chart.js/src/chart.js"></script> -->
<!--<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">-->
<style>
<meta charset="utf-8">
<title>Jazz Serverless Platform</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://www.google-analytics.com/analytics.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<link rel="icon" type="image/x-icon" href="assets/images/favicon.png">
<style>
html {
height: 100%;
height: 100%;
}

body {
background-image: radial-gradient(circle farthest-corner at center, #fff 0%, #fff 100%);
background-image: radial-gradient(circle farthest-corner at center, #fff 0%, #fff 100%);
}

.loader {
position: absolute;
top: calc(50% - 32px);
left: calc(50% - 32px);
width: 64px;
height: 64px;
border-radius: 50%;
perspective: 800px;
position: absolute;
top: calc(50% - 32px);
left: calc(50% - 32px);
width: 64px;
height: 64px;
border-radius: 50%;
perspective: 800px;
}

.inner {
position: absolute;
box-sizing: border-box;
width: 100%;
height: 100%;
border-radius: 50%;
position: absolute;
box-sizing: border-box;
width: 100%;
height: 100%;
border-radius: 50%;
}

.inner.one {
left: 0%;
top: 0%;
animation: rotate-one 1s linear infinite;
border-bottom: 3px solid #d40285;
left: 0%;
top: 0%;
animation: rotate-one 1s linear infinite;
border-bottom: 3px solid #d40285;
}

.inner.two {
right: 0%;
top: 0%;
animation: rotate-two 1s linear infinite;
border-right: 3px solid #d40285;
right: 0%;
top: 0%;
animation: rotate-two 1s linear infinite;
border-right: 3px solid #d40285;
}

.inner.three {
right: 0%;
bottom: 0%;
animation: rotate-three 1s linear infinite;
border-top: 3px solid #d40285;
right: 0%;
bottom: 0%;
animation: rotate-three 1s linear infinite;
border-top: 3px solid #d40285;
}

@keyframes rotate-one {
0% {
transform: rotateX(35deg) rotateY(-45deg) rotateZ(0deg);
}
100% {
transform: rotateX(35deg) rotateY(-45deg) rotateZ(360deg);
}
0% {
transform: rotateX(35deg) rotateY(-45deg) rotateZ(0deg);
}
100% {
transform: rotateX(35deg) rotateY(-45deg) rotateZ(360deg);
}
}

@keyframes rotate-two {
0% {
transform: rotateX(50deg) rotateY(10deg) rotateZ(0deg);
}
100% {
transform: rotateX(50deg) rotateY(10deg) rotateZ(360deg);
}
0% {
transform: rotateX(50deg) rotateY(10deg) rotateZ(0deg);
}
100% {
transform: rotateX(50deg) rotateY(10deg) rotateZ(360deg);
}
}

@keyframes rotate-three {
0% {
transform: rotateX(35deg) rotateY(55deg) rotateZ(0deg);
}
100% {
transform: rotateX(35deg) rotateY(55deg) rotateZ(360deg);
}
0% {
transform: rotateX(35deg) rotateY(55deg) rotateZ(0deg);
}
100% {
transform: rotateX(35deg) rotateY(55deg) rotateZ(360deg);
}
}
</style>
</style>
</head>

<body>
<app-root>
<div class="loader">
<div class="inner one"></div>
<div class="inner two"></div>
<div class="inner three"></div>
</div>
</app-root>
<app-root>
<div class="loader">
<div class="inner one"></div>
<div class="inner two"></div>
<div class="inner three"></div>
</div>
</app-root>
</body>

</html>
</html>

0 comments on commit 9f0a066

Please sign in to comment.