-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move checkout error messages to a new component
- Loading branch information
1 parent
545412e
commit 1b24d26
Showing
6 changed files
with
78 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/app/checkout/checkout-error-messages/checkout-error-messages.component.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import angular from 'angular' | ||
|
||
import template from './checkout-error-messages.tpl.html' | ||
|
||
const componentName = 'checkoutErrorMessages' | ||
|
||
class CheckoutErrorMessagesController {} | ||
|
||
export default angular | ||
.module(componentName, []) | ||
.component(componentName, { | ||
controller: CheckoutErrorMessagesController, | ||
templateUrl: template, | ||
bindings: { | ||
needinfoErrors: '<', | ||
submissionError: '<', | ||
submissionErrorStatus: '<' | ||
} | ||
}) |
44 changes: 44 additions & 0 deletions
44
src/app/checkout/checkout-error-messages/checkout-error-messages.tpl.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<div class="alert alert-danger" role="alert" ng-if="$ctrl.needinfoErrors || $ctrl.submissionError"> | ||
<p ng-repeat="error in $ctrl.needinfoErrors" ng-switch="error"> | ||
<span ng-switch-when="need.email" translate>{{'REVIEW_EMAIL_ERROR'}}</span> | ||
<span ng-switch-when="need.payment.method" translate>{{'REVIEW_PAYMENT_ERROR'}}</span> | ||
<span ng-switch-when="need.billing.address" translate>{{'REVIEW_BILLING_ADDRESS_ERROR'}}</span> | ||
<span ng-switch-default translate> | ||
<span ng-if="$ctrl.submissionErrorStatus > -1" translate> | ||
{{'REVIEW_MISSING_DATA_ERROR'}} | ||
</span> | ||
<span ng-if="$ctrl.submissionErrorStatus === -1" translate> | ||
{{'REVIEW_TIME_OUT_ERROR'}} | ||
</span> | ||
</span> | ||
</p> | ||
<p ng-if="$ctrl.submissionError" ng-switch="$ctrl.submissionError"> | ||
<span ng-switch-when="Current payment type is unknown" translate> | ||
{{'REVIEW_SUBMITTING_PAYMENT_ERROR'}} | ||
</span> | ||
<span ng-switch-when="CardExpiredException" translate> | ||
{{'REVIEW_CARD_EXPIRED_ERROR'}} | ||
</span> | ||
<span ng-switch-when="CardErrorException" translate> | ||
{{'REVIEW_INVALID_CARD_ERROR'}} | ||
</span> | ||
<span ng-switch-when="CardDeclinedException" translate> | ||
{{'REVIEW_CARD_DECLINED_ERROR'}} | ||
</span> | ||
<span ng-switch-when="InsufficientFundException" translate> | ||
{{'REVIEW_INSUFFICIENT_FUNDS_ERROR'}} | ||
</span> | ||
<span ng-switch-when="AuthorizedAmountExceededException" translate> | ||
{{'REVIEW_EXCEEDS_BALANCE_ERROR'}} | ||
</span> | ||
<span ng-switch-when="InvalidCVV2Exception" translate> | ||
{{'REVIEW_INVALID_SEC_CODE_ERROR'}} | ||
</span> | ||
<span ng-switch-when="InvalidAddressException" translate> | ||
{{'REVIEW_ADDRESS_MISMATCH_ERROR'}} | ||
</span> | ||
<span ng-switch-default translate> | ||
{{'REVIEW_DEFAULT_ERROR'}} | ||
</span> | ||
</p> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters