Skip to content

Commit

Permalink
web-ui: Upgrade angular to 7.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexITC committed Jan 18, 2019
1 parent 9100fc6 commit efea7d0
Show file tree
Hide file tree
Showing 15 changed files with 2,303 additions and 2,058 deletions.
3,213 changes: 1,394 additions & 1,819 deletions web-ui/package-lock.json

Large diffs are not rendered by default.

31 changes: 16 additions & 15 deletions web-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,34 @@
},
"private": true,
"dependencies": {
"@angular/animations": "^6.1.0",
"@angular/common": "^6.1.0",
"@angular/compiler": "^6.1.0",
"@angular/core": "^6.1.0",
"@angular/forms": "^6.1.0",
"@angular/http": "^6.1.0",
"@angular/platform-browser": "^6.1.0",
"@angular/platform-browser-dynamic": "^6.1.0",
"@angular/router": "^6.1.0",
"@angular/animations": "^7.2.1",
"@angular/common": "^7.2.1",
"@angular/compiler": "^7.2.1",
"@angular/core": "^7.2.1",
"@angular/forms": "^7.2.1",
"@angular/http": "^7.2.1",
"@angular/platform-browser": "^7.2.1",
"@angular/platform-browser-dynamic": "^7.2.1",
"@angular/router": "^7.2.1",
"@ngx-translate/core": "^10.0.2",
"bootstrap": "^3.3.7",
"core-js": "^2.5.4",
"moment": "^2.22.2",
"ng-http-loader": "^3.1.2",
"ng-http-loader": "^5.0.0",
"ngx-bootstrap": "^3.0.1",
"ngx-infinite-scroll": "^7.0.1",
"ngx-moment": "^3.0.1",
"ngx-pagination": "^3.2.1",
"ngx-toastr": "^9.1.0",
"rxjs": "~6.2.0",
"rxjs": "~6.3.3",
"rxjs-compat": "^6.3.3",
"zone.js": "~0.8.26"
"zone.js": "~0.8.28"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.8.0",
"@angular/cli": "^7.2.2",
"@angular/compiler-cli": "^6.1.0",
"@angular/language-service": "^6.1.0",
"@angular/compiler-cli": "^7.2.1",
"@angular/language-service": "^7.2.1",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
Expand All @@ -55,6 +55,7 @@
"protractor": "^5.4.1",
"ts-node": "~3.2.0",
"tslint": "~5.11.0",
"typescript": "~2.9.2"
"typescript": "~3.2.4",
"webpack": "4.24.0"
}
}
8 changes: 5 additions & 3 deletions web-ui/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@

import {distinctUntilChanged} from 'rxjs/operators';
import { Component, OnInit } from '@angular/core';

import { Router, NavigationEnd } from '@angular/router';

import 'rxjs/add/operator/distinctUntilChanged';


import { TranslateService } from '@ngx-translate/core';

