Merge pull request #8063 from Gamboster/fix/successModal

Fix: success modal, amazon failure message and txp details
This commit is contained in:
Gustavo Maximiliano Cortez 2018-02-16 18:26:11 -03:00 committed by GitHub
commit 491d49b31d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 46 additions and 18 deletions

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 13.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 14948) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="100px" height="100px" viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve">
<path fill="#9B9BAB" d="M50,0C22.41,0,0,22.409,0,50s22.41,50,50,50c27.59,0,50-22.409,50-50S77.59,0,50,0z M50,4
c25.429,0,46,20.571,46,46S75.429,96,50,96S4,75.429,4,50S24.571,4,50,4z M47.562,25.812c-0.43,0-0.688,0.257-0.688,0.688v5.25
c0,0.43,0.255,0.75,0.688,0.75h4.875c0.428,0,0.688-0.32,0.688-0.75V26.5c0-0.43-0.258-0.688-0.688-0.688H47.562z M47.438,40.25
C47.176,40.351,47,40.615,47,40.938v32.938c0,0.43,0.257,0.688,0.688,0.688h4.625c0.43,0,0.688-0.256,0.688-0.688V40.938
c0-0.43-0.256-0.688-0.688-0.688h-4.625C47.581,40.25,47.525,40.216,47.438,40.25z"/>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -311,7 +311,7 @@ export class BuyAmazonPage {
this.openSuccessModal();
});
});
}, 8000, {
}, 15000, {
'leading': true
});
@ -414,11 +414,14 @@ export class BuyAmazonPage {
public openSuccessModal(): void {
let successComment: string;
let cssClass: string;
if (this.amazonGiftCard.status == 'FAILURE') {
successComment = 'Bitcoin purchase completed. Coinbase has queued the transfer to your selected wallet';
successComment = 'Your purchase could not be completed';
cssClass = 'danger';
}
if (this.amazonGiftCard.status == 'PENDING') {
successComment = 'Your purchase was added to the list of pending'
successComment = 'Your purchase was added to the list of pending';
cssClass = 'warning';
}
if (this.amazonGiftCard.status == 'SUCCESS') {
successComment = 'Bought ' + this.amountUnitStr;
@ -427,7 +430,7 @@ export class BuyAmazonPage {
successComment = 'Gift card generated and ready to use.';
}
let successText = '';
let modal = this.modalCtrl.create(SuccessModalPage, { successText: successText, successComment: successComment }, { showBackdrop: true, enableBackdropDismiss: false });
let modal = this.modalCtrl.create(SuccessModalPage, { successText: successText, successComment: successComment, cssClass: cssClass }, { showBackdrop: true, enableBackdropDismiss: false });
modal.present();
modal.onDidDismiss(() => {
this.navCtrl.remove(2, 2);

View File

@ -91,7 +91,8 @@ export class BuyMercadoLibrePage {
this.wallets = this.profileProvider.getWallets({
onlyComplete: true,
network: this.network,
coin: this.coin
coin: this.coin,
m: 1
});
if (_.isEmpty(this.wallets)) {
this.showErrorAndBack(null, this.translate.instant('No wallets available'));
@ -301,7 +302,7 @@ export class BuyMercadoLibrePage {
this.openSuccessModal();
});
});
}, 8000, {
}, 15000, {
'leading': true
});
@ -316,7 +317,6 @@ export class BuyMercadoLibrePage {
uuid: wallet.id,
email: email
};
console.log('[buy-mercado-libre.ts:313]',dataSrc); /* TODO */
this.onGoingProcessProvider.set('loadingTxInfo', true);
this.createInvoice(dataSrc).then((data: any) => {
let invoice = data.invoice;
@ -402,17 +402,20 @@ export class BuyMercadoLibrePage {
public openSuccessModal(): void {
let successComment: string;
let cssClass: string;
if (this.mlGiftCard.status == 'FAILURE') {
successComment = 'Sua compra não pôde ser concluída';
cssClass = 'danger';
}
if (this.mlGiftCard.status == 'PENDING') {
successComment = 'Sua compra foi adicionada à lista de pendentes';
cssClass = 'warning';
}
if (this.mlGiftCard.status == 'SUCCESS' || this.mlGiftCard.cardStatus == 'active') {
successComment = 'Vale-Presente gerado e pronto para usar';
}
let successText = '';
let modal = this.modalCtrl.create(SuccessModalPage, { successText: successText, successComment: successComment }, { showBackdrop: true, enableBackdropDismiss: false });
let modal = this.modalCtrl.create(SuccessModalPage, { successText: successText, successComment: successComment, cssClass: cssClass }, { showBackdrop: true, enableBackdropDismiss: false });
modal.present();
modal.onDidDismiss(() => {
this.navCtrl.remove(2, 2);

View File

@ -1,11 +1,12 @@
<div class="container">
<div class="content">
<div class="success">
<img class="success-img" src="assets/img/onboarding-success.svg">
<div class="success-text">
<div class="content" [ngClass]="{'success': cssClass == 'success', 'warning': cssClass == 'warning', 'danger': cssClass == 'danger'}">
<div class="body">
<img class="body-img" *ngIf="cssClass == 'success'" src="assets/img/onboarding-success.svg">
<img class="body-img" *ngIf="cssClass != 'success'" src="assets/img/icon-important.svg">
<div class="body-text">
{{successText}}
</div>
<div class="success-comment">
<div class="body-comment">
{{successComment}}
</div>
</div>

View File

@ -1,6 +1,5 @@
page-success{
.container {
background-color: #11D1A6;
height: 100%;
position: relative;
.content {
@ -8,7 +7,7 @@ page-success{
display: flex;
justify-content: center;
align-items: center;
.success {
.body {
margin-top: -20vh;
text-align: center;
&-img {
@ -41,4 +40,13 @@ page-success{
cursor: pointer;
}
}
.success {
background-color: #11D1A6;
}
.warning {
background-color: color($colors, warning);
}
.danger {
background-color: color($colors, danger);
}
}

View File

@ -10,14 +10,16 @@ export class SuccessModalPage {
public successText: string;
public successComment: string;
public cssClass: string; // success, warning, danger
constructor(
private viewCtrl: ViewController,
private navParams: NavParams,
private translate: TranslateService
) {
this.successText = this.navParams.data.successText ? this.navParams.data.successText : this.translate.instant('Payment Sent');
this.successText = (this.navParams.data.successText || this.navParams.data.successText == '') ? this.navParams.data.successText : this.translate.instant('Payment Sent');
this.successComment = this.navParams.data.successComment ? this.navParams.data.successComment : '';
this.cssClass = this.navParams.data.cssClass ? this.navParams.data.cssClass : 'success';
}
public close(): void {

View File

@ -171,7 +171,7 @@
<ion-label>
{{'Merchant Message'|translate}}
</ion-label>
<ion-note item-end>
<ion-note *ngIf="tx.paypro.pr && tx.paypro.pr.pd" item-end>
{{tx.paypro.pr.pd.memo}}
</ion-note>
</ion-item>