diff --git a/feature-libs/quote/assets/translations/en/quote.i18n.ts b/feature-libs/quote/assets/translations/en/quote.i18n.ts index f7d1dada00a..29bbb354ed2 100644 --- a/feature-libs/quote/assets/translations/en/quote.i18n.ts +++ b/feature-libs/quote/assets/translations/en/quote.i18n.ts @@ -6,153 +6,127 @@ export const quote = { quote: { - list: { - name: 'Name', - updated: 'Updated', - sortBy: 'Sort by', - sortOrders: 'Sort orders', - empty: 'We have no quote records for this account.', - }, - states: { - BUYER_DRAFT: 'Draft', - BUYER_SUBMITTED: 'Submitted', - BUYER_ACCEPTED: 'Accepted', - BUYER_APPROVED: 'Approved', - BUYER_REJECTED: 'Rejected', - BUYER_OFFER: 'Vendor Quote', - BUYER_ORDERED: 'Ordered', - SELLER_DRAFT: 'Draft', - SELLER_REQUEST: 'Requested', - SELLER_SUBMITTED: 'Submitted', - SELLERAPPROVER_DRAFT: 'Draft', - SELLERAPPROVER_PENDING: 'Pending Approval', - SELLERAPPROVER_APPROVED: 'Approved', - SELLERAPPROVER_REJECTED: 'Rejected', - CREATED: 'Created', - CANCELLED: 'Cancelled', - EXPIRED: 'Expired', - }, actions: { - VIEW: 'View Quote', - SUBMIT: 'Submit Quote', - SAVE: 'Save Quote', - EDIT: 'Edit Quote', - CANCEL: 'Cancel Quote', - CHECKOUT: 'Accept and Checkout', - APPROVE: 'Approve Quote', - REJECT: 'Reject Quote', - REQUOTE: 'Request new Quote', - }, - commons: { - id: 'Quote ID', - status: 'Status', - creationSuccess: 'Quote #{{ code }} created successfully', - cart: 'Cart', - }, - seller: { - apply: 'Apply', - placeholder: '0', - discount: 'Discount', - expiryDate: 'Expiry Date', - discountValidationText: 'Enter a valid absolute discount', + byRole: { + VIEW: 'View Quote', + SUBMIT: 'Submit Quote', + SAVE: 'Save Quote', + EDIT: 'Edit Quote', + CANCEL: 'Cancel Quote', + CHECKOUT: 'Accept and Checkout', + APPROVE: 'Approve Quote', + REJECT: 'Reject Quote', + REQUOTE: 'Request new Quote', + }, + link: { + newCart: 'New Cart', + quotes: 'Quotes', + }, + confirmDialog: { + name: 'Name:', + description: 'Description:', + validity: 'This quote is valid until {{ expirationTime }}', + option: { yes: 'Yes', no: 'No' }, + buyer: { + submit: { + title: 'Submit Quote Request {{ code }}?', + confirmNote: 'Are you sure you want to submit this quote request?', + successMessage: 'Quote request submitted successfully', + }, + cancel: { + title: 'Cancel Quote Request {{ code }}?', + confirmNote: 'Are you sure you want to cancel this quote request', + successMessage: 'Quote request cancelled', + }, + }, + buyer_offer: { + edit: { + title: 'Confirm Edit Quote {{ code }}?', + confirmNote: 'Are you sure you want to edit this approved quote?', + warningNote: + 'This Quote has been Approved. Editing this Quote will prevent Checkout until new edits are approved.', + }, + cancel: { + title: 'Cancel Quote {{ code }}?', + confirmNote: 'Are you sure you want to cancel this quote?', + successMessage: 'Quote cancelled', + }, + checkout: { + title: 'Checkout Quote {{ code }}?', + confirmNote: + 'Are you sure you want to accept and checkout this quote?', + }, + }, + expired: { + edit: { + title: 'Confirm Edit Quote {{ code }}?', + confirmNote: 'Are you sure you want to edit this expired quote?', + warningNote: + 'This Quote is expired. Editing this quote will prevent checkout until new edits are approved.', + }, + requote: { + title: 'Recreate Quote Request {{ code }}?', + confirmNote: + 'Are you sure you want to recreate this quote request?', + warningNote: + 'This Quote is expired. Re-quoting it will create a new quote request with same contents, which can be edited and submitted for approval afterwards.', + }, + }, + seller: { + submit: { + title: 'Submit Quote {{ code }}?', + confirmNote: 'Are you sure you want to submit this quote?', + warningNote: + 'Depending on the total value of the quote, an additional approval might be required before the buyer can check out this quote.', + successMessage: 'Quote submitted successfully', + }, + }, + approver: { + approve: { + title: 'Approve Quote {{ code }}?', + confirmNote: 'Are you sure you want to approve this quote?', + successMessage: 'Quote approved successfully', + }, + reject: { + title: 'Reject Quote {{ code }}?', + confirmNote: 'Are you sure you want to reject this quote?', + successMessage: 'Quote rejected', + }, + }, + }, }, comments: { title: 'Contact', invalidComment: 'Invalid Input - Please type again...', allProducts: 'All Products', }, - details: { - information: 'Quote Information', - code: 'Quote ID', - name: 'Name', - created: 'Created', - lastUpdated: 'Last Updated', - estimatedTotal: 'Estimated Total', - total: 'Total', - description: 'Description', - estimateAndDate: 'Estimated & Date', - update: 'Update', - expirationTime: 'Expiry Date', - charactersLeft: 'characters left: {{count}}', - }, - links: { - newCart: 'New Cart', - quotes: 'Quotes', - }, - request: { + commons: { + requestQuote: 'Request Quote', + cart: 'Cart', minRequestInitiationNote: 'Minimum ${{minValue}} subtotal is required to submit a quote ', - requestQuote: 'Request Quote', }, - confirmActionDialog: { - name: 'Name:', - description: 'Description:', - validity: 'This quote is valid until {{ expirationTime }}', - confirmActionOption: { yes: 'Yes', no: 'No' }, - buyer: { - submit: { - title: 'Submit Quote Request {{ code }}?', - confirmNote: 'Are you sure you want to submit this quote request?', - successMessage: 'Quote request submitted successfully', - }, - cancel: { - title: 'Cancel Quote Request {{ code }}?', - confirmNote: 'Are you sure you want to cancel this quote request', - successMessage: 'Quote request cancelled', - }, + header: { + overview: { + id: 'Quote ID', + status: 'Status', + information: 'Quote Information', + name: 'Name', + created: 'Created', + lastUpdated: 'Last Updated', + estimatedTotal: 'Estimated Total', + total: 'Total', + description: 'Description', + estimateAndDate: 'Estimated & Date', + update: 'Update', + expirationTime: 'Expiry Date', + charactersLeft: 'characters left: {{count}}', }, - buyer_offer: { - edit: { - title: 'Confirm Edit Quote {{ code }}?', - confirmNote: 'Are you sure you want to edit this approved quote?', - warningNote: - 'This Quote has been Approved. Editing this Quote will prevent Checkout until new edits are approved.', - }, - cancel: { - title: 'Cancel Quote {{ code }}?', - confirmNote: 'Are you sure you want to cancel this quote?', - successMessage: 'Quote cancelled', - }, - checkout: { - title: 'Checkout Quote {{ code }}?', - confirmNote: - 'Are you sure you want to accept and checkout this quote?', - }, - }, - expired: { - edit: { - title: 'Confirm Edit Quote {{ code }}?', - confirmNote: 'Are you sure you want to edit this expired quote?', - warningNote: - 'This Quote is expired. Editing this quote will prevent checkout until new edits are approved.', - }, - requote: { - title: 'Recreate Quote Request {{ code }}?', - confirmNote: 'Are you sure you want to recreate this quote request?', - warningNote: - 'This Quote is expired. Re-quoting it will create a new quote request with same contents, which can be edited and submitted for approval afterwards.', - }, - }, - seller: { - submit: { - title: 'Submit Quote {{ code }}?', - confirmNote: 'Are you sure you want to submit this quote?', - warningNote: - 'Depending on the total value of the quote, an additional approval might be required before the buyer can check out this quote.', - successMessage: 'Quote submitted successfully', - }, - }, - approver: { - approve: { - title: 'Approve Quote {{ code }}?', - confirmNote: 'Are you sure you want to approve this quote?', - successMessage: 'Quote approved successfully', - }, - reject: { - title: 'Reject Quote {{ code }}?', - confirmNote: 'Are you sure you want to reject this quote?', - successMessage: 'Quote rejected', - }, + sellerEdit: { + apply: 'Apply', + discount: 'Discount', + expiryDate: 'Expiry Date', + discountValidationText: 'Enter a valid absolute discount', }, }, httpHandlers: { @@ -170,5 +144,31 @@ export const quote = { expired: 'This quote has expired. You must resubmit your quote request to receive another vendor quote.', }, + list: { + name: 'Name', + updated: 'Updated', + sortBy: 'Sort by', + sortOrders: 'Sort orders', + empty: 'We have no quote records for this account.', + }, + states: { + BUYER_DRAFT: 'Draft', + BUYER_SUBMITTED: 'Submitted', + BUYER_ACCEPTED: 'Accepted', + BUYER_APPROVED: 'Approved', + BUYER_REJECTED: 'Rejected', + BUYER_OFFER: 'Vendor Quote', + BUYER_ORDERED: 'Ordered', + SELLER_DRAFT: 'Draft', + SELLER_REQUEST: 'Requested', + SELLER_SUBMITTED: 'Submitted', + SELLERAPPROVER_DRAFT: 'Draft', + SELLERAPPROVER_PENDING: 'Pending Approval', + SELLERAPPROVER_APPROVED: 'Approved', + SELLERAPPROVER_REJECTED: 'Rejected', + CREATED: 'Created', + CANCELLED: 'Cancelled', + EXPIRED: 'Expired', + }, }, }; diff --git a/feature-libs/quote/components/actions/by-role/quote-actions-by-role.component.html b/feature-libs/quote/components/actions/by-role/quote-actions-by-role.component.html index 8f82597cb5c..7039404a6b8 100644 --- a/feature-libs/quote/components/actions/by-role/quote-actions-by-role.component.html +++ b/feature-libs/quote/components/actions/by-role/quote-actions-by-role.component.html @@ -9,7 +9,7 @@ [disabled]="mustDisableAction(action.type, quoteDetails)" (click)="onClick(action.type, quoteDetails)" > - {{ 'quote.actions.' + action.type | cxTranslate }} + {{ 'quote.actions.byRole.' + action.type | cxTranslate }} diff --git a/feature-libs/quote/components/actions/by-role/quote-actions-by-role.component.spec.ts b/feature-libs/quote/components/actions/by-role/quote-actions-by-role.component.spec.ts index c4b0533d2ff..adc783bfb0b 100644 --- a/feature-libs/quote/components/actions/by-role/quote-actions-by-role.component.spec.ts +++ b/feature-libs/quote/components/actions/by-role/quote-actions-by-role.component.spec.ts @@ -50,7 +50,7 @@ const mockQuote: Quote = { const testMappings: ConfirmActionDialogMappingConfig = { BUYER_OFFER: { EDIT: { - i18nKey: 'quote.confirmActionDialog.buyer_offer.edit', + i18nKey: 'quote.actions.confirmDialog.buyer_offer.edit', showWarningNote: true, showExpirationDate: true, showSuccessMessage: false, @@ -58,7 +58,7 @@ const testMappings: ConfirmActionDialogMappingConfig = { }, BUYER: { SUBMIT: { - i18nKey: 'quote.confirmActionDialog.buyer.submit', + i18nKey: 'quote.actions.confirmDialog.buyer.submit', showWarningNote: false, showExpirationDate: false, showSuccessMessage: true, @@ -66,7 +66,7 @@ const testMappings: ConfirmActionDialogMappingConfig = { }, EXPIRED: { REQUOTE: { - i18nKey: 'quote.confirmActionDialog.expired.requote', + i18nKey: 'quote.actions.confirmDialog.expired.requote', showWarningNote: true, showExpirationDate: false, showSuccessMessage: false, @@ -201,9 +201,9 @@ describe('QuoteActionsByRoleComponent', () => { }; const confirmationContextForSubmitAction: ConfirmationContext = { quote: quoteForSubmitAction, - title: 'quote.confirmActionDialog.buyer.submit.title', - confirmNote: 'quote.confirmActionDialog.buyer.submit.confirmNote', - successMessage: 'quote.confirmActionDialog.buyer.submit.successMessage', + title: 'quote.actions.confirmDialog.buyer.submit.title', + confirmNote: 'quote.actions.confirmDialog.buyer.submit.confirmNote', + successMessage: 'quote.actions.confirmDialog.buyer.submit.successMessage', }; mockQuoteDetails$.next(quoteForSubmitAction); fixture.detectChanges(); @@ -229,10 +229,10 @@ describe('QuoteActionsByRoleComponent', () => { }; const confirmationContextForEditAction: ConfirmationContext = { quote: quoteInBuyerOfferState, - title: 'quote.confirmActionDialog.buyer_offer.edit.title', - confirmNote: 'quote.confirmActionDialog.buyer_offer.edit.confirmNote', - warningNote: 'quote.confirmActionDialog.buyer_offer.edit.warningNote', - validity: 'quote.confirmActionDialog.validity', + title: 'quote.actions.confirmDialog.buyer_offer.edit.title', + confirmNote: 'quote.actions.confirmDialog.buyer_offer.edit.confirmNote', + warningNote: 'quote.actions.confirmDialog.buyer_offer.edit.warningNote', + validity: 'quote.actions.confirmDialog.validity', }; mockQuoteDetails$.next(quoteInBuyerOfferState); fixture.detectChanges(); @@ -271,9 +271,9 @@ describe('QuoteActionsByRoleComponent', () => { }; const confirmationContextForRequoteAction: ConfirmationContext = { quote: expiredQuote, - title: 'quote.confirmActionDialog.expired.requote.title', - confirmNote: 'quote.confirmActionDialog.expired.requote.confirmNote', - warningNote: 'quote.confirmActionDialog.expired.requote.warningNote', + title: 'quote.actions.confirmDialog.expired.requote.title', + confirmNote: 'quote.actions.confirmDialog.expired.requote.confirmNote', + warningNote: 'quote.actions.confirmDialog.expired.requote.warningNote', }; mockQuoteDetails$.next(expiredQuote); fixture.detectChanges(); @@ -473,7 +473,7 @@ describe('QuoteActionsByRoleComponent', () => { QuoteState.BUYER_OFFER ) ).toEqual({ - i18nKey: 'quote.confirmActionDialog.buyer_offer.edit', + i18nKey: 'quote.actions.confirmDialog.buyer_offer.edit', showWarningNote: true, showExpirationDate: true, showSuccessMessage: false, diff --git a/feature-libs/quote/components/actions/by-role/quote-actions-by-role.component.ts b/feature-libs/quote/components/actions/by-role/quote-actions-by-role.component.ts index dd44b00a551..ed078e13e72 100644 --- a/feature-libs/quote/components/actions/by-role/quote-actions-by-role.component.ts +++ b/feature-libs/quote/components/actions/by-role/quote-actions-by-role.component.ts @@ -58,7 +58,7 @@ export class QuoteActionsByRoleComponent implements OnInit, OnDestroy { if (mustDisableAction) { this.globalMessageService.add( { - key: 'quote.request.minRequestInitiationNote', + key: 'quote.commons.minRequestInitiationNote', params: { minValue: quote.threshold, }, @@ -181,7 +181,7 @@ export class QuoteActionsByRoleComponent implements OnInit, OnDestroy { confirmationContext.warningNote = dialogConfig.i18nKey + '.warningNote'; } if (dialogConfig.showExpirationDate) { - confirmationContext.validity = 'quote.confirmActionDialog.validity'; + confirmationContext.validity = 'quote.actions.confirmDialog.validity'; } if (dialogConfig.showSuccessMessage) { confirmationContext.successMessage = diff --git a/feature-libs/quote/components/actions/confirm-dialog/quote-actions-confirm-dialog.component.html b/feature-libs/quote/components/actions/confirm-dialog/quote-actions-confirm-dialog.component.html index e98f2a24c3b..411671c7076 100644 --- a/feature-libs/quote/components/actions/confirm-dialog/quote-actions-confirm-dialog.component.html +++ b/feature-libs/quote/components/actions/confirm-dialog/quote-actions-confirm-dialog.component.html @@ -33,7 +33,7 @@