Expand Down Expand Up @@ -31,14 +33,14 @@ export class AppComponent implements OnInit {

ngOnInit() {
// integrate google analytics via gtag - based on https://stackoverflow.com/a/47658214/3211175
this.router.events.distinctUntilChanged((previous: any, current: any) => {
this.router.events.pipe(distinctUntilChanged((previous: any, current: any) => {
// Subscribe to any `NavigationEnd` events where the url has changed
if (current instanceof NavigationEnd) {
return previous.url === current.url;
}

return true;
}).subscribe((x: any) => {
})).subscribe((x: any) => {
const dirtyUrl: string = x.url || '';
const url = this.removeQueryParams(dirtyUrl);
(<any>window).gtag('config', environment.gtag.id, { 'page_path': url });
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

import {tap} from 'rxjs/operators';
import { Component, OnInit, HostListener } from '@angular/core';
import { ActivatedRoute } from '@angular/router';

Expand Down Expand Up @@ -50,8 +52,8 @@ export class AddressDetailsComponent implements OnInit {
}

this.addressesService
.getTransactionsV2(this.addressString, this.limit, lastSeenTxid, order)
.do(response => this.items.push(...response.data))
.getTransactionsV2(this.addressString, this.limit, lastSeenTxid, order).pipe(
tap(response => this.items.push(...response.data)))
.subscribe();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

import {tap} from 'rxjs/operators';
import { Component, OnInit, HostListener } from '@angular/core';
import { ActivatedRoute } from '@angular/router';

Expand Down Expand Up @@ -62,8 +64,8 @@ export class BlockDetailsComponent implements OnInit {
}

this.blocksService
.getTransactionsV2(this.blockhash, this.limit, lastSeenTxid)
.do(response => this.transactions.push(...response.data))
.getTransactionsV2(this.blockhash, this.limit, lastSeenTxid).pipe(
tap(response => this.transactions.push(...response.data)))
.subscribe();
}

Expand Down
25 changes: 10 additions & 15 deletions web-ui/src/app/components/latest-blocks/latest-blocks.component.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@

import {tap, merge, switchMap} from 'rxjs/operators';
import { Component, OnInit, OnDestroy } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';

import { Subscription } from 'rxjs/Subscription';
import { Subject } from 'rxjs/Subject';

import 'rxjs/add/operator/do';
import 'rxjs/add/operator/merge';
import 'rxjs/add/operator/switchMap';

import { of } from 'rxjs';
import { Subscription , Subject , of } from 'rxjs';

import { Block } from '../../models/block';

Expand Down Expand Up @@ -52,14 +47,14 @@ export class LatestBlocksComponent implements OnInit, OnDestroy {
const interval = 50000;

// polling based on https://stackoverflow.com/a/42659054/3211175
this.subscription$ = of(null)
.merge(polling$)
.switchMap(_ =>
this.blocksService.getLatest()
.do(_ => {
this.subscription$ = of(null).pipe(
merge(polling$),
switchMap(_ =>
this.blocksService.getLatest().pipe(
tap(_ => {
setTimeout(_ => polling$.next(null), interval);
})
)
}))
),)
.subscribe(
response => this.onBlockRetrieved(response),
response => this.onError(response)
Expand Down
16 changes: 9 additions & 7 deletions web-ui/src/app/components/masternodes/masternodes.component.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@

import {map, tap} from 'rxjs/operators';
import { Component, OnInit } from '@angular/core';

import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';



import 'rxjs/add/operator/do';
import 'rxjs/add/operator/map';

import { Masternode } from '../../models/masternode';

Expand Down Expand Up @@ -38,9 +40,9 @@ export class MasternodesComponent implements OnInit {
const limit = this.pageSize;

this.asyncItems = this.masternodesService
.get(offset, limit, 'activeSeconds:desc')
.do(response => this.total = response.total)
.do(response => this.currentPage = 1 + (response.offset / this.pageSize))
.map(response => response.data);
.get(offset, limit, 'activeSeconds:desc').pipe(
tap(response => this.total = response.total),
tap(response => this.currentPage = 1 + (response.offset / this.pageSize)),
map(response => response.data),);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@

import {tap} from 'rxjs/operators';
import { Component, OnInit, OnDestroy, HostListener } from '@angular/core';

import 'rxjs/add/operator/do';
import 'rxjs/add/operator/map';



import { Balance } from '../../models/balance';

Expand Down Expand Up @@ -43,8 +45,8 @@ export class RichestAddressesComponent implements OnInit {
}

this.balancesService
.getHighest(this.limit, lastSeenAddress)
.do(response => this.items.push(...response.data))
.getHighest(this.limit, lastSeenAddress).pipe(
tap(response => this.items.push(...response.data)))
.subscribe();
}

Expand Down
2 changes: 1 addition & 1 deletion web-ui/src/app/services/addresses.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';

import { environment } from '../../environments/environment';

Expand Down
2 changes: 1 addition & 1 deletion web-ui/src/app/services/balances.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';

import { environment } from '../../environments/environment';

Expand Down
2 changes: 1 addition & 1 deletion web-ui/src/app/services/blocks.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';

import { environment } from '../../environments/environment';

Expand Down
2 changes: 1 addition & 1 deletion web-ui/src/app/services/masternodes.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';

import { environment } from '../../environments/environment';

Expand Down
2 changes: 1 addition & 1 deletion web-ui/src/app/services/ticker.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';

import { environment } from '../../environments/environment';

Expand Down
2 changes: 1 addition & 1 deletion web-ui/src/app/services/transactions.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';

import { environment } from '../../environments/environment';

Expand Down
Loading

0 comments on commit efea7d0

Please sign in to comment.