mirror of
https://github.com/bitwarden/web
synced 2025-12-15 15:53:18 +00:00
sca card failure warning
This commit is contained in:
@@ -6,6 +6,11 @@ import {
|
|||||||
ViewChild,
|
ViewChild,
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
|
import {
|
||||||
|
ActivatedRoute,
|
||||||
|
Router,
|
||||||
|
} from '@angular/router';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
import { Angulartics2 } from 'angulartics2';
|
||||||
|
|
||||||
@@ -34,7 +39,8 @@ export class AdjustSeatsComponent {
|
|||||||
formPromise: Promise<any>;
|
formPromise: Promise<any>;
|
||||||
|
|
||||||
constructor(private apiService: ApiService, private i18nService: I18nService,
|
constructor(private apiService: ApiService, private i18nService: I18nService,
|
||||||
private analytics: Angulartics2, private toasterService: ToasterService) { }
|
private analytics: Angulartics2, private toasterService: ToasterService,
|
||||||
|
private router: Router, private activatedRoute: ActivatedRoute) { }
|
||||||
|
|
||||||
async submit() {
|
async submit() {
|
||||||
try {
|
try {
|
||||||
@@ -60,7 +66,12 @@ export class AdjustSeatsComponent {
|
|||||||
this.analytics.eventTrack.next({ action: this.add ? 'Added Seats' : 'Removed Seats' });
|
this.analytics.eventTrack.next({ action: this.add ? 'Added Seats' : 'Removed Seats' });
|
||||||
this.onAdjusted.emit(this.seatAdjustment);
|
this.onAdjusted.emit(this.seatAdjustment);
|
||||||
if (paymentFailed) {
|
if (paymentFailed) {
|
||||||
// TODO: Go to billing page
|
this.toasterService.popAsync({
|
||||||
|
body: this.i18nService.t('couldNotChargeCardPayInvoice'),
|
||||||
|
type: 'warning',
|
||||||
|
timeout: 10000,
|
||||||
|
});
|
||||||
|
this.router.navigate(['../billing'], { relativeTo: this.activatedRoute });
|
||||||
} else {
|
} else {
|
||||||
this.toasterService.popAsync('success', null,
|
this.toasterService.popAsync('success', null,
|
||||||
this.i18nService.t('adjustedSeats', request.seatAdjustment.toString()));
|
this.i18nService.t('adjustedSeats', request.seatAdjustment.toString()));
|
||||||
|
|||||||
@@ -6,6 +6,11 @@ import {
|
|||||||
ViewChild,
|
ViewChild,
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
|
import {
|
||||||
|
ActivatedRoute,
|
||||||
|
Router,
|
||||||
|
} from '@angular/router';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
import { Angulartics2 } from 'angulartics2';
|
||||||
|
|
||||||
@@ -36,7 +41,8 @@ export class AdjustStorageComponent {
|
|||||||
formPromise: Promise<any>;
|
formPromise: Promise<any>;
|
||||||
|
|
||||||
constructor(private apiService: ApiService, private i18nService: I18nService,
|
constructor(private apiService: ApiService, private i18nService: I18nService,
|
||||||
private analytics: Angulartics2, private toasterService: ToasterService) { }
|
private analytics: Angulartics2, private toasterService: ToasterService,
|
||||||
|
private router: Router, private activatedRoute: ActivatedRoute) { }
|
||||||
|
|
||||||
async submit() {
|
async submit() {
|
||||||
try {
|
try {
|
||||||
@@ -68,7 +74,12 @@ export class AdjustStorageComponent {
|
|||||||
this.analytics.eventTrack.next({ action: this.add ? 'Added Storage' : 'Removed Storage' });
|
this.analytics.eventTrack.next({ action: this.add ? 'Added Storage' : 'Removed Storage' });
|
||||||
this.onAdjusted.emit(this.storageAdjustment);
|
this.onAdjusted.emit(this.storageAdjustment);
|
||||||
if (paymentFailed) {
|
if (paymentFailed) {
|
||||||
// TOOD: go to billing page
|
this.toasterService.popAsync({
|
||||||
|
body: this.i18nService.t('couldNotChargeCardPayInvoice'),
|
||||||
|
type: 'warning',
|
||||||
|
timeout: 10000,
|
||||||
|
});
|
||||||
|
this.router.navigate(['../billing'], { relativeTo: this.activatedRoute });
|
||||||
} else {
|
} else {
|
||||||
this.toasterService.popAsync('success', null,
|
this.toasterService.popAsync('success', null,
|
||||||
this.i18nService.t('adjustedStorage', request.storageGbAdjustment.toString()));
|
this.i18nService.t('adjustedStorage', request.storageGbAdjustment.toString()));
|
||||||
|
|||||||
@@ -2926,5 +2926,8 @@
|
|||||||
},
|
},
|
||||||
"selectOneCollection": {
|
"selectOneCollection": {
|
||||||
"message": "You must select at least one collection."
|
"message": "You must select at least one collection."
|
||||||
|
},
|
||||||
|
"couldNotChargeCardPayInvoice": {
|
||||||
|
"message": "We were not able to charge your card. Please view and pay the unpaid invoice listed below."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user