Skip to content

Commit f6b5f42

Browse files
authored
Merge pull request #78 from Pear-Trading/Release-v0.1.10
Release v0.1.10
2 parents bcfd6b0 + a81437b commit f6b5f42

File tree

8 files changed

+43
-5
lines changed

8 files changed

+43
-5
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ testem.log
4141
/e2e/*.js
4242
/e2e/*.map
4343

44+
# build
45+
/dist
46+
4447
# local env variable
4548
/src/environments/environment.local.ts
4649
/src/environments/environment.prod.ts

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
# Next Release
44

5+
# 0.1.10
6+
7+
* Allowed for creation of yearly recurring transactions
8+
* Added google analytics
9+
510
# 0.1.9
611

712
* Made layout change to make it neater when chart doesn't show

src/app/app.module.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { environment } from '../environments/environment';
2+
13
import { BrowserModule } from '@angular/platform-browser';
24
import { NgModule } from '@angular/core';
35
import { LocationStrategy, HashLocationStrategy } from '@angular/common';
@@ -38,6 +40,8 @@ import { P500Component } from './pages/500.component';
3840
import { AuthModule } from './auth/auth.module';
3941
import { DashboardModule } from './dashboard/dashboard.module';
4042

43+
44+
4145
@NgModule({
4246
imports: [
4347
BrowserModule,
@@ -78,4 +82,10 @@ import { DashboardModule } from './dashboard/dashboard.module';
7882
],
7983
bootstrap: [ AppComponent ]
8084
})
81-
export class AppModule { }
85+
export class AppModule {
86+
constructor () {
87+
if (environment.enableAnalytics) {
88+
(<any>window).ga('create', environment.analyticsKey, 'auto');
89+
}
90+
}
91+
}

src/app/dashboard/add-data.component.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@
6262
<label class="btn btn-secondary mb-0" [class.active]="recurringType == 'quarterly'">
6363
<input value="quarterly" type="radio" name="radios" style="display:none;" [(ngModel)]="recurringType" (ngModelChange)="transactionFormValidate()">Quarterly
6464
</label>
65+
<label class="btn btn-secondary mb-0" [class.active]="recurringType == 'yearly'">
66+
<input value="yearly" type="radio" name="radios" style="display:none;" [(ngModel)]="recurringType" (ngModelChange)="transactionFormValidate()">Yearly
67+
</label>
6568
</div>
6669
</div>
6770
<span class="help-block">Please give the period of time the purchase will recur from "Time of Transaction".</span>

src/app/dashboard/dashboard.component.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { Component } from '@angular/core';
2-
import { Router } from '@angular/router';
2+
import {Router, NavigationEnd} from "@angular/router";
33
import { GraphWidget } from '../widgets/graph-widget.component';
44
import { OrgBarSnippetComponent } from '../snippets/org-snippet-bar.component';
55
import { GraphPanel } from '../panels/graph-panel.component';
66
import { DataType } from '../shared/data-types.enum';
7+
import { environment } from '../../environments/environment';
78

89
@Component({
910
templateUrl: 'dashboard.component.html'
@@ -50,6 +51,14 @@ export class DashboardComponent {
5051
dataType: DataType.currency,
5152
},
5253
];
53-
54-
constructor() { }
54+
constructor(private router: Router) {
55+
if (environment.enableAnalytics) {
56+
this.router.events.subscribe(event => {
57+
if (event instanceof NavigationEnd) {
58+
(<any>window).ga('set', 'page', event.urlAfterRedirects);
59+
(<any>window).ga('send', 'pageview');
60+
}
61+
});
62+
}
63+
}
5564
}

src/environments/environment.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@ export const environment = {
77
production: false,
88
apiUrl: 'https://dev.peartrade.org/api',
99
mapApiKey: 'CHANGEME',
10+
enableAnalytics: false,
11+
analyticsKey: 'CHANGEME',
1012
};
0 Bytes
Binary file not shown.

src/index.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
1919

2020
</head>
21-
2221
<body class="app header-fixed sidebar-fixed">
2322
<!-- Enable bootstrap 4 theme -->
2423
<script>window.__theme = 'bs4';</script>
@@ -123,6 +122,13 @@
123122
<div class="sk-cube3 sk-cube"></div>
124123
</div>
125124
</app-root>
125+
<app-root></app-root>
126+
<script>
127+
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
128+
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
129+
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
130+
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
131+
</script>
126132
</body>
127133

128134
</html>

0 commit comments

Comments
 (0)