Skip to content

Commit

Permalink
feat: fix seller submit (CXSPA-4748) (#17855)
Browse files Browse the repository at this point in the history
  • Loading branch information
Uli-Tiger authored Sep 22, 2023
1 parent 5f28469 commit 4409b78
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
9 changes: 5 additions & 4 deletions feature-libs/quote/assets/translations/en/quote.i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,11 @@ export const quote = {
},
seller: {
submit: {
title: 'Submit Quote {{ code }} for approval?',
confirmNote:
'Are you sure you want to submit this quote for approval?',
successMessage: 'Quote submitted for approval successfully',
title: 'Submit Quote {{ code }}?',
confirmNote: 'Are you sure you want to submit this quote?',
warningNote:
'Based on the total value of the quote an additional approval might be required, before the buyer can checkout this quote.',
successMessage: 'Quote submitted successfully',
},
},
approver: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const defaultDialogMappings: ConfirmActionDialogMappingConfig = {
SUBMIT: {
i18nKey: 'quote.confirmActionDialog.seller.submit',
...defaultConfirmActionDialogConfig,
showWarningNote: true,
},
},
SELLERAPPROVER: {
Expand Down
6 changes: 5 additions & 1 deletion feature-libs/quote/core/facade/quote.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -419,13 +419,17 @@ describe('QuoteService', () => {
});

describe('on submit', () => {
it('should create new cart and navigate to quote list', (done) => {
it('should create new cart and navigate to quote list, but not reload', (done) => {
service
.performQuoteAction(quote, QuoteActionType.SUBMIT)
.subscribe(() => {
expect(
cartUtilsService.createNewCartAndGoToQuoteList
).toHaveBeenCalled();
expect(eventService.dispatch).not.toHaveBeenCalledWith(
{},
QuoteDetailsReloadQueryEvent
);
done();
});
});
Expand Down
2 changes: 1 addition & 1 deletion feature-libs/quote/core/facade/quote.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ export class QuoteService implements QuoteFacade {
payload.quoteAction === QuoteActionType.CANCEL
) {
this.cartUtilsService.createNewCartAndGoToQuoteList();
this.triggerReloadAndCompleteAction();
this.isActionPerforming$.next(false);
}
if (
payload.quoteAction === QuoteActionType.EDIT ||
Expand Down

0 comments on commit 4409b78

Please sign in to comment.