Adds page terms of use. Logger module. App bootstrap info

This commit is contained in:
Gustavo Maximiliano Cortez 2017-07-28 17:42:23 -03:00
parent 28af6a7136
commit c1a1eaf402
No known key found for this signature in database
GPG Key ID: 15EDAD8D9F2EB1AF
9 changed files with 112 additions and 12 deletions

View File

@ -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",

View File

@ -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();
}
});
}
}

View File

@ -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: [

View File

@ -25,7 +25,7 @@
"description": "A Secure Bitcoin Wallet",
"version": "3.7.1",
"androidVersion": "371000",
"commitHash": "abcd1234",
"commitHash": "222222",
"_extraCSS": null,
"_enabledExtensions": {
"coinbase": true,

View File

@ -26,7 +26,7 @@
</ion-note>
</ion-item>
<ion-item-divider color="light">&nbsp;</ion-item-divider>
<ion-item>
<ion-item (click)="openTermsOfUse()">
<ion-icon name="people" item-start></ion-icon>
Terms of use
</ion-item>

View File

@ -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);
}
}

View File

@ -0,0 +1,37 @@
<ion-header>
<ion-navbar>
<ion-title>Terms of use</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>
<p>
This is a binding Agreement between BitPay, Inc. (&ldquo;BitPay&rdquo; or &ldquo;We&rdquo;) and the person, persons, or entity (&ldquo;You&rdquo; or &ldquo;Your&rdquo;) using the service, Software, or application (&ldquo;Software&rdquo;).
</p>
<p class="terms__heading">
RIGHTS AND OBLIGATIONS
</p>
<p>
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.
</p>
<p>
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).
</p>
<p>
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.
</p>
<p>
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.
</p>
<p class="terms__heading">
DISCLAIMER
</p>
<p>
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.
</p>
</ion-content>

View File

@ -0,0 +1,3 @@
page-terms-of-use {
}

View File

@ -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');
}
}