Commit 51d9d5eb authored by Laury Bueno's avatar Laury Bueno

Merge branch 'develop'

 Conflicts:
	package-lock.json
parents fcaaa6c0 9139f6b1
Pipeline #14861699 passed with stages
in 10 minutes and 28 seconds
This diff is collapsed.
......@@ -25,6 +25,7 @@
"@ngx-translate/core": "^8.0.0",
"@ngx-translate/http-loader": "^2.0.0",
"@qontu/ngx-inline-editor": "^0.2.0-alpha.12",
"angulartics2": "^4.2.0",
"bootstrap": "^4.0.0-beta",
"core-js": "^2.4.1",
"font-awesome": "^4.7.0",
......@@ -37,7 +38,7 @@
"ngx-toastr": "^6.4.0",
"ngx-webstorage": "^1.8.0",
"roboto-fontface": "^0.8.0",
"rxjs": "^5.4.2",
"rxjs": "^5.5.2",
"zone.js": "^0.8.14"
},
"devDependencies": {
......
......@@ -5,6 +5,8 @@ import { By } from '@angular/platform-browser';
import { TranslateModule } from '@ngx-translate/core';
import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
import {RouterTestingModule} from "@angular/router/testing";
import { Angulartics2GoogleAnalytics } from 'angulartics2/ga';
import { Angulartics2Module } from 'angulartics2';
import * as helpers from "../spec/helpers";
import { GlobalState } from './global.state';
......@@ -15,14 +17,15 @@ describe('AppComponent', () => {
let component: AppComponent;
let fixture: ComponentFixture<AppComponent>;
let mocks = helpers.getMocks();
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [TranslateModule.forRoot(), HttpClientTestingModule, RouterTestingModule],
imports: [TranslateModule.forRoot(), HttpClientTestingModule, RouterTestingModule, Angulartics2Module.forRoot([Angulartics2GoogleAnalytics])],
declarations: [ AppComponent ],
providers: [{ provide: GlobalState, useValue: mocks.globalState },
{ provide: SessionService, useValue: mocks.sessionService },
{ provide: ProfileService, useValue: mocks.profileService },
{ provide: Angulartics2GoogleAnalytics, useValue: mocks.analyticsService },
],
schemas: [ CUSTOM_ELEMENTS_SCHEMA ]
});
......
......@@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { Router, NavigationEnd } from '@angular/router';
import { Angulartics2GoogleAnalytics } from 'angulartics2/ga';
import { NavigationBarComponent } from './navigation-bar/navigation-bar.component';
import { ProfileService } from './services/profile.service';
import { Profile } from './models/profile';
......@@ -12,7 +13,7 @@ import * as _ from 'lodash';
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
providers: [ProfileService],
providers: [ProfileService, Angulartics2GoogleAnalytics],
})
export class AppComponent implements OnInit {
......@@ -21,8 +22,9 @@ export class AppComponent implements OnInit {
isMenuCollapsed: boolean = false;
alreadeyCollapsed: boolean = false;
constructor(private _state: GlobalState, private translate: TranslateService,
private profileService: ProfileService, private router: Router) {
constructor(private _state: GlobalState, private translate: TranslateService,
private profileService: ProfileService, private router: Router,
public angulartics2GoogleAnalytics: Angulartics2GoogleAnalytics) {
translate.setDefaultLang('pt');
translate.use('pt');
......@@ -59,8 +61,8 @@ export class AppComponent implements OnInit {
hideNavigationBar(e, isCollapsed){
if(window.innerWidth > NavigationBarComponent.MAX_SIZE_FOR_AUTOMATIC_TOGGLE)
return false
return false
if(this.alreadeyCollapsed && isCollapsed){
this.isMenuCollapsed = !this.isMenuCollapsed;
......
......@@ -23,6 +23,10 @@ import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
// ngx-facebook
import { FacebookModule } from 'ngx-facebook';
// angulartics2
import { Angulartics2Module } from 'angulartics2';
import { Angulartics2GoogleAnalytics } from 'angulartics2/ga';
// Application Modules
import { CommentsReportModule } from './comments_report/comments-report.module';
import { SharedModule } from './shared/shared.module';
......@@ -95,11 +99,12 @@ export function HttpLoaderFactory(http: HttpClient) {
NgPipesModule,
ToastrModule.forRoot(),
FacebookModule.forRoot(),
Ng2Webstorage.forRoot({ prefix: 'empurrandojuntos', caseSensitive: true }) ,
Ng2Webstorage.forRoot({ prefix: 'empurrandojuntos', caseSensitive: true }) ,
NgbModule.forRoot(),
RouterModule.forRoot(rootRouterConfig, { useHash: true }),
HttpModule,
ShareButtonsModule.forRoot(),
Angulartics2Module.forRoot([Angulartics2GoogleAnalytics]),
],
providers: [GlobalState,
AuthService,
......
......@@ -5,6 +5,17 @@
<title>Brasil que o Povo Quer!</title>
<base href="/">
<!-- Google Analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-104880284-1', 'auto');
</script>
<!-- End Google Analytics -->
<!-- Include the Facebook script tag to be user with ngx-facebook -->
<script type="text/javascript" src="//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.10"></script>
......
......@@ -37,7 +37,7 @@ export function getMocks() {
close: () => {
return "";
},
},
},
authService: {
signIn: () => {
return {};
......@@ -85,6 +85,12 @@ export function getMocks() {
next: (param: any) => { }
},
},
analyticsService: {
settings: {
pageTracking: {}
},
eventTrack: () => {}
},
globalState: {
subscribe: () => Observable.of({}),
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment