Permalink
Browse files

Merge pull request bitpay#8623 from gabrielbazan7/fix/general

FIX: general string fixes and search box fix
  • Loading branch information...
cmgustavo committed May 11, 2018
2 parents 3d947d7 + 0fc616a commit 8c174880d544038ff90529bda30cdd2025c22354
@@ -1,4 +1,5 @@
import { Component } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { NavController, NavParams, ViewController } from 'ionic-angular';
import { Logger } from '../../../providers/logger/logger';
@@ -10,6 +11,7 @@ import { AppProvider } from '../../../providers/app/app';
import { ConfigProvider } from '../../../providers/config/config';
import { PersistenceProvider } from '../../../providers/persistence/persistence';
import { PlatformProvider } from '../../../providers/platform/platform';
import { ReplaceParametersProvider } from '../../../providers/replace-parameters/replace-parameters';
// pages
import { HomePage } from '../../home/home';
@@ -45,14 +47,16 @@ export class FeedbackCompletePage {
private persistenceProvider: PersistenceProvider,
private socialSharing: SocialSharing,
private appProvider: AppProvider,
private configProvider: ConfigProvider
private configProvider: ConfigProvider,
private replaceParametersProvider: ReplaceParametersProvider,
private translate: TranslateService
) {
this.score = this.navParams.data.score;
this.skipped = this.navParams.data.skipped;
this.rated = this.navParams.data.rated;
this.fromSettings = this.navParams.data.fromSettings;
this.isCordova = this.platformProvider.isCordova;
this.title = "Share " + this.appProvider.info.nameCase;
this.title = this.replaceParametersProvider.replace(this.translate.instant("Share {{appName}}"), { appName: this.appProvider.info.nameCase });
let defaults = this.configProvider.getDefaults();
this.downloadUrl = this.appProvider.info.name == 'copay' ? defaults.download.copay.url : defaults.download.bitpay.url;
if (!this.fromSettings) {
@@ -1,7 +1,7 @@
<div class="card" *ngIf="isShowRateCard">
<ion-item-divider>
<div class="title" item-start>
<span translate>How do you like {{appName}}?</span>
<span>{{ feedbackCardTitle }}</span>
</div>
<div item-end>
<button ion-button clear icon-only color="grey" (click)="hideCard()">
@@ -7,6 +7,7 @@ import { Logger } from '../../../providers/logger/logger';
import { AppProvider } from '../../../providers/app/app';
import { PersistenceProvider } from '../../../providers/persistence/persistence';
import { PlatformProvider } from '../../../providers/platform/platform';
import { ReplaceParametersProvider } from "../../../providers/replace-parameters/replace-parameters";
// pages
import { FeedbackPage } from '../../../pages/feedback/feedback/feedback';
@@ -18,9 +19,9 @@ import { SendFeedbackPage } from '../../../pages/feedback/send-feedback/send-fee
})
export class FeedbackCardPage {
public appName: string;
public score: number;
public button_title: string;
public feedbackCardTitle: string;
private isShowRateCard: boolean = false;
private isCordova: boolean;
@@ -32,11 +33,13 @@ export class FeedbackCardPage {
private persistenceProvider: PersistenceProvider,
private events: Events,
private translate: TranslateService,
private platformProvider: PlatformProvider
private platformProvider: PlatformProvider,
private replaceParametersProvider: ReplaceParametersProvider
) {
this.appName = this.appProvider.info.nameCase;
this.score = 0;
this.isCordova = this.platformProvider.isCordova;
let appName = this.appProvider.info.nameCase;
this.feedbackCardTitle = this.replaceParametersProvider.replace(this.translate.instant('How do you like {{appName}}?'), { appName });
}
public setShowRateCard(value) {
@@ -10,6 +10,7 @@ import { TermsOfUsePage } from './terms-of-use/terms-of-use';
// providers
import { AppProvider } from '../../../providers/app/app';
import { ExternalLinkProvider } from '../../../providers/external-link/external-link';
import { ReplaceParametersProvider } from '../../../providers/replace-parameters/replace-parameters';
@Component({
selector: 'page-about',
@@ -22,25 +23,26 @@ export class AboutPage {
constructor(
private navCtrl: NavController,
private app: AppProvider,
private appProvider: AppProvider,
private logger: Logger,
private externalLinkProvider: ExternalLinkProvider,
private replaceParametersProvider: ReplaceParametersProvider,
private translate: TranslateService
) { }
ionViewDidLoad() {
this.logger.debug('ionViewDidLoad AboutPage');
this.commitHash = this.app.info.commitHash;
this.version = this.app.info.version;
this.title = 'About' + ' ' + this.app.info.nameCase;
this.commitHash = this.appProvider.info.commitHash;
this.version = this.appProvider.info.version;
this.title = this.replaceParametersProvider.replace(this.translate.instant("About {{appName}}"), { appName: this.appProvider.info.nameCase });
}
public openTermsOfUse(): void {
this.navCtrl.push(TermsOfUsePage);
}
public openExternalLink(): void {
let url = 'https://github.com/bitpay/' + this.app.info.gitHubRepoName + '/tree/' + this.app.info.commitHash + '';
let url = 'https://github.com/bitpay/' + this.appProvider.info.gitHubRepoName + '/tree/' + this.appProvider.info.commitHash + '';
let optIn = true;
let title = this.translate.instant('Open GitHub Project');
let message = this.translate.instant('You can see the latest developments and contribute to this open source app by visiting our project on GitHub.');
@@ -11,7 +11,7 @@
<ion-toggle [(ngModel)]="spendUnconfirmed" (ionChange)="spendUnconfirmedChange()"></ion-toggle>
</ion-item>
<ion-item-divider text-wrap>
<span translate>If enabled, wallets will also try to spend unconfirmed funds. This option may cause transaction delays.</span>
<span translate>If enabled, wallets will also try to spend unconfirmed funds.</span>
</ion-item-divider>
<ion-item>
<ion-label>{{'Use Bitcoin Cash Copay Style Addresses' | translate}}</ion-label>
@@ -30,4 +30,4 @@
</span>
</ion-item-divider>
</ion-list>
</ion-content>
</ion-content>
@@ -41,7 +41,7 @@
<ion-icon item-start>
<img src="assets/img/settings-icons/icon-notifications.svg" width="22">
</ion-icon>
<span translate>Notification</span>
<span translate>Notifications</span>
</button>
<button ion-item (click)="openLanguagePage()">
@@ -12,7 +12,7 @@
<ion-input type="text" formControlName="bwsurl" [value]="walletServiceForm.value.bwsurl" required></ion-input>
</ion-item>
<ion-item-divider text-wrap>
<span translate>{{appName}} depends on Bitcore Wallet Service (BWS) for blockchain information, networking and Copayer synchronization. The default configuration points to https://bws.bitpay.com (BitPay's public BWS instance).</span>
<span>{{comment}}</span>
<a (click)="resetDefaultUrl()" translate>
Use default url
</a>
@@ -22,4 +22,4 @@
</button>
</form>
</ion-list>
</ion-content>
</ion-content>
@@ -1,5 +1,6 @@
import { Component } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { TranslateService } from '@ngx-translate/core';
import { Events, NavController, NavParams } from 'ionic-angular';
import { Logger } from '../../../../../providers/logger/logger';
@@ -12,6 +13,7 @@ import { ConfigProvider } from '../../../../../providers/config/config';
import { PersistenceProvider } from '../../../../../providers/persistence/persistence';
import { PlatformProvider } from '../../../../../providers/platform/platform';
import { ProfileProvider } from '../../../../../providers/profile/profile';
import { ReplaceParametersProvider } from '../../../../../providers/replace-parameters/replace-parameters';
@Component({
selector: 'page-wallet-service-url',
@@ -21,7 +23,7 @@ export class WalletServiceUrlPage {
public success: boolean = false;
public wallet: any;
public appName: string;
public comment: string;
public walletServiceForm: FormGroup;
private config: any;
private defaults: any;
@@ -37,7 +39,9 @@ export class WalletServiceUrlPage {
private formBuilder: FormBuilder,
private events: Events,
private splashScreen: SplashScreen,
private platformProvider: PlatformProvider
private platformProvider: PlatformProvider,
private replaceParametersProvider: ReplaceParametersProvider,
private translate: TranslateService
) {
this.walletServiceForm = this.formBuilder.group({
bwsurl: ['', Validators.compose([Validators.minLength(1), Validators.required])]
@@ -52,7 +56,8 @@ export class WalletServiceUrlPage {
this.wallet = this.profileProvider.getWallet(this.navParams.data.walletId);
this.defaults = this.configProvider.getDefaults();
this.config = this.configProvider.get();
this.appName = this.app.info.nameCase;
let appName = this.app.info.nameCase;
this.comment = this.replaceParametersProvider.replace(this.translate.instant("{{appName}} depends on Bitcore Wallet Service (BWS) for blockchain information, networking and Copayer synchronization. The default configuration points to https://bws.bitpay.com (BitPay's public BWS instance)."), { appName });
this.walletServiceForm.value.bwsurl = (this.config.bwsFor && this.config.bwsFor[this.wallet.credentials.walletId]) || this.defaults.bws.url
}
@@ -7,7 +7,7 @@
<page-wallet-item [wallet]="wallet"></page-wallet-item>
<ion-list>
<button ion-item (click)="openWalletInformation()">
<span translate>Wallet information</span>
<span translate>Wallet Information</span>
</button>
<button ion-item (click)="openWalletAddresses()">
<span translate>Wallet Addresses</span>
@@ -17,7 +17,7 @@
<ion-list *ngIf="txHistorySearchResults && txHistorySearchResults[0]" class="tx-history">
<div>
<div *ngFor="let tx of txHistorySearchResults; trackBy: trackByFn; let i = index;">
<button ion-item (click)="goToTxDetails(tx); close()">
<button ion-item (click)="close(tx.txid)">
<ion-icon item-start>
<div *ngIf="tx.confirmations == 0">
<img src="assets/img/tx-action/icon-confirming.svg" width="40">
@@ -41,8 +41,8 @@ export class SearchTxModalPage {
this.wallet = this.navParams.data.wallet;
}
public close(): void {
this.viewCtrl.dismiss();
public close(txid: string): void {
this.viewCtrl.dismiss({ txid });
}
public updateSearchInput(search: string): void {
@@ -120,9 +120,9 @@ export class SearchTxModalPage {
public showHistory(): void {
this.txHistorySearchResults = this.filteredTxHistory
? this.filteredTxHistory.slice(
0,
(this.currentTxHistoryPage + 1) * this.HISTORY_SHOW_LIMIT
)
0,
(this.currentTxHistoryPage + 1) * this.HISTORY_SHOW_LIMIT
)
: [];
this.txHistoryShowMore =
this.filteredTxHistory.length > this.txHistorySearchResults.length;
@@ -135,11 +135,4 @@ export class SearchTxModalPage {
public createdWithinPastDay(time: any): boolean {
return this.timeProvider.withinPastDay(time);
}
public goToTxDetails(tx: any): void {
this.navCtrl.push(TxDetailsPage, {
walletId: this.wallet.credentials.walletId,
txid: tx.txid
});
}
}
@@ -157,7 +157,7 @@ export class WalletDetailsPage {
this.updateTxHistoryError = false;
this.updatingTxHistoryProgress = 0;
let progressFn = function(txs, newTxs) {
let progressFn = function (txs, newTxs) {
if (newTxs > 5) this.thistory = null;
this.updatingTxHistoryProgress = newTxs;
}.bind(this);
@@ -332,5 +332,12 @@ export class WalletDetailsPage {
{ showBackdrop: false, enableBackdropDismiss: true }
);
modal.present();
modal.onDidDismiss((data: any) => {
if (!data || !data.txid) return;
this.navCtrl.push(TxDetailsPage, {
walletId: this.wallet.credentials.walletId,
txid: data.txid
});
});
}
}

0 comments on commit 8c17488

Please sign in to comment.