Skip to content

Commit

Permalink
fix: display user friendly error messages for quoting (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian-Haehnlein authored and shauke committed Feb 19, 2020
1 parent b4f7ae9 commit 0c9a943
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ <h1>
{{ 'quote.edit.saved.your_quote_request_has_been_saved.text' | translate: { '0': displayName } }}
</div>

<div *ngIf="error" role="alert" class="alert alert-danger">{{ error.status }}: {{ error.error }}</div>
<ish-error-message [error]="error"></ish-error-message>

<!-- Description -->
<!-- Quote Header ( shown once if quote request submitted ) -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { ServerHtmlDirective } from 'ish-core/directives/server-html.directive';
import { User } from 'ish-core/models/user/user.model';
import { DatePipe } from 'ish-core/pipes/date.pipe';
import { LineItemListComponent } from 'ish-shared/components/basket/line-item-list/line-item-list.component';
import { ErrorMessageComponent } from 'ish-shared/components/common/error-message/error-message.component';
import { LoadingComponent } from 'ish-shared/components/common/loading/loading.component';
import { RecentlyViewedComponent } from 'ish-shared/components/recently/recently-viewed/recently-viewed.component';
import { InputComponent } from 'ish-shared/forms/components/input/input.component';
Expand All @@ -28,6 +29,7 @@ describe('Quote Edit Component', () => {
TestBed.configureTestingModule({
declarations: [
DatePipe,
MockComponent(ErrorMessageComponent),
MockComponent(InputComponent),
MockComponent(LineItemListComponent),
MockComponent(LoadingComponent),
Expand Down
6 changes: 5 additions & 1 deletion src/assets/i18n/de_DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -2666,5 +2666,9 @@
"account.login.register_now": "Sie haben noch kein Benutzerkonto?<br/><a href=\"{{0}}\">Jetzt anmelden</a>",
"account.payment.further_payments.heading": "Weitere gespeicherte Zahlungsmittel",
"account.payment.no_entries": "Derzeit haben Sie keine gespeicherten Zahlungsmittel.",
"account.payment.preferred.link": "Als bevorzugtes Zahlungsmittel speichern"
"account.payment.preferred.link": "Als bevorzugtes Zahlungsmittel speichern",
"basket.add_quotelineitem.error": "Das Preisangebot kann nicht in den Warenkorb gelegt werden. Es enthält ungültige Produkte.",
"quote.already_in_basket.error": "Das Preisangebot befindet sich bereits im Warenkorb.",
"quote.not_found.error": "Das Preisangebot konnte nicht gefunden werden.",
"basket.add_quote.error": "Das Preisangebot konnte nicht in den Warenkorb gelegt werden."
}
6 changes: 5 additions & 1 deletion src/assets/i18n/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -2667,5 +2667,9 @@
"account.login.register_now": "You don't have an account yet?<br/><a href=\"{{0}}\">Register now</a>",
"account.payment.further_payments.heading": "Further Saved Payment Instruments",
"account.payment.no_entries": "Currently, you do not have any saved payment instruments.",
"account.payment.preferred.link": "Save as Preferred Payment Instrument"
"account.payment.preferred.link": "Save as Preferred Payment Instrument",
"basket.add_quotelineitem.error": "The quote cannot be added to the shopping cart. It contains invalid products.",
"quote.already_in_basket.error": "The quote is already in the cart.",
"quote.not_found.error": "The quote could not be found.",
"basket.add_quote.error": "The quote could not be added to the cart."
}
6 changes: 5 additions & 1 deletion src/assets/i18n/fr_FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -2665,5 +2665,9 @@
"account.login.register_now": "Vous n’avez pas encore de compte??<br/><a href=\"{{0}}\">Enregistrez-vous maintenant</a>",
"account.payment.further_payments.heading": "Autres instruments de paiement sauvegardés",
"account.payment.no_entries": "Actuellement, vous n’avez aucun instrument de paiement sauvegardé.",
"account.payment.preferred.link": "Enregistrer comme instrument de paiement par défaut"
"account.payment.preferred.link": "Enregistrer comme instrument de paiement par défaut",
"basket.add_quotelineitem.error": "Le devis ne peut pas être ajouté au panier. Il contient des produits non valides.",
"quote.already_in_basket.error": "Le devis se trouve déjà dans le panier.",
"quote.not_found.error": "Le devis n’a pas pu être trouvé.",
"basket.add_quote.error": "Le devis n’a pas pu être ajouté au panier."
}

0 comments on commit 0c9a943

Please sign in to comment.