From c1a1eaf40293eedb32e0876727678dcb372a4a5e Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Fri, 28 Jul 2017 17:42:23 -0300 Subject: [PATCH] Adds page terms of use. Logger module. App bootstrap info --- package.json | 1 + src/app/app.component.ts | 28 ++++++++++++++++-- src/app/app.module.ts | 15 +++++++++- src/assets/appConfig.json | 2 +- src/pages/about/about.html | 2 +- src/pages/about/about.ts | 19 ++++++++---- src/pages/terms-of-use/terms-of-use.html | 37 ++++++++++++++++++++++++ src/pages/terms-of-use/terms-of-use.scss | 3 ++ src/pages/terms-of-use/terms-of-use.ts | 17 +++++++++++ 9 files changed, 112 insertions(+), 12 deletions(-) create mode 100644 src/pages/terms-of-use/terms-of-use.html create mode 100644 src/pages/terms-of-use/terms-of-use.scss create mode 100644 src/pages/terms-of-use/terms-of-use.ts diff --git a/package.json b/package.json index f5876f537..c7c2b706f 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "@ionic-native/splash-screen": "3.12.1", "@ionic-native/status-bar": "3.12.1", "@ionic/storage": "2.0.1", + "@nsalaun/ng-logger": "^2.0.1", "@types/lodash": "^4.14.71", "ionic-angular": "3.5.3", "ionicons": "3.0.0", diff --git a/src/app/app.component.ts b/src/app/app.component.ts index c633d80a9..0e6d8c357 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -3,6 +3,9 @@ import { Platform } from 'ionic-angular'; import { StatusBar } from '@ionic-native/status-bar'; import { SplashScreen } from '@ionic-native/splash-screen'; +import { Logger } from '@nsalaun/ng-logger'; +import { AppService } from '../providers/app-service/app-service'; + import { TabsPage } from '../pages/tabs/tabs'; @Component({ @@ -11,10 +14,29 @@ import { TabsPage } from '../pages/tabs/tabs'; export class Copay { rootPage:any = TabsPage; - constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) { + constructor( + platform: Platform, + statusBar: StatusBar, + splashScreen: SplashScreen, + log: Logger, + appSrv: AppService + ) { platform.ready().then(() => { - statusBar.styleDefault(); - splashScreen.hide(); + appSrv.getName().subscribe((name) => { + log.info('Name: ' + name); + }); + appSrv.getVersion().subscribe((version) => { + log.info('Version: ' + version); + }); + appSrv.getCommitHash().subscribe((commit) => { + log.info('Commit Hash: #' + commit); + }); + log.info('Platform: ' + platform.platforms()); + log.info('Language: ' + platform.lang()); + if (platform.is('cordova')) { + statusBar.styleDefault(); + splashScreen.hide(); + } }); } } diff --git a/src/app/app.module.ts b/src/app/app.module.ts index ecfa3ddd0..32112679b 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,6 +1,9 @@ -import { NgModule, ErrorHandler } from '@angular/core'; +import { NgModule, ErrorHandler, isDevMode } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { HttpModule } from '@angular/http'; + +import { NgLoggerModule, Level } from '@nsalaun/ng-logger'; + import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular'; import { Copay } from './app.component'; @@ -11,6 +14,7 @@ import { SettingPage } from '../pages/setting/setting'; import { TabsPage } from '../pages/tabs/tabs'; import { AboutPage } from '../pages/about/about'; +import { TermsOfUsePage } from '../pages/terms-of-use/terms-of-use'; import { StatusBar } from '@ionic-native/status-bar'; import { SplashScreen } from '@ionic-native/splash-screen'; @@ -19,6 +23,12 @@ import { WalletService } from '../providers/wallet-service/wallet-service'; import { StorageService } from '../providers/storage-service/storage-service'; import { AppService } from '../providers/app-service/app-service'; +// Set different log level depending on environment. +const LOG_LEVEL = Level.LOG; +if (isDevMode()){ + const LOG_LEVEL = Level.ERROR; +} + @NgModule({ declarations: [ Copay, @@ -27,11 +37,13 @@ import { AppService } from '../providers/app-service/app-service'; SendPage, SettingPage, AboutPage, + TermsOfUsePage, TabsPage ], imports: [ BrowserModule, HttpModule, + NgLoggerModule.forRoot(LOG_LEVEL), IonicModule.forRoot(Copay) ], bootstrap: [IonicApp], @@ -42,6 +54,7 @@ import { AppService } from '../providers/app-service/app-service'; SendPage, SettingPage, AboutPage, + TermsOfUsePage, TabsPage ], providers: [ diff --git a/src/assets/appConfig.json b/src/assets/appConfig.json index 3449597da..8b19a10fe 100644 --- a/src/assets/appConfig.json +++ b/src/assets/appConfig.json @@ -25,7 +25,7 @@ "description": "A Secure Bitcoin Wallet", "version": "3.7.1", "androidVersion": "371000", - "commitHash": "abcd1234", + "commitHash": "222222", "_extraCSS": null, "_enabledExtensions": { "coinbase": true, diff --git a/src/pages/about/about.html b/src/pages/about/about.html index 507cf002b..11f6a3660 100644 --- a/src/pages/about/about.html +++ b/src/pages/about/about.html @@ -26,7 +26,7 @@   - + Terms of use diff --git a/src/pages/about/about.ts b/src/pages/about/about.ts index c25510fcd..edeb17b0d 100644 --- a/src/pages/about/about.ts +++ b/src/pages/about/about.ts @@ -1,6 +1,10 @@ import { Component } from '@angular/core'; import { NavController, NavParams } from 'ionic-angular'; +import { Logger } from '@nsalaun/ng-logger'; + +import { TermsOfUsePage } from '../terms-of-use/terms-of-use'; + import { AppService } from '../../providers/app-service/app-service'; @Component({ @@ -14,19 +18,22 @@ export class AboutPage { constructor( public navCtrl: NavController, public navParams: NavParams, - private appSrv: AppService - ) { + private appSrv: AppService, + private log: Logger + ) {} - appSrv.getCommitHash().subscribe((data) => { + ionViewDidLoad() { + this.log.log('ionViewDidLoad AboutPage'); + this.appSrv.getCommitHash().subscribe((data) => { this.commitHash = data; }); - appSrv.getVersion().subscribe((data) => { + this.appSrv.getVersion().subscribe((data) => { this.version = data; }); } - ionViewDidLoad() { - console.log('ionViewDidLoad AboutPage'); + openTermsOfUse() { + this.navCtrl.push(TermsOfUsePage); } } diff --git a/src/pages/terms-of-use/terms-of-use.html b/src/pages/terms-of-use/terms-of-use.html new file mode 100644 index 000000000..0d32bbbde --- /dev/null +++ b/src/pages/terms-of-use/terms-of-use.html @@ -0,0 +1,37 @@ + + + + Terms of use + + + + + + + +

+ This is a binding Agreement between BitPay, Inc. (“BitPay” or “We”) and the person, persons, or entity (“You” or “Your”) using the service, Software, or application (“Software”). +

+

+ RIGHTS AND OBLIGATIONS +

+

+ BitPay provides the Software solely on the terms and conditions set forth in this Agreement and on the condition that You accept and comply with them. By using the Software You (a) accept this Agreement and agree that You are legally bound by its terms; and (b) represent and warrant that: (i) You are of legal age to enter into a binding agreement; and (ii) if You are a corporation, governmental organization or other legal entity, You have the right, power and authority to enter into this Agreement on behalf of the corporation, governmental organization or other legal entity and bind them to these terms. +

+

+ This Software functions as a free, open source, and multi-signature digital wallet. The Software does not constitute an account where We or other third parties serve as financial intermediaries or custodians of Your bitcoin(s). +

+

+ While the Software has undergone beta testing and continues to be improved by feedback from the open-source user and developer community, We cannot guarantee there will not be bugs in the Software. You acknowledge that Your use of this Software is at Your own discretion and in compliance with all applicable laws. You are responsible for safekeeping Your passwords, private key pairs, PINs, and any other codes You use to access the Software. +

+

+ IF YOU LOSE ACCESS TO YOUR BITCOIN WALLET OR YOUR ENCRYPTED PRIVATE KEYS AND YOU HAVE NOT SEPARATELY STORED A BACKUP OF YOUR WALLET AND CORRESPONDING PASSWORD, YOU ACKNOWLEDGE AND AGREE THAT ANY BITCOIN YOU HAVE ASSOCIATED WITH THAT WALLET WILL BECOME INACCESSIBLE. All transaction requests are irreversible. The authors of the Software, employees and affiliates of BitPay, copyright holders, and BitPay, Inc. cannot retrieve Your private keys or passwords if You lose or forget them and cannot guarantee transaction confirmation as they do not have control over the bitcoin network. +

+

+ DISCLAIMER +

+

+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OF THE SOFTWARE, EMPLOYEES AND AFFILIATES OF BITPAY, COPYRIGHT HOLDERS, OR BITPAY, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +

+ +
diff --git a/src/pages/terms-of-use/terms-of-use.scss b/src/pages/terms-of-use/terms-of-use.scss new file mode 100644 index 000000000..feb78fa44 --- /dev/null +++ b/src/pages/terms-of-use/terms-of-use.scss @@ -0,0 +1,3 @@ +page-terms-of-use { + +} diff --git a/src/pages/terms-of-use/terms-of-use.ts b/src/pages/terms-of-use/terms-of-use.ts new file mode 100644 index 000000000..20e1e600a --- /dev/null +++ b/src/pages/terms-of-use/terms-of-use.ts @@ -0,0 +1,17 @@ +import { Component } from '@angular/core'; +import { NavController, NavParams } from 'ionic-angular'; + +@Component({ + selector: 'page-terms-of-use', + templateUrl: 'terms-of-use.html', +}) +export class TermsOfUsePage { + + constructor(public navCtrl: NavController, public navParams: NavParams) { + } + + ionViewDidLoad() { + console.log('ionViewDidLoad TermsOfUsePage'); + } + +